Page MenuHomeGRNET

index.html.erb
No OneTemporary

File Metadata

Created
Wed, Jun 10, 6:55 PM

index.html.erb

<% if current_user.memberships.empty? %>
<div class="jumbotron">
<h2>Wellcome to WebDNS!</h2>
<p>
In order to manage domains you have to be a member of a group.
</p>
<p>
You can either contact an admin to create a new group for you, or ask another user for an invite to an existing group.
</p>
</div>
<% end %>
<table class="table table-striped">
<thead>
</thead>
<tbody>
<% @domains.group_by(&:group).each do |group, domains| %>
<tr>
<th colspan="2" style="width:800px">
<%= link_to group.name, group_path(group) %>
<%= link_to glyph('menu-down'), "##{group.id}", onclick: "$('tr.group-#{group.id}').toggleClass('hidden');" %>
</th>
<th>State</th>
<th colspan="2">Controls</th>
</tr>
<% domains.each do |domain| %>
<tr class="group-<%= group.id =%>">
<td>
<% if domain.reverse? %>
<%= abbr_glyph('chevron-left', 'Reverse') %>
<% elsif domain.enum? %>
<%= abbr_glyph('phone-alt', 'Enum') %>
<% else %>
<%= abbr_glyph('chevron-right', 'Forward') %>
<% end %>
<% if domain.slave? %>
<%= abbr_glyph('link', 'Slave') %>
<% end %>
<% if domain.dnssec? %>
<%= abbr_glyph('flash', 'DNSSEC') %>
<% end %>
</td>
<td style="width:800px"><%= link_to domain.name, domain %></td>
<td><%= human_state(domain.state) %></td>
<td><%= link_to_edit edit_domain_path(domain) %></td>
<td><%= link_to_destroy domain, method: :delete, data: { confirm: 'Are you sure?' } if domain.can_remove? %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<p>
<% if current_user.memberships.any? %>
<%= link_to 'Add Domain', new_domain_path, class: 'btn btn-primary' %>
<% else %>
<%= link_to 'Add Domain', new_domain_path, class: 'btn btn-primary disabled' %>
<% end %>
</p>

Event Timeline