Prepare UI for notification settings

This commit is contained in:
Dmitriy Zaporozhets 2013-03-27 20:07:52 +02:00
parent d55ade1686
commit ba59912072
8 changed files with 81 additions and 20 deletions

View file

@ -1,15 +1,25 @@
%h3.page_title Setup your notification level
%br
%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
= form_tag profile_notifications_path do
%ul.unstyled
= form_tag profile_notifications_path, method: :put, remote: true, class: 'update-notifications' do
%ul.well-list
%li
.row
.span3
.span4
%h5 Global
.span9
.span7
= label_tag do
= radio_button_tag :notification_level, Notification::N_DISABLED, @notification.disabled?
%span Disabled
@ -22,5 +32,37 @@
= radio_button_tag :notification_level, Notification::N_WATCH, @notification.watch?
%span Watch
= link_to '#', class: 'js-toggle-visibility-link' do
%h6.btn.btn-tiny
%i.icon-chevron-down
%span Per project notifications settings
%ul.well-list.js-toggle-visibility-container.hide
- @projects.each do |project|
%li
.row
.span4
%span
= project.name_with_namespace
.span7
= label_tag do
= radio_button_tag :"notification_level[#{project.id}]", Notification::N_DISABLED, @notification.disabled?, disabled: true
%span Disabled
= label_tag do
= radio_button_tag :"notification_level[#{project.id}]", Notification::N_PARTICIPATING, @notification.participating?, disabled: true
%span Participating
= label_tag do
= radio_button_tag :"notification_level[#{project.id}]", Notification::N_WATCH, @notification.watch?, disabled: true
%span Watch
.form-actions
= submit_tag 'Save', class: 'btn btn-save'
%span.update-success.cgreen.hide
%i.icon-ok
Saved
%span.update-failed.cred.hide
%i.icon-remove
Failed

View file

@ -0,0 +1,7 @@
- if @saved
:plain
$('.update-notifications .update-success').showAndHide();
- else
:plain
$('.update-notifications .update-failed').showAndHide();