Add chat_name partial
This commit is contained in:
parent
9b86a5e19d
commit
1ddfc574ce
|
@ -1,9 +1,9 @@
|
|||
class Profiles::ChatNamesController < Profiles::ApplicationController
|
||||
before_action :chat_names, only: [:index]
|
||||
before_action :chat_name_token, only: [:new]
|
||||
before_action :chat_name_params, only: [:new, :create, :deny]
|
||||
|
||||
def index
|
||||
@chat_names = current_user.chat_names
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
- service = chat_name.service
|
||||
- project = service.project
|
||||
%tr
|
||||
%td
|
||||
%strong
|
||||
- if can?(current_user, :read_project, project)
|
||||
= link_to project.name_with_namespace, project_path(project)
|
||||
- else
|
||||
.light N/A
|
||||
%td
|
||||
%strong
|
||||
- if can?(current_user, :admin_project, project)
|
||||
= link_to service.title, edit_namespace_project_service_path(project.namespace, project, service)
|
||||
- else
|
||||
= service.title
|
||||
%td
|
||||
= chat_name.team_domain
|
||||
%td
|
||||
= chat_name.chat_name
|
||||
%td
|
||||
- if chat_name.last_used_at
|
||||
time_ago_with_tooltip(chat_name.last_used_at)
|
||||
- else
|
||||
Never
|
||||
|
||||
%td
|
||||
= link_to 'Remove', profile_chat_name_path(chat_name), method: :delete, class: 'btn btn-danger pull-right', data: { confirm: 'Are you sure you want to revoke this nickname?' }
|
|
@ -9,7 +9,7 @@
|
|||
You can see your Chat accounts.
|
||||
|
||||
.col-lg-9
|
||||
%h5 Active chat names (#{@chat_names.length})
|
||||
%h5 Active chat names (#{@chat_names.size})
|
||||
|
||||
- if @chat_names.present?
|
||||
.table-responsive
|
||||
|
@ -23,34 +23,7 @@
|
|||
%th Last used
|
||||
%th
|
||||
%tbody
|
||||
- @chat_names.each do |chat_name|
|
||||
- service = chat_name.service
|
||||
- project = service.project
|
||||
%tr
|
||||
%td
|
||||
%strong
|
||||
- if can?(current_user, :read_project, project)
|
||||
= link_to project.name_with_namespace, project_path(project)
|
||||
- else
|
||||
.light N/A
|
||||
%td
|
||||
%strong
|
||||
- if can?(current_user, :admin_project, project)
|
||||
= link_to service.title, edit_namespace_project_service_path(project.namespace, project, service)
|
||||
- else
|
||||
= service.title
|
||||
%td
|
||||
= chat_name.team_domain
|
||||
%td
|
||||
= chat_name.chat_name
|
||||
%td
|
||||
- if chat_name.last_used_at
|
||||
time_ago_with_tooltip(chat_name.last_used_at)
|
||||
- else
|
||||
Never
|
||||
|
||||
%td
|
||||
= link_to 'Remove', profile_chat_name_path(chat_name), method: :delete, class: 'btn btn-danger pull-right', data: { confirm: 'Are you sure you want to revoke this nickname?' }
|
||||
= render @chat_names
|
||||
|
||||
- else
|
||||
.settings-message.text-center
|
||||
|
|
Loading…
Reference in New Issue