Commit 1cf5580bd951f6a056168fc5c60e965262124672

Authored by AntonioTerceiro
1 parent a39b1635

ActionItem44: displaying icon in menu


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1996 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/views/shared/user_menu.rhtml
... ... @@ -21,6 +21,12 @@
21 21  
22 22 <!-- li><a href="#"><span class="icon-menu-blog"></span> Meu Blog</a></li -->
23 23  
  24 + <% if MailConf.enabled? && current_user.enable_email %>
  25 + <li>
  26 + <%= link_to '<span class="icon-menu-mail"></span>' + _('Webmail'), MailConf.webmail_url %>
  27 + </li>
  28 + <% end %>
  29 +
24 30 <li><%= link_to_myprofile( '<span class="icon-menu-ctrl-panel"></span>'+ _('Control panel'),
25 31 {}, nil, :id => 'link_edit_profile',
26 32 :help => _('Control panel: change your picture, edit your personal information, create content or change the way your home page looks.')
... ...
public/designs/icons/default/mail-HC.gif 0 → 100644

101 Bytes

public/designs/icons/default/style.css
... ... @@ -42,3 +42,4 @@
42 42 .icon-menu-articles { background-image: url(edit-HC.gif) }
43 43 .icon-menu-comments { background-image: url(blog-HC.gif) }
44 44 .icon-menu-people { background-image: url(album-HC.gif) }
  45 +.icon-menu-mail { background-image: url(mail-HC.gif) }
... ...
test/functional/application_controller_test.rb
... ... @@ -160,4 +160,31 @@ class ApplicationControllerTest &lt; Test::Unit::TestCase
160 160 assert_tag :tag => 'a', :attributes => { :href => /\?lang=it/ }, :content => 'Italiano'
161 161 end
162 162  
  163 + should 'display link to webmail if enabled for system and for user' do
  164 + login_as('ze')
  165 + MailConf.expects(:enabled?).returns(true)
  166 + MailConf.expects(:webmail_url).returns('http://web.mail/')
  167 + User.any_instance.expects(:enable_email).returns(true)
  168 +
  169 + get :index
  170 + assert_tag :tag => 'div', :attributes => { :id => 'user_box' }, :descendant => { :tag => 'a', :attributes => { :href => 'http://web.mail/' } }
  171 + end
  172 +
  173 + should 'not display link to webmail if not enabled for system' do
  174 + login_as('ze')
  175 + MailConf.expects(:enabled?).returns(false)
  176 +
  177 + get :index
  178 + assert_no_tag :tag => 'div', :attributes => { :id => 'user_box' }, :descendant => { :tag => 'a', :attributes => { :href => 'http://web.mail/' } }
  179 + end
  180 +
  181 + should 'not display link in menu to webmail if not enabled for user' do
  182 + login_as('ze')
  183 + MailConf.expects(:enabled?).returns(true)
  184 + User.any_instance.expects(:enable_email).returns(false)
  185 +
  186 + get :index
  187 + assert_no_tag :tag => 'div', :attributes => { :id => 'user_box' }, :descendant => { :tag => 'a', :attributes => { :href => 'http://web.mail/' } }
  188 + end
  189 +
163 190 end
... ...