Commit d14a7abb authored by Jeff Sturek's avatar Jeff Sturek
Browse files

Update homepage and add login/logout to nav

parent 30699289
......@@ -15,13 +15,21 @@ If you'd like your organization, building, or department in our scheduler, pleas
to set up a service space. Enjoy!
</p>
<h2 class="dcf-txt-h6 dcf-txt-center">Your Service Spaces</h5>
<% unless @user %>
Please login to see your service spaces.<br>
<a class="dcf-btn dcf-btn-primary" href="https://shib.unl.edu/idp/profile/cas/login?service=<%= "http://#{request.host}#{":" if request.port != 80}#{request.port if request.port != 80}#{request.path_info}" %>">Login</a>
<% end %>
<% unless spaces.empty? %>
<h2 class="dcf-txt-h5">Your Service Spaces</h5>
<% if spaces.empty? %>
<% if @user %>
<p>You are not a member of any service spaces.</p>
<% else %>
<div class="dcf-notice dcf-notice-warning" hidden>
<h2>Log In Required</h2>
<div>
<p class="dcf-mt-2">Please log in to view your service spaces.</p>
<a class="dcf-btn dcf-btn-inverse-secondary" href="https://shib.unl.edu/idp/profile/cas/login?service=<%= "http://#{request.host}#{":" if request.port != 80}#{request.port if request.port != 80}#{request.path_info}" %>">Log In</a>
</div>
</div>
<p>You must log in to view your service space resources.</p>
<% end %>
<% else %>
<div class="dcf-grid-full dcf-grid-fourths dcf-col-gap-vw">
<% spaces.each do |space| %>
<div class="dcf-txt-center">
......@@ -41,7 +49,7 @@ Please login to see your service spaces.<br>
<% end %>
<% unless resources.empty? %>
<h2 class="dcf-txt-h6 dcf-txt-center">Available Resources</h5>
<h2 class="dcf-mt-6 dcf-txt-h5">Available Resources</h5>
<p>These resources are available to everyone at the University. You will be required to log in to reserve them.
<table>
<thead>
......
......@@ -3,29 +3,34 @@
<% unless @space.nil? %>
<li><a href="<%= @space.calendar_href %>">Calendar</a></li>
<li><a href="<%= @space.resources_href %>">Resources</a></li>
<% unless @user.nil? || !@user.is_admin?(@space) %>
<li><a href="<%= @space.admin_href %>" title="Admin">Admin</a>
<ul>
<% if @user.has_permission?(Permission::MANAGE_USERS, @space) || @user.has_permission?(Permission::SUPER_USER, @space) %>
<li><a href="/<%= @space.url_name %>/admin/users/" title="Users">Users</a></li>
<% end %>
<% if @user.has_permission?(Permission::MANAGE_EVENTS, @space) %>
<li><a href="/<%= @space.url_name %>/admin/events/" title="Events">Events</a></li>
<% end %>
<% if @user.has_permission?(Permission::MANAGE_RESOURCES, @space) %>
<li><a href="/<%= @space.url_name %>/admin/resources/" title="Resources">Resources</a></li>
<% end %>
<% if @user.has_permission?(Permission::MANAGE_SPACE_HOURS, @space) %>
<li><a href="/<%= @space.url_name %>/admin/hours/" title="Hours">Hours</a></li>
<% end %>
<% if @user.has_permission?(Permission::MANAGE_EMAILS, @space) %>
<li><a href="/<%= @space.url_name %>/admin/email/" title="Email">Email</a></li>
<% end %>
<% if @user.has_permission?(Permission::SEE_AGENDA, @space) %>
<li><a href="/<%= @space.url_name %>/admin/agenda/" title="Agenda">Agenda</a></li>
<% end %>
</ul>
</li>
<% unless @user.nil? || !@user.is_admin?(@space) %>
<li><a href="<%= @space.admin_href %>" title="Admin">Admin</a>
<ul>
<% if @user.has_permission?(Permission::MANAGE_USERS, @space) || @user.has_permission?(Permission::SUPER_USER, @space) %>
<li><a href="/<%= @space.url_name %>/admin/users/" title="Users">Users</a></li>
<% end %>
<% if @user.has_permission?(Permission::MANAGE_EVENTS, @space) %>
<li><a href="/<%= @space.url_name %>/admin/events/" title="Events">Events</a></li>
<% end %>
<% if @user.has_permission?(Permission::MANAGE_RESOURCES, @space) %>
<li><a href="/<%= @space.url_name %>/admin/resources/" title="Resources">Resources</a></li>
<% end %>
<% if @user.has_permission?(Permission::MANAGE_SPACE_HOURS, @space) %>
<li><a href="/<%= @space.url_name %>/admin/hours/" title="Hours">Hours</a></li>
<% end %>
<% if @user.has_permission?(Permission::MANAGE_EMAILS, @space) %>
<li><a href="/<%= @space.url_name %>/admin/email/" title="Email">Email</a></li>
<% end %>
<% if @user.has_permission?(Permission::SEE_AGENDA, @space) %>
<li><a href="/<%= @space.url_name %>/admin/agenda/" title="Agenda">Agenda</a></li>
<% end %>
</ul>
</li>
<% end %>
<% end %>
<% if @user.nil? %>
<li><a href="https://shib.unl.edu/idp/profile/cas/login?service=<%= "http://#{request.host}#{":" if request.port != 80}#{request.port if request.port != 80}#{request.path_info}" %>">Log In</a></li>
<% else %>
<li><a href="/logout" title="Logout">Logout</a></li>
<% end %>
<% end %>
</ul>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment