From 9f38cf5093f5141717cfa1b1c956ed8ec9135ebe Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 31 Jul 2013 17:05:22 +0300 Subject: [PATCH] Improve Notifications page. Much easier to find muted projects now --- app/helpers/notifications_helper.rb | 11 +++++ app/views/admin/users/index.html.haml | 2 +- app/views/dashboard/projects.html.haml | 1 + .../notifications/_settings.html.haml | 2 + .../profiles/notifications/show.html.haml | 43 +++++++++++-------- 5 files changed, 40 insertions(+), 19 deletions(-) diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 7342393a707..ae3402b2617 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -1,2 +1,13 @@ module NotificationsHelper + def notification_icon(notification) + if notification.disabled? + content_tag :i, nil, class: 'icon-circle cred' + elsif notification.participating? + content_tag :i, nil, class: 'icon-circle cblue' + elsif notification.watch? + content_tag :i, nil, class: 'icon-circle cgreen' + else + content_tag :i, nil, class: 'icon-circle-blank cblue' + end + end end diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index c2dfcb5e6fa..e0647933394 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -55,4 +55,4 @@ - else = link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-small btn-remove" = link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn btn-small btn-remove" - = paginate @users, theme: "gitlab" + = paginate @users, theme: "gitlab" diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index 78ba479c5af..705b316dd74 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -1,3 +1,4 @@ +%h3.page-title My Projects .row .span3 %ul.nav.nav-pills.nav-stacked diff --git a/app/views/profiles/notifications/_settings.html.haml b/app/views/profiles/notifications/_settings.html.haml index 1a4a4a9f916..5f62c8099d0 100644 --- a/app/views/profiles/notifications/_settings.html.haml +++ b/app/views/profiles/notifications/_settings.html.haml @@ -2,6 +2,8 @@ .row .span4 %span + = notification_icon(notification) + - if membership.kind_of? UsersGroup = link_to membership.group.name, membership.group - else diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml index 43b1cf6f8df..3b8da833232 100644 --- a/app/views/profiles/notifications/show.html.haml +++ b/app/views/profiles/notifications/show.html.haml @@ -1,19 +1,25 @@ -%h3.page-title Setup your notification level +%h3.page-title + Notifications settings -%p.light - %strong Disabled - – You will not get any notifications via email -%p.light - %strong Participating - – You will receive only notifications from related resources(ex. from assigned issue or your commit) -%p.light - %strong Watch - – You will receive all notifications from projects in which you participate -%hr +.alert.alert-info + %p + %i.icon-circle.cred + %strong Disabled + – You will not get any notifications via email + %p + %i.icon-circle.cblue + %strong Participating + – You will receive only notifications from related resources(ex. from assigned issue or your commit) + %p + %i.icon-circle.cgreen + %strong Watch + – You will receive all notifications from projects in which you participate .row .span4 - %h5 Global setting + %h4 + = notification_icon(@notification) + Global setting .span7 = form_tag profile_notifications_path, method: :put, remote: true, class: 'update-notifications' do = hidden_field_tag :notification_type, 'global' @@ -30,20 +36,21 @@ = radio_button_tag :notification_level, Notification::N_WATCH, @notification.watch?, class: 'trigger-submit' %span Watch -%hr +%br = link_to '#', class: 'js-toggle-visibility-link' do - %h6.btn.btn-tiny + %span.btn.btn-tiny %i.icon-chevron-down %span Advanced notifications settings .js-toggle-visibility-container.hide - %h5 Groups: - %ul.well-list + %hr + %h4 Groups: + %ul.bordered-list - @users_groups.each do |users_group| - notification = Notification.new(users_group) = render 'settings', type: 'group', membership: users_group, notification: notification - %h5 Projects: - %ul.well-list + %h4 Projects: + %ul.bordered-list - @users_projects.each do |users_project| - notification = Notification.new(users_project) = render 'settings', type: 'project', membership: users_project, notification: notification