summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-11-16 23:10:27 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-11-16 23:10:27 +0100
commit6f714dfb4a9b823ab75508f252d06e19e286d5f2 (patch)
tree409569ad65f1982451d9eb9a5bb0eae078abf01a /app
parent2749e7a58285e59381a3e788983678d9cf633b45 (diff)
downloadgitlab-ce-6f714dfb4a9b823ab75508f252d06e19e286d5f2.tar.gz
Improve code design after code review
Diffstat (limited to 'app')
-rw-r--r--app/controllers/profiles/chat_names_controller.rb4
-rw-r--r--app/services/chat_names/find_user_service.rb2
-rw-r--r--app/views/profiles/chat_names/index.html.haml14
-rw-r--r--app/views/profiles/chat_names/new.html.haml4
4 files changed, 13 insertions, 11 deletions
diff --git a/app/controllers/profiles/chat_names_controller.rb b/app/controllers/profiles/chat_names_controller.rb
index 0d3bdeff416..7f9c8e64cca 100644
--- a/app/controllers/profiles/chat_names_controller.rb
+++ b/app/controllers/profiles/chat_names_controller.rb
@@ -13,7 +13,7 @@ class Profiles::ChatNamesController < Profiles::ApplicationController
new_chat_name = current_user.chat_names.new(chat_name_params)
if new_chat_name.save
- flash[:notice] = "Authorized chat nickname #{new_chat_name.chat_name}"
+ flash[:notice] = "Authorized #{new_chat_name.chat_name}"
else
flash[:alert] = "Could not authorize chat nickname. Try again!"
end
@@ -34,7 +34,7 @@ class Profiles::ChatNamesController < Profiles::ApplicationController
@chat_name = chat_names.find(params[:id])
if @chat_name.destroy
- flash[:notice] = "Delete chat nickname: #{@chat_name.chat_name}!"
+ flash[:notice] = "Deleted chat nickname: #{@chat_name.chat_name}!"
else
flash[:alert] = "Could not delete chat nickname #{@chat_name.chat_name}."
end
diff --git a/app/services/chat_names/find_user_service.rb b/app/services/chat_names/find_user_service.rb
index 28e3e155be1..08079fdaf70 100644
--- a/app/services/chat_names/find_user_service.rb
+++ b/app/services/chat_names/find_user_service.rb
@@ -9,7 +9,7 @@ module ChatNames
chat_name = find_chat_name
return unless chat_name
- chat_name.update(used_at: Time.now)
+ chat_name.update(last_used_at: Time.now)
chat_name.user
end
diff --git a/app/views/profiles/chat_names/index.html.haml b/app/views/profiles/chat_names/index.html.haml
index ae0b6336944..6d8d606583d 100644
--- a/app/views/profiles/chat_names/index.html.haml
+++ b/app/views/profiles/chat_names/index.html.haml
@@ -6,7 +6,7 @@
%h4.prepend-top-0
= page_title
%p
- You can see your Chat integrations.
+ You can see your Chat accounts.
.col-lg-9
%h5 Active chat names (#{@chat_names.length})
@@ -39,11 +39,13 @@
= 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=
- - if chat_name.used_at
- time_ago_with_tooltip(chat_name.used_at)
+ %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
diff --git a/app/views/profiles/chat_names/new.html.haml b/app/views/profiles/chat_names/new.html.haml
index 0b9ee8c71ad..f635acf96e2 100644
--- a/app/views/profiles/chat_names/new.html.haml
+++ b/app/views/profiles/chat_names/new.html.haml
@@ -1,11 +1,11 @@
%h3.page-title Authorization required
%main{:role => "main"}
%p.h4
- Authorize the chat user
+ Authorize
%strong.text-info= @chat_name_params[:chat_name]
to use your account?
- %hr/
+ %hr
.actions
= form_tag profile_chat_names_path, method: :post do
= hidden_field_tag :token, @chat_name_token.token