initial commit

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2017-12-08 09:58:14 +01:00
commit 90ceb4f6fe
181 changed files with 8219 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
<h2>Edit User</h2>
<%= render "form.html", Map.put(assigns, :action, user_path(@conn, :update, @user)) %>
<span><%= link "Back", to: user_path(@conn, :index) %></span>

View File

@@ -0,0 +1,35 @@
<%= form_for @changeset, @action, fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<div class="form-group">
<%= label f, :username, class: "control-label" %>
<%= text_input f, :username, class: "form-control" %>
<%= error_tag f, :username %>
</div>
<div class="form-group">
<%= label f, :email, class: "control-label" %>
<%= text_input f, :email, class: "form-control" %>
<%= error_tag f, :email %>
</div>
<div class="form-group">
<%= label f, :password_hash, class: "control-label" %>
<%= text_input f, :password_hash, class: "form-control" %>
<%= error_tag f, :password_hash %>
</div>
<div class="form-group">
<%= label f, :role, class: "control-label" %>
<%= number_input f, :role, class: "form-control" %>
<%= error_tag f, :role %>
</div>
<div class="form-group">
<%= submit "Submit", class: "btn btn-primary" %>
</div>
<% end %>

View File

@@ -0,0 +1,32 @@
<h2>Listing Users</h2>
<table class="table">
<thead>
<tr>
<th>Username</th>
<th>Email</th>
<th>Password hash</th>
<th>Role</th>
<th></th>
</tr>
</thead>
<tbody>
<%= for user <- @users do %>
<tr>
<td><%= user.username %></td>
<td><%= user.email %></td>
<td><%= user.password_hash %></td>
<td><%= user.role %></td>
<td class="text-right">
<span><%= link "Show", to: user_path(@conn, :show, user), class: "btn btn-default btn-xs" %></span>
<span><%= link "Edit", to: user_path(@conn, :edit, user), class: "btn btn-default btn-xs" %></span>
<span><%= link "Delete", to: user_path(@conn, :delete, user), method: :delete, data: [confirm: "Are you sure?"], class: "btn btn-danger btn-xs" %></span>
</td>
</tr>
<% end %>
</tbody>
</table>
<span><%= link "New User", to: user_path(@conn, :new) %></span>

View File

@@ -0,0 +1,5 @@
<h2>New User</h2>
<%= render "form.html", Map.put(assigns, :action, user_path(@conn, :create)) %>
<span><%= link "Back", to: user_path(@conn, :index) %></span>

View File

@@ -0,0 +1,28 @@
<h2>Show User</h2>
<ul>
<li>
<strong>Username:</strong>
<%= @user.username %>
</li>
<li>
<strong>Email:</strong>
<%= @user.email %>
</li>
<li>
<strong>Password hash:</strong>
<%= @user.password_hash %>
</li>
<li>
<strong>Role:</strong>
<%= @user.role %>
</li>
</ul>
<span><%= link "Edit", to: user_path(@conn, :edit, @user) %></span>
<span><%= link "Back", to: user_path(@conn, :index) %></span>