[refs #257] Add new design to notifier settings. Fix sidebar. Add edit btn to user profile

This commit is contained in:
konstantin.grabar 2012-03-03 13:23:30 +04:00
parent 0dc22bae82
commit ecff8d2d41
7 changed files with 110 additions and 39 deletions

View File

@ -1,7 +1,5 @@
# -*- encoding : utf-8 -*-
class Settings::NotifiersController < ApplicationController
layout "sessions"
before_filter :authenticate_user!
load_and_authorize_resource :user

View File

@ -1,41 +1,90 @@
.group
= f.label :can_notify, t('activerecord.attributes.settings.notifier.can_notify'), :class => :label
= f.check_box :can_notify#, :class => 'text_field'
.group
= f.label :new_comment, t('activerecord.attributes.settings.notifier.new_comment'), :class => :label
.leftside.w25
= f.check_box :can_notify
.leftside
= f.label :can_notify, t('activerecord.attributes.settings.notifier.can_notify')
.both
%h3 Код
.leftside.w25
= f.check_box :new_comment, :class => 'notify_cbx'
.group
= f.label :new_comment_reply, t('activerecord.attributes.settings.notifier.new_comment_reply'), :class => :label
.leftside
= f.label :new_comment, t('activerecord.attributes.settings.notifier.new_comment')
.both
.leftside.w25
= f.check_box :new_comment_reply, :class => 'notify_cbx'
.group
= f.label :new_issue, t('activerecord.attributes.settings.notifier.new_issue'), :class => :label
.leftside
= f.label :new_comment_reply, t('activerecord.attributes.settings.notifier.new_comment_reply')
.both
.leftside.w25
= f.check_box :new_issue, :class => 'notify_cbx'
.group
= f.label :issue_assign, t('activerecord.attributes.settings.notifier.issue_assign'), :class => :label
.leftside
= f.label :new_issue, t('activerecord.attributes.settings.notifier.new_issue')
.both
.leftside.w25
= f.check_box :issue_assign, :class => 'notify_cbx'
.group
= f.label :new_comment_commit_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_owner'), :class => :label
.leftside
= f.label :issue_assign, t('activerecord.attributes.settings.notifier.issue_assign')
.both
.leftside.w25
= f.check_box :new_comment_commit_owner, :class => 'notify_cbx'
.group
= f.label :new_comment_commit_repo_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_repo_owner'), :class => :label
.leftside
= f.label :new_comment_commit_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_owner')
.both
.leftside.w25
= f.check_box :new_comment_commit_repo_owner, :class => 'notify_cbx'
.group
= f.label :new_comment_commit_commentor, t('activerecord.attributes.settings.notifier.new_comment_commit_commentor'), :class => :label
.leftside
= f.label :new_comment_commit_repo_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_repo_owner')
.both
.leftside.w25
= f.check_box :new_comment_commit_commentor, :class => 'notify_cbx'
.group.navform.wat-cf
%button.button{:type => "submit"}
= image_tag("choose.png", :alt => t("layout.save"))
= t("layout.save")
%span.text_button_padding= t("layout.or")
= link_to t("layout.cancel"), user_settings_notifier_path(@user), :class => "text_button_padding link_button"
.leftside
= f.label :new_comment_commit_commentor, t('activerecord.attributes.settings.notifier.new_comment_commit_commentor')
.both
%br
.leftside.w25
\ 
.leftside.w420
= submit_tag t("layout.save")
.both
:javascript
disableNotifierCbx($('#settings_notifier_can_notify'));
-#.group
-# = f.label :can_notify, t('activerecord.attributes.settings.notifier.can_notify'), :class => :label
-# = f.check_box :can_notify#, :class => 'text_field'
-#
-#.group
-# = f.label :new_comment, t('activerecord.attributes.settings.notifier.new_comment'), :class => :label
-# = f.check_box :new_comment, :class => 'notify_cbx'
-#
-#.group
-# = f.label :new_comment_reply, t('activerecord.attributes.settings.notifier.new_comment_reply'), :class => :label
-# = f.check_box :new_comment_reply, :class => 'notify_cbx'
-#
-#.group
-# = f.label :new_issue, t('activerecord.attributes.settings.notifier.new_issue'), :class => :label
-# = f.check_box :new_issue, :class => 'notify_cbx'
-#
-#.group
-# = f.label :issue_assign, t('activerecord.attributes.settings.notifier.issue_assign'), :class => :label
-# = f.check_box :issue_assign, :class => 'notify_cbx'
-#
-#.group
-# = f.label :new_comment_commit_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_owner'), :class => :label
-# = f.check_box :new_comment_commit_owner, :class => 'notify_cbx'
-#
-#.group
-# = f.label :new_comment_commit_repo_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_repo_owner'), :class => :label
-# = f.check_box :new_comment_commit_repo_owner, :class => 'notify_cbx'
-#
-#.group
-# = f.label :new_comment_commit_commentor, t('activerecord.attributes.settings.notifier.new_comment_commit_commentor'), :class => :label
-# = f.check_box :new_comment_commit_commentor, :class => 'notify_cbx'
-#
-#.group.navform.wat-cf
-# %button.button{:type => "submit"}
-# = image_tag("choose.png", :alt => t("layout.save"))
-# = t("layout.save")
-# %span.text_button_padding= t("layout.or")
-# = link_to t("layout.cancel"), user_settings_notifier_path(@user), :class => "text_button_padding link_button"
-#

View File

@ -1,5 +1,20 @@
#block-signup.block
%h2= title t("layout.settings.notifiers.edit_header")
.content
= form_for @notifier, :url => user_settings_notifier_path(@user), :html => { :class => :form } do |f|
= render :partial => "form", :locals => {:f => f}
%p
= t("layout.settings.notifiers.notice_header", :email => @user.email)
%br
= link_to t("layout.settings.notifiers.change_email_link"), edit_user_path(@user)
%br
%br/
= form_for @notifier, :url => user_settings_notifier_path(@user), :html => { :class => :form } do |f|
= render :partial => "form", :locals => {:f => f}
:javascript
$('article .right').addClass('bigpadding');
- content_for :sidebar, render('users/sidebar')
-##block-signup.block
-# %h2= title t("layout.settings.notifiers.edit_header")
-# .content
-# = form_for @notifier, :url => user_settings_notifier_path(@user), :html => { :class => :form } do |f|
-# = render :partial => "form", :locals => {:f => f}

View File

@ -11,7 +11,7 @@
%li{:class => (act == :private && contr == :users) ? 'active' : ''}
= link_to t("layout.users.user_private_settings"), user_private_settings_path(@user)
- if can? :user_settings_notifier, @user
%li{:class => (act == :show && contr == :'settings/notifier') ? 'active' : ''}
%li{:class => (act == :show && contr == :notifiers) ? 'active' : ''}
= link_to t("layout.users.settings_notifier"), user_settings_notifier_path(@user)
-#.block.notice

View File

@ -14,6 +14,11 @@
= link_to project.name, project
%br
.left
%br
= link_to t("layout.users.edit"), edit_user_path(@user), :class => 'button' if can? :edit, @user
:javascript
$('article .all').addClass('verybigpadding');

View File

@ -48,6 +48,8 @@ en:
notifier: Notifier setting
notifiers:
edit_header: Notifier setting
notice_header: You can receive notifies from other collaborators about changes into code of your projects. Notifies will be sent to your email %{email}.
change_email_link: Change email address
processing: working ...
invalid_content_type: incorrect type

View File

@ -48,6 +48,8 @@ ru:
notifier: Настройки оповещений
notifiers:
edit_header: Настройки оповещений
notice_header: Вы можете получать уведомления об изменениях, которые вносят другие участники, в код ваших программ. Уведомления будут высылаться на указанный вами адрес электронной почты %{email}.
change_email_link: Изменить адрес электронной почты
processing: Обрабатывается...
invalid_content_type: имеет неверный тип