+ <% if based_on.org != plan.template.org %>
+ <%= _('A version of ') %> "<%= based_on.title %>" <%= _(' that has been customised by ') %> <%= plan.template.org.name %>
+ <% else %>
+ <%= _('The')%> "<%= plan.template.title %>" <%= _('generic template') if plan.template.is_default %> <%= _('provided by ') %><%= plan.template.org.name %>
+ <% end %>
+
diff --git a/app/views/plans/new.html.erb b/app/views/plans/new.html.erb
index a046efa..085a34a 100644
--- a/app/views/plans/new.html.erb
+++ b/app/views/plans/new.html.erb
@@ -1,4 +1,4 @@
-<% javascript "new_plan.js" %>
+<% javascript "create_plan.js" %>
<%= _('Create a new plan') %>
@@ -12,61 +12,60 @@
diff --git a/config/application.rb b/config/application.rb
index 99d62cc..0a0551f 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -75,7 +75,7 @@
config.assets.precompile += %w(jquery-accessible-autocomplet-list-aria.js)
config.assets.precompile += %w(export_configure.js)
config.assets.precompile += %w(toolbar.js)
- config.assets.precompile += %w(new_plan.js)
+ config.assets.precompile += %w(create_plan.js)
config.assets.precompile += %w(admin.js)
config.assets.precompile += %w(admin.css)
diff --git a/lib/assets/javascripts/create_plan.js b/lib/assets/javascripts/create_plan.js
new file mode 100644
index 0000000..c3a8cb5
--- /dev/null
+++ b/lib/assets/javascripts/create_plan.js
@@ -0,0 +1,69 @@
+$(document).ready(function(){
+ // Form submit button is disabled until all requirements are met
+ $(".form-submit").prop("disabled", true).prop("aria-disabled", true);
+ $("#available-templates").hide();
+
+ // retrieve the template options and toggle the submit button on page reload
+ handleComboboxChange();
+ handleCheckboxClick("org", $("#plan_no_org").prop("checked"));
+ handleCheckboxClick("funder", $("#plan_no_funder").prop("checked"));
+
+ // When the hidden org and funder id fields change toogle the submit button
+ $("#plan_org_id, #plan_funder_id").change(function(){
+ handleComboboxChange();
+ });
+
+ // Make sure the checkbox is unchecked if we're entering text
+ $(".js-combobox").keyup(function(){
+ var whichOne = $(this).prop('id').split('_')[1];
+ $("#plan_no_" + whichOne).prop("checked", false);
+ });
+
+ // If the user clicks the no Org/Funder checkbox disable the dropdown
+ // and hide clear button
+ $("#plan_no_org, #plan_no_funder").click(function(){
+ var whichOne = $(this).prop('id').split('_')[2];
+ handleCheckboxClick(whichOne, this.checked);
+ });
+});
+
+// Only display the submit button if the user has made each decision
+// -------------------------------------------------------------
+function handleComboboxChange(){
+ // If the (no_org checkbox is checked OR an org was selected) AND
+ // (no_funder checkbox is checked OR a funder was selected)
+ var retrieve = ($("#plan_no_org").prop("checked") ||
+ $("#plan_org_id").val().trim().length > 0) &&
+ ($("#plan_no_funder").prop("checked") ||
+ $("#plan_funder_id").val().trim().length > 0);
+
+ if(retrieve){
+ $(".form-submit").prop('disabled', false).prop("aria-disabled", false);
+
+ // If the templates section isn't available then submit the form to find the template options
+ if($("#available_templates").html() == undefined){
+ if(!$("#plan_template_id").val()){
+ $("form").submit();
+ }
+ }
+
+ }else{
+ $("#available-templates").fadeOut();
+ $("#plan_template_id").val("");
+
+ $(".form-submit").prop('disabled', true).prop("aria-disabled", true);
+ }
+}
+
+// Clear the combobox and disable it if the box was checked
+// -------------------------------------------------------------
+function handleCheckboxClick(name, checked){
+ $("#plan_" + name + "_name").prop("disabled", checked);
+ if(checked){
+ $("#plan_" + name + "_name").val("");
+ $("#plan_" + name + "_id").val("").change();
+ $("#plan_" + name + "_name").siblings(".combobox-clear-button").hide();
+ }else{
+ $(".form-submit").prop('disabled', true).prop("aria-disabled", true);
+ }
+}
diff --git a/lib/assets/javascripts/new_plan.js b/lib/assets/javascripts/new_plan.js
deleted file mode 100644
index 8553b80..0000000
--- a/lib/assets/javascripts/new_plan.js
+++ /dev/null
@@ -1,69 +0,0 @@
-$(document).ready(function(){
- // Form submit button is disabled until all requirements are met
- $(".form-submit").prop("disabled", true);
- $("#available-templates").hide();
-
- // retrieve the template options and toggle the submit button on page reload
- handleComboboxChange();
- handleCheckboxClick("org", $("#plan_no_org").prop("checked"));
- handleCheckboxClick("funder", $("#plan_no_funder").prop("checked"));
-
- // When the hidden org and funder id fields change toogle the submit button
- $("#plan_org_id, #plan_funder_id").change(function(){
- handleComboboxChange();
- });
-
- // Make sure the checkbox is unchecked if we're entering text
- $(".js-combobox").keyup(function(){
- var whichOne = $(this).prop('id').split('_')[1];
- $("#plan_no_" + whichOne).prop("checked", false);
- });
-
- // If the user clicks the no Org/Funder checkbox disable the dropdown
- // and hide clear button
- $("#plan_no_org, #plan_no_funder").click(function(){
- var whichOne = $(this).prop('id').split('_')[2];
- handleCheckboxClick(whichOne, this.checked);
- });
-});
-
-// Only display the submit button if the user has made each decision
-// -------------------------------------------------------------
-function handleComboboxChange(){
- // If the (no_org checkbox is checked OR an org was selected) AND
- // (no_funder checkbox is checked OR a funder was selected)
- var retrieve = ($("#plan_no_org").prop("checked") ||
- $("#plan_org_id").val().trim().length > 0) &&
- ($("#plan_no_funder").prop("checked") ||
- $("#plan_funder_id").val().trim().length > 0);
-
- if(retrieve){
- $(".form-submit").prop('disabled', false);
-
- // If the templates section isn't available then submit the form to find the template options
- if($("#available_templates").html() == undefined){
- if(!$("#plan_template_id").val()){
- $("form").submit();
- }
- }
-
- }else{
- $("#available-templates").fadeOut();
- $("#plan_template_id").val("");
-
- $(".form-submit").prop('disabled', true);
- }
-}
-
-// Clear the combobox and disable it if the box was checked
-// -------------------------------------------------------------
-function handleCheckboxClick(name, checked){
- $("#plan_" + name + "_name").prop("disabled", checked);
- if(checked){
- $("#plan_" + name + "_name").val("");
- $("#plan_" + name + "_id").val("").change();
- $("#plan_" + name + "_name").siblings(".combobox-clear-button").hide();
- }else{
- $(".form-submit").prop('disabled', true);
- }
-}
diff --git a/lib/assets/stylesheets/dmproadmap.scss b/lib/assets/stylesheets/dmproadmap.scss
index c9b2b36..453bf4e 100644
--- a/lib/assets/stylesheets/dmproadmap.scss
+++ b/lib/assets/stylesheets/dmproadmap.scss
@@ -1,6 +1,7 @@
@import "font-awesome";
$font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
+$header-font: "GillSansLight";
$white: #FFF;
@@ -19,7 +20,6 @@
}
.main {
-
form {
.white-fieldset {
@@ -31,6 +31,17 @@
-moz-border-radius: 10px;
border-radius: 10px;
+ legend {
+ font-family: $header-font;
+ color: $primary-color;
+ font-size: 26px;
+ font-weight: normal;
+ text-decoration: none;
+
+ float: left; /* positions the legend within the fieldset box */
+ border-bottom: none;
+ }
+
label,
input[type="checkbox"],
.combobox-container,
@@ -46,6 +57,11 @@
input[type="checkbox"] {
vertical-align: top;
}
+
+ .checkbox-label {
+ display: inline-block;
+ margin-left: 5px;
+ }
}
input.form-submit {