This commit is contained in:
BoHung Chiu 2023-09-24 15:19:52 +08:00
parent 9bb9c5959b
commit a810260e14
6 changed files with 36 additions and 15 deletions

View File

@ -25,6 +25,7 @@ module Admin::NewsHelper
request.protocol+(request.host_with_port+ann_page.url+'/'+news_bulletin.to_param).gsub('//','/') rescue "/" request.protocol+(request.host_with_port+ann_page.url+'/'+news_bulletin.to_param).gsub('//','/') rescue "/"
end end
def send_rejection_email(news) def send_rejection_email(news)
user = User.find(news.create_user_id) rescue nil user = User.find(news.create_user_id) rescue nil
if !user.nil? if !user.nil?

View File

@ -161,8 +161,8 @@
</div> </div>
</div> </div>
<div class="controls pull-left"> <div class="controls pull-left">
<input type="checkbox" id="user_default_image" /> <input type="checkbox" id="use_default_image" />
<label class="checkbox inline muted"> <%= t('news_bulletin.user_default_image')%></label> <label class="checkbox inline muted"> <%= t('news_bulletin.use_default_image')%></label>
</div> </div>
</div> </div>
<% @site_in_use_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
@ -482,7 +482,7 @@
var validate_image = function(){ var validate_image = function(){
var validate = true, var validate = true,
file_size = 0; file_size = 0;
if($("#user_default_image").prop("checked")){ if($("#use_default_image").prop("checked")){
return validate; return validate;
}else{ }else{
fileupload_alert = $("#news_bulletin_image").parent().parent().parent().find('.fileupload-alert'); fileupload_alert = $("#news_bulletin_image").parent().parent().parent().find('.fileupload-alert');
@ -496,7 +496,7 @@
} }
} }
if(!validate){ if(!validate){
alert("您還沒有上傳封面圖片"); alert("<%=t('news.cover_image_not_yet_upload')%>");
fileupload_alert.text("<%= t("news.file_size")%>: "+file_size.toFixed(1)+"MB , <%= t("news.file_size_limit") %>: "+fileupload_size_limit_mb+"MB"); fileupload_alert.text("<%= t("news.file_size")%>: "+file_size.toFixed(1)+"MB , <%= t("news.file_size_limit") %>: "+fileupload_size_limit_mb+"MB");
fileupload_alert.show(); fileupload_alert.show();
$("#basic").removeClass("active"); $("#basic").removeClass("active");

View File

@ -103,7 +103,7 @@
<% Unit.where({:id => b.unit_id}).each do |u| %> <% Unit.where({:id => b.unit_id}).each do |u| %>
<%= u.name %> <%= u.name %>
<% end %> <% end %>
<% Department.where({:id => b.department}).each do |d| %> <% Department.where({:id => b.department_id}).each do |d| %>
-<%= d.name %> -<%= d.name %>
<% end %> <% end %>
</td> </td>

View File

@ -1,6 +1,27 @@
en: en:
module_name:
news: News
news_bulletin:
use_default_image: Use Default Image
all_category: All Category
campus_news: Campus News
category: Category
create_news_bulletin_category_success: News Category create successfully
create_news_bulletin_success: News create successfully
department: Department
editing_news: Edit News
editing_news_category: Edit Category
error:
no_avilb_cate_for_posting: News must have a category to send, please contact the administrator
hot: Headlines
news_bulletins: News
new_news_category: Create News Category
search: Search News
update_news_bulletin_category_success: News Category update successfully
update_news_bulletin_success: News update successfully
ut_prompt: Please choose department
news: news:
cover_image_not_yet_upload: The cover image has not been uploaded yet.
admins: Unit Setting admins: Unit Setting
unit: Department unit: Department
category: Category category: Category

View File

@ -1,10 +1,8 @@
zh_tw: zh_tw:
module_name: module_name:
news: 新聞 news: 新聞
news_bulletin: news_bulletin:
user_default_image: 或使用預設圖片 use_default_image: 或使用預設圖片
all_category: 全部類別 all_category: 全部類別
campus_news: 校園新聞 campus_news: 校園新聞
category: 分類 category: 分類
@ -23,6 +21,7 @@ zh_tw:
update_news_bulletin_success: 新聞已成功更新 update_news_bulletin_success: 新聞已成功更新
ut_prompt: 請選擇單位 ut_prompt: 請選擇單位
news: news:
cover_image_not_yet_upload: 您還沒有上傳封面圖片
unit: 單位 unit: 單位
category: 分類 category: 分類
department: 系所 department: 系所

View File

@ -30,11 +30,6 @@ module News
:priority=>2, :priority=>2,
:active_for_action=>{'admin/news'=>'news'}, :active_for_action=>{'admin/news'=>'news'},
:available_for => 'sub_managers' :available_for => 'sub_managers'
context_link 'news.admins',
:link_path=>"admin_news_admins_path" ,
:priority=>4,
:active_for_action=>{'admin/news'=>'admins'},
:available_for => 'managers'
context_link 'categories', context_link 'categories',
:link_path=>"admin_module_app_categories_path" , :link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'news').id}", :link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'news').id}",
@ -49,6 +44,11 @@ module News
:active_for_action=>{'admin/news'=>'tags'}, :active_for_action=>{'admin/news'=>'tags'},
:active_for_tag => 'News', :active_for_tag => 'News',
:available_for => 'managers' :available_for => 'managers'
context_link 'news.admins',
:link_path=>"admin_news_admins_path" ,
:priority=>6,
:active_for_action=>{'admin/news'=>'admins'},
:available_for => 'managers'
end end
end end