Commit 7b8823c271404263ad68e92108d6a9f1fee1e9d2
1 parent
f54fa6c1
Exists in
staging
and in
42 other branches
ActionItem287: friends manage interface and delet is better now.
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1718 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
6 changed files
with
101 additions
and
4 deletions
Show diff stats
app/helpers/application_helper.rb
| @@ -398,6 +398,7 @@ module ApplicationHelper | @@ -398,6 +398,7 @@ module ApplicationHelper | ||
| 398 | # #profile_image) and its name below it. | 398 | # #profile_image) and its name below it. |
| 399 | def profile_image_link(profile, size=:portrait) | 399 | def profile_image_link(profile, size=:portrait) |
| 400 | link_to( '<div>'+ profile_image(profile, size) +'</div><span>'+ profile.name() +'</span>', profile.url, | 400 | link_to( '<div>'+ profile_image(profile, size) +'</div><span>'+ profile.name() +'</span>', profile.url, |
| 401 | + :class => 'profile_link', | ||
| 401 | :help => _('Click on this icon to go to the <b>%s</b>\'s home page') % profile.name ) | 402 | :help => _('Click on this icon to go to the <b>%s</b>\'s home page') % profile.name ) |
| 402 | end | 403 | end |
| 403 | 404 |
app/views/friends/index.rhtml
| 1 | +<div id="manage_friends"> | ||
| 2 | + | ||
| 1 | <h1><%= _("%s's friends") % profile.name %></h1> | 3 | <h1><%= _("%s's friends") % profile.name %></h1> |
| 2 | 4 | ||
| 3 | <ul class='profile-list'> | 5 | <ul class='profile-list'> |
| 4 | <% @friends.each do |friend| %> | 6 | <% @friends.each do |friend| %> |
| 5 | <li> | 7 | <li> |
| 6 | - <%= profile_image_link(friend)%> | ||
| 7 | - <br/> | ||
| 8 | - <%= link_to '(remove)', :action => 'remove', :id => friend.id %> | 8 | + <%= profile_image_link friend %> |
| 9 | + <div class="controll"> | ||
| 10 | + <%= link_to content_tag('span',_('remove')), | ||
| 11 | + { :action => 'remove', :id => friend.id }, | ||
| 12 | + :class => 'button icon-delete', | ||
| 13 | + :title => _('remove'), | ||
| 14 | + :help => _('Clicking on this button will remove your friend relation with %s.') % friend.name %> | ||
| 15 | + </div><!-- end class="controll" --> | ||
| 9 | </li> | 16 | </li> |
| 10 | <% end %> | 17 | <% end %> |
| 11 | </ul> | 18 | </ul> |
| @@ -18,7 +25,9 @@ | @@ -18,7 +25,9 @@ | ||
| 18 | </p> | 25 | </p> |
| 19 | <% end %> | 26 | <% end %> |
| 20 | 27 | ||
| 21 | - | ||
| 22 | <% button_bar do %> | 28 | <% button_bar do %> |
| 23 | <%= button(:back, _('Go back'), :controller => 'profile_editor') %> | 29 | <%= button(:back, _('Go back'), :controller => 'profile_editor') %> |
| 24 | <% end %> | 30 | <% end %> |
| 31 | + | ||
| 32 | +</div><!-- end id="manage_friends" --> | ||
| 33 | + |
app/views/friends/remove.rhtml
| 1 | +<div id="remove_friend"> | ||
| 2 | + | ||
| 1 | <h1><%= _('Removing friend: %s') % @friend.name %></h1> | 3 | <h1><%= _('Removing friend: %s') % @friend.name %></h1> |
| 2 | 4 | ||
| 5 | +<%= profile_image @friend, :thumb, :class => 'friend_picture' %> | ||
| 6 | + | ||
| 3 | <p> | 7 | <p> |
| 4 | <%= _('Are you sure you want to remove %s from your friends list?') % @friend.name %> | 8 | <%= _('Are you sure you want to remove %s from your friends list?') % @friend.name %> |
| 5 | </p> | 9 | </p> |
| @@ -16,3 +20,5 @@ | @@ -16,3 +20,5 @@ | ||
| 16 | <%= submit_button(:ok, _("Yes, I want to remove %s from my friend list") % @friend.name) %> | 20 | <%= submit_button(:ok, _("Yes, I want to remove %s from my friend list") % @friend.name) %> |
| 17 | <%= button(:cancel, _("No, I don't want"), :action => 'index') %> | 21 | <%= button(:cancel, _("No, I don't want"), :action => 'index') %> |
| 18 | <% end %> | 22 | <% end %> |
| 23 | + | ||
| 24 | +</div><!-- end id="remove_friend" --> |
app/views/layouts/application.rhtml
| @@ -170,6 +170,19 @@ | @@ -170,6 +170,19 @@ | ||
| 170 | // the onload will run only after all related documents load. | 170 | // the onload will run only after all related documents load. |
| 171 | // by that we need to cal this here: | 171 | // by that we need to cal this here: |
| 172 | if ( window.addEventListener ) resizePrincipalTemplateBox() | 172 | if ( window.addEventListener ) resizePrincipalTemplateBox() |
| 173 | + | ||
| 174 | + // Sory IE: | ||
| 175 | + if ( document.all ) { | ||
| 176 | + if ( confirm("<%= | ||
| 177 | +_("Ups... It seems you are using Internet Explorer. | ||
| 178 | + | ||
| 179 | +We are sory, but some things will not work well on this web browser for now... | ||
| 180 | +We propose you to use Firefox, for this web site and any other. | ||
| 181 | + | ||
| 182 | +Do you want to get your Firefox now?").gsub(/\n/,'\n') %>") ) { | ||
| 183 | + document.location.href = "http://getfirefox.com"; | ||
| 184 | + } | ||
| 185 | + } | ||
| 173 | </script> | 186 | </script> |
| 174 | 187 | ||
| 175 | </body> | 188 | </body> |
public/designs/themes/default/stylesheets/controller_friends.css
0 → 100644
| @@ -0,0 +1,59 @@ | @@ -0,0 +1,59 @@ | ||
| 1 | + | ||
| 2 | +#content #manage_friends ul { | ||
| 3 | + margin: 0px; | ||
| 4 | + padding: 0px; | ||
| 5 | + list-style: none; | ||
| 6 | +} | ||
| 7 | + | ||
| 8 | +#content #manage_friends li { | ||
| 9 | + float: left; | ||
| 10 | + width: 200px; | ||
| 11 | + height: 68px; | ||
| 12 | + margin: 5px; | ||
| 13 | + padding: 5px; | ||
| 14 | + border: 2px solid #B8CFE7; | ||
| 15 | + list-style: none; | ||
| 16 | + overflow: hidden; | ||
| 17 | + position: relative; | ||
| 18 | +} | ||
| 19 | +#content #manage_friends li:hover { | ||
| 20 | + border: 2px solid #2A5896; | ||
| 21 | + background: #729FCF; | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +.profile-list img { | ||
| 25 | + float: left; | ||
| 26 | + border: none; | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +.profile-list a { | ||
| 30 | + text-decoration: none; | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +.profile-list .profile_link span { | ||
| 34 | + width: 200px; | ||
| 35 | + display: block; | ||
| 36 | + overflow: hidden; | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +.controll { | ||
| 40 | + position: absolute; | ||
| 41 | + right: 5px; | ||
| 42 | + bottom: 10px; | ||
| 43 | +} | ||
| 44 | + | ||
| 45 | +#manage_friends .button-bar { | ||
| 46 | + clear: both; | ||
| 47 | + padding-top: 20px; | ||
| 48 | +} | ||
| 49 | + | ||
| 50 | +#remove_friend .friend_picture { | ||
| 51 | + float: left; | ||
| 52 | + margin-right: 15px; | ||
| 53 | +} | ||
| 54 | + | ||
| 55 | +#remove_friend form { | ||
| 56 | + clear: both; | ||
| 57 | + padding-top: 20px; | ||
| 58 | +} | ||
| 59 | + |