-
Notifications
You must be signed in to change notification settings - Fork 110
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
Conversation
briri
commented
Apr 4, 2018
•
edited
Loading
edited
- Removed example answer from guidances section since its never used (query looks only for guidance type annotations)
- Added Org abbreviation to 'Guidance' label when the template is customized Add Funder & Org abbreviation before "Guidance" word in customised templates #1343
- Used existing model method to get customization example answer and display it underneath the template's original example answer (would be better to refactor into a single query later) Customisation example answers do not appear when editing plan #1344
- Updated 'Answer locked by another user' section to exclude reshowing example answers since they appear below the main answer
…ample answers updated locking logic
<% if example_answer.present? %> | ||
<dt><%= _('Example answer') %></dt> | ||
<dd><%= raw example_answer.text %><dd> | ||
<% end %> | ||
<% if guidance.present? %> |
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
</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 comment
The 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
@@ -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 comment
The 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?