Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/views/annotations/_show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--show annotations. annotation is passed as an argument-->
<h3 class="accordion_heading_text">
<% if annotation.type == :example_answer %>
<%= _('Example Answer') %>
<% elsif annotation.type == :guidance %>
<%= _('Guidance') %>
<% else %>
<%= plan.template.org.abbreviation %>
<% end %>
<span class="fa fa-plus" aria-hidden="true"></span>
</h3>

<div class="accordion-section"><%= raw annotation.text %></div>
189 changes: 99 additions & 90 deletions app/views/answers/_new_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,100 +2,109 @@
This partial creates a form for each type of question. The local variables are: plan, answer, question, readonly
-->
<% q_format = question.question_format %>
<%= semantic_form_for answer, :url => {controller: :answers, action: :update }, html: {method: "put", class: "roadmap-form", 'data-autosave': question.id }, remote: true do |f| %>
<fieldset class="standard">
<% if !readonly %>
<%= f.input :id, as: :hidden, input_html: { value: answer.id } %>
<%= f.input :plan_id, as: :hidden, input_html: { value: answer.plan_id } %>
<%= f.input :user_id, as: :hidden, input_html: { value: answer.user_id } %>
<%= f.input :question_id, as: :hidden, input_html: { value: answer.question_id } %>
<%= f.input :lock_version, as: :hidden, input_html: { value: answer.lock_version } %>
<% end %>
<%= form_for answer, url: {controller: :answers, action: :update}, html: {method: :put, class: "roadmap-form", 'data-autosave': question.id}, remote: true do |f| %>
<fieldset class="standard">
<% if !readonly %>
<%= f.hidden_field :id %>
<%= f.hidden_field :plan_id %>
<%= f.hidden_field :user_id %>
<%= f.hidden_field :question_id %>
<%= f.hidden_field :lock_version %>
<% end %>

<div class="form-input">
<!-- Question text -->
<% if question.option_based? %>
<%= f.label raw(question.text), for: :question_option_ids, class: "no-colon" %>
<% else %>
<%= f.label raw(question.text), for: :text, class: "no-colon" %>
<% end %>

<% if question.option_based? %>
<% options = question.question_options.by_number %>
<% if q_format.checkbox? %>
<ol class="choices-group">
<% options.each do |op| %>
<li>
<%= f.check_box(:question_option_ids, { multiple: true, checked: answer.has_question_option(op.id), disabled: readonly }, op.id, nil) %>
<%= raw op.text %>
</li>
<% end %>
</ol>
<% elsif q_format.radiobuttons? %>
<ol class="choices-group">
<% options.each do |op| %>
<li>
<%= f.radio_button :question_option_ids, op.id, { checked: answer.has_question_option(op.id), id: "answer_option_ids_#{op.id}", disabled: readonly } %>
<%= raw op.text %>
</li>
<% end %>
</ol>
<% elsif q_format.dropdown? || q_format.multiselectbox? %>
<%
options_html = ""
options.each do |op|
options_html += answer.has_question_option(op.id) ?
"<option value=#{op.id} selected=\"selected\">#{op.text}</option>" :
"<option value=#{op.id}>#{op.text}</option>"
end
%>
<%= select_tag('answer[question_option_ids]', raw(options_html),
{multiple: q_format.multiselectbox?, include_blank: q_format.dropdown?, disabled: readonly }) %>
<% end %>
<!-- Comment text area for option_based questions -->
<% if question.option_comment_display == true %>
<%= label_tag('answer[text]', _('Comment')) %>
<% if readonly %>
<p><%= raw(answer.text) %></p>
<% else %>
<%= text_area_tag('answer[text]', answer.text, id: "answer-text-#{question.id}") %>
<%= tinymce(selector: "#answer-text-#{question.id}", setup: "$.fn.tinymce_answer_events", content_css: asset_path('application.css')) %>
<% end %>
<%end%>

