diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 37c6800..7ce8920 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -19,7 +19,7 @@ end @templates_own = current_templates.values #funders templates - @templates_funders = Org.funders.collect{|o| o.templates } #Template.funders_templates + @templates_funders = []#Org.funders.collect{|o| o.templates } #Template.funders_templates end diff --git a/app/views/dmptemplates/_add_question.html.erb b/app/views/dmptemplates/_add_question.html.erb deleted file mode 100644 index b9bbfc8..0000000 --- a/app/views/dmptemplates/_add_question.html.erb +++ /dev/null @@ -1,183 +0,0 @@ - - -<% @new_question = Question.new %> -<% @new_question.number = section.questions.count + 1 %> - - -<%= form_for @new_question, :url => {:action => "admin_createquestion"}, :html => {:id => "new_question_#{section.id}"} do |f| %> -<%= f.hidden_field :section_id, :value => section.id %> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<%= t("org_admin.questions.question_number_label")%><%= f.number_field :number, :in => 1..50, :class => "number_field has-tooltip", "data-toggle" => "tooltip", "title" => t("org_admin.questions.number_help_text") %> - -
-
<%= t("org_admin.questions.question_text_label")%><%= f.text_area :text, :rows => "5", :id => "new_question_text_#{section.id}" %> -
-
<%= t("org_admin.questions.answer_format_label")%><%= f.hidden_field :section_id, :value => section.id, :class => "section_id" %> -
-
- <%= f.select :question_format_id, - #options_from_collection_for_select(QuestionFormat.all.order("title"), :id, :title, QuestionFormat.find_by_title(t("helpers.text_area")).id), - # the above was the line but it doesn't work because in the DB - # the QuestionFormat title is in English (Text area) - # but the above uses the Fr translation and so gets a nil - options_from_collection_for_select(QuestionFormat.all.order("title"), :id, :title, QuestionFormat.find_by_title("Text area").id), - {}, :id => "new-select-format-#{section.id}"%> -
-
- <%= link_to( image_tag("help_button.png"), "#", :class => "question_format_popover", :rel => "popover", "data-html" => "true", "data-content" => t("org_admin.questions.question_format_help_text_html"))%> -
- -
-
- - -
- - -
- - -
- -
-
-
-
<%= t("org_admin.questions.suggested_or_example_answer_label")%>
- <% suggested_answer = @new_question.suggested_answers.build %> - <%= f.fields_for :suggested_answers, suggested_answer do |s|%> - <%= s.hidden_field :organisation_id, :value => current_user.organisation.id %> -
    -
  • <%= s.select :is_example, {t("org_admin.questions.example_answer_label") => true, t("org_admin.questions.suggested_answer_label") => false} %>
  • -
  • <%= s.text_area :text, :rows => 5 %>
  • -
- <%end%> -
-
- <%= link_to( image_tag("help_button.png"), "#", :class => "suggested_answer_popover", :rel => "popover", "data-html" => "true", "data-content" => t("org_admin.questions.suggested_answer_help_text_html"))%> -
-
-
- -
<%= t("org_admin.questions.guidance_label")%>
- <%= text_area_tag("new-question-guidance", "", class: "tinymce") %> -
-
- <%= link_to( image_tag("help_button.png"), "#", :class => "question_guidance_popover", :rel => "popover", "data-html" => "true", "data-content" => t("org_admin.questions.question_guidance_help_text_html"))%> -
-
-
-
<%= t("org_admin.questions.themes_label")%>
- <%= f.collection_select(:theme_ids, - Theme.all.order("title"), - :id, :title, {:prompt => false, :include_blank => t('helpers.none')}, {:multiple => true})%> -
-
- <%= link_to( image_tag("help_button.png"), "#", :class => "question_themes_popover", :rel => "popover", "data-html" => "true", "data-content" => t("org_admin.questions.question_themes_help_text_html"))%> -
- - -
-
- - -
- <%= hidden_field_tag :section_id, section.id, :class => "section_id" %> - <%= f.submit t("helpers.submit.save"), :class => "btn btn-primary new_question_save_button" %> - <%= hidden_field_tag :section_id, section.id, :class => "section_id_new" %> - <%= link_to t("helpers.submit.cancel"), '#', :class => "btn cancel cancel_add_new_question" %> -
-
- -<%end%> - diff --git a/app/views/dmptemplates/_admin_nav_tabs.html.erb b/app/views/dmptemplates/_admin_nav_tabs.html.erb deleted file mode 100644 index e2237ea..0000000 --- a/app/views/dmptemplates/_admin_nav_tabs.html.erb +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/app/views/templates/_admin_nav_tabs.html.erb b/app/views/templates/_admin_nav_tabs.html.erb index 0134df6..d5cb6c6 100644 --- a/app/views/templates/_admin_nav_tabs.html.erb +++ b/app/views/templates/_admin_nav_tabs.html.erb @@ -19,7 +19,7 @@ <% end %> - <% if current_user.can_org_admin? && (template.org_type != constant("organisation_types.funder")|| current_user.org_type == constant("organisation_types.funder")) %> + <% if current_user.can_org_admin? && (template.org.org_type != constant("organisation_types.funder")|| current_user.org_type == constant("organisation_types.funder")) %> <% if active == 'add_plan' %>
  • <% else %> diff --git a/app/views/templates/_show_phases_sections.html.erb b/app/views/templates/_show_phases_sections.html.erb index 63f5a08..606aabb 100644 --- a/app/views/templates/_show_phases_sections.html.erb +++ b/app/views/templates/_show_phases_sections.html.erb @@ -12,7 +12,7 @@ <% if phase.sections.length > 0 %> - <%= link_to t("helpers.preview"), admin_previewphase_template_path(phase), class: 'btn btn-primary'%> + <%= link_to t("helpers.preview"), admin_previewphase_template_path(id: phase.id), class: 'btn btn-primary'%> <% end %> <% if !phase.template.published? %> <%= link_to t("helpers.submit.delete"), admin_destroyphase_template_path(phase_id: phase.id), diff --git a/app/views/templates/admin_index.html.erb b/app/views/templates/admin_index.html.erb index 99dde0d..5435712 100644 --- a/app/views/templates/admin_index.html.erb +++ b/app/views/templates/admin_index.html.erb @@ -92,7 +92,7 @@ <% @templates_funders.each do |org_template| %> - <% if org_template.published? ||org_template.has_customisations?(current_user.organisation_id, org_template) then %> + <% if org_template.published ||org_template.has_customisations?(current_user.organisation_id, org_template) then %> <%= org_template.title%>