Skip to content

Commit

Permalink
Merge branch 'release/0.11.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed Dec 9, 2016
2 parents 6d87983 + 788d38c commit 0264afb
Show file tree
Hide file tree
Showing 53 changed files with 390 additions and 89 deletions.
Binary file added app/assets/images/mailers/confession/confirm.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion app/assets/javascripts/application.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#= require jasny-bootstrap
#= require jasny_file_uploader
#= require react_integration
#= require react_bundle
# Views logic
#= require web/members
#= require web/events
Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/web/admin/application.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#= require jasny_file_uploader
#= require placeholders
#= require react_integration
#= require react_bundle
#= reuqire yofication

$.extend String.prototype, camelize: ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
border-right: 1px solid lightgray
.avatar_on_modal
margin-bottom: 15px
.my_own_petition
a
cursor: default !important
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def update
@confession_form = ::ActivityLines::Corporative::ConfessionForm.find_with_model params[:id]
if @confession_form.submit params[:activity_lines_corporative_confession]
create_tag
send_notification @confession_form.member, @confession_form.model, :nominated if confession_confirmed?
send_notification @confession_form.creator, @confession_form.model, :confirm if confession_confirmed?
redirect_to edit_admin_activity_lines_corporative_confession_path @confession_form.model
else
choose_members
Expand All @@ -61,4 +63,8 @@ def create_tag
target_type: 'Member',
target_id: params[:activity_lines_corporative_confession][:member_id]
end

def confession_confirmed?
params[:activity_lines_corporative_confession][:state] == 'confirmed' && @prev_object_attributes[:state] != 'confirmed'
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ def create
@online_conference_form = ::ActivityLines::Corporative::OnlineConferenceForm.new_with_model
@online_conference_form.submit params[:activity_lines_corporative_online_conference]
if @online_conference_form.save
build_event
redirect_to new_admin_event_path(event: @event.attributes)
redirect_to new_admin_event_path event: build_event
else
render action: :new
end
Expand All @@ -51,9 +50,9 @@ def destroy
private

def build_event
@event = Event.new title: @online_conference_form.model.decorate.event_title,
{ title: @online_conference_form.model.decorate.event_title,
begin_date: @online_conference_form.model.date,
end_date: @online_conference_form.model.date + 3.hours,
creator_id: current_user.id
creator_id: current_user.id }
end
end
1 change: 0 additions & 1 deletion app/controllers/web/admin/news_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def edit
@news_form = NewsForm.find_with_model params[:id]
@previous_news = News.where('id < ? AND state = ?', @news_form.model.id, @news_form.model.state).last
@next_news = News.where('id > ? AND state = ?', @news_form.model.id, @news_form.model.state).first
@logged_actions = @news_form.model.logged_actions
end

def update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def create
params[:activity_lines_corporative_confession] = confession_params
@petition_form = ::ActivityLines::Corporative::ConfessionForm.new_with_model
if @petition_form.submit params[:activity_lines_corporative_confession]
redirect_to activity_lines_corporative_petitions_path
Organization::Permissions.confession[:review].each do |member|
send_notification member, @petition_form.model, :create
end
redirect_to activity_lines_corporative_petitions_path notice: :your_petition_will_be_reviewed
else
choose_members
render :new
Expand Down
1 change: 1 addition & 0 deletions app/controllers/web/news_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def show
@news = News.find(params[:id]).decorate
unless @news.is_published?
redirect_to not_found_page_path
return
end
@news.increase_views
topic_news_tags = @news.tags
Expand Down
2 changes: 1 addition & 1 deletion app/decorators/team_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def short_description
end

def full_title(type_case = nil)
team_type = I18n.t("activerecord.attributes.team.types.#{type.split(':').last.downcase}")
team_type = I18n.t("activerecord.attributes.team.types.#{object.type.split(':').last.downcase}")
if object.is_departament?
"#{type_case ? send(type_case, team_type) : team_type} в #{instrumental(object.municipality)}"
elsif object.is_primary?
Expand Down
17 changes: 17 additions & 0 deletions app/mailers/activity_lines/corporative/confession_mailer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class ActivityLines::Corporative::ConfessionMailer < ApplicationMailer
default template_path: "mailers/#{self.name.underscore}"

def create(confession, user)
@user = user
@confession = confession
@subject = subject(confession.class, :create)
mail from: sender_name, to: user.email, subject: @subject
end

