scinote-web/app/views/users/settings/teams/show.html.erb

122 lines
5.3 KiB
Text
Raw Normal View History

2018-07-19 23:56:42 +08:00
<% content_for :head do %>
<meta name="turbolinks-cache-control" content="no-cache">
<% end %>
2017-01-25 19:01:23 +08:00
<% provide(:head_title, t("users.settings.teams.head_title")) %>
<% provide(:container_class, "no-second-nav-container") %>
2017-01-25 19:01:23 +08:00
2017-02-02 17:36:23 +08:00
<div data-hook="team-beginning"></div>
2017-02-01 00:32:08 +08:00
<%= render partial: "users/settings/sidebar.html.erb" %>
2017-01-25 19:01:23 +08:00
<div class="tab-content">
<div class="tab-pane content-pane" role="tabpanel"></div>
2019-11-12 18:26:18 +08:00
<div class="tab-pane content-pane active team-settings-pane" role="tabpanel">
2017-01-25 19:01:23 +08:00
<%= render partial: "users/settings/teams/breadcrumbs.html.erb" %>
<!-- TITLE -->
2020-07-08 19:02:47 +08:00
<h1 id="team-name" class="settings-team-name" data-current-team="<%= current_team == @team %>">
<% if can_manage_team?(@team) %>
2019-11-03 21:59:30 +08:00
<%= render partial: "shared/inline_editing",
locals: {
initial_value: @team.name,
2019-11-12 18:26:18 +08:00
config: {
2019-11-03 21:59:30 +08:00
field_to_udpate: 'name',
2019-11-12 18:26:18 +08:00
params_group: 'team',
2019-11-03 21:59:30 +08:00
path_to_update: update_team_path(@team, format: :json)
}
} %>
<% else %>
2019-11-12 18:26:18 +08:00
<span class="view-mode"><%= @team.name %></span>
<% end %>
2020-07-08 19:02:47 +08:00
</h1>
2017-01-25 19:01:23 +08:00
<!-- End of TITLE -->
<!-- HEADER -->
2019-11-12 18:26:18 +08:00
<div class="team-metadata">
<div class="created-at grid-block">
2019-11-12 18:26:18 +08:00
<span class="fas fa-calendar-alt"></span>
<span class="hidden-xs hidden-sm"><%= t("users.settings.teams.edit.header_created_at") %></span>
<b><%= l(@team.created_at, format: :full_date) %></b>
2017-01-25 19:01:23 +08:00
</div>
<div class="created-by grid-block">
2019-11-12 18:26:18 +08:00
<span class="fas fa-user fa-lg"></span>
<span class="hidden-xs hidden-sm"><%= t("users.settings.teams.edit.header_created_by") %></span>
2020-10-02 20:25:44 +08:00
<b>
<%= t('users.settings.teams.edit.header_created_by_name_email', name: @team.created_by.full_name, email: @team.created_by.email) if @team.created_by %>
</b>
2017-01-25 19:01:23 +08:00
</div>
<div class="space-usage grid-block">
2019-11-12 18:26:18 +08:00
<span class="fas fa-hdd"></span>
<span class="hidden-xs hidden-sm"><%= t("users.settings.teams.edit.header_space_taken") %></span>
<b data-hook="team-space-taken"><%= "#{number_to_human_size(@team.storage_used)}" %></b>
2017-01-25 19:01:23 +08:00
</div>
</div>
2019-11-12 18:26:18 +08:00
<div class="team-description">
<% if can_manage_team?(@team) %>
2019-11-19 18:21:03 +08:00
<div
class="inline-init-handler"
data-field-to-update="description"
data-params-group="team"
data-path-to-update="<%= update_team_path(@team, format: :json) %>"
data-original-name="<%= @team.description %>"
2019-11-19 18:21:03 +08:00
>
<div class="view-mode" data-placeholder="<%= t("users.settings.teams.show.enter_description") %>"><%= @team.description %></div>
<textarea placeholder="<%= t("users.settings.teams.show.enter_description") %>" class="hidden input-field smart-text-area" type="text" value="<%= @team.description %>" disabled><%= @team.description %></textarea>
2019-11-19 18:21:03 +08:00
<div class="button-container">
<span class="cancel-button inline-field-button"><%= t('general.cancel') %></span>
<span class="save-button inline-field-button"><%= t('general.save') %></span>
</div>
</div>
<% else %>
<span class="view-mode disable-select"><%= @team.description.blank? ? t('users.settings.teams.edit.header_no_description') : @team.description %></span>
2019-11-19 18:21:03 +08:00
<% end %>
2017-01-25 19:01:23 +08:00
</div>
<!-- End of HEADER -->
<!-- USERS TABLE -->
2019-11-12 18:26:18 +08:00
<div class="users-datatable">
<% if can_invite_team_users?(@team) %>
<div id="add-new-team-members-button" class="hidden">
<a href="#" class="btn btn-primary" data-trigger="invite-users" data-turbolinks="false" data-modal-id="team-invite-users-modal">
<span class="fas fa-plus"></span>
<%= I18n.t('users.settings.teams.edit.add_user') %>
</a>
</div>
<%= render(partial: 'shared/invite_users_modal.html.erb',
locals: { modal_id: 'team-invite-users-modal',
type: 'invite_to_team_with_role',
team: @team } ) %>
<% end %>
2019-11-12 18:26:18 +08:00
<table id="users-table" class="table" data-source="<%= team_users_datatable_path(@team, format: :json) %>">
<thead>
<tr>
<th id="user-name"><%= t("users.settings.teams.edit.thead_user_name") %></th>
<th id="email"><%= t("users.settings.teams.edit.thead_email") %></th>
<th id="user-role"><%= t("users.settings.teams.edit.thead_role") %></th>
<th id="joined-on"><%= t("users.settings.teams.edit.thead_joined_on") %></th>
<th id="status"><%= t("users.settings.teams.edit.thead_status") %></th>
<th id="options"><%= t("users.settings.teams.edit.thead_actions") %></th>
</tr>
</thead>
<tbody></tbody>
</table>
2017-01-25 19:01:23 +08:00
</div>
<!-- End of USERS TABLE -->
2017-02-01 00:32:08 +08:00
2017-02-02 17:36:23 +08:00
<div data-hook="team-the-end"></div>
2017-02-01 00:32:08 +08:00
2017-01-25 19:01:23 +08:00
</div>
</div>
<%= render partial: 'users/settings/teams/description_modal.html.erb' %>
<%= render partial: 'users/settings/teams/destroy_modal.html.erb', locals: { team: @team } %>
<%= render partial: 'users/settings/user_teams/destroy_user_team_modal.html.erb' %>
2017-01-25 19:01:23 +08:00
<%= stylesheet_link_tag 'datatables' %>
<%= javascript_include_tag 'users/settings/teams/show' %>
<span data-hook="team-bottom"></span>