Initial commit
This commit is contained in:
25
app/views/account_auths/_account_auth.html.erb
Normal file
25
app/views/account_auths/_account_auth.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<tr id="<%= dom_id(account_auth) %>">
|
||||
<td style="width:3rem">
|
||||
<%= image_or_text_avatar(account_auth.user) %>
|
||||
</td>
|
||||
<td><%= account_auth.user.email %></td>
|
||||
<td><%= account_auth.user.full_name %></td>
|
||||
<td>
|
||||
<% if account_auth.user == Current.user %>
|
||||
<%= account_auth.role.to_s.titleize %>
|
||||
<% else %>
|
||||
<%= bootstrap_form_with model: account_auth, local: true, layout: :inline do |form| %>
|
||||
<%= form.select :role, options_for_role_select, { hide_label: true, append: form.button("Change Role", class: "btn btn-success btn-sm") }, { class: "form-control custom-select" } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= pluralize(account_auth.user.accessible_projects_for(account_auth.account).size, "Project") %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<% if policy(account_auth).destroy? && account_auth.user != Current.user %>
|
||||
<%= link_to t(".actions.remove"), account_auth_path(account_auth), method: :delete, data: { confirm: t(".confirm") }, class: "btn btn-light btn-sm border" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
4
app/views/account_auths/_account_logo_form.html.erb
Normal file
4
app/views/account_auths/_account_logo_form.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<%= bootstrap_form_with model: account, url: account_path, html: { autocorrect: :off, autocapitalize: :none, autocomplete: :off, spellcheck: false }, layout: :inline, remote: true do |form| %>
|
||||
<%= form.file_field :logo, hide_label: true, accept: "image/*", placeholder: "Upload Logo", direct_upload: true, wrapper_class: "mr-1" %>
|
||||
<%= form.button(fa_icon("upload", text: t(".submit")), class: "btn btn-md btn-primary", data: { disable_with: t("shared.disable_with") }) %>
|
||||
<% end %>
|
||||
4
app/views/account_auths/_form.html.erb
Normal file
4
app/views/account_auths/_form.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<%= bootstrap_form_with model: [account_auth], html: { autocorrect: :off, autocapitalize: :none, autocomplete: :off, spellcheck: false } do |form| %>
|
||||
<%= form.email_field :user_email, hide_label: true, append: form.button(fa_icon("paper-plane-o", text: t(".submit")), class: "btn btn-primary"), placeholder: true %>
|
||||
<%= form.hidden_field :account_id, { value: account_id } %>
|
||||
<% end %>
|
||||
39
app/views/account_auths/index.html.erb
Normal file
39
app/views/account_auths/index.html.erb
Normal file
@@ -0,0 +1,39 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), subtext: @account.name, close_action_path: ( Current.user.admin? ? admin_accounts_path : projects_path) %>
|
||||
|
||||
<div class="card-body p-3">
|
||||
<section class="py-2">
|
||||
<h2 class="h6"><%= t(".logo.heading") %></h2>
|
||||
<div class="mb-2" id="account_logo_display">
|
||||
<%= render "accounts/logo", account: @account %>
|
||||
</div>
|
||||
<%= render "account_logo_form", account: @account %>
|
||||
</section>
|
||||
<hr>
|
||||
<% if policy(AccountAuth).new? %>
|
||||
<section class="py-2">
|
||||
<h2 class="h6"><%= t(".invitation.heading") %></h2>
|
||||
<%= render "form", account_auth: @account_auth, account_id: @account.id %>
|
||||
</section>
|
||||
<% end %>
|
||||
|
||||
<h2 class="h6"><%= pluralize(@members.size, "Account Member") %></h2>
|
||||
<div class="pt-2 mx-n3">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Email</th>
|
||||
<th>Name</th>
|
||||
<th>Role</th>
|
||||
<th>No. Projects</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= render @members %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user