Merge Request #260

Merged
softwarepublico/softwarepublico!260
Created by Álvaro Fernando Matos de Souza

Siorg field only

Relacionado com #424

Merged by Daniela Feitosa

Source branch has been removed
Commits (3)
4 participants
src/noosfero-spb/gov_user/controllers/gov_user_plugin_controller.rb
@@ -120,7 +120,7 @@ class GovUserPluginController < ApplicationController @@ -120,7 +120,7 @@ class GovUserPluginController < ApplicationController
120 params[:community] ||= {} 120 params[:community] ||= {}
121 params[:institutions] ||= {} 121 params[:institutions] ||= {}
122 122
123 - @show_sisp_field = user.is_admin? 123 + @show_admin_fields = user.is_admin?
124 @governmental_sphere = get_governmental_spheres() 124 @governmental_sphere = get_governmental_spheres()
125 @governmental_power = get_governmental_powers() 125 @governmental_power = get_governmental_powers()
126 @juridical_nature = get_juridical_natures() 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 +7,7 @@ class GovUserPluginMyprofileController < MyProfileController
7 end 7 end
8 8
9 def edit_institution 9 def edit_institution
10 - @show_sisp_field = user.is_admin? 10 + @show_admin_fields = user.is_admin?
11 @state_list = NationalRegion.find( 11 @state_list = NationalRegion.find(
12 :all, 12 :all,
13 :conditions => { :national_region_type_id => 2 }, 13 :conditions => { :national_region_type_id => 2 },
src/noosfero-spb/gov_user/db/migrate/20160525181858_change_siorg_column_type.rb 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +class ChangeSiorgColumnType < ActiveRecord::Migration
  2 + def self.up
  3 + change_column :institutions, :siorg_code, :string
  4 + end
  5 +
  6 + def self.down
  7 + change_column :institutions, :siorg_code, :integer
  8 + end
  9 +end
src/noosfero-spb/gov_user/features/institution_registration.feature
@@ -47,3 +47,25 @@ Feature: Institution Field @@ -47,3 +47,25 @@ Feature: Institution Field
47 And I should not see "community_city" 47 And I should not see "community_city"
48 And I select "Brazil" from "community_country" 48 And I select "Brazil" from "community_country"
49 Then I should not see "Gama" 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 &lt; ActiveRecord::Base @@ -48,6 +48,9 @@ class Institution &lt; ActiveRecord::Base
48 validate :validate_country, :validate_state, :validate_city, 48 validate :validate_country, :validate_state, :validate_city,
49 :verify_institution_type 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 def has_accepted_rating? user_rating 55 def has_accepted_rating? user_rating
53 rating_ids = OrganizationRating.where(institution_id: self.id, organization_id: user_rating.organization_id).map(&:id) 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 &quot;&quot; @@ -89,15 +89,23 @@ msgstr &quot;&quot;
89 msgid "Institution" 89 msgid "Institution"
90 msgstr "" 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 msgid "invalid, only public and private institutions are allowed." 101 msgid "invalid, only public and private institutions are allowed."
94 msgstr "" 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 msgid "can't be blank" 105 msgid "can't be blank"
98 msgstr "" 106 msgstr ""
99 107
100 -#: ../lib/institution.rb:94 108 +#: ../lib/institution.rb:104
101 msgid "invalid state" 109 msgid "invalid state"
102 msgstr "" 110 msgstr ""
103 111
@@ -160,105 +168,109 @@ msgstr &quot;&quot; @@ -160,105 +168,109 @@ msgstr &quot;&quot;
160 msgid "Private Institution" 168 msgid "Private Institution"
161 msgstr "" 169 msgstr ""
162 170
163 -#: ../views/gov_user_plugin/_institution.html.erb:48 171 +#: ../views/gov_user_plugin/_institution.html.erb:46
164 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:45 172 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:45
165 msgid "Corporate Name" 173 msgid "Corporate Name"
166 msgstr "" 174 msgstr ""
167 175
168 -#: ../views/gov_user_plugin/_institution.html.erb:53 176 +#: ../views/gov_user_plugin/_institution.html.erb:51
169 msgid "Institution name already exists" 177 msgid "Institution name already exists"
170 msgstr "" 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 #: ../views/gov_user_plugin/_institution.html.erb:57 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 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:48 189 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:48
175 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:76 190 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:76
176 msgid "Fantasy name" 191 msgid "Fantasy name"
177 msgstr "" 192 msgstr ""
178 193
179 -#: ../views/gov_user_plugin/_institution.html.erb:65 194 +#: ../views/gov_user_plugin/_institution.html.erb:76
180 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:54 195 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:54
181 msgid "Country" 196 msgid "Country"
182 msgstr "" 197 msgstr ""
183 198
184 -#: ../views/gov_user_plugin/_institution.html.erb:69 199 +#: ../views/gov_user_plugin/_institution.html.erb:80
185 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:54 200 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:54
186 msgid "Select a country" 201 msgid "Select a country"
187 msgstr "" 202 msgstr ""
188 203
189 -#: ../views/gov_user_plugin/_institution.html.erb:74 204 +#: ../views/gov_user_plugin/_institution.html.erb:85
190 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:58 205 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:58
191 msgid "State" 206 msgid "State"
192 msgstr "" 207 msgstr ""
193 208
194 -#: ../views/gov_user_plugin/_institution.html.erb:78 209 +#: ../views/gov_user_plugin/_institution.html.erb:89
195 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:58 210 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:58
196 msgid "Select a state" 211 msgid "Select a state"
197 msgstr "" 212 msgstr ""
198 213
199 -#: ../views/gov_user_plugin/_institution.html.erb:83 214 +#: ../views/gov_user_plugin/_institution.html.erb:94
200 msgid "City" 215 msgid "City"
201 msgstr "" 216 msgstr ""
202 217
203 -#: ../views/gov_user_plugin/_institution.html.erb:95 218 +#: ../views/gov_user_plugin/_institution.html.erb:106
204 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:68 219 #: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:68
205 msgid "CNPJ" 220 msgid "CNPJ"
206 msgstr "" 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 msgid "Governmental Sphere" 224 msgid "Governmental Sphere"
217 msgstr "" 225 msgstr ""
218 226
219 -#: ../views/gov_user_plugin/_institution.html.erb:125 227 +#: ../views/gov_user_plugin/_institution.html.erb:128
220 msgid "Governmental Power" 228 msgid "Governmental Power"
221 msgstr "" 229 msgstr ""
222 230
223 -#: ../views/gov_user_plugin/_institution.html.erb:136 231 +#: ../views/gov_user_plugin/_institution.html.erb:139
224 msgid "Juridical Nature" 232 msgid "Juridical Nature"
225 msgstr "" 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 msgid "SISP?" 237 msgid "SISP?"
230 msgstr "" 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 #: ../views/profile/_institution_tab.html.erb:19 242 #: ../views/profile/_institution_tab.html.erb:19
235 msgid "Yes" 243 msgid "Yes"
236 msgstr "" 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 #: ../views/profile/_institution_tab.html.erb:19 249 #: ../views/profile/_institution_tab.html.erb:19
242 msgid "No" 250 msgid "No"
243 msgstr "" 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 msgid "Save" 260 msgid "Save"
249 msgstr "" 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 msgid "Cancel" 266 msgid "Cancel"
255 msgstr "" 267 msgstr ""
256 268
257 -#: ../views/gov_user_plugin/_institution.html.erb:175 269 +#: ../views/gov_user_plugin/_institution.html.erb:185
258 msgid "Could not send the form data to the server" 270 msgid "Could not send the form data to the server"
259 msgstr "" 271 msgstr ""
260 272
261 -#: ../views/gov_user_plugin/_institution.html.erb:183 273 +#: ../views/gov_user_plugin/_institution.html.erb:193
262 msgid "Creating institution" 274 msgid "Creating institution"
263 msgstr "" 275 msgstr ""
264 276
@@ -288,6 +300,10 @@ msgstr &quot;&quot; @@ -288,6 +300,10 @@ msgstr &quot;&quot;
288 msgid "Juridical Nature:" 300 msgid "Juridical Nature:"
289 msgstr "" 301 msgstr ""
290 302
  303 +#: ../views/gov_user_plugin_myprofile/edit_institution.html.erb:119
  304 +msgid "SIORG Code:"
  305 +msgstr ""
  306 +
291 #: ../views/incomplete_registration.html.erb:3 307 #: ../views/incomplete_registration.html.erb:3
292 msgid "Complete Profile" 308 msgid "Complete Profile"
293 msgstr "" 309 msgstr ""
src/noosfero-spb/gov_user/po/pt/gov_user.po
@@ -63,6 +63,12 @@ msgstr &quot;Informações da Instituição&quot; @@ -63,6 +63,12 @@ msgstr &quot;Informações da Instituição&quot;
63 msgid "Institution" 63 msgid "Institution"
64 msgstr "Instituição" 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 msgid "invalid, only public and private institutions are allowed." 72 msgid "invalid, only public and private institutions are allowed."
67 msgstr "Inválido, somente instituições públicas e privadas são permitidas." 73 msgstr "Inválido, somente instituições públicas e privadas são permitidas."
68 74
@@ -123,6 +129,9 @@ msgstr &quot;Razão Social&quot; @@ -123,6 +129,9 @@ msgstr &quot;Razão Social&quot;
123 msgid "Institution name already exists" 129 msgid "Institution name already exists"
124 msgstr "Nome de Instituição já existe" 130 msgstr "Nome de Instituição já existe"
125 131
  132 +msgid "Acronym"
  133 +msgstr "Sigla"
  134 +
126 msgid "Fantasy name" 135 msgid "Fantasy name"
127 msgstr "Nome Fantasia" 136 msgstr "Nome Fantasia"
128 137
@@ -144,9 +153,6 @@ msgstr &quot;Cidade&quot; @@ -144,9 +153,6 @@ msgstr &quot;Cidade&quot;
144 msgid "CNPJ" 153 msgid "CNPJ"
145 msgstr "CNPJ" 154 msgstr "CNPJ"
146 155
147 -msgid "Acronym"  
148 -msgstr "Sigla"  
149 -  
150 msgid "Governmental Sphere" 156 msgid "Governmental Sphere"
151 msgstr "Esfera Governamental:" 157 msgstr "Esfera Governamental:"
152 158
@@ -165,6 +171,9 @@ msgstr &quot;Sim&quot; @@ -165,6 +171,9 @@ msgstr &quot;Sim&quot;
165 msgid "No" 171 msgid "No"
166 msgstr "Não" 172 msgstr "Não"
167 173
  174 +msgid "SIORG Code"
  175 +msgstr "Código SIORG"
  176 +
168 msgid "Save" 177 msgid "Save"
169 msgstr "Salvar" 178 msgstr "Salvar"
170 179
@@ -198,6 +207,9 @@ msgstr &quot;Poder Governamental:&quot; @@ -198,6 +207,9 @@ msgstr &quot;Poder Governamental:&quot;
198 msgid "Juridical Nature:" 207 msgid "Juridical Nature:"
199 msgstr "Natureza Jurídica:" 208 msgstr "Natureza Jurídica:"
200 209
  210 +msgid "SIORG Code:"
  211 +msgstr "Código SIORG:"
  212 +
201 msgid "Complete Profile" 213 msgid "Complete Profile"
202 msgstr "Complete o Perfil" 214 msgstr "Complete o Perfil"
203 215
src/noosfero-spb/gov_user/public/views/create-institution.js
@@ -45,6 +45,7 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;] @@ -45,6 +45,7 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
45 45
46 46
47 function get_institution_post_data() { 47 function get_institution_post_data() {
  48 +
48 return { 49 return {
49 cnpj: $("#institutions_cnpj").val(), 50 cnpj: $("#institutions_cnpj").val(),
50 type: $("input[name='institutions[type]']:checked").val(), 51 type: $("input[name='institutions[type]']:checked").val(),
@@ -52,7 +53,9 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;] @@ -52,7 +53,9 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
52 governmental_power: $("#institutions_governmental_power").selected().val(), 53 governmental_power: $("#institutions_governmental_power").selected().val(),
53 governmental_sphere: $("#institutions_governmental_sphere").selected().val(), 54 governmental_sphere: $("#institutions_governmental_sphere").selected().val(),
54 juridical_nature: $("#institutions_juridical_nature").selected().val(), 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 &lt; ActiveSupport::TestCase @@ -73,4 +73,19 @@ class InstitutionTest &lt; ActiveSupport::TestCase
73 assert_includes search_result_env1, @institution.id 73 assert_includes search_result_env1, @institution.id
74 assert_not_includes search_result_env2, @institution.id 74 assert_not_includes search_result_env2, @institution.id
75 end 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 end 91 end
src/noosfero-spb/gov_user/views/gov_user_plugin/_institution.html.erb
@@ -30,37 +30,48 @@ @@ -30,37 +30,48 @@
30 <%= hidden_field_tag "edit_institution_page", false %> 30 <%= hidden_field_tag "edit_institution_page", false %>
31 <%= fields_for :institutions do |inst| %> 31 <%= fields_for :institutions do |inst| %>
32 <div class="spb-row no-margin-top"> 32 <div class="spb-row no-margin-top">
33 - <div class='spb-col spb-col-3'> 33 + <div class='spb-col'>
34 <%= labelled_radio_button _('Public Institution'), 'institutions[type]', 'PublicInstitution', true %> 34 <%= labelled_radio_button _('Public Institution'), 'institutions[type]', 'PublicInstitution', true %>
35 </div> 35 </div>
36 36
37 - <div class="spb-col spb-col-3"> 37 + <div class="spb-col">
38 <%= labelled_radio_button _('Private Institution'), 'institutions[type]', 'PrivateInstitution' %> 38 <%= labelled_radio_button _('Private Institution'), 'institutions[type]', 'PrivateInstitution' %>
39 </div> 39 </div>
40 40
41 - <div class="spb-col spb-col-3"></div>  
42 - <div class="spb-col spb-col-3"></div>  
43 </div> 41 </div>
44 42
45 <div class="spb-row"> 43 <div class="spb-row">
46 - <div class="spb-col spb-col-5"> 44 + <div class="spb-col">
47 <label for="community_name" class="formlabel"> 45 <label for="community_name" class="formlabel">
48 <%= _("Corporate Name") %><!-- razão social --> 46 <%= _("Corporate Name") %><!-- razão social -->
49 <span class="required-field">(*)</span> 47 <span class="required-field">(*)</span>
50 </label> 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 <%= content_tag :span, _("Institution name already exists"), :id=>"already_exists_text", :class=>"errorExplanation hide-field" %> 51 <%= content_tag :span, _("Institution name already exists"), :id=>"already_exists_text", :class=>"errorExplanation hide-field" %>
54 </div> 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 <%= inst.label "corporate_name", _("Fantasy name"), :class=>"formlabel" %><!-- Nome fantasia --> 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 </div> 69 </div>
60 </div> 70 </div>
61 71
62 <div class="spb-row"> 72 <div class="spb-row">
63 - <div class="spb-col spb-col-5"> 73 +
  74 + <div class="spb-col">
64 <label for="community_country" class="formlabel"> 75 <label for="community_country" class="formlabel">
65 <%= _("Country") %> 76 <%= _("Country") %>
66 <span class="required-field">(*)</span> 77 <span class="required-field">(*)</span>
@@ -69,7 +80,7 @@ @@ -69,7 +80,7 @@
69 <%= select("community", "country", [[_('Select a country'), -1]] + country_helper.countries, {:class => "type-select #{flash[:error_community_country]}"}) %> 80 <%= select("community", "country", [[_('Select a country'), -1]] + country_helper.countries, {:class => "type-select #{flash[:error_community_country]}"}) %>
70 </div> 81 </div>
71 82
72 - <div class="spb-col spb-col-2"> 83 + <div class="spb-col">
73 <label for="community_state" class="formlabel"> 84 <label for="community_state" class="formlabel">
74 <%= _("State") %> 85 <%= _("State") %>
75 <span class="required-field">(*)</span> 86 <span class="required-field">(*)</span>
@@ -78,13 +89,13 @@ @@ -78,13 +89,13 @@
78 <%= select("community", "state", [[_('Select a state'), '']] + @state_options, {:class => "type-select #{flash[:error_community_state]}"}) %> 89 <%= select("community", "state", [[_('Select a state'), '']] + @state_options, {:class => "type-select #{flash[:error_community_state]}"}) %>
79 </div> 90 </div>
80 91
81 - <div class="spb-col spb-col-5"> 92 + <div class="spb-col">
82 <label class="formlabel" for="community_city"> 93 <label class="formlabel" for="community_city">
83 <%= _("City") %> 94 <%= _("City") %>
84 <span class="required-field">(*)</span> 95 <span class="required-field">(*)</span>
85 </label> 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 </div> 99 </div>
89 </div> 100 </div>
90 101
@@ -99,14 +110,6 @@ @@ -99,14 +110,6 @@
99 </div> 110 </div>
100 </div> 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 <div class="spb-row public-institutions-fields"> 114 <div class="spb-row public-institutions-fields">
112 <div class="spb-col spb-col-6"> 115 <div class="spb-col spb-col-6">
@@ -141,28 +144,35 @@ @@ -141,28 +144,35 @@
141 </div> 144 </div>
142 </div> 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 </div> 165 </div>
162 - <% end %>  
163 </div> 166 </div>
164 </div> 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 <div class="spb-row modal-form-actions"> 177 <div class="spb-row modal-form-actions">
168 <div class="spb-col spb-col-6"> 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,10 +41,21 @@
41 </div> 41 </div>
42 42
43 <div class="spb-row"> 43 <div class="spb-row">
44 - <div class="spb-col spb-col-4"> 44 + <div class="spb-col spb-col-7">
45 <%= required labelled_form_field(_('Corporate Name'), text_field_tag('community[name]', @institution.community.name)) %> 45 <%= required labelled_form_field(_('Corporate Name'), text_field_tag('community[name]', @institution.community.name)) %>
46 </div> 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 <%= labelled_form_field(_('Fantasy name'), inst.text_field(:corporate_name, :value => @institution.corporate_name)) %> 59 <%= labelled_form_field(_('Fantasy name'), inst.text_field(:corporate_name, :value => @institution.corporate_name)) %>
49 </div> 60 </div>
50 </div> 61 </div>
@@ -63,21 +74,16 @@ @@ -63,21 +74,16 @@
63 </div> 74 </div>
64 </div> 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 </div> 85 </div>
80 - </span> 86 + </div>
81 87
82 <div class="spb-row public-institutions-fields"> 88 <div class="spb-row public-institutions-fields">
83 <div class="spb-col spb-col-6"> 89 <div class="spb-col spb-col-6">
@@ -112,6 +118,17 @@ @@ -112,6 +118,17 @@
112 </div> 118 </div>
113 </div> 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 <div class="spc-col spb-col-12 sisp-fields"> 132 <div class="spc-col spb-col-12 sisp-fields">
116 <div class="spb-row public-institutions-fields"> 133 <div class="spb-row public-institutions-fields">
117 <div class="spb-col spb-col-3"> 134 <div class="spb-col spb-col-3">
@@ -120,7 +137,7 @@ @@ -120,7 +137,7 @@
120 <div class="spb-col spb-col-12"> 137 <div class="spb-col spb-col-12">
121 <%= _("SISP?") %> 138 <%= _("SISP?") %>
122 </div> 139 </div>
123 - <% if @show_sisp_field %> 140 + <% if @show_admin_fields %>
124 <div class="spb-col spb-col-4"> 141 <div class="spb-col spb-col-4">
125 <%= inst.radio_button(:sisp, true, :checked=>(@institution.sisp ? true : false)) %> 142 <%= inst.radio_button(:sisp, true, :checked=>(@institution.sisp ? true : false)) %>
126 <%= inst.label("sisp" ,_("Yes")) %> 143 <%= inst.label("sisp" ,_("Yes")) %>
src/noosfero-spb/noosfero-spb-theme/css/administration-panel.css
@@ -346,22 +346,33 @@ @@ -346,22 +346,33 @@
346 margin-bottom: 10px; 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 .action-gov_user_plugin_myprofile-edit_institution #community_name { 354 .action-gov_user_plugin_myprofile-edit_institution #community_name {
350 color: black; 355 color: black;
351 - width: 220px 356 + width: 402px;
352 } 357 }
353 358
354 .action-gov_user_plugin-create_institution_admin #community_name { 359 .action-gov_user_plugin-create_institution_admin #community_name {
355 - width: 200px; 360 + width: 372px;
356 } 361 }
357 362
358 .action-gov_user_plugin_myprofile-edit_institution #institutions_corporate_name { 363 .action-gov_user_plugin_myprofile-edit_institution #institutions_corporate_name {
359 - width: 287px; 364 + width: 537px;
360 color: black; 365 color: black;
361 } 366 }
362 367
  368 +.action-gov_user_plugin-create_institution_admin #institutions_cnpj,
