This repository has been archived by the owner on Mar 27, 2022. It is now read-only.
/
search.html.erb
62 lines (56 loc) · 2.11 KB
/
search.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<% content_for :sidebar do %>
<p><%= link_to t('groups.back_to_homepage'), groups_path, :class => 'left-icon' %></p>
<%= render :partial => 'search' %>
<% end %>
<% if @groups.any? %>
<table class="spaced">
<% @groups.each do |group| %>
<tr>
<td class="icon">
<% if @logged_in.sees? group %><a href="<%= url_for group %>"><% end %>
<% if group.photo.exists? %>
<%= image_tag group.photo.url(:small), :alt => group.name %>
<% else %>
<%= image_tag 'group.small.jpg', :alt => group.name %>
<% end %>
<% if @logged_in.sees? group %></a><% end %>
</td>
<td>
<span class="list-heading">
<%= link_to group.name, group %>
<% if group.private? %><%= image_tag('lock.gif', :alt => t('groups.private_group'), :class => 'icon') %><% end %>
</span>
<% if group.admin?(@logged_in) %>
<%= link_to 'edit', edit_group_path(group), :class => 'discreet' %>
<% if group.linked? %>
<%= image_tag 'link.png', :alt => group.link_code, :class => 'icon' %>
<% end %>
<% end %>
<% if group.description.to_s.any? %>
<br/>
<%= group.description %>
<% end %>
<% if group.leader %>
<br/>
<%= t('groups.leader') %>: <%= link_to group.leader.name, person_path(group.leader) %>
<% end %>
<% if group.address.to_s.any? and group.can_send? @logged_in %>
<br/>
<%= t('people.email') %>: <%= mail_to u(group.full_address), group.full_address %>
<% end %>
<br/>
<%= t('people.person', :count => group.people.count) %>
</td>
</tr>
<% end %>
</table>
<% else %>
<p><em><%= t('groups.no_groups_found') %></em></p>
<% end %>
<% if @logged_in.admin?(:manage_groups) and @hidden_groups.any? %>
<h2><%= t('groups.hidden_groups') %></h2>
<p>
<%= t('groups.only_admins_see_this_list') %>:<br/>
<%= @hidden_groups.map { |g| link_to(g.name, g) }.join(', ') %>
</p>
<% end %>