diff --git a/app/views/guidance_groups/admin_edit.html.erb b/app/views/guidance_groups/admin_edit.html.erb index 4edeb0f..8b25730 100644 --- a/app/views/guidance_groups/admin_edit.html.erb +++ b/app/views/guidance_groups/admin_edit.html.erb @@ -2,78 +2,47 @@

<%= _('Guidance group') %> - -
- <%= link_to _('View all guidance'), - admin_index_guidance_path, - class: 'btn btn-primary' %> -

-
+
+ <%= _('View all guidance') %> +
-
- -
-
- <%= form_for(@guidance_group, url: admin_update_guidance_group_path(@guidance_group), html: {method: :put}) do |f| %> - - - - - - - - <% if @guidance_group.published == true then %> - - - - - <% end %> - - - - - - -
<%= _('Name') %> -
- <%= f.text_field :name, - as: :string, - class: 'text_field' %> - -
-
- <%= link_to(image_tag('help_button.png'), '#', class: 'guidance_group_title_popover', rel: "popover", 'data-html' => "true", 'data-content' => _('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.')) %> -
-
<%= _('Published') %> -
- <%= f.check_box :published %> -
-
- -
-
<%= _('Optional subset') %> -
- <%= f.check_box :optional_subset %> <%= _('e.g. School/ Department') %> -
-
- <%= link_to(image_tag('help_button.png'), '#', class: 'guidance_group_subset_popover', rel: "popover", 'data-html' => "true", 'data-content' => _("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.")) %> -
-
- - - -
- <%= f.submit _('Save'), class: 'btn btn-primary' %> - <% if @guidance_group.published == false then %> - <%= f.submit _('Publish'), name: "save_publish", class: "btn btn-primary" %> - <% end %> - <%= link_to _('Cancel'), :back, class: 'btn cancel' %> +
+ <%= form_for(@guidance_group, url: admin_update_guidance_group_path(@guidance_group), html: {method: :put, class: 'roadmap-form'}) do |f| %> +
+ <%= f.label :name %> + <%= f.text_field :name, as: :string, class: 'text_field' %> +
+ <%= link_to(image_tag('help_button.png'), '#', class: 'guidance_group_title_popover', rel: "popover", 'data-html' => "true", 'data-content' => _('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.')) %> +
+
+ + + <% if @guidance_group.published == true then %> +
+ <%= f.label :published %> + <%= f.check_box :published %> +
+
- -
+
<% end %> + +
+ <%= f.label :optional_subset %> + <%= f.check_box :optional_subset %> <%= _('e.g. School/ Department') %> +
+ <%= link_to(image_tag('help_button.png'), '#', class: 'guidance_group_subset_popover', rel: "popover", 'data-html' => "true", 'data-content' => _("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.")) %> +
+
+ + +
+ <%= f.submit _('Save'), class: 'btn btn-primary' %> + <% if @guidance_group.published == false then %> + <%= f.submit _('Publish'), name: "save_publish", class: "btn btn-primary" %> + <% end %>
-
+ <% end %>
diff --git a/app/views/templates/admin_template.html.erb b/app/views/templates/admin_template.html.erb index 292bafd..75564de 100644 --- a/app/views/templates/admin_template.html.erb +++ b/app/views/templates/admin_template.html.erb @@ -1,93 +1,33 @@ +<%= stylesheet_link_tag "admin" %> <% javascript 'admin.js' %>

<%= @template.title %> + +
+ <%= link_to _('View all templates'), + admin_index_template_path, + class: 'btn btn-primary' %> +

- -
- -
- - -
-
    - - - - <% @template.phases.each do |phase| %> - - <% end %> - - - <% if current_user.can_org_admin? && - (@template.org.funder? || current_user.org.funder? || (@template.org == current_user.org)) %> - <% if (@template == @current || @edit) && @template.customization_of.nil? %> - - <% end %> - <% end %> -