def confirm(confession, user)
@user = user
@confession = confession
@subject = subject(confession.class, :confirm)
mail from: sender_name, to: user.email, subject: @subject
end
end
1 change: 1 addition & 0 deletions app/models/activity_lines/corporative/confession.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class ActivityLines::Corporative::Confession < ActiveRecord::Base
belongs_to :member
belongs_to :creator, class_name: 'Member'
has_many :arguments
has_many :comments, as: :record,
dependent: :destroy
Expand Down
2 changes: 2 additions & 0 deletions app/views/layouts/web/admin/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
= render 'layouts/web/shared/head'
= stylesheet_link_tag 'web/admin/application'
= stylesheet_link_tag_if_exists stylesheet_link
- unless Rails.env.test?
= javascript_include_tag 'react_bundle'
= javascript_include_tag 'web/admin/application'
= javascript_include_tag_if_exists javascript_link
%body
Expand Down
2 changes: 2 additions & 0 deletions app/views/layouts/web/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
= stylesheet_link_tag 'application'
= stylesheet_link_tag 'web/application'
= javascript_include_tag 'vendor/modernizr'
- unless Rails.env.test?
= javascript_include_tag 'react_bundle'
= javascript_include_tag 'application'
= csrf_meta_tags
= favicon_link_tag 'favicon.ico'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
.nomination
= t('.number_one_of_the_year')
- number_one_of_the_year.each do |confession|
.member{ class: (:petition if vote), data: { id: confession.id, 'reveal-id' => ('argumentsModal' if vote) } }
- attributes = (confession.creator_id == current_user&.id) ? { class: (:petition if vote), data: { id: confession.id, 'reveal-id' => ('argumentsModal' if vote) } } : { class: :my_own_petition }
.member{ attributes }
= render 'layouts/web/elements/mic_member_2',
link: (('#' if vote) || ('' if confession.member.state != 'confirmed') || member_path(confession.member.ticket)),
img_src: confession.member.avatar.element.url,
Expand All @@ -27,7 +28,8 @@
.nomination
= t('.debut_of_the_year')
- debut_of_the_year.each do |confession|
.member{ class: (:petition if vote), data: { id: confession.id, 'reveal-id' => ('argumentsModal' if vote) } }
- attributes = (confession.creator_id == current_user&.id) ? { class: (:petition if vote), data: { id: confession.id, 'reveal-id' => ('argumentsModal' if vote) } } : { class: :my_own_petition }
.member{ attributes }
= render 'layouts/web/elements/mic_member_2',
link: (('#' if vote) || ('' if confession.member.state != 'confirmed') || member_path(confession.member.ticket)),
img_src: confession.member.avatar.element.url,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
!!!
%html
%head
%meta{ content: "text/html; charset=utf-8", "http-equiv" => "Content-Type" }/
%meta{ content: "width=device-width, initial-scale=1.0", name: "viewport" }/
%title Minty-Multipurpose Responsive Email Template
:css
/* Client-specific Styles */
#outlook a { padding:0; } /* Force Outlook to provide a "view in browser" menu link. */
body{ width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0; }
/* Prevent Webkit and Windows Mobile platforms from changing default font sizes, while not breaking desktop design. */
.ExternalClass { width:100%; } /* Force Hotmail to display emails at full width */
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } /* Force Hotmail to display normal line spacing. More on that: http://www.emailonacid.com/forum/viewthread/43/ */
#backgroundTable { margin:0; padding:0; width:100% !important; line-height: 100% !important; }
img { outline:none; text-decoration:none;border:none; -ms-interpolation-mode: bicubic; }
a img { border:none; }
.image_fix { display:block; }
p { margin: 0px 0px !important; }
table td { border-collapse: collapse; }
table { border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; }
a { /*color: #e95353;*/ text-underline:none!important; text-decoration: none;text-decoration:none!important; }
/*STYLES*/
table[class=full] { width: 100%; clear: both; }
/*################################################*/
/*IPAD STYLES*/
/*################################################*/
@media only screen and (max-width: 640px) {
a[href^="tel"], a[href^="sms"] {
text-decoration: none;
color: #ffffff; /* or whatever your want */
pointer-events: none;
cursor: default;
}
.mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
text-decoration: default;
color: #ffffff !important;
pointer-events: auto;
cursor: default;
}
table[class=devicewidth] { width: 440px!important;text-align:center!important; }
table[class=devicewidthinner] { width: 420px!important;text-align:center!important; }
table[class="sthide"]{ display: none!important; }
img[class="bigimage"]{ width: 420px!important;height:219px!important; }
img[class="col2img"]{ width: 420px!important;height:258px!important; }
img[class="image-banner"]{ width: 440px!important;height:106px!important; }
td[class="menu"]{ text-align:center !important; padding: 0 0 10px 0 !important; }
td[class="logo"]{ padding:10px 0 5px 0!important;margin: 0 auto !important; }
img[class="logo"]{ padding:0!important;margin: 0 auto !important; }
}
/*##############################################*/
/*IPHONE STYLES*/
/*##############################################*/
@media only screen and (max-width: 480px) {
a[href^="tel"], a[href^="sms"] {
text-decoration: none;
color: #ffffff; /* or whatever your want */
pointer-events: none;
cursor: default;
}
.mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
text-decoration: default;
color: #ffffff !important;
pointer-events: auto;
cursor: default;
}
table[class=devicewidth] { width: 280px!important;text-align:center!important; }
table[class=devicewidthinner] { width: 260px!important;text-align:center!important; }
table[class="sthide"]{ display: none!important; }
img[class="bigimage"]{ width: 260px!important;height:136px!important; }
img[class="col2img"]{ width: 260px!important;height:160px!important; }
img[class="image-banner"]{ width: 280px!important;height:68px!important; }
}
%body
- 20.times do
%p
%table{ bgcolor: "#f6f4f5", border: "0", cellpadding: "0", cellspacing: "0", width: "100%" }
%tbody
%tr
%td
.innerbg
%table.devicewidth{ align: "center", bgcolor: "#ffffff", border: "0", cellpadding: "0", cellspacing: "0", width: "580" }
%tbody
%tr
%td{ height: "20", width: "100%" }
%tr
%td
%table.devicewidthinner{ align: "center", border: "0", cellpadding: "0", cellspacing: "0", width: "540" }
%tbody
%tr
%td{ align: "center" }
.imgpop
.uploader_wrap{ style: "width: 540px; opacity: 0;" }
.upload_buttons
.img_link
.img_upload
.img_edit{ style: "visibility: visible;" }
%a{ href: "#" }
%img{ src: 'https://ulmic.ru/assets/mailers/confession/confirm.jpg', alt: '', border: '0', height: 'auto', style: 'display:block; border:none; outline:none; text-decoration:none;', width: '540' }
%tr
%td{ height: "20", width: "100%" }
%tr
%td{ style: "font-family: Helvetica, arial, sans-serif; font-size: 18px; color: #333333; text-align:left;line-height: 20px;" }
%p
Твоё ходатайство опубликовано
%tr
%td{ height: "20", width: "100%" }
%tr
%td{ style: "font-family: Helvetica, arial, sans-serif; font-size: 13px; color: #333333; text-align:left;line-height: 24px;" }
%p
Ранее Ты выдвинул на Премию "Признание"
= @confession.member.decorate.short_name
в номинации
= enumerize_locales_value @confession, :nomination
%p
Сообщаем тебе, что Твоё ходатайство принято руководителями МИЦ и Твой кандидат выдвинут на голосование за номинантов Премии "Признание". Голование начнётся
=l configus.dates.activity_lines.corporative.confession.begining_voting, format: '%d %M'
%p
Голосование будет проводиться на
= link_to ' сайте МИЦ.', activity_lines_corporative_petitions_path
%p
Следи за новостями, Твой МИЦ!

