Merge branch 'design_team' into ldap
Conflicts: config/locales/zh_tw.yml vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
This commit is contained in:
commit
2b9190a49e
101 files changed
+1269
-689
No files matched your search
+8
@@ -1,7 +1,15 @@
|
||||
class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendController
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
include AdminHelper
|
||||
# layout 'admin'
|
||||
def preview_and_approve
|
||||
@bulletin = Bulletin.find params[:bulletin_id]
|
||||
end
|
||||
|
||||
def approve
|
||||
|
||||
end
|
||||
|
||||
def setting
|
||||
@bulletin_categorys = BulletinCategory.all
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController
|
||||
layout 'new_admin'
|
||||
|
||||
before_filter :for_app_manager,:except => [:index]
|
||||
|
||||
def index
|
||||
@bulletin_categorys = BulletinCategory.all
|
||||
|
||||
+19
-92
@@ -3,8 +3,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
layout 'new_admin'
|
||||
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
|
||||
# before_filter :for_admin_only,:only => [:]
|
||||
# before_filter :for_app_manager,:only => [:index,:show,]
|
||||
before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_bulletins]
|
||||
def index
|
||||
# @bulletins = Bulletin.all
|
||||
# @bulletins = Bulletin.desc("postdate desc")
|
||||
@@ -44,6 +45,10 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
@bulletin_file = BulletinFile.new
|
||||
@file_url = panel_announcement_back_end_bulletins_path
|
||||
|
||||
@bulletins.delete_if{ |bulletin|
|
||||
bulletin.is_pending == true && (!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || bulletin.create_user_id!=current_user.id)
|
||||
}
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.js { }
|
||||
@@ -81,14 +86,17 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
|
||||
# @bulletin.bulletin_files.build
|
||||
# @bulletin.bulletin_files.new
|
||||
|
||||
get_categorys
|
||||
get_tags
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render :xml => @bulletin }
|
||||
end
|
||||
if get_categorys.empty?
|
||||
flash[:alert] = t("announcement.error.no_avilb_cate_for_posting")
|
||||
redirect_to :action => :index
|
||||
else
|
||||
get_tags
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render :xml => @bulletin }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# GET /bulletins/1/edit
|
||||
@@ -312,10 +320,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
|
||||
def get_categorys(id = nil)
|
||||
@bulletin_categorys = []
|
||||
@unit_list_for_anc = UnitListForAnc.all
|
||||
if(is_manager? || is_admin?)
|
||||
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
|
||||
elsif is_sub_manager?
|
||||
@bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit_new')
|
||||
@bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -323,87 +332,5 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
module_app = ModuleApp.first(:conditions => {:key => 'announcement'})
|
||||
@tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc)
|
||||
end
|
||||
|
||||
def get_sorted_and_filtered_bulletins
|
||||
bulletins = Bulletin.all
|
||||
case params[:sort]
|
||||
when 'postdate', 'deadline'
|
||||
bulletins = bulletins.order_by([params[:sort], params[:direction]])
|
||||
when 'category'
|
||||
category_ids = bulletins.distinct(:bulletin_category_id)
|
||||
categories = BulletinCategory.find(category_ids) rescue nil
|
||||
if categories
|
||||
h = Hash.new
|
||||
categories.each { |category| h[category.i18n_variable[I18n.locale]] = category.id }
|
||||
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
|
||||
sorted_categorys = sorted.collect {|a| bulletins.where(:bulletin_category_id => a[1]).entries }
|
||||
bulletins = sorted_categorys.flatten!
|
||||
end
|
||||
when 'title'
|
||||
h = Array.new
|
||||
bulletins.each { |bulletin| h << [bulletin.title[I18n.locale].downcase, bulletin] }
|
||||
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
|
||||
bulletins = sorted.collect {|a| a[1] }
|
||||
when 'status'
|
||||
bulletins = bulletins.order_by(:is_top, params[:direction]).order_by(:is_hot, params[:direction]).order_by(:is_hidden, params[:direction]).order_by(:is_pending, params[:direction]).order_by(:is_checked, params[:direction]).order_by(:is_rejected, params[:direction])
|
||||
when 'update_user_id'
|
||||
user_ids = bulletins.distinct(:update_user_id)
|
||||
users = User.find(user_ids) rescue nil
|
||||
if users
|
||||
h = Array.new
|
||||
users.each { |user| h << [user.name, user.id] }
|
||||
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
|
||||
sorted_users = sorted.collect {|a| bulletins.where(:update_user_id => a[1]).entries }
|
||||
bulletins = sorted_users.flatten
|
||||
end
|
||||
when 'tags'
|
||||
a = Array.new
|
||||
AnnouncementTag.all.order_by(I18n.locale, params[:direction]).each { |tag| a << tag.bulletins }
|
||||
a.flatten!
|
||||
a.uniq!
|
||||
tmp = Array.new
|
||||
bulletins.where(:tag_ids => []).each { |bulletin| tmp << [bulletin.title[I18n.locale].downcase, bulletin] }
|
||||
sorted = params[:direction].eql?('asc') ? tmp.sort : tmp.sort.reverse!
|
||||
sorted_titles = sorted.collect {|a| a[1] }
|
||||
a = params[:direction].eql?('asc') ? (sorted_titles + a) : (a + sorted_titles)
|
||||
bulletins = a.flatten
|
||||
end
|
||||
if @filter
|
||||
@filter.each do |key, value|
|
||||
case key
|
||||
when 'status'
|
||||
a = Array.new
|
||||
bulletins.each do |bulletin|
|
||||
value.each do |v|
|
||||
case v
|
||||
when 'pending'
|
||||
a << bulletin if bulletin.is_checked.nil?
|
||||
when 'rejected'
|
||||
a << bulletin if bulletin.is_checked.eql?(false)
|
||||
else
|
||||
a << bulletin if bulletin[v]
|
||||
end
|
||||
end
|
||||
end
|
||||
bulletins = a.uniq
|
||||
when 'categories'
|
||||
a = Array.new
|
||||
bulletins.each do |bulletin|
|
||||
a << bulletin if value.include?(bulletin.bulletin_category.id.to_s)
|
||||
end
|
||||
bulletins = a.uniq
|
||||
when 'tags'
|
||||
a = Array.new
|
||||
bulletins.each do |bulletin|
|
||||
bulletin.tags.each do |tag|
|
||||
a << bulletin if value.include?(tag.id.to_s)
|
||||
end
|
||||
end
|
||||
bulletins = a.uniq
|
||||
end if value.size > 0
|
||||
end
|
||||
end
|
||||
Kaminari.paginate_array(bulletins).page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
end
|
||||
+12
-2
@@ -25,10 +25,20 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def show
|
||||
@bulletin = Bulletin.can_display.where(_id: params[:id]).first
|
||||
get_categorys
|
||||
if params[:preview] == "true"
|
||||
preview_content
|
||||
else
|
||||
@bulletin = Bulletin.can_display.where(_id: params[:id]).first
|
||||
get_categorys
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def preview_content
|
||||
@bulletin = Bulletin.find params[:id]
|
||||
get_categorys
|
||||
render :show
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ module Panel::Announcement::BackEnd::BulletinsHelper
|
||||
|
||||
def show_approval_link(bulletin)
|
||||
by_bulletin = (!bulletin.is_expired? and !bulletin.is_checked?)
|
||||
by_user = bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?
|
||||
by_user = (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?)
|
||||
by_bulletin and by_user
|
||||
end
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ class Bulletin
|
||||
mount_uploader :image, ImageUploader
|
||||
|
||||
belongs_to :bulletin_category
|
||||
belongs_to :unit_list_for_anc
|
||||
|
||||
# embeds_many :bulletin_links, :cascade_callbacks => true
|
||||
# embeds_many :bulletin_files, :cascade_callbacks => true
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
class UnitListForAnc
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :order
|
||||
field :ut_code
|
||||
field :up_ut_code
|
||||
|
||||
has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true
|
||||
|
||||
|
||||
end
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
<% if bulletin -%>
|
||||
|
||||
<div class="modal hide fade in banner-preview" id="bulletin-<%=bulletin.id%>">
|
||||
<div class="modal-header">
|
||||
<a class="close" data-dismiss="modal">×</a>
|
||||
<h3><%= t("modal.preview") %></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="bulletin_slideshow">
|
||||
<iframe src=<%= panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id ,:preview=>true) %> style="width:1024px;height:300px" >
|
||||
|
||||
</iframe>
|
||||
|
||||
<%# preview_block_ad_images_helper(bulletin).each do |ad_image| -%>
|
||||
<%#= image_tag ad_image.file,:alt => (ad_image.title[locale] || " "),:time_to_next => bulletin.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || bulletin.context || " ")) %>
|
||||
<%# end -%>
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<%= form_for bulletin, :url => panel_announcement_back_end_bulletin_path(bulletin), :html => {:class => 'clear'} do |f| %>
|
||||
<%= f.label :approval_stat, t('announcement.bulletin.approval_stat') %>
|
||||
<%= content_tag :label,:class => "radio inline" do -%>
|
||||
<%= f.radio_button :is_checked, true , {:class => 'privacy'} %>
|
||||
<%= t('announcement.bulletin.approval_pass') %>
|
||||
<% end -%>
|
||||
<%= content_tag :label,:class => "radio inline" do -%>
|
||||
<%= f.radio_button :is_checked, false, (!@bulletin.is_checked ? {:checked => true, :class => 'privacy'} : {})%>
|
||||
<%= t('announcement.bulletin.approval_not_pass') %>
|
||||
<% end -%>
|
||||
|
||||
<%= label :is_checked_false, t('announcement.bulletin.approval_not_pass_reason') %>
|
||||
<%= f.text_field :not_checked_reason %>
|
||||
<%= f.submit t('announcement.bulletin.submit_approval'),:class=>"btn"%>
|
||||
<% end %>
|
||||
|
||||
<a href="#" class="btn" data-dismiss="modal"><%= t("modal.close") %></a>
|
||||
</div>
|
||||
<div>
|
||||
<script type="text/javascript" src="/static/kernel.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
// $("#bulletin-<%#=bulletin.title.dehumanize%>").on("show", function () {
|
||||
// $("#bulletin-<%#=bulletin.title.dehumanize%>").find(".bulletin_slideshow").cycle({delay: -1000, fx: "<%#= bulletin.ad_fx.nil?? "fade": bulletin.ad_fx %>", timeoutFn: getTimeout });
|
||||
// });
|
||||
$(".modal").on("hidden", function () {
|
||||
$("#show_preview").remove();
|
||||
});
|
||||
|
||||
$("iframe").load(function(){
|
||||
// Get the body element
|
||||
var frameBody = $("iframe").contents().find("body");
|
||||
|
||||
// Get all links inside the BODY tag
|
||||
$('a', frameBody).click(function(e){
|
||||
//Disable all default actions
|
||||
e.preventDefault();
|
||||
});
|
||||
$('input', frameBody).attr("disabled", true);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<% end -%>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
$('#show_preview').html("<%= escape_javascript(render(:partial => 'modal_approve',:locals => {:bulletin => @bulletin})) %>");
|
||||
var start_modal_with_id = "bulletin-<%=@bulletin.id%>";
|
||||
$("#"+start_modal_with_id).css("width","1050px");
|
||||
$("#"+start_modal_with_id).css("height","768px");
|
||||
$("#"+start_modal_with_id).css("margin","-270px 0 0 -550px");
|
||||
+7
-4
@@ -4,10 +4,13 @@
|
||||
<%= bulletin_category.key %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t('bulletin_category.edit'), edit_panel_announcement_back_end_bulletin_category_path(bulletin_category), :remote => true %></li>
|
||||
<li><%= show_submit_permission_link(bulletin_category) %></li>
|
||||
<li><%= link_to t('bulletin_category.delete'), panel_announcement_back_end_bulletin_category_path(bulletin_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
|
||||
<%if is_manager? || is_admin? %>
|
||||
<li><%= show_submit_permission_link(bulletin_category) %></li>
|
||||
<% end %>
|
||||
<% if is_admin?%>
|
||||
<li><%= link_to t('bulletin_category.edit'), edit_panel_announcement_back_end_bulletin_category_path(bulletin_category), :remote => true %></li>
|
||||
<li><%= link_to t('bulletin_category.delete'), panel_announcement_back_end_bulletin_category_path(bulletin_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="form"><%= render :partial => "form" %></div>
|
||||
<div id="form"><%= render :partial => "form" if is_manager?%></div>
|
||||
|
||||
|
||||
|
||||
+28
-19
@@ -1,5 +1,9 @@
|
||||
<tr id="<%= dom_id bulletin %>" class="with_action">
|
||||
<td><%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %></td>
|
||||
<td>
|
||||
<% if (bulletin.create_user_id == current_user.id) || is_manager? %>
|
||||
<%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %>
|
||||
<% end -%>
|
||||
</td>
|
||||
<td>
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
@@ -27,27 +31,32 @@
|
||||
<td><%= bulletin.bulletin_category.i18n_variable[I18n.locale] %></td>
|
||||
<td>
|
||||
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
|
||||
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<% if current_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
|
||||
<li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" id="menu1">
|
||||
<li><%= link_to t(:basic), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'basic'), :remote => true %></li>
|
||||
<li><%= link_to t(:picture), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'picture'), :remote => true %></li>
|
||||
<li><%= link_to t(:tags), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'tags'), :remote => true %></li>
|
||||
<li><%= link_to t(:link), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'links'), :remote => true %></li>
|
||||
<li><%= link_to t(:file), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<%#= debugger %>
|
||||
<%#= a=1 %>
|
||||
<% if show_approval_link(bulletin) %>
|
||||
<li><%= link_to t('announcement.bulletin.approval'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li><%#= #TODO add ancher so user can quick access into that part %>
|
||||
<% end %>
|
||||
<% if (bulletin.create_user_id == current_user.id) || is_manager? %>
|
||||
|
||||
<% if current_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
|
||||
<li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" id="menu1">
|
||||
<li><%= link_to t(:basic), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'basic'), :remote => true %></li>
|
||||
<li><%= link_to t(:picture), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'picture'), :remote => true %></li>
|
||||
<li><%= link_to t(:tags), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'tags'), :remote => true %></li>
|
||||
<li><%= link_to t(:link), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'links'), :remote => true %></li>
|
||||
<li><%= link_to t(:file), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<%#= debugger %>
|
||||
<%#= a=1 %>
|
||||
|
||||
<% end %>
|
||||
<li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
<% end -%>
|
||||
<% if show_approval_link(bulletin) %>
|
||||
<li><%= link_to t('announcement.bulletin.approval'), panel_announcement_back_end_bulletin_approval_preview_path(bulletin),:class => 'preview_trigger' %></li><%#= #TODO add ancher so user can quick access into that part %>
|
||||
<% end %>
|
||||
<li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
Vendored
+5
-24
@@ -105,28 +105,6 @@
|
||||
<a class="action"><i title="A" class="icon-exclamation-sign icon-white tip"></i></a>
|
||||
</div>
|
||||
|
||||
<h3 class="widget-title"><i class="icons-link icons-white"></i>Audit</h3>
|
||||
<div class="widget-content">
|
||||
|
||||
<% if is_manager? || @bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || current_user.admin? %>
|
||||
<div class="controls">
|
||||
<%= f.label :approval_stat, t('announcement.bulletin.approval_stat') %>
|
||||
<%= content_tag :label,:class => "radio inline" do -%>
|
||||
<%= f.radio_button :is_checked, true , {:class => 'privacy'} %>
|
||||
<%= t('announcement.bulletin.approval_pass') %>
|
||||
<% end -%>
|
||||
<%= content_tag :label,:class => "radio inline" do -%>
|
||||
<%= f.radio_button :is_checked, false, (!@bulletin.is_checked ? {:checked => true, :class => 'privacy'} : {})%>
|
||||
<%= t('announcement.bulletin.approval_not_pass') %>
|
||||
<% end -%>
|
||||
<div class="select-role">
|
||||
<%= label :is_checked_false, t('announcement.bulletin.approval_not_pass_reason') %>
|
||||
<%= f.text_field :not_checked_reason %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.admin? %>
|
||||
<%= f.hidden_field :is_checked,:value => true%>
|
||||
@@ -139,13 +117,16 @@
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content" class="clear">
|
||||
|
||||
<%= f.label :unit_list_for_anc%>
|
||||
<%= f.select :unit_list_for_anc_id,@unit_list_for_anc.collect{|t| [ t.title[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
|
||||
|
||||
<%= f.label :category %>
|
||||
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<%# @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<% site_valid_locales_default_head.each_with_index do |locale, i| %>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? " class='active'" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -153,7 +134,7 @@
|
||||
<div class="tab-content">
|
||||
|
||||
<%# @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<% site_valid_locales_default_head.each_with_index do |locale, i| %>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
|
||||
|
||||
Vendored
+7
-6
@@ -5,8 +5,11 @@
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
<div id="bulletin_pagination" class="paginationFixed">
|
||||
<%= paginate @bulletins, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]} %>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_announcement_back_end_bulletin_path, :class => 'btn btn-primary pull-right' %>
|
||||
<div id="bulletin_pagination" class="paginationFixed">
|
||||
<%= paginate @bulletins, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="bulletin_link_qe">
|
||||
@@ -14,12 +17,10 @@
|
||||
<%= render :partial => "bulletin_link_qe" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_announcement_back_end_bulletin_path, :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "bulletin_form" %>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
<%= javascript_include_tag "inc/modal-preview" %>
|
||||
<% end %>
|
||||
|
||||
Vendored
+13
-53
@@ -4,7 +4,7 @@
|
||||
<div class="info1">
|
||||
<span class="date"><%= @bulletin.postdate %></span>
|
||||
|
|
||||
<a href="" class="unit"><%= User.find(@bulletin.create_user_id).name %></a>
|
||||
<a href="" class="unit"><%= @bulletin.unit_list_for_anc.title[I18n.locale] rescue '' %></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="news_image">
|
||||
@@ -14,58 +14,18 @@
|
||||
<div class="news_paragraph">
|
||||
<%= @bulletin.text[I18n.locale].html_safe %>
|
||||
</div>
|
||||
|
||||
<b><%= t('announcement.link') %></b>
|
||||
<% @bulletin.bulletin_links.each do | blink | %>
|
||||
<%= link_to blink.i18n_variable[I18n.locale], blink.url, :target => '_blank' %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.file') %></b>
|
||||
<% @bulletin.bulletin_files.each do | bfile | %>
|
||||
<%= link_to bfile.filetitle[I18n.locale], bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
|
||||
<% end %>
|
||||
|
||||
<div class="fb">
|
||||
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.nccu.edu.tw&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font&height=35&appId=263319013700607" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
|
||||
</div>
|
||||
<!--
|
||||
<p id="notice"><%= flash_messages %></p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<b><%= t('announcement.category') %></b>
|
||||
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.postdate') %></b>
|
||||
<%= @bulletin.postdate %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.title') %></b>
|
||||
<%= @bulletin.title[I18n.locale] %>
|
||||
</li>
|
||||
<li>
|
||||
<%#= 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 %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.subtitle') %></b>
|
||||
<%= @bulletin.subtitle[I18n.locale].html_safe %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.text') %></b>
|
||||
<%= @bulletin.text[I18n.locale].html_safe %>
|
||||
</li>
|
||||
<li>
|
||||
<li>
|
||||
<b><%= t('announcement.link') %></b>
|
||||
<% @bulletin.bulletin_links.each do | blink | %>
|
||||
<%= link_to blink.name, blink.url, :target => '_blank' %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.file') %></b>
|
||||
<% @bulletin.bulletin_files.each do | bfile | %>
|
||||
<%= link_to bfile.filetitle, bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.張貼者') %></b>
|
||||
<%= User.find(@bulletin.create_user_id).name %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.最後修改時間') %></b>
|
||||
<%= @bulletin.updated_at.strftime("%Y-%m-%d %H:%I:%S") %>
|
||||
</li>
|
||||
-->
|
||||
|
||||
<%#= link_back %>
|
||||
@@ -59,6 +59,8 @@ en:
|
||||
all_articles: List
|
||||
add_new: Add
|
||||
categories: Categories
|
||||
error:
|
||||
no_avilb_cate_for_posting: You need a category to submit your post,please contact admin
|
||||
sure?: Sure?
|
||||
campus_news: Campus News
|
||||
more: more+
|
||||
@@ -80,8 +82,9 @@ en:
|
||||
approval_setting_window_title: 'Unit'
|
||||
approval_user_list: 'Approval Users'
|
||||
cate_auth: Category Authorization
|
||||
submit_approval: Submit approval
|
||||
tag_cloud: Tag cloud
|
||||
|
||||
|
||||
# admin:
|
||||
# action: Action
|
||||
# add_language: Add language
|
||||
|
||||
@@ -37,6 +37,8 @@ zh_tw:
|
||||
announcement:
|
||||
add_new: 新增
|
||||
all_articles: 列表
|
||||
error:
|
||||
no_avilb_cate_for_posting: 您目前沒有分類可以刊登公告,請聯絡系統管理員為您開通分類
|
||||
tags: 標籤
|
||||
categories: 分類
|
||||
status: 狀態
|
||||
@@ -61,6 +63,7 @@ zh_tw:
|
||||
approval_setting_window_title: '單位'
|
||||
approval_user_list: '審核者'
|
||||
cate_auth: '分類授權'
|
||||
submit_approval: '提交審核'
|
||||
tag_cloud: 標籤雲
|
||||
|
||||
bulletin:
|
||||
|
||||
+5
-1
@@ -7,6 +7,8 @@ Rails.application.routes.draw do
|
||||
match 'approval_setting' => "approvals#update_setting" ,:as => :approval_setting,:via => :post
|
||||
match 'approval_setting' => "approvals#user_list" ,:as => :approval_user_list,:via => :put
|
||||
resources :bulletins do
|
||||
match "approve/:bulletin_id" => "approvals#preview_and_approve",:as => :approval_preview,:via => :put
|
||||
match "approve/:bulletin_id" => "approvals#approve",:as => :approve,:via => :post
|
||||
match "link_quick_add/:bulletin_id" => "bulletins#link_quick_add" ,:as => :link_quick_add
|
||||
match "link_quick_edit/:bulletin_id" => "bulletins#link_quick_edit" ,:as => :link_quick_edit
|
||||
member do
|
||||
@@ -32,7 +34,9 @@ Rails.application.routes.draw do
|
||||
resources :tags
|
||||
end
|
||||
namespace :front_end do
|
||||
resources :bulletins
|
||||
resources :bulletins # do
|
||||
# match "preview" => "bulletins#preview_content",:as => :get_preview_content
|
||||
# end
|
||||
end
|
||||
namespace :widget do
|
||||
match "bulletins" => "bulletins#index"
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# encoding: utf-8
|
||||
|
||||
namespace :nccu_data do
|
||||
desc "load nccu data from csv"
|
||||
task :setup_ut_list => :environment do
|
||||
require 'csv'
|
||||
|
||||
CSV.foreach("vendor/built_in_modules/announcement/lib/ut_list_from_nccu_2012feb.csv") do |row|
|
||||
new_unit = UnitListForAnc.new(:order => row[0], :ut_code => row[1], :up_ut_code => row[2], :created_at => Time.now,:updated_at => Time.now)
|
||||
new_unit.build_title :en => row[4], :zh_tw => row[3]
|
||||
new_unit.save
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,186 @@
|
||||
order,ut_code,up_tu_code,ut_zh_tw,ut_en
|
||||
0100,H00,H00,校長室,Office of the President
|
||||
0110,H01,H01,副校長室一,Office of the Vice President
|
||||
0110,H03,H03,副校長室二,Office of the Vice President
|
||||
0200,100,100,文學院,College of Liberal Arts
|
||||
0210,101,100,中文系,Dept. of Chinese Literature
|
||||
0220,103,100,歷史系,Dept. of History
|
||||
0230,104,100,哲學系,Dept. of Philosophy
|
||||
0240,155,100,圖檔所,"Graduate Institute of Library, Informati"
|
||||
0250,156,100,宗教所,Graduate Institute of Religious Studies
|
||||
0260,158,100,台史所,Graduate Institute of Taiwan History
|
||||
0270,159,100,台文所,Graduate Institute of Taiwan Literatu
|
||||
0280,161,100,華文碩,Master's Program in Teaching Chinese as
|
||||
0290,160,100,華文博,Doctor's Program in Teaching Chinese as
|
||||
0294,913,100,圖資專班,E-learning Master Program of Library and
|
||||
0300,700,700,理學院,College of Science
|
||||
0310,701,700,應數系,Dept. of Mathematical Sciences
|
||||
0320,702,700,心理系,Dept. of Psychology
|
||||
0330,703,700,資科系,Dept. of Computer Science
|
||||
0340,754,700,神科所,The Graduate Institute of Neuroscience
|
||||
0350,755,700,應物所,Graduate Institute of Applied Physics
|
||||
0600,200,200,社科院,College of Social Sciences
|
||||
0605,202,200,政治系,Dept. of Political Science
|
||||
0610,204,200,社會系,Dept. of Sociology
|
||||
0615,205,200,財政系,Dept. of Public Finance
|
||||
0620,206,200,公行系,Dept. of Public Administration
|
||||
0625,207,200,地政系,Dept. of Land Economics
|
||||
0630,208,200,經濟系,Dept. of Economics
|
||||
0635,209,200,民族系,Dept. of Ethnology
|
||||
0640,261,200,國發所,GIDS
|
||||
0645,262,200,勞工所,Graduate Institute of Labor Research
|
||||
0650,264,200,社工所,Graduate Institute of Social Work
|
||||
0652,265,200,亞太博,International Doctor Program in Asia-Pac
|
||||
0700,600,600,法學院,College of Law
|
||||
0710,601,600,法律系,Dept. of Law
|
||||
0720,652,600,法科所,The Institute of Law and Inter-disciplin
|
||||
0800,300,300,商學院,College of Commerce
|
||||
0801,301,300,國貿系,Dept. of International Business
|
||||
0803,302,300,金融系,Dept. of Money and Banking
|
||||
0805,303,300,會計系,Dept. of Accounting
|
||||
0807,304,300,統計系,Dept. of Statistics
|
||||
0809,305,300,企管系,Dept. of Business Administration
|
||||
0811,306,300,資管系,Dept. of Management Information System
|
||||
0813,307,300,財管系,Dept. of Finance
|
||||
0815,308,300,風管系,Dept. of Risk Management and Insurance
|
||||
0817,359,300,科管所,Graduate Institute of Technology and Inn
|
||||
0819,361,300,智財所,Graduate Institute of Intellectual Prope
|
||||
0821,362,300,管理碩士學程,Advanced Master of Business Administrati
|
||||
0823,380,300,商管碩,Advanced Master of Business Administrati
|
||||
1100,500,500,外語學院,College of Foreign Languages
|
||||
1110,501,500,英文系,Dept. of English
|
||||
1120,502,500,阿文系,Dept. of Arabic Language and Literature
|
||||
1130,504,500,斯拉夫文系,Dept. of Slavic Languages and Literature
|
||||
1140,506,500,日文系,Dept. of Japanese
|
||||
1150,507,500,韓文系,Dept. of Korean Language and Cultur
|
||||
1160,508,500,土文系,Dept. of Turkish Language and Cultu
|
||||
1170,555,500,語言所,Graduate Institute of Linguistics
|
||||
1180,509,500,歐洲語文學程,Undergraduate Program in European Langua
|
||||
1190,5T1,500,外文中心,Foreign Languages Center
|
||||
1200,400,400,傳播學院,College of Communication
|
||||
1210,401,400,新聞系,Dept. of Journalism
|
||||
1220,402,400,廣告系,Dept. of Advertising
|
||||
1230,403,400,廣電系,Dept. of Radio and Television
|
||||
1240,461,400,國傳英語碩士學位學程,International Master's Program in Intern
|
||||
1250,404,400,傳播學程,College of Communication Undergraduate D
|
||||
1260,462,400,數位內容學程,DCT
|
||||
1270,781,700,數位內容與科技學士學位學程,數位內容與科技學士學位學程
|
||||
1280,4A1,400,實習廣播電台,NCCU Community Radio Station
|
||||
1300,800,800,國際事務學院,College of International Affairs
|
||||
1310,203,800,外交系,Dept. of Diplomacy
|
||||
1320,260,800,東亞所,Graduate Institute of East Asian Studies
|
||||
1330,263,800,俄研所,Graduate Institute of Russian Studies
|
||||
1340,861,800,日碩研,Master Program in Japan Studies
|
||||
1346,862,800,國際研究英語碩士學位學程(籌備處),International Master's Program in Intern
|
||||
1600,900,900,教育學院,College of Education
|
||||
1610,102,900,教育系,Dept. of Education
|
||||
1620,157,900,幼教所,Graduate Institute of Early Childhood Ed
|
||||
1630,171,900,教政所,Graduate Institute of Educational Admini
|
||||
1640,1T3,900,師培中心,Institute of Teacher Education
|
||||
1652,172,900,輔諮碩學程,MPCG
|
||||
1660,1T1,900,教研中心,The Teacher In-Service Education Center
|
||||
1700,L00,L00,國關中心,The Institute of International Relations
|
||||
1710,L01,L00,國關第一所,First Division
|
||||
1720,L02,L00,國關第二所,Second Division
|
||||
1730,L03,L00,國關第三所,Third Division
|
||||
1740,L04,L00,國關第四所,Fourth Division
|
||||
1750,L05,L00,國關合交組,The Institute of International Relations
|
||||
1760,L06,L00,國關編譯組,The Institute of International Relations
|
||||
1770,L07,L00,國關圖資組,The Institute of International Relations
|
||||
1780,L08,L00,國關秘書組,The Institute of International Relations
|
||||
1800,S00,S00,選研中心,Election Study Center
|
||||
1900,Z01,Z01,第三部門研究中心,Center for the Third Sector
|
||||
1910,Z02,Z02,創新創造力研究中心,CCIS
|
||||
1920,Z03,Z03,中國大陸研究中心,Center for China Studies
|
||||
1930,Z04,Z04,台灣研究中心,TSC
|
||||
1940,Z08,Z08,心腦學中心,"Reseach Center for Mind, Brain and Learn"
|
||||
1950,Z10,Z10,原民中心,Center for Aboriginal Studies
|
||||
1960,Z09,Z09,人文中心,Humanities Center
|
||||
2000,T00,T00,教務處,Office of Academic Affairs
|
||||
2010,T01,T00,教務處註冊組,Registration Section
|
||||
2020,T02,T00,教務處課務組,Instruction Resources Section
|
||||
2030,T03,T00,教務處綜合業務組,Admission Section
|
||||
2040,T04,T00,教務處通識教育中心,Center of General Education
|
||||
2100,M00,M00,學務處,Office of Student Affairs
|
||||
2110,M01,M00,學務處生僑組,Life Guidance and Overseas Chinese Stude
|
||||
2120,M02,M00,學務處課外組,Student Activities Section
|
||||
2130,M03,M00,學務處住宿組,Student Housing Service Section
|
||||
2150,M11,M00,學務處藝文中心,Art and Culture Center
|
||||
2155,M14,M00,學務處身心健康中心,Physical and Mental Health Center
|
||||
2160,M13,M00,學務處職涯中心,Center of Career Development
|
||||
2170,D00,M00,學務處軍訓室,Military Education Office
|
||||
2200,G00,G00,總務處,Office of General Affairs
|
||||
2210,G01,G00,總務處文書組,Document and postal section
|
||||
2220,G02,G00,總務處事務組,General Management Section
|
||||
2230,G05,G00,總務處出納組,Cashier Section
|
||||
2240,G04,G00,總務處營繕組,Construction and Maintenance Section
|
||||
2250,G03,G00,總務處財產組,Property Management SEction
|
||||
2260,G06,G00,總務處環保組,Environmental Protection Section
|
||||
2270,G08,G00,總務處規劃組,Campus Planning & Devel opment Section
|
||||
2280,G07,G00,總務處駐警隊,Campus Security National Chengchi Unive
|
||||
2300,R00,R00,研發處,Office of Research and Development
|
||||
2310,R01,R00,研發處企畫組,Planning Section
|
||||
2320,R02,R00,研發處學術推展組,Academic Development Section
|
||||
2330,R03,R00,研發處學評組,Academic Evaluation Section
|
||||
2400,Z05,Z05,國合處,Office of International Cooperation
|
||||
2410,Z06,Z05,國合處合作交流組,CES
|
||||
2420,Z07,Z05,國合處教育組,IES
|
||||
2430,Z14,Z05,國合處發展策劃組,DPS
|
||||
2500,Q00,Q00,秘書處,Secretariat
|
||||
2510,Q01,Q00,秘書處第一組,First Section
|
||||
2520,Q02,Q00,秘書處第二組,Second Section
|
||||
2530,Q03,Q00,秘書處第三組,Third Section
|
||||
2600,K00,K00,圖書館,Libraries
|
||||
2610,K06,K00,圖書館資訊組,System Information Section
|
||||
2620,K07,K00,圖書館採編組,Acquisition & Cataloging Section
|
||||
2630,K08,K00,圖書館典閱組,Circulation Section
|
||||
2640,K09,K00,圖書館推廣服務組,Reference Services Section
|
||||
2650,K10,K00,圖書館數位典藏組,Digital Preservation Section
|
||||
2660,K11,K00,圖書館行政組,Administration Section
|
||||
2670,K12,K00,圖書館圖書分館,Branch Libraries
|
||||
2700,B00,B00,體育室,Physical Education Office
|
||||
2710,B01,B00,體育教學組,Physical Education Office
|
||||
2720,B02,B00,體育活動組,Sport activities section
|
||||
2800,P00,P00,人事室,Personnel Office
|
||||
2810,P01,P00,人一組,First Section
|
||||
2820,P02,P00,人二組,Second Section
|
||||
2830,P03,P00,人三組,Third Section
|
||||
2840,P04,P00,人四組,Fourth Section
|
||||
2900,A00,A00,會計室,Accounting Office
|
||||
2910,A01,A00,會計室第一組,Budgeting Section
|
||||
2920,A02,A00,會計室第二組,Accounting Section
|
||||
2930,A03,A00,會計室第三組,Auditing Section
|
||||
3000,I00,I00,公企中心,Public and Business Administration Educa
|
||||
3010,I01,I00,公企諮詢組,Research and Consultation Section
|
||||
3020,I02,I00,公企職訓組,Training Section
|
||||
3030,I03,I00,公企語訓組,Language Training Section
|
||||
3040,I04,I00,公企總務組,General Affairs Section
|
||||
3050,I05,I00,公企中心圖資組,Library Resource Section
|
||||
3100,O00,O00,公教中心,Civil Service Education Center
|
||||
3110,O01,O00,公教教務組,Civil Service Education Center
|
||||
3120,O02,O00,公教輔導組,Civil Service Education Center
|
||||
3130,O03,O00,公教行政組,Civil Service Education Center
|
||||
3200,J00,J00,社資中心,Social Sciences Information Center
|
||||
3210,J03,J00,社資資料組,Reference Services Section
|
||||
3220,J04,J00,社資研發組,Section of Research & Development
|
||||
3300,C00,C00,電算中心,Computer Center
|
||||
3310,C01,C00,電算教研組,Teaching and Research Section
|
||||
3320,C02,C00,電算系統組,Application System Section
|
||||
3330,C03,C00,電算行政組,Administration and Counseling Section
|
||||
3340,C04,C00,電算網路組,Networking and Development Section
|
||||
3400,T05,T05,教學發展中心,Center for Teaching and Learning Develop
|
||||
3410,T06,T05,教發教學組,Teaching and Learning Division
|
||||
3420,T07,T05,教發數位組,E-Learning Division
|
||||
3430,T08,T05,教發規劃組,Planning and Research Division
|
||||
3500,162,162,華語文中心,Chinese Language Center
|
||||
3600,Z11,Z11,育成中心,Innovation Incubation Center
|
||||
3700,V00,V00,附設實小,The Experimental Elementary School
|
||||
3700,V01,V00,附設實小教務處,Office of Academic Affairs
|
||||
3700,V02,V00,附設實小學務處,Office of Student Affairs
|
||||
3700,V03,V00,附設實小輔導室,The Experimental Elementary School
|
||||
3700,V04,V00,附設實小總務處,Office of General Affairs
|
||||
3700,V06,V00,附設實小研究處,The Experimental Elementary School
|
||||
3710,V05,V00,附設實小幼稚園,The Experimental Elementary School
|
||||
3800,W00,W00,附中,The Affiliated High School
|
||||
3900,Z13,Z13,政大書院辦公室,Chengchi College Project Office
|
||||
4000,Z12,Z12,頂大辦公室,Office of NCCU Top University Program
|
||||
|
Vendored
+9
@@ -1,7 +1,16 @@
|
||||
class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
include AdminHelper
|
||||
|
||||
def preview_and_approve
|
||||
@bulletin = NewsBulletin.find params[:bulletin_id]
|
||||
end
|
||||
|
||||
def approve
|
||||
|
||||
end
|
||||
|
||||
def setting
|
||||
@news_bulletin_categorys = NewsBulletinCategory.all
|
||||
if params.has_key?(:category_id)
|
||||
|
||||
+3
@@ -1,5 +1,8 @@
|
||||
class Panel::News::BackEnd::NewsBulletinCategorysController < OrbitBackendController
|
||||
|
||||
before_filter :for_app_manager,:except => [:index]
|
||||
|
||||
|
||||
def index
|
||||
@news_bulletin_categorys = NewsBulletinCategory.all
|
||||
@news_bulletin_category = NewsBulletinCategory.new(:display => 'List')
|
||||
|
||||
Vendored
+20
-92
@@ -1,7 +1,10 @@
|
||||
class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
||||
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
|
||||
# before_filter :for_admin_only,:only => [:]
|
||||
# before_filter :for_app_manager,:only => [:index,:show,]
|
||||
before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_news_bulletins]
|
||||
|
||||
def index
|
||||
# @news_bulletins = NewsBulletin.all
|
||||
@@ -39,6 +42,10 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
||||
@news_bulletin_link = NewsBulletinLink.new
|
||||
@link_url = panel_news_back_end_news_bulletins_path
|
||||
|
||||
@news_bulletins.delete_if{ |news_bulletin|
|
||||
news_bulletin.is_pending == true && (!news_bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || news_bulletin.create_user_id!=current_user.id)
|
||||
}
|
||||
|
||||
@news_bulletin_file = NewsBulletinFile.new
|
||||
@file_url = panel_news_back_end_news_bulletins_path
|
||||
|
||||
@@ -75,17 +82,19 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
||||
def new
|
||||
@news_bulletin = NewsBulletin.new
|
||||
|
||||
@link_url = panel_news_back_end_news_bulletins_path
|
||||
@link_url = panel_news_back_end_news_bulletins_path
|
||||
|
||||
# @news_bulletin.news_bulletin_files.build
|
||||
# @news_bulletin.news_bulletin_files.new
|
||||
|
||||
get_categorys
|
||||
get_tags
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render :xml => @news_bulletin }
|
||||
if get_categorys.empty?
|
||||
flash[:alert] = t("announcement.error.no_avilb_cate_for_posting")
|
||||
redirect_to :action => :index
|
||||
else
|
||||
get_tags
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render :xml => @news_bulletin }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -311,10 +320,11 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
||||
|
||||
def get_categorys(id = nil)
|
||||
@news_bulletin_categorys = []
|
||||
@unit_list_for_anc = UnitListForAnc.all
|
||||
if(is_manager? || is_admin?)
|
||||
@news_bulletin_categorys = (id ? NewsBulletinCategory.find(id).to_a : NewsBulletinCategory.excludes('disabled' => true))
|
||||
elsif is_sub_manager?
|
||||
@news_bulletin_categorys = NewsBulletinCategory.authed_for_user(current_user,'submit_new')
|
||||
@news_bulletin_categorys = NewsBulletinCategory.authed_for_user(current_user,'submit')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -323,86 +333,4 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
||||
@tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc)
|
||||
end
|
||||
|
||||
def get_sorted_and_filtered_news_bulletins
|
||||
news_bulletins = NewsBulletin.all
|
||||
case params[:sort]
|
||||
when 'postdate', 'deadline'
|
||||
news_bulletins = news_bulletins.order_by([params[:sort], params[:direction]])
|
||||
when 'category'
|
||||
category_ids = news_bulletins.distinct(:news_bulletin_category_id)
|
||||
categories = NewsBulletinCategory.find(category_ids) rescue nil
|
||||
if categories
|
||||
h = Hash.new
|
||||
categories.each { |category| h[category.i18n_variable[I18n.locale]] = category.id }
|
||||
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
|
||||
sorted_categorys = sorted.collect {|a| news_bulletins.where(:news_bulletin_category_id => a[1]).entries }
|
||||
news_bulletins = sorted_categorys.flatten!
|
||||
end
|
||||
when 'title'
|
||||
h = Array.new
|
||||
news_bulletins.each { |news_bulletin| h << [news_bulletin.title[I18n.locale].downcase, news_bulletin] }
|
||||
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
|
||||
news_bulletins = sorted.collect {|a| a[1] }
|
||||
when 'status'
|
||||
news_bulletins = news_bulletins.order_by(:is_top, params[:direction]).order_by(:is_hot, params[:direction]).order_by(:is_hidden, params[:direction]).order_by(:is_pending, params[:direction]).order_by(:is_checked, params[:direction]).order_by(:is_rejected, params[:direction])
|
||||
when 'update_user_id'
|
||||
user_ids = news_bulletins.distinct(:update_user_id)
|
||||
users = User.find(user_ids) rescue nil
|
||||
if users
|
||||
h = Array.new
|
||||
users.each { |user| h << [user.name, user.id] }
|
||||
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
|
||||
sorted_users = sorted.collect {|a| news_bulletins.where(:update_user_id => a[1]).entries }
|
||||
news_bulletins = sorted_users.flatten
|
||||
end
|
||||
when 'tags'
|
||||
a = Array.new
|
||||
NewsTag.all.order_by(I18n.locale, params[:direction]).each { |tag| a << tag.news_bulletins }
|
||||
a.flatten!
|
||||
a.uniq!
|
||||
tmp = Array.new
|
||||
news_bulletins.where(:tag_ids => []).each { |news_bulletin| tmp << [news_bulletin.title[I18n.locale].downcase, news_bulletin] }
|
||||
sorted = params[:direction].eql?('asc') ? tmp.sort : tmp.sort.reverse!
|
||||
sorted_titles = sorted.collect {|a| a[1] }
|
||||
a = params[:direction].eql?('asc') ? (sorted_titles + a) : (a + sorted_titles)
|
||||
news_bulletins = a.flatten
|
||||
end
|
||||
if @filter
|
||||
@filter.each do |key, value|
|
||||
case key
|
||||
when 'status'
|
||||
a = Array.new
|
||||
news_bulletins.each do |news_bulletin|
|
||||
value.each do |v|
|
||||
case v
|
||||
when 'pending'
|
||||
a << news_bulletin if news_bulletin.is_checked.nil?
|
||||
when 'rejected'
|
||||
a << news_bulletin if news_bulletin.is_checked.eql?(false)
|
||||
else
|
||||
a << news_bulletin if news_bulletin[v]
|
||||
end
|
||||
end
|
||||
end
|
||||
news_bulletins = a.uniq
|
||||
when 'categories'
|
||||
a = Array.new
|
||||
news_bulletins.each do |news_bulletin|
|
||||
a << news_bulletin if value.include?(news_bulletin.news_bulletin_category.id.to_s)
|
||||
end
|
||||
news_bulletins = a.uniq
|
||||
when 'tags'
|
||||
a = Array.new
|
||||
news_bulletins.each do |news_bulletin|
|
||||
news_bulletin.tags.each do |tag|
|
||||
a << news_bulletin if value.include?(tag.id.to_s)
|
||||
end
|
||||
end
|
||||
news_bulletins = a.uniq
|
||||
end if value.size > 0
|
||||
end
|
||||
end
|
||||
Kaminari.paginate_array(news_bulletins).page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
end
|
||||
Vendored
+11
-2
@@ -24,10 +24,19 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def show
|
||||
@news_bulletin = NewsBulletin.can_display.where(_id: params[:id]).first
|
||||
get_categorys
|
||||
if params[:preview] == "true"
|
||||
preview_content
|
||||
else
|
||||
@news_bulletin = NewsBulletin.can_display.where(_id: params[:id]).first
|
||||
get_categorys
|
||||
end
|
||||
end
|
||||
|
||||
def preview_content
|
||||
@news_bulletins = NewsBulletin.find params[:id]
|
||||
get_categorys
|
||||
render :show
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
module Panel::News::BackEnd::NewsBulletinCategorysHelper
|
||||
include ActionView::Helpers::UrlHelper
|
||||
|
||||
|
||||
def show_submit_permission_link(news_bulletin_category)
|
||||
oa = news_bulletin_category.get_object_auth_by_title('submit')
|
||||
if oa.nil?
|
||||
news_bulletin_category.object_auths.new(title: 'submit' ).save
|
||||
oa = news_bulletin_category.get_object_auth_by_title('submit')
|
||||
end
|
||||
link_to t('announcement.bulletin.cate_auth'), edit_admin_object_auth_path(oa)
|
||||
end
|
||||
|
||||
end
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
module Panel::News::BackEnd::NewsBulletinsHelper
|
||||
|
||||
def news_show_approval_link(news_bulletin)
|
||||
by_news_bulletin = (!news_bulletin.is_expired? and !news_bulletin.is_checked?)
|
||||
by_user = news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?
|
||||
by_news_bulletin and by_user
|
||||
end
|
||||
|
||||
end
|
||||
@@ -33,6 +33,7 @@ class NewsBulletin
|
||||
mount_uploader :image, ImageUploader
|
||||
|
||||
belongs_to :news_bulletin_category
|
||||
belongs_to :unit_list_for_anc
|
||||
|
||||
# embeds_many :news_bulletin_links, :cascade_callbacks => true
|
||||
# embeds_many :news_bulletin_files, :cascade_callbacks => true
|
||||
|
||||
Vendored
+69
@@ -0,0 +1,69 @@
|
||||
<% if news_bulletin -%>
|
||||
|
||||
<div class="modal hide fade in banner-preview" id="news_bulletin-<%=news_bulletin.id%>">
|
||||
<div class="modal-header">
|
||||
<a class="close" data-dismiss="modal">×</a>
|
||||
<h3><%= t("modal.preview") %></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="news_bulletin_slideshow">
|
||||
<iframe src=<%= panel_news_front_end_news_bulletin_path(news_bulletin, :category_id => news_bulletin.news_bulletin_category.id ,:preview=>true) %> style="width:1024px;height:300px" >
|
||||
|
||||
</iframe>
|
||||
|
||||
<%# preview_block_ad_images_helper(news_bulletin).each do |ad_image| -%>
|
||||
<%#= image_tag ad_image.file,:alt => (ad_image.title[locale] || " "),:time_to_next => news_bulletin.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || news_bulletin.context || " ")) %>
|
||||
<%# end -%>
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<%= form_for news_bulletin, :url => panel_news_back_end_news_bulletin_path(news_bulletin), :html => {:class => 'clear'} do |f| %>
|
||||
<%= f.label :approval_stat, t('announcement.bulletin.approval_stat') %>
|
||||
<%= content_tag :label,:class => "radio inline" do -%>
|
||||
<%= f.radio_button :is_checked, true , {:class => 'privacy'} %>
|
||||
<%= t('announcement.bulletin.approval_pass') %>
|
||||
<% end -%>
|
||||
<%= content_tag :label,:class => "radio inline" do -%>
|
||||
<%= f.radio_button :is_checked, false, (!@news_bulletin.is_checked ? {:checked => true, :class => 'privacy'} : {})%>
|
||||
<%= t('announcement.bulletin.approval_not_pass') %>
|
||||
<% end -%>
|
||||
|
||||
<%= label :is_checked_false, t('announcement.bulletin.approval_not_pass_reason') %>
|
||||
<%= f.text_field :not_checked_reason %>
|
||||
<%= f.submit t('announcement.bulletin.submit_approval'),:class=>"btn"%>
|
||||
<% end %>
|
||||
|
||||
<a href="#" class="btn" data-dismiss="modal"><%= t("modal.close") %></a>
|
||||
</div>
|
||||
<div>
|
||||
<script type="text/javascript" src="/static/kernel.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
// $("#news_bulletin-<%#=news_bulletin.title.dehumanize%>").on("show", function () {
|
||||
// $("#news_bulletin-<%#=news_bulletin.title.dehumanize%>").find(".news_bulletin_slideshow").cycle({delay: -1000, fx: "<%#= news_bulletin.ad_fx.nil?? "fade": news_bulletin.ad_fx %>", timeoutFn: getTimeout });
|
||||
// });
|
||||
$(".modal").on("hidden", function () {
|
||||
$("#show_preview").remove();
|
||||
});
|
||||
|
||||
$("iframe").load(function(){
|
||||
// Get the body element
|
||||
var frameBody = $("iframe").contents().find("body");
|
||||
|
||||
// Get all links inside the BODY tag
|
||||
$('a', frameBody).click(function(e){
|
||||
//Disable all default actions
|
||||
e.preventDefault();
|
||||
});
|
||||
$('input', frameBody).attr("disabled", true);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<% end -%>
|
||||
vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/preview_and_approve.js.erb
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
$('#show_preview').html("<%= escape_javascript(render(:partial => 'modal_approve',:locals => {:news_bulletin => @news_bulletin})) %>");
|
||||
var start_modal_with_id = "news_bulletin-<%=@news_bulletin.id%>";
|
||||
$("#"+start_modal_with_id).css("width","1050px");
|
||||
$("#"+start_modal_with_id).css("height","768px");
|
||||
$("#"+start_modal_with_id).css("margin","-270px 0 0 -550px");
|
||||
+8
-2
@@ -4,8 +4,14 @@
|
||||
<%= news_bulletin_category.key %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t('news_bulletin_category.edit'), edit_panel_news_back_end_news_bulletin_category_path(news_bulletin_category), :remote => true %></li>
|
||||
<li><%= link_to t('news_bulletin_category.delete'), panel_news_back_end_news_bulletin_category_path(news_bulletin_category), :confirm => t('news.sure?'), :method => :delete, :remote => true %></li>
|
||||
<%if is_manager? || is_admin? %>
|
||||
<li><%= show_submit_permission_link(news_bulletin_category) %></li>
|
||||
<% end %>
|
||||
<% if is_admin?%>
|
||||
<li><%= link_to t('bulletin_category.edit'), edit_panel_news_back_end_news_bulletin_category_path(news_bulletin_category), :remote => true %></li>
|
||||
<li><%= link_to t('bulletin_category.delete'), panel_news_back_end_news_bulletin_category_path(news_bulletin_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
Vendored
+1
-1
@@ -17,7 +17,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="form"><%= render :partial => "form" %></div>
|
||||
<div id="form"><%= render :partial => "form" if is_manager? %></div>
|
||||
|
||||
|
||||
|
||||
+6
-25
@@ -105,28 +105,6 @@
|
||||
<a class="action"><i title="A" class="icon-exclamation-sign icon-white tip"></i></a>
|
||||
</div>
|
||||
|
||||
<h3 class="widget-title"><i class="icons-link icons-white"></i>Audit</h3>
|
||||
<div class="widget-content">
|
||||
|
||||
<% if is_manager? || @news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) || current_user.admin? %>
|
||||
<div class="controls">
|
||||
<%= f.label :approval_stat, t('news.news_bulletin.approval_stat') %>
|
||||
<%= content_tag :label,:class => "radio inline" do -%>
|
||||
<%= f.radio_button :is_checked, true , {:class => 'privacy'} %>
|
||||
<%= t('news.news_bulletin.approval_pass') %>
|
||||
<% end -%>
|
||||
<%= content_tag :label,:class => "radio inline" do -%>
|
||||
<%= f.radio_button :is_checked, false, (!@news_bulletin.is_checked ? {:checked => true, :class => 'privacy'} : {})%>
|
||||
<%= t('news.news_bulletin.approval_not_pass') %>
|
||||
<% end -%>
|
||||
<div class="select-role">
|
||||
<%= label :is_checked_false, t('news.news_bulletin.approval_not_pass_reason') %>
|
||||
<%= f.text_field :not_checked_reason %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.admin? %>
|
||||
<%= f.hidden_field :is_checked,:value => true%>
|
||||
@@ -139,13 +117,16 @@
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content" class="clear">
|
||||
|
||||
|
||||
<%= f.label :unit_list_for_anc%>
|
||||
<%= f.select :unit_list_for_anc_id,@unit_list_for_anc.collect{|t| [ t.title[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
|
||||
|
||||
<%= f.label :category %>
|
||||
<%= f.select :news_bulletin_category_id, @news_bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<%# @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<% site_valid_locales_default_head.each_with_index do |locale, i| %>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? " class='active'" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -153,7 +134,7 @@
|
||||
<div class="tab-content">
|
||||
|
||||
<%# @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<% site_valid_locales_default_head.each_with_index do |locale, i| %>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
|
||||
|
||||
Vendored
+29
-19
@@ -1,5 +1,9 @@
|
||||
<tr id="<%= dom_id news_bulletin %>" class="with_action">
|
||||
<td><%= check_box_tag 'to_delete[]', news_bulletin.id, false, :class => "checkbox_in_list" %></td>
|
||||
<td>
|
||||
<% if (news_bulletin.create_user_id == current_user.id) || is_manager? %>
|
||||
<%= check_box_tag 'to_delete[]', news_bulletin.id, false, :class => "checkbox_in_list" %>
|
||||
<% end -%>
|
||||
</td>
|
||||
<td>
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
@@ -27,27 +31,33 @@
|
||||
<td><%= news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] %></td>
|
||||
<td>
|
||||
<%= link_to news_bulletin.title[I18n.locale], panel_news_front_end_news_bulletin_path(news_bulletin, :category_id => news_bulletin.news_bulletin_category.id) rescue ''%>
|
||||
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<% if current_user.admin? || (!news_bulletin.is_rejected? && !news_bulletin.is_checked?) %>
|
||||
<li><%= link_to t('news_bulletin.edit'), edit_panel_news_back_end_news_bulletin_path(news_bulletin) %></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" id="menu1">
|
||||
<li><%= link_to t(:basic), load_quick_edit_panel_news_back_end_news_bulletin_path(news_bulletin, :type => 'basic'), :remote => true %></li>
|
||||
<li><%= link_to t(:picture), load_quick_edit_panel_news_back_end_news_bulletin_path(news_bulletin, :type => 'picture'), :remote => true %></li>
|
||||
<li><%= link_to t(:tags), load_quick_edit_panel_news_back_end_news_bulletin_path(news_bulletin, :type => 'tags'), :remote => true %></li>
|
||||
<li><%= link_to t(:link), load_quick_edit_panel_news_back_end_news_bulletin_path(news_bulletin, :type => 'links'), :remote => true %></li>
|
||||
<li><%= link_to t(:file), load_quick_edit_panel_news_back_end_news_bulletin_path(news_bulletin, :type => 'files'), :remote => true %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<%#= debugger %>
|
||||
<%#= a=1 %>
|
||||
<% if (news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?) and !news_bulletin.is_expired? %>
|
||||
<li><%= link_to t('news.news_bulletin.approval'), edit_panel_news_back_end_news_bulletin_path(news_bulletin) %></li><%#= #TODO add ancher so user can quick access into that part %>
|
||||
<% end %>
|
||||
<% if (news_bulletin.create_user_id == current_user.id) || is_manager? %>
|
||||
|
||||
<% if current_user.admin? || (!news_bulletin.is_rejected? && !news_bulletin.is_checked?) %>
|
||||
<li><%= link_to t('news_bulletin.edit'), edit_panel_news_back_end_news_bulletin_path(news_bulletin) %></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" id="menu1">
|
||||
<li><%= link_to t(:basic), load_quick_edit_panel_news_back_end_news_bulletin_path(news_bulletin, :type => 'basic'), :remote => true %></li>
|
||||
<li><%= link_to t(:picture), load_quick_edit_panel_news_back_end_news_bulletin_path(news_bulletin, :type => 'picture'), :remote => true %></li>
|
||||
<li><%= link_to t(:tags), load_quick_edit_panel_news_back_end_news_bulletin_path(news_bulletin, :type => 'tags'), :remote => true %></li>
|
||||
<li><%= link_to t(:link), load_quick_edit_panel_news_back_end_news_bulletin_path(news_bulletin, :type => 'links'), :remote => true %></li>
|
||||
<li><%= link_to t(:file), load_quick_edit_panel_news_back_end_news_bulletin_path(news_bulletin, :type => 'files'), :remote => true %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<%#= debugger %>
|
||||
<%#= a=1 %>
|
||||
|
||||
<% end %>
|
||||
<li class="dropdown"><%= link_to t('news_bulletin.delete'), panel_news_back_end_news_bulletin_path(news_bulletin), :confirm => t('news.sure?'), :method => :delete, :remote => true %></li>
|
||||
<% end %>
|
||||
<li class="dropdown"><%= link_to t('news_bulletin.delete'), panel_news_back_end_news_bulletin_path(news_bulletin), :confirm => t('news.sure?'), :method => :delete, :remote => true %></li>
|
||||
<% if news_show_approval_link(news_bulletin) %>
|
||||
<li><%= link_to t('news.news_bulletin.approval'), panel_news_back_end_news_bulletin_approval_preview_path(news_bulletin) %></li><%#= #TODO add ancher so user can quick access into that part %>
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
+7
-6
@@ -5,8 +5,11 @@
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
<div id="news_bulletin_pagination">
|
||||
<%= paginate @news_bulletins, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]} %>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_news_back_end_news_bulletin_path, :class => 'btn btn-primary' %>
|
||||
<div id="news_bulletin_pagination" class="paginationFixed">
|
||||
<%= paginate @news_bulletins, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="news_bulletin_link_qe">
|
||||
@@ -20,12 +23,10 @@
|
||||
<%= render :partial => "news_bulletin_file_qe" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_news_back_end_news_bulletin_path, :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "news_bulletin_form" %>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
<%= javascript_include_tag "inc/modal-preview" %>
|
||||
<% end %>
|
||||
|
||||
+13
-53
@@ -4,7 +4,7 @@
|
||||
<div class="info1">
|
||||
<span class="date"><%= @news_bulletin.postdate %></span>
|
||||
|
|
||||
<a href="" class="unit"><%= User.find(@news_bulletin.create_user_id).name %></a>
|
||||
<a href="" class="unit"><%= @news_bulletin.unit_list_for_anc.title[I18n.locale] rescue '' %></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="news_image">
|
||||
@@ -14,58 +14,18 @@
|
||||
<div class="news_paragraph">
|
||||
<%= @news_bulletin.text[I18n.locale].html_safe %>
|
||||
</div>
|
||||
|
||||
<b><%= t('announcement.link') %></b>
|
||||
<% @news_bulletin.bulletin_links.each do | blink | %>
|
||||
<%= link_to blink.i18n_variable[I18n.locale], blink.url, :target => '_blank' %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.file') %></b>
|
||||
<% @news_bulletin.bulletin_files.each do | bfile | %>
|
||||
<%= link_to bfile.filetitle[I18n.locale], bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
|
||||
<% end %>
|
||||
|
||||
<div class="fb">
|
||||
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.nccu.edu.tw&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font&height=35&appId=263319013700607" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
|
||||
</div>
|
||||
<!--
|
||||
<p id="notice"><%= flash_messages %></p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<b><%= t('news.category') %></b>
|
||||
<%= @news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('news.postdate') %></b>
|
||||
<%= @news_bulletin.postdate %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('news.title') %></b>
|
||||
<%= @news_bulletin.title[I18n.locale] %>
|
||||
</li>
|
||||
<li>
|
||||
<%#= image_tag(@news_bulletin.image.url, :size => "320x240") if @news_bulletin.image.file %>
|
||||
<%= link_to image_tag(@news_bulletin.image.url, :size => "320x240"), @news_bulletin.image.url, {:target => '_blank', :title => @news_bulletin.image_identifier} if @news_bulletin.image.file %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('news.subtitle') %></b>
|
||||
<%= @news_bulletin.subtitle[I18n.locale].html_safe %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('news.text') %></b>
|
||||
<%= @news_bulletin.text[I18n.locale].html_safe %>
|
||||
</li>
|
||||
<li>
|
||||
<li>
|
||||
<b><%= t('news.link') %></b>
|
||||
<% @news_bulletin.news_bulletin_links.each do | blink | %>
|
||||
<%= link_to blink.name, blink.url, :target => '_blank' %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('news.file') %></b>
|
||||
<% @news_bulletin.news_bulletin_files.each do | bfile | %>
|
||||
<%= link_to bfile.filetitle, bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('news.張貼者') %></b>
|
||||
<%= User.find(@news_bulletin.create_user_id).name %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('news.最後修改時間') %></b>
|
||||
<%= @news_bulletin.updated_at.strftime("%Y-%m-%d %H:%I:%S") %>
|
||||
</li>
|
||||
-->
|
||||
|
||||
<%#= link_back %>
|
||||
+14
-1
@@ -2,7 +2,20 @@
|
||||
|
||||
<% if @news_bulletins and !@news_bulletins.nil? %>
|
||||
<h2 class="topic_title"><%= t('news.campus_news')%></h2>
|
||||
<%= link_to t('news.more'),panel_news_front_end_news_bulletins_path(), :class => "topic_note" %>
|
||||
<%#= link_to t('news.more'),panel_news_front_end_news_bulletins_path(), :class => "topic_note" %>
|
||||
<div class="btn-group topic_note">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<%= t('news.more') %>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<% @news_bulletin_categorys.each do |category| %>
|
||||
<li>
|
||||
<%= link_to category.i18n_variable[I18n.locale], panel_news_front_end_news_bulletins_path(:category_id => category.id) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="topic_prev">previous page</div>
|
||||
<div class="topic_next">next page</div>
|
||||
<ul id="topic_list">
|
||||
|
||||
+5
-1
@@ -6,6 +6,8 @@ Rails.application.routes.draw do
|
||||
match 'update_setting' => "news_approvals#update_setting" ,:as => :news_approval_update_setting
|
||||
|
||||
resources :news_bulletins do
|
||||
match "approve/:news_bulletin_id" => "approvals#preview_and_approve",:as => :approval_preview,:via => :put
|
||||
match "approve/:news_bulletin_id" => "approvals#approve",:as => :approve,:via => :post
|
||||
match "link_quick_add/:news_bulletin_id" => "news_bulletins#link_quick_add" ,:as => :link_quick_add
|
||||
match "link_quick_edit/:news_bulletin_id" => "news_bulletins#link_quick_edit" ,:as => :link_quick_edit
|
||||
member do
|
||||
@@ -31,7 +33,9 @@ Rails.application.routes.draw do
|
||||
resources :tags
|
||||
end
|
||||
namespace :front_end do
|
||||
resources :news_bulletins
|
||||
resources :news_bulletins # do
|
||||
# match "preview" => "news_bulletins#preview_content",:as => :get_preview_content
|
||||
# end
|
||||
end
|
||||
namespace :widget do
|
||||
match "news_bulletins" => "news_bulletins#index"
|
||||
|
||||
+2
-1
@@ -5,11 +5,12 @@ class Panel::PageContent::BackEnd::PageContextsController < OrbitBackendControll
|
||||
|
||||
def index
|
||||
|
||||
@page_contexts = PageContext.where(:archived => false).desc(:updated_at).page(params[:page]).per(10)
|
||||
@page_contexts = params[:sort] ? get_sorted_and_filtered("page_contexts", {:archived => false}) : PageContext.where(:archived => false).page(params[:page]).per(10)
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.xml { render :xml => @page_contexts }
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<div id='filter' class="subnav">
|
||||
<div class="filters">
|
||||
<div id="sort_headers" class="table-label">
|
||||
<%= render 'sort_headers' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "sort_header" %>
|
||||
<% end %>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
<%= render_sort_bar(false, ['name', 'page','span7', 'page_context.name'],
|
||||
['version', 'version', 'span2', 'page_context.version'],
|
||||
['update_time', 'updated_at', 'span2', 'page_context.update_time'],
|
||||
['last_modified', 'update_user_id', 'span2', 'page_context.last_modified']).html_safe %>
|
||||
+5
-21
@@ -1,22 +1,6 @@
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<div id="filter" class="subnav">
|
||||
<div class="filters">
|
||||
<div id="sort_headers" class="table-label">
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span7"><%= t('page_context.name') %></th>
|
||||
<th class="span2"><%= t('page_context.version') %></th>
|
||||
<th class="span2"><%= t('page_context.update_time') %></th>
|
||||
<th class="span2"><%= t('page_context.last_modified') %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'filter' %>
|
||||
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
@@ -27,13 +11,13 @@
|
||||
<th class="span2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody id="tbody_page_contexts" class="sort-holder">
|
||||
|
||||
<%= render :partial => 'page_context', :collection => @page_contexts %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @page_contexts %>
|
||||
|
||||
|
||||
<div id="page_context_pagination" class="paginationFixed">
|
||||
<%= paginate @page_contexts, :params => {:direction => params[:direction], :sort => params[:sort]} %>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
$("#sort_headers").html("<%= j render 'sort_headers' %>");
|
||||
$("#tbody_page_contexts").html("<%= j render :partial => 'page_context', :collection => @page_contexts %>");
|
||||
$("#page_context_pagination").html("<%= j paginate @page_contexts, :params => {:direction => params[:direction], :sort => params[:sort]} %>");
|
||||
+7
@@ -122,6 +122,13 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def delete
|
||||
if params[:to_delete]
|
||||
web_links = WebLink.any_in(:_id => params[:to_delete]).delete_all
|
||||
end
|
||||
redirect_to panel_web_resource_back_end_web_links_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<%= render_sort_bar(false, ['status', ['is_top', 'is_hot', 'is_hidden', 'is_pending', 'is_checked', 'is_rejected'], 'span1', 'bulletin.status'],
|
||||
<%= render_sort_bar(true, ['status', ['is_top', 'is_hot', 'is_hidden', 'is_pending', 'is_checked', 'is_rejected'], 'span1', 'bulletin.status'],
|
||||
['category', 'bulletin_category', 'span2', 'bulletin.category'],
|
||||
['name', 'name','span3', 'bulletin.title'],
|
||||
['tags', 'tags', 'span2', 'bulletin.tags']).html_safe %>
|
||||
+5
@@ -1,4 +1,9 @@
|
||||
<tr id="<%= dom_id web_link %>" class="with_action">
|
||||
<td>
|
||||
<% if (web_link.create_user_id == current_user.id) || is_manager? %>
|
||||
<%= check_box_tag 'to_delete[]', web_link.id, false, :class => "checkbox_in_list" %>
|
||||
<% end -%>
|
||||
</td>
|
||||
<td>
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
|
||||
Vendored
+17
-14
@@ -1,17 +1,20 @@
|
||||
<%= render 'filter' %>
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1"></th>
|
||||
<th class="span2"></th>
|
||||
<th class="span3"></th>
|
||||
<th class="span2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody_web_links" class="sort-holder">
|
||||
<%= render :partial => 'web_link', :collection => @web_links %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= form_for :news_bulletins, :url => delete_panel_web_resource_back_end_web_links_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), :html => {:id => 'delete_all'}, :remote => true do %>
|
||||
<%= render 'filter' %>
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1"></th>
|
||||
<th class="span1"></th>
|
||||
<th class="span2"></th>
|
||||
<th class="span3"></th>
|
||||
<th class="span2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody_web_links" class="sort-holder">
|
||||
<%= render :partial => 'web_link', :collection => @web_links %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
<div id="web_link_pagination" class="paginationFixed">
|
||||
<%= paginate @web_links, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||
|
||||
+5
-1
@@ -4,7 +4,11 @@ Rails.application.routes.draw do
|
||||
namespace :web_resource do
|
||||
namespace :back_end do
|
||||
root :to => "web_links#index"
|
||||
resources :web_links
|
||||
resources :web_links do
|
||||
collection do
|
||||
post 'delete'
|
||||
end
|
||||
end
|
||||
resources :web_link_categorys
|
||||
resources :tags
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user