Commit 4e225ec650a145880fdf5f83cb9641c84a73b4b7
1 parent
87a67734
Exists in
staging
and in
42 other branches
Moving memberships view to a partial
Showing
3 changed files
with
37 additions
and
40 deletions
Show diff stats
app/views/memberships/index.rhtml
... | ... | @@ -8,30 +8,6 @@ |
8 | 8 | <%= button :back, _('Go back'), :controller => 'profile_editor' %> |
9 | 9 | <% end %> |
10 | 10 | |
11 | -<ul> | |
12 | -<% for membership in @memberships %> | |
13 | - <li> | |
14 | - <div class='common-profile-list-block'> | |
15 | - <%= profile_image_link(membership, :portrait, 'div') %> | |
16 | - </div> | |
17 | - <span class='profile-details'> | |
18 | - <strong><%= membership.name %></strong><br/> | |
19 | - <%= _('Role: %s') % rolename_for(profile, membership) %> <br/> | |
20 | - <%= _('Type: %s') % getterm(membership.class.identification) %> <br/> | |
21 | - <%= _('Description: %s') % membership.description + '<br/>' if membership.community? %> | |
22 | - <%= _('Members: %s') % membership.members_count.to_s %> <br/> | |
23 | - <%= _('Created at: %s') % show_date(membership.created_at) unless membership.enterprise? %> <br/> | |
24 | - <% button_bar do %> | |
25 | - <%= button 'menu-ctrl-panel', _('Control panel of this group'), membership.admin_url %> | |
26 | - <%= button 'menu-logout', _('Leave community'), membership.leave_url(true), :class => 'leave-community' %> | |
27 | - <% if (membership.community? && user.has_permission?(:destroy_profile, membership)) %> | |
28 | - <%= button 'delete', _('Remove'), { :controller => 'profile_editor', :action => 'destroy_profile', :profile => membership.identifier } %> | |
29 | - <% end %> | |
30 | - <% end %> | |
31 | - </span> | |
32 | - <br class="may-clear" /> | |
33 | - </li> | |
34 | -<% end %> | |
35 | -</ul> | |
11 | +<%= render :partial => 'shared/list_groups', :locals => {:groups => @memberships} %> | |
36 | 12 | |
37 | 13 | </div> | ... | ... |
... | ... | @@ -0,0 +1,26 @@ |
1 | +<ul id="groups-list"> | |
2 | +<% for group in groups %> | |
3 | + <li> | |
4 | + <div class='common-profile-list-block'> | |
5 | + <%= profile_image_link(group, :portrait, 'div') %> | |
6 | + </div> | |
7 | + <span class='profile-details'> | |
8 | + <strong><%= group.name %></strong><br/> | |
9 | + <%= _('Role: %s') % rolename_for(profile, group) + '<br/>' if profile.role_assignments.find_by_resource_id(group.id) %> | |
10 | + <%= _('Type: %s') % getterm(group.class.identification) %> <br/> | |
11 | + <%= _('Description: %s') % group.description + '<br/>' if group.community? %> | |
12 | + <%= _('Members: %s') % group.members_count.to_s %> <br/> | |
13 | + <%= _('Created at: %s') % show_date(group.created_at) unless group.enterprise? %> <br/> | |
14 | + <% button_bar do %> | |
15 | + <%= button 'menu-ctrl-panel', _('Control panel of this group'), group.admin_url %> | |
16 | + <%= button 'menu-logout', _('Leave community'), group.leave_url(true), :class => 'leave-community' %> | |
17 | + <% if (group.community? && user.has_permission?(:destroy_profile, group)) %> | |
18 | + <%= button 'delete', _('Remove'), { :controller => 'profile_editor', :action => 'destroy_profile', :profile => group.identifier } %> | |
19 | + <% end %> | |
20 | + <% end %> | |
21 | + </span> | |
22 | + <br class="may-clear" /> | |
23 | + </li> | |
24 | +<% end %> | |
25 | +</ul> | |
26 | + | ... | ... |
public/stylesheets/application.css
... | ... | @@ -4264,56 +4264,51 @@ h1#agenda-title { |
4264 | 4264 | /* ==> public/stylesheets/controller_memberships.css <== */ |
4265 | 4265 | /* @import url(profile-list-block.css); ==> BROKEN REFERENCE, OH MY! */ |
4266 | 4266 | |
4267 | -.controller-memberships #memberships-index ul { | |
4267 | +#groups-list { | |
4268 | 4268 | width: 100%; |
4269 | 4269 | padding: 0px; |
4270 | 4270 | margin: 0px; |
4271 | 4271 | display: block; |
4272 | 4272 | } |
4273 | 4273 | |
4274 | -.controller-memberships #memberships-index li { | |
4274 | +#groups-list li { | |
4275 | 4275 | display: block; |
4276 | 4276 | list-style: none; |
4277 | 4277 | margin-bottom: 20px |
4278 | 4278 | background-color: #B8CFE7; |
4279 | 4279 | } |
4280 | 4280 | |
4281 | -.controller-memberships #memberships-index li .vcard { | |
4281 | +#groups-list li .vcard { | |
4282 | 4282 | float: right; |
4283 | 4283 | padding: 5px; |
4284 | 4284 | margin-bottom: 5px; |
4285 | 4285 | margin-left: 10px; |
4286 | 4286 | } |
4287 | -.controller-memberships #memberships-index li .may-clear { | |
4287 | +#groups-list li .may-clear { | |
4288 | 4288 | clear: right; |
4289 | 4289 | } |
4290 | 4290 | |
4291 | -.controller-memberships #memberships-index li .profile-details { | |
4291 | +#groups-list li .profile-details { | |
4292 | 4292 | display: block; |
4293 | 4293 | padding: 3% 0px 0px 30px; |
4294 | 4294 | } |
4295 | 4295 | |
4296 | -.controller-memberships .action_memberships_destroy_community .main-block u { | |
4297 | - text-decoration: none; | |
4298 | - border-bottom: 1px dotted red; | |
4299 | -} | |
4300 | - | |
4301 | -#memberships-index .menu-submenu { | |
4296 | +#groups-list .menu-submenu { | |
4302 | 4297 | bottom: 127px; |
4303 | 4298 | right: -20px; |
4304 | 4299 | } |
4305 | 4300 | |
4306 | -#memberships-index .menu-submenu li { | |
4301 | +#groups-list .menu-submenu li { | |
4307 | 4302 | border: 0; |
4308 | 4303 | background: transparent; |
4309 | 4304 | } |
4310 | 4305 | |
4311 | -.controller-memberships .button-bar { | |
4306 | +#groups-list .button-bar { | |
4312 | 4307 | clear: both; |
4313 | 4308 | } |
4314 | 4309 | |
4315 | -.controller-memberships #memberships-index li .vcard a.profile_link.url, | |
4316 | -.controller-memberships #memberships-index li .vcard a.profile_link.url:hover { | |
4310 | +#groups-list li .vcard a.profile_link.url, | |
4311 | +#groups-list li .vcard a.profile_link.url:hover { | |
4317 | 4312 | background: transparent; |
4318 | 4313 | border: 0; |
4319 | 4314 | text-decoration: none; | ... | ... |