diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-11-13 20:35:47 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-11-16 13:42:35 +0100 |
commit | c60437786bfe43344b4a5eb040437f73f37c6396 (patch) | |
tree | fe90ee0dd9e556369e7f53ce4a03e2751b486682 /app/views/profiles/chat_names | |
parent | c5169b5d447ab6c73bbe542c071a4054c5969165 (diff) | |
download | gitlab-ce-c60437786bfe43344b4a5eb040437f73f37c6396.tar.gz |
Create relation between chat user and GitLab user and allow to authorize them [ci skip]
Diffstat (limited to 'app/views/profiles/chat_names')
-rw-r--r-- | app/views/profiles/chat_names/index.html.haml | 49 | ||||
-rw-r--r-- | app/views/profiles/chat_names/new.html.haml | 15 |
2 files changed, 64 insertions, 0 deletions
diff --git a/app/views/profiles/chat_names/index.html.haml b/app/views/profiles/chat_names/index.html.haml new file mode 100644 index 00000000000..f90ac4c6a03 --- /dev/null +++ b/app/views/profiles/chat_names/index.html.haml @@ -0,0 +1,49 @@ +- page_title "Chat" += render 'profiles/head' + +.row.prepend-top-default + .col-lg-3.profile-settings-sidebar + %h4.prepend-top-0 + = page_title + %p + You can see your Chat integrations. + + .col-lg-9 + %h5 Active chat names (#{@chat_names.length}) + + - if @chat_names.present? + .table-responsive + %table.table.chat-names + %thead + %tr + %th Project + %th Service + %th Team domain + %th Nickname + %th Created + %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 + = chat_name.service.title + %td= chat_name.team_domain + %td= chat_name.chat_name + %td= chat_name.created_at + %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?" } + + - else + .settings-message.text-center + You don't have any active chat names. diff --git a/app/views/profiles/chat_names/new.html.haml b/app/views/profiles/chat_names/new.html.haml new file mode 100644 index 00000000000..0b9ee8c71ad --- /dev/null +++ b/app/views/profiles/chat_names/new.html.haml @@ -0,0 +1,15 @@ +%h3.page-title Authorization required +%main{:role => "main"} + %p.h4 + Authorize the chat user + %strong.text-info= @chat_name_params[:chat_name] + to use your account? + + %hr/ + .actions + = form_tag profile_chat_names_path, method: :post do + = hidden_field_tag :token, @chat_name_token.token + = submit_tag "Authorize", class: "btn btn-success wide pull-left" + = form_tag deny_profile_chat_names_path, method: :delete do + = hidden_field_tag :token, @chat_name_token.token + = submit_tag "Deny", class: "btn btn-danger prepend-left-10" |