Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fbea06642 | ||
|
|
ce2ec4fc1a | ||
|
|
39386930ef | ||
|
|
ca2b66a210 | ||
|
|
a39d979a54 | ||
|
|
d88b2a4e32 | ||
|
|
a7005c6e8b | ||
|
|
768f03954f | ||
|
|
64b80092f6 | ||
|
|
8e89a1647d | ||
|
|
7121223a4d | ||
|
|
eb7627a28a | ||
|
|
7193e2efb4 | ||
|
|
45d9bbc342 | ||
|
|
5bab384195 | ||
|
|
cfda9365ab | ||
|
|
f38985bb34 | ||
|
|
dc3a44d181 | ||
|
|
592692eefd | ||
|
|
c10800acd7 | ||
|
|
c96646844a | ||
|
|
5efebe2ab2 | ||
|
|
60dce13fd8 | ||
|
|
16aacf3d2a |
No files matched your search
+3
-1
@@ -1,3 +1,5 @@
|
|||||||
= Announcement
|
= Announcement
|
||||||
|
|
||||||
This project rocks and uses MIT-LICENSE.
|
This project rocks and uses MIT-LICENSE.
|
||||||
|
* Tagging
|
||||||
|
* Categories
|
||||||
@@ -25,7 +25,12 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||||||
@statuses = get_statuses
|
@statuses = get_statuses
|
||||||
category_ids = @categories.collect{|t| t.id}
|
category_ids = @categories.collect{|t| t.id}
|
||||||
|
|
||||||
@bulletins = get_sorted_and_filtered("bulletin", :category_id.in => category_ids)
|
if is_manager? or is_admin?
|
||||||
|
@bulletins = get_sorted_and_filtered("bulletin", :category_id.in => category_ids)
|
||||||
|
else
|
||||||
|
@bulletins = get_sorted_and_filtered("bulletin", {:category_id.in => category_ids, :create_user_id => current_user.id})
|
||||||
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
format.js { }
|
format.js { }
|
||||||
@@ -70,7 +75,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||||||
@tags = get_tags
|
@tags = get_tags
|
||||||
is_authorized_sub_manager = @bulletin.category.auth_sub_manager.authorized_user_ids rescue nil
|
is_authorized_sub_manager = @bulletin.category.auth_sub_manager.authorized_user_ids rescue nil
|
||||||
|
|
||||||
if !(is_manager? || is_admin? || is_authorized_sub_manager.include?(current_user.id))
|
if !(is_manager? || is_admin? || (is_authorized_sub_manager.include?(current_user.id) and @bulletin.create_user_id == current_user.id))
|
||||||
|
|
||||||
redirect_to :action => :index
|
redirect_to :action => :index
|
||||||
else
|
else
|
||||||
# @summary_variable = @bulletin.summary_variable
|
# @summary_variable = @bulletin.summary_variable
|
||||||
@@ -141,6 +147,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|
|
||||||
|
|||||||
@@ -12,8 +12,13 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
|||||||
if params[:search_query] == ""
|
if params[:search_query] == ""
|
||||||
@bulletins = get_bulletins_for_index
|
@bulletins = get_bulletins_for_index
|
||||||
else
|
else
|
||||||
@search = Bulletin.tire.search "#{params[:search_query]}"
|
key_string = params[:search_query]
|
||||||
search_result = @search.collect{|result| result.id}
|
keywords = key_string.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/)
|
||||||
|
regex = Regexp.union(keywords.map{|word| Regexp.new(".*"+word+".*", "i")})
|
||||||
|
|
||||||
|
query = ["title","subtitle","text"].map{|f| {f.to_sym => regex} }
|
||||||
|
res = Bulletin.any_of(query)
|
||||||
|
search_result = res.collect{|result| result.id}
|
||||||
|
|
||||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
|
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
|
||||||
end
|
end
|
||||||
@@ -55,7 +60,6 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
@item = Page.find(params[:page_id]) rescue nil
|
@item = Page.find(params[:page_id]) rescue nil
|
||||||
@fb_share = eval(params[:facebook_share]) rescue false
|
|
||||||
if params[:preview] == "true"
|
if params[:preview] == "true"
|
||||||
preview_content
|
preview_content
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -158,5 +166,25 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
|||||||
def bulletins_search_block
|
def bulletins_search_block
|
||||||
@part = PagePart.find params[:part_id]
|
@part = PagePart.find params[:part_id]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def sync_data
|
||||||
|
@create_users = ( params[:dept].blank? or !params[:dept].kind_of?(Array)) ? [] : User.where(:sid.in => params[:dept]).collect{|p| p.id}
|
||||||
|
@page_num = params[:page_num].blank? ? '10' : params[:page_num]
|
||||||
|
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.nin => ['53abbd0b45ef444e6a0001a0','53abbd2045ef444e6a00095d','53abbd0745ef444e6a000001'], :create_user_id.in => @create_users).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||||
|
end
|
||||||
|
|
||||||
|
def show_sync_data
|
||||||
|
@bulletin = Bulletin.all.can_display.where(_id: params[:id]).first
|
||||||
|
if @bulletin and !@bulletin.disable?
|
||||||
|
if @bulletin.enabled_for_lang(I18n.locale.to_s)
|
||||||
|
impressionist(@bulletin)
|
||||||
|
else
|
||||||
|
render :text => "<div class='alert alert-error'>#{t('sys.can_not_display_due_to_no_context')}</div>".html_safe
|
||||||
|
end
|
||||||
|
else
|
||||||
|
render :nothing => true, :status => 403
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
+15
-6
@@ -13,10 +13,10 @@ class Bulletin
|
|||||||
include OrbitModel::TimeFrame
|
include OrbitModel::TimeFrame
|
||||||
include OrbitTag::Taggable
|
include OrbitTag::Taggable
|
||||||
|
|
||||||
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
|
||||||
@@ -44,9 +44,9 @@ class Bulletin
|
|||||||
|
|
||||||
validates :title, :at_least_one => true
|
validates :title, :at_least_one => true
|
||||||
|
|
||||||
def to_indexed_json
|
# def to_indexed_json
|
||||||
self.to_json
|
# self.to_json
|
||||||
end
|
# end
|
||||||
|
|
||||||
# search_in :title, :subtitle, :text
|
# search_in :title, :subtitle, :text
|
||||||
|
|
||||||
@@ -66,6 +66,11 @@ class Bulletin
|
|||||||
def bulletin_category_with_title
|
def bulletin_category_with_title
|
||||||
self.category.title
|
self.category.title
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bulletin_create_dept
|
||||||
|
unit_field = User.get_member_list_attribute_field("staff","unit")
|
||||||
|
User.get_member_list_attribute_value(self.create_user_id,unit_field.id).get_value_by_locale(I18n.locale) rescue nil
|
||||||
|
end
|
||||||
|
|
||||||
def get_bulletin_category
|
def get_bulletin_category
|
||||||
self.category
|
self.category
|
||||||
@@ -158,6 +163,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,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="image_note"><%= t("announcement.image_note")%></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -241,6 +242,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>
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
<% set_default_index do
|
<%
|
||||||
|
|
||||||
|
@unit_field = User.get_member_list_attribute_field("staff","unit")
|
||||||
|
|
||||||
|
set_default_index do
|
||||||
objects @bulletins
|
objects @bulletins
|
||||||
quick_edit_link type: 'edit',
|
quick_edit_link type: 'edit',
|
||||||
link: 'edit_panel_announcement_back_end_bulletin_path'
|
link: 'edit_panel_announcement_back_end_bulletin_path'
|
||||||
@@ -49,6 +53,11 @@
|
|||||||
translation: 'last_modified',
|
translation: 'last_modified',
|
||||||
hide: 'phone',
|
hide: 'phone',
|
||||||
sort: 'last_modified'
|
sort: 'last_modified'
|
||||||
|
field db_field: 'update_user_id',
|
||||||
|
translation: 'announcement.default_widget.bulletin_create_dept',
|
||||||
|
display_option: 'User.get_member_list_attribute_value(object.create_user_id,@unit_field.id).get_value_by_locale(I18n.locale) rescue nil',
|
||||||
|
sort: 'last_modified'
|
||||||
|
|
||||||
filter_field type: 'array',
|
filter_field type: 'array',
|
||||||
values: @statuses,
|
values: @statuses,
|
||||||
translation: 'status'
|
translation: 'status'
|
||||||
|
|||||||
@@ -32,3 +32,4 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<%= paginate( @bulletins, :param_name => :page_main, :params => {:inner => 'false'} ) rescue nil%>
|
||||||
@@ -4,14 +4,13 @@
|
|||||||
<div class="info1">
|
<div class="info1">
|
||||||
<span class="pull-right"><%= dislpay_view_count(@bulletin) %></span>
|
<span class="pull-right"><%= dislpay_view_count(@bulletin) %></span>
|
||||||
<span class="date"><%= display_date_time(@bulletin.postdate) %></span>
|
<span class="date"><%= display_date_time(@bulletin.postdate) %></span>
|
||||||
<% unit = @bulletin.cache_dept[I18n.locale.to_s] rescue nil %>
|
<%
|
||||||
<span><%= link_to unit,panel_announcement_front_end_index_bulletins_by_unit_path(:name=>unit) unless unit.blank? %></span>
|
unit_field = User.get_member_list_attribute_field("staff","unit")
|
||||||
|
unit = User.get_member_list_attribute_value(@bulletin.create_user_id,unit_field.id).get_value_by_locale(I18n.locale) rescue nil
|
||||||
|
%>
|
||||||
|
<span><%= t('announcement.default_widget.bulletin_create_dept') + ": " + unit unless unit.blank? %></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="news_image">
|
|
||||||
<%#= 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 %>
|
|
||||||
</div>
|
|
||||||
<div class="news_paragraph">
|
<div class="news_paragraph">
|
||||||
<%= @bulletin.text.html_safe rescue '' %>
|
<%= @bulletin.text.html_safe rescue '' %>
|
||||||
</div>
|
</div>
|
||||||
@@ -38,20 +37,4 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%#= share_links(@bulletin, 'announcement') %>
|
<%= share_links(@bulletin, 'announcement') %>
|
||||||
<% if @fb_share %>
|
|
||||||
<a href="" target="_blank" class="fb-share-button">
|
|
||||||
<%= image_tag("announcement/fbn.png",:width=>30, :height=>30) %>
|
|
||||||
</a>
|
|
||||||
<script type="text/javascript">
|
|
||||||
(function(){
|
|
||||||
$(".fb-share-button").click(function(){
|
|
||||||
var img = window.location.protocol + "//" + window.location.host + "<%= @bulletin.image.url rescue '' %>",
|
|
||||||
url = "https://www.facebook.com/sharer/sharer.php?s=100&p[title]=<%= @bulletin.title %>&p[images][0]=" + img + "&p[url]="+window.location.href;
|
|
||||||
newwindow = window.open(url,'name','height=500,width=1024');
|
|
||||||
if (window.focus) {newwindow.focus()}
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
<% end %>
|
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
<% # encoding: utf-8 %>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
|
||||||
|
.h1{
|
||||||
|
font: 22px/1.5 'open sans','微軟正黑體',sans-serif;
|
||||||
|
margin: 0 0 10px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.info {
|
||||||
|
background: none repeat scroll 0 0 #FFFFFF;
|
||||||
|
border: 1px solid #DDDDDD;
|
||||||
|
font: 13px/1 'arial',sans-serif;
|
||||||
|
margin: 0 0 20px;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.info span {
|
||||||
|
margin: 0 7px 0 0;
|
||||||
|
border-right: 1px solid #ddd;
|
||||||
|
padding: 0 10px 0 0;
|
||||||
|
}
|
||||||
|
.news_paragraph{
|
||||||
|
margin: 0 0 20px;
|
||||||
|
}
|
||||||
|
.linkAndFile{
|
||||||
|
border-top: 1px solid #CCCCCC;
|
||||||
|
border-left: 1px solid #CCCCCC;
|
||||||
|
border-right: 1px solid #CCCCCC;
|
||||||
|
border-radius: 5px 5px 0 0;
|
||||||
|
clear: both;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 10px 10px 0 10px;
|
||||||
|
}
|
||||||
|
.fb{
|
||||||
|
border-bottom : 1px solid #CCCCCC;
|
||||||
|
border-left: 1px solid #CCCCCC;
|
||||||
|
border-right: 1px solid #CCCCCC;
|
||||||
|
border-radius: 0 0 5px 5px;
|
||||||
|
clear: both;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 5px 10px 5px 10px;
|
||||||
|
}
|
||||||
|
.linkAndFile>div{
|
||||||
|
border-bottom: 1px solid #CCCCCC;
|
||||||
|
display: block;
|
||||||
|
margin: 0 0 5px;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0 0 5px;
|
||||||
|
}
|
||||||
|
.icons-link, .icons-paperclip{
|
||||||
|
float: left;
|
||||||
|
margin: 0 10px 0 0;
|
||||||
|
}
|
||||||
|
.showLink, .showFile {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.showLink a, .showFile a{
|
||||||
|
margin: 0 10px 0 0;
|
||||||
|
}
|
||||||
|
.fb a{
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
}
|
||||||
|
.showLink:before, .showFile:before {
|
||||||
|
content: "●";
|
||||||
|
margin: 0 10px 0 5px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<h1 class="h1"><%= @bulletin.title %></h1>
|
||||||
|
<div class="info">
|
||||||
|
<div class="info1">
|
||||||
|
<span class="category"><%= t('announcement.categories') %> : <%= @bulletin.category.title rescue nil %></span>
|
||||||
|
<span class="date"><%= display_date_time(@bulletin.postdate) %></span>
|
||||||
|
<%
|
||||||
|
unit_field = User.get_member_list_attribute_field("staff","unit")
|
||||||
|
unit = User.get_member_list_attribute_value(@bulletin.create_user_id,unit_field.id).get_value_by_locale(I18n.locale) rescue nil
|
||||||
|
%>
|
||||||
|
<span><%= t('announcement.default_widget.bulletin_create_dept') + ": " + unit unless unit.blank? %></span>
|
||||||
|
<span class="pull-right"><%= dislpay_view_count(@bulletin) %></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="news_paragraph">
|
||||||
|
<%= @bulletin.text.html_safe rescue '' %>
|
||||||
|
</div>
|
||||||
|
<div class="linkAndFile">
|
||||||
|
<% if @bulletin.bulletin_links.size > 0 %>
|
||||||
|
<div>
|
||||||
|
<i class="icons-link"></i>
|
||||||
|
<div class="showLink">
|
||||||
|
<% @bulletin.bulletin_links.each do | blink | %>
|
||||||
|
<%= link_to blink.title, blink.url, :target => '_blank' %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% if @bulletin.bulletin_files.size > 0 %>
|
||||||
|
<div>
|
||||||
|
<i class="icons-paperclip"></i>
|
||||||
|
<div class="showFile">
|
||||||
|
<% @bulletin.bulletin_files.each do | bfile | %>
|
||||||
|
<%= link_to bfile.title, bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= share_links(@bulletin, 'announcement') %>
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
<% # encoding: utf-8 %>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
th {
|
||||||
|
background: #fff;
|
||||||
|
border-bottom: 2px solid #333;
|
||||||
|
padding: 10px 5px;
|
||||||
|
font: 15px/1 '微軟正黑體',sans-serif;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
td {
|
||||||
|
padding: 10px 5px;
|
||||||
|
font: 13px/1.5 'arial',sans-serif;
|
||||||
|
vertical-align: top;
|
||||||
|
text-align: left;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
tr{
|
||||||
|
background: #fafafa
|
||||||
|
}
|
||||||
|
.odd{
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
td a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
td a:hover {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
.pagination{
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
.pagination ul{
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.pagination li:first-child {
|
||||||
|
border-radius: 5px 0 0 5px;
|
||||||
|
}
|
||||||
|
.pagination li {
|
||||||
|
background: none repeat scroll 0 0 #FFFFFF !important;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-right: 0px solid #ccc;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
font: 13px/30px 'open sans',sans-serif !important;
|
||||||
|
padding: 0 10px !important;
|
||||||
|
}
|
||||||
|
.pagination li:last-child {
|
||||||
|
border-radius: 0 5px 5px 0;
|
||||||
|
border-right: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
.pagination li a {
|
||||||
|
color: #333;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.pagination li a:hover {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
// Popup window code
|
||||||
|
function newPopup(url) {
|
||||||
|
popupWindow = window.open(
|
||||||
|
url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<table class="table table-bordered">
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th><%= t('announcement.categories') %></th>
|
||||||
|
<th><%= t('announcement.default_widget.title') %></th>
|
||||||
|
<th><%= t('announcement.default_widget.postdate') %></th>
|
||||||
|
<th><%= t('announcement.default_widget.bulletin_create_dept') %></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<% @bulletins.each_with_index do |post, i| %>
|
||||||
|
<tr <%= (i % 2 == 0) ? 'class=odd' : '' %>>
|
||||||
|
<td><%= post.category.title rescue nil %></td>
|
||||||
|
<td><a href="JavaScript:newPopup('<%= panel_announcement_widget_show_sync_data_path(post) %>');"><%= post.title %></a></td>
|
||||||
|
<td><%= display_date(post.postdate) %></td>
|
||||||
|
<%
|
||||||
|
unit_field = User.get_member_list_attribute_field("staff","unit")
|
||||||
|
unit = User.get_member_list_attribute_value(post.create_user_id,unit_field.id).get_value_by_locale(I18n.locale) rescue nil
|
||||||
|
%>
|
||||||
|
<td><%= unit %></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<%= paginate( @bulletins, :param_name => :page_main, :params => {:inner => 'false'} ) rescue nil if params[:show_page] == 'true' %>
|
||||||
|
|
||||||
|
|
||||||
@@ -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,10 +14,11 @@ 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
|
||||||
|
bulletin_create_dept: Unit
|
||||||
editing_announcement: Edit Announcement
|
editing_announcement: Edit Announcement
|
||||||
editing_announcement_category: Edit Category
|
editing_announcement_category: Edit Category
|
||||||
file: Attachment
|
file: Attachment
|
||||||
@@ -25,6 +27,8 @@ en:
|
|||||||
frontend:
|
frontend:
|
||||||
bulletins: Announcement front-end
|
bulletins: Announcement front-end
|
||||||
search_result: Search result
|
search_result: Search result
|
||||||
|
image: Cover image
|
||||||
|
image_note: The image will not show in content
|
||||||
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,10 +14,11 @@ 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: 標題
|
||||||
|
bulletin_create_dept: 單位
|
||||||
editing_announcement: 編輯類別
|
editing_announcement: 編輯類別
|
||||||
editing_announcement_category: 編輯類別
|
editing_announcement_category: 編輯類別
|
||||||
error:
|
error:
|
||||||
@@ -27,6 +29,8 @@ zh_tw:
|
|||||||
frontend:
|
frontend:
|
||||||
bulletins: 公告前台
|
bulletins: 公告前台
|
||||||
search_result: 搜尋結果頁
|
search_result: 搜尋結果頁
|
||||||
|
image: 封面圖片
|
||||||
|
image_note: 此處上傳的圖片不會在公告內文出現
|
||||||
link_name: 連結名稱
|
link_name: 連結名稱
|
||||||
new_bulletin_category: 新增公告類別
|
new_bulletin_category: 新增公告類別
|
||||||
picture: 刊頭圖片
|
picture: 刊頭圖片
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ Rails.application.routes.draw do
|
|||||||
match "reload_web_links" => "bulletins#reload_web_links"
|
match "reload_web_links" => "bulletins#reload_web_links"
|
||||||
match "bulletins_side_bar" => "bulletins#bulletins_side_bar"
|
match "bulletins_side_bar" => "bulletins#bulletins_side_bar"
|
||||||
match "bulletins_search_block" => "bulletins#bulletins_search_block"
|
match "bulletins_search_block" => "bulletins#bulletins_search_block"
|
||||||
|
match "sync_data" => "bulletins#sync_data",:as => :sync_data,:via => :get
|
||||||
|
match "show_sync_data/:id" => "bulletins#show_sync_data",:as => :show_sync_data,:via => :get
|
||||||
end
|
end
|
||||||
namespace :api do
|
namespace :api do
|
||||||
get "categories_tags.json" => "bulletins#get_categories_tags"
|
get "categories_tags.json" => "bulletins#get_categories_tags"
|
||||||
|
|||||||
+1
-1
@@ -38,10 +38,10 @@ module Announcement
|
|||||||
enable ["typeA", "typeB_style3", "typeC"]
|
enable ["typeA", "typeB_style3", "typeC"]
|
||||||
image :image
|
image :image
|
||||||
field :postdate
|
field :postdate
|
||||||
facebook_enabled false
|
|
||||||
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
|
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
|
||||||
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:category,:id]}}
|
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:category,:id]}}
|
||||||
field :subtitle
|
field :subtitle
|
||||||
|
field :bulletin_create_dept
|
||||||
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user