diff --git a/app/controllers/token_permission_types_controller.rb b/app/controllers/token_permission_types_controller.rb deleted file mode 100644 index 345bf1f..0000000 --- a/app/controllers/token_permission_types_controller.rb +++ /dev/null @@ -1,12 +0,0 @@ -class TokenPermissionTypesController < ApplicationController - respond_to :html - - ## - # GET - Lists all TokenPermissionTypes available to the user - # also lists their description - def index - authorize TokenPermissionType - @user = current_user - @token_types = @user.org.token_permission_types - end -end \ No newline at end of file diff --git a/app/views/annotations/_DELETE_add_annotation.html.erb b/app/views/annotations/_DELETE_add_annotation.html.erb new file mode 100644 index 0000000..d84fef9 --- /dev/null +++ b/app/views/annotations/_DELETE_add_annotation.html.erb @@ -0,0 +1,32 @@ + +

<%= _('Add Annotations') %>

+<%= form_tag admin_create_annotation_path , class: 'add_annotation_form' do %> + + + + + + + + + +
<%= _('Example Answer')%> +
    +
  • <%= text_area_tag :example_answer_text, nil, rows: 5 %> +
  • +
+
<%= _('Guidance')%> +
    +
  • <%= text_area_tag :guidance_text, nil, rows: 5 %> +
  • +
+
+
+ + +
+ <%= submit_tag _('Save'), class: "btn btn-primary", role: 'button' %> + <%= hidden_field_tag :question_id, question.id, class: "question_id" %> + <%= link_to _('Cancel'), "#", class: "btn cancel cancel_add_annotations", role: 'button' %> +
+<%end%> diff --git a/app/views/annotations/_DELETE_edit_annotation.html.erb b/app/views/annotations/_DELETE_edit_annotation.html.erb new file mode 100644 index 0000000..cae438b --- /dev/null +++ b/app/views/annotations/_DELETE_edit_annotation.html.erb @@ -0,0 +1,43 @@ + +<%= form_tag admin_update_annotation_path, method: :put do %> + <% example_answer_text = example_answer.present? ? example_answer.text : '' %> + <% guidance_text = guidance.present? ? guidance.text : '' %> + <%= hidden_field_tag :example_answer_id, example_answer.present? ? example_answer.id : nil %> + <%= hidden_field_tag :guidance_id, guidance.present? ? guidance.id : nil %> + + + + + + + + + + +
<%= _('Example Answer')%> +
    +
  • <%= text_area_tag :example_answer_text, example_answer_text, rows: 5 %>
  • +
+
<%= _('Guidance')%> +
    +
  • <%= text_area_tag :guidance_text, guidance_text, rows: 5 %>
  • +
