Merge branch 'design_team' into ldap
Conflicts: vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb
This commit is contained in:
commit
f1c8bed29d
Binary file not shown.
After Width: | Height: | Size: 8.0 KiB |
|
@ -0,0 +1,7 @@
|
||||||
|
jQuery(document).ajaxStart(function(){
|
||||||
|
$('<div class="modal-backdrop fade in" id="sys_modal"><img src="/assets/ajax-loader.gif" style="margin-top: 25%;margin-left: 50%;"></div>').appendTo('body');
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery(document).ajaxComplete(function(){
|
||||||
|
$("#sys_modal").hide().remove();
|
||||||
|
});
|
|
@ -40,11 +40,11 @@ $(".nav-tabs").find(".icons-pencil").click(function(){
|
||||||
data: { body: content_holder.html() },
|
data: { body: content_holder.html() },
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
$(selector).attr("contenteditable",false)
|
$(selector).attr("contenteditable",false)
|
||||||
alert("<%= I18n.t("admin.contenteditable.update_done") %>");
|
alert("<%= I18n.t('admin.contenteditable.update_done') %>");
|
||||||
//content_holder.effect('highlight', {'color': '#0f0'}, 3000);
|
//content_holder.effect('highlight', {'color': '#0f0'}, 3000);
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
alert("<%= I18n.t("admin.contenteditable.update_failed") %>");
|
alert("<%= I18n.t('admin.contenteditable.update_failed') %>");
|
||||||
//content_holder.effect('highlight', {'color': '#f00'}, 3000);
|
//content_holder.effect('highlight', {'color': '#f00'}, 3000);
|
||||||
content_holder.html(content);
|
content_holder.html(content);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,3 +17,4 @@
|
||||||
//= require side_bar_history
|
//= require side_bar_history
|
||||||
//= require rss
|
//= require rss
|
||||||
//= require ajax_form
|
//= require ajax_form
|
||||||
|
//= require inc/ajax_setting
|
||||||
|
|
|
@ -34,6 +34,10 @@ $('.part_kind').live('click', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
bindTreeDragHandle();
|
||||||
|
});
|
||||||
|
|
||||||
|
var bindTreeDragHandle = function(){
|
||||||
$('ol.sortable').nestedSortable({
|
$('ol.sortable').nestedSortable({
|
||||||
disableNesting: 'no-nest',
|
disableNesting: 'no-nest',
|
||||||
forcePlaceholderSize: true,
|
forcePlaceholderSize: true,
|
||||||
|
@ -52,4 +56,4 @@ $(document).ready(function(){
|
||||||
$.post("<%= Rails.application.routes.url_helpers.admin_update_position_path %>", { id: ui.item.attr('id'), parent_id: ui.item.parent().closest('li').attr('id'), position: ui.item.index() } );
|
$.post("<%= Rails.application.routes.url_helpers.admin_update_position_path %>", { id: ui.item.attr('id'), parent_id: ui.item.parent().closest('li').attr('id'), position: ui.item.index() } );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
|
@ -1,14 +1,5 @@
|
||||||
var history_edited = false;
|
var history_edited = false;
|
||||||
|
|
||||||
$('#back_sidebar a, #back_main a.nav').live('click',
|
|
||||||
function () {
|
|
||||||
$.getScript(this.href);
|
|
||||||
history.pushState(null, document.title, this.href);
|
|
||||||
history_edited = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
$('#back_main a.reload').live('click',
|
$('#back_main a.reload').live('click',
|
||||||
function () {
|
function () {
|
||||||
$.getScript(this.href);
|
$.getScript(this.href);
|
||||||
|
@ -18,7 +9,7 @@ $('#back_main a.reload').live('click',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$('#back_main .form').live('submit', function () {
|
$('#back_main form').live('submit', function () {
|
||||||
$.post(this.action, $(this).serialize(), null, 'script');
|
$.post(this.action, $(this).serialize(), null, 'script');
|
||||||
history_edited = true;
|
history_edited = true;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -18,6 +18,18 @@
|
||||||
padding: 3px 0px;
|
padding: 3px 0px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
.nav-list>li>ol {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
.nav-list>li>.with_action {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
.nav-list>li>.with_action>.quick-edit {
|
||||||
|
margin: 0 0 0 3px !important;
|
||||||
|
}
|
||||||
|
.nav-list>li>.with_action>i {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
#back_sidebar h1 {
|
#back_sidebar h1 {
|
||||||
background: url(<%= asset_path "h1_bg.png" %>) repeat-x scroll left top transparent;
|
background: url(<%= asset_path "h1_bg.png" %>) repeat-x scroll left top transparent;
|
||||||
|
@ -126,7 +138,7 @@
|
||||||
background: none repeat scroll 0 0 #FFFFFF;
|
background: none repeat scroll 0 0 #FFFFFF;
|
||||||
border: 1px solid #DDDDDD;
|
border: 1px solid #DDDDDD;
|
||||||
border-radius: 5px 5px 5px 5px;
|
border-radius: 5px 5px 5px 5px;
|
||||||
margin: 0 0 0 3px;
|
margin: 0 0 0 20px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
z-index:1;
|
z-index:1;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -155,7 +167,7 @@ ol.nav>li>.icons-moves {
|
||||||
}
|
}
|
||||||
.sortable i {
|
.sortable i {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -20px;
|
left: 0px;
|
||||||
top: 6px;
|
top: 6px;
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
|
@ -166,6 +178,9 @@ ol.nav>li>.icons-moves {
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
filter: alpha(opacity=70);
|
filter: alpha(opacity=70);
|
||||||
}
|
}
|
||||||
|
.with_action {
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
.placeholder {
|
.placeholder {
|
||||||
background-color: rgba(0,136,204,.6);
|
background-color: rgba(0,136,204,.6);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class Admin::AdBannersController < OrbitBackendController
|
class Admin::AdBannersController < OrbitBackendController
|
||||||
layout "new_admin"
|
layout "new_admin"
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
before_filter :for_app_manager,:except => [:index,:show]
|
before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview]
|
||||||
before_filter :for_app_sub_manager
|
before_filter :for_app_sub_manager
|
||||||
|
|
||||||
def rename
|
def rename
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class Admin::AdImagesController < ApplicationController
|
class Admin::AdImagesController < OrbitBackendController
|
||||||
layout 'new_admin'
|
layout 'new_admin'
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
before_filter :is_admin?
|
before_filter :for_app_sub_manager
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@ad_banner = AdBanner.find params[:ad_banner_id]
|
@ad_banner = AdBanner.find params[:ad_banner_id]
|
||||||
|
|
|
@ -65,9 +65,11 @@ class Admin::LinksController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete
|
def delete
|
||||||
|
@item = Link.find(params[:id])
|
||||||
|
@item.destroy
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {}
|
format.html {}
|
||||||
format.js { destroy }
|
format.js { @item = @item.parent }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Admin::PagesController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@item = Page.new(params[:page])
|
@item = Page.new(params[:page])
|
||||||
|
|
||||||
if @item.module_app.key == 'page_content'
|
if @item.module_app && @item.module_app.key == 'page_content'
|
||||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -99,14 +99,16 @@ class Admin::PagesController < ApplicationController
|
||||||
format.html {
|
format.html {
|
||||||
redirect_to admin_items_url( :parent_id => @item.parent_id )
|
redirect_to admin_items_url( :parent_id => @item.parent_id )
|
||||||
}
|
}
|
||||||
format.js {}
|
format.js { redirect_to admin_items_url }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete
|
def delete
|
||||||
|
@item = Page.find(params[:id])
|
||||||
|
@item.destroy
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {}
|
format.html {}
|
||||||
format.js { destroy }
|
format.js { @item = @item.parent }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_homepage
|
def get_homepage
|
||||||
Item.first(:conditions => {:parent_id => nil})
|
Page.root
|
||||||
end
|
end
|
||||||
|
|
||||||
def layout_by_resource
|
def layout_by_resource
|
||||||
|
|
|
@ -32,13 +32,8 @@ class OrbitBackendController< ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_sorted_and_filtered(object_class, query=nil)
|
def get_sorted_and_filtered(object_class, query=nil)
|
||||||
|
objects = get_objects(object_class, query)
|
||||||
object_class = object_class.classify.constantize
|
object_class = object_class.classify.constantize
|
||||||
if query
|
|
||||||
objects = object_class.all.where(query)
|
|
||||||
else
|
|
||||||
objects = object_class.all
|
|
||||||
end
|
|
||||||
|
|
||||||
if !params[:sort].blank?
|
if !params[:sort].blank?
|
||||||
options = params[:sort_options]
|
options = params[:sort_options]
|
||||||
options = [options] if !options.class.eql?(Array)
|
options = [options] if !options.class.eql?(Array)
|
||||||
|
@ -79,7 +74,7 @@ class OrbitBackendController< ApplicationController
|
||||||
when 'categories'
|
when 'categories'
|
||||||
a = Array.new
|
a = Array.new
|
||||||
objects.each do |object|
|
objects.each do |object|
|
||||||
a << object if value.include?(object.send("#{object.class.to_s.underscore}_category").id.to_s)
|
a << object if (value.include?(object.send("#{object.class.to_s.underscore}_category").id.to_s) rescue nil)
|
||||||
end
|
end
|
||||||
objects = a.uniq
|
objects = a.uniq
|
||||||
when 'tags'
|
when 'tags'
|
||||||
|
@ -93,7 +88,7 @@ class OrbitBackendController< ApplicationController
|
||||||
end if value.size > 0
|
end if value.size > 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Kaminari.paginate_array(objects).page(params[:page]).per(10)
|
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_string_value_from_object(object)
|
def get_string_value_from_object(object)
|
||||||
|
@ -104,9 +99,9 @@ class OrbitBackendController< ApplicationController
|
||||||
if s
|
if s
|
||||||
case s.class.to_s
|
case s.class.to_s
|
||||||
when "String"
|
when "String"
|
||||||
s.downcase
|
s.downcase rescue ''
|
||||||
when "I18nVariable"
|
when "I18nVariable"
|
||||||
s[I18n.locale].downcase
|
s[I18n.locale].downcase rescue ''
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
@ -158,4 +153,37 @@ class OrbitBackendController< ApplicationController
|
||||||
a.flatten
|
a.flatten
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def get_viewable(object_class)
|
||||||
|
objects = get_objects(object_class)
|
||||||
|
Kaminari.paginate_array(objects).page(params[:page]).per(10)
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_objects(object_class, query=nil)
|
||||||
|
object_class = object_class.classify.constantize
|
||||||
|
if query
|
||||||
|
objects = object_class.all.where(query)
|
||||||
|
else
|
||||||
|
objects = object_class.all
|
||||||
|
end
|
||||||
|
objects
|
||||||
|
end
|
||||||
|
|
||||||
|
def filter_authorized_objects(objects)
|
||||||
|
if(!is_admin? || !is_manager?)
|
||||||
|
objects.delete_if{ |object|
|
||||||
|
if object.is_pending == true
|
||||||
|
if check_permission(:manager)
|
||||||
|
object.create_user_id != current_user.id
|
||||||
|
else
|
||||||
|
!object.send("#{object.class.to_s.underscore}_category").authed_users('fact_check').include?(current_user) rescue false
|
||||||
|
end
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
objects
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -11,14 +11,14 @@ module Admin::ItemHelper
|
||||||
no_nested = 'no-nest'
|
no_nested = 'no-nest'
|
||||||
end
|
end
|
||||||
ret << "<li id='#{node.id}' class='#{no_nested}'>"
|
ret << "<li id='#{node.id}' class='#{no_nested}'>"
|
||||||
ret << "<i class='icons-moves'></i>"
|
# ret << "<i class='icons-moves'></i>"
|
||||||
ret << "<div class='with_action'>"
|
ret << "<div class='with_action'><i class='icons-moves'></i>"
|
||||||
ret << (link_to node.i18n_variable[I18n.locale], dest)
|
ret << (link_to node.i18n_variable[I18n.locale], dest, :class => 'js_history')
|
||||||
ret << "<div class='quick-edit hide'>"
|
ret << "<div class='quick-edit hide'>"
|
||||||
ret << (link_to t('admin.edit'), eval("edit_admin_#{node._type.downcase}_path(node)")) if node._type.eql?('Page')
|
ret << (link_to t('admin.edit'), eval("edit_admin_#{node._type.downcase}_path(node)"), :class => 'js_history') if node._type.eql?('Page')
|
||||||
ret << (link_to t('admin.new_page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page') if node._type.eql?('Page')
|
ret << (link_to t('admin.new_page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page js_history') if node._type.eql?('Page')
|
||||||
ret << (link_to t('admin.new_link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link') if node._type.eql?('Page')
|
ret << (link_to t('admin.new_link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link js_history') if node._type.eql?('Page')
|
||||||
ret << (link_to t(:delete), eval("delete_admin_#{node._type.downcase}_path(node, :authenticity_token => form_authenticity_token)"), :confirm => t('sure?'), :class => 'delete')
|
ret << (link_to t(:delete), eval("delete_admin_#{node._type.downcase}_path(node, :authenticity_token => form_authenticity_token)"), :confirm => t('sure?'), :class => 'delete js_history')
|
||||||
ret << "</div>"
|
ret << "</div>"
|
||||||
ret << "</div>"
|
ret << "</div>"
|
||||||
ret << render_children(node)
|
ret << render_children(node)
|
||||||
|
|
|
@ -204,4 +204,12 @@ module ApplicationHelper
|
||||||
is_manager? || is_admin?
|
is_manager? || is_admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def display_date_time(object)
|
||||||
|
object.strftime("%Y-%m-%d %H:%M")
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_date(object)
|
||||||
|
object.strftime("%Y-%m-%d")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,10 +34,10 @@ class Asset
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def set_key
|
def set_key
|
||||||
if title.new_record?
|
if title && title.new_record?
|
||||||
title.key = 'title'
|
title.key = 'title'
|
||||||
end
|
end
|
||||||
if description.new_record?
|
if description && description.new_record?
|
||||||
description.key = 'description'
|
description.key = 'description'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,15 +11,17 @@ class Item
|
||||||
field :enabled_for, :type => Array, :default => nil
|
field :enabled_for, :type => Array, :default => nil
|
||||||
field :menu_enabled_for, :type => Array, :default => nil
|
field :menu_enabled_for, :type => Array, :default => nil
|
||||||
|
|
||||||
|
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
|
||||||
|
|
||||||
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
|
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
|
||||||
validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
|
validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
|
||||||
validates_uniqueness_of :name, :scope => :parent_id
|
validates_uniqueness_of :name, :scope => :parent_id
|
||||||
validates_presence_of :name
|
validates_presence_of :name
|
||||||
|
|
||||||
validates_associated :parent, :children
|
validates_associated :parent, :children
|
||||||
|
|
||||||
|
before_destroy :destroy_children
|
||||||
after_rearrange :rebuild_path
|
after_rearrange :rebuild_path
|
||||||
|
|
||||||
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
|
|
||||||
|
|
||||||
def self.find_by_name(item_name)
|
def self.find_by_name(item_name)
|
||||||
Item.first(:conditions => { :name => item_name, :is_published => true })
|
Item.first(:conditions => { :name => item_name, :is_published => true })
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Link < Item
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def add_http
|
def add_http
|
||||||
unless self.url[/^http?s:\/\//]
|
unless self.url[/^http:\/\//] || self.url[/^https:\/\//]
|
||||||
self.url = 'http://' + self.url
|
self.url = 'http://' + self.url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
|
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
|
||||||
<%= f.label :transition_sec, t('admin.ad.transition_sec') %>
|
<%= f.label :transition_sec, t('admin.ad.transition_sec') %>
|
||||||
<%= f.text_field :transition_sec,:placeholder=>t('admin.ad.sec_place_holder'),:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %>
|
<%= f.text_field :transition_sec,:placeholder=>t('admin.ad.sec_place_holder'),:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %>
|
||||||
|
<%if at_least_module_manager%>
|
||||||
|
<%= f.label :best_size, t('admin.ad.best_size') %>
|
||||||
|
<%= f.text_field :best_size %> Ex: 500px x 300px
|
||||||
|
<% end -%>
|
||||||
<br>
|
<br>
|
||||||
<%= f.submit t("admin.ad.update_banner"), :class => 'btn' %>
|
<%= f.submit t("admin.ad.update_banner"), :class => 'btn' %>
|
||||||
<%= f.submit t("cancel"),:type=>'reset', :class => 'btn' %>
|
<%= f.submit t("cancel"),:type=>'reset', :class => 'btn' %>
|
||||||
|
|
|
@ -22,6 +22,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<%= f.label :best_size, t('admin.ad.best_size'),:class => "control-label" %>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.text_field :best_size %> Ex: 500px x 300px
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<%= f.label :ad_fx, t('admin.ad.ab_fx') %>
|
<%= f.label :ad_fx, t('admin.ad.ab_fx') %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -13,11 +13,16 @@
|
||||||
<ul id="banner_tab" class="nav nav-tabs">
|
<ul id="banner_tab" class="nav nav-tabs">
|
||||||
<% @ad_banners.each do |ab| %>
|
<% @ad_banners.each do |ab| %>
|
||||||
<%= content_tag :li ,:class => (ab == @active ? 'active' : nil) do %>
|
<%= content_tag :li ,:class => (ab == @active ? 'active' : nil) do %>
|
||||||
|
<%if at_least_module_manager%>
|
||||||
<i class="icons-pencil"></i>
|
<i class="icons-pencil"></i>
|
||||||
<%= link_to(ab.title,"##{ab.title.dehumanize}",:contenteditable=>"false",:data=>{:toggle=>"tab" ,'edit-url' =>(admin_rename_ad_banner_path ab) } )%>
|
<%= link_to(ab.title,"##{ab.title.dehumanize}",:contenteditable=>"false",:data=>{:toggle=>"tab" ,'edit-url' =>(admin_rename_ad_banner_path ab) } )%>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to(ab.title,"##{ab.title.dehumanize}",:data=>{:toggle=>"tab" } )%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<%= content_tag :li,link_to(t("admin.ad.new_banner"),"#new-a-banner",:data=>{:toggle=>"modal"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) %>
|
<% end -%>
|
||||||
|
|
||||||
|
<%= content_tag :li,link_to(t("admin.ad.new_banner"),"#new-a-banner",:data=>{:toggle=>"modal"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) if at_least_module_manager%>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,10 @@
|
||||||
<!--請程式務必將圖片尺寸加入到行內裡-->
|
<!--請程式務必將圖片尺寸加入到行內裡-->
|
||||||
<%= image_tag @ad_image.file rescue ''%>
|
<%= image_tag @ad_image.file rescue ''%>
|
||||||
</div>
|
</div>
|
||||||
<span class="alert widgetInfo"><%= t("admin.ad.widget_info_for_ad_image_size",:best_size=> @ad_image.ad_banner.best_size) if !@ad_image.ad_banner.best_size.empty?%></span>
|
<% if !@ad_image.ad_banner.best_size.empty?%>
|
||||||
|
<span class="alert widgetInfo"><%= t("admin.ad.widget_info_for_ad_image_size",:best_size=> @ad_image.ad_banner.best_size) %>
|
||||||
|
</span>
|
||||||
|
<% end -%>
|
||||||
<div class="controls file-upload input-prepend">
|
<div class="controls file-upload input-prepend">
|
||||||
<label class="control-label add-on btn" for="input-upload">
|
<label class="control-label add-on btn" for="input-upload">
|
||||||
<%= t(:browse) %>
|
<%= t(:browse) %>
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
<% content_for :side_bar do %>
|
||||||
|
<%= render 'admin/sites/side_bar' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<h1><%= t('admin.editing_design') %></h1>
|
<h1><%= t('admin.editing_design') %></h1>
|
||||||
|
|
||||||
<%= form_for @design, :url => admin_design_path(@design),:html => {:multipart => true} do |f| %>
|
<%= form_for @design, :url => admin_design_path(@design),:html => {:multipart => true} do |f| %>
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
<% content_for :side_bar do %>
|
||||||
|
<%= render 'admin/sites/side_bar' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= form_for :news_bulletins, :url => delete_admin_designs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), :html => {:id => 'delete_all'}, :remote => true do %>
|
<%= form_for :news_bulletins, :url => delete_admin_designs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), :html => {:id => 'delete_all'}, :remote => true do %>
|
||||||
<%= render 'filter' %>
|
<%= render 'filter' %>
|
||||||
<table class="table main-list">
|
<table class="table main-list">
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
<% content_for :side_bar do %>
|
||||||
|
<%= render 'admin/sites/side_bar' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<h1><%= t('admin.new_design') %></h1>
|
<h1><%= t('admin.new_design') %></h1>
|
||||||
|
|
||||||
<%= form_for :design, :url => admin_designs_path, :html => {:multipart => true} do |f| %>
|
<%= form_for :design, :url => admin_designs_path, :html => {:multipart => true} do |f| %>
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
<% content_for :side_bar do %>
|
||||||
|
<%= render 'admin/sites/side_bar' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="main2">
|
<div class="main2">
|
||||||
<%= form_tag '',:multipart => true,:action=>"post" do |f| %>
|
<%= form_tag '',:multipart => true,:action=>"post" do |f| %>
|
||||||
|
|
||||||
|
|
|
@ -1 +1,6 @@
|
||||||
|
<ol class="nav nav-list">
|
||||||
<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %>
|
<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %>
|
||||||
|
</ol>
|
||||||
|
<script type="text/javascript">
|
||||||
|
bindTreeDragHandle();
|
||||||
|
</script>
|
|
@ -1,9 +1,7 @@
|
||||||
$('#back_main').empty();
|
$('#back_main').empty();
|
||||||
switch ("<%= escape_javascript(@item._type)%>") {
|
<% case @item._type %>
|
||||||
case 'Link':
|
<% when 'Page' %>
|
||||||
$('#back_main').append("<%= escape_javascript(render(:partial => 'admin/links/show')) %>");
|
|
||||||
break;
|
|
||||||
case 'Page':
|
|
||||||
$('#back_main').append("<%= escape_javascript(render(:partial => 'admin/pages/show')) %>");
|
$('#back_main').append("<%= escape_javascript(render(:partial => 'admin/pages/show')) %>");
|
||||||
break;
|
<% when 'Link' %>
|
||||||
};
|
$('#back_main').append("<%= escape_javascript(render(:partial => 'admin/links/show')) %>");
|
||||||
|
<% end %>
|
|
@ -1 +1,3 @@
|
||||||
$('#back_sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>");
|
$('#back_sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>");
|
||||||
|
$('#back_main').html("<%= escape_javascript(render(:partial => 'admin/pages/show')) %>");
|
||||||
|
history.pushState(null, document.title, "<%= escape_javascript(admin_items_url) %>");
|
|
@ -4,7 +4,7 @@
|
||||||
<%= form_for @item, :url => admin_pages_path, :html => { :class => 'form-horizontal edit_page' } do |f| %>
|
<%= form_for @item, :url => admin_pages_path, :html => { :class => 'form-horizontal edit_page' } do |f| %>
|
||||||
<%= render :partial => "form", :locals => { :f => f } %>
|
<%= render :partial => "form", :locals => { :f => f } %>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<%= f.submit t('update'), :class => 'btn btn-primary' %>
|
<%= f.submit t('create'), :class => 'btn btn-primary' %>
|
||||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
$('#back_sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>");
|
$('#back_sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>");
|
||||||
|
$('#back_main').html("<%= escape_javascript(render(:partial => 'admin/pages/show')) %>");
|
||||||
|
history.pushState(null, document.title, "<%= escape_javascript(admin_items_url) %>");
|
|
@ -10,3 +10,7 @@
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
|
<%= content_tag :li, :class => active_for_controllers('designs') do -%>
|
||||||
|
<%= link_to content_tag(:i, nil, :class => 'icons-window-block') + t('admin.design'), admin_designs_path %>
|
||||||
|
<% end -%>
|
||||||
|
|
|
@ -5,4 +5,4 @@
|
||||||
per_page: number of items to fetch per page
|
per_page: number of items to fetch per page
|
||||||
remote: data-remote
|
remote: data-remote
|
||||||
-%>
|
-%>
|
||||||
<li class="page gap"><%= raw(t 'views.pagination.truncate') %></li>
|
<!-- <li class="page gap"><%= raw(t 'views.pagination.truncate') %></li> -->
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<%= content_tag :li, link_to(t('announcement.add_new'), new_panel_news_back_end_news_bulletin_path), :class => active_for_action('news_bulletins', 'new') %>
|
<%= content_tag :li, link_to(t('announcement.add_new'), new_panel_news_back_end_news_bulletin_path), :class => active_for_action('news_bulletins', 'new') %>
|
||||||
<%= content_tag :li, link_to(t('announcement.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') || active_for_ob_auths_object("NewsBulletinCategory") %>
|
<%= content_tag :li, link_to(t('announcement.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') || active_for_ob_auths_object("NewsBulletinCategory") %>
|
||||||
<%= content_tag :li, link_to(t('announcement.tags'), panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') %>
|
<%= content_tag :li, link_to(t('announcement.tags'), panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') %>
|
||||||
<%= content_tag :li, link_to(t('announcement.bulletin.approval_setting'), panel_news_back_end_news_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %>
|
<%= content_tag :li, link_to(t('announcement.bulletin.approval_setting'), panel_news_back_end_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %>
|
||||||
<%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_for_app_auth('news') if (is_admin? rescue nil) %>
|
<%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_for_app_auth('news') if (is_admin? rescue nil) %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
|
@ -45,10 +45,6 @@
|
||||||
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<%= content_tag :li, :class => active_for_controllers('designs') do -%>
|
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icons-window-block') + t('admin.design'), admin_designs_path %>
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') ||active_for_ob_auths_object("AdBanner") ||active_for_app_auth('ad_banners') do -%>
|
<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') ||active_for_ob_auths_object("AdBanner") ||active_for_app_auth('ad_banners') do -%>
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.ad_banner'), admin_ad_banners_path %>
|
<%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.ad_banner'), admin_ad_banners_path %>
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="viewport">
|
<div class="viewport">
|
||||||
<div id='back_sidebar' class="overview">
|
<div id='back_sidebar' class="overview">
|
||||||
<ol class="nav nav-list">
|
|
||||||
<%= yield :sidebar %>
|
<%= yield :sidebar %>
|
||||||
</ol>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -91,6 +91,7 @@ en:
|
||||||
ab_fx: FX
|
ab_fx: FX
|
||||||
all_banners: AdBanner list
|
all_banners: AdBanner list
|
||||||
banner_best_size: Banner Best Size
|
banner_best_size: Banner Best Size
|
||||||
|
best_size: Best size
|
||||||
new_banner: New banner
|
new_banner: New banner
|
||||||
new_image: New image
|
new_image: New image
|
||||||
showing: Showing
|
showing: Showing
|
||||||
|
@ -216,6 +217,10 @@ en:
|
||||||
options: Options
|
options: Options
|
||||||
orig_upload_file: Original filename
|
orig_upload_file: Original filename
|
||||||
page: Page
|
page: Page
|
||||||
|
page_context:
|
||||||
|
edit: Edit
|
||||||
|
ob_auth:
|
||||||
|
edit: Category authorization
|
||||||
page_part_kinds:
|
page_part_kinds:
|
||||||
text: Text Area
|
text: Text Area
|
||||||
public_r_tag: System Widget
|
public_r_tag: System Widget
|
||||||
|
|
|
@ -88,6 +88,7 @@ zh_tw:
|
||||||
ab_fx: 轉場特效
|
ab_fx: 轉場特效
|
||||||
all_banners: 輪播清單
|
all_banners: 輪播清單
|
||||||
banner_best_size: Banner 尺寸
|
banner_best_size: Banner 尺寸
|
||||||
|
best_size: 最佳尺寸
|
||||||
cate_auth: 分類授權
|
cate_auth: 分類授權
|
||||||
delete_banner: 刪除整組輪播
|
delete_banner: 刪除整組輪播
|
||||||
new_banner: 新增輪播
|
new_banner: 新增輪播
|
||||||
|
|
|
@ -8,7 +8,7 @@ defaults: &defaults
|
||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: prototype_r4_ldap0229
|
database: prototype_r4_development
|
||||||
|
|
||||||
test:
|
test:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
|
@ -22,4 +22,4 @@ production:
|
||||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: prototype_r4_ldap0229
|
database: prototype_r4_development
|
||||||
|
|
|
@ -32,7 +32,11 @@ module OrbitCoreLib
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_object_auth_by_title(title)
|
def get_object_auth_by_title(title)
|
||||||
self.object_auths.where({title: title }).first
|
oa = self.object_auths.where({title: title }).first
|
||||||
|
if oa.nil? && (self.class::ObjectAuthTitlesOptions.include? title)
|
||||||
|
oa = self.object_auths.create title: title
|
||||||
|
end
|
||||||
|
oa
|
||||||
end
|
end
|
||||||
|
|
||||||
def authed_users(title=nil)
|
def authed_users(title=nil)
|
||||||
|
|
|
@ -20,8 +20,8 @@ class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendControlle
|
||||||
else
|
else
|
||||||
@bulletin_category = @bulletin_categorys.first
|
@bulletin_category = @bulletin_categorys.first
|
||||||
end
|
end
|
||||||
preload_object_auth = @bulletin_category.object_auths.where(title: 'fact_check').empty?? (@bulletin_category.object_auths.create! :title=> 'fact_check') : @bulletin_category.object_auths.where(title: 'fact_check')
|
preload_object_auth = @bulletin_category.get_object_auth_by_title('fact_check')
|
||||||
@users_array = preload_object_auth.first.privilege_users rescue []
|
@users_array = preload_object_auth.privilege_users rescue []
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.js
|
format.js
|
||||||
|
@ -31,9 +31,9 @@ class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendControlle
|
||||||
def update_setting
|
def update_setting
|
||||||
object_auth = update_setting_by_params
|
object_auth = update_setting_by_params
|
||||||
if object_auth.save!
|
if object_auth.save!
|
||||||
flash[:notice] = "Update Done"
|
flash[:notice] = t("admin.object_auth.update_done")
|
||||||
else
|
else
|
||||||
flash[:notice] = "Update Failed"
|
flash[:notice] = t("admin.object_auth.update_failed")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
|
|
||||||
|
|
||||||
# @bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered_bulletins : Bulletin.all.page(params[:page]).per(10)
|
# @bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered_bulletins : Bulletin.all.page(params[:page]).per(10)
|
||||||
@bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered("bulletin") : Bulletin.all.page(params[:page]).per(10)
|
@bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered("bulletin") : get_viewable("bulletin")
|
||||||
@bulletin_categories = BulletinCategory.all
|
@bulletin_categories = BulletinCategory.all
|
||||||
|
|
||||||
@bulletin_link = BulletinLink.new
|
@bulletin_link = BulletinLink.new
|
||||||
|
@ -45,12 +45,6 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
@bulletin_file = BulletinFile.new
|
@bulletin_file = BulletinFile.new
|
||||||
@file_url = panel_announcement_back_end_bulletins_path
|
@file_url = panel_announcement_back_end_bulletins_path
|
||||||
|
|
||||||
if(!is_admin? || !is_manager?)
|
|
||||||
@bulletins.delete_if{ |bulletin|
|
|
||||||
bulletin.is_pending == true && ((!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) || bulletin.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 { }
|
||||||
|
|
|
@ -38,7 +38,6 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||||
def preview_content
|
def preview_content
|
||||||
@bulletin = Bulletin.find params[:id]
|
@bulletin = Bulletin.find params[:id]
|
||||||
get_categorys
|
get_categorys
|
||||||
render :show
|
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -160,13 +160,13 @@ class Bulletin
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def set_key
|
def set_key
|
||||||
if title.new_record?
|
if title && title.new_record?
|
||||||
title.key = 'title'
|
title.key = 'title'
|
||||||
end
|
end
|
||||||
if subtitle.new_record?
|
if subtitle && subtitle.new_record?
|
||||||
subtitle.key = 'subtitle'
|
subtitle.key = 'subtitle'
|
||||||
end
|
end
|
||||||
if text.new_record?
|
if text && text.new_record?
|
||||||
text.key = 'text'
|
text.key = 'text'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,10 +29,10 @@ class BulletinFile
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def set_key
|
def set_key
|
||||||
if filetitle.new_record?
|
if filetitle && filetitle.new_record?
|
||||||
filetitle.key = 'filetitle'
|
filetitle.key = 'filetitle'
|
||||||
end
|
end
|
||||||
if description.new_record?
|
if description && description.new_record?
|
||||||
description.key = 'description'
|
description.key = 'description'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,11 +16,9 @@
|
||||||
<%= select "category",'id',@options_from_collection_for_select_bulletin_categorys %>
|
<%= select "category",'id',@options_from_collection_for_select_bulletin_categorys %>
|
||||||
<%= search_field_tag 'user_filter' %>
|
<%= search_field_tag 'user_filter' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<%= link_to t("announcement.bulletin.approval_user_list"), panel_announcement_back_end_approval_user_list_path , :class=>'preview_trigger btn btn-success pull-right'%>
|
<%= link_to t("announcement.bulletin.approval_user_list"), panel_announcement_back_end_approval_user_list_path , :class=>'preview_trigger btn btn-success pull-right'%>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<%#= label_tag :role, t("admin.roles") %>
|
<%#= label_tag :role, t("admin.roles") %>
|
||||||
<div class="clear">
|
<div class="clear">
|
||||||
|
|
|
@ -60,8 +60,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><%= bulletin.postdate %></td>
|
<td><%= display_date_time(bulletin.postdate) %></td>
|
||||||
<td><%= (bulletin.deadline) ? bulletin.deadline : t('bulletin.no_deadline') %></td>
|
<td><%= (bulletin.deadline) ? display_date_time(bulletin.deadline ): t('bulletin.no_deadline') %></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="label-group">
|
<div class="label-group">
|
||||||
<div class="label-td">
|
<div class="label-td">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.postdate') %></b>
|
<b><%= t('announcement.postdate') %></b>
|
||||||
<%= @bulletin.postdate %>
|
<%= display_date_time(@bulletin.postdate) %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.title') %></b>
|
<b><%= t('announcement.title') %></b>
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.最後修改時間') %></b>
|
<b><%= t('announcement.最後修改時間') %></b>
|
||||||
<%= @bulletin.updated_at %>
|
<%= display_date(@bulletin.updated_at) %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
||||||
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= post.postdate %></td>
|
<td><%= display_date_time(post.postdate) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -2,10 +2,11 @@
|
||||||
<h1 class="h1"><%= @bulletin.title[I18n.locale] %></h1>
|
<h1 class="h1"><%= @bulletin.title[I18n.locale] %></h1>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="info1">
|
<div class="info1">
|
||||||
<span class="date"><%= @bulletin.postdate %></span>
|
<span class="pull-right"><%= dislpay_view_count(@bulletin) %></span>
|
||||||
|
|
<span class="date"><%= display_date_time(@bulletin.postdate) %></span>
|
||||||
<a href="" class="unit"><%= User.find(@bulletin.create_user_id).sub_roles.collect{|t| t.key}.join(" ") rescue '' %></a>
|
<% unit = User.find(@bulletin.create_user_id).sub_roles.collect{|t| t.key}.join(" ") rescue nil %>
|
||||||
<span><%= dislpay_view_count(@bulletin) %></span>
|
<%= " | " if unit %>
|
||||||
|
<a href="" class="unit"><%= unit %></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="news_image">
|
<div class="news_image">
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<td><%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
|
<td><%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
|
||||||
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= post.postdate %></td>
|
<td><%= display_date_time(post.postdate) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -4,7 +4,7 @@ class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController
|
||||||
include AdminHelper
|
include AdminHelper
|
||||||
|
|
||||||
def preview_and_approve
|
def preview_and_approve
|
||||||
@news_bulletin = NewsBulletin.find params[:news_bulletin_id]
|
@news_bulletin = NewsBulletin.find params[:news_category][:id]
|
||||||
end
|
end
|
||||||
|
|
||||||
def approve
|
def approve
|
||||||
|
@ -14,20 +14,14 @@ class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController
|
||||||
def setting
|
def setting
|
||||||
@sys_users = User.all(conditions: {admin: false})
|
@sys_users = User.all(conditions: {admin: false})
|
||||||
@news_bulletin_categorys = NewsBulletinCategory.all
|
@news_bulletin_categorys = NewsBulletinCategory.all
|
||||||
if params.has_key?(:category_id)
|
@options_from_collection_for_select_news_bulletin_categorys = @news_bulletin_categorys.collect{|bc| [bc.i18n_variable[I18n.locale],bc.id] }
|
||||||
first_category = NewsBulletinCategory.find params[:category_id]
|
if params.has_key? :news_category
|
||||||
if params[:commit] == 'Update'
|
@news_bulletin_categorys = NewsBulletinCategory.find params[:news_category][:id]
|
||||||
privilege_users = params[:users].collect{|key,value| User.find key } rescue []
|
|
||||||
preload_object_auth_ary = first_category.object_auths.where(title: 'fact_check') || (first_category.object_auths.create :title=> 'fact_check')
|
|
||||||
preload_object_auth = preload_object_auth_ary.first
|
|
||||||
preload_object_auth.privilege_users = privilege_users
|
|
||||||
preload_object_auth.save!
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
first_category = @news_bulletin_categorys.first
|
@news_bulletin_categorys = @news_bulletin_categorys.first
|
||||||
end
|
end
|
||||||
preload_object_auth = first_category.object_auths.where(title: 'fact_check').empty?? (first_category.object_auths.create! :title=> 'fact_check') : first_category.object_auths.where(title: 'fact_check')
|
preload_object_auth = @news_bulletin_categorys.get_object_auth_by_title('fact_check')
|
||||||
@users_array = preload_object_auth.first.privilege_users rescue []
|
@users_array = preload_object_auth.privilege_users rescue []
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.js
|
format.js
|
||||||
|
@ -35,10 +29,27 @@ class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_setting
|
def update_setting
|
||||||
|
object_auth = update_setting_by_params
|
||||||
|
if object_auth.save!
|
||||||
|
flash[:notice] = t("admin.object_auth.update_done")
|
||||||
|
else
|
||||||
|
flash[:notice] = t("admin.object_auth.update_failed")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def user_list
|
||||||
|
@news_bulletin_category = NewsBulletinCategory.find params[:news_category][:id]
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
def update_setting_by_params
|
||||||
|
category = NewsBulletinCategory.find params[:news_category][:id]
|
||||||
|
privilege_users = params[:users].collect{|key,value| User.find key } rescue []
|
||||||
|
object_auth_ary = category.object_auths.where(title: 'fact_check') || (category.object_auths.create :title=> 'fact_check')
|
||||||
|
object_auth = object_auth_ary.first
|
||||||
|
object_auth.privilege_users = privilege_users
|
||||||
|
object_auth
|
||||||
|
end
|
||||||
|
|
||||||
def get_categorys(id = nil)
|
def get_categorys(id = nil)
|
||||||
@news_bulletin_categorys = []
|
@news_bulletin_categorys = []
|
||||||
|
|
|
@ -42,10 +42,6 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
||||||
@news_bulletin_link = NewsBulletinLink.new
|
@news_bulletin_link = NewsBulletinLink.new
|
||||||
@link_url = panel_news_back_end_news_bulletins_path
|
@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) rescue nil) || news_bulletin.create_user_id!=current_user.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
@news_bulletin_file = NewsBulletinFile.new
|
@news_bulletin_file = NewsBulletinFile.new
|
||||||
@file_url = panel_news_back_end_news_bulletins_path
|
@file_url = panel_news_back_end_news_bulletins_path
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,8 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController
|
||||||
end
|
end
|
||||||
|
|
||||||
def preview_content
|
def preview_content
|
||||||
@news_bulletins = NewsBulletin.find params[:id]
|
@news_bulletin = NewsBulletin.find params[:id]
|
||||||
get_categorys
|
get_categorys
|
||||||
render :show
|
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Panel::News::BackEnd::NewsBulletinsHelper
|
||||||
|
|
||||||
def news_show_approval_link(news_bulletin)
|
def news_show_approval_link(news_bulletin)
|
||||||
by_news_bulletin = (!news_bulletin.is_expired? and !news_bulletin.is_checked?)
|
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) rescue nil) or is_manager?
|
by_user = (news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? or is_admin?)
|
||||||
by_news_bulletin and by_user
|
by_news_bulletin and by_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -160,13 +160,13 @@ class NewsBulletin
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def set_key
|
def set_key
|
||||||
if title.new_record?
|
if title && title.new_record?
|
||||||
title.key = 'title'
|
title.key = 'title'
|
||||||
end
|
end
|
||||||
if subtitle.new_record?
|
if subtitle && subtitle.new_record?
|
||||||
subtitle.key = 'subtitle'
|
subtitle.key = 'subtitle'
|
||||||
end
|
end
|
||||||
if text.new_record?
|
if text && text.new_record?
|
||||||
text.key = 'text'
|
text.key = 'text'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,10 +29,10 @@ class NewsBulletinFile
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def set_key
|
def set_key
|
||||||
if filetitle.new_record?
|
if filetitle && filetitle.new_record?
|
||||||
filetitle.key = 'filetitle'
|
filetitle.key = 'filetitle'
|
||||||
end
|
end
|
||||||
if description.new_record?
|
if description && description.new_record?
|
||||||
description.key = 'description'
|
description.key = 'description'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
44
vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_list.html.erb
vendored
Normal file
44
vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_list.html.erb
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
<% if news_bulletin_category -%>
|
||||||
|
|
||||||
|
<div class="modal hide fade in" id="news_bulletin_category-<%=news_bulletin_category.id%>">
|
||||||
|
<div class="modal-header">
|
||||||
|
<a class="close" data-dismiss="modal">×</a>
|
||||||
|
<h3><%= t("announcement.bulletin.approval_user_list") %></h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="clear">
|
||||||
|
<% news_bulletin_category.get_object_auth_by_title('fact_check').auth_users.each do |user| %>
|
||||||
|
<div class="checkbox clear checked">
|
||||||
|
<div class='member-avatar'>
|
||||||
|
<% if user.avatar? %>
|
||||||
|
<%= image_tag(user.avatar.thumb.url,:class => "member-img") %>
|
||||||
|
<% else %>
|
||||||
|
<%= image_tag "person.png",:class => "member-img" %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<%= label_tag "lab-user-#{user.id}", (user.name rescue ''),:class=>"member-name",:id=>nil -%>
|
||||||
|
</div>
|
||||||
|
<% end -%>
|
||||||
|
<divl>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<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_category-<%=news_bulletin_category.id%>").on("show", function () {
|
||||||
|
});
|
||||||
|
$(".modal").on("hidden", function () {
|
||||||
|
$("#show_preview").remove();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<% end -%>
|
|
@ -6,7 +6,7 @@
|
||||||
<% user.sub_roles.each do |sr| %>
|
<% user.sub_roles.each do |sr| %>
|
||||||
<div class="for_unit" style="display:none;"> <%= sr.key %></div>
|
<div class="for_unit" style="display:none;"> <%= sr.key %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= content_tag :div,:data=>{'original-title'=>t('news.news_bulletin.approval_setting_window_title'),:content => "#{user.sub_roles.collect{|sr| sr.key}.join(',')}"},:class=>"checkbox clear" do %>
|
<%= content_tag :div,:data=>{'original-title'=>t('news.news_bulletin.approval_setting_window_title'),:content => "#{user.sub_roles.collect{|sr| sr.i18n_variable[I18n.locale]}.join(',')}"},:class=>"checkbox clear" do %>
|
||||||
<div class="check-icon">
|
<div class="check-icon">
|
||||||
</div>
|
</div>
|
||||||
<div class='member-avatar'>
|
<div class='member-avatar'>
|
||||||
|
|
|
@ -4,27 +4,29 @@
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<%= javascript_include_tag "inc/permission-checkbox" %>
|
<%= javascript_include_tag "inc/permission-checkbox" %>
|
||||||
<%= javascript_include_tag "inc/search" %>
|
<%= javascript_include_tag "inc/search" %>
|
||||||
|
<%= javascript_include_tag "inc/modal-preview" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%#= label_tag :fact_check_setting, t("news.news_bulletin.fact_check_setting") %>
|
<%#= label_tag :fact_check_setting, t("news.news_bulletin.fact_check_setting") %>
|
||||||
<%= form_tag('', :remote => true) %>
|
<%= form_tag('', :remote => true,:class => "prevent_enter_submit_form") %>
|
||||||
<div class="subnav">
|
<div class="subnav clear">
|
||||||
<ul class="nav nav-pills filter">
|
<ul class="nav nav-pills filter pull-left">
|
||||||
<li class="accordion-group">
|
<li class="accordion-group">
|
||||||
<div class="form-search" style="margin: 5px 10px;">
|
<div class="form-search" style="margin: 5px 10px;">
|
||||||
<%= label_tag :category, t("news.news_bulletin.category") %>
|
<%= label_tag :category, t("news.news_bulletin.category") %>
|
||||||
<%= select_tag "category_id", options_from_collection_for_select(@news_bulletin_categorys, "id", "key") %>
|
<%= select "news_category",'id', @options_from_collection_for_select_news_bulletin_categorys %>
|
||||||
<%= search_field_tag 'user_filter' %>
|
<%= search_field_tag 'user_filter' %>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<%= link_to t("announcement.bulletin.approval_user_list"), panel_news_back_end_approval_user_list_path , :class=>'preview_trigger btn btn-success pull-right'%>
|
||||||
</div>
|
</div>
|
||||||
<%#= label_tag :role, t("admin.roles") %>
|
<%#= label_tag :role, t("admin.roles") %>
|
||||||
<div class="clear">
|
<div class="clear">
|
||||||
<%= content_tag :div do -%>
|
<%= content_tag :div do -%>
|
||||||
<% form_tag :action => "update_setting" do %>
|
<% form_tag panel_news_back_end_approval_setting_path do %>
|
||||||
<%= render :partial => "privilege_user", :locals => {:users => @users_array} %>
|
<%= render :partial => "privilege_user", :locals => {:users => @users_array} %>
|
||||||
<div class="form-actions pagination-centered">
|
<div class="form-actions form-fixed pagination-right">
|
||||||
<%= submit_tag "Update", :class => 'btn' %>
|
<%= submit_tag "Update", :class => 'btn btn-primary' %>
|
||||||
</div>
|
</div>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
@ -32,9 +34,21 @@
|
||||||
|
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
var availableTags = [];
|
var availableTags = [];
|
||||||
$(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#category_id').change(function() {
|
$(".prevent_enter_submit_form").bind("keypress", function(e) {
|
||||||
$(this).parents('form').submit();
|
if (e.keyCode == 13) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#news_category_id').change(function() {
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
dataType: "script",
|
||||||
|
url:$(this).parents("from").attr("href"),
|
||||||
|
data:$(this).parents("form").serialize()
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -1 +1,2 @@
|
||||||
$("#users_checkbox_ary").replaceWith('<%= (render :partial => 'privilege_user', :locals => {:users => @users_array}).html_safe%>');
|
$("#users_checkbox_ary").replaceWith('<%= escape_javascript(render :partial => "privilege_user", :locals => {:users => @users_array})%>');
|
||||||
|
permissionCheckbox();
|
|
@ -0,0 +1 @@
|
||||||
|
alert( "<% flash.each do |key, msg| %><%= msg %><% end%>");
|
2
vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/user_list.js.erb
vendored
Normal file
2
vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/user_list.js.erb
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
$('#show_preview').html("<%= escape_javascript(render(:partial => 'modal_list',:locals => {:news_bulletin_category => @news_bulletin_category})) %>");
|
||||||
|
var start_modal_with_id = "news_bulletin_category-<%=@news_bulletin_category.id%>"
|
|
@ -55,14 +55,14 @@
|
||||||
<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>
|
<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 %>
|
<% end %>
|
||||||
<% if news_show_approval_link(news_bulletin) %>
|
<% 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) ,:class=>"preview_trigger" %></li><%#= #TODO add ancher so user can quick access into that part %>
|
<li><%= link_to t('news.news_bulletin.approval'), panel_news_back_end_news_bulletin_approval_preview_path(news_bulletin),:class => 'preview_trigger' %></li><%#= #TODO add ancher so user can quick access into that part %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><%= news_bulletin.postdate %></td>
|
<td><%= display_date(news_bulletin.postdate) %></td>
|
||||||
<td><%= (news_bulletin.deadline) ? news_bulletin.deadline : t('news_bulletin.no_deadline') %></td>
|
<td><%= (news_bulletin.deadline) ? display_date(news_bulletin.deadline) : t('news_bulletin.no_deadline') %></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="label-group">
|
<div class="label-group">
|
||||||
<div class="label-td">
|
<div class="label-td">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('news.postdate') %></b>
|
<b><%= t('news.postdate') %></b>
|
||||||
<%= @news_bulletin.postdate %>
|
<%= display_date(@news_bulletin.postdate) %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('news.title') %></b>
|
<b><%= t('news.title') %></b>
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('news.最後修改時間') %></b>
|
<b><%= t('news.最後修改時間') %></b>
|
||||||
<%= @news_bulletin.updated_at %>
|
<%= display_date(@news_bulletin.updated_at) %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,12 @@
|
||||||
</tr>
|
</tr>
|
||||||
<% @news_bulletins.each do |post| %>
|
<% @news_bulletins.each do |post| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= image_tag post.image %></td>
|
<td><%= image_tag post.image rescue nil %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to post.title[I18n.locale], panel_news_front_end_news_bulletin_path(post), :class => 'news_title' %>
|
<%= link_to post.title[I18n.locale], panel_news_front_end_news_bulletin_path(post), :class => 'news_title' %>
|
||||||
<%= post.subtitle[I18n.locale].html_safe %>
|
<%= post.subtitle[I18n.locale].html_safe %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= post.postdate %></td>
|
<td><%= display_date(post.postdate) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="info1">
|
<div class="info1">
|
||||||
<span class="pull-right"><%= dislpay_view_count(@news_bulletin) %></span>
|
<span class="pull-right"><%= dislpay_view_count(@news_bulletin) %></span>
|
||||||
<span class="date"><%= @news_bulletin.postdate %></span>
|
<span class="date"><%= display_date(@news_bulletin.postdate) %></span>
|
||||||
|
|
<% unit = @news_bulletin.unit_list_for_anc.title[I18n.locale] rescue nil %>
|
||||||
<a href="" class="unit"><%= @news_bulletin.unit_list_for_anc.title[I18n.locale] rescue '' %></a>
|
<%= " | " if unit %>
|
||||||
|
<a href="" class="unit"><%= unit %></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="news_image">
|
<div class="news_image">
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<%= link_to post.title[I18n.locale], panel_news_front_end_news_bulletin_path(post), :class => 'news_title' %>
|
<%= link_to post.title[I18n.locale], panel_news_front_end_news_bulletin_path(post), :class => 'news_title' %>
|
||||||
<%= post.subtitle[I18n.locale].html_safe %>
|
<%= post.subtitle[I18n.locale].html_safe %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= post.postdate %></td>
|
<td><%= display_date(post.postdate) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -2,9 +2,10 @@ Rails.application.routes.draw do
|
||||||
namespace :panel do
|
namespace :panel do
|
||||||
namespace :news do
|
namespace :news do
|
||||||
namespace :back_end do
|
namespace :back_end do
|
||||||
match 'news_approval_setting' => "news_approvals#setting" ,:as => :news_approval_setting
|
match 'public' => "news#public",:as => :public
|
||||||
match 'update_setting' => "news_approvals#update_setting" ,:as => :news_approval_update_setting
|
match 'approval_setting' => "news_approvals#setting" ,:as => :approval_setting,:via => :get
|
||||||
|
match 'approval_setting' => "news_approvals#update_setting" ,:as => :approval_setting,:via => :post
|
||||||
|
match 'approval_setting' => "news_approvals#user_list" ,:as => :approval_user_list,:via => :put
|
||||||
resources :news_bulletins do
|
resources :news_bulletins do
|
||||||
match "approve/:news_bulletin_id" => "news_approvals#preview_and_approve",:as => :approval_preview,:via => :put
|
match "approve/:news_bulletin_id" => "news_approvals#preview_and_approve",:as => :approval_preview,:via => :put
|
||||||
match "approve/:news_bulletin_id" => "news_approvals#approve",:as => :approve,:via => :post
|
match "approve/:news_bulletin_id" => "news_approvals#approve",:as => :approve,:via => :post
|
||||||
|
|
|
@ -18,6 +18,6 @@
|
||||||
<%= link_to page_context.version, panel_page_content_back_end_view_path(page_context.page_id) %>
|
<%= link_to page_context.version, panel_page_content_back_end_view_path(page_context.page_id) %>
|
||||||
<%end -%>
|
<%end -%>
|
||||||
</td>
|
</td>
|
||||||
<td><%= page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %></td>
|
<td><%= display_date_time(page_context.updated_at) %></td>
|
||||||
<td><%= User.find(page_context.create_user_id).name %></td>
|
<td><%= User.find(page_context.create_user_id).name %></td>
|
||||||
</tr>
|
</tr>
|
|
@ -10,6 +10,6 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><%= view_page_context.version %></td>
|
<td><%= view_page_context.version %></td>
|
||||||
<td><%= view_page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %></td>
|
<td><%= display_date(view_page_context.updated_at) %></td>
|
||||||
<td><%= User.find(view_page_context.create_user_id).name %></td>
|
<td><%= User.find(view_page_context.create_user_id).name %></td>
|
||||||
</tr>
|
</tr>
|
|
@ -21,7 +21,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('page_content.最後修改時間') %></b>
|
<b><%= t('page_content.最後修改時間') %></b>
|
||||||
<%= @page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %>
|
<%= display_date(@page_context.updated_at) %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -69,10 +69,10 @@ class WebLink
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def set_key
|
def set_key
|
||||||
if name.new_record?
|
if name && name.new_record?
|
||||||
name.key = 'name'
|
name.key = 'name'
|
||||||
end
|
end
|
||||||
if context.new_record?
|
if context && context.new_record?
|
||||||
context.key = 'context'
|
context.key = 'context'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.postdate') %></b>
|
<b><%= t('announcement.postdate') %></b>
|
||||||
<%= @bulletin.postdate %>
|
<%= display_date(@bulletin.postdate) %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.title') %></b>
|
<b><%= t('announcement.title') %></b>
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.最後修改時間') %></b>
|
<b><%= t('announcement.最後修改時間') %></b>
|
||||||
<%= @bulletin.updated_at %>
|
<%= display_date(@bulletin.updated_at) %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.postdate') %></b>
|
<b><%= t('announcement.postdate') %></b>
|
||||||
<%= @bulletin.postdate %>
|
<%= display_date(@bulletin.postdate) %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.title') %></b>
|
<b><%= t('announcement.title') %></b>
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.最後修改時間') %></b>
|
<b><%= t('announcement.最後修改時間') %></b>
|
||||||
<%= @bulletin.updated_at.strftime("%Y-%m-%d %H:%I:%S") %>
|
<%= display_date_time(@bulletin.updated_at) %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,10 +38,13 @@ module Impressionist
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_impressionist_counter_cache
|
def update_impressionist_counter_cache
|
||||||
|
# cache_options = self.class.impressionist_counter_cache_options
|
||||||
|
# column_name = cache_options[:column_name].to_sym
|
||||||
|
# count = cache_options[:unique] ? impressionist_count(:filter => :ip_address) : impressionist_count
|
||||||
|
# update_attribute(column_name, count)
|
||||||
cache_options = self.class.impressionist_counter_cache_options
|
cache_options = self.class.impressionist_counter_cache_options
|
||||||
column_name = cache_options[:column_name].to_sym
|
column_name = cache_options[:column_name].to_sym
|
||||||
count = cache_options[:unique] ? impressionist_count(:filter => :ip_address) : impressionist_count
|
update_attribute(column_name, self.send(cache_options[:column_name]) + 1)
|
||||||
update_attribute(column_name, count)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# OLD METHODS - DEPRECATE IN V0.5
|
# OLD METHODS - DEPRECATE IN V0.5
|
||||||
|
|
|
@ -27,6 +27,7 @@ class Impression
|
||||||
private
|
private
|
||||||
|
|
||||||
def update_impressions_counter_cache
|
def update_impressions_counter_cache
|
||||||
|
if self.referrer
|
||||||
impressionable_class = self.impressionable_type.constantize
|
impressionable_class = self.impressionable_type.constantize
|
||||||
|
|
||||||
if impressionable_class.impressionist_counter_cache_options
|
if impressionable_class.impressionist_counter_cache_options
|
||||||
|
@ -35,3 +36,4 @@ class Impression
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue