Commit 8510417
John Pinto
Added feature "Org admins can show/hide the ethical_issues field on plans" (#3555).
Changes:
(1) Added a property Rails.configuration.x.madmp.enable_ethical_issues_per_template to configuration which works as follows:
If Rails.configuration.x.madmp.enable_ethical_issues is true, this flag hide_ethical_issues_question_per_template comes into play.
It will determine if the ethical_issues question is hidden/shown based on the template selected for the plan.
If the template has the hide_ethical_issues attribute set to true, then the question will be hidden.
If the template has the hide_ethical_issues is set to false, then the question will be shown.
(2) Added to Template model
attribute :hide_ethical_issues_question, :boolean, default: false
with migration.
(3) Added a safe param :hide_ethical_issues_question to the org admin
Template controller.
(4) Updated the app/views/org_admin/templates/_form.html.erb to display a
checkbox for "Hide question about ethical issues". This checkbox will
only appear if Rails.configuration.x.madmp.enable_ethical_issues and
Rails.configuration.x.madmp.enable_ethical_issues_per_template are both
set to true in config.
(5) Updated the conitional for display of the ethical issues question in
the Project details page as follows:
<% if Rails.configuration.x.madmp.enable_ethical_issues &&
(!Rails.configuration.x.madmp.enable_hide_ethical_issues_per_template ||
(Rails.configuration.x.madmp.enable_hide_ethical_issues_per_template && plan.template.present? && plan.template.hide_ethical_issues_question.present? && !plan.template.hide_ethical_issues_question)) %>1 parent f7bcd33 commit 8510417
7 files changed
Lines changed: 341 additions & 3 deletions
File tree
- app
- controllers/org_admin
- models
- views
- org_admin/templates
- plans
- config/initializers
- db
- migrate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
| 383 | + | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
14 | 31 | | |
15 | 32 | | |
16 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
227 | 235 | | |
228 | 236 | | |
229 | 237 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments