cirandas.net

commit 64dcf49b32480f132fcdfaf8df385a88d1e8b0e5

Author: Braulio Bhavamitra <braulio@prout.io>

Merge branch 'master' of https://github.com/samasti/noosfero into samasti

 plugins/suppliers/lib/ext/profile.rb | 2 
 plugins/suppliers/locales/en-US.yml | 1 
 plugins/suppliers/locales/pt-BR.yml | 1 
 plugins/suppliers/public/javascripts/views/consumer-view.tag.slim | 4 


diff --git a/plugins/suppliers/lib/ext/profile.rb b/plugins/suppliers/lib/ext/profile.rb
index e87ff322c6a2348de55148b4721f48ea07e24b0d..15a981b2f696c550aac1e277a3a65a8beb3d4440 100644
--- a/plugins/suppliers/lib/ext/profile.rb
+++ b/plugins/suppliers/lib/ext/profile.rb
@@ -53,7 +53,7 @@     consumer ||= self.consumers.create! profile: self, consumer: consumer_profile
   end
   def remove_consumer consumer_profile
     consumer = self.consumers.of_consumer(consumer_profile).first
-    consumer.destroy if supplier
+    consumer.destroy if consumer
   end
 
   def add_supplier supplier_profile, attrs={}




diff --git a/plugins/suppliers/locales/en-US.yml b/plugins/suppliers/locales/en-US.yml
index ff1a9f70de96f664bbadd2dc298c46e800391a07..c4374bc90fa45cf6ea66f4e5e880ea22272c4ce7 100644
--- a/plugins/suppliers/locales/en-US.yml
+++ b/plugins/suppliers/locales/en-US.yml
@@ -424,6 +424,7 @@           telephone: Telephone
           celular: Celular
           email: Email
           hub: Hub
+          choose_one_hub: "Choose one hub"
           address: Address
           city: City
           state: State




diff --git a/plugins/suppliers/locales/pt-BR.yml b/plugins/suppliers/locales/pt-BR.yml
index a8b15602ebee8efcb57e1edc3fefd23fb35500f9..bdd4746469722c06a25130225728ec62aaf4180a 100644
--- a/plugins/suppliers/locales/pt-BR.yml
+++ b/plugins/suppliers/locales/pt-BR.yml
@@ -448,6 +448,7 @@           telephone: Telefone
           celular: Celular
           email: Email
           hub: Núcleo
+          choose_one_hub: "Escolha um núcleo"
           address: Endereço
           city: Cidade
           state: Estado




diff --git a/plugins/suppliers/public/javascripts/views/consumer-view.tag.slim b/plugins/suppliers/public/javascripts/views/consumer-view.tag.slim
index 2e53ea01b447950a2faa26fb15cdb0a791185162..53af376c76ffac6dd1df3b6d8ef0e39d51fc5770 100644
--- a/plugins/suppliers/public/javascripts/views/consumer-view.tag.slim
+++ b/plugins/suppliers/public/javascripts/views/consumer-view.tag.slim
@@ -61,7 +61,9 @@               label for="hub" class="col-sm-2 control-label"
                 |{cs.t("views.consumer.index.hub")}
               .col-sm-10
                 select value='{consumer.hub_id}' name='hub_id' class="form-control" id="hub_id"
-                  option each="{hubs}" value="{id}"
+                  option value="" 
+                    |{cs.t("views.consumer.index.choose_one_hub")}
+                  option each="{hubs}" value="{id}" selected="{consumer.hub_id == id}"
                     |{name}
 
             .form-group