diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index 623d18e..2e2dbc2 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -314,7 +314,7 @@ def set_test plan = Plan.find(params[:id]) authorize plan - plan.visibility = "#{plan_params[:visibility]}" + plan.visibility = (params[:is_test] === "1" ? :is_test : :privately_visible) if plan.save render json: {msg: (plan.is_test? ? _('Your project is now a test.') : _('Your project is no longer a test.') )} else diff --git a/app/views/layouts/_es5_scripts.html.erb b/app/views/layouts/_es5_scripts.html.erb index f153150..350c240 100644 --- a/app/views/layouts/_es5_scripts.html.erb +++ b/app/views/layouts/_es5_scripts.html.erb @@ -5,8 +5,8 @@ <%= javascript_include_tag 'rails.js' %> <%= javascript_include_tag 'jquery-ui.min.js' %> <%= javascript_include_tag 'placeholder.min.js' %> - <%= javascript_include_tag 'jquery.tablesorter.min.js' %> - <%= javascript_include_tag 'jquery.tablesorter.widgets.min.js' %> + <%#= javascript_include_tag 'jquery.tablesorter.min.js' %> + <%#= javascript_include_tag 'jquery.tablesorter.widgets.min.js' %> <%= javascript_include_tag 'jquery.timeago.js' %> <%#= javascript_include_tag 'bootstrap.min.js' %> @@ -17,8 +17,8 @@ <%= javascript_include_tag 'utils_es5/tinymce.js' %> <%= javascript_include_tag 'utils_es5/validate.js' %> <%= javascript_include_tag 'utils_es5/ariatiseForm.js' %> - <%= javascript_include_tag 'utils_es5/filteriseTable.js' %> - <%= javascript_include_tag 'utils_es5/collateTable.js' %> + <%#= javascript_include_tag 'utils_es5/filteriseTable.js' %> + <%#= javascript_include_tag 'utils_es5/collateTable.js' %> @@ -33,6 +33,7 @@ <%= 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' %> diff --git a/app/views/phases/_admin_add.html.erb b/app/views/phases/_admin_add.html.erb index 5d60ffd..39bff5a 100644 --- a/app/views/phases/_admin_add.html.erb +++ b/app/views/phases/_admin_add.html.erb @@ -1,4 +1,3 @@ -<%- model_class = Phase -%>

<%= _('Phase details') %>

<%= _('When you create a new phase for your template, a version will automatically be created. Once you complete the form below you will be provided with options to create sections and questions.') %>

<%= form_for :phase, { url: admin_create_phase_path, html: { class: 'form-horizontal' }} do |f| %> diff --git a/app/views/phases/admin_preview.html.erb b/app/views/phases/admin_preview.html.erb index 0e7466a..bb0fee7 100644 --- a/app/views/phases/admin_preview.html.erb +++ b/app/views/phases/admin_preview.html.erb @@ -1,5 +1,3 @@ -<%- model_class = Phase -%> -

diff --git a/app/views/plans/index.html.erb b/app/views/plans/index.html.erb index 9567967..4093ba5 100644 --- a/app/views/plans/index.html.erb +++ b/app/views/plans/index.html.erb @@ -54,12 +54,16 @@ <%= display_role(plan.roles.find_by(user: current_user)) %> <% if plan.administerable_by?(current_user.id) then %> - <%= plan.administerable_by?(current_user.id) ? '' : 'disabled="true"' %> /> + <%= form_for plan, url: set_test_plan_url(plan), html: {method: :post, id: 'update-test-plan'} do |f| %> + <%= check_box_tag(:is_test, "1", (plan.visibility === 'is_test')) %> + <% end %> <% else %> <%= plan.visibility === 'is_test' ? _('Yes') : _('No') %> <% end %> - <%= raw display_visibility(plan.visibility) %> + + <%= plan.visibility === 'is_test' ? _('N/A') : raw(display_visibility(plan.visibility)) %> +