diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index e5b9bed..3ab6078 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -1,305 +1,324 @@ class ProjectsController < ApplicationController - before_filter :get_plan_list_columns, only: %i( index ) + before_filter :get_plan_list_columns, only: %i( index ) after_action :verify_authorized - # GET /projects - # GET /projects.json - def index + # GET /projects + # GET /projects.json + def index authorize Project ## TODO: Is this A magic String? the "Show_shib_link?" as we define it and users dont see cookies - if user_signed_in? then - if (current_user.shibboleth_id.nil? || current_user.shibboleth_id.length == 0) && !cookies[:show_shib_link].nil? && cookies[:show_shib_link] == "show_shib_link" then - flash.notice = "Would you like to #{view_context.link_to I18n.t('helpers.shibboleth_to_link_text'), user_omniauth_shibboleth_path}".html_safe - end + if user_signed_in? then + if (current_user.shibboleth_id.nil? || current_user.shibboleth_id.length == 0) && !cookies[:show_shib_link].nil? && cookies[:show_shib_link] == "show_shib_link" then + flash.notice = "Would you like to #{view_context.link_to I18n.t('helpers.shibboleth_to_link_text'), user_omniauth_shibboleth_path}".html_safe + end - @projects = current_user.projects.filter(params[:filter]) - @has_projects = current_user.projects.any? # unfiltered count + @projects = current_user.projects.filter(params[:filter]) + @has_projects = current_user.projects.any? # unfiltered count - respond_to do |format| - format.html # index.html.erb - end - else - respond_to do |format| - format.html { redirect_to edit_user_registration_path } - end - end - end + respond_to do |format| + format.html # index.html.erb + end + else + respond_to do |format| + format.html { redirect_to edit_user_registration_path } + end + end + end - # GET /projects/1 - # GET /projects/1.json - def show - @project = Project.find(params[:id]) + # GET /projects/1 + # GET /projects/1.json + def show + @project = Project.find(params[:id]) authorize @project - @show_form = false - if params[:show_form] == "yes" then - @show_form = true - end - if user_signed_in? && @project.readable_by(current_user.id) then - respond_to do |format| - format.html # show.html.erb - end - elsif user_signed_in? then - respond_to do |format| - format.html { redirect_to projects_url, notice: I18n.t('helpers.settings.plans.errors.no_access_account') } - end - else - respond_to do |format| - format.html { redirect_to edit_user_registration_path } - end - end - end + @show_form = false + if params[:show_form] == "yes" then + @show_form = true + end + if user_signed_in? && @project.readable_by(current_user.id) then + respond_to do |format| + format.html # show.html.erb + end + elsif user_signed_in? then + respond_to do |format| + format.html { redirect_to projects_url, notice: I18n.t('helpers.settings.plans.errors.no_access_account') } + end + else + respond_to do |format| + format.html { redirect_to edit_user_registration_path } + end + end + end - # GET /projects/new - # GET /projects/new.json - def new - if user_signed_in? then - @project = Project.new + # GET /projects/new + # GET /projects/new.json + def new + if user_signed_in? then + @project = Project.new authorize @project - @project.organisation = current_user.organisation - @funders = orgs_of_type(constant("organisation_types.funder"), true) + @project.organisation = current_user.organisation + @funders = orgs_of_type(constant("organisation_types.funder"), true) @templates = get_available_templates @guidance_groups = get_available_guidance @always_guidance = get_always_available_guidance @institutions = orgs_of_type(constant("organisation_types.institution")) - respond_to do |format| - format.html # new.html.erb - end - else - respond_to do |format| - format.html { redirect_to edit_user_registration_path } - end - end - end + respond_to do |format| + format.html # new.html.erb + end + else + respond_to do |format| + format.html { redirect_to edit_user_registration_path } + end + end + end - # GET /projects/1/edit + # GET /projects/1/edit # Should this be removed? - def edit - @project = Project.find(params[:id]) + def edit + @project = Project.find(params[:id]) authorize @project - if !user_signed_in? then + if !user_signed_in? then respond_to do |format| - format.html { redirect_to edit_user_registration_path } - end - elsif !@project.editable_by(current_user.id) then - respond_to do |format| - format.html { redirect_to projects_url, notice: I18n.t('helpers.settings.plans.errors.no_access_account') } - end - end - end + format.html { redirect_to edit_user_registration_path } + end + elsif !@project.editable_by(current_user.id) then + respond_to do |format| + format.html { redirect_to projects_url, notice: I18n.t('helpers.settings.plans.errors.no_access_account') } + end + end + end - def share - @project = Project.find(params[:id]) + def share + @project = Project.find(params[:id]) authorize @project - if !user_signed_in? then + if !user_signed_in? then respond_to do |format| - format.html { redirect_to edit_user_registration_path } - end - elsif !@project.editable_by(current_user.id) then - respond_to do |format| - format.html { redirect_to projects_url, notice: I18n.t('helpers.settings.plans.errors.no_access_account') } - end - end - end + format.html { redirect_to edit_user_registration_path } + end + elsif !@project.editable_by(current_user.id) then + respond_to do |format| + format.html { redirect_to projects_url, notice: I18n.t('helpers.settings.plans.errors.no_access_account') } + end + end + end - def export - @project = Project.find(params[:id]) + def export + @project = Project.find(params[:id]) authorize @project - if !user_signed_in? then + if !user_signed_in? then respond_to do |format| - format.html { redirect_to edit_user_registration_path } - end - else - respond_to do |format| - format.html { render action: "export" } + format.html { redirect_to edit_user_registration_path } + end + else + respond_to do |format| + format.html { render action: "export" } - end - end - end + end + end + end - # POST /projects - # POST /projects.json - def create - if user_signed_in? then - @project = Project.new(params[:project]) + # POST /projects + # POST /projects.json + def create + if user_signed_in? then + + attrs = project_params + + @project = Project.new(attrs) authorize @project - if @project.dmptemplate.nil? && params[:project][:funder_id] != "" then # this shouldn't be necessary - see setter for funder_id in project.rb - funder = Organisation.find(params[:project][:funder_id]) - if funder.dmptemplates.count == 1 then - @project.dmptemplate = funder.published_templates.first - end - elsif @project.dmptemplate.nil? || params[:default_tag] == 'true' then - if @project.organisation.nil? || params[:default_tag] == 'true' || @project.organisation.published_templates.first.nil? then - @project.dmptemplate = Dmptemplate.find_by_is_default(true) - else - @project.dmptemplate = @project.organisation.published_templates.first - end - end - @project.principal_investigator = current_user.name(false) + + if @project.dmptemplate.nil? && attrs[:funder_id] != "" then # this shouldn't be necessary - see setter for funder_id in project.rb + funder = Organisation.find(attrs[:funder_id]) + if funder.dmptemplates.count == 1 then + @project.dmptemplate = funder.published_templates.first + end + + elsif @project.dmptemplate.nil? || params[:default_tag] == 'true' then + if @project.organisation.nil? || params[:default_tag] == 'true' || @project.organisation.published_templates.first.nil? then + @project.dmptemplate = Dmptemplate.find_by_is_default(true) + else + @project.dmptemplate = @project.organisation.published_templates.first + end + end + + @project.principal_investigator = current_user.name(false) - @project.title = I18n.t('helpers.project.my_project_name')+' ('+@project.dmptemplate.title+')' - @project.assign_creator(current_user.id) - respond_to do |format| - if @project.save - format.html { redirect_to({:action => "show", :id => @project.slug, :show_form => "yes"}, {:notice => I18n.t('helpers.project.success')}) } - else - format.html { render action: "new" } - end - end - else - render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false) - end - end + @project.title = I18n.t('helpers.project.my_project_name')+' ('+@project.dmptemplate.title+')' + @project.assign_creator(current_user.id) + + respond_to do |format| + if @project.save + format.html { redirect_to({:action => "show", :id => @project.slug, :show_form => "yes"}, {:notice => I18n.t('helpers.project.success')}) } + else + format.html { render action: "new" } + end + end + + else + render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false) + end + end - # PUT /projects/1 - # PUT /projects/1.json - def update - @project = Project.find(params[:id]) + # PUT /projects/1 + # PUT /projects/1.json + def update + @project = Project.find(params[:id]) authorize @project - if user_signed_in? && @project.editable_by(current_user.id) then - if @project.update_attributes(params[:project]) + + if user_signed_in? && @project.editable_by(current_user.id) then + attrs = project_params + + if @project.update_attributes(attrs) respond_to do |format| - format.html { redirect_to({:action => "show", :id => @project.slug, notice: I18n.t('helpers.project.success_update') }) } + format.html { redirect_to({:action => "show", :id => @project.slug, notice: I18n.t('helpers.project.success_update') }) } end else respond_to do |format| - format.html { render action: "edit" } - end - end - else - render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false) - end - end + format.html { render action: "edit" } + end + end + else + render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false) + end + end - # DELETE /projects/1 - # DELETE /projects/1.json - def destroy - @project = Project.find(params[:id]) + # DELETE /projects/1 + # DELETE /projects/1.json + def destroy + @project = Project.find(params[:id]) authorize @project - if user_signed_in? && @project.editable_by(current_user.id) then - @project.destroy + if user_signed_in? && @project.editable_by(current_user.id) then + @project.destroy - respond_to do |format| - format.html { redirect_to projects_url } - end - else - render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false) - end - end + respond_to do |format| + format.html { redirect_to projects_url } + end + else + render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false) + end + end # returns to AJAX call from frontend # difficult to secure as it passes through params, and dosent curate data based # on what the user can "view" or is public - # GET /projects/possible_templates.json - def possible_templates - if !params[:funder].nil? && params[:funder] != "" && params[:funder] != "undefined" then - funder = Organisation.find(params[:funder]) - else - funder = nil - end - if !params[:institution].nil? && params[:institution] != "" && params[:institution] != "undefined" then - institution = Organisation.find(params[:institution]) - else - institution = nil - end - templates = {} - unless funder.nil? then - funder.published_templates.each do |t| - templates[t.id] = t.title - end - end - if templates.count == 0 && !institution.nil? then - institution.published_templates.each do |t| - templates[t.id] = t.title - end - institution.children.each do |o| - o.published_templates.each do |t| - templates[t.id] = t.title - end - end - end - respond_to do |format| - format.json { render json: templates.to_json } - end - end + # GET /projects/possible_templates.json + def possible_templates + if !params[:funder].nil? && params[:funder] != "" && params[:funder] != "undefined" then + funder = Organisation.find(params[:funder]) + else + funder = nil + end + if !params[:institution].nil? && params[:institution] != "" && params[:institution] != "undefined" then + institution = Organisation.find(params[:institution]) + else + institution = nil + end + templates = {} + unless funder.nil? then + funder.published_templates.each do |t| + templates[t.id] = t.title + end + end + if templates.count == 0 && !institution.nil? then + institution.published_templates.each do |t| + templates[t.id] = t.title + end + institution.children.each do |o| + o.published_templates.each do |t| + templates[t.id] = t.title + end + end + end + respond_to do |format| + format.json { render json: templates.to_json } + end + end # returns to AJAX call from frontend - # difficult to secure as it passes through params, and dosent curate data based + # difficult to secure as it passes through params, and dosent curate data based # on what the user can "view" or is public def possible_guidance authorize @project - if !params[:template].nil? && params[:template] != "" && params[:template] != "undefined" then - template = Dmptemplate.find(params[:template]) - else - template = nil - end - if !params[:institution].nil? && params[:institution] != "" && params[:institution] != "undefined" then - institution = Organisation.find(params[:institution]) - else - institution = nil - end - excluded_orgs = orgs_of_type(constant("organisation_types.funder")) + orgs_of_type(constant("organisation_types.institution")) + Organisation.orgs_with_parent_of_type(constant("organisation_types.institution")) - guidance_groups = {} - ggs = GuidanceGroup.guidance_groups_excluding(excluded_orgs) + if !params[:template].nil? && params[:template] != "" && params[:template] != "undefined" then + template = Dmptemplate.find(params[:template]) + else + template = nil + end + if !params[:institution].nil? && params[:institution] != "" && params[:institution] != "undefined" then + institution = Organisation.find(params[:institution]) + else + institution = nil + end + excluded_orgs = orgs_of_type(constant("organisation_types.funder")) + orgs_of_type(constant("organisation_types.institution")) + Organisation.orgs_with_parent_of_type(constant("organisation_types.institution")) + guidance_groups = {} + ggs = GuidanceGroup.guidance_groups_excluding(excluded_orgs) - ggs.each do |gg| - guidance_groups[gg.id] = gg.name - end + ggs.each do |gg| + guidance_groups[gg.id] = gg.name + end #subset guidance that belong to the institution - unless institution.nil? then + unless institution.nil? then authorize Project - optional_gg = GuidanceGroup.where("optional_subset = ? AND organisation_id = ?", true, institution.id) - optional_gg.each do|optional| - guidance_groups[optional.id] = optional.name - end + optional_gg = GuidanceGroup.where("optional_subset = ? AND organisation_id = ?", true, institution.id) + optional_gg.each do|optional| + guidance_groups[optional.id] = optional.name + end - institution.children.each do |o| - o.guidance_groups.each do |gg| - include = false - gg.guidances.each do |g| - if g.dmptemplate.nil? || g.dmptemplate_id == template.id then - include = true - break - end - end - if include then - guidance_groups[gg.id] = gg.name - end - end - end - end + institution.children.each do |o| + o.guidance_groups.each do |gg| + include = false + gg.guidances.each do |g| + if g.dmptemplate.nil? || g.dmptemplate_id == template.id then + include = true + break + end + end + if include then + guidance_groups[gg.id] = gg.name + end + end + end + end #If template belongs to a funder and that funder has subset guidance display then. if !template.nil? && template.organisation.organisation_type.name == constant("organisation_types.funder") then optional_gg = GuidanceGroup.where("optional_subset = ? AND organisation_id = ?", true, template.organisation_id) - optional_gg.each do|optional| - guidance_groups[optional.id] = optional.name - end + optional_gg.each do|optional| + guidance_groups[optional.id] = optional.name + end end - respond_to do |format| - format.json { render json: guidance_groups.to_json } - end - end + respond_to do |format| + format.json { render json: guidance_groups.to_json } + end + end - private - def orgs_of_type(org_type_name, published_templates = false) - org_type = OrganisationType.find_by_name(org_type_name) - all_such_orgs = org_type.organisations - if published_templates then - with_published = Array.new - all_such_orgs.each do |o| - if o.published_templates.count > 0 then - with_published << o - end - end - return with_published.sort_by {|o| [o.sort_name, o.name] } - else - return all_such_orgs.sort_by {|o| [o.sort_name, o.name] } - end - end + private + def project_params + params.require(:project).permit(:title, :grant_number, :identifier, :description, + :principal_investigator, :principal_investigator_identifier, + :data_contact, :funder_name, :visibility, + :dmptemplate_id, :organisation_id, :funder_id, :institution_id, + :guidance_group_ids, :project_group_ids) + end + + def orgs_of_type(org_type_name, published_templates = false) + org_type = OrganisationType.find_by_name(org_type_name) + all_such_orgs = org_type.organisations + if published_templates then + with_published = Array.new + all_such_orgs.each do |o| + if o.published_templates.count > 0 then + with_published << o + end + end + return with_published.sort_by {|o| [o.sort_name, o.name] } + else + return all_such_orgs.sort_by {|o| [o.sort_name, o.name] } + end + end # ----------------------------------------------------------- def get_available_templates @@ -315,7 +334,7 @@ # ----------------------------------------------------------- def get_always_available_guidance # Exclude Funders, Institutions, or children of Institutions - excluded_orgs = orgs_of_type(constant("organisation_types.funder")) + + excluded_orgs = orgs_of_type(constant("organisation_types.funder")) + orgs_of_type(constant("organisation_types.institution")) + Organisation.orgs_with_parent_of_type(constant("organisation_types.institution")) diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 8408cfe..feaf769 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -15,4 +15,63 @@ def roadmap end + # GET /projects/publicly_available + # ----------------------------------------------------------- + def public_plans + @projects = Project.publicly_visible.order(title: :asc) + end + + # GET /projects/[:project_slug]/public_export + # ------------------------------------------------------------- + def public_export + @project = Project.find(params[:id]) + + # Force PDF response + request.format = :pdf + + # if the project is designated as public + if @project.visibility == :publicly_visible + @plan = @project.plans.first + + if !@plan.nil? + @exported_plan = ExportedPlan.new.tap do |ep| + ep.plan = @plan + ep.user = current_user ||= nil + #ep.format = request.format.try(:symbol) + ep.format = request.format.to_sym + plan_settings = @plan.settings(:export) + + Settings::Dmptemplate::DEFAULT_SETTINGS.each do |key, value| + ep.settings(:export).send("#{key}=", plan_settings.send(key)) + end + end + + @exported_plan.save! # FIXME: handle invalid request types without erroring? + file_name = @exported_plan.project_name + + respond_to do |format| + format.pdf do + @formatting = @plan.settings(:export).formatting + render pdf: file_name, + margin: @formatting[:margin], + footer: { + center: t('helpers.plan.export.pdf.generated_by'), + font_size: 8, + spacing: (@formatting[:margin][:bottom] / 2) - 4, + right: '[page] of [topage]' + } + end + end + + else + # the project has no plans for some reason + redirect_to public_plans_path, notice: I18n.t('helpers.settings.projects.errors.no_plan') + end + + else + # Otherwise redirect to the home page with an unauthorized message + redirect_to public_plans_path, notice: I18n.t('helpers.settings.plans.errors.no_access_account') + end + end + end \ No newline at end of file diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 4679053..84c458d 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -44,10 +44,18 @@ shared_num = project.project_groups.count - 1 text = shared_num > 0 ? (t("helpers.yes_label") + " (with #{shared_num} people) ") : t("helpers.no_label") [ "dmp_td_small", text ] + when 'visibility' + ["dmp_td_small", (project.visibility.nil? ? I18n.t("helpers.project.visibilities.labels.organisationally_visible") : I18n.t("helpers.project.visibilities.labels.#{project.visibility}"))] when 'last_edited' [ "dmp_td_small", l(project.latest_update.to_date, formats: :short) ] when 'description' [ "dmp_td_medium", (project.try(col) || "Unknown") ] + when 'non_link_name' + [ "dmp_td_big", project.title ] + when 'template' + ["dmp_td_big", project.dmptemplate.title] + when 'organisation' + ["dmp_td_medium", (project.organisation.nil? ? project.owner.organisation.name : project.organisation.name)] else [ "dmp_td_small", (project.try(col) || "Unknown") ] end diff --git a/app/models/project.rb b/app/models/project.rb index f205429..2b326b6 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -3,11 +3,6 @@ extend FriendlyId - attr_accessible :dmptemplate_id, :title, :organisation_id, :unit_id, :guidance_group_ids, - :project_group_ids, :funder_id, :institution_id, :grant_number, :identifier, - :description, :principal_investigator, :principal_investigator_identifier, - :data_contact, :funder_name, :as => [:default, :admin] - #associations between tables belongs_to :dmptemplate belongs_to :organisation @@ -17,6 +12,9 @@ friendly_id :title, use: [:slugged, :history, :finders] + # public is a Ruby keyword so using publicly + enum visibility: [:organisationally_visible, :publicly_visible, :is_test, :privately_visible] + ## # returns the title of the project # diff --git a/app/views/layouts/_navigation.html.erb b/app/views/layouts/_navigation.html.erb index e4a3c9f..c7b02b5 100644 --- a/app/views/layouts/_navigation.html.erb +++ b/app/views/layouts/_navigation.html.erb @@ -97,6 +97,16 @@ <% end %> <%= t("helpers.help_label") %> + + + <% if current_path == "/plans/public_plans" then %> +
- <%= t('helpers.project.project_details_text_html')%> -
-+ <%= t('helpers.project.project_details_text_html')%> +
+| <%= t('helpers.project.project_name') %> | -<%= @project.title %> | -
| <%= t('helpers.project.project_identifier') %> | -- <% if !@project.identifier.nil? && @project.identifier != "" then %> - <%= @project.identifier %> - <%else%> - - - <%end%> - | -
| <%= t('helpers.project.grant_title') %> | -- <% if !@project.grant_number.nil? && @project.grant_number!= "" then %> - <%= @project.grant_number %> - <%else%> - - - <%end%> - | -
| <%= t('helpers.project.principal_investigator') %> | -<% if !@project.principal_investigator.nil? && @project.principal_investigator != "" then %> - <%= @project.principal_investigator %> - <%else%> - - - <%end%> - | -
| <%= t('helpers.project.principal_investigator_id') %> | -- <%= @project.principal_investigator_identifier %> - | -
| <%= t('helpers.project.project_data_contact') %> | -<% if !@project.data_contact.nil? && @project.data_contact != "" then%> - <%= @project.data_contact %> - <%else%> - - - <%end%> - | -
| <%= t('helpers.desc') %> | -<% if !@project.description.nil? && @project.description != "" then%> - <%= @project.description %> - <%else%> - - - <%end%> - | -
- <%= raw t('helpers.project.project_details_editing_text_html')%> -
-| <%= t('helpers.project.project_name') %> | +<%= @project.title %> | +
| <%= t('helpers.project.project_identifier') %> | ++ <% if !@project.identifier.nil? && @project.identifier != "" then %> + <%= @project.identifier %> + <%else%> + - + <%end%> + | +
| <%= t('helpers.project.grant_title') %> | ++ <% if !@project.grant_number.nil? && @project.grant_number!= "" then %> + <%= @project.grant_number %> + <%else%> + - + <%end%> + | +
| <%= t('helpers.project.principal_investigator') %> | +<% if !@project.principal_investigator.nil? && @project.principal_investigator != "" then %> + <%= @project.principal_investigator %> + <%else%> + - + <%end%> + | +
| <%= t('helpers.project.principal_investigator_id') %> | ++ <%= @project.principal_investigator_identifier %> + | +
| <%= t('helpers.project.project_data_contact') %> | +<% if !@project.data_contact.nil? && @project.data_contact != "" then%> + <%= @project.data_contact %> + <%else%> + - + <%end%> + | +
| <%= t('helpers.desc') %> | +<% if !@project.description.nil? && @project.description != "" then%> + <%= @project.description %> + <%else%> + - + <%end%> + | +
| <%= t('helpers.project.visibility') %> | +<%= (@project.is_test? ? t("helpers.project.visibilities.help_texts.is_test") : (@project.organisationally_visible? ? t("helpers.project.visibilities.help_texts.organisationally_visible") : (@project.publicly_visible? ? t("helpers.project.visibilities.help_texts.publicly_visible") : (@project.privately_visible? ? t("helpers.project.visibilities.help_texts.privately_visible") : "Defaulting to: #{t("helpers.project.visibilities.help_texts.not_set")}")))) %> | +
+ <%= raw t('helpers.project.project_details_editing_text_html')%> +
+| <%= t('helpers.project.project_name') %> | -- <%= f.text_field :title, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.project_name_help_text') %> - | -
| <%= t('helpers.project.project_identifier') %> | -- <%= f.text_field :identifier, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.project_identifier_help_text') %> - | -
| <%= t('helpers.project.grant_title') %> | -- <%= f.text_field :grant_number, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.grant_help_text') %> - | -
| <%= t('helpers.project.principal_investigator') %> | -- <%= f.text_field :principal_investigator, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.principal_investigator_help_text') %> - | -
| <%= t('helpers.project.principal_investigator_id') %> | -- <%= f.text_field :principal_investigator_identifier, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.principal_investigator_id_help_text') %> - | -
| <%= t('helpers.project.project_data_contact') %> | -- <%= f.text_field :data_contact, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.project_data_contact_help_text') %> - | -
| <%= t('helpers.desc') %> | -- <%= f.text_area :description, { :rows => 7, :class => 'text_area has-tooltip', 'data-toggle' => "tooltip", 'data-html' => "true", 'title'=> t('helpers.project.project_desc_help_text_html')} %> - | -
| <%= constant("organisation_types.funder") %> | -<%= @project.dmptemplate.organisation.name %> | -
| <%= constant("organisation_types.institution") %> | -<%= @project.organisation.name %> | -
| <%= t('helpers.project.project_name') %> | ++ <%= f.text_field :title, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.project_name_help_text') %> + | +
| <%= t('helpers.project.project_identifier') %> | ++ <%= f.text_field :identifier, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.project_identifier_help_text') %> + | +
| <%= t('helpers.project.grant_title') %> | ++ <%= f.text_field :grant_number, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.grant_help_text') %> + | +
| <%= t('helpers.project.principal_investigator') %> | ++ <%= f.text_field :principal_investigator, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.principal_investigator_help_text') %> + | +
| <%= t('helpers.project.principal_investigator_id') %> | ++ <%= f.text_field :principal_investigator_identifier, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.principal_investigator_id_help_text') %> + | +
| <%= t('helpers.project.project_data_contact') %> | ++ <%= f.text_field :data_contact, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.project_data_contact_help_text') %> + | +
| <%= t('helpers.desc') %> | ++ <%= f.text_area :description, { :rows => 7, :class => 'text_area has-tooltip', 'data-toggle' => "tooltip", 'data-html' => "true", 'title'=> t('helpers.project.project_desc_help_text_html')} %> + | +
| <%= t('helpers.project.visibility') %> | +
+
+ /><%= t('helpers.project.visibilities.help_texts.publicly_visible') %>
+
+
+ /><%= t('helpers.project.visibilities.help_texts.organisationally_visible') %>
+
+
+ /><%= t('helpers.project.visibilities.help_texts.is_test') %>
+
+
+ /><%= t('helpers.project.visibilities.help_texts.privately_visible') %>
+
+ |
+
| <%= constant("organisation_types.funder") %> | +<%= @project.dmptemplate.organisation.name %> | +
| <%= constant("organisation_types.institution") %> | +<%= @project.organisation.name %> | +
<%= raw plan.version.phase.description %>
- <% if !plan.sections.nil? %> -| <%= t('helpers.sections_label')%> | -<%= t('helpers.questions_label')%> | -
|---|---|
|
- <%= section.title %> - |
-
- <% if section.questions.any? %>
- <% questions = section.questions.sort_by(&:number) %>
-
|
-
<%= raw plan.version.phase.description %> -
+<%= raw plan.version.phase.description %>
+ <% if !plan.sections.nil? %> +| <%= t('helpers.sections_label')%> | +<%= t('helpers.questions_label')%> | +
|---|---|
|
+ <%= section.title %> + |
+
+ <% if section.questions.any? %>
+ <% questions = section.questions.sort_by(&:number) %>
+
|
+
<%= raw plan.version.phase.description %> +
- <% if !plan.sections.nil? %> -| <%= t('helpers.sections_label')%> | -<%= t('helpers.questions_label')%> | -
|---|---|
|
- <%= section.title %> - |
-
- <% if section.questions.any? %>
- <% questions = section.questions.sort_by(&:number) %>
-
|
-
| <%= t('helpers.sections_label')%> | +<%= t('helpers.questions_label')%> | +
|---|---|
|
+ <%= section.title %> + |
+
+ <% if section.questions.any? %>
+ <% questions = section.questions.sort_by(&:number) %>
+
|
+
Willkommen. Sie können nun ihren ersten DMP erstellen. Wählen Sie 'Plan erstellen' weiter unten aus, um zu beginnen.
" project_text_when_project: "Die folgende Tabelle listet alle von Ihnen erstellten und von anderen mit Ihnen geteilten Pläne. Diese können jederzeit bearbeitet, geteilt, exportiert und gelöscht werden.
" diff --git a/config/locales/en-UK.yml b/config/locales/en-UK.yml index 0caef61..eafcfd4 100644 --- a/config/locales/en-UK.yml +++ b/config/locales/en-UK.yml @@ -339,6 +339,7 @@ roadmap_label: "Future plans" help_label: "Help" contact_label: "Contact" + public_plans_label: "Public DMPs" jisc: "The %{organisation_abbreviation} is funded by" format: "format" change_language: "Change language" @@ -574,6 +575,21 @@ project_identifier_help_text: "A pertinent ID as determined by the funder and/or institution." project_static_info: "This plan is based on:" projects_title: "My plans" + + visibility: "Visibility" + visibilities: + labels: + privately_visible: "Private" + organisationally_visible: "Organisational" + publicly_visible: "Public" + is_test: "Test/Practice" + help_texts: + privately_visible: "Private (owners, co-owners, and administrators only) See our Terms of Use." + organisationally_visible: "Organisational (visibile to others within your organisation)" + publicly_visible: "Public (Your DMP will appear on the Public DMPs page of this site)" + is_test: "Test/Practice (your plan is not visible to other users) See our Terms of Use." + not_set: "Not specified (will be visible to others within your organisation by default)" + project_settings_text: "The items you select here will be displayed in the table below. You can sort the data by each of these headings or filter by entering a text string in the search box." project_text_when_no_project: "Welcome. You are now ready to create your first DMP.Click the 'Create plan' button below to begin.
" project_text_when_project: "The table below lists the plans that you have created, and any that have been shared with you by others.These can be edited, shared, exported or deleted at anytime.
" diff --git a/config/locales/en-US.yml b/config/locales/en-US.yml index 16de5b7..b25edb1 100644 --- a/config/locales/en-US.yml +++ b/config/locales/en-US.yml @@ -327,6 +327,7 @@ roadmap_label: "Future plans" help_label: "Help" contact_label: "Contact" + public_plans_label: "Public DMPs" jisc: "The %{organisation_abbreviation} is funded by" format: "format" @@ -560,6 +561,21 @@ project_identifier_help_text: "A pertinent ID as determined by the funder and/or institution." project_static_info: "This plan is based on:" projects_title: "My plans" + + visibility: "Visibility" + visibilities: + labels: + privately_visible: "Private" + organisationally_visible: "Organizational" + publicly_visible: "Public" + is_test: "Test/Practice" + help_texts: + privately_visible: "Private (owners, co-owners, and administrators only) See our Terms of Use." + organisationally_visible: "Organizational (visibile to others within your organization)" + publicly_visible: "Public (Your DMP will appear on the Public DMPs page of this site)" + is_test: "Test/Practice (your plan is not visible to other users) See our Terms of Use." + not_set: "Not specified (will be visible to others within your organization by default)" + project_settings_text: "The items you select here will be displayed in the table below. You can sort the data by each of these headings or filter by entering a text string in the search box." project_text_when_no_project: "Welcome. You are now ready to create your first DMP.Click the 'Create plan' button below to begin.
" project_text_when_project: "The table below lists the plans that you have created, and any that have been shared with you by others.These can be edited, shared, exported or deleted at anytime.
" diff --git a/config/locales/es.yml b/config/locales/es.yml index 9c288cd..e4f8e05 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -280,6 +280,7 @@ roadmap_label: "Hoja de ruta" help_label: "Ayuda" contact_label: "Contacto" + public_plans_label: "DMP Públicos" jisc: "El DCC está financiado por" sign_in: "Conectar" @@ -453,6 +454,21 @@ project_identifier_help_text: "El ID tal como lo determinó la institución u organismo financiador." project_static_info: "Este plan está basado en:" projects_title: "Mis planes" + + visibility: "Visibilidad" + visibilities: + labels: + privately_visible: "Privado" + organisationally_visible: "Organizativo" + publicly_visible: "Público" + is_test: "Prueba/Práctica" + help_texts: + privately_visible: "Privado (propietarios, copropietarios y administradores solamente) Consulte nuestras Condiciones de uso." + organisationally_visible: "Con otros miembros de su organización" + publicly_visible: "Publicamente en la web. Su DMP aparecerá en la página Public DMPs de este sitio." + is_test: "Prueba / Práctica (su plan no es visible para otros usuarios) Vea nuestras Condiciones de uso." + not_set: "No especificado (será visible para otros dentro de su organización de forma predeterminada)" + project_settings_text: "Los items que seleccione se mostarán en la siguiente tabla. Puede ordenar los datos según sus encabezados o filtrar tecleando textos en la caja de búsqueda." project_text_when_no_project: "Bienvenido. Ya está listo para crear su primer PGD.Haga clic en el botón 'Crear un plan' para comenzar.
" project_text_when_project: "La siguiente tabla lista los planes que usted ha creado, así como los que otros investigadores hayan compartido con usted.Se pueden editar, compartir, exportar o borrar en cualquier momento.
" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5f4e0eb..5becc4b 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -281,6 +281,7 @@ roadmap_label: "Feuille de route" help_label: "Aide" contact_label: "Contact" + public_plans_label: "DMP Publics" jisc: "Le DCC est financé par" sign_in: "Connexion" @@ -458,6 +459,21 @@ project_identifier_help_text: "Un identifiant approprié conforme aux prescriptions de l'organisme financeur ou de l'établissement." project_static_info: "Ce plan s'inspire de :" projects_title: "Mes plans" + + visibility: "Visibilité" + visibilities: + labels: + privately_visible: "Privé" + organisationally_visible: "Organisationnel" + publicly_visible: "Public" + is_test: "Test/Pratique" + help_texts: + privately_visible: "Privé (propriétaires, copropriétaires et administrateurs uniquement) Consultez nos Conditions d'utilisation." + organisationally_visible: "Avec d'autres membres de votre organisation" + publicly_visible: "Publiquement sur le web. Votre DMP apparaîtra sur la page Public DMPs de ce site." + is_test: "Test / Practice (votre plan n'est pas visible aux autres utilisateurs) Voir nos Conditions d'utilisation." + not_set: "Non spécifié (sera visible par d'autres personnes au sein de votre organisation par défaut)" + project_settings_text: "Les éléments que vous sélectionnez ici s'afficherontt dans le tableaiu ci-après. Vous pouvez trier les données à partir de chacune de ces en-tête ou les filtrer en tapant une chaîne de caractères dans la zone de recherche." project_text_when_no_project: "Bienvenue. Vous voilà prêt à créer votre premier DMP.Cliquez sur le bouton 'Créer un plan' ci-dessous pour commencer.
" project_text_when_project: "Dans le tableau ci-dessous figurent les plans que vous avez créés, ainsi que ceux que vous partagez avec d'autres.Vous pouvez à tout moment les modifier, les partager, les exporter, les effacer...
" diff --git a/config/routes.rb b/config/routes.rb index 78c801a..b2f318c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -37,6 +37,9 @@ get "help" => 'static_pages#help' get "roadmap" => 'static_pages#roadmap' get "terms" => 'static_pages#termsuse' + get "public_plans" => 'static_pages#public_plans' + get "public_export/:id" => 'static_pages#public_export', as: 'public_export' + get "existing_users" => 'existing_users#index' #post 'contact_form' => 'contacts', as: 'localized_contact_creation' diff --git a/db/schema.rb b/db/schema.rb index 3ff9498..cec4bb6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,422 +11,452 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20161102221313) do +ActiveRecord::Schema.define(version: 20170124231538) do create_table "answers", force: :cascade do |t| - t.text "text" - t.integer "plan_id" - t.integer "user_id" - t.integer "question_id" - t.datetime "created_at" - t.datetime "updated_at" + t.text "text", limit: 65535 + t.integer "plan_id", limit: 4 + t.integer "user_id", limit: 4 + t.integer "question_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "answers_options", id: false, force: :cascade do |t| - t.integer "answer_id", null: false - t.integer "option_id", null: false + t.integer "answer_id", limit: 4, null: false + t.integer "option_id", limit: 4, null: false end - add_index "answers_options", ["answer_id", "option_id"], name: "index_answers_options_on_answer_id_and_option_id" + add_index "answers_options", ["answer_id", "option_id"], name: "index_answers_options_on_answer_id_and_option_id", using: :btree create_table "comments", force: :cascade do |t| - t.integer "user_id" - t.integer "question_id" - t.text "text" - t.datetime "created_at" - t.datetime "updated_at" + t.integer "user_id", limit: 4 + t.integer "question_id", limit: 4 + t.text "text", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "archived" - t.integer "plan_id" - t.integer "archived_by" + t.integer "plan_id", limit: 4 + t.integer "archived_by", limit: 4 end create_table "dmptemplates", force: :cascade do |t| - t.string "title" - t.text "description" + t.string "title", limit: 255 + t.text "description", limit: 65535 t.boolean "published" - t.integer "user_id" - t.integer "organisation_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "locale" + t.integer "user_id", limit: 4 + t.integer "organisation_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "locale", limit: 255 t.boolean "is_default" end create_table "dmptemplates_guidance_groups", id: false, force: :cascade do |t| - t.integer "dmptemplate_id" - t.integer "guidance_group_id" + t.integer "dmptemplate_id", limit: 4 + t.integer "guidance_group_id", limit: 4 end create_table "exported_plans", force: :cascade do |t| - t.integer "plan_id" - t.integer "user_id" - t.string "format" - t.datetime "created_at" - t.datetime "updated_at" + t.integer "plan_id", limit: 4 + t.integer "user_id", limit: 4 + t.string "format", limit: 255 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "file_types", force: :cascade do |t| - t.string "name" - t.string "icon_name" - t.integer "icon_size" - t.string "icon_location" - t.datetime "created_at" - t.datetime "updated_at" + t.string "name", limit: 255 + t.string "icon_name", limit: 255 + t.integer "icon_size", limit: 4 + t.string "icon_location", limit: 255 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "file_uploads", force: :cascade do |t| - t.string "name" - t.string "title" - t.text "description" - t.integer "size" + t.string "name", limit: 255 + t.string "title", limit: 255 + t.text "description", limit: 65535 + t.integer "size", limit: 4 t.boolean "published" - t.string "location" - t.integer "file_type_id" - t.datetime "created_at" - t.datetime "updated_at" + t.string "location", limit: 255 + t.integer "file_type_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "friendly_id_slugs", force: :cascade do |t| - t.string "slug", null: false - t.integer "sluggable_id", null: false + t.string "slug", limit: 255, null: false + t.integer "sluggable_id", limit: 4, null: false t.string "sluggable_type", limit: 40 t.datetime "created_at" end - add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", unique: true - add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id" - add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type" + add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", unique: true, using: :btree + add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id", using: :btree + add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type", using: :btree create_table "guidance_groups", force: :cascade do |t| - t.string "name" - t.integer "organisation_id" - t.datetime "created_at" - t.datetime "updated_at" + t.string "name", limit: 255 + t.integer "organisation_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "optional_subset" t.boolean "published" end create_table "guidance_in_group", id: false, force: :cascade do |t| - t.integer "guidance_id", null: false - t.integer "guidance_group_id", null: false + t.integer "guidance_id", limit: 4, null: false + t.integer "guidance_group_id", limit: 4, null: false end - add_index "guidance_in_group", ["guidance_id", "guidance_group_id"], name: "index_guidance_in_group_on_guidance_id_and_guidance_group_id" + add_index "guidance_in_group", ["guidance_id", "guidance_group_id"], name: "index_guidance_in_group_on_guidance_id_and_guidance_group_id", using: :btree create_table "guidances", force: :cascade do |t| - t.text "text" - t.integer "guidance_group_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "question_id" + t.text "text", limit: 65535 + t.integer "guidance_group_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "question_id", limit: 4 t.boolean "published" end + create_table "identifier_schemes", force: :cascade do |t| + t.string "name", limit: 255 + t.string "description", limit: 255 + t.boolean "active" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "use_for_login", default: false + end + create_table "languages", force: :cascade do |t| - t.string "abbreviation" - t.string "description" - t.string "name" + t.string "abbreviation", limit: 255 + t.string "description", limit: 255 + t.string "name", limit: 255 t.boolean "default_language" end create_table "option_warnings", force: :cascade do |t| - t.integer "organisation_id" - t.integer "option_id" - t.text "text" - t.datetime "created_at" - t.datetime "updated_at" + t.integer "organisation_id", limit: 4 + t.integer "option_id", limit: 4 + t.text "text", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "options", force: :cascade do |t| - t.integer "question_id" - t.string "text" - t.integer "number" + t.integer "question_id", limit: 4 + t.string "text", limit: 255 + t.integer "number", limit: 4 t.boolean "is_default" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "org_token_permissions", force: :cascade do |t| - t.integer "organisation_id" - t.integer "token_permission_type_id" + t.integer "organisation_id", limit: 4 + t.integer "token_permission_type_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end create_table "organisation_types", force: :cascade do |t| - t.string "name" - t.text "description" - t.datetime "created_at" - t.datetime "updated_at" + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "organisations", force: :cascade do |t| - t.string "name" - t.string "abbreviation" - t.string "target_url" - t.integer "organisation_type_id" - t.string "domain" - t.string "wayfless_entity" - t.integer "stylesheet_file_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "parent_id" + t.string "name", limit: 255 + t.string "abbreviation", limit: 255 + t.string "target_url", limit: 255 + t.integer "organisation_type_id", limit: 4 + t.string "domain", limit: 255 + t.string "wayfless_entity", limit: 255 + t.integer "stylesheet_file_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "parent_id", limit: 4 t.boolean "is_other" - t.string "sort_name" - t.text "banner_text" - t.integer "region_id" - t.integer "language_id" - t.string "logo_uid" - t.string "logo_name" - t.string "contact_email" + t.string "sort_name", limit: 255 + t.text "banner_text", limit: 65535 + t.integer "region_id", limit: 4 + t.integer "language_id", limit: 4 + t.string "logo_uid", limit: 255 + t.string "logo_name", limit: 255 + t.string "contact_email", limit: 255 end create_table "phases", force: :cascade do |t| - t.string "title" - t.text "description" - t.integer "number" - t.integer "dmptemplate_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "slug" + t.string "title", limit: 255 + t.text "description", limit: 65535 + t.integer "number", limit: 4 + t.integer "dmptemplate_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "slug", limit: 255 end - add_index "phases", ["dmptemplate_id"], name: "index_phases_on_dmptemplate_id" - add_index "phases", ["slug"], name: "index_phases_on_slug", unique: true + add_index "phases", ["dmptemplate_id"], name: "index_phases_on_dmptemplate_id", using: :btree + add_index "phases", ["slug"], name: "index_phases_on_slug", unique: true, using: :btree create_table "plan_sections", force: :cascade do |t| - t.integer "user_id" - t.integer "section_id" - t.integer "plan_id" - t.datetime "created_at" - t.datetime "updated_at" + t.integer "user_id", limit: 4 + t.integer "section_id", limit: 4 + t.integer "plan_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.datetime "release_time" end create_table "plans", force: :cascade do |t| t.boolean "locked" - t.integer "project_id" - t.integer "version_id" - t.datetime "created_at" - t.datetime "updated_at" + t.integer "project_id", limit: 4 + t.integer "version_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "project_groups", force: :cascade do |t| t.boolean "project_creator" t.boolean "project_editor" - t.integer "user_id" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" + t.integer "user_id", limit: 4 + t.integer "project_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "project_administrator" end create_table "project_guidance", id: false, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "guidance_group_id", null: false + t.integer "project_id", limit: 4, null: false + t.integer "guidance_group_id", limit: 4, null: false end - add_index "project_guidance", ["project_id", "guidance_group_id"], name: "index_project_guidance_on_project_id_and_guidance_group_id" + add_index "project_guidance", ["project_id", "guidance_group_id"], name: "index_project_guidance_on_project_id_and_guidance_group_id", using: :btree create_table "projects", force: :cascade do |t| - t.string "title" - t.integer "dmptemplate_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "slug" - t.integer "organisation_id" - t.string "grant_number" - t.string "identifier" - t.text "description" - t.string "principal_investigator" - t.string "principal_investigator_identifier" - t.string "data_contact" - t.string "funder_name" + t.string "title", limit: 255 + t.integer "dmptemplate_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "slug", limit: 255 + t.integer "organisation_id", limit: 4 + t.string "grant_number", limit: 255 + t.string "identifier", limit: 255 + t.text "description", limit: 65535 + t.string "principal_investigator", limit: 255 + t.string "principal_investigator_identifier", limit: 255 + t.string "data_contact", limit: 255 + t.string "funder_name", limit: 255 + t.integer "visibility", limit: 4, default: 0, null: false end - add_index "projects", ["slug"], name: "index_projects_on_slug", unique: true + add_index "projects", ["id"], name: "index_projects_on_id_and_is_test_and_is_public", using: :btree + add_index "projects", ["slug"], name: "index_projects_on_slug", unique: true, using: :btree create_table "question_formats", force: :cascade do |t| - t.string "title" - t.text "description" - t.datetime "created_at" - t.datetime "updated_at" + t.string "title", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "questions", force: :cascade do |t| - t.text "text" - t.text "default_value" - t.text "guidance" - t.integer "number" - t.integer "parent_id" - t.integer "dependency_id" - t.text "dependency_text" - t.integer "section_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "question_format_id" - t.boolean "option_comment_display", default: true + t.text "text", limit: 65535 + t.text "default_value", limit: 65535 + t.text "guidance", limit: 65535 + t.integer "number", limit: 4 + t.integer "parent_id", limit: 4 + t.integer "dependency_id", limit: 4 + t.text "dependency_text", limit: 65535 + t.integer "section_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "question_format_id", limit: 4 + t.boolean "option_comment_display", default: true end create_table "questions_themes", id: false, force: :cascade do |t| - t.integer "question_id", null: false - t.integer "theme_id", null: false + t.integer "question_id", limit: 4, null: false + t.integer "theme_id", limit: 4, null: false end - add_index "questions_themes", ["question_id", "theme_id"], name: "index_questions_themes_on_question_id_and_theme_id" + add_index "questions_themes", ["question_id", "theme_id"], name: "index_questions_themes_on_question_id_and_theme_id", using: :btree create_table "region_groups", force: :cascade do |t| - t.integer "super_region_id" - t.integer "region_id" + t.integer "super_region_id", limit: 4 + t.integer "region_id", limit: 4 end create_table "regions", force: :cascade do |t| - t.string "abbreviation" - t.string "description" - t.string "name" + t.string "abbreviation", limit: 255 + t.string "description", limit: 255 + t.string "name", limit: 255 end create_table "roles", force: :cascade do |t| - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" + t.string "name", limit: 255 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "role_in_plans" - t.integer "resource_id" - t.string "resource_type" + t.integer "resource_id", limit: 4 + t.string "resource_type", limit: 255 end - add_index "roles", ["name"], name: "index_roles_on_name" - add_index "roles", ["name"], name: "index_roles_on_name_and_resource_type_and_resource_id" + add_index "roles", ["name"], name: "index_roles_on_name", using: :btree + add_index "roles", ["name"], name: "index_roles_on_name_and_resource_type_and_resource_id", using: :btree create_table "sections", force: :cascade do |t| - t.string "title" - t.text "description" - t.integer "number" - t.integer "version_id" - t.integer "organisation_id" - t.datetime "created_at" - t.datetime "updated_at" + t.string "title", limit: 255 + t.text "description", limit: 65535 + t.integer "number", limit: 4 + t.integer "version_id", limit: 4 + t.integer "organisation_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "published" end create_table "settings", force: :cascade do |t| - t.string "var", null: false - t.text "value" - t.integer "target_id", null: false - t.string "target_type", null: false - t.datetime "created_at" - t.datetime "updated_at" + t.string "var", limit: 255, null: false + t.text "value", limit: 65535 + t.integer "target_id", limit: 4, null: false + t.string "target_type", limit: 255, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "settings", ["target_type", "target_id", "var"], name: "index_settings_on_target_type_and_target_id_and_var", unique: true + add_index "settings", ["target_type", "target_id", "var"], name: "index_settings_on_target_type_and_target_id_and_var", unique: true, using: :btree create_table "splash_logs", force: :cascade do |t| - t.string "destination" - t.datetime "created_at" - t.datetime "updated_at" + t.string "destination", limit: 255 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "suggested_answers", force: :cascade do |t| - t.integer "question_id" - t.integer "organisation_id" - t.text "text" - t.datetime "created_at" - t.datetime "updated_at" + t.integer "question_id", limit: 4 + t.integer "organisation_id", limit: 4 + t.text "text", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "is_example" end create_table "themes", force: :cascade do |t| - t.string "title" - t.text "description" - t.datetime "created_at" - t.datetime "updated_at" - t.string "locale" + t.string "title", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "locale", limit: 255 end create_table "themes_in_guidance", id: false, force: :cascade do |t| - t.integer "theme_id" - t.integer "guidance_id" + t.integer "theme_id", limit: 4 + t.integer "guidance_id", limit: 4 end create_table "token_permission_types", force: :cascade do |t| - t.string "token_type" - t.text "text_description" + t.string "token_type", limit: 255 + t.text "text_description", limit: 65535 t.datetime "created_at" t.datetime "updated_at" end + create_table "user_identifiers", force: :cascade do |t| + t.string "identifier", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "user_id", limit: 4 + t.integer "identifier_scheme_id", limit: 4 + end + + add_index "user_identifiers", ["identifier_scheme_id"], name: "fk_rails_fe95df7db0", using: :btree + add_index "user_identifiers", ["user_id"], name: "fk_rails_65c9a98cdb", using: :btree + + create_table "user_role_types", force: :cascade do |t| + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "user_statuses", force: :cascade do |t| - t.string "name" - t.text "description" - t.datetime "created_at" - t.datetime "updated_at" + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "user_types", force: :cascade do |t| - t.string "name" - t.text "description" - t.datetime "created_at" - t.datetime "updated_at" + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "users", force: :cascade do |t| - t.string "firstname" - t.string "surname" - t.string "email", default: "", null: false - t.string "orcid_id" - t.string "shibboleth_id" - t.integer "user_type_id" - t.integer "user_status_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "encrypted_password", default: "" - t.string "reset_password_token" + t.string "firstname", limit: 255 + t.string "surname", limit: 255 + t.string "email", limit: 255, default: "", null: false + t.string "orcid_id", limit: 255 + t.string "shibboleth_id", limit: 255 + t.integer "user_type_id", limit: 4 + t.integer "user_status_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "encrypted_password", limit: 255, default: "" + t.string "reset_password_token", limit: 255 t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0 + t.integer "sign_in_count", limit: 4, default: 0 t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" - t.string "confirmation_token" + t.string "current_sign_in_ip", limit: 255 + t.string "last_sign_in_ip", limit: 255 + t.string "confirmation_token", limit: 255 t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "invitation_token" + t.string "invitation_token", limit: 255 t.datetime "invitation_created_at" t.datetime "invitation_sent_at" t.datetime "invitation_accepted_at" - t.string "other_organisation" - t.boolean "dmponline3" + t.string "other_organisation", limit: 255 t.boolean "accept_terms" - t.integer "organisation_id" - t.string "api_token" - t.integer "invited_by_id" - t.string "invited_by_type" - t.integer "language_id" + t.integer "organisation_id", limit: 4 + t.string "api_token", limit: 255 + t.integer "invited_by_id", limit: 4 + t.string "invited_by_type", limit: 255 + t.integer "language_id", limit: 4 end - add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true - add_index "users", ["email"], name: "index_users_on_email", unique: true - add_index "users", ["invitation_token"], name: "index_users_on_invitation_token", unique: true - add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true + add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree + add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree + add_index "users", ["invitation_token"], name: "index_users_on_invitation_token", unique: true, using: :btree + add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree create_table "users_roles", id: false, force: :cascade do |t| - t.integer "user_id" - t.integer "role_id" + t.integer "user_id", limit: 4 + t.integer "role_id", limit: 4 end - add_index "users_roles", ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id" + add_index "users_roles", ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id", using: :btree create_table "versions", force: :cascade do |t| - t.string "title" - t.text "description" + t.string "title", limit: 255 + t.text "description", limit: 65535 t.boolean "published" - t.integer "number" - t.integer "phase_id" - t.datetime "created_at" - t.datetime "updated_at" + t.integer "number", limit: 4 + t.integer "phase_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "versions", ["phase_id"], name: "index_versions_on_phase_id" + add_index "versions", ["phase_id"], name: "index_versions_on_phase_id", using: :btree + add_foreign_key "user_identifiers", "identifier_schemes" + add_foreign_key "user_identifiers", "users" end diff --git a/lib/assets/stylesheets/bootstrap_and_overrides.css.less b/lib/assets/stylesheets/bootstrap_and_overrides.css.less index f0b730b..1b9d41b 100644 --- a/lib/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/lib/assets/stylesheets/bootstrap_and_overrides.css.less @@ -730,6 +730,11 @@ margin-top:4px; } +.radio-label { + margin-left: 10px; +} + + .sign_up_org_label{ margin: 0 0 6px 0; float:left;