Skip to content

Commit

Permalink
Merge pull request #1459 from GSA/1364-challenge-portal-utility-menu-…
Browse files Browse the repository at this point in the history
…v-eval

Utility menu implementation - on eval branch.
  • Loading branch information
jairoanaya authored Oct 24, 2024
2 parents e297c34 + 978a8e5 commit 967bd43
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 1 deletion.
1 change: 1 addition & 0 deletions assets/static/images/account_circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion lib/web/templates/layout/app.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@
<%= case current_user(@conn) do %>
<% nil -> %>
<% u -> %>
<!-- placeholder util nav-->

<%= if Accounts.role_at_or_below(u, "solver") do %>
<%= render Web.LayoutView, "util_nav/_solver.html", conn: @conn, user: u %>
<% end %>
<%= if ChallengeGov.Accounts.is_challenge_manager?(u) do %>
<%= render Web.LayoutView, "util_nav/_challenge_manager.html", conn: @conn, user: u %>
<% end %>
<%= if ChallengeGov.Accounts.has_admin_access?(u) do %>
<%= render Web.LayoutView, "util_nav/_admin.html", conn: @conn, user: u %>
<% end %>


<% end %>

<div class="grid-row grid-gap">
Expand Down
39 changes: 39 additions & 0 deletions lib/web/templates/layout/util_nav/_admin.html.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<div class="bg-primary-darker w-full display-flex flex-justify-center desktop:flex-justify-end padding-1 font-body-3xs desktop:font-body-2xs text-white">

<%= link(to: Routes.dashboard_path(@conn, :index), class: "display-flex flex-align-center desktop:flex-row margin-x-1 desktop:margin-x-3 text-white text-no-wra") do %>
<svg class="usa-icon usa-challenge-menu float-left margin-right-1" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#grid_view"></use>
</svg><span class="display-none desktop:display-block ">Dashboard</span><span class="desktop:display-none" style="font-size: 0.7rem">Dashboard</span>
<% end %>

<%= link(to: Routes.user_path(@conn, :index), class: "display-flex flex-align-center desktop:flex-row margin-x-1 desktop:margin-x-3 text-white text-no-wra") do %>
<svg class="usa-icon usa-challenge-menu float-left margin-right-1" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#people"></use>
</svg><span class="display-none desktop:display-block">Users</span><span class="desktop:display-none" style="font-size: 0.7rem">Users</span>
<% end %>

<%= link(to: Routes.challenge_path(@conn, :index), class: "display-flex flex-align-center desktop:flex-row margin-x-1 desktop:margin-x-3 text-white text-no-wra") do %>
<svg class="usa-icon usa-challenge-menu float-left margin-right-1" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#emoji_events"></use>
</svg><span class="display-none desktop:display-block">Challenges</span><span class="desktop:display-none" style="font-size: 0.7rem">Challenges</span>
<% end %>

<div class="display-none desktop:display-flex flex-align-center margin-x-1 margin-top-1"> |
<img class="usa-icon--size-3 icon-white margin-x-2" alt="Help"src=" <%= Routes.static_path(Web.Endpoint, "/images/account_circle.svg") %>" >
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="text-bold text-white text-no-underline" href="#" aria-expanded="true">
<span><%= @user.email %></span>
</a>
<div class="dropdown-content padding-2 float-right" style="min-width:280px">
<%= link to: Routes.session_path(@conn, :delete), method: :delete, class: "dropdown-item_" do %>
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#logout"></use>
</svg> Logout
<% end %>
</div>
</li>
</ul>
</div>

</div>
34 changes: 34 additions & 0 deletions lib/web/templates/layout/util_nav/_challenge_manager.html.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<div class="bg-primary-darker w-full display-flex flex-justify-center desktop:flex-justify-end padding-1 font-body-3xs desktop:font-body-2xs text-white">

