Commit 54b441e2869ede500bab6eb165e42f712407eac8

Authored by Daniela Feitosa
2 parents d1b36447 76f8ef7b

Merge commit 'refs/merge-requests/399' of git://gitorious.org/noosfero/noosfero …

…into merge-requests/399
app/models/link_list_block.rb
... ... @@ -57,7 +57,7 @@ class LinkListBlock < Block
57 57 def link_html(link)
58 58 klass = 'icon-' + link[:icon] if link[:icon]
59 59 sanitize_link(
60   - link_to(link[:name], expand_address(link[:address]), :class => klass)
  60 + link_to(link[:name], expand_address(link[:address]), :target => link[:target], :class => klass)
61 61 )
62 62 end
63 63  
... ...
app/views/box_organizer/_link_list_block.rhtml
1 1 <strong><%= _('Links') %></strong>
2 2 <div id='edit-link-list-block' style='width:450px'>
3 3 <table id='links' class='noborder'>
4   - <tr><th><%= _('Icon') %></th><th><%= _('Name') %></th><th><%= _('Address') %></th></tr>
  4 + <tr><th><%= _('Icon') %></th><th><%= _('Name') %></th><th><%= _('Address') %></th><th><%= _('Target') %></th></tr>
5 5 <% for link in @block.links do %>
6 6 <tr>
7 7 <td>
... ... @@ -9,6 +9,9 @@
9 9 </td>
10 10 <td><%= text_field_tag 'block[links][][name]', link[:name], :class => 'link-name', :maxlength => 20 %></td>
11 11 <td class='cel-address'><%= text_field_tag 'block[links][][address]', link[:address], :class => 'link-address' %></td>
  12 + <td>
  13 + <%= select_tag('block[links][][target]', options_for_select([[_('Same page'), '_self'], [_('New tab'), '_blank'], [_('New window'), '_new']], link[:target].blank? ? '_self' : link[:target])) %>
  14 + </td>
12 15 </tr>
13 16 <% end %>
14 17 </table>
... ... @@ -18,7 +21,8 @@
18 21 page.insert_html :bottom, 'links', content_tag('tr',
19 22 content_tag('td', icon_selector('ok')) +
20 23 content_tag('td', text_field_tag('block[links][][name]', '', :maxlength => 20)) +
21   - content_tag('td', text_field_tag('block[links][][address]', nil, :class => 'cel-address'))
  24 + content_tag('td', text_field_tag('block[links][][address]', nil, :class => 'cel-address')) +
  25 + content_tag('td', select_tag('block[links][][target]',options_for_select([['Mesma pagina', '_self'], ['Nova aba', '_blank'], ['Nova Janela', '_new']], '_self')))
22 26 ) +
23 27 javascript_tag("$('edit-link-list-block').scrollTop = $('edit-link-list-block').scrollHeight")
24 28 end %>
... ...