Commit bf8193c2aceca7e72abf65b39f66c4eb72fc513a
Exists in
master
and in
1 other branch
Merge branch 'siorg_field_only' into 'master'
Siorg field only Relacionado com #424 See merge request !260
Showing
13 changed files
with
254 additions
and
114 deletions
Show diff stats
src/noosfero-spb/gov_user/controllers/gov_user_plugin_controller.rb
... | ... | @@ -120,7 +120,7 @@ class GovUserPluginController < ApplicationController |
120 | 120 | params[:community] ||= {} |
121 | 121 | params[:institutions] ||= {} |
122 | 122 | |
123 | - @show_sisp_field = user.is_admin? | |
123 | + @show_admin_fields = user.is_admin? | |
124 | 124 | @governmental_sphere = get_governmental_spheres() |
125 | 125 | @governmental_power = get_governmental_powers() |
126 | 126 | @juridical_nature = get_juridical_natures() | ... | ... |
src/noosfero-spb/gov_user/controllers/gov_user_plugin_myprofile_controller.rb
... | ... | @@ -7,7 +7,7 @@ class GovUserPluginMyprofileController < MyProfileController |
7 | 7 | end |
8 | 8 | |
9 | 9 | def edit_institution |
10 | - @show_sisp_field = user.is_admin? | |
10 | + @show_admin_fields = user.is_admin? | |
11 | 11 | @state_list = NationalRegion.find( |
12 | 12 | :all, |
13 | 13 | :conditions => { :national_region_type_id => 2 }, | ... | ... |
src/noosfero-spb/gov_user/db/migrate/20160525181858_change_siorg_column_type.rb
0 → 100644
src/noosfero-spb/gov_user/features/institution_registration.feature
... | ... | @@ -47,3 +47,25 @@ Feature: Institution Field |
47 | 47 | And I should not see "community_city" |
48 | 48 | And I select "Brazil" from "community_country" |
49 | 49 | Then I should not see "Gama" |
50 | + | |
51 | + @selenium | |
52 | + Scenario: Show sisp and siorg field to admin on create new institution form | |
53 | + Given I follow "Control panel" | |
54 | + And I follow "Edit Profile" | |
55 | + When I follow "Create new institution" | |
56 | + And I choose "Public Institution" | |
57 | + Then I should see "SISP?" | |
58 | + And I should see "SIORG Code" | |
59 | + | |
60 | + @selenium | |
61 | + Scenario: Not show sisp and siorg field to regular user on create new institution form | |
62 | + Given the following users | |
63 | + | login | | |
64 | + | zombie | | |
65 | + And I am logged in as "zombie" | |
66 | + When I follow "Control panel" | |
67 | + And I follow "Edit Profile" | |
68 | + And I follow "Create new institution" | |
69 | + And I choose "Public Institution" | |
70 | + Then I should not see "SISP?" | |
71 | + And I should not see "SIORG Code" | ... | ... |
src/noosfero-spb/gov_user/lib/institution.rb
... | ... | @@ -48,6 +48,9 @@ class Institution < ActiveRecord::Base |
48 | 48 | validate :validate_country, :validate_state, :validate_city, |
49 | 49 | :verify_institution_type |
50 | 50 | |
51 | + validates :siorg_code, | |
52 | + format: {with: /\A[0-9]+\z/, message: _("invalid, only numbers are allowed.")}, | |
53 | + allow_blank: true | |
51 | 54 | |
52 | 55 | def has_accepted_rating? user_rating |
53 | 56 | rating_ids = OrganizationRating.where(institution_id: self.id, organization_id: user_rating.organization_id).map(&:id) | ... | ... |
src/noosfero-spb/gov_user/po/gov_user.pot
... | ... | @@ -89,15 +89,23 @@ msgstr "" |
89 | 89 | msgid "Institution" |
90 | 90 | msgstr "" |
91 | 91 | |
92 | -#: ../lib/institution.rb:68 | |
92 | +#: ../lib/institution.rb:6 | |
93 | +msgid "institution" | |
94 | +msgstr "" | |
95 | + | |
96 | +#: ../lib/institution.rb:55 | |
97 | +msgid "invalid, only numbers are allowed." | |
98 | +msgstr "" | |
99 | + | |
100 | +#: ../lib/institution.rb:78 | |
93 | 101 | msgid "invalid, only public and private institutions are allowed." |
94 | 102 | msgstr "" |
95 | 103 | |
96 | -#: ../lib/institution.rb:80 ../lib/institution.rb:91 ../lib/institution.rb:107 | |
104 | +#: ../lib/institution.rb:90 ../lib/institution.rb:101 ../lib/institution.rb:117 | |
97 | 105 | msgid "can't be blank" |
98 | 106 | msgstr "" |
99 | 107 | |
100 | -#: ../lib/institution.rb:94 | |
108 | +#: ../lib/institution.rb:104 | |
101 | 109 | msgid "invalid state" |
102 | 110 | msgstr "" |
103 | 111 | |
... | ... | @@ -160,105 +168,109 @@ msgstr "" |
160 | 168 | msgid "Private Institution" |
161 | 169 | msgstr "" |
162 | 170 | |
163 | -#: ../views/gov_user_plugin/_institution.html.erb:48 | |
171 | +#: ../views/gov_user_plugin/_institution.html.erb:46 | |
164 | 172 | #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:45 |
165 | 173 | msgid "Corporate Name" |
166 | 174 | msgstr "" |
167 | 175 | |
168 | -#: ../views/gov_user_plugin/_institution.html.erb:53 | |
176 | +#: ../views/gov_user_plugin/_institution.html.erb:51 | |
169 | 177 | msgid "Institution name already exists" |
170 | 178 | msgstr "" |
171 | 179 | |
180 | +#: ../views/gov_user_plugin/_institution.html.erb:56 | |
181 | +#: ../views/gov_user_plugin/_institution.html.erb:58 | |
182 | +#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:75 | |
183 | +#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:77 | |
184 | +msgid "Acronym" | |
185 | +msgstr "" | |
186 | + | |
172 | 187 | #: ../views/gov_user_plugin/_institution.html.erb:57 |
173 | -#: ../views/gov_user_plugin/_institution.html.erb:105 | |
188 | +#: ../views/gov_user_plugin/_institution.html.erb:67 | |
174 | 189 | #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:48 |
175 | 190 | #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:76 |
176 | 191 | msgid "Fantasy name" |
177 | 192 | msgstr "" |
178 | 193 | |
179 | -#: ../views/gov_user_plugin/_institution.html.erb:65 | |
194 | +#: ../views/gov_user_plugin/_institution.html.erb:76 | |
180 | 195 | #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:54 |
181 | 196 | msgid "Country" |
182 | 197 | msgstr "" |
183 | 198 | |
184 | -#: ../views/gov_user_plugin/_institution.html.erb:69 | |
199 | +#: ../views/gov_user_plugin/_institution.html.erb:80 | |
185 | 200 | #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:54 |
186 | 201 | msgid "Select a country" |
187 | 202 | msgstr "" |
188 | 203 | |
189 | -#: ../views/gov_user_plugin/_institution.html.erb:74 | |
204 | +#: ../views/gov_user_plugin/_institution.html.erb:85 | |
190 | 205 | #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:58 |
191 | 206 | msgid "State" |
192 | 207 | msgstr "" |
193 | 208 | |
194 | -#: ../views/gov_user_plugin/_institution.html.erb:78 | |
209 | +#: ../views/gov_user_plugin/_institution.html.erb:89 | |
195 | 210 | #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:58 |
196 | 211 | msgid "Select a state" |
197 | 212 | msgstr "" |
198 | 213 | |
199 | -#: ../views/gov_user_plugin/_institution.html.erb:83 | |
214 | +#: ../views/gov_user_plugin/_institution.html.erb:94 | |
200 | 215 | msgid "City" |
201 | 216 | msgstr "" |
202 | 217 | |
203 | -#: ../views/gov_user_plugin/_institution.html.erb:95 | |
218 | +#: ../views/gov_user_plugin/_institution.html.erb:106 | |
204 | 219 | #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:68 |
205 | 220 | msgid "CNPJ" |
206 | 221 | msgstr "" |
207 | 222 | |
208 | -#: ../views/gov_user_plugin/_institution.html.erb:104 | |
209 | -#: ../views/gov_user_plugin/_institution.html.erb:106 | |
210 | -#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:75 | |
211 | -#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:77 | |
212 | -msgid "Acronym" | |
213 | -msgstr "" | |
214 | - | |
215 | -#: ../views/gov_user_plugin/_institution.html.erb:114 | |
223 | +#: ../views/gov_user_plugin/_institution.html.erb:117 | |
216 | 224 | msgid "Governmental Sphere" |
217 | 225 | msgstr "" |
218 | 226 | |
219 | -#: ../views/gov_user_plugin/_institution.html.erb:125 | |
227 | +#: ../views/gov_user_plugin/_institution.html.erb:128 | |
220 | 228 | msgid "Governmental Power" |
221 | 229 | msgstr "" |
222 | 230 | |
223 | -#: ../views/gov_user_plugin/_institution.html.erb:136 | |
231 | +#: ../views/gov_user_plugin/_institution.html.erb:139 | |
224 | 232 | msgid "Juridical Nature" |
225 | 233 | msgstr "" |
226 | 234 | |
227 | -#: ../views/gov_user_plugin/_institution.html.erb:150 | |
228 | -#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:121 | |
235 | +#: ../views/gov_user_plugin/_institution.html.erb:153 | |
236 | +#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:132 | |
229 | 237 | msgid "SISP?" |
230 | 238 | msgstr "" |
231 | 239 | |
232 | -#: ../views/gov_user_plugin/_institution.html.erb:155 | |
233 | -#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:126 | |
240 | +#: ../views/gov_user_plugin/_institution.html.erb:158 | |
241 | +#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:137 | |
234 | 242 | #: ../views/profile/_institution_tab.html.erb:19 |
235 | 243 | msgid "Yes" |
236 | 244 | msgstr "" |
237 | 245 | |
238 | -#: ../views/gov_user_plugin/_institution.html.erb:160 | |
239 | -#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:130 | |
240 | -#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:133 | |
246 | +#: ../views/gov_user_plugin/_institution.html.erb:163 | |
247 | +#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:141 | |
248 | +#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:144 | |
241 | 249 | #: ../views/profile/_institution_tab.html.erb:19 |
242 | 250 | msgid "No" |
243 | 251 | msgstr "" |
244 | 252 | |
245 | -#: ../views/gov_user_plugin/_institution.html.erb:170 | |
246 | -#: ../views/gov_user_plugin/_institution.html.erb:173 | |
247 | -#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:143 | |
253 | +#: ../views/gov_user_plugin/_institution.html.erb:171 | |
254 | +msgid "SIORG Code" | |
255 | +msgstr "" | |
256 | + | |
257 | +#: ../views/gov_user_plugin/_institution.html.erb:180 | |
258 | +#: ../views/gov_user_plugin/_institution.html.erb:183 | |
259 | +#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:154 | |
248 | 260 | msgid "Save" |
249 | 261 | msgstr "" |
250 | 262 | |
251 | -#: ../views/gov_user_plugin/_institution.html.erb:171 | |
252 | -#: ../views/gov_user_plugin/_institution.html.erb:174 | |
253 | -#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:144 | |
263 | +#: ../views/gov_user_plugin/_institution.html.erb:181 | |
264 | +#: ../views/gov_user_plugin/_institution.html.erb:184 | |
265 | +#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:155 | |
254 | 266 | msgid "Cancel" |
255 | 267 | msgstr "" |
256 | 268 | |
257 | -#: ../views/gov_user_plugin/_institution.html.erb:175 | |
269 | +#: ../views/gov_user_plugin/_institution.html.erb:185 | |
258 | 270 | msgid "Could not send the form data to the server" |
259 | 271 | msgstr "" |
260 | 272 | |
261 | -#: ../views/gov_user_plugin/_institution.html.erb:183 | |
273 | +#: ../views/gov_user_plugin/_institution.html.erb:193 | |
262 | 274 | msgid "Creating institution" |
263 | 275 | msgstr "" |
264 | 276 | |
... | ... | @@ -288,6 +300,10 @@ msgstr "" |
288 | 300 | msgid "Juridical Nature:" |
289 | 301 | msgstr "" |
290 | 302 | |
303 | +#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:119 | |
304 | +msgid "SIORG Code:" | |
305 | +msgstr "" | |
306 | + | |
291 | 307 | #: ../views/incomplete_registration.html.erb:3 |
292 | 308 | msgid "Complete Profile" |
293 | 309 | msgstr "" | ... | ... |
src/noosfero-spb/gov_user/po/pt/gov_user.po
... | ... | @@ -63,6 +63,12 @@ msgstr "Informações da Instituição" |
63 | 63 | msgid "Institution" |
64 | 64 | msgstr "Instituição" |
65 | 65 | |
66 | +msgid "institution" | |
67 | +msgstr "instituição" | |
68 | + | |
69 | +msgid "invalid, only numbers are allowed." | |
70 | +msgstr "inválido, apenas números são permitidos." | |
71 | + | |
66 | 72 | msgid "invalid, only public and private institutions are allowed." |
67 | 73 | msgstr "Inválido, somente instituições públicas e privadas são permitidas." |
68 | 74 | |
... | ... | @@ -123,6 +129,9 @@ msgstr "Razão Social" |
123 | 129 | msgid "Institution name already exists" |
124 | 130 | msgstr "Nome de Instituição já existe" |
125 | 131 | |
132 | +msgid "Acronym" | |
133 | +msgstr "Sigla" | |
134 | + | |
126 | 135 | msgid "Fantasy name" |
127 | 136 | msgstr "Nome Fantasia" |
128 | 137 | |
... | ... | @@ -144,9 +153,6 @@ msgstr "Cidade" |
144 | 153 | msgid "CNPJ" |
145 | 154 | msgstr "CNPJ" |
146 | 155 | |
147 | -msgid "Acronym" | |
148 | -msgstr "Sigla" | |
149 | - | |
150 | 156 | msgid "Governmental Sphere" |
151 | 157 | msgstr "Esfera Governamental:" |
152 | 158 | |
... | ... | @@ -165,6 +171,9 @@ msgstr "Sim" |
165 | 171 | msgid "No" |
166 | 172 | msgstr "Não" |
167 | 173 | |
174 | +msgid "SIORG Code" | |
175 | +msgstr "Código SIORG" | |
176 | + | |
168 | 177 | msgid "Save" |
169 | 178 | msgstr "Salvar" |
170 | 179 | |
... | ... | @@ -198,6 +207,9 @@ msgstr "Poder Governamental:" |
198 | 207 | msgid "Juridical Nature:" |
199 | 208 | msgstr "Natureza Jurídica:" |
200 | 209 | |
210 | +msgid "SIORG Code:" | |
211 | +msgstr "Código SIORG:" | |
212 | + | |
201 | 213 | msgid "Complete Profile" |
202 | 214 | msgstr "Complete o Perfil" |
203 | 215 | ... | ... |
src/noosfero-spb/gov_user/public/views/create-institution.js
... | ... | @@ -45,6 +45,7 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
45 | 45 | |
46 | 46 | |
47 | 47 | function get_institution_post_data() { |
48 | + | |
48 | 49 | return { |
49 | 50 | cnpj: $("#institutions_cnpj").val(), |
50 | 51 | type: $("input[name='institutions[type]']:checked").val(), |
... | ... | @@ -52,7 +53,9 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
52 | 53 | governmental_power: $("#institutions_governmental_power").selected().val(), |
53 | 54 | governmental_sphere: $("#institutions_governmental_sphere").selected().val(), |
54 | 55 | juridical_nature: $("#institutions_juridical_nature").selected().val(), |
55 | - corporate_name: $("#institutions_corporate_name").val() | |
56 | + corporate_name: $("#institutions_corporate_name").val(), | |
57 | + siorg_code: $("#institutions_siorg_code").val(), | |
58 | + sisp: $('input[name="institutions[sisp]"]:checked').val() | |
56 | 59 | }; |
57 | 60 | } |
58 | 61 | ... | ... |
src/noosfero-spb/gov_user/test/unit/institution_test.rb
... | ... | @@ -73,4 +73,19 @@ class InstitutionTest < ActiveSupport::TestCase |
73 | 73 | assert_includes search_result_env1, @institution.id |
74 | 74 | assert_not_includes search_result_env2, @institution.id |
75 | 75 | end |
76 | + | |
77 | + should "not save if siorg_code is not a number" do | |
78 | + @institution.siorg_code = "not a number" | |
79 | + assert_equal false, @institution.save | |
80 | + | |
81 | + @institution.siorg_code = "1111111" | |
82 | + assert_equal true, @institution.save | |
83 | + end | |
84 | + | |
85 | + should "validate siorg_code if it is blank" do | |
86 | + @institution.siorg_code = "" | |
87 | + assert_equal true, @institution.save | |
88 | + end | |
89 | + | |
90 | + | |
76 | 91 | end | ... | ... |
src/noosfero-spb/gov_user/views/gov_user_plugin/_institution.html.erb
... | ... | @@ -30,37 +30,48 @@ |
30 | 30 | <%= hidden_field_tag "edit_institution_page", false %> |
31 | 31 | <%= fields_for :institutions do |inst| %> |
32 | 32 | <div class="spb-row no-margin-top"> |
33 | - <div class='spb-col spb-col-3'> | |
33 | + <div class='spb-col'> | |
34 | 34 | <%= labelled_radio_button _('Public Institution'), 'institutions[type]', 'PublicInstitution', true %> |
35 | 35 | </div> |
36 | 36 | |
37 | - <div class="spb-col spb-col-3"> | |
37 | + <div class="spb-col"> | |
38 | 38 | <%= labelled_radio_button _('Private Institution'), 'institutions[type]', 'PrivateInstitution' %> |
39 | 39 | </div> |
40 | 40 | |
41 | - <div class="spb-col spb-col-3"></div> | |
42 | - <div class="spb-col spb-col-3"></div> | |
43 | 41 | </div> |
44 | 42 | |
45 | 43 | <div class="spb-row"> |
46 | - <div class="spb-col spb-col-5"> | |
44 | + <div class="spb-col"> | |
47 | 45 | <label for="community_name" class="formlabel"> |
48 | 46 | <%= _("Corporate Name") %><!-- razão social --> |
49 | 47 | <span class="required-field">(*)</span> |
50 | 48 | </label> |
51 | 49 | |
52 | - <%= f.text_field(:name, :class => flash[:error_community_name], :value => params[:community][:name]) %> | |
50 | + <%= f.text_field(:name, :class => flash[:error_community_name], :maxlength => 250, :value => params[:community][:name]) %> | |
53 | 51 | <%= content_tag :span, _("Institution name already exists"), :id=>"already_exists_text", :class=>"errorExplanation hide-field" %> |
54 | 52 | </div> |
55 | 53 | |
56 | - <div class="spb-col spb-col-6"> | |
54 | + <div class="public-institutions-fields"> | |
55 | + <div class="spb-col"> | |
56 | + <%= hidden_field_tag "acronym_translate", _("Acronym") %> | |
57 | + <%= hidden_field_tag "fantasy_name_translate", _("Fantasy name") %> | |
58 | + <%= inst.label("acronym" ,_("Acronym"), :class=>"formlabel", id: "institution_acronym_label") %> | |
59 | + <%= inst.text_field(:acronym, :value => params[:institutions][:acronym], :maxlength => 12) %> | |
60 | + </div> | |
61 | + </div> | |
62 | + | |
63 | + </div> | |
64 | + | |
65 | + <div class="spb-row"> | |
66 | + <div class="spb-col spb-col-12"> | |
57 | 67 | <%= inst.label "corporate_name", _("Fantasy name"), :class=>"formlabel" %><!-- Nome fantasia --> |
58 | - <%= inst.text_field(:corporate_name, :value => params[:institutions][:corporate_name], :size => 55) %> | |
68 | + <%= inst.text_field(:corporate_name, :value => params[:institutions][:corporate_name], :size => 55, :maxlength => 250) %> | |
59 | 69 | </div> |
60 | 70 | </div> |
61 | 71 | |
62 | 72 | <div class="spb-row"> |
63 | - <div class="spb-col spb-col-5"> | |
73 | + | |
74 | + <div class="spb-col"> | |
64 | 75 | <label for="community_country" class="formlabel"> |
65 | 76 | <%= _("Country") %> |
66 | 77 | <span class="required-field">(*)</span> |
... | ... | @@ -69,7 +80,7 @@ |
69 | 80 | <%= select("community", "country", [[_('Select a country'), -1]] + country_helper.countries, {:class => "type-select #{flash[:error_community_country]}"}) %> |
70 | 81 | </div> |
71 | 82 | |
72 | - <div class="spb-col spb-col-2"> | |
83 | + <div class="spb-col"> | |
73 | 84 | <label for="community_state" class="formlabel"> |
74 | 85 | <%= _("State") %> |
75 | 86 | <span class="required-field">(*)</span> |
... | ... | @@ -78,13 +89,13 @@ |
78 | 89 | <%= select("community", "state", [[_('Select a state'), '']] + @state_options, {:class => "type-select #{flash[:error_community_state]}"}) %> |
79 | 90 | </div> |
80 | 91 | |
81 | - <div class="spb-col spb-col-5"> | |
92 | + <div class="spb-col"> | |
82 | 93 | <label class="formlabel" for="community_city"> |
83 | 94 | <%= _("City") %> |
84 | 95 | <span class="required-field">(*)</span> |
85 | 96 | </label> |
86 | 97 | |
87 | - <%= f.text_field(:city, :class => flash[:error_community_city], :value => params[:community][:city]) %> | |
98 | + <%= f.text_field(:city, :class => flash[:error_community_city], :value => params[:community][:city], :maxlength => 250) %> | |
88 | 99 | </div> |
89 | 100 | </div> |
90 | 101 | |
... | ... | @@ -99,14 +110,6 @@ |
99 | 110 | </div> |
100 | 111 | </div> |
101 | 112 | |
102 | - <div class="spb-row"> | |
103 | - <div class="spb-col spb-col-12"> | |
104 | - <%= hidden_field_tag "acronym_translate", _("Acronym") %> | |
105 | - <%= hidden_field_tag "fantasy_name_translate", _("Fantasy name") %> | |
106 | - <%= inst.label("acronym" ,_("Acronym"), :class=>"formlabel") %> | |
107 | - <%= inst.text_field(:acronym, :value => params[:institutions][:acronym]) %> | |
108 | - </div> | |
109 | - </div> | |
110 | 113 | |
111 | 114 | <div class="spb-row public-institutions-fields"> |
112 | 115 | <div class="spb-col spb-col-6"> |
... | ... | @@ -141,28 +144,35 @@ |
141 | 144 | </div> |
142 | 145 | </div> |
143 | 146 | |
144 | - <div class="spb-row public-institutions-fields"> | |
145 | - <div class="spc-col spb-col-12 sisp-fields"> | |
146 | - <div class="spb-col spb-col-3"> | |
147 | - <% if @show_sisp_field %> | |
147 | + <% if @show_admin_fields %> | |
148 | + <div class="spb-row public-institutions-fields"> | |
149 | + <div class="spc-col spb-col-12 sisp-fields"> | |
150 | + <div class="spb-col spb-col-3"> | |
148 | 151 | |
149 | - <div class="spb-col spb-col-12"> | |
150 | - <%= _("SISP?") %> | |
151 | - </div> | |
152 | + <div class="spb-col spb-col-12"> | |
153 | + <%= _("SISP?") %> | |
154 | + </div> | |
152 | 155 | |
153 | - <div class="spb-col spb-col-5"> | |
154 | - <%= inst.radio_button(:sisp, true, :class => "#{flash[:error_institution_sisp]}" ) %> | |
155 | - <%= inst.label :sisp ,_("Yes"), :value => true %> | |
156 | - </div> | |
156 | + <div class="spb-col spb-col-5"> | |
157 | + <%= inst.radio_button(:sisp, true, :class => "#{flash[:error_institution_sisp]}" ) %> | |
158 | + <%= inst.label :sisp ,_("Yes"), :value => true %> | |
159 | + </div> | |
157 | 160 | |
158 | - <div class="spb-col spb-col-6"> | |
159 | - <%= inst.radio_button(:sisp, false, :checked=>"checked", :class => "#{flash[:error_institution_sisp]}") %> | |
160 | - <%= inst.label :sisp ,_("No"), :value => false %> | |
161 | + <div class="spb-col spb-col-6"> | |
162 | + <%= inst.radio_button(:sisp, false, :checked=>"checked", :class => "#{flash[:error_institution_sisp]}") %> | |
163 | + <%= inst.label :sisp ,_("No"), :value => false %> | |
164 | + </div> | |
161 | 165 | </div> |
162 | - <% end %> | |
163 | 166 | </div> |
164 | 167 | </div> |
165 | - </div> | |
168 | + | |
169 | + <div class="spb-row public-institutions-fields"> | |
170 | + <div class="spb-col spb-col-12"> | |
171 | + <%= inst.label("siorg_code" ,_("SIORG Code"), :class=>"formlabel") %> | |
172 | + <%= inst.text_field(:siorg_code, :value => params[:institutions][:siorg_code]) %> | |
173 | + </div> | |
174 | + </div> | |
175 | + <% end %> | |
166 | 176 | |
167 | 177 | <div class="spb-row modal-form-actions"> |
168 | 178 | <div class="spb-col spb-col-6"> | ... | ... |
src/noosfero-spb/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb
... | ... | @@ -41,10 +41,21 @@ |
41 | 41 | </div> |
42 | 42 | |
43 | 43 | <div class="spb-row"> |
44 | - <div class="spb-col spb-col-4"> | |
44 | + <div class="spb-col spb-col-7"> | |
45 | 45 | <%= required labelled_form_field(_('Corporate Name'), text_field_tag('community[name]', @institution.community.name)) %> |
46 | 46 | </div> |
47 | - <div class="spb-col spb-col-5"> | |
47 | + <span class='optional-field'> | |
48 | + <div class="spb-col spb-col-5"> | |
49 | + <%= hidden_field_tag "acronym_translate", _("Acronym") %> | |
50 | + <%= hidden_field_tag "fantasy_name_translate", _("Fantasy name") %> | |
51 | + <%= inst.label("acronym" ,_("Acronym"), :class=>"formlabel") %> | |
52 | + <%= inst.text_field(:acronym, :value => @institution.acronym) %> | |
53 | + </div> | |
54 | + </div> | |
55 | + </div> | |
56 | + | |
57 | + <div class="spb-row"> | |
58 | + <div class="spb-col spb-col-12"> | |
48 | 59 | <%= labelled_form_field(_('Fantasy name'), inst.text_field(:corporate_name, :value => @institution.corporate_name)) %> |
49 | 60 | </div> |
50 | 61 | </div> |
... | ... | @@ -63,21 +74,16 @@ |
63 | 74 | </div> |
64 | 75 | </div> |
65 | 76 | |
66 | - <span class='optional-field'> | |
67 | - <div class="formfield type-text"> | |
68 | - <%= inst.label("cnpj" ,_("CNPJ"), :class=>"formlabel") %> | |
69 | - <%= required inst.text_field(:cnpj, :placeholder=>"99.999.999/9999-99", :class=>"intitution_cnpj_field", :value => @institution.cnpj) %> | |
70 | - </div> | |
71 | - </span> | |
72 | - | |
73 | - <span class='optional-field'> | |
74 | - <div class="formfield type-text"> | |
75 | - <%= hidden_field_tag "acronym_translate", _("Acronym") %> | |
76 | - <%= hidden_field_tag "fantasy_name_translate", _("Fantasy name") %> | |
77 | - <%= inst.label("acronym" ,_("Acronym"), :class=>"formlabel") %> | |
78 | - <%= inst.text_field(:acronym, :value => @institution.acronym) %> | |
77 | + <div class="spb-row"> | |
78 | + <div class="spb-col spb-col-12"> | |
79 | + <span class='optional-field'> | |
80 | + <div class="formfield type-text"> | |
81 | + <%= inst.label("cnpj" ,_("CNPJ"), :class=>"formlabel") %> | |
82 | + <%= required inst.text_field(:cnpj, :placeholder=>"99.999.999/9999-99", :class=>"intitution_cnpj_field", :value => @institution.cnpj) %> | |
83 | + </div> | |
84 | + </span> | |
79 | 85 | </div> |
80 | - </span> | |
86 | + </div> | |
81 | 87 | |
82 | 88 | <div class="spb-row public-institutions-fields"> |
83 | 89 | <div class="spb-col spb-col-6"> |
... | ... | @@ -112,6 +118,17 @@ |
112 | 118 | </div> |
113 | 119 | </div> |
114 | 120 | |
121 | + <div class="spb-row public-institutions-fields"> | |
122 | + <div class="spb-col spb-col-6"> | |
123 | + <span class='required-field public-institutions-fields'> | |
124 | + <div class="formfield type-text"> | |
125 | + <%= inst.label("siorg_code" ,_("SIORG Code:"), :class=>"formlabel") %> | |
126 | + <%= inst.text_field(:siorg_code, :value => @institution.siorg_code) %> | |
127 | + </div> | |
128 | + </span> | |
129 | + </div> | |
130 | + </div> | |
131 | + | |
115 | 132 | <div class="spc-col spb-col-12 sisp-fields"> |
116 | 133 | <div class="spb-row public-institutions-fields"> |
117 | 134 | <div class="spb-col spb-col-3"> |
... | ... | @@ -120,7 +137,7 @@ |
120 | 137 | <div class="spb-col spb-col-12"> |
121 | 138 | <%= _("SISP?") %> |
122 | 139 | </div> |
123 | - <% if @show_sisp_field %> | |
140 | + <% if @show_admin_fields %> | |
124 | 141 | <div class="spb-col spb-col-4"> |
125 | 142 | <%= inst.radio_button(:sisp, true, :checked=>(@institution.sisp ? true : false)) %> |
126 | 143 | <%= inst.label("sisp" ,_("Yes")) %> | ... | ... |
src/noosfero-spb/noosfero-spb-theme/css/administration-panel.css
... | ... | @@ -346,22 +346,33 @@ |
346 | 346 | margin-bottom: 10px; |
347 | 347 | } |
348 | 348 | |
349 | +.action-gov_user_plugin_myprofile-edit_institution #content .main-content .formfieldline { | |
350 | + margin-top: 0; | |
351 | + padding: 0; | |
352 | +} | |
353 | + | |
349 | 354 | .action-gov_user_plugin_myprofile-edit_institution #community_name { |
350 | 355 | color: black; |
351 | - width: 220px | |
356 | + width: 402px; | |
352 | 357 | } |
353 | 358 | |
354 | 359 | .action-gov_user_plugin-create_institution_admin #community_name { |
355 | - width: 200px; | |
360 | + width: 372px; | |
356 | 361 | } |
357 | 362 | |
358 | 363 | .action-gov_user_plugin_myprofile-edit_institution #institutions_corporate_name { |
359 | - width: 287px; | |
364 | + width: 537px; | |
360 | 365 | color: black; |
361 | 366 | } |
362 | 367 | |
368 | +.action-gov_user_plugin-create_institution_admin #institutions_cnpj, | |
363 | 369 | .action-gov_user_plugin-create_institution_admin #institutions_corporate_name { |
364 | - width: 310px; | |
370 | + width: 508px; | |
371 | +} | |
372 | + | |
373 | +.action-gov_user_plugin_myprofile-edit_institution #institutions_cnpj { | |
374 | + width: 537px; | |
375 | + color: black; | |
365 | 376 | } |
366 | 377 | |
367 | 378 | .action-gov_user_plugin_myprofile-edit_institution #community_country { |
... | ... | @@ -383,20 +394,18 @@ |
383 | 394 | } |
384 | 395 | |
385 | 396 | .action-gov_user_plugin_myprofile-edit_institution #community_city { |
386 | - width: 165px; | |
397 | + width: 171px; | |
387 | 398 | color: black; |
388 | 399 | } |
389 | 400 | |
390 | 401 | .action-gov_user_plugin-create_institution_admin #community_city { |
391 | - width: 222px; | |
402 | + width: 199px; | |
392 | 403 | } |
393 | 404 | |
394 | -.action-gov_user_plugin_myprofile-edit_institution #institutions_cnpj, | |
395 | 405 | .action-gov_user_plugin_myprofile-edit_institution #institutions_acronym, |
396 | -.action-gov_user_plugin-create_institution_admin #institutions_cnpj, | |
397 | 406 | .action-gov_user_plugin-create_institution_admin #institutions_acronym { |
398 | 407 | text-indent: 5px; |
399 | - width: 530px; | |
408 | + width: 111px; | |
400 | 409 | } |
401 | 410 | |
402 | 411 | .action-gov_user_plugin_myprofile-edit_institution .modal-form-actions, |
... | ... | @@ -409,7 +418,20 @@ |
409 | 418 | margin-top: 15px; |
410 | 419 | } |
411 | 420 | |
412 | -.action-gov_user_plugin_myprofile-edit_institution #content form input.button.with-text, | |
421 | +.action-gov_user_plugin_myprofile-edit_institution #content .main-content input.button.with-text.icon-save.submit { | |
422 | + background: #3E67B1 none; | |
423 | + color: #fff; | |
424 | + border-radius: 4px; | |
425 | + border: 1px solid #3E67B1; | |
426 | + font-size: 14px; | |
427 | + font-family: "open_sansregular", Arial; | |
428 | + line-height: 17px; | |
429 | + max-height: 32px; | |
430 | + height: 32px; | |
431 | + padding: 5px 15px; | |
432 | + margin-right: 5px; | |
433 | +} | |
434 | + | |
413 | 435 | .action-gov_user_plugin-create_institution_admin #content form input.button.with-text { |
414 | 436 | background-color: #3E67B1; |
415 | 437 | color: #fff; |
... | ... | @@ -694,6 +716,14 @@ |
694 | 716 | color: #585858; |
695 | 717 | } |
696 | 718 | |
719 | +#noosfero_profile-content #content .main-content #profile-data #institutions_siorg_code, | |
720 | +.action-profile_editor-edit #content .main-content #profile-data #institutions_siorg_code, | |
721 | +.action-gov_user_plugin-create_institution_admin #content .main-content #institutions_siorg_code, | |
722 | +.action-gov_user_plugin_myprofile-edit_institution #content .main-content #institutions_siorg_code, | |
723 | +.action-organization_ratings_plugin_profile-new_rating #content .main-content #institutions_siorg_code { | |
724 | + width: 189px; | |
725 | +} | |
726 | + | |
697 | 727 | .action-users-send_mail #content .main-content{ |
698 | 728 | font-family: Arial; |
699 | 729 | } | ... | ... |
src/noosfero-spb/noosfero-spb-theme/css/modal.css
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | |
31 | 31 | .action-profile_editor-edit #content .main-content #profile-data .modal-dialog, |
32 | 32 | .modal-dialog { |
33 | - width: 45%; | |
33 | + width: 590px; | |
34 | 34 | margin: 15px auto; |
35 | 35 | position: relative; |
36 | 36 | } |
... | ... | @@ -235,13 +235,18 @@ |
235 | 235 | .action-profile_editor-edit #content .main-content #profile-data .modal #community_name, |
236 | 236 | .modal #community_name { |
237 | 237 | height: 16px; |
238 | - width: 200px; | |
238 | + width: 392px; | |
239 | 239 | } |
240 | 240 | |
241 | +.action-profile_editor-edit #content .main-content #profile-data .modal #institutions_cnpj, | |
242 | +.modal #institutions_cnpj{ | |
243 | + height: 16px; | |
244 | + width: 115px; | |
245 | +} | |
241 | 246 | .action-profile_editor-edit #content .main-content #profile-data .modal #institutions_corporate_name, |
242 | 247 | .modal #institutions_corporate_name { |
243 | 248 | height: 16px; |
244 | - width: 285px; | |
249 | + width: 533px; | |
245 | 250 | } |
246 | 251 | |
247 | 252 | .action-profile_editor-edit #content .main-content #profile-data .modal #community_country, |
... | ... | @@ -251,22 +256,20 @@ |
251 | 256 | |
252 | 257 | .action-profile_editor-edit #content .main-content #profile-data .modal #community_state, |
253 | 258 | .modal #community_state { |
254 | - width: 80px; | |
259 | + width: 90px; | |
255 | 260 | } |
256 | 261 | |
257 | 262 | .action-profile_editor-edit #content .main-content #profile-data .modal #community_city, |
258 | 263 | .modal #community_city { |
259 | 264 | height: 16px; |
260 | - width: 190px; | |
265 | + width: 205px; | |
261 | 266 | margin-top: 2px; |
262 | 267 | } |
263 | 268 | |
264 | -.action-profile_editor-edit #content .main-content #profile-data .modal #institutions_cnpj, | |
265 | 269 | .action-profile_editor-edit #content .main-content #profile-data .modal #institutions_acronym, |
266 | -.modal #institutions_cnpj, | |
267 | 270 | .modal #institutions_acronym { |
268 | 271 | height: 16px; |
269 | - width: 530px; | |
272 | + width: 111px; | |
270 | 273 | } |
271 | 274 | |
272 | 275 | .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-add, | ... | ... |