+
-
- - -
- - <% if @template == @current && @template.customization_of.nil? %> - <%= render partial: "templates/edit_template", locals: {template: @template, hash: @hash} %> - <% else %> - <%= render partial: "templates/show_template", locals: {template: @template, current: @current, hash: @hash} %> - <% end %> + +<%= render partial: "templates/admin_nav_tabs", locals: {template: @template, hash: @hash, active: "show_template"} %> + + +
+
+ <% if @template == @current && @template.customization_of.nil? %> + - - - <% @template.phases.each do |phase| %> - - <% end %> - -
-
-
-
- -
-
- - <%= render partial: 'templates/show_phases_sections', locals: {phase: phase[:data], phase_hash: phase, template: @template, current: @current}%> -
-
-
-
- -
- <% end %> - - - + <% end %> +
+ <%= render partial: "templates/show_template", locals: {template: @template, current: @current, hash: @hash}%> +
+
<% if @hash[:template][:phases].present? %> <% if @hash[:template][:phases].length == 1 %> @@ -98,11 +38,25 @@ <% else %> <% (1..@hash[:template][:phases].length).each do |phase_no| %> <% phase = @hash[:template][:phases][phase_no] %> - +
+
+ +
+
+ + <%= render partial: 'templates/show_phases_sections', locals: {phase: phase[:data], phase_hash: phase, template: @template, current: @current}%> +
+
+
+
<% end %> <% end %> <% end %> -
-<%= tinymce %> +<%= tinymce :content_css => asset_path('application.css') %> diff --git a/lib/assets/javascripts/admin.js b/lib/assets/javascripts/admin.js index 7b47b6b..ab7e97f 100644 --- a/lib/assets/javascripts/admin.js +++ b/lib/assets/javascripts/admin.js @@ -20,7 +20,7 @@ }, 1000); } } - +/* //set the tinymce popover help text $(".template_desc_popover, .phase_desc_popover, .version_desc_popover, .section_desc_popover, .question_format_popover," + " .default_answer_popover, .suggested_answer_popover, .question_guidance_popover, .question_themes_popover," + @@ -29,7 +29,7 @@ " .guidance_by_question_popover, .guidance_group_select_popover, .org_abbr_popover").on('click', function(e) { e.preventDefault(); }).popover(); - +*/ // This handler serves to display/hide default_answer field as well as to display/hide question_options fields // depending on the question_format selected $('.question_format').change(function(){ diff --git a/lib/assets/javascripts/roadmap-accordion.js b/lib/assets/javascripts/roadmap-accordion.js index 3512af5..a8ca3ae 100644 --- a/lib/assets/javascripts/roadmap-accordion.js +++ b/lib/assets/javascripts/roadmap-accordion.js @@ -1,13 +1,13 @@ $(document).ready(function(){ $(".accordion").accordion({heightStyle: "content"}); - - $(".accordion h2").click(function(e){ - $.each($(this).parent().children("h2"), function(idx, section){ - if($(section).hasClass("ui-accordion-header-active")){ - $(section).children("span.fa").removeClass("fa-plus").addClass("fa-minus"); - }else{ - $(section).children("span.fa").removeClass("fa-minus").addClass("fa-plus"); - } - }); - }); + + $(".accordion h2").click(function(e){ + $.each($(this).parent().children("h2"), function(idx, section){ + if($(section).hasClass("ui-accordion-header-active")){ + $(section).children("span.fa").removeClass("fa-plus").addClass("fa-minus"); + }else{ + $(section).children("span.fa").removeClass("fa-minus").addClass("fa-plus"); + } + }); + }); }); \ No newline at end of file diff --git a/lib/assets/stylesheets/roadmap/accordion.scss b/lib/assets/stylesheets/roadmap/accordion.scss index 7af4485..e248b6f 100644 --- a/lib/assets/stylesheets/roadmap/accordion.scss +++ b/lib/assets/stylesheets/roadmap/accordion.scss @@ -1,28 +1,28 @@ .accordion { - position: relative; - width: 100%; - - h2, h3 { - position: relative; - color: $white; - font-size: 24px; - background-color: $primary-color; - padding: 6px 0 10px 10px; - border-radius: 3px; - - .ui-accordion-header-active, - .ui-accordion-header-collapsed { - position: relative; - } - - .fa { - font-size: 18px; - right: 15px; - top: 10px; - } - } - - div.accordion-section { - - } + position: relative; + width: 100%; + + h2, h3 { + position: relative; + color: $white; + font-size: 24px; + background-color: $primary-color; + padding: 6px 0 10px 10px; + border-radius: 3px; + + .ui-accordion-header-active, + .ui-accordion-header-collapsed { + position: relative; + } + + .fa { + font-size: 18px; + right: 15px; + top: 10px; + } + } + + div.accordion-section { + + } } \ No newline at end of file