diff --git a/assets/static/images/account_circle.svg b/assets/static/images/account_circle.svg new file mode 100644 index 000000000..7ba7670cd --- /dev/null +++ b/assets/static/images/account_circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/web/templates/layout/app.html.eex b/lib/web/templates/layout/app.html.eex index 5f5729cae..229663b40 100644 --- a/lib/web/templates/layout/app.html.eex +++ b/lib/web/templates/layout/app.html.eex @@ -6,7 +6,18 @@ <%= case current_user(@conn) do %> <% nil -> %> <% u -> %> - + + <%= 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 %>
diff --git a/lib/web/templates/layout/util_nav/_admin.html.eex b/lib/web/templates/layout/util_nav/_admin.html.eex new file mode 100644 index 000000000..97d4ab625 --- /dev/null +++ b/lib/web/templates/layout/util_nav/_admin.html.eex @@ -0,0 +1,39 @@ +
+ + <%= 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 %> + Dashboard + <% 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 %> + Users + <% 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 %> + Challenges + <% end %> + + + +
diff --git a/lib/web/templates/layout/util_nav/_challenge_manager.html.eex b/lib/web/templates/layout/util_nav/_challenge_manager.html.eex new file mode 100644 index 000000000..e5b47ff73 --- /dev/null +++ b/lib/web/templates/layout/util_nav/_challenge_manager.html.eex @@ -0,0 +1,34 @@ +
+ + <%= 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 %> + Dashboard + <% 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 %> + Challenges + <% end %> + + + +
diff --git a/lib/web/templates/layout/util_nav/_solver.html.eex b/lib/web/templates/layout/util_nav/_solver.html.eex new file mode 100644 index 000000000..27e5576ae --- /dev/null +++ b/lib/web/templates/layout/util_nav/_solver.html.eex @@ -0,0 +1,40 @@ +
+ + <%= 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 %> + Dashboard + <% 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 %> + Submissions + <% 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 %> + Saved Challenges + <% end %> + + + +