363 .action-gov_user_plugin-create_institution_admin #institutions_corporate_name { 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 .action-gov_user_plugin_myprofile-edit_institution #community_country { 378 .action-gov_user_plugin_myprofile-edit_institution #community_country {
@@ -383,20 +394,18 @@ @@ -383,20 +394,18 @@
383 } 394 }
384 395
385 .action-gov_user_plugin_myprofile-edit_institution #community_city { 396 .action-gov_user_plugin_myprofile-edit_institution #community_city {
386 - width: 165px; 397 + width: 171px;
387 color: black; 398 color: black;
388 } 399 }
389 400
390 .action-gov_user_plugin-create_institution_admin #community_city { 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 .action-gov_user_plugin_myprofile-edit_institution #institutions_acronym, 405 .action-gov_user_plugin_myprofile-edit_institution #institutions_acronym,
396 -.action-gov_user_plugin-create_institution_admin #institutions_cnpj,  
397 .action-gov_user_plugin-create_institution_admin #institutions_acronym { 406 .action-gov_user_plugin-create_institution_admin #institutions_acronym {
398 text-indent: 5px; 407 text-indent: 5px;
399 - width: 530px; 408 + width: 111px;
400 } 409 }
401 410
402 .action-gov_user_plugin_myprofile-edit_institution .modal-form-actions, 411 .action-gov_user_plugin_myprofile-edit_institution .modal-form-actions,
@@ -409,7 +418,20 @@ @@ -409,7 +418,20 @@
409 margin-top: 15px; 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 .action-gov_user_plugin-create_institution_admin #content form input.button.with-text { 435 .action-gov_user_plugin-create_institution_admin #content form input.button.with-text {
414 background-color: #3E67B1; 436 background-color: #3E67B1;
415 color: #fff; 437 color: #fff;
@@ -694,6 +716,14 @@ @@ -694,6 +716,14 @@
694 color: #585858; 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 .action-users-send_mail #content .main-content{ 727 .action-users-send_mail #content .main-content{
698 font-family: Arial; 728 font-family: Arial;
699 } 729 }
src/noosfero-spb/noosfero-spb-theme/css/modal.css
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 30
31 .action-profile_editor-edit #content .main-content #profile-data .modal-dialog, 31 .action-profile_editor-edit #content .main-content #profile-data .modal-dialog,
32 .modal-dialog { 32 .modal-dialog {
33 - width: 45%; 33 + width: 590px;
34 margin: 15px auto; 34 margin: 15px auto;
35 position: relative; 35 position: relative;
36 } 36 }
@@ -235,13 +235,18 @@ @@ -235,13 +235,18 @@
235 .action-profile_editor-edit #content .main-content #profile-data .modal #community_name, 235 .action-profile_editor-edit #content .main-content #profile-data .modal #community_name,
236 .modal #community_name { 236 .modal #community_name {
237 height: 16px; 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 .action-profile_editor-edit #content .main-content #profile-data .modal #institutions_corporate_name, 246 .action-profile_editor-edit #content .main-content #profile-data .modal #institutions_corporate_name,
242 .modal #institutions_corporate_name { 247 .modal #institutions_corporate_name {
243 height: 16px; 248 height: 16px;
244 - width: 285px; 249 + width: 533px;
245 } 250 }
246 251
247 .action-profile_editor-edit #content .main-content #profile-data .modal #community_country, 252 .action-profile_editor-edit #content .main-content #profile-data .modal #community_country,
@@ -251,22 +256,20 @@ @@ -251,22 +256,20 @@
251 256
252 .action-profile_editor-edit #content .main-content #profile-data .modal #community_state, 257 .action-profile_editor-edit #content .main-content #profile-data .modal #community_state,
253 .modal #community_state { 258 .modal #community_state {
254 - width: 80px; 259 + width: 90px;
255 } 260 }
256 261
257 .action-profile_editor-edit #content .main-content #profile-data .modal #community_city, 262 .action-profile_editor-edit #content .main-content #profile-data .modal #community_city,
258 .modal #community_city { 263 .modal #community_city {
259 height: 16px; 264 height: 16px;
260 - width: 190px; 265 + width: 205px;
261 margin-top: 2px; 266 margin-top: 2px;
262 } 267 }
263 268
264 -.action-profile_editor-edit #content .main-content #profile-data .modal #institutions_cnpj,  
265 .action-profile_editor-edit #content .main-content #profile-data .modal #institutions_acronym, 269 .action-profile_editor-edit #content .main-content #profile-data .modal #institutions_acronym,
266 -.modal #institutions_cnpj,  
267 .modal #institutions_acronym { 270 .modal #institutions_acronym {
268 height: 16px; 271 height: 16px;
269 - width: 530px; 272 + width: 111px;
270 } 273 }
271 274
272 .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-add, 275 .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-add,
  • 0857617ca13d090825c8eb4228efb6ae?s=40&d=identicon
    Marcos Pereira @marcosronaldo

    Added 1 new commit:

    Choose File ...   File name...
    Cancel
  • C8b72d0556872a2aea21e8fed0a72001?s=40&d=identicon
    Melissa Wen @melissawen

    Added 2 new commits:

    • 61ae15de - Add 'SIORG code' field and reorganize some fields on create institution forms
    • 5115c9ae - Add translations related to siorg field
    Choose File ...   File name...
    Cancel
  • C8b72d0556872a2aea21e8fed0a72001?s=40&d=identicon
    Melissa Wen @melissawen

    Added 9 new commits:

    • 3c5f9fd6 - Fixed a noosfero design bug
    • 3a000162 - Fixed global modification
    • 87f7a333 - Fix link to mailinglist
    • 70d4f9b5 - Merge branch 'fix_colab_list_link' into 'master'
    • adb7fe36 - Adds error highlight to institutions input
    • ba4c0a5b - Merge branch 'institution_error_highlight' into 'master'
    • 2cdb8b4f - Fix test: regular user now can create institution
    • ad42d65c - Add 'SIORG code' field and reorganize some fields on create institution forms
    • d83a421c - Add translations related to siorg field
    Choose File ...   File name...
    Cancel
  • 0857617ca13d090825c8eb4228efb6ae?s=40&d=identicon
    Marcos Pereira @marcosronaldo

    Added 1 new commit:

    • 104fb853 - Adds selenium test to sisp and siorg fields
    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela

    Added 2 new commits:

    • dbd719eb - Add 'SIORG code' field and reorganize some fields on create institution forms
    • 08b3a06d - Add translations related to siorg field
    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela

    Added 12 new commits:

    • 2e3bb388 - Bumps version for colab-deps colab and noosfero
    • ddd9254f - Add new tab link
    • 2e96e9f5 - Merge branch 'add_tab_link' into 'master'
    • 6135aa2f - Adding fix for cookbooks
    • d4e966c1 - Adding a sample of config environment
    • bcb32095 - Fix for preconfig task
    • d49b2288 - Fix interation with organization_ratings plugin
    • d7737eac - Redirect user when not logged in
    • 8badd05d - Merge branch 'organization_ratings_improvements' into 'master'
    • 37794dc3 - Add 'SIORG code' field and reorganize some fields on create institution forms
    • 4d0beccb - Add translations related to siorg field
    • 526cca84 - Validate format of siorg_code and add test
    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela

    Reassigned to @daniela

    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela
    Choose File ...   File name...
    Cancel