-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added org abbreviation to 'Guidance' sections and added customized ex… #1347
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<div class="answer_notice"> | ||
<p><%= _('The following answer cannot be saved') %></p> | ||
<%= render partial: '/answers/new_edit', locals: { question: question, answer: answer, readonly: true, locking: true } %> | ||
<%# We do not need to re-show example answers in this lock conflict section so leave template nil %> | ||
<%= render partial: '/answers/new_edit', locals: { template: nil, question: question, answer: answer, readonly: true, locking: true } %> | ||
<p><%= _('since %{name} saved the answer below while you were editing. Please, combine your changes and then save the answer again.') % { name: user.name} %></p> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<%# locals: { question, answer, readonly, locking } %> | ||
<%# locals: { template, question, answer, readonly, locking } %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this partial is used also for previewing a template, did you test if still works? |
||
<!-- | ||
This partial creates a form for each type of question. The local variables are: plan, answer, question, readonly | ||
--> | ||
|
@@ -64,15 +64,18 @@ | |
<%= f.button(_('Save'), class: "btn btn-default", type: "submit") %> | ||
</fieldset> | ||
<!--Example Answer area --> | ||
<% annotation = question.first_example_answer %> | ||
<% if annotation.present? && annotation.text.present? %> | ||
<div class="panel panel-default"> | ||
<span class="label label-default"> | ||
<%="#{annotation.org.abbreviation} "%> <%=_('example answer')%> | ||
</span> | ||
<div class="panel-body"> | ||
<%= raw annotation.text %> | ||
<% annotations = [question.first_example_answer] %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is workable but I don't think is understandable at a glance. A more simplistic approach would be question.annotations.where(type: Annotation.types[:example_answer]) which would bring both example answers in one go. Obviously we should move data access to the controllers or model |
||
<% annotations << question.get_example_answer(template.org.id) if template.present? && template.org.present? %> | ||
<% annotations.each do |annotation| %> | ||
<% if annotation.present? && annotation.org.present? %> | ||
<div class="panel panel-default"> | ||
<span class="label label-default"> | ||
<%="#{annotation.org.abbreviation} "%> <%=_('example answer')%> | ||
</span> | ||
<div class="panel-body"> | ||
<%= raw annotation.text %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this if is no longer needed