<%= link(to: Routes.dashboard_path(@conn, :index), class: "display-flex flex-align-center desktop:flex-row margin-x-1 desktop:margin-x-3 text-white text-no-wra") do %>
<svg class="usa-icon usa-challenge-menu float-left margin-right-1" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#grid_view"></use>
</svg><span class="display-none desktop:display-block ">Dashboard</span><span class="desktop:display-none" style="font-size: 0.7rem">Dashboard</span>
<% end %>

<%= link(to: Routes.challenge_path(@conn, :index), class: "display-flex flex-align-center desktop:flex-row margin-x-1 desktop:margin-x-3 text-white text-no-wra") do %>
<svg class="usa-icon usa-challenge-menu float-left margin-right-1" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#emoji_events"></use>
</svg><span class="display-none desktop:display-block">Challenges</span><span class="desktop:display-none" style="font-size: 0.7rem">Challenges</span>
<% end %>

<div class="display-none desktop:display-flex flex-align-center margin-x-1 margin-top-1">
|
<img class="usa-icon--size-3 icon-white margin-x-2" alt="Help"src=" <%= Routes.static_path(Web.Endpoint, "/images/account_circle.svg") %>" >
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="text-bold text-white text-no-underline" href="#" aria-expanded="true">
<span><%= @user.email %></span>
</a>
<div class="dropdown-content padding-2 float-right" style="min-width:280px">
<%= link to: Routes.session_path(@conn, :delete), method: :delete, class: "dropdown-item_" do %>
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#logout"></use>
</svg> Logout
<% end %>
</div>
</li>
</ul>
</div>

</div>
40 changes: 40 additions & 0 deletions lib/web/templates/layout/util_nav/_solver.html.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<div class="bg-primary-darker w-full display-flex flex-justify-center desktop:flex-justify-end padding-1 font-body-3xs desktop:font-body-2xs text-white">

<%= link(to: Routes.dashboard_path(@conn, :index), class: "display-flex flex-align-center desktop:flex-row margin-x-1 desktop:margin-x-3 text-white text-no-wra") do %>
<svg class="usa-icon usa-challenge-menu float-left margin-right-1" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#grid_view"></use>
</svg><span class="display-none desktop:display-block ">Dashboard</span><span class="desktop:display-none" style="font-size: 0.7rem">Dashboard</span>
<% end %>

<%= link(to: Routes.submission_path(@conn, :index), class: "display-flex flex-align-center desktop:flex-row margin-x-1 desktop:margin-x-3 text-white text-no-wra") do %>
<svg class="usa-icon usa-challenge-menu float-left margin-right-1" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#file_present"></use>
</svg><span class="display-none desktop:display-block">Submissions</span><span class="desktop:display-none" style="font-size: 0.7rem">Submissions</span>
<% end %>

<%= link(to: Routes.saved_challenge_path(@conn, :index), class: "display-flex flex-align-center desktop:flex-row margin-x-1 desktop:margin-x-3 text-white text-no-wra") do %>
<svg class="usa-icon usa-challenge-menu float-left margin-right-1" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#emoji_events"></use>
</svg><span class="display-none desktop:display-block">Saved Challenges</span><span class="desktop:display-none" style="font-size: 0.7rem">Saved Challenges</span>
<% end %>

<div class="display-none desktop:display-flex flex-align-center margin-x-1 margin-top-1">
|
<img class="usa-icon--size-3 icon-white margin-x-2" alt="Help"src=" <%= Routes.static_path(Web.Endpoint, "/images/account_circle.svg") %>" >
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="text-bold text-white text-no-underline" href="#" aria-expanded="true">
<span><%= @user.email %></span>
</a>
<div class="dropdown-content padding-2 float-right" style="min-width:280px">
<%= link to: Routes.session_path(@conn, :delete), method: :delete, class: "dropdown-item_" do %>
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
<use xlink:href="/assets/img/sprite.svg#logout"></use>
</svg> Logout
<% end %>
</div>
</li>
</ul>
</div>

</div>

0 comments on commit 967bd43

Please sign in to comment.