File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11class PlansController < ApplicationController
22 require 'pp'
3+ helper SettingsTemplateHelper
34 #Uncomment the line below in order to add authentication to this page - users without permission will not be able to add new plans
45 #load_and_authorize_resource
56 #
Original file line number Diff line number Diff line change 1+ module SettingsTemplateHelper
2+ # Retrieves an msgstr for a given admin_field
3+ def admin_field_t ( admin_field )
4+ if Settings ::Template ::VALID_ADMIN_FIELDS . include? ( admin_field )
5+ if admin_field == 'project_name'
6+ return _ ( 'Plan Name' )
7+ elsif admin_field == 'project_identifier'
8+ return _ ( 'Plan ID' )
9+ elsif admin_field == 'grant_title'
10+ return _ ( 'Grant number' )
11+ elsif admin_field == 'principal_investigator'
12+ return _ ( 'Principal Investigator / Researcher' )
13+ elsif admin_field == 'project_data_contact'
14+ return _ ( 'Plan Data Contact' )
15+ elsif admin_field == 'project_description'
16+ return _ ( 'Plan Description' )
17+ elsif admin_field == 'funder'
18+ return _ ( 'Funder' )
19+ elsif admin_field == 'institution'
20+ return _ ( 'Institution' )
21+ elsif admin_field == 'orcid'
22+ return _ ( 'Your ORCID' )
23+ end
24+ end
25+ return _ ( 'Unknown column name.' )
26+ end
27+ end
Original file line number Diff line number Diff line change 2222 if value . present?
2323 %>
2424 < tr >
25- < th class ="dmp_th_border "> < p > - <%= t ( "helpers.plan.export. #{ field } " ) -%> </ p > </ th >
25+ < th class ="dmp_th_border "> < p > - <%= admin_field_t ( field ) -%> </ p > </ th >
2626 < td class ="dmp_td_border "> <%= value -%> </ td >
2727 </ tr >
2828 <% end %>
2929 <% end %>
3030 </ tbody >
3131 </ table >
32- <% end %>
32+ <% end %>
3333 <% @exported_plan . sections . each do |section | %>
3434 < h3 > <%= section . title %> </ h3 >
3535 < table class ="dmp_table ">
4949 < td class ="dmp_td_border " >
5050 <% answer = @plan . answer ( question . id , false ) %>
5151 <% if answer . nil? then %>
52- < p > Question not answered. </ p >
52+ < p > <%= _ ( ' Question not answered' ) %> </ p >
5353 <% else %>
5454 <% q_format = question . question_format %>
5555 <% if q_format . title == _ ( 'Check box' ) || q_format . title == _ ( 'Multi select box' ) ||
Original file line number Diff line number Diff line change 2727 value = @exported_plan . send ( field )
2828 if value . present?
2929 %>
30- < p > < strong > <%= t ( "helpers.plan.export. #{ field } " ) -%> </ strong > <%= value -%> </ p >
30+ < p > < strong > <%= admin_field_t ( field ) -%> </ strong > <%= value -%> </ p >
3131 <% end %>
3232 <% end %>
3333
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ xml.plan("id" => @plan.id) do
88 xml . details do
99 details . each do |field |
1010 value = @exported_plan . send ( field )
11- xml . detail ( value , title : t ( "helpers.plan.export. #{ field } " ) ) if value . present?
11+ xml . detail ( value , title : admin_field_t ( field ) ) if value . present?
1212 end
1313 end
1414 end
You can’t perform that action at this time.
0 commit comments