Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88e7bdea61 | ||
|
|
a7005c6e8b | ||
|
|
8e89a1647d | ||
|
|
7121223a4d | ||
|
|
eb7627a28a |
No files matched your search
@@ -141,6 +141,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||||||
|
|
||||||
params[:bulletin][:email_user_ids] = params[:bulletin][:email_user_ids].uniq
|
params[:bulletin][:email_user_ids] = params[:bulletin][:email_user_ids].uniq
|
||||||
params[:bulletin][:email_user_ids].delete('')
|
params[:bulletin][:email_user_ids].delete('')
|
||||||
|
|
||||||
|
params[:bulletin][:update_user_id] = current_user.id
|
||||||
|
|
||||||
delete_out_invalid_date_from_params
|
delete_out_invalid_date_from_params
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|||||||
@@ -146,7 +146,15 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
|||||||
|
|
||||||
@selected_tag = Tag.find(params[:tag_id]).first
|
@selected_tag = Tag.find(params[:tag_id]).first
|
||||||
@ModuleApp = ModuleApp.first(:conditions => {:key=>'web_resource'})
|
@ModuleApp = ModuleApp.first(:conditions => {:key=>'web_resource'})
|
||||||
@link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :module_tag_id => @ModuleApp.id})
|
@link_module_tag = ModuleTag.first(:conditions => {:name => @selected_tag.name, :module_app_id => @ModuleApp.id})
|
||||||
|
# @link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :tag_lease_id => @ModuleApp.id})
|
||||||
|
|
||||||
|
if !@link_module_tag.blank?
|
||||||
|
@link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :tag_lease_id => @link_module_tag.id})
|
||||||
|
else
|
||||||
|
@link_selected_tag = @link_module_tag
|
||||||
|
end
|
||||||
|
|
||||||
@web_links = WebLink.where(:tagged_ids => @link_selected_tag.id.to_s, :is_hidden => false).desc(:is_top,:created_at).available_for_lang(I18n.locale).page(params[:page]).per(@page_num) rescue nil
|
@web_links = WebLink.where(:tagged_ids => @link_selected_tag.id.to_s, :is_hidden => false).desc(:is_top,:created_at).available_for_lang(I18n.locale).page(params[:page]).per(@page_num) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,13 @@ class Bulletin
|
|||||||
# include Tire::Model::Search
|
# include Tire::Model::Search
|
||||||
# include Tire::Model::Callbacks
|
# include Tire::Model::Callbacks
|
||||||
|
|
||||||
is_impressionable :counter_cache => { :column_name => :view_count }
|
is_impressionable
|
||||||
|
|
||||||
field :title, localize: true
|
field :title, localize: true
|
||||||
field :subtitle, localize: true
|
field :subtitle, localize: true
|
||||||
field :text, localize: true
|
field :text, localize: true
|
||||||
|
|
||||||
|
field :image_description, localize: true
|
||||||
|
|
||||||
field :create_user_id
|
field :create_user_id
|
||||||
field :update_user_id, :class_name => "User"
|
field :update_user_id, :class_name => "User"
|
||||||
@@ -158,6 +160,10 @@ class Bulletin
|
|||||||
User.find(self.email_user_ids) rescue []
|
User.find(self.email_user_ids) rescue []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def view_count
|
||||||
|
Impression.where(:impressionable_id=>self.id).count
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
# def clean_values
|
# def clean_values
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
|
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#imageupload" data-toggle="tab"><%= t(:image) %></a>
|
<a href="#imageupload" data-toggle="tab"><%= t("announcement.image") %></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#mail-group" data-toggle="tab"><%= t('announcement.email_reminder')%></a>
|
<a href="#mail-group" data-toggle="tab"><%= t('announcement.email_reminder')%></a>
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
|
|
||||||
<!-- Images Upload -->
|
<!-- Images Upload -->
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t(:image) %></label>
|
<label class="control-label muted"><%= t("announcement.image") %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @bulletin.image.file %>" data-provides="fileupload">
|
<div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @bulletin.image.file %>" data-provides="fileupload">
|
||||||
<div class="fileupload-new thumbnail pull-left">
|
<div class="fileupload-new thumbnail pull-left">
|
||||||
@@ -139,6 +139,32 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Image Description -->
|
||||||
|
<div class="control-group">
|
||||||
|
<%= f.label t("announcement.image_description"),{:class=>"control-label muted", :func=>"field_label"} %>
|
||||||
|
<div class="controls add-input">
|
||||||
|
<div class="add-target">
|
||||||
|
<div class="input-append">
|
||||||
|
<div class="tab-content">
|
||||||
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
|
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="image_description_<%= locale %>">
|
||||||
|
<%= f.fields_for :image_description_translations do |f| %>
|
||||||
|
<%= f.text_field locale, :value => (@bulletin.image_description_translations[locale] rescue nil), :placeholder=>"#{t("announcement.image_description")}" %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group" data-toggle="buttons-radio">
|
||||||
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
|
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#image_description_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -241,6 +267,10 @@
|
|||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls add-input"><%= t('announcement.append_note')%></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Link -->
|
<!-- Link -->
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t(:link) %></label>
|
<label class="control-label muted"><%= t(:link) %></label>
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="news_image">
|
<div class="news_image">
|
||||||
<%#= image_tag(@bulletin.image.url, :size => "320x240") if @bulletin.image.file %>
|
<%#= image_tag(@bulletin.image.url, :size => "320x240") if @bulletin.image.file %>
|
||||||
<%= link_to image_tag(@bulletin.image.url, :size => "320x240"), @bulletin.image.url, {:target => '_blank', :title => @bulletin.image_identifier} if @bulletin.image.file %>
|
<%= link_to image_tag(@bulletin.image.url), @bulletin.image.url, {:target => '_blank', :title => @bulletin.image_identifier} if @bulletin.image.file %>
|
||||||
|
<span class="image_description"><%= @bulletin.image_description unless @bulletin.image_description.blank? %></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="news_paragraph">
|
<div class="news_paragraph">
|
||||||
<%= @bulletin.text.html_safe rescue '' %>
|
<%= @bulletin.text.html_safe rescue '' %>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ en:
|
|||||||
add_new: Add New
|
add_new: Add New
|
||||||
all_articles: All Articles
|
all_articles: All Articles
|
||||||
announcement: Announcement
|
announcement: Announcement
|
||||||
|
append_note: Suggest to input underside Link and File's annotation to show correct info in frontend
|
||||||
approval_setting: Approval Setting
|
approval_setting: Approval Setting
|
||||||
approve_bulletin_fail: Approval Fail
|
approve_bulletin_fail: Approval Fail
|
||||||
approve_bulletin_success: Approve Successfully
|
approve_bulletin_success: Approve Successfully
|
||||||
@@ -13,7 +14,7 @@ en:
|
|||||||
create_bulletin_category_success: Create Category Successfully
|
create_bulletin_category_success: Create Category Successfully
|
||||||
date: Announcement Date
|
date: Announcement Date
|
||||||
default_widget:
|
default_widget:
|
||||||
bulletin_category_with_title: Bulletin Category with Title
|
bulletin_category_with_title: Category
|
||||||
postdate: Post Date
|
postdate: Post Date
|
||||||
subtitle: Subtitle
|
subtitle: Subtitle
|
||||||
title: Title
|
title: Title
|
||||||
@@ -25,6 +26,8 @@ en:
|
|||||||
frontend:
|
frontend:
|
||||||
bulletins: Announcement front-end
|
bulletins: Announcement front-end
|
||||||
search_result: Search result
|
search_result: Search result
|
||||||
|
image: Cover image
|
||||||
|
image_description: Cover Image Description
|
||||||
link_name: Link Name
|
link_name: Link Name
|
||||||
new_bulletin_category: New Bulletin Category
|
new_bulletin_category: New Bulletin Category
|
||||||
picture: Cover Picture
|
picture: Cover Picture
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ zh_tw:
|
|||||||
add_new: 新建
|
add_new: 新建
|
||||||
all_articles: 文章列表
|
all_articles: 文章列表
|
||||||
announcement: 公告
|
announcement: 公告
|
||||||
|
append_note: 以下之附加連結與檔案,為使前台顯示名稱,建議您輸入註解。
|
||||||
approval_setting: 審核設定
|
approval_setting: 審核設定
|
||||||
approve_bulletin_fail: 審核失敗
|
approve_bulletin_fail: 審核失敗
|
||||||
approve_bulletin_success: 審核成功
|
approve_bulletin_success: 審核成功
|
||||||
@@ -13,7 +14,7 @@ zh_tw:
|
|||||||
create_bulletin_category_success: 建立類別成功
|
create_bulletin_category_success: 建立類別成功
|
||||||
date: 起迄日期
|
date: 起迄日期
|
||||||
default_widget:
|
default_widget:
|
||||||
bulletin_category_with_title: 公告類別及標題
|
bulletin_category_with_title: 類別
|
||||||
postdate: 張貼日期
|
postdate: 張貼日期
|
||||||
subtitle: 副標題
|
subtitle: 副標題
|
||||||
title: 標題
|
title: 標題
|
||||||
@@ -27,6 +28,8 @@ zh_tw:
|
|||||||
frontend:
|
frontend:
|
||||||
bulletins: 公告前台
|
bulletins: 公告前台
|
||||||
search_result: 搜尋結果頁
|
search_result: 搜尋結果頁
|
||||||
|
image: 封面圖片
|
||||||
|
image_description: 封面圖片說明
|
||||||
link_name: 連結名稱
|
link_name: 連結名稱
|
||||||
new_bulletin_category: 新增公告類別
|
new_bulletin_category: 新增公告類別
|
||||||
picture: 刊頭圖片
|
picture: 刊頭圖片
|
||||||
|
|||||||
Reference in new issue
Block a user