Commit 760ea10e93091b38adee02f848def06b0986df60
Committed by
Gabriela Navarro
1 parent
e682f9c1
Exists in
master
and in
5 other branches
fix_institution: Show SISP option when user is admin
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com> Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Showing
3 changed files
with
6 additions
and
2 deletions
Show diff stats
controllers/mpog_software_plugin_controller.rb
| ... | ... | @@ -39,6 +39,8 @@ class MpogSoftwarePluginController < ApplicationController |
| 39 | 39 | end |
| 40 | 40 | |
| 41 | 41 | def create_institution |
| 42 | + @show_sisp_field = environment.admins.include?(current_user.person) | |
| 43 | + | |
| 42 | 44 | if request.xhr? |
| 43 | 45 | render :layout=>false |
| 44 | 46 | else |
| ... | ... | @@ -54,6 +56,8 @@ class MpogSoftwarePluginController < ApplicationController |
| 54 | 56 | end |
| 55 | 57 | |
| 56 | 58 | def create_institution_admin |
| 59 | + @show_sisp_field = environment.admins.include?(current_user.person) | |
| 60 | + | |
| 57 | 61 | @url_token = split_http_referer request.original_url() |
| 58 | 62 | end |
| 59 | 63 | ... | ... |
public/mpog-institution-validations.js
| ... | ... | @@ -223,7 +223,7 @@ |
| 223 | 223 | |
| 224 | 224 | jQuery("#create_institution_link").click(open_create_institution_modal); |
| 225 | 225 | |
| 226 | - jQuery("input[type='radio']").click(institution_type_actions); | |
| 226 | + jQuery("input[type='radio'][name='institutions[type]']").click(institution_type_actions); | |
| 227 | 227 | |
| 228 | 228 | jQuery('#save_institution_button').click(save_institution); |
| 229 | 229 | ... | ... |
views/mpog_software_plugin/_institution.html.erb
| ... | ... | @@ -98,7 +98,7 @@ |
| 98 | 98 | <%= inst.label("sisp" ,_("Yes")) %> |
| 99 | 99 | <%= inst.radio_button(:sisp, true) %> |
| 100 | 100 | <%= inst.label("sisp" ,_("No")) %> |
| 101 | - <%= inst.radio_button(:sisp, false) %> | |
| 101 | + <%= inst.radio_button(:sisp, false, :checked=>"checked") %> | |
| 102 | 102 | <% else %> |
| 103 | 103 | <%= inst.label("sisp", _("No")) %> |
| 104 | 104 | <% end %> | ... | ... |