diff --git a/app/controllers/api/v0/guidance_groups_controller.rb b/app/controllers/api/v0/guidance_groups_controller.rb index 1336f55..ce2ac72 100644 --- a/app/controllers/api/v0/guidance_groups_controller.rb +++ b/app/controllers/api/v0/guidance_groups_controller.rb @@ -11,8 +11,8 @@ end def index - raise Pundit::NotAuthorizedError unless Api::V0::GuidanceGroupPolicy.new(@user, :guidance_group).index? - @all_viewable_groups = GuidanceGroup.all_viewable(@user) + raise Pundit::NotAuthorizedError unless Api::V0::GuidanceGroupPolicy.new(@user, :guidance_group).index? + @all_viewable_groups = GuidanceGroup.all_viewable(@user) respond_with @all_viewable_groups end diff --git a/app/controllers/api/v0/plans_controller.rb b/app/controllers/api/v0/plans_controller.rb index ac2f1b4..23ae557 100644 --- a/app/controllers/api/v0/plans_controller.rb +++ b/app/controllers/api/v0/plans_controller.rb @@ -1,104 +1,48 @@ module Api module V0 - class ProjectsController < Api::V0::BaseController + class PlansController < Api::V0::BaseController before_action :authenticate - swagger_controller :projects, 'Plans' - - swagger_api :create do |api| - summary 'Returns a single guidance group item' - notes 'Notes...' - param :header, 'Authentication-Token', :string, :required, 'Authentication-Token' - response :unauthorized - response :not_found - end - ## - # Creates a new project based on the information passed in JSON to the API + # Creates a new plan based on the information passed in JSON to the API def create - # find the user's api_token permissions - # then ensure that they have the permission associated with creating plans - if has_auth(constant("api_endpoint_types.plans")) - #params[:organization_id] = Org.where(name: params[:template][:organization]) - # find_by returns nil if none found, find_by! raises an ActiveRecord error - org = Org.find_by name: params[:template][:organisation] - - # if organization exists - if !org.nil? - # if organization is funder - if org.funder? - # if organization has only 1 template - if org.templates.length == 1 - # set template id - template = org.templates.first - # else if params.template.name specified && params.template.name == one of organization's tempates - elsif !org.templates.find_by title: params[:template][:name].nil? - # set template id - template = org.templates.find_by title: params[:template][:name] - # else error: organization has more than one template and template name unspecified - else - render json: _('{"Error":"Organisation has more than one template and template name unspecified or invalid"}'), status: 400 and return - end - # else error: organization specified is not a funder - else - render json: _('{"Error":"Organisation specified is not a funder"}'), status: 400 and return - end - # else error: organization does not exist - else - render json: _('{"Error":"Organisation does not exist"}'), status: 400 and return - end + @template = Template.live(params[:template_id]) + raise Pundit::NotAuthorizedError unless Api::V0::PlansPolicy.new(@user, @template).create? - all_groups = [] - # Check to see if the user specified guidances - if !params[:guidance].nil? - # for each specified guidance, see if it exists - params[:guidance][:name].each do |guidance_name| - group = GuidanceGroup.find_by(name: guidance_name) - # if it exists, add it to the guidances for the new project - if !group.nil? - all_groups = all_groups + [group] - end - end - end + plan_user = User.find_by(email: params[:plan][:email]) + # ensure user exists + if plan_user.blank? + User.invite!({email: params[:plan][:email]}, ( @user)) + plan_user = User.find_by(email: params[:plan][:email]) + plan_user.org = @user.org + plan_user.save + end + # ensure user's organisation is the same as api user's + raise Pundit::NotAuthorizedError, _("user must be in your organisation") unless plan_user.org == @user.org - # cant invite a user without having a current user because of devise :ivitable - # after we have auth, will be able to assign an :invited_by_id - user = User.find_by email: params[:project][:email] - # if user does not exist - if user.nil? - # invite user to DMPRoadmap - User.invite!({email: params[:project][:email]}, ( @user)) - # set project owner to user associated w/email - user = (User.find_by email: params[:project][:email]) - end - - # create new project with specified parameters - @project = Plan.new - @project.title = params[:project][:title] - @project.template = template - @project.slug = params[:project][:title] - #@project.organisation = @user.organisations.first - @project.assign_creator(user.id) - @project.guidance_groups = all_groups - - # if save successful, render success, otherwise show error - if @project.save - #render json: @project ,status: :created - render :show, status: :created - else - render json: get_resource.errors, status: :unprocessable_entity - end + # initialize the plan + @plan = Plan.new + @plan.principal_investigator = plan_user.surname.blank? ? nil : "#{plan_user.firstname} #{plan_user.surname}" + @plan.data_contact = plan_user.email + # set funder name to template's org, or original template's org + if @template.customization_of.nil? + @plan.funder_name = @template.org.name else - - render json: _('{"Error":"You do not have authorisation to view this endpoint"}'), status: 400 and return + @plan.funder_name = Template.where(dmptemplate_id: @template.customization_of).first.org.name + end + @plan.template = @template + @plan.title = params[:plan][:title] + if @plan.save + @plan.assign_creator(plan_user) + respond_with @plan + else + # the plan did not save + self.headers['WWW-Authenticate'] = "Token realm=\"\"" + render json: _("Bad Parameters"), status: 400 end end - # private - # def project_params - # params.require(:template).permit(:organisation, :name) - # params.require(:project).permit(:title, :email) - # end + end end end diff --git a/app/controllers/api/v0/statistics_controller.rb b/app/controllers/api/v0/statistics_controller.rb index 6ef0540..b3b95a4 100644 --- a/app/controllers/api/v0/statistics_controller.rb +++ b/app/controllers/api/v0/statistics_controller.rb @@ -26,10 +26,26 @@ # @return the number of DMPs using the specified template between the optional specified dates # ensures that the template is owned/created by the caller's organisation def using_template - template = Template.find(params[:id]) - raise Pundit::NotAuthorizedError unless Api::V0::StatisticsPolicy.new(@user, template).using_template? - @template_count = restrict_date_range(template.plans).count - respond_with @template_count + org_templates = @user.org.templates.where(customization_of: nil) + raise Pundit::NotAuthorizedError unless Api::V0::StatisticsPolicy.new(@user, org_templates.first).using_template? + @templates = {} + org_templates.each do |template| + if @templates[template.title].blank? + @templates[template.title] = {} + @templates[template.title][:title] = template.title + @templates[template.title][:id] = template.dmptemplate_id + if template.plans.present? + @templates[template.title][:uses] = restrict_date_range(template.plans).length + else + @templates[template.title][:uses] = 0 + end + else + if template.plans.present? + @templates[template.title][:uses] += restrict_date_range(template.plans).length + end + end + end + respond_with @templates end ## @@ -39,16 +55,28 @@ # as the user who ititiated the call def plans_by_template raise Pundit::NotAuthorizedError unless Api::V0::StatisticsPolicy.new(@user, :statistics).plans_by_template? - @org_projects = [] + org_projects = [] @user.org.users.each do |user| user.plans.each do |plan| - unless @org_projects.include? plan - @org_projects += [plan] + unless org_projects.include? plan + org_projects += [plan] end end end - @org_projects = restrict_date_range(@org_projects) - respond_with @org_projects + org_projects = restrict_date_range(org_projects) + @templates = {} + org_projects.each do |plan| + # if hash exists + if @templates[plan.template.title].blank? + @templates[plan.template.title] = {} + @templates[plan.template.title][:title] = plan.template.title + @templates[plan.template.title][:id] = plan.template.dmptemplate_id + @templates[plan.template.title][:uses] = 1 + else + @templates[plan.template.title][:uses] += 1 + end + end + respond_with @templates end ## diff --git a/app/controllers/api/v0/templates_controller.rb b/app/controllers/api/v0/templates_controller.rb index dfe78da..8560068 100644 --- a/app/controllers/api/v0/templates_controller.rb +++ b/app/controllers/api/v0/templates_controller.rb @@ -10,16 +10,34 @@ def index # check if the user has permissions to use the templates API raise Pundit::NotAuthorizedError unless Api::V0::TemplatePolicy.new(@user, :guidance_group).index? + @org_templates = {} - published_templates = Template.includes(:org).where(customization_of: nil, published: true).order(:org_id, :version) - published_templates.all.each do |temp| + + published_templates = Template.includes(:org).valid.where(customization_of: nil, published: true).order(:org_id, :version) + customized_templates = Template.includes(:org).valid.where(org_id: @user.org_id, published: true).where.not(customization_of: nil) + + published_templates.each do |temp| if @org_templates[temp.org].present? - if @org_templates[temp.org][temp.dmptemplate_id].nil? - @org_templates[temp.org][temp.dmptemplate_id] = temp + if @org_templates[temp.org][:own][temp.dmptemplate_id].nil? + @org_templates[temp.org][:own][temp.dmptemplate_id] = temp end else @org_templates[temp.org] = {} - @org_templates[temp.org][temp.dmptemplate_id] = temp + @org_templates[temp.org][:own] = {} + @org_templates[temp.org][:cust] = {} + @org_templates[temp.org][:own][temp.dmptemplate_id] = temp + end + end + customized_templates.each do |temp| + if @org_templates[temp.org].present? + if @org_templates[temp.org][:cust][temp.dmptemplate_id].nil? + @org_templates[temp.org][:cust][temp.dmptemplate_id] = temp + end + else + @org_templates[temp.org] = {} + @org_templates[temp.org][:own] = {} + @org_templates[temp.org][:cust] = {} + @org_templates[temp.org][:cust][temp.dmptemplate_id] = temp end end respond_with @org_templates diff --git a/app/controllers/phases_controller.rb b/app/controllers/phases_controller.rb index b9d9685..4abba8b 100644 --- a/app/controllers/phases_controller.rb +++ b/app/controllers/phases_controller.rb @@ -118,6 +118,11 @@ if params.has_key?(:question_id) @question_id = params[:question_id].to_i end + if @phase.template.customization_of.present? + @original_org = Template.where(dmptemplate_id: @phase.template.customization_of).first.org + else + @original_org = @phase.template.org + end end @@ -179,6 +184,11 @@ @section_id = (params[:section_id].nil? ? nil : params[:section_id].to_i) @question_id = (params[:question_id].nil? ? nil : params[:question_id].to_i) flash[:notice] = failed_update_error(@phase, _('phase')) + if @phase.template.customization_of.present? + @original_org = Template.where(dmptemplate_id: @phase.template.customization_of).first.org + else + @original_org = @phase.template.org + end render 'admin_show' end end @@ -203,6 +213,11 @@ @section_id = (params[:section_id].nil? ? nil : params[:section_id].to_i) @question_id = (params[:question_id].nil? ? nil : params[:question_id].to_i) flash[:notice] = failed_destroy_error(@phase, _('phase')) + if @phase.template.customization_of.present? + @original_org = Template.where(dmptemplate_id: @phase.template.customization_of).first.org + else + @original_org = @phase.template.org + end render 'admin_show' end end diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb index 2beb963..dbc5613 100644 --- a/app/controllers/questions_controller.rb +++ b/app/controllers/questions_controller.rb @@ -8,6 +8,11 @@ @question = Question.new(question_params) authorize @question @question.modifiable = true + if @question.question_format.textfield? + @question.default_value = params["question-default-value-textfield"] + elsif @question.question_format.textarea? + @question.default_value = params["question-default-value-textarea"] + end if @question.save @question.section.phase.template.dirty = true @question.section.phase.template.save! @@ -30,10 +35,15 @@ @question_id = @question.id flash[:notice] = failed_create_error(@question, _('question')) + if @phase.template.customization_of.present? + @original_org = Template.where(dmptemplate_id: @phase.template.customization_of).first.org + else + @original_org = @phase.template.org + end render template: 'phases/admin_show' end rescue ActionController::ParameterMissing => e - flash[:notice] = e.message + flash[:notice] = e.message end end @@ -41,7 +51,7 @@ def admin_update @question = Question.find(params[:id]) authorize @question - guidance = @question.get_guidance_annotation(current_user.org_id) + guidance = @question.get_guidance_annotation(current_user.org_id) if params["question-guidance-#{params[:id]}"].present? if guidance.blank? guidance = @question.annotations.build @@ -50,7 +60,11 @@ guidance.text = params["question-guidance-#{params[:id]}"] guidance.save end - @question.default_value = params["question-default-value-#{params[:id]}"] + if @question.question_format.textfield? + @question.default_value = params["question-default-value-textfield"] + elsif @question.question_format.textarea? + @question.default_value = params["question-default-value-textarea"] + end @section = @question.section @phase = @section.phase template = @phase.template @@ -67,6 +81,11 @@ @question_id = @question.id flash[:notice] = failed_update_error(@question, _('question')) + if @phase.template.customization_of.present? + @original_org = Template.where(dmptemplate_id: @phase.template.customization_of).first.org + else + @original_org = @phase.template.org + end render template: 'phases/admin_show' end end @@ -80,7 +99,7 @@ if @question.destroy @phase.template.dirty = true @phase.template.save! - + redirect_to admin_show_phase_path(id: @phase.id, section_id: @section.id, edit: 'true'), notice: _('Information was successfully deleted.') else redirect_to admin_show_phase_path(id: @phase.id, section_id: @section.id, edit: 'true'), notice: failed_destroy_error(@question, 'question') @@ -94,10 +113,8 @@ permitted = params.require(:question).except(:created_at, :updated_at).tap do |question_params| question_params.require(:question_format_id) q_format = QuestionFormat.find(question_params[:question_format_id]) - if q_format.option_based - question_params.delete(:default_value) - else - question_params.delete(:question_options_attributes) + if !q_format.option_based? + question_params.delete(':question_options_attributes') end end end diff --git a/app/controllers/sections_controller.rb b/app/controllers/sections_controller.rb index 9880863..b6ef3d1 100644 --- a/app/controllers/sections_controller.rb +++ b/app/controllers/sections_controller.rb @@ -12,7 +12,7 @@ if @section.save @section.phase.template.dirty = true @section.phase.template.save! - + redirect_to admin_show_phase_path(id: @section.phase_id, :section_id => @section.id, edit: 'true'), notice: _('Information was successfully created.') else @@ -22,6 +22,11 @@ @section_id = @section.id @question_id = nil flash[:notice] = failed_create_error(@section, _('section')) + if @phase.template.customization_of.present? + @original_org = Template.where(dmptemplate_id: @phase.template.customization_of).first.org + else + @original_org = @phase.template.org + end render template: 'phases/admin_show' end end @@ -36,7 +41,7 @@ if @section.update_attributes(params[:section]) @section.phase.template.dirty = true @section.phase.template.save! - + redirect_to admin_show_phase_path(id: @phase.id, section_id: @section.id , edit: 'true'), notice: _('Information was successfully updated.') else @edit = (@phase.template.org == current_user.org) @@ -45,6 +50,11 @@ @section_id = @section.id @question_id = nil flash[:notice] = failed_update_error(@section, _('section')) + if @phase.template.customization_of.present? + @original_org = Template.where(dmptemplate_id: @phase.template.customization_of).first.org + else + @original_org = @phase.template.org + end render template: 'phases/admin_show' end end @@ -55,11 +65,11 @@ @section = Section.includes(phase: :template).find(params[:section_id]) authorize @section @phase = @section.phase - + if @section.destroy @phase.template.dirty = true @phase.template.save! - + redirect_to admin_show_phase_path(id: @phase.id, edit: 'true' ), notice: _('Information was successfully deleted.') else @edit = (@phase.template.org == current_user.org) @@ -67,10 +77,15 @@ @sections = @phase.sections @section_id = @section.id @question_id = nil - + flash[:notice] = failed_destroy_error(@section, _('section')) + if @phase.template.customization_of.present? + @original_org = Template.where(dmptemplate_id: @phase.template.customization_of).first.org + else + @original_org = @phase.template.org + end render template: 'phases/admin_show' end end - + end \ No newline at end of file diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 817229d..742ce33 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -117,7 +117,7 @@ if section.modifiable # this is a custom section section_copy = Section.deep_copy(section) - customization_phase = new_customization.phases.includes(:sections.where(number: phase.number).first) + customization_phase = new_customization.phases.includes(:sections).where(number: phase.number).first section_copy.phase_id = customization_phase.id # custom sections get added to the end section_copy.number = customization_phase.sections.length + 1 diff --git a/app/models/guidance_group.rb b/app/models/guidance_group.rb index 892a47e..ee3e685 100644 --- a/app/models/guidance_group.rb +++ b/app/models/guidance_group.rb @@ -103,7 +103,7 @@ # @return [Array] a list of all "viewable" guidance groups to a user def self.all_viewable(user) # first find all groups owned by the Managing Curation Center - managing_org_groups = Org.includes(:guidance_groups).managing_orgs.collect{|org| org.guidance_groups} + managing_org_groups = Org.includes(guidance_groups: [guidances: :themes]).managing_orgs.collect{|org| org.guidance_groups} # find all groups owned by a Funder organisation funder_groups = Org.includes(:guidance_groups).funders.collect{|org| org.guidance_groups} @@ -112,7 +112,7 @@ # pass this organisation guidance groups to the view with respond_with @all_viewable_groups all_viewable_groups = managing_org_groups + funder_groups + organisation_groups - all_viewable_groups = all_viewable_groups.flatten.uniq{|x| x.id} + all_viewable_groups = all_viewable_groups.flatten.uniq return all_viewable_groups end end diff --git a/app/models/org.rb b/app/models/org.rb index bb45c32..9abbe2e 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -26,7 +26,8 @@ :logo_file_name, :name, :target_url, :organisation_type_id, :wayfless_entity, :parent_id, :sort_name, :token_permission_type_ids, :language_id, :contact_email, - :language, :org_type, :region, :token_permission_types + :language, :org_type, :region, :token_permission_types, + :guidance_group_ids, :is_other, :region_id, :logo_uid, :logo_name ## # Validators diff --git a/app/models/plan.rb b/app/models/plan.rb index 5db4cde..f3974d2 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -1134,7 +1134,7 @@ # Only run this before_validation because rails fires this before save/create if self.id.nil? self.title = "My plan (#{self.template.title})" if self.title.nil? && !self.template.nil? - self.visibility = 1 + self.visibility = 3 end end diff --git a/app/models/template.rb b/app/models/template.rb index eac8d84..b72d216 100644 --- a/app/models/template.rb +++ b/app/models/template.rb @@ -55,7 +55,6 @@ Template.where(customization_of: dmptemplate_id, org_id: org_id).order(version: :desc).valid.first end - ## # deep copy the given template and all of it's associations # diff --git a/app/policies/api/v0/plans_policy.rb b/app/policies/api/v0/plans_policy.rb new file mode 100644 index 0000000..6d0ab77 --- /dev/null +++ b/app/policies/api/v0/plans_policy.rb @@ -0,0 +1,23 @@ +module Api + module V0 + class PlansPolicy < ApplicationPolicy + attr_reader :user + attr_reader :template + + def initialize(user, template) + raise Pundit::NotAuthorizedError, _("must be logged in") unless user + unless user.org.token_permission_types.include? TokenPermissionType::PLANS + raise Pundit::NotAuthorizedError, _("must have access to plans api") + end + @user = user + @template = template + end + + ## + # users can create a plan if their template exists + def create? + @template.present? + end + end + end +end \ No newline at end of file diff --git a/app/views/api/v0/guidance_groups/index.json.jbuilder b/app/views/api/v0/guidance_groups/index.json.jbuilder index 8d283d3..7a5fd3d 100644 --- a/app/views/api/v0/guidance_groups/index.json.jbuilder +++ b/app/views/api/v0/guidance_groups/index.json.jbuilder @@ -7,4 +7,11 @@ json.optional guidance_group.optional_subset json.updated guidance_group.updated_at -end + json.guidances guidance_group.guidances.each do |guidance| + json.text guidance.text + json.updated guidance.updated_at + json.themes guidance.themes.each do |theme| + json.title theme.title + end + end +end \ No newline at end of file diff --git a/app/views/api/v0/plans/create.json.jbuilder b/app/views/api/v0/plans/create.json.jbuilder index ebb8c58..0c3b359 100644 --- a/app/views/api/v0/plans/create.json.jbuilder +++ b/app/views/api/v0/plans/create.json.jbuilder @@ -2,14 +2,11 @@ json.prettify! -json.project do - json.title @project.title +json.plan do + json.title @plan.title + json.template @plan.template.title # TODO add after decision on user creation/identification - #json.created_by @project.owner.email - json.id @project.id - json.created_at @project.created_at -end - -# json.location do -# json.link (url_for action: 'show', controller: 'project') -# end + json.created_by @plan.owner.email + json.id @plan.id + json.created_at @plan.created_at +end \ No newline at end of file diff --git a/app/views/api/v0/statistics/plans.json.jbuilder b/app/views/api/v0/statistics/plans.json.jbuilder index a2ca5c1..fdefac1 100644 --- a/app/views/api/v0/statistics/plans.json.jbuilder +++ b/app/views/api/v0/statistics/plans.json.jbuilder @@ -3,13 +3,10 @@ json.plans @org_plans.each do |plan| json.id plan.id json.grant_number plan.grant_number - json.org_id plan.owner.org.id + json.title plan.title json.template do json.title plan.template.title - json.id plan.template.id - end - json.project do - json.title plan.title + json.id plan.template.dmptemplate_id end json.funder do json.name (plan.template.org.funder? ? plan.template.org.name : '') diff --git a/app/views/api/v0/statistics/plans_by_template.json.jbuilder b/app/views/api/v0/statistics/plans_by_template.json.jbuilder index d8d5485..9a7efd8 100644 --- a/app/views/api/v0/statistics/plans_by_template.json.jbuilder +++ b/app/views/api/v0/statistics/plans_by_template.json.jbuilder @@ -1,20 +1,7 @@ json.prettify! -templates = {} -@org_projects.each do |plan| - # if hash exists - if templates[plan.template.title].blank? - templates[plan.template.title] = {} - templates[plan.template.title][:title] = plan.template.title - templates[plan.template.title][:id] = plan.template.id - templates[plan.template.title][:uses] = 1 - else - templates[plan.template.title][:uses] += 1 - end -end -json.templates templates.each do |template, info| +json.templates @templates.each do |template, info| json.template_name info[:title] json.template_id info[:id] json.template_uses info[:uses] -end - +end \ No newline at end of file diff --git a/app/views/api/v0/statistics/using_template.json.jbuilder b/app/views/api/v0/statistics/using_template.json.jbuilder index 04a77b6..9a7efd8 100644 --- a/app/views/api/v0/statistics/using_template.json.jbuilder +++ b/app/views/api/v0/statistics/using_template.json.jbuilder @@ -1,3 +1,7 @@ json.prettify! -json.plans_using_template @template_count \ No newline at end of file +json.templates @templates.each do |template, info| + json.template_name info[:title] + json.template_id info[:id] + json.template_uses info[:uses] +end \ No newline at end of file diff --git a/app/views/api/v0/templates/index.json.jbuilder b/app/views/api/v0/templates/index.json.jbuilder index 643d87d..5f9b5ff 100644 --- a/app/views/api/v0/templates/index.json.jbuilder +++ b/app/views/api/v0/templates/index.json.jbuilder @@ -2,11 +2,18 @@ json.prettify! json.templates @org_templates.each do |org, templates| - json.organisation_name org.name - json.organisation_id org.id - json.organisation_templates templates.each do |_, template| - json.title template.title - json.id template.id - json.description template.description - end + json.organisation_name org.name + json.organisation_id org.id + json.is_funder org.funder? + json.organisation_templates templates[:own].each do |_, template| + json.title template.title + json.id template.dmptemplate_id + json.description template.description + end + json.customized_templates templates[:cust].each do |_,template| + json.title template.title + json.id template.dmptemplate_id + json.customization_of template.customization_of + json.description template.description + end end \ No newline at end of file diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index ec280ec..a9c5b2f 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -80,11 +80,10 @@ <% unless @user.api_token.blank? %>
- <%= f.label :api_token, _('API token') %> -
<%= @user.api_token %>
- - -
<%= link_to( _('How to use the API'), controller: "token_permission_types", action: "index")%>
+ <%= f.label :api_token, _('API token') %><%= @user.api_token %> +
+
+ <%= link_to( _('How to use the API'), controller: "token_permission_types", action: "index")%>
<% end %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 9dd7c36..0c689be 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,4 +1,4 @@ -

<%= _('Sign up') %>

+

<%= _('Create account') %>

<% unless session["devise.shibboleth_data"].nil? %>

<%= (_("%{application_name} doesn't recognise your institutional credentials - either you haven't created an account with us or you haven't linked these details to your existing account.
* If you do not have an account with %{application_name}, please complete the form below.
* If you have an account with %{application_name}, please Sign in so we can link your account to your institutional credentials.
Once you have created and/or linked your account, you'll be able to sign in with your institutional credentials directly.") % { :application_name => Rails.configuration.branding[:application][:name] }).html_safe %> diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 40441b0..92bfeb2 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -38,9 +38,9 @@

- <%= _('Sign up') %> + <%= _('Create account') %>

- <%= _('New to %{application_name}? Sign up today.') % {:application_name => Rails.configuration.branding[:application][:name]} %> + <%= _('New to %{application_name}? Create an account today.') % {:application_name => Rails.configuration.branding[:application][:name]} %>

diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 14cca4f..4866e06 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -33,7 +33,7 @@