2020-12-21 15:40:19 +01:00
|
|
|
<h1>Account settings</h1>
|
|
|
|
|
|
|
|
<p>
|
2020-12-22 14:22:34 +01:00
|
|
|
You are currently logged in as <%= @current_user.username %> (<i><%=
|
|
|
|
@current_user.dn %></i>), using <%= @current_user.email %> as primary contact
|
|
|
|
method.
|
2020-12-21 15:40:19 +01:00
|
|
|
</p>
|
2020-12-15 14:24:14 +01:00
|
|
|
|
|
|
|
<h3>Change email</h3>
|
|
|
|
|
|
|
|
<%= form_for @email_changeset, Routes.user_settings_path(@conn, :update), fn f -> %>
|
|
|
|
<%= if @email_changeset.action do %>
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
<p>Oops, something went wrong! Please check the errors below.</p>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= hidden_input f, :action, name: "action", value: "update_email" %>
|
|
|
|
|
2020-12-21 15:40:19 +01:00
|
|
|
<%= email_input f, :email, required: true, placeholder: "Email" %>
|
2020-12-15 14:24:14 +01:00
|
|
|
<%= error_tag f, :email %>
|
|
|
|
|
2020-12-21 15:40:19 +01:00
|
|
|
<br />
|
|
|
|
|
|
|
|
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email", placeholder: "Current password" %>
|
2020-12-15 14:24:14 +01:00
|
|
|
<%= error_tag f, :current_password %>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<%= submit "Change email" %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<h3>Change password</h3>
|
|
|
|
|
|
|
|
<%= form_for @password_changeset, Routes.user_settings_path(@conn, :update), fn f -> %>
|
|
|
|
<%= if @password_changeset.action do %>
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
<p>Oops, something went wrong! Please check the errors below.</p>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= hidden_input f, :action, name: "action", value: "update_password" %>
|
|
|
|
|
2020-12-21 15:40:19 +01:00
|
|
|
<%= password_input f, :password, required: true, placeholder: "New password" %>
|
2020-12-15 14:24:14 +01:00
|
|
|
<%= error_tag f, :password %>
|
|
|
|
|
2020-12-21 15:40:19 +01:00
|
|
|
<br />
|
|
|
|
|
|
|
|
<%= password_input f, :password_confirmation, required: true, placeholder: "New password confirmation" %>
|
2020-12-15 14:24:14 +01:00
|
|
|
<%= error_tag f, :password_confirmation %>
|
|
|
|
|
2020-12-21 15:40:19 +01:00
|
|
|
<br />
|
|
|
|
|
|
|
|
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password", placeholder: "Current password" %>
|
2020-12-15 14:24:14 +01:00
|
|
|
<%= error_tag f, :current_password %>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<%= submit "Change password" %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2020-12-23 12:51:05 +01:00
|
|
|
|
|
|
|
<h3>SSH Keys</h3>
|
|
|
|
|
|
|
|
<%= form_for @key_changeset, Routes.user_keys_path(@conn, :new), fn f -> %>
|
|
|
|
<%= if @key_changeset.action do %>
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
<p>Oops, something went wrong! Please check the errors below.</p>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= text_input f, :comment, placeholder: "comment" %>
|
|
|
|
<%= error_tag f, :comment %>
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
<%= textarea f, :value, required: true, placeholder: "value" %>
|
|
|
|
<%= error_tag f, :value %>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<%= submit "Add key" %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Comment</th>
|
|
|
|
<th>Imported on</th>
|
|
|
|
<th>Fingerprint</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<%= for key <- @keys do %>
|
|
|
|
<tr>
|
|
|
|
<td><%= key.comment %></td>
|
|
|
|
<td><%= key.inserted_at %></td>
|
|
|
|
<td><%= key.fingerprint %></td>
|
|
|
|
<td><%= link "Delete", to: Routes.user_keys_path(@conn, :delete, key.id) %></td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|