<!-- Question text -->
<p>
<strong><%= raw question.text %></strong>
</p>

<% elsif q_format.textfield? %>
<% if readonly %>
<p><%= strip_tags(answer.text) %></p>
<% else %>
<%= text_field_tag('answer[text]', strip_tags(answer.text)) %>
<% end %>

<% elsif q_format.textarea? %>
<% if readonly %>
<p><%= raw(answer.text) %></p>
<% else %>
<%= text_area_tag('answer[text]', answer.text, id: "answer-text-#{question.id}") %>
<%= tinymce(selector: "#answer-text-#{question.id}", setup: "$.fn.tinymce_answer_events", content_css: asset_path('application.css')) %>
<% end %>
<% end %>

<!--Example Answer area-->
<% if !readonly && question.annotations.where(type: Annotation.types[:example_answer]).any? %>
<% annotation = question.annotations.where(type: Annotation.types[:example_answer]).order(:created_at).first %>
<% if annotation.text.present? %>
<div class="suggested-answer-div">
<span class="suggested-answer-intro">
<%="#{annotation.org.abbreviation} "%> <%=_('Example of answer')%>
</span>
<!--Example Answer area-->
<% if !readonly && question.annotations.where(type: Annotation.types[:example_answer]).any? %>
<% annotation = question.annotations.where(type: Annotation.types[:example_answer]).order(:created_at).first %>
<% if annotation.text.present? %>
<div class="suggested-answer-div lefgt-indent">
<span class="suggested-answer-intro">
<%="#{annotation.org.abbreviation} "%> <%=_('example answer')%>
</span>

<div class="suggested-answer-border">
<p class="suggested-answer">
<%= raw annotation.text %>
</p>
</div>
<div class="suggested-answer-border">
<p class="suggested-answer"><%= raw annotation.text %></p>
</div>
<% end %>
</div>
<% end %>
<% end %>

<% if question.option_based? %>
<% options = question.question_options.by_number %>
<% if q_format.checkbox? %>
<ol class="choices-group">
<% options.each do |op| %>
<li>
<%= f.check_box(:question_option_ids, { multiple: true, checked: answer.has_question_option(op.id), disabled: readonly }, op.id, nil) %>
<%= raw op.text %>
</li>
<% end %>
</ol>
<% elsif q_format.radiobuttons? %>
<ol class="choices-group">
<% options.each do |op| %>
<li>
<%= f.radio_button :question_option_ids, op.id, { checked: answer.has_question_option(op.id), id: "answer_option_ids_#{op.id}", disabled: readonly } %>
<%= raw op.text %>
</li>
<% end %>
</ol>
<% elsif q_format.dropdown? || q_format.multiselectbox? %>
<%
options_html = ""
options.each do |op|
options_html += answer.has_question_option(op.id) ?
"<option value=#{op.id} selected=\"selected\">#{op.text}</option>" :
"<option value=#{op.id}>#{op.text}</option>"
end
%>
<%= select_tag('answer[question_option_ids]', raw(options_html),
{multiple: q_format.multiselectbox?, include_blank: q_format.dropdown?, disabled: readonly }) %>
<% end %>
<!-- Comment text area for option_based questions -->
<% if question.option_comment_display == true %>
<%= label_tag('answer[text]', _('Comment')) %>
<% if readonly %>
<p><%= raw(answer.text) %></p>
<% else %>
<%= text_area_tag('answer[text]', answer.text, id: "answer-text-#{question.id}") %>
<%= tinymce(selector: "#answer-text-#{question.id}", setup: "$.fn.tinymce_answer_events", content_css: asset_path('application.css')) %>
<% end %>
<%end%>
<% end %>
<!-- For non-option_based questions -->
<% if q_format.textfield? %>
<% if readonly %>
<p><%= strip_tags(answer.text) %></p>
<% else %>
<%= text_field_tag('answer[text]', strip_tags(answer.text)) %>
<% end %>
<% elsif q_format.textarea? %>
<% if readonly %>
<p><%= raw(answer.text) %></p>
<% else %>
<%= text_area_tag('answer[text]', answer.text, id: "answer-text-#{question.id}") %>
<%= tinymce(selector: "#answer-text-#{question.id}", setup: "$.fn.tinymce_answer_events", content_css: asset_path('application.css')) %>
<% end %>
<% end %>
</div> <!-- form-input -->