%tr
%td{ height: "10", width: "100%" }
%tr
%td
.buttonbg
%table.tablet-button{ align: "left", bgcolor: "#ffa600", border: "0", cellpadding: "0", cellspacing: "0", height: "30", style: "border-radius: 4px; font-size: 13px; font-family: Helvetica, arial, sans-serif; text-align: center; color: rgb(255, 255, 255); font-weight: 300; padding-left: 18px; padding-right: 18px; background-color: rgb(255, 166, 0); background-clip: padding-box;", valign: "middle" }
%tbody
%tr
%td{ align: "center", height: "30", style: "padding-left:18px; padding-right:18px;font-family:Helvetica, arial, sans-serif; text-align:center; color:#ffffff; font-weight: 300;", valign: "middle", width: "auto" }
%p{ align: "center" }
%span{ style: "color: rgb(255, 255, 255); font-weight: 300; font-size: 20pt;" }
%a{ href: activity_lines_corporative_petitions_path, style: "color: #ffffff; text-align:center;text-decoration: none;", tabindex: "-1" }= t('helpers.more_info')
%tr
%td{ height: "20", width: "100%" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
%p
Привет,
= @user.first_name
\, довожу до Твоего сведения, что на сайте добавлено ходатайство на премию "Признание" на
= @сonfession.member.decorate.short_name
прошу провести ревью этого ходатайства и опубликовать его.
%p
%b
Спасибо! Твой МИЦ.
Loading

0 comments on commit 0264afb

Please sign in to comment.