+
+
+ + +
+ <%= submit_tag _('Save'), class: 'btn btn-primary', role: 'button' %> + <% if example_answer.present? %> + <%= link_to _('Delete Example Answer'), admin_destroy_annotation_path(id: example_answer.id), + confirm: _("You are about to delete an example answer for '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary", role: 'button' %> + <% end %> + <% if guidance.present? %> + <%= link_to _('Delete Example Answer'), admin_destroy_annotation_path(id: guidance.id), + confirm: _("You are about to delete a guidance for '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary", role: 'button'%> + <% end %> + + <%= hidden_field_tag :question_id, question.id, class: "question_id" %> + <%= link_to _('Cancel'), '#', class: 'btn cancel cancel_edit_annotations', role: 'button' %> +
+<% end %> diff --git a/app/views/annotations/_DELETE_show_annotation.html.erb b/app/views/annotations/_DELETE_show_annotation.html.erb new file mode 100644 index 0000000..9ed4d19 --- /dev/null +++ b/app/views/annotations/_DELETE_show_annotation.html.erb @@ -0,0 +1,26 @@ + +

<%= _('Annotations') %>

+ + <% if example_answer.present? %> + + + + + <% end %> + <% if guidance.present? %> + + + + + <% end %> +
+ <%= _('Example Answer')%> + <%= raw example_answer.text %>
+ <%= _('Guidance')%> + <%= raw guidance.text %>
+
+ +
+ <%= hidden_field_tag :question_id, question.id, class: "question_id" %> + <%= link_to _('Edit Annotations'), '# ', class: "btn btn-primary edit_form_for_annotations", role: 'button'%> +
diff --git a/app/views/annotations/_add_annotation.html.erb b/app/views/annotations/_add_annotation.html.erb deleted file mode 100644 index d84fef9..0000000 --- a/app/views/annotations/_add_annotation.html.erb +++ /dev/null @@ -1,32 +0,0 @@ - -

<%= _('Add Annotations') %>

-<%= form_tag admin_create_annotation_path , class: 'add_annotation_form' do %> - - - - - - - - - -
<%= _('Example Answer')%> -
    -
  • <%= text_area_tag :example_answer_text, nil, rows: 5 %> -
  • -
-
<%= _('Guidance')%> -
    -
  • <%= text_area_tag :guidance_text, nil, rows: 5 %> -
  • -
-
-
- - -
- <%= submit_tag _('Save'), class: "btn btn-primary", role: 'button' %> - <%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <%= link_to _('Cancel'), "#", class: "btn cancel cancel_add_annotations", role: 'button' %> -
-<%end%> diff --git a/app/views/annotations/_edit_annotation.html.erb b/app/views/annotations/_edit_annotation.html.erb deleted file mode 100644 index cae438b..0000000 --- a/app/views/annotations/_edit_annotation.html.erb +++ /dev/null @@ -1,43 +0,0 @@ - -<%= form_tag admin_update_annotation_path, method: :put do %> - <% example_answer_text = example_answer.present? ? example_answer.text : '' %> - <% guidance_text = guidance.present? ? guidance.text : '' %> - <%= hidden_field_tag :example_answer_id, example_answer.present? ? example_answer.id : nil %> - <%= hidden_field_tag :guidance_id, guidance.present? ? guidance.id : nil %> - - - - - - - - - - -
<%= _('Example Answer')%> -
    -
  • <%= text_area_tag :example_answer_text, example_answer_text, rows: 5 %>
  • -
-
<%= _('Guidance')%> -
    -
  • <%= text_area_tag :guidance_text, guidance_text, rows: 5 %>
  • -
-
-
- - -
- <%= submit_tag _('Save'), class: 'btn btn-primary', role: 'button' %> - <% if example_answer.present? %> - <%= link_to _('Delete Example Answer'), admin_destroy_annotation_path(id: example_answer.id), - confirm: _("You are about to delete an example answer for '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary", role: 'button' %> - <% end %> - <% if guidance.present? %> - <%= link_to _('Delete Example Answer'), admin_destroy_annotation_path(id: guidance.id), - confirm: _("You are about to delete a guidance for '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary", role: 'button'%> - <% end %> - - <%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <%= link_to _('Cancel'), '#', class: 'btn cancel cancel_edit_annotations', role: 'button' %> -
-<% end %> diff --git a/app/views/annotations/_show_annotation.html.erb b/app/views/annotations/_show_annotation.html.erb deleted file mode 100644 index 9ed4d19..0000000 --- a/app/views/annotations/_show_annotation.html.erb +++ /dev/null @@ -1,26 +0,0 @@ - -

<%= _('Annotations') %>

- - <% if example_answer.present? %> - - - - - <% end %> - <% if guidance.present? %> - - - - - <% end %> -
- <%= _('Example Answer')%> - <%= raw example_answer.text %>
- <%= _('Guidance')%> - <%= raw guidance.text %>
-
- -
- <%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <%= link_to _('Edit Annotations'), '# ', class: "btn btn-primary edit_form_for_annotations", role: 'button'%> -
diff --git a/app/views/answers/_form_fields.html.erb b/app/views/answers/_form_fields.html.erb deleted file mode 100644 index e69de29..0000000 --- a/app/views/answers/_form_fields.html.erb +++ /dev/null diff --git a/app/views/answers/_locking.html.erb b/app/views/answers/_locking.html.erb index 40a3d90..1a34b49 100644 --- a/app/views/answers/_locking.html.erb +++ b/app/views/answers/_locking.html.erb @@ -2,4 +2,4 @@

<%= _('The following answer cannot be saved') %>

<%= render partial: '/answers/new_edit', locals: { question: question, answer: answer, readonly: true } %>

<%= _('since %{name} saved the answer below while you were editing. Please, combine your changes and then save the answer again.') % { name: user.name} %>

- + \ No newline at end of file diff --git a/app/views/contact_us/contacts/new_formtastic.html.erb b/app/views/contact_us/contacts/new_formtastic.html.erb deleted file mode 100644 index 8554019..0000000 --- a/app/views/contact_us/contacts/new_formtastic.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

<%= t('.contact_us') %>

-<%= semantic_form_for @contact, :url => contacts_path do |f| %> - <%= f.input :name, :label => t('.name') if ContactUs.require_name %> - <%= f.input :email, :label => t('.email') %> - <%= f.input :subject, :label => t('.subject') if ContactUs.require_subject %> - <%= f.input :message, :as => :text, :label => t('.message') %> - <%= f.action :submit, :label => t('.submit'), :button_html => { :alt => t('.submit'), :id => 'contact_us_contact_submit', :title => t('.submit') } %> -<% end %> diff --git a/app/views/contact_us/contacts/new_simple_form.html.erb b/app/views/contact_us/contacts/new_simple_form.html.erb deleted file mode 100644 index b4593f0..0000000 --- a/app/views/contact_us/contacts/new_simple_form.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

<%= t('.contact_us') %>

-<%= simple_form_for @contact, :url => contacts_path do |f| %> - <%= f.input :name, :label => t('.name') if ContactUs.require_name %> - <%= f.input :email, :label => t('.email') %> - <%= f.input :subject, :label => t('.subject') if ContactUs.require_subject %> - <%= f.input :message, :as => :text, :label => t('.message') %> - <%= f.button :submit, :label => t('.submit'), :button_html => { :alt => t('.submit'), :id => 'contact_us_contact_submit', :title => t('.submit') } %> -<% end %> diff --git a/app/views/devise/invitations/new.html.erb b/app/views/devise/invitations/new.html.erb deleted file mode 100644 index 5aee6f2..0000000 --- a/app/views/devise/invitations/new.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -
-
-

<%= t "devise.invitations.new.header" %>

-
-
- -
-
- <%= form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :post} do |f| %> - <%= devise_error_messages! %> - - <% resource.class.invite_key_fields.each do |field| -%> -

<%= f.label field %>
- <%= f.text_field field %>

- <% end -%> - -

<%= f.submit t("devise.invitations.new.submit_button") %>

- <% end %> -
-
\ No newline at end of file diff --git a/app/views/devise/registrations/_personal_details.html.erb b/app/views/devise/registrations/_personal_details.html.erb index 4514f7e..69db266 100644 --- a/app/views/devise/registrations/_personal_details.html.erb +++ b/app/views/devise/registrations/_personal_details.html.erb @@ -102,8 +102,9 @@ <% unless @user.api_token.blank? %>
<%= f.label(:api_token, _('API token'), class: "col-sm-2 control-label") %> - <%= @user.api_token %> - <%= link_to( _('How to use the API'), controller: "token_permission_types", action: "index")%> +
<%= @user.api_token %>
+ <%= label_tag(:api_information, _('API Information'), class: "col-sm-2 control-label") %> +
<%= _('How to use the API') %>
<% end %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb deleted file mode 100644 index b37fa86..0000000 --- a/app/views/devise/registrations/new.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -
-
-

<%= _('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 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 %> -

- <% cookies[:show_shib_link] = { value: 'show_shib_link', expires: 3.hours.from_now } %> - <% end %> -
-
-
-
- <%= render :partial => 'shared/create_account_form', locals: {extended: false} %> -
-
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb deleted file mode 100644 index 34c952a..0000000 --- a/app/views/devise/sessions/new.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -
-
-

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

-
-
- -
-
- <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> -
- - - - - - - - - - - - - -
<%= _('Email') %><%= f.email_field :email, :autofocus => true %>
<%= _('Password') %><%= f.password_field :password %>
<% if devise_mapping.rememberable? -%> -
- <%= f.check_box :remember_me %> - <%= f.label :remember_me %> -
- <% end -%> -
-
- <%= f.submit _('Sign in'), :class => "btn btn-primary" %> -
-
- <% end %> - - <%= render "devise/shared/links" %> -
-
diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb deleted file mode 100644 index 08db6da..0000000 --- a/app/views/devise/unlocks/new.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -
-
-

<%= t('custom_devise.resend_unlock') %>

-
-
- -
-
- <%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
- -
<%= f.submit "Resend unlock instructions" %>
- <% end %> - - <%= render "devise/shared/links" %> -
-
\ No newline at end of file diff --git a/app/views/guidance_groups/admin_edit.html.erb b/app/views/guidance_groups/admin_edit.html.erb index c390fc6..1ff0013 100644 --- a/app/views/guidance_groups/admin_edit.html.erb +++ b/app/views/guidance_groups/admin_edit.html.erb @@ -11,37 +11,21 @@
<%= f.label _('Name'), for: :name, class: "col-sm-2 control-label" %>
- <%= f.text_field :name, as: :string, class: "form-control" %> -
-
- " aria-label="<%= _('More information: Guidance group names') %>"> - + <%= f.text_field :name, as: :string, class: "form-control", 'data-toggle': 'tooltip', title: _('Add an appropriate name for your guidance group. This name will be used to tell the end user where the guidance has come from. It will be appended to text identifying the theme e.g. "[guidance group name]: guidance on data sharing" so we suggest you just use the institution or department name.') %>
<%= f.label _('Published'), for: :published, class: "col-sm-2 control-label" %>
- <%= f.check_box :published %> -
-
- <% lbl = _("Check this box when you are ready for guidance associated with this group to appear on user's plans.") %> - - + <%= f.check_box :published, 'data-toggle': 'tooltip', title: _("Check this box when you are ready for guidance associated with this group to appear on user's plans.") %>
<%= f.label _('Optional Subset'), for: :optional_subset, class: "col-sm-2 control-label" %>
- <%= f.check_box :optional_subset %> <%= _('e.g. School/ Department') %> -
-
- " aria-label="<%= _('More information: Optional subsets for guidance groups') %>"> - + <%= f.check_box :optional_subset, 'data-toggle': 'tooltip', title: _("If the guidance is only meant for a subset of users e.g. those in a specific college or institute, check this box. Users will be able to select to display this subset guidance when answering questions in the 'create plan' wizard.") %> <%= _('e.g. School/ Department') %>
diff --git a/app/views/guidance_groups/admin_new.html.erb b/app/views/guidance_groups/admin_new.html.erb index 9ade9d6..fd79fc1 100644 --- a/app/views/guidance_groups/admin_new.html.erb +++ b/app/views/guidance_groups/admin_new.html.erb @@ -10,24 +10,14 @@
<%= f.label _('Name'), for: :name, class: "col-sm-2 control-label" %>
- <%= f.text_field :name, as: :string, class: "form-control" %> -
-
- " aria-label="<%= _('More information: Guidance group names') %>"> - + <%= f.text_field :name, as: :string, class: "form-control", 'data-toggle': 'tooltip', title: _('Add an appropriate name for your guidance group. This name will be used to tell the end user where the guidance has come from. It will be appended to text identifying the theme e.g. "[guidance group name]: guidance on data sharing" so we suggest you just use the institution or department name.') %>
<%= f.label _('Optional Subset'), for: :optional_subset, class: "col-sm-2 control-label" %>
- <%= f.check_box :optional_subset %> <%= _('e.g. School/ Department') %> -
-
- " aria-label="<%= _('More information: Optional subsets for guidance groups') %>"> - + <%= f.check_box :optional_subset, 'data-toggle': 'tooltip', title: _("If the guidance is only meant for a subset of users e.g. those in a specific college or institute, check this box. Users will be able to select to display this subset guidance when answering questions in the 'create plan' wizard.") %> <%= _('e.g. School/ Department') %>
diff --git a/app/views/guidances/_DELETE_edit_guidance.html.erb b/app/views/guidances/_DELETE_edit_guidance.html.erb deleted file mode 100644 index ffae58d..0000000 --- a/app/views/guidances/_DELETE_edit_guidance.html.erb +++ /dev/null @@ -1,26 +0,0 @@ - -<%= form_for(suggested_answer, url: admin_update_suggested_answer_path(suggested_answer), html: { method: :put}) do |f| %> - <%= f.hidden_field :org_id, value: current_user.org_id %> - - - - - - -
<%= _('Suggested answer/ Example')%> -
    -
  • <%= f.select :is_example, {_('Example Answer') => true, _('Suggested answer') => false} %>
  • -
  • <%= f.text_area :text, rows: 5 %>
  • -
-
-
- - -
- <%= f.submit _('Save'), class: "btn btn-primary" %> - <%= link_to _('Delete'), admin_destroy_suggested_answer_path(id: suggested_answer.id), - confirm: _("You are about to delete a suggested answer/ example for '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary"%> - <%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <%= link_to _('Cancel'), "#", class: "btn cancel cancel_edit_suggested_answer" %> -
-<%end%> diff --git a/app/views/layouts/_es5_scripts.html.erb b/app/views/layouts/_es5_scripts.html.erb index 2cc8522..e636952 100644 --- a/app/views/layouts/_es5_scripts.html.erb +++ b/app/views/layouts/_es5_scripts.html.erb @@ -31,9 +31,8 @@ <%= javascript_include_tag 'views/guidances/admin_edit.js' %> <%= javascript_include_tag 'views/home/index.js' %> - <%= javascript_include_tag 'views/orgs/admin_edit.js' %> + <%= javascript_include_tag 'views/orgs/shibboleth_ds.js' %> <%= javascript_include_tag 'views/plans/available_templates.js' %> - <%= javascript_include_tag 'views/plans/index.js' %> <%= javascript_include_tag 'views/registrations/sign_in_sign_up.js' %> <%= javascript_include_tag 'views/shared/login_form.js' %> <%= javascript_include_tag 'views/shared/register_form.js' %> diff --git a/app/views/phases/_DELETE_answer_form.html.erb b/app/views/phases/_DELETE_answer_form.html.erb deleted file mode 100644 index 762340d..0000000 --- a/app/views/phases/_DELETE_answer_form.html.erb +++ /dev/null @@ -1,122 +0,0 @@ - - -
- <% - answers = question.plan_answers(plan.id) - if answers.present? - answer = answers.first - else - answer = Answer.new({ plan_id: plan.id, question_id: question.id, user_id: current_user.id }) - if question.default_value.present? - answer.text = question.default_value - end - end - %> -
-
" class="answer-locking">
-
"> - <%= render(partial: 'answers/new_edit', locals: { question: question, answer: answer, readonly: readonly }) %> -
-
" class="answer-status"> - <%= render(partial: 'answers/status', locals: { answer: answer }) %> -
-
-
- - -
- -
- <% comments = answer.notes.all %> - <%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <% active_tab = nil %> - - - - -
-
- - - -
- - - <% num_annotations = 0 %> - <% i = 0 %> - <% if annotations.present? %> - <% annotations.each do |annotation| %> - -

- <%= annotation.org.abbreviation %> <%= _('Guidance') %> - -

- - -
-
<%= raw annotation.text %>
-
- <% num_annotations += 1%> - <% i += 1 %> - <% end %> - <% end %> - - - <% guidance_accordion_id = num_annotations %> - <% question_guidances.each_pair do |theme, group| %> - <% group.each do |gobj| %> -

- <%= gobj[:org] %> guidance on <%= theme %> - -

- -
-
<%= raw gobj[:text] %>
-
- <% guidance_accordion_id += 1 %> - <% i += 1 %> - <% end %> - <% end %> - -
- -
- -
- - - <%= render partial: "note", locals: {question: question, answer: answer, plan: plan, suffix: "" }%> - -
-
-
-
- - -<% if last_question_id == question.id then %> -
-<% else %> -
-<% end %> diff --git a/app/views/phases/admin_preview.html.erb b/app/views/phases/admin_preview.html.erb index bb0fee7..bee3206 100644 --- a/app/views/phases/admin_preview.html.erb +++ b/app/views/phases/admin_preview.html.erb @@ -1,62 +1,62 @@ -
-
-

- <%= @template.title %> - -
- <%= link_to _('Back to edit view'), - admin_show_phase_path(id: @phase.id, edit: "true"), - class: 'btn btn-primary' %> - <%= link_to _('View all templates'), - admin_index_template_path, - class: 'btn btn-primary' %> -
-

-
-
- -
-
- - <%= render partial: "templates/admin_nav_tabs", locals: {template: @template, active: @phase.id} %> - - -
-
- <% sections = @phase.sections %> - <% sections.order(:number).each do |section| %> -
- -
-
- <%= raw section.description %> -
-
- <% last_question_id = section.questions.order("number DESC").first.id%> - - <% section.questions.order("number").each do |question| %> - - <%= render partial: 'questions/preview_question', locals: {question: question}%> - <% if last_question_id == question.id then %> -
- <% else %> -
- <% end %> - - <% end %> -
-
-
- <% end %> -
-
-
+
+
+

+ <%= @template.title %> + +
+ <%= link_to _('Back to edit view'), + admin_show_phase_path(id: @phase.id, edit: "true"), + class: 'btn btn-primary' %> + <%= link_to _('View all templates'), + admin_index_template_path, + class: 'btn btn-primary' %> +
+

+
+
+ +
+
+ + <%= render partial: "templates/admin_nav_tabs", locals: {template: @template, active: @phase.id} %> + + +
+
+ <% sections = @phase.sections %> + <% sections.order(:number).each do |section| %> +
+ +
+
+ <%= raw section.description %> +
+
+ <% last_question_id = section.questions.order("number DESC").first.id%> + + <% section.questions.order("number").each do |question| %> + + <%= render partial: 'questions/preview_question', locals: {question: question}%> + <% if last_question_id == question.id then %> +
+ <% else %> +
+ <% end %> + + <% end %> +
+
+
+ <% end %> +
+
+
\ No newline at end of file diff --git a/app/views/phases/edit.html.erb b/app/views/phases/edit.html.erb index 92b5bb6..0d0946f 100644 --- a/app/views/phases/edit.html.erb +++ b/app/views/phases/edit.html.erb @@ -6,6 +6,6 @@
- <%= render partial: 'edit_plan_answers', layout: 'shared/plan_navigation', locals: {} %> + <%= render partial: 'edit_plan_answers', layout: 'plans/navigation', locals: {} %>
\ No newline at end of file diff --git a/app/views/plans/_answer_form_ro.html.erb b/app/views/plans/_answer_form_ro.html.erb deleted file mode 100644 index e035e1c..0000000 --- a/app/views/plans/_answer_form_ro.html.erb +++ /dev/null @@ -1,51 +0,0 @@ - -<% answer = @plan.answer(question.id) %> - -
- - <% q_format = question.question_format%> - -
-

<%= question.text %>

- -
- <% if q_format.title == "Check box" || q_format.title == "Multi select box" || - q_format.title == "Radio buttons" || q_format.title == "Dropdown" %> -
    - <% if answer.question_options.is_a? Array then %> -
  • <%= answer.question_options.text %>
  • - <% else %> - <% answer.question_options.each do |o| %> -
  • <%= o.text %>
  • - <% end %> - <% end %> -
- <% end %> - -
- <%= raw answer.text %> -
-
-
- - <% if answer.created_at.nil? then %> - <%= _('Not answered yet') %> - <% else %> - <%= _('Answered')%><%= answer.created_at %><%= _(' by')%><%= answer.user.name %> - <% end %> - - - -
- - -<% if last_question_id == question.id then %> -
-<% else %> -
-<% end %> diff --git a/app/views/plans/_available_templates.html.erb b/app/views/plans/_available_templates.html.erb deleted file mode 100644 index 8f3b2df..0000000 --- a/app/views/plans/_available_templates.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<%= _('Which DMP template would you like to use?') %> - -
- <%= label_tag(:plan_template_selector, _('Select a template')) %> - - <%= select_tag(:plan_template_selector, - options_from_collection_for_select(@templates, 'id', 'title'), - class: 'left-indent input-extra-large', - prompt: _('Please select one')) - %> -
- -
-
-

<%= _('We found multiple DMP templates corresponding to your funder.') %>

-
-
\ No newline at end of file diff --git a/app/views/plans/_export.html.erb b/app/views/plans/_export.html.erb deleted file mode 100644 index fdaa663..0000000 --- a/app/views/plans/_export.html.erb +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/app/views/plans/_form.html.erb b/app/views/plans/_form.html.erb deleted file mode 100644 index 4c4404a..0000000 --- a/app/views/plans/_form.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -<%= form_for @plan, :html => { :class => 'form-horizontal' } do |f| %> -
- <%= f.label :locked, :class => 'control-label' %> -
- <%= f.check_box :locked, :class => 'check_box' %> -
-
-
- <%= f.label :project_id, :class => 'control-label' %> -
- <%= f.number_field :project_id, :class => 'number_field' %> -
-
-
- <%= f.label :version_id, :class => 'control-label' %> -
- <%= f.number_field :version_id, :class => 'number_field' %> -
-
-
- <%= f.label :slug, :class => 'control-label' %> -
- <%= f.text_field :slug, :class => 'text_field' %> -
-
- -
- <%= f.submit nil, :class => 'btn btn-primary' %> - <%= link_to _('helpers.links.cancel'), - plans_path, :class => 'btn' %> -
-<% end %> diff --git a/app/views/plans/_navigation.html.erb b/app/views/plans/_navigation.html.erb new file mode 100644 index 0000000..a6ffbd4 --- /dev/null +++ b/app/views/plans/_navigation.html.erb @@ -0,0 +1,23 @@ + +
+
+ <%= yield %> +
+
diff --git a/app/views/plans/_show_phase.html.erb b/app/views/plans/_show_phase.html.erb deleted file mode 100644 index e69de29..0000000 --- a/app/views/plans/_show_phase.html.erb +++ /dev/null diff --git a/app/views/plans/create.html.erb b/app/views/plans/create.html.erb deleted file mode 100644 index 875aaa2..0000000 --- a/app/views/plans/create.html.erb +++ /dev/null @@ -1,20 +0,0 @@ - -
- -

Choose one of these templates:

- - -<%= form_tag(controller: "plans", action: "create", method: "post", class: "choose_template_form") do %> - - <%= submit_tag("Create Plan") %> -<% end %> - - -
diff --git a/app/views/plans/create.js.erb b/app/views/plans/create.js.erb deleted file mode 100644 index 11be185..0000000 --- a/app/views/plans/create.js.erb +++ /dev/null @@ -1,16 +0,0 @@ -$("#available-templates").fadeOut(); - -<% if @templates.nil? %> - $(".main_page_content").prepend('

<%= raw notice %>

'); - -<% elsif @templates.count > 1 %> - // Clear the existing contents of the modal and then display template combobox - $("#available-templates").html("<%= escape_javascript(render partial: 'available_templates') %>").fadeIn(); - -<% else %> - // Only one template so fill in the id - $("#plan_template_id").val("<%= @templates.first.id %>"); -<% end %> - -// Force the submit button toggle -$("#plan_template_id").change(); \ No newline at end of file diff --git a/app/views/plans/download.html.erb b/app/views/plans/download.html.erb index f971efe..d10ee74 100644 --- a/app/views/plans/download.html.erb +++ b/app/views/plans/download.html.erb @@ -7,6 +7,6 @@
- <%= render partial: 'download_form', layout: '/shared/plan_navigation', locals: { plan: @plan } %> + <%= render partial: 'download_form', layout: 'navigation', locals: { plan: @plan } %>
diff --git a/app/views/plans/share.html.erb b/app/views/plans/share.html.erb index c6660f6..0a679b3 100644 --- a/app/views/plans/share.html.erb +++ b/app/views/plans/share.html.erb @@ -7,6 +7,6 @@
- <%= render partial: 'share_form', layout: '/shared/plan_navigation', locals: { plan: @plan } %> + <%= render partial: 'share_form', layout: 'navigation', locals: { plan: @plan } %>
\ No newline at end of file diff --git a/app/views/plans/show.html.erb b/app/views/plans/show.html.erb index 8736900..df98d71 100644 --- a/app/views/plans/show.html.erb +++ b/app/views/plans/show.html.erb @@ -8,7 +8,7 @@
<% if @plan.editable_by?(current_user) %> - <%= render partial: 'edit_details', layout: 'shared/plan_navigation', locals: {plan: @plan, visibility: @visibility} %> + <%= render partial: 'edit_details', layout: 'navigation', locals: {plan: @plan, visibility: @visibility} %> <% else %> <%= render partial: 'show_details', locals: {plan: @plan, visibility: @visibility} %> <% end %> diff --git a/app/views/plans/update.js.erb b/app/views/plans/update.js.erb deleted file mode 100644 index 53f05f7..0000000 --- a/app/views/plans/update.js.erb +++ /dev/null @@ -1,7 +0,0 @@ -$("form").html("<%= escape_javascript(render partial: '/edit_details', locals: {plan: @plan}) %>"); - -<% if flash[:alert].present? %> - animateNotification("<%= flash[:alert] %>", true); -<% else %> - animateNotification("<%= flash[:notice] %>", true); -<% end %> \ No newline at end of file diff --git a/app/views/questions/_preview_question.html.erb b/app/views/questions/_preview_question.html.erb index 625cc84..1461bf6 100644 --- a/app/views/questions/_preview_question.html.erb +++ b/app/views/questions/_preview_question.html.erb @@ -1,116 +1,116 @@ - - -
- - - <% q_format = question.question_format %> -
-
- - <% if q_format.option_based? %> - <% options = question.question_options.order("number") %> - - - <% if q_format.checkbox? %> - <%if !options.nil? %> -
- -
    - <% options.each do |op|%> -
  1. - <% end %> -
-
- <% end %> - - <% elsif q_format.multiselectbox? %> - <% if !options.nil? %> - - - <% end %> - - <% elsif q_format.radiobuttons? %> - <% if !options.nil? %> -
- -
    - <% options.each do |op|%> -
  1. - <% end %> -
-
- <% end %> - - <% elsif q_format.dropdown? %> - <% if !options.nil? %> - - - <% end %> - <% end %> - - - <% if question.annotations.where(type: Annotation.types[:example_answer]).any? %> - <% annotation = question.annotations.where(type: Annotation.types[:example_answer]).order(:created_at).first %> -
- - <%= _('example answer')%> - -
-

- <%= raw annotation.text %> -

-
-
- <% end %> - -
- - <% else %> - - - <% annotations = question.annotations.find_by(org_id: current_user.org_id) %> - <% if !annotations.blank? %> -
- - <%= _('example answer')%> - -
-

- <%= raw annotations.text %> -

-
-
- <% end %> - - <% end %> - - - - - <% if q_format.title == _('Text field') %> - - - <% elsif q_format.title == _('Text area') %> - - <% end %> -
- - <%= link_to _('Save'), "#", class: "btn btn-primary", onclick: "event.preventDefault();" %> - - <%= _('Not answered yet') %> - -
-
-
- - - -<%= render partial: "guidances/guidance_display", locals: {question: question}%> + + +
+ + + <% q_format = question.question_format %> +
+
+ + <% if q_format.option_based? %> + <% options = question.question_options.order("number") %> + + + <% if q_format.checkbox? %> + <%if !options.nil? %> +
+ +
    + <% options.each do |op|%> +
  1. + <% end %> +
+
+ <% end %> + + <% elsif q_format.multiselectbox? %> + <% if !options.nil? %> + + + <% end %> + + <% elsif q_format.radiobuttons? %> + <% if !options.nil? %> +
+ +
    + <% options.each do |op|%> +
  1. + <% end %> +
+
+ <% end %> + + <% elsif q_format.dropdown? %> + <% if !options.nil? %> + + + <% end %> + <% end %> + + + <% if question.annotations.where(type: Annotation.types[:example_answer]).any? %> + <% annotation = question.annotations.where(type: Annotation.types[:example_answer]).order(:created_at).first %> +
+ + <%= _('example answer')%> + +
+

+ <%= raw annotation.text %> +

+
+
+ <% end %> + +
+ + <% else %> + + + <% annotations = question.annotations.find_by(org_id: current_user.org_id) %> + <% if !annotations.blank? %> +
+ + <%= _('example answer')%> + +
+

+ <%= raw annotations.text %> +

+
+
+ <% end %> + + <% end %> + + + + + <% if q_format.title == _('Text field') %> + + + <% elsif q_format.title == _('Text area') %> + + <% end %> +
+ + <%= link_to _('Save'), "#", class: "btn btn-primary", onclick: "event.preventDefault();" %> + + <%= _('Not answered yet') %> + +
+
+
+ + + +<%= render partial: "guidances/guidance_display", locals: {question: question}%> diff --git a/app/views/settings/phases/_export_formatting_form.html.erb b/app/views/settings/phases/_export_formatting_form.html.erb deleted file mode 100644 index 3633722..0000000 --- a/app/views/settings/phases/_export_formatting_form.html.erb +++ /dev/null @@ -1,114 +0,0 @@ -<% - @export_settings ||= plan.settings(:export) - admin_settings = @export_settings.fields[:admin] - question_settings = @export_settings.fields[:questions] || :all - filename = @export_settings.title.present? ? @export_settings.title : plan.title -%> -<% @export_settings.errors.full_messages.each do |error| %> -
<%= error %>
-<% end %> - -<%= form_for(@export_settings, url: settings_plan_path(plan), method: :put, as: :export) do |f| %> -
- <%= submit_tag(_('Reset'), class: "btn btn-primary", role:'button')%> - <%= submit_tag(_('Save'), class: "btn btn-primary", "data-toggle" => "collapse", "data-target" => "#settings-accordion-plan-#{plan.id}", role:'button') %> -
- -
-

<%= _('File Name') %>

-
-
    -
  1. - <%= label_tag("export[title]", _('File Name')) %> -
    - <%= text_field_tag("export[title]", filename) %> -
    -
  2. -
-
-
-
-

<%= _('Included Elements') %>

-
-
- - <%= label_tag(:admin_details_toggle, _('Details')) %> - -
    - <% Settings::Template::VALID_ADMIN_FIELDS.each do |field| - name = "export[fields][admin][#{field}]" - %> -
  1. - <%= label_tag(name, t("helpers.plan.export.#{field}")) %> - <%= check_box_tag(name, true, admin_settings.include?(field.to_sym)) %> -
  2. - <% end %> -
-
-
- - <%= label_tag(:sections_toggle, _('Sections')) %> - -
    - <% phase.sections.each do |section| %> -
  1. -
    - - <%= label_tag("section_toggle_#{section.id}", section.title) %> - -
      - <% section.questions.each do |question| - selected = question_settings == :all || question_settings.member?(question.id) - name = "export[fields][questions][#{question.id}]" - %> -
    1. - <%= label_tag(name, strip_tags(question.text).html_safe, title: strip_tags(question.text).html_safe) %> - <%= check_box_tag(name, true, selected) %> -
    2. - <% end %> -
    -
    -
  2. - <% end %> -
-
-
-

<%= _('PDF Formatting') %>

-
- <%= _('Font') -%> -
- <%= label_tag("export[formatting][font_face]", _('Face')) %> - <%= select_tag("export[formatting][font_face]", options_for_select(Settings::Template::VALID_FONT_FACES, @export_settings.formatting[:font_face]), { "data-default" => plan.template.settings(:export).formatting[:font_face] }) %> -
-
- <%= label_tag("export[formatting][font_size]", _('Size') + " (pt)") %> - <%= select_tag("export[formatting][font_size]", options_for_select(Settings::Template::VALID_FONT_SIZE_RANGE.to_a, @export_settings.formatting[:font_size]), { "data-default" => plan.template.settings(:export).formatting[:font_size] }) %> -
-
-
- <%= _('Margin') -%> (mm) -
- <%= label_tag("export[formatting][margin][top]", _('Top')) %> - <%= select_tag("export[formatting][margin][top]", options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a, @export_settings.formatting[:margin][:top]), { "data-default" => plan.template.settings(:export).formatting[:margin][:top] }) %> -
-
- <%= label_tag("export[formatting][margin][bottom]", _('Bottom')) %> - <%= select_tag("export[formatting][margin][bottom]", options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a, @export_settings.formatting[:margin][:bottom]), { "data-default" => plan.template.settings(:export).formatting[:margin][:bottom] }) %> -
-
- <%= label_tag("export[formatting][margin][left]", _('Left')) %> - <%= select_tag("export[formatting][margin][left]", options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a, @export_settings.formatting[:margin][:left]), { "data-default" => plan.template.settings(:export).formatting[:margin][:left] }) %> -
-
- <%= label_tag("export[formatting][margin][right]", _('Right')) %> - <%= select_tag("export[formatting][margin][right]", options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a, @export_settings.formatting[:margin][:right]), { "data-default" => plan.template.settings(:export).formatting[:margin][:rigth] }) %> -
-
-
-
- <%= submit_tag(_('Reset'), class: "btn btn-primary", role:'button') %> - <%= submit_tag(_('Save'), class: "btn btn-primary", "data-toggle" => "collapse", "data-target" => "#settings-accordion-plan-#{plan.template.id}", role:"button") %> -
- -
-<% end %> \ No newline at end of file diff --git a/app/views/settings/phases/show.html.erb b/app/views/settings/phases/show.html.erb deleted file mode 100644 index 796bd51..0000000 --- a/app/views/settings/phases/show.html.erb +++ /dev/null @@ -1,13 +0,0 @@ - -
-
-

<%= _('File Name') -%> - <%= @plan.title -%>

-

<%= _('Description') -%>

-
-
- -
-
- <%= render "export_formatting_form" %> -
-
diff --git a/app/views/settings/phases/show.partial.erb b/app/views/settings/phases/show.partial.erb deleted file mode 100644 index 9017f61..0000000 --- a/app/views/settings/phases/show.partial.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render "export_formatting_form.html.erb" %> diff --git a/app/views/shared/_accessible_submit_button.html.erb b/app/views/shared/_accessible_submit_button.html.erb deleted file mode 100644 index 4917e60..0000000 --- a/app/views/shared/_accessible_submit_button.html.erb +++ /dev/null @@ -1,9 +0,0 @@ - - -<%= tooltip %> diff --git a/app/views/shared/_export_links.html.erb b/app/views/shared/_export_links.html.erb deleted file mode 100644 index db5b32c..0000000 --- a/app/views/shared/_export_links.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -
- <%= label_tag(:format, _('Format')) %> - <%= select_tag(:format, options_for_select(ExportedPlan::VALID_FORMATS, :pdf), class: 'export-format-selection') %> - - - -
- -
-

Export Settings <%= plan_settings_indicator(plan) -%>

- <%= render(partial: "settings/phases/export_formatting_form", locals: { plan: plan, phase: phase }) %> -
diff --git a/app/views/shared/_plan_navigation.html.erb b/app/views/shared/_plan_navigation.html.erb deleted file mode 100644 index a6ffbd4..0000000 --- a/app/views/shared/_plan_navigation.html.erb +++ /dev/null @@ -1,23 +0,0 @@ - -
-
- <%= yield %> -
-
diff --git a/app/views/static_pages/roadmap.html.erb b/app/views/static_pages/roadmap.html.erb deleted file mode 100644 index ed84e52..0000000 --- a/app/views/static_pages/roadmap.html.erb +++ /dev/null @@ -1,42 +0,0 @@ -
-
-

<%= _('Future plans')%>

-
-
- -
-
- - - -
-
- <%= raw _("

The %{organisation_abbreviation} are now collaborating to develop a joint codebase for Data Management Planning called DMP Roadmap. Both of our tools will be delivered using this in the future. We've agreed what features need to be included and are planning a few sprints to deliver these. The initial release will include all of the main priorities we already had flagged, including:

  • - APIs to create plans, extract guidance and generate statistics from %{application_name}
  • - Multi-lingual support so foreign language versions can be presented
  • - Locales to provide a refined set of content for particular countries or other contexts
  • - A lifecycle to indicate the status of DMPs and allow institutional access to plans
  • - Support for reviewing Data Management Plans

%{application_name} has an active and growing user base, and we are grateful to the members who suggest ideas for new and improved features. If you would like to help shape our future plans, please join the user group. More information on how you can engage with us is available under the 'Get involved' tab.

Current release

The current version of %{application_name} is %{application_version}.

The code is available on GitHub


") % { - :organisation_email => Rails.configuration.branding[:organisation][:email], - :organisation_abbreviation => Rails.configuration.branding[:organisation][:abbreviation], - :application_name => Rails.configuration.branding[:application][:name], - :application_url => Rails.configuration.branding[:application][:url], - :application_version => Rails.configuration.branding[:application][:version], - :application_release_notes_url => Rails.configuration.branding[:application][:release_notes_url] } %> -
- -
- <%= raw _("

%{application_name} is developed and maintained by the UK %{organisation_name}. We’re a small team, and are happy to collaborate with others. There are various ways you can get involved:

Join the user group

We run a listserv for the %{application_name} user group that you can request to join. We also host periodic meetings to consult on our plans. Being part of the user group gives you the opportunity to be informed about future developments and to provide feedback to help shape our plans.

Our user group sessions are usually focused around a certain topic (e.g. fleshing out use cases for an API) so invites are sent based on your areas of expertise. It is helpful for us to know your role and interests to invite relevant people to each session. Please introduce yourself on the list and share your ideas.

Notes from previous user group sessions are provided below:

Please let us know your interests and share your ideas for future developments via the mailing list so the community as a whole can feedback on them.

Customise %{application_name}

%{application_name} can be customised by institutions and disciplines. You can add templates for users in your organisation and tailored guidance that explains local support and services. Example answers can also be offered to help users understand what to write in a Data Management Plan. To do this you’ll need to request admin access, so please email us on dmponline@dcc.ac.uk.

Futher guidance on customising %{application_name} is available on the %{application_name} website.

Contribute to the code

%{application_name} is a Ruby on Rails application. The source code is made available under an MIT License. This permits others to reuse the code freely, but obligates you to share the source code for any extensions in the same way. Please inform us if you install an instance of %{application_name} and offer your contributions back to the community.

If you install an instance of %{application_name} we require that you credit the %{organisation_abbreviation} as originators of the tool. We recommend that the acknowledgement takes the form of the %{application_name} logo with a link back to the %{organisation_abbreviation}-hosted version of the tool.

We are willing to work with external developers to add new features to the tool. We are also open to delivering new features on a chargeable basis. If there are extensions you would like to see prioritised and have resource to support additional developer effort, please contact us on dmponline@dcc.ac.uk to negotiate terms.

The code is available on GitHub

Support our work

We are impressed by the uptake of %{application_name} both in the UK and internationally and are really keen to hear how you are using the tool and promoting it in your context. We are aware that others have run training courses, developed guidance materials and advocated use of the tool. Please notify us of this as it helps to show impact.

We are currently investigating options for revenue generation. This will help us serve the increased demand more effectively and safeguard the long-term sustainability of %{application_name}. Plans will be released for consultation soon but we also welcome your suggestions on how best to support our work.

") % { - organisation_name: Rails.configuration.branding[:organisation][:name], - organisation_email: Rails.configuration.branding[:organisation][:email], - organisation_url: Rails.configuration.branding[:organisation][:url], - organisation_abbreviation: Rails.configuration.branding[:organisation][:abbreviation], - application_name: Rails.configuration.branding[:application][:name], - application_url: Rails.configuration.branding[:application][:url], - application_user_group_subscription_url: Rails.configuration.branding[:application][:user_group_subscription_url] } %> -
-
-
-
\ No newline at end of file diff --git a/app/views/templates/_DELETE_edit_annotations.html.erb b/app/views/templates/_DELETE_edit_annotations.html.erb new file mode 100644 index 0000000..efc2244 --- /dev/null +++ b/app/views/templates/_DELETE_edit_annotations.html.erb @@ -0,0 +1,94 @@ + + +<%= form_for(question, url: admin_update_question_path(question), html: { method: :put}) do |f| %> +
+ + <%= f.hidden_field :id,{ class: "quest_id" } %> + + + + + + + + + + + + + + + + + + + + + + + +
<%= _('Question number')%><%= question.number %> +
+
<%= _('Question text')%><%= raw question.text %> +
+
+ <% q_format = question.question_format %> + <% if q_format.title == _('Check box') || q_format.title == _('Multi select box') || q_format.title == _('Radio buttons') || q_format.title == _('Dropdown') %> +
    + <% if question.question_options.is_a? QuestionOption %> +
  • - <%= question.question_options.text %>
  • + <% else %> + <% if !question.question_options.to_a.nil? %> + <% question.question_options.to_a.sort_by{|op| op['number']}.each do |o| %> +
  • - <%= o.text %>
  • + <% end %> + <% end %> + <% end %> +
+ <% end %> +
+
<%= _('example answer')%> +
+ <% annotations = question.annotations.where(org_id: current_user.org_id).where(type: Annotation.types[:example_answer]).order(:created_at).first %> + <% if annotations.nil? %> + <% annotations = question.annotations.build %> + <% end %> + <%= f.fields_for :annotations, annotation do |s|%> + <%= s.hidden_field :org_id, value: current_user.org.id %> +
    +
  • <%= s.text_area :text, rows: 5, 'data-toggle': 'tooltip', title: _('You can add an example or suggested answer to help users respond. These will be presented above the answer box and can be copied/ pasted.') %>
  • +
+ <% end %> +
+
+
+
<%= _('Guidance')%> +
"> + <%= text_area_tag("question-guidance-#{question.id}", question.guidance , class: "tinymce") %> +
+
+
+
+
+ +
+ <%= f.submit _('Save'), class: "btn btn-primary", role:"button" %> + <% if !question.section.phase.template.published? %> + <%= link_to _('Delete'), admin_destroy_question_path(question_id: question.id), + confirm: _("You are about to delete '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary", role:"button"%> + <% end %> + <%= hidden_field_tag :question_id, question.id, class: "question_id" %> + <%= link_to _('Cancel'), "#", class: "btn cancel cancel_edit_question", role:"button" %> +
+
+ + + +<%= render partial: "guidances/guidance_display", locals: {question: question} %> +<% end %> diff --git a/app/views/templates/_edit_annotations.html.erb b/app/views/templates/_edit_annotations.html.erb deleted file mode 100644 index efc2244..0000000 --- a/app/views/templates/_edit_annotations.html.erb +++ /dev/null @@ -1,94 +0,0 @@ - - -<%= form_for(question, url: admin_update_question_path(question), html: { method: :put}) do |f| %> -
- - <%= f.hidden_field :id,{ class: "quest_id" } %> - - - - - - - - - - - - - - - - - - - - - - - -
<%= _('Question number')%><%= question.number %> -
-
<%= _('Question text')%><%= raw question.text %> -
-
- <% q_format = question.question_format %> - <% if q_format.title == _('Check box') || q_format.title == _('Multi select box') || q_format.title == _('Radio buttons') || q_format.title == _('Dropdown') %> -
    - <% if question.question_options.is_a? QuestionOption %> -
  • - <%= question.question_options.text %>
  • - <% else %> - <% if !question.question_options.to_a.nil? %> - <% question.question_options.to_a.sort_by{|op| op['number']}.each do |o| %> -
  • - <%= o.text %>
  • - <% end %> - <% end %> - <% end %> -
- <% end %> -
-
<%= _('example answer')%> -
- <% annotations = question.annotations.where(org_id: current_user.org_id).where(type: Annotation.types[:example_answer]).order(:created_at).first %> - <% if annotations.nil? %> - <% annotations = question.annotations.build %> - <% end %> - <%= f.fields_for :annotations, annotation do |s|%> - <%= s.hidden_field :org_id, value: current_user.org.id %> -
    -
  • <%= s.text_area :text, rows: 5, 'data-toggle': 'tooltip', title: _('You can add an example or suggested answer to help users respond. These will be presented above the answer box and can be copied/ pasted.') %>
  • -
- <% end %> -
-
-
-
<%= _('Guidance')%> -
"> - <%= text_area_tag("question-guidance-#{question.id}", question.guidance , class: "tinymce") %> -
-
-
-
-
- -
- <%= f.submit _('Save'), class: "btn btn-primary", role:"button" %> - <% if !question.section.phase.template.published? %> - <%= link_to _('Delete'), admin_destroy_question_path(question_id: question.id), - confirm: _("You are about to delete '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary", role:"button"%> - <% end %> - <%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <%= link_to _('Cancel'), "#", class: "btn cancel cancel_edit_question", role:"button" %> -
-
- - - -<%= render partial: "guidances/guidance_display", locals: {question: question} %> -<% end %> diff --git a/app/views/token_permission_types/index.html.erb b/app/views/token_permission_types/index.html.erb deleted file mode 100644 index 67ed7ad..0000000 --- a/app/views/token_permission_types/index.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -
-
- <% @token_types.each do |token_type|%> -

- <%= token_type.token_type %> -

-
- -
- <%= token_type.text_description %> -
- - <% end %> -
-
\ No newline at end of file diff --git a/test/functional/token_permission_types_controller_test.rb b/test/functional/token_permission_types_controller_test.rb deleted file mode 100644 index f1cc342..0000000 --- a/test/functional/token_permission_types_controller_test.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'test_helper' - -class TokenPermissionTypesControllerTest < ActionDispatch::IntegrationTest - - include Devise::Test::IntegrationHelpers - - # CURRENT RESULTS OF `rake routes` - # -------------------------------------------------- - # token_permission_types GET /token_permission_types token_permission_types#index - - setup do - @user = User.first - end - - # GET /token_permission_types (token_permission_types_path) - # ---------------------------------------------------------- - test "retrieve the list of token permission types" do - # Should redirect user to the root path if they are not logged in! - get token_permission_types_path - assert_unauthorized_redirect_to_root_path - - sign_in @user - - get token_permission_types_path - assert_response :success - assert assigns(:user) - assert assigns(:token_types) - end - -end \ No newline at end of file