diff --git a/app/views/domains/index.html.erb b/app/views/domains/index.html.erb index a75eb45..47058bc 100644 --- a/app/views/domains/index.html.erb +++ b/app/views/domains/index.html.erb @@ -1,34 +1,50 @@ +<% if current_user.memberships.empty? %> +
+

Wellcome to WebDNS!

+

+ In order to manage domains you have to be a member of a group. +

+

+ You can either contact an admin to create a new group for you, or ask another user for an invite to an existing group. +

+
+<% end %> + <% @domains.group_by(&:group).each do |group, domains| %> <% domains.each do |domain| %> <% end %> <% end %>
<%= link_to group.name, group_path(group) %> Controls
<%= link_to domain.name, domain %> <% if domain.reverse? %> <%= abbr_glyph('chevron-left', 'Reverse') %> <% else %> <%= abbr_glyph('chevron-right', 'Forward') %> <% end %> <% if domain.slave? %> <%= abbr_glyph('link', 'Slave') %> <% end %> <%= link_to_edit edit_domain_path(domain) %> <%= link_to_destroy domain, method: :delete, data: { confirm: 'Are you sure?' } %>

- <%= link_to 'Add Domain', new_domain_path, class: 'btn btn-primary' %> + <% 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 %>