diff --git a/app/views/plans/_plan_details.html.erb b/app/views/plans/_plan_details.html.erb index 981b3c0..98e6fd5 100644 --- a/app/views/plans/_plan_details.html.erb +++ b/app/views/plans/_plan_details.html.erb @@ -16,7 +16,7 @@

- <%= _('helpers.links.cancel') %> + <%= _('Cancel') %>
@@ -76,7 +76,7 @@ <%= f.actions do %>
<%= f.submit _('Save'), :class => 'btn btn-primary' %> - <%= _('helpers.links.cancel') %> + <%= _('Cancel') %>
<%end%> <%end%> @@ -233,7 +233,7 @@ - <% phase["sections"].each do |section| %> + <% phase.sections.each do |section| %>

<%= section.title %>

diff --git a/lib/assets/javascripts/projects.js b/lib/assets/javascripts/projects.js index 9e1c870..c32016c 100644 --- a/lib/assets/javascripts/projects.js +++ b/lib/assets/javascripts/projects.js @@ -1,116 +1,5 @@ $( document ).ready(function() { $(".select2-container").select2(); - - // ---------------------------------------------------------- - $("#plan_funder_id").change(function(){ - -// if($(this).select2().val().length > 0){ -// $("#other-funder-name").hide(); -// $("#project_funder_name").val(""); -// -// }else{ -// $("#other-funder-name").show(); -// } - -// $("#institution-control-group").show(); - $("#create-plan-button").show(); - $("#confirm-funder").text($("#project_funder_id option:selected").text()); - getTemplateList(); - }); - - // ---------------------------------------------------------- - $("#project_institution_idX").change(function(){ - reloadTemplateData(); - - $("#confirm-institution").text($("#project_institution_id option:selected").text()); - }); - - // ---------------------------------------------------------- - $("#project_dmptemplate_idX").change(function(){ - reloadGuidanceOptions(); - }); - - // ---------------------------------------------------------- - $("#no-funderX").click(function(e) { - e.preventDefault(); - // For some reason we need to access the select2 box's value again to get the - // UI to update correctly - $("#project_funder_id").select2().val(""); - $("#project_funder_id").select2().val(); - - $("#institution-control-group").show(); - $("#create-plan-button").show(); - $("#other-funder-name").show(); - $("#confirm-funder").text(I18n.t("helpers.none")); - reloadTemplateData(); - }); - - // ---------------------------------------------------------- - $("#project_funder_nameX").change(function(){ - $("#confirm-funder").text($("#project_funder_id :selected").text()); - reloadTemplateData(); - }); - - // ---------------------------------------------------------- - $("#no-institutionX").click(function() { - // For some reason we need to access the select2 box's value again to get the - // UI to update correctly - $("#project_institution_id").select2().val(""); - $("#project_institution_id").select2().val(); - - $("#confirm-institution").text(I18n.t("helpers.none")); - }); - - // ---------------------------------------------------------- - $("#project-confirmation-dialogX").on("show", function(){ - if ($("#confirm-institution").text() == "") { - $("#confirm-institution").text(I18n.t("helpers.none")); - } - if ($("#confirm-funder").text() == "") { - $("#confirm-funder").text(I18n.t("helpers.none")); - } - if ($("#confirm-template").text() == "") { - $("#confirm-template").closest("div").hide(); - } - else { - $("#confirm-template").closest("div").show(); - } - $("#confirm-guidance").empty(); - $("input:checked").each(function(){ - $("#confirm-guidance").append("
  • "+$(this).parent().text()+"
  • "); - }); - $('.select2-choice').hide(); - }); - - // ---------------------------------------------------------- - $("#new-project-cancelledX").click(function (){ - $("#project-confirmation-dialog").modal("hide"); - $('.select2-choice').show(); - }); - - // ---------------------------------------------------------- - $("#new-project-confirmedX").click(function (){ - $("#new_project").submit(); - }); - - // ---------------------------------------------------------- - //for the default template alert - $("#default-template-confirmation-dialogX").on("show", function(){ - $('.select2-choice').hide(); - }); - - // ---------------------------------------------------------- - $("#default-template-cancelledX").click(function (){ - $("#default-template-confirmation-dialog").modal("hide"); - $('.select2-choice').show(); - }); - - // ---------------------------------------------------------- - $("#default-template-confirmedX").click(function (){ - $("#default_tag").val('true'); - $("#new_project").submit(); - }); - // The following function references a JSON array that is // constructed in app/view/projects/_dropdown_new_project.html.erb