<% if !readonly %>
<input type="submit" class="form-submit" value="<%= _('Save') %>" />
<% end %>
</fieldset>
<% end %>
<div class="form-input">
<% if !readonly %>
<input type="submit" class="form-submit left-indent" value="<%= _('Save') %>" />
<% end %>
<div id="<%= "answer-status-#{question.id}" %>" class="answer-status inline left-indent">
<%= render(partial: 'answers/status', locals: { answer: answer }) %>
</div>
</div>
</fieldset>
<% end %>
2 changes: 1 addition & 1 deletion app/views/answers/update.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ if($.fn.init_answer_status)
$(".progress").html("<%= escape_javascript(render :partial => '/plans/progress', locals: { plan: @plan }) %>");

// partial /sections/progress
$("#section-progress-<%= @section.id %>")
$(".progress-bar-<%= @section.id %>")
.html("<%= escape_javascript(render partial: '/sections/progress', locals: { section: @section, plan: @plan }) %>");
9 changes: 4 additions & 5 deletions app/views/contact_us/contacts/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<h1>
<%= _("Contact Us") %>
</h1>
<p>
<p class="left-indent">
<%= raw _('%{application_name} is provided by the %{organisation_name}.<br /> You can find out more about us on our <a href="%{organisation_url}" target="_blank">website</a>. If you would like to contact us about %{application_name}, please fill out the form below.') % {organisation_name: Rails.configuration.branding[:organisation][:name],
organisation_url: Rails.configuration.branding[:organisation][:url],
application_name: Rails.configuration.branding[:application][:name]} %>
</p>

<div class="content bordered" id="contact-us">
<div class="content bordered left-indent" id="contact-us">
<!-- left column content -->
<div class="column-left">
<%= form_for @contact, url: contacts_path, html: {class: "roadmap-form"} do |f| %>
Expand All @@ -36,7 +36,7 @@

<div class="form-input">
<%= f.label(:message, _('Message'), class: "align-top required") %>
<%= f.text_area(:message, class: "left-indent required input-large", rows: 10) %>
<%= f.text_area(:message, class: "required input-large", rows: 10, style: "height: 160px;") %>
</div>
<% if !user_signed_in? then %>
<div class="form-input">
Expand All @@ -53,8 +53,7 @@
locals: {id: 'create_contact_submit',
val: 'Submit',
disabled_initially: true,
tooltip: _('Fill in the required fields'),
classes: 'left-indent'} %>
tooltip: _('Fill in the required fields')} %>
</div>
</fieldset>

Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/passwords/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<h1><%= _('Forgot your password?') %></h1>

<p><%= _('Please enter your email below and we will send you instructions on how to reset your password.') %></p>
<p class="left-indent"><%= _('Please enter your email below and we will send you instructions on how to reset your password.') %></p>

<div class="content">
<%= form_for resource, as: 'user', url: user_password_path, html: {class: "password-reset roadmap-form", method: :post} do |f| %>
Expand Down
8 changes: 8 additions & 0 deletions app/views/guidance_groups/_show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<h3 class="accordion_heading_text">
<%= group[:org] %> guidance on <%= theme %>
<span class="fa fa-plus" aria-hidden="true"></span>
</h3>

<div id="collapse-guidance-<%= question.id %>-<%= guidance_accordion_id %>" class="accordion-section collapse">
<%= raw group[:text] %>
</div>
2 changes: 1 addition & 1 deletion app/views/guidances/admin_index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%= _('Guidance') %>
</h1>

