Commit 40638bbf41df8f52a66c08832f08d4ec16ffdfa3

Authored by MoisesMachado
1 parent 5688035d

ActionItem140: fixed some issues of blocks


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1106 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/design_blocks/list_block/models/list_block.rb
@@ -39,6 +39,7 @@ class ListBlock < Design::Block @@ -39,6 +39,7 @@ class ListBlock < Design::Block
39 end 39 end
40 40
41 def view 41 def view
  42 + return 'nothing' unless element_type
42 element_type.to_s.underscore 43 element_type.to_s.underscore
43 end 44 end
44 45
app/design_blocks/list_block/views/nothing.rhtml 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +<h4><%= _('Nothing to see here') %></h4>
app/design_blocks/profile_info_block/controllers/profile_info_block_controller.rb
@@ -21,7 +21,7 @@ class ProfileInfoBlockController &lt; ApplicationController @@ -21,7 +21,7 @@ class ProfileInfoBlockController &lt; ApplicationController
21 # 21 #
22 # This hash will define the options menu on edit mode. 22 # This hash will define the options menu on edit mode.
23 CONTROL_ACTION_OPTIONS = { 23 CONTROL_ACTION_OPTIONS = {
24 -# 'edit' => _('Edit') 24 + 'edit' => _('Edit')
25 } 25 }
26 26
27 27
app/design_blocks/profile_info_block/models/profile_info_block.rb
@@ -12,4 +12,12 @@ class ProfileInfoBlock &lt; Design::Block @@ -12,4 +12,12 @@ class ProfileInfoBlock &lt; Design::Block
12 'ProfileInfoBlock' 12 'ProfileInfoBlock'
13 end 13 end
14 14
  15 + def title
  16 + self.settings[:title]
  17 + end
  18 +
  19 + def title= value
  20 + self.settings[:title] = value
  21 + end
  22 +
15 end 23 end
app/design_blocks/profile_info_block/views/edit.rhtml 0 → 100644
@@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
  1 +<h2> <%= _('Editing profile exibition') %> </h2>
  2 +
  3 +<% design_form_remote_tag( :url => {:action => 'save'}) do %>
  4 + <p>
  5 + <label for="design_block_title"> <%= _("Title") %> </label>
  6 + <%= text_field 'design_block', 'title'%>
  7 + </p>
  8 +
  9 + <%= submit_tag _('Save') %>
  10 +<% end %>