diff --git a/app/controllers/settings/notifiers_controller.rb b/app/controllers/settings/notifiers_controller.rb index 0b8aef12f..b52d8f525 100644 --- a/app/controllers/settings/notifiers_controller.rb +++ b/app/controllers/settings/notifiers_controller.rb @@ -1,7 +1,5 @@ # -*- encoding : utf-8 -*- class Settings::NotifiersController < ApplicationController - layout "sessions" - before_filter :authenticate_user! load_and_authorize_resource :user diff --git a/app/views/settings/notifiers/_form.html.haml b/app/views/settings/notifiers/_form.html.haml index 9a19ff6b0..b66bba9a9 100644 --- a/app/views/settings/notifiers/_form.html.haml +++ b/app/views/settings/notifiers/_form.html.haml @@ -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" +-# diff --git a/app/views/settings/notifiers/show.html.haml b/app/views/settings/notifiers/show.html.haml index 97f82b931..64c7ef397 100644 --- a/app/views/settings/notifiers/show.html.haml +++ b/app/views/settings/notifiers/show.html.haml @@ -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} diff --git a/app/views/users/_sidebar.html.haml b/app/views/users/_sidebar.html.haml index 9fd764acb..84b1fc81f 100644 --- a/app/views/users/_sidebar.html.haml +++ b/app/views/users/_sidebar.html.haml @@ -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 diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 48ff57488..3e597e31e 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -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'); diff --git a/config/locales/en.yml b/config/locales/en.yml index ccb1e5916..3a1281ea6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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 diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 68ca88d74..371c5c3d4 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -48,6 +48,8 @@ ru: notifier: Настройки оповещений notifiers: edit_header: Настройки оповещений + notice_header: Вы можете получать уведомления об изменениях, которые вносят другие участники, в код ваших программ. Уведомления будут высылаться на указанный вами адрес электронной почты %{email}. + change_email_link: Изменить адрес электронной почты processing: Обрабатывается... invalid_content_type: имеет неверный тип