<p>
<p class="left-indent">
<%= _("First create a guidance group. This could be institution wide or a subset e.g. a particular College / School, Institute or department. When you create guidance you'll be asked to assign it to a guidance group.") %>
</p>

Expand Down
Empty file.
4 changes: 2 additions & 2 deletions app/views/notes/_add.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<%= f.hidden_field :plan_id, value: plan_id %>

<fieldset class="standard">
<%= label_tag "#{questionid}new_note_text", _('Share note with collaborators') %>
<%= label_tag "#{questionid}new_note_text", _('Add comments to share with collaborators') %>
<%= text_area_tag "#{questionid}new_note_text", nil, class: "tinymce" %>
<%= tinymce :content_css => asset_path('application.css') %>
<input type="submit" class="form-submit new_comment_submit_button" value="<%= _('Save') %>" />
<input type="submit" class="form-submit new_comment_submit_button left-indent" value="<%= _('Save') %>" />
</fieldset>
<% end %>
13 changes: 3 additions & 10 deletions app/views/notes/_list.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<!--table displaying notes for this question and actions-->

<% if notes.count > 1 then%>
<% style_to_add = "height:150px; overflow-y:auto;" %>
<%else%>
<% style_to_add = "" %>
<%end%>

<div class="two-column-clear question-divider"></div>

<div class="div-table-content" style ="<%= style_to_add %>">
<div class="div-table-content">
<table class="dmp_table" id="dmp_table">
<tbody class= "comment_table_body">
<% notes.each do |note|%>
Expand All @@ -23,10 +16,10 @@
<% if note.archived %>

<% if note.archived_by == current_user.id %>
<%= _('Note removed by you')%>
<%= _('Comment removed by you')%>
<% else %>
<% archived_by_user = User.find(note.archived_by) %>
<%= _('Note removed by')%> <%= archived_by_user.name %>
<%= _('Comment removed by')%> <%= archived_by_user.name %>
<%end%>

<%else%> <!-- not archived -->
Expand Down
2 changes: 1 addition & 1 deletion app/views/notes/_view.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>
<div>
<ul>
<li><p class= "accordion_label"><%= _('Noted by:')%></p></li>
<li><p class= "accordion_label"><%= _('Comment from:')%></p></li>
<li><%= user.name%> (<%= l note.updated_at, format: :custom %>)</li>
<li><%= raw note.text %></li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/views/notes/create.js.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

// rewrite the number of notes heading e.g. Notes(3)
<% noteslabel = "#notes_number_#{@question.id}" %>
$("<%=noteslabel%>").html("Notes (<%= @num_notes %>)");
$("<%=noteslabel%>").html("Comments (<%= @num_notes %>)");

// need to remove the existing tinymce editor otherwise
tinymce.remove(".tinymce");
Expand Down
6 changes: 3 additions & 3 deletions app/views/orgs/admin_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="org-logo form-input">
<%= f.label :logo %>
<%= image_tag @org.logo.url, alt: "#{@org.name} #{_('logo')}", class: 'left-indent' %>
<div class="inline left-indent" id="logo-controls">
<div class="inline" id="logo-controls">
<%= f.label _('Remove logo') % {application_name: Rails.configuration.branding[:application][:name]}, for: :remove_logo %>
<%= f.check_box :remove_logo, title: _("This will remove your organisation's logo") %>
<br />
Expand All @@ -35,13 +35,13 @@
<% else %>
<div class="form-input">
<%= f.label :logo %>
<%= f.file_field :logo, class: 'left-indent' %>
<%= f.file_field :logo %>
</div>
<% end %>

<div class="form-input" id="banner-text">
<%= f.label _('Top banner text'), for: @org.banner_text %>
<div class="left-indent inline">
<div class="inline">
<%= text_area_tag('org_banner_text', @org.banner_text, id: "org_banner_text") %>
<%= tinymce(selector: "#org_banner_text", content_css: asset_path('application.css')) %>
</div>
Expand Down
Loading