aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/application/_user_info.html.erb17
-rw-r--r--app/views/layouts/application.html.erb19
-rw-r--r--app/views/resources/delete.html.erb2
-rw-r--r--app/views/resources/edit.html.erb2
-rw-r--r--app/views/resources/index.html.erb2
-rw-r--r--app/views/resources/new.html.erb2
-rw-r--r--app/views/users/index.html.erb4
-rw-r--r--app/views/users/show.html.erb4
-rw-r--r--app/views/welcome/index.html.erb6
9 files changed, 50 insertions, 8 deletions
diff --git a/app/views/application/_user_info.html.erb b/app/views/application/_user_info.html.erb
new file mode 100644
index 0000000..4549684
--- /dev/null
+++ b/app/views/application/_user_info.html.erb
@@ -0,0 +1,17 @@
+<section id="user_info" class="<%= current_user.present? ? 'authenticated' : 'anonymous' %>">
+ <nav>
+ <% if current_user.present? %>
+ <a href="/my/dashboard"><%= image_tag current_user.avatar_url, alt: current_user.username %></a>
+ <ul>
+ <%= tag.li(link_to(new_agent_switch_url, method: :get, remote: true, title: "Changer d'Agent") do
+ "Agent: %s" % current_agent
+ end, id: 'current_agent_name') %>
+ <%= tag.li link_to("Ajouter un point", new_resource_url) %>
+ <%= tag.li link_to("Mon compte", user_url(current_user.id)) %>
+ <%= tag.li link_to("Terminer la session", logout_url) %>
+ </ul>
+ <% else %>
+ <%= link_to image_tag('login.png', alt: 'Se connecter'), '/authenticate' %>
+ <% end %>
+ </nav>
+</section>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index cfee6e2..4aae3ea 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>IncommonMap</title>
+ <title>Carte IN COMMON</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
@@ -10,6 +10,21 @@
</head>
<body>
- <%= yield %>
+ <header>
+ <h1><%= link_to image_tag("https://talk.incommon.cc/uploads/disc_6_incommon/original/1X/92f926e8210ea7a5412d6e2bdabfa825233e808b.png", alt: "IN COMMON", size: "x4em"), '/' %></h1>
+ <%= render 'application/user_info' %>
+ <%= yield :header %>
+ </header>
+ <main>
+ <article>
+ <%= yield %>
+ </article>
+ </main>
+ <aside>
+ <%= yield :aside %>
+ </aside>
+ <footer>
+ <%= yield :footer %>
+ </footer>
</body>
</html>
diff --git a/app/views/resources/delete.html.erb b/app/views/resources/delete.html.erb
new file mode 100644
index 0000000..837c275
--- /dev/null
+++ b/app/views/resources/delete.html.erb
@@ -0,0 +1,2 @@
+<h1>Resources#delete</h1>
+<p>Find me in app/views/resources/delete.html.erb</p>
diff --git a/app/views/resources/edit.html.erb b/app/views/resources/edit.html.erb
new file mode 100644
index 0000000..61b0939
--- /dev/null
+++ b/app/views/resources/edit.html.erb
@@ -0,0 +1,2 @@
+<h1>Resources#edit</h1>
+<p>Find me in app/views/resources/edit.html.erb</p>
diff --git a/app/views/resources/index.html.erb b/app/views/resources/index.html.erb
new file mode 100644
index 0000000..320849a
--- /dev/null
+++ b/app/views/resources/index.html.erb
@@ -0,0 +1,2 @@
+<h1>Resources#index</h1>
+<p>Find me in app/views/resources/index.html.erb</p>
diff --git a/app/views/resources/new.html.erb b/app/views/resources/new.html.erb
new file mode 100644
index 0000000..c29e88a
--- /dev/null
+++ b/app/views/resources/new.html.erb
@@ -0,0 +1,2 @@
+<h1>Resources#new</h1>
+<p>Find me in app/views/resources/new.html.erb</p>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
new file mode 100644
index 0000000..0d53728
--- /dev/null
+++ b/app/views/users/index.html.erb
@@ -0,0 +1,4 @@
+<h1>Users#index</h1>
+<p>Find me in app/views/users/index.html.erb</p>
+
+<p>Show a table with Agent <%= current_agent %> members (<%= pluralize(@users.count, "user") %>), their roles, and ways to change them.</p>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
new file mode 100644
index 0000000..95ca059
--- /dev/null
+++ b/app/views/users/show.html.erb
@@ -0,0 +1,4 @@
+<h1>Users#show</h1>
+<p>Find me in app/views/users/show.html.erb</p>
+
+<p>Show self information and ways to change stuff.</p>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index a1fa276..d1f15c7 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -1,8 +1,2 @@
<h1>Bienvenue à l'atelier carto d'IN COMMON</h1>
-<% if current_user.present? %>
- <p>Hi <%= h current_user.name %>, please <%= link_to 'proceed to your dashboard', url_for(action: 'dashboard') %>.</p>
- <p>You may <%= link_to 'sign off', logout_url %>.</p>
-<% else %>
- <p><%= link_to "S'identifier avec Talk.incommon.cc", '/authenticate' %></p>
-<% end %>