From 17d40d3e081953347fa26c5fdc3ec206de06c3d1 Mon Sep 17 00:00:00 2001 From: Spen Date: Tue, 5 Nov 2013 16:05:16 +0800 Subject: [PATCH] fix announcement image info and mail subject --- .../back_end/bulletins_controller.rb | 21 ++++++++++--------- .../back_end/bulletins/_form.html.erb | 6 +++++- .../announcement/config/locales/en.yml | 4 +++- .../announcement/config/locales/zh_tw.yml | 4 +++- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb index 0b93a2b21..0be043165 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb @@ -159,12 +159,12 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController respond_to do |format| if @bulletin.save - # if @bulletin.email_sent == true && @bulletin.is_checked == true && !@bulletin.is_rejected - # send_email_data(@bulletin) + if @bulletin.email_sent == true && @bulletin.is_checked == true && !@bulletin.is_rejected + send_email_data(@bulletin) - # @bulletin.email_sent = false - # @bulletin.save - # end + @bulletin.email_sent = false + @bulletin.save + end format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('announcement.create_bulletin_success')) } format.xml { render :xml => @bulletin, :status => :created, :location => @bulletin } @@ -249,12 +249,12 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController @bulletin.de_pending! end - # if @bulletin.email_sent == true && @bulletin.is_checked == true && !@bulletin.is_rejected - # send_email_data(@bulletin) + if @bulletin.email_sent == true && @bulletin.is_checked == true && !@bulletin.is_rejected + send_email_data(@bulletin) - # @bulletin.email_sent = false - # @bulletin.save - # end + @bulletin.email_sent = false + @bulletin.save + end # if (params[:bulletin][:is_checked] == "false") # @bulletin.is_rejected = true @@ -403,6 +403,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController :mail_from_app => 'announcement', :mail_from => @user.email, :mail_reply_to => @user.email, + :mail_subject => "#{t("announcement.mail_subject")}:", :mail_subject => "#{t("announcement.mail_subject",:site_title => @site.title)}:#{bulletin.title}", :mail_to => @group_mail.join(','), :mail_content => @mail_content , diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb index 284bf8276..3ceb817ee 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb @@ -22,7 +22,11 @@ <% end %> - <%= t("ad.widget_info_for_ad_image_size", :best_size=> "290px x 230px") %> + + <%= t("ad.widget_info_for_ad_image_size", :best_size=> "290px(w) x 230px(h)") %> +
+ <%= t("announcement.image_upload_size_note", :image_upload_size =>'900kb') %> +
<%= t(:browse) %> <%= f.file_field :image, :id => "input-upload", :class => '', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %> diff --git a/vendor/built_in_modules/announcement/config/locales/en.yml b/vendor/built_in_modules/announcement/config/locales/en.yml index c1068fd29..0f60c46be 100644 --- a/vendor/built_in_modules/announcement/config/locales/en.yml +++ b/vendor/built_in_modules/announcement/config/locales/en.yml @@ -49,11 +49,13 @@ en: email_group_data_2: Postgraduates email_group_data_3: Continuing Ed. Postgraduates email_group_data_4: Other - mail_subject: this is an announcement reminder from【%{site_title}】 + # mail_subject: this is an announcement reminder from【%{site_title}】 + mail_subject: 【北教大公告提醒】 other_mailaddress: Other Email other_mailaddress_note: Divide different email accounts with "," mail_hi: Hi mail_url_view: This email is the reminder of an announcement, please click the link for the details mail_source: Source mail_time: Time + image_upload_size_note: The following recommendations %{image_upload_size} upload size diff --git a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml index 5e736d163..97942f1f3 100644 --- a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml @@ -51,10 +51,12 @@ zh_tw: email_group_data_2: 日間部研究生 email_group_data_3: 進修部研究生 email_group_data_4: 其他 - mail_subject: 來自【%{site_title}】的公告事件提醒 + # mail_subject: 來自【%{site_title}】的公告事件提醒 + mail_subject: 【北教大公告提醒】 mail_hi: 您好 mail_url_view: 此封信件為公告事件提醒,請點選以下連結詳細觀看 mail_source: 來源 mail_time: 時間 + image_upload_size_note: 建議檔案小於%{image_upload_size}