Merge branch 'dashboard' of https://github.com/Rulingcom/orbit into dashboard
Conflicts: vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb
This commit is contained in:
commit
9382ef6ae8
164 files changed
+1088
-2321
No files matched your search
+1
-3
@@ -1,6 +1,4 @@
|
||||
class Panel::Announcement::BackEnd::BulletinCategorysController < ApplicationController
|
||||
|
||||
layout 'new_admin'
|
||||
class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController
|
||||
|
||||
def index
|
||||
@bulletin_categorys = BulletinCategory.all
|
||||
|
||||
+60
-55
@@ -1,5 +1,4 @@
|
||||
class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
layout 'new_admin'
|
||||
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
@@ -159,12 +158,12 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def file_quick_add
|
||||
# debugger
|
||||
# debugger
|
||||
|
||||
@bulletin_file = BulletinFile.new
|
||||
@file_url = panel_announcement_back_end_bulletins_path
|
||||
@file_url = panel_announcement_back_end_bulletins_path
|
||||
|
||||
@bulletin_file.bulletin_id = params[:bulletin_id]
|
||||
@bulletin_file.bulletin_id = params[:bulletin_id]
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
@@ -173,75 +172,73 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def file_quick_edit
|
||||
# debugger
|
||||
# debugger
|
||||
@bulletin_file = BulletinFile.find(params[:bulletin_id])
|
||||
|
||||
@file_url = panel_announcement_back_end_bulletin_path(@bulletin_file)
|
||||
@file_url = panel_announcement_back_end_bulletin_path(@bulletin_file)
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# PUT /bulletins/1
|
||||
# PUT /bulletins/1.xml
|
||||
def update
|
||||
|
||||
if params[:bulletin_link]
|
||||
|
||||
@bulletin_link = BulletinLink.find(params[:id])
|
||||
|
||||
@link_url = panel_announcement_back_end_bulletin_path(@bulletin_link)
|
||||
if params[:bulletin_link]
|
||||
|
||||
@bulletin_link = BulletinLink.find(params[:id])
|
||||
|
||||
@link_url = panel_announcement_back_end_bulletin_path(@bulletin_link)
|
||||
|
||||
respond_to do |format|
|
||||
if @bulletin_link.update_attributes(params[:bulletin_link])
|
||||
# format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
|
||||
format.js { render 'update_bulletin_link' }
|
||||
end
|
||||
end
|
||||
|
||||
elsif params[:bulletin_file]
|
||||
|
||||
@bulletin_file = BulletinFile.find(params[:id])
|
||||
|
||||
@file_url = panel_announcement_back_end_bulletin_path(@bulletin_file)
|
||||
respond_to do |format|
|
||||
if @bulletin_link.update_attributes(params[:bulletin_link])
|
||||
# format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
|
||||
format.js { render 'update_bulletin_link' }
|
||||
end
|
||||
end
|
||||
|
||||
elsif params[:bulletin_file]
|
||||
|
||||
@bulletin_file = BulletinFile.find(params[:id])
|
||||
|
||||
@file_url = panel_announcement_back_end_bulletin_path(@bulletin_file)
|
||||
|
||||
respond_to do |format|
|
||||
if @bulletin_file.update_attributes(params[:bulletin_file])
|
||||
# format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
|
||||
format.js { render 'update_bulletin_file' }
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
@bulletin = Bulletin.find(params[:id])
|
||||
|
||||
@bulletin.update_user_id = current_user.id
|
||||
|
||||
# @bulletin.image.clear if params[:bulletin][:image_del] == '1'
|
||||
# if params[:bulletin][:image_del] == '1'
|
||||
# @bulletin.remove_image!
|
||||
# @bulletin.image_del = nil
|
||||
# params[:bulletin][:image_del] = nil
|
||||
# end
|
||||
respond_to do |format|
|
||||
if @bulletin_file.update_attributes(params[:bulletin_file])
|
||||
# format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
|
||||
format.js { render 'update_bulletin_file' }
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
@bulletin = Bulletin.find(params[:id])
|
||||
|
||||
@bulletin.update_user_id = current_user.id
|
||||
|
||||
# @bulletin.image.clear if params[:bulletin][:image_del] == '1'
|
||||
# if params[:bulletin][:image_del] == '1'
|
||||
# @bulletin.remove_image!
|
||||
# @bulletin.image_del = nil
|
||||
# params[:bulletin][:image_del] = nil
|
||||
# end
|
||||
|
||||
respond_to do |format|
|
||||
if @bulletin.update_attributes(params[:bulletin]) && @bulletin.save
|
||||
# format.html { redirect_to(panel_announcement_back_end_bulletin_url(@bulletin), :notice => t('bulletin.update_bulletin_success')) }
|
||||
format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('bulletin.update_bulletin_success')) }
|
||||
format.js { render 'toggle_enable' }
|
||||
format.xml { head :ok }
|
||||
else
|
||||
format.html { render :action => "edit" }
|
||||
format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
if @bulletin.update_attributes(params[:bulletin]) && @bulletin.save
|
||||
# format.html { redirect_to(panel_announcement_back_end_bulletin_url(@bulletin), :notice => t('bulletin.update_bulletin_success')) }
|
||||
format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('bulletin.update_bulletin_success')) }
|
||||
format.js { render 'toggle_enable' }
|
||||
format.xml { head :ok }
|
||||
else
|
||||
format.html { render :action => "edit" }
|
||||
format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
# DELETE /bulletins/1
|
||||
@@ -268,6 +265,14 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
|
||||
# end
|
||||
|
||||
|
||||
def load_quick_edit
|
||||
@bulletin = Bulletin.find(params[:id])
|
||||
@type = params[:type]
|
||||
@bulletin_categories = BulletinCategory.all
|
||||
get_tags
|
||||
end
|
||||
|
||||
|
||||
protected
|
||||
|
||||
|
||||
+1
-2
@@ -2,7 +2,6 @@ class Panel::Announcement::BackEnd::FactChecksController < OrbitBackendControll
|
||||
before_filter :authenticate_user!
|
||||
include AdminHelper
|
||||
# layout 'admin'
|
||||
layout 'new_admin'
|
||||
|
||||
def setting
|
||||
@bulletin_categorys = BulletinCategory.all
|
||||
@@ -18,7 +17,7 @@ class Panel::Announcement::BackEnd::FactChecksController < OrbitBackendControll
|
||||
else
|
||||
first_category = @bulletin_categorys.first
|
||||
end
|
||||
preload_object_auth = first_category.object_auths.where(title: 'fact_check') || (first_category.object_auths.create :title=> 'fact_check')
|
||||
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')
|
||||
@users_array = preload_object_auth.first.privilege_users rescue []
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_title = NewBlog::MOUDLEAPP_TITLE
|
||||
@app_title = 'announcement'
|
||||
end
|
||||
|
||||
# GET /bulletins
|
||||
@@ -12,9 +12,9 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
|
||||
date_now = Time.now
|
||||
if params[:category_id]
|
||||
@bulletins = Bulletin.where(:bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
|
||||
@bulletins = Bulletin.can_display.where(:bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
|
||||
else
|
||||
@bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
|
||||
@bulletins = Bulletin.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
|
||||
end
|
||||
|
||||
get_categorys
|
||||
@@ -23,7 +23,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def show
|
||||
@bulletin = Bulletin.find(params[:id])
|
||||
@bulletin = Bulletin.can_display.where.where(_id: params[:id])
|
||||
get_categorys
|
||||
end
|
||||
|
||||
|
||||
+5
-5
@@ -2,7 +2,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_title = NewBlog::MOUDLEAPP_TITLE
|
||||
@app_title = 'announcement'
|
||||
end
|
||||
|
||||
# GET /bulletins
|
||||
@@ -14,9 +14,9 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||
# @bulletin_categorys = BulletinCategory.first;
|
||||
# @bulletins = Bulletin.widget_datas(@bulletin_categorys.id).limit(9)
|
||||
if params[:category_id]
|
||||
@bulletins = Bulletin.where(:bulletin_category_id => params[:category_id]).widget_datas.limit(9)
|
||||
@bulletins = Bulletin.can_display.where(:bulletin_category_id => params[:category_id]).widget_datas.limit(9)
|
||||
else
|
||||
@bulletins = Bulletin.widget_datas.limit(9)
|
||||
@bulletins = Bulletin.can_display.widget_datas.limit(9)
|
||||
end
|
||||
|
||||
get_categorys
|
||||
@@ -26,14 +26,14 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||
def bulletins_and_web_links
|
||||
@tags = AnnouncementTag.all
|
||||
@selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0]
|
||||
@bulletins = @selected_tag.get_visible_bulletins.page(params[:page]).per(5) rescue nil
|
||||
@bulletins = @selected_tag.get_visible_bulletins.can_display.page(params[:page]).per(5) rescue nil
|
||||
@web_links = WebResourceTag.first(:conditions => {:en => @selected_tag[:en]}).get_visible_links.page(params[:page]).per(5) rescue nil
|
||||
render :layout => 'module_widget'
|
||||
end
|
||||
|
||||
def reload_bulletins
|
||||
@selected_tag = AnnouncementTag.find(params[:tag_id])
|
||||
@bulletins = @selected_tag.get_visible_bulletins.page(params[:page]).per(5) rescue nil
|
||||
@bulletins = @selected_tag.get_visible_bulletins.can_display.page(params[:page]).per(5) rescue nil
|
||||
end
|
||||
|
||||
def reload_web_links
|
||||
|
||||
+26
-22
@@ -19,12 +19,14 @@ class Bulletin
|
||||
field :is_top, :type => Boolean, :default => false
|
||||
field :is_hot, :type => Boolean, :default => false
|
||||
field :is_hidden, :type => Boolean, :default => false
|
||||
field :is_checked, :type => Boolean, :default => false
|
||||
field :is_checked, :type => Boolean, :default => nil
|
||||
|
||||
field :not_checked_reason
|
||||
|
||||
field :public, :type => Boolean, :default => true
|
||||
|
||||
scope :can_display,where(is_checked: true)
|
||||
|
||||
mount_uploader :image, ImageUploader
|
||||
|
||||
belongs_to :bulletin_category
|
||||
@@ -47,28 +49,17 @@ class Bulletin
|
||||
|
||||
|
||||
def self.search( search = nil, category_id = nil )
|
||||
|
||||
if category_id.to_s.size > 0 and search.to_s.size > 0
|
||||
|
||||
if category_id.to_s.size > 0 and search.to_s.size > 0
|
||||
key = /#{search}/
|
||||
|
||||
find(:all, :conditions => {title: key, bulletin_category_id: category_id}).desc( :is_top, :postdate )
|
||||
|
||||
elsif category_id.to_s.size > 0 and search.to_s.size < 1
|
||||
|
||||
find(:all, :conditions => {bulletin_category_id: category_id}).desc( :is_top, :postdate )
|
||||
|
||||
elsif search.to_s.size > 0 and category_id.to_s.size < 1
|
||||
|
||||
find(:all, :conditions => {title: key, bulletin_category_id: category_id}).desc( :is_top, :postdate )
|
||||
elsif category_id.to_s.size > 0 and search.to_s.size < 1
|
||||
find(:all, :conditions => {bulletin_category_id: category_id}).desc( :is_top, :postdate )
|
||||
elsif search.to_s.size > 0 and category_id.to_s.size < 1
|
||||
key = /#{search}/
|
||||
|
||||
find(:all, :conditions => {title: key}).desc( :is_top, :postdate )
|
||||
else
|
||||
|
||||
find(:all).desc( :is_top, :postdate)
|
||||
|
||||
end
|
||||
|
||||
find(:all, :conditions => {title: key}).desc( :is_top, :postdate )
|
||||
else
|
||||
find(:all).desc( :is_top, :postdate)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -87,7 +78,11 @@ class Bulletin
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def is_expired?
|
||||
Date.today > self.deadline ? true : false rescue false
|
||||
#some dates might sat as nil so rescue false
|
||||
end
|
||||
|
||||
def is_top?
|
||||
self.is_top
|
||||
@@ -101,6 +96,15 @@ class Bulletin
|
||||
self.is_hidden
|
||||
end
|
||||
|
||||
def is_checked?
|
||||
self.is_checked
|
||||
end
|
||||
|
||||
def is_check_rejected?
|
||||
self.is_checked == false
|
||||
end
|
||||
|
||||
|
||||
def save_bulletin_links
|
||||
self.bulletin_links.each do |t|
|
||||
if t.should_destroy
|
||||
|
||||
+24
-19
@@ -10,40 +10,45 @@
|
||||
<% if bulletin.is_hidden? %>
|
||||
<span class="label"><%= t(:hidden) %></span>
|
||||
<% end %>
|
||||
</td>
|
||||
<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">
|
||||
<% unless bulletin.is_check_rejected?%>
|
||||
<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><a href="#" class='toggle-tr-edit' rel='basic'><%= t(:basic) %></a></li>
|
||||
<li><a href="#" class='toggle-tr-edit' rel='picture'><%= t(:picture) %></a></li>
|
||||
<li><a href="#" class='toggle-tr-edit' rel='tags'><%= t(:tags) %></a></li>
|
||||
<li><a href="#" class='toggle-tr-edit' rel='link'><%= t(:link) %></a></li>
|
||||
<li><a href="#" class='toggle-tr-edit' rel='file'><%= t(:file) %></a></li>
|
||||
<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>
|
||||
<li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
<%#= debugger %>
|
||||
<%#= a=1 %>
|
||||
<% if (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?) and !bulletin.is_expired? %>
|
||||
<li><%= link_to t('bulletin.fact_check'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li><%#= #TODO add ancher so user can quick access into that part %>
|
||||
<% end %>
|
||||
<% 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>
|
||||
<td><%= bulletin.bulletin_category.i18n_variable[I18n.locale] %></td>
|
||||
<td><%= link_to bulletin.title[I18n.locale], panel_announcement_back_end_bulletin_path(bulletin) rescue ''%></td>
|
||||
<td><%= bulletin.postdate %></td>
|
||||
<td><%= (bulletin.deadline) ? bulletin.deadline : t('bulletin.no_deadline') %></td>
|
||||
<td>
|
||||
<% bulletin.sorted_tags.each do |tag| %>
|
||||
<span class="label label-tags"><%= tag[I18n.locale] %></span>
|
||||
<% end %>
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
<% bulletin.sorted_tags.each do |tag| %>
|
||||
<span class="label label-tags"><%= tag[I18n.locale] %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td><%= User.from_id(bulletin.update_user_id).name rescue ''%></td>
|
||||
</tr>
|
||||
|
||||
<%= render :partial => 'quick_edit', :locals => {:bulletin => bulletin} %>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<script>
|
||||
|
||||
</script>
|
||||
<% end %>
|
||||
<tr id="<%= dom_id bulletin, :edit %>" class="qe-block hide" />
|
||||
+30
-36
@@ -1,43 +1,37 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= form_for(@bulletin_link, :remote => true, :url => @link_url) do |f| %>
|
||||
|
||||
|
||||
<div class="modal-header">
|
||||
<a class="close" data-dismiss="modal">×</a>
|
||||
<h3><%= (@bulletin_link.new_record? ? 'Add Link' : 'Edit Link') %></h3>
|
||||
</div>
|
||||
<div class="modal-body form-horizontal">
|
||||
<div class="control-group">
|
||||
<label for="http" class="control-label">URL</label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :url %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.fields_for :i18n_variable, (@bulletin_link.new_record? ? @bulletin_link.build_i18n_variable : @bulletin_link.i18n_variable) do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<div class="control-group">
|
||||
<%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%#= f.text_field locale, :class => 'input-xxlarge' %>
|
||||
<%= f.text_field locale %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<%= hidden_field_tag 'bulletin_link[bulletin_id]', @bulletin_link.bulletin_id %>
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
|
||||
|
||||
</div>
|
||||
<%= form_for(@bulletin_link, :remote => true, :url => @link_url) do |f| %>
|
||||
|
||||
<div class="modal-header">
|
||||
<a class="close" data-dismiss="modal">×</a>
|
||||
<h3><%= (@bulletin_link.new_record? ? 'Add Link' : 'Edit Link') %></h3>
|
||||
</div>
|
||||
<div class="modal-body form-horizontal">
|
||||
<div class="control-group">
|
||||
<label for="http" class="control-label">URL</label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :url %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<%= f.fields_for :i18n_variable, (@bulletin_link.new_record? ? @bulletin_link.build_i18n_variable : @bulletin_link.i18n_variable) do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<div class="control-group">
|
||||
<%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%#= f.text_field locale, :class => 'input-xxlarge' %>
|
||||
<%= f.text_field locale %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="modal-footer">
|
||||
<%= hidden_field_tag 'bulletin_link[bulletin_id]', @bulletin_link.bulletin_id %>
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
+13
-1
@@ -1,4 +1,4 @@
|
||||
<thead>
|
||||
<!--<thead>
|
||||
<tr class="sort-header">
|
||||
<th class="span1 strong">
|
||||
<input type="checkbox">
|
||||
@@ -33,6 +33,18 @@
|
||||
<%= content_tag(:b, nil, :class => is_sort?('update_user_id')) %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>-->
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span7"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="sort-holder">
|
||||
<%= render :partial => 'bulletin', :collection => @bulletins %>
|
||||
|
||||
+40
@@ -53,5 +53,45 @@
|
||||
<a href="#" class="btn"><i class="icons-brush-large"></i>Clear/重置</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-label">
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr class="sort-header">
|
||||
<th class="span1 strong">
|
||||
<input type="checkbox">
|
||||
<a href class="list-remove"><i class="icon-trash"></i></a>
|
||||
</th>
|
||||
<th class="sort span1-2 <%= is_sort_active?('status') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('status')) %>">
|
||||
<%= t('bulletin.status') %>
|
||||
<%= content_tag(:b, nil, :class => is_sort?('status')) %>
|
||||
</th>
|
||||
<th class="sort span1-2 <%= is_sort_active?('category') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('category')) %>">
|
||||
<%= t('bulletin.category') %>
|
||||
<%= content_tag(:b, nil, :class => is_sort?('category')) %>
|
||||
</th>
|
||||
<th class="sort span7 <%= is_sort_active?('title') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('title')) %>">
|
||||
<%= t('bulletin.title') %>
|
||||
<%= content_tag(:b, nil, :class => is_sort?('title')) %>
|
||||
</th>
|
||||
<th class="sort span1-2 <%= is_sort_active?('postdate') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('postdate')) %>">
|
||||
<%= t('bulletin.start_date') %>
|
||||
<%= content_tag(:b, nil, :class => is_sort?('postdate')) %>
|
||||
</th>
|
||||
<th class="sort span1-2 <%= is_sort_active?('deadline') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('deadline')) %>">
|
||||
<%= t('bulletin.end_date') %>
|
||||
<%= content_tag(:b, nil, :class => is_sort?('deadline')) %>
|
||||
</th>
|
||||
<th class="sort span1-2 <%= is_sort_active?('tags') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('tags')) %>">
|
||||
<%= t('bulletin.tags') %>
|
||||
<%= content_tag(:b, nil, :class => is_sort?('tags')) %>
|
||||
</th>
|
||||
<th class="sort span1-2 <%= is_sort_active?('update_user_id') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('update_user_id')) %>">
|
||||
<%= t('bulletin.last_modified') %>
|
||||
<%= content_tag(:b, nil, :class => is_sort?('update_user_id')) %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Vendored
+71
-33
@@ -1,11 +1,41 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= f.error_messages %>
|
||||
|
||||
<!--Widget start-->
|
||||
<%= f.error_messages %>
|
||||
|
||||
<div id="sub-wiget">
|
||||
|
||||
<% if params[:action] != 'new' %>
|
||||
<div id="widget-audit" class="widget-box">
|
||||
<div class="widget-action clear">
|
||||
<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 :fact_check_stat, t('announcement.bulletin.fact_check_stat') %>
|
||||
<%= content_tag :label,:class => "radio inline" do -%>
|
||||
<%= f.radio_button :is_checked, true , {:class => 'privacy'} %>
|
||||
<%= t('announcement.bulletin.fact_check_pass') %>
|
||||
<% end -%>
|
||||
<%= content_tag :label,:class => "radio inline" do -%>
|
||||
<%= f.radio_button :is_checked, false, (@bulletin.is_checked.nil?? {:checked => true, :class => 'privacy'} : {})%>
|
||||
<%= t('announcement.bulletin.fact_check_not_pass') %>
|
||||
<% end -%>
|
||||
<div class="select-role">
|
||||
<%= label :is_checked_false, t('announcement.bulletin.fact_check_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%>
|
||||
<% end %>
|
||||
<div id="widget-picture" class="widget-box widget-size-300">
|
||||
<div class="widget-action clear">
|
||||
<a class="action"><i title="Upload pictures" class="icon-exclamation-sign icon-white tip"></i></a>
|
||||
@@ -61,9 +91,18 @@
|
||||
<h3 class="widget-title"><i class="icons-star-thin icons-white"></i>Status</h3>
|
||||
<div class="widget-content clear">
|
||||
<div class="controls">
|
||||
<%= f.check_box :is_top %><%= t('top') %>
|
||||
<%= f.check_box :is_hot %><%= t('hot') %>
|
||||
<%= f.check_box :is_hidden %><%= t('hide') %>
|
||||
<%= content_tag :label,:class => "checkbox inline" do -%>
|
||||
<%= f.check_box :is_top %>
|
||||
<%= t('top') %>
|
||||
<% end -%>
|
||||
<%= content_tag :label,:class => "checkbox inline" do -%>
|
||||
<%= f.check_box :is_hot %>
|
||||
<%= t('hot') %>
|
||||
<% end -%>
|
||||
<%= content_tag :label,:class => "checkbox inline" do -%>
|
||||
<%= f.check_box :is_hidden %>
|
||||
<%= t('hide') %>
|
||||
<% end -%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -75,8 +114,10 @@
|
||||
<h3 class="widget-title"><i class="icons-tag icons-white"></i>Tags</h3>
|
||||
<div class="widget-content clear form-horizontal">
|
||||
<% @tags.each do |tag| %>
|
||||
<%= check_box_tag 'bulletin[tag_ids][]', tag.id, @bulletin.tag_ids.include?(tag.id)%>
|
||||
<%= tag[I18n.locale] %>
|
||||
<%= content_tag :label,:class => "checkbox inline" do -%>
|
||||
<%= check_box_tag 'bulletin[tag_ids][]', tag.id, @bulletin.tag_ids.include?(tag.id)%>
|
||||
<%= tag[I18n.locale] %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -89,6 +130,15 @@
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content" class="clear">
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :image, t('announcement.image') %><br />
|
||||
<%= f.file_field :image %>
|
||||
<% if @bulletin.image.file %>
|
||||
<%= check_box_tag 'bulletin[image_del]' %>
|
||||
<%= t('announcement.刪除已上傳檔案') %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.label :category %>
|
||||
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
|
||||
@@ -111,31 +161,30 @@
|
||||
<%= I18nVariable.from_locale(locale) %>
|
||||
<%= f.text_field locale, :class=>'post-title' %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="title">
|
||||
<div class="editor">
|
||||
<%= f.label :subtitle %>
|
||||
<%= f.fields_for :subtitle, (@bulletin.new_record? ? @bulletin.build_subtitle : @bulletin.subtitle ) do |f| %>
|
||||
<%= I18nVariable.from_locale(locale) %>
|
||||
<%= f.text_area locale, :style=>"width:100%" %>
|
||||
<%= f.text_area locale, :style=>"width:100%", :class => 'tinymce_textarea' %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="title">
|
||||
<div class="editor">
|
||||
<%= f.label :text %>
|
||||
<%= f.fields_for :text, (@bulletin.new_record? ? @bulletin.build_text : @bulletin.text ) do |f| %>
|
||||
<%= I18nVariable.from_locale(locale) %>
|
||||
<%= f.text_area locale, :style=>"width:100%" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.text_area locale, :style=>"width:100%", :class => 'tinymce_textarea' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="main-wiget">
|
||||
<div id="widget-link" class="widget-box">
|
||||
<div class="widget-action clear">
|
||||
@@ -181,10 +230,6 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="main-wiget">
|
||||
<div id="widget-file" class="widget-box">
|
||||
<div class="widget-action clear">
|
||||
<a class="action"><i title="Added to the file" class="icon-exclamation-sign icon-white tip"></i></a>
|
||||
@@ -231,10 +276,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--Post End-->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
@@ -260,11 +305,4 @@
|
||||
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_bulletin_file', f, :bulletin_files) %>").replace(old_id, new_id));
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('textarea').tinymce({
|
||||
theme: 'advanced'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
+10
-17
@@ -1,17 +1,10 @@
|
||||
<!-- <tr class="qe-block hide"> -->
|
||||
<tr class="qe-block hide">
|
||||
<td colspan="8">
|
||||
<legend><%= t(:quick_edit) %> - <span class='qe_title'></span>Basic / Picture / Tags / Link / File</legend>
|
||||
<%= form_for bulletin, :url => panel_announcement_back_end_bulletin_path(bulletin), :html => {:class => 'form-horizontal'} do |f| %>
|
||||
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_basic", :locals => { :f => f, :bulletin => bulletin } %>
|
||||
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_picture", :locals => { :f => f, :bulletin => bulletin } %>
|
||||
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_tags", :locals => { :f => f, :bulletin => bulletin } %>
|
||||
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_links", :locals => { :f => f, :bulletin => bulletin } %>
|
||||
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_files", :locals => { :f => f, :bulletin => bulletin } %>
|
||||
<div class="form-actions">
|
||||
<%= f.submit t(:submit), :class => 'btn btn-primary' %>
|
||||
<%= f.submit t(:cancel), :class => 'btn', :type => 'reset' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<td colspan="8">
|
||||
<legend><%= t(:quick_edit) %> - <span class='qe_title'></span><%= t(type) %></legend>
|
||||
<%= form_for @bulletin, :url => panel_announcement_back_end_bulletin_path(@bulletin), :html => {:class => 'form-horizontal'} do |f| %>
|
||||
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_#{@type}", :locals => { :f => f, :bulletin => @bulletin } %>
|
||||
<div class="form-actions">
|
||||
<%= f.submit t(:submit), :class => 'btn btn-primary' %>
|
||||
<%= f.submit t(:cancel), :class => 'btn quick_edit_cancel', :type => 'reset', :rel => dom_id(@bulletin, :edit) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<div id="qe-basic" class="qe-edit-div hide">
|
||||
<div id="qe-basic" class="qe-edit-div">
|
||||
<div id="widget-category">
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t(:category) %></label>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<div id="qe-file" class="qe-edit-div hide">
|
||||
<div id="qe-file" class="qe-edit-div">
|
||||
<div id="widget-file">
|
||||
<div class="control-group">
|
||||
<table class="table table-condensed">
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<div id="qe-link" class="qe-edit-div hide">
|
||||
<div id="qe-link" class="qe-edit-div">
|
||||
<div id="widget-link">
|
||||
<div class="control-group">
|
||||
<table id="bulletin_links" class="table table-condensed">
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<div id="qe-picture" class="qe-edit-div hide">
|
||||
<div id="qe-picture" class="qe-edit-div">
|
||||
<div id="widget-picture">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Picture</label>
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div id="qe-tags" class="qe-edit-div hide">
|
||||
<div id="qe-tags" class="qe-edit-div">
|
||||
<div id="widget-tags">
|
||||
<div class="form-horizontal">
|
||||
<% @tags.each do |tag| %>
|
||||
|
||||
Vendored
+10
-7
@@ -1,7 +1,10 @@
|
||||
<h1><%= t('announcement.editing_announcement') %></h1>
|
||||
|
||||
<%= form_for @bulletin, :url => panel_announcement_back_end_bulletin_path(@bulletin), :html => {:class => 'clear'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<% end %>
|
||||
|
||||
<%#= link_back %>
|
||||
<ul class="breadcrumb">
|
||||
<li><span>Home</span><span class="divider">/</span></li>
|
||||
<li><span>Library</span><span class="divider">/</span></li>
|
||||
<li class="text-blue"><%= t('announcement.editing_announcement') %></li>
|
||||
</ul>
|
||||
<div id="poststuff">
|
||||
<%= form_for @bulletin, :url => panel_announcement_back_end_bulletin_path(@bulletin), :html => {:class => 'clear'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<% end %>
|
||||
</div>
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
$("#<%= dom_id @bulletin, :edit %>").show()
|
||||
$("#<%= dom_id @bulletin, :edit %>").html("<%= j render :partial => 'quick_edit', :locals => {:type => @type} %>")
|
||||
Vendored
+3
-3
@@ -1,5 +1,5 @@
|
||||
<%= form_for @bulletin, :url => panel_announcement_back_end_bulletins_path, :html => {:class => 'clear'} do |f| %>
|
||||
<div id="poststuff">
|
||||
<%= form_for @bulletin, :url => panel_announcement_back_end_bulletins_path do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<% end %>
|
||||
|
||||
<%#= link_back %>
|
||||
</div>
|
||||
Vendored
-8
@@ -1,11 +1,3 @@
|
||||
<%= flash_messages %>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<b><%= t('announcement.category') %></b>
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<h1><%= bulletin_category.key %></h1>
|
||||
<table>
|
||||
<tr>
|
||||
<th><%= t('bulletin.status') %></th>
|
||||
<th><%= t('bulletin.category') %></th>
|
||||
<th><%= t('bulletin.title') %></th>
|
||||
<th><%= t('bulletin.postdate') %></th>
|
||||
<th><%= t('bulletin.deadline') %></th>
|
||||
<th><%= t('bulletin.action') %></th>
|
||||
</tr>
|
||||
|
||||
<% bulletin_category.bulletins.each do |post| %>
|
||||
<%= render :partial => 'panel/announcement/back_end/bulletins/bulletins', :locals => {:post => post,:fact_check_allow=>true} %>
|
||||
<% end %>
|
||||
</table>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<%= content_tag :div ,:id => "users_checkbox_ary", do -%>
|
||||
<% sys_users = User.all -%>
|
||||
<% sys_users.each do |user| -%>
|
||||
<%= label_tag "lab-user-#{user.id}", user.name rescue '' -%>
|
||||
<%= check_box_tag "[users][#{user.id}]", 'true',users.include?(user) -%>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
<%= render 'panel/announcement/back_end/bulletins/filter' %>
|
||||
<table id="bulettin_sort_list" class="table main-list">
|
||||
<%= render 'panel/announcement/back_end/bulletins/bulletins' %>
|
||||
</table>
|
||||
<div class="form-actions">
|
||||
<%= 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 :secondary do %>
|
||||
<%#= render :partial => '/panel/announcement/back_end/announcement_secondary' %>
|
||||
<% end -%>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<fieldset><legend><%= t('bulletin.search') %></legend>
|
||||
|
||||
<%= form_for :bulletin, :action => 'search', :method => 'get', :url => panel_announcement_back_end_bulletins_path do |f| %>
|
||||
|
||||
<%#= f.select :bulletin_category_id, @bulletin_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ] },{ :include_blank => t('bulletin.select') }%>
|
||||
|
||||
Category <%#= select_tag "category_id", options_for_select(@bulletin_categorys.collect{|t| [t.i18n_variable[I18n.locale], t.id]}), :prompt => t('bulletin.select') %>
|
||||
|
||||
KeyWord <%#= text_field_tag :search, params[:search], :id => 'search_field' %>
|
||||
|
||||
<%= submit_tag "Search", :name => nil %>
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<h1><%= t('bulletin.list_announcement') %></h1>
|
||||
|
||||
<div id="check_block">
|
||||
<h1>Check Please</h1>
|
||||
<%#= render :partial => "list_table", :collection => @bulletin_categorys_check,:as => :bulletin_category%>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
-->
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<%= label_tag :fact_check_setting, t("announcement.bulletin.fact_check_setting") %>
|
||||
<br/>
|
||||
<%= form_tag('', :remote => true) %>
|
||||
<%= label_tag :category, t("announcement.bulletin.category") %>
|
||||
<%= select_tag "category_id", options_from_collection_for_select(@bulletin_categorys, "id", "key") %>
|
||||
|
||||
<br/>
|
||||
<%= label_tag :role, t("admin.roles") %>
|
||||
<%= content_tag :div do -%>
|
||||
<% form_tag :action => "update_setting" do %>
|
||||
<%= render :partial => "privilege_user", :locals => {:users => @users_array} %>
|
||||
<%= submit_tag "Update" %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$('#category_id').change(function() {
|
||||
$(this).parents('form').submit();
|
||||
});
|
||||
</script>
|
||||
+1
@@ -0,0 +1 @@
|
||||
$("#users_checkbox_ary").replaceWith('<%= (render :partial => 'privilege_user', :locals => {:users => @users_array}).html_safe%>');
|
||||
Vendored
-1
@@ -1,7 +1,6 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<% if @bulletins and !@bulletins.nil? %>
|
||||
|
||||
<h2 class="topic_title"><%= t('announcement.campus_news')%></h2>
|
||||
<%= link_to t('announcement.more'),panel_announcement_front_end_bulletins_path(), :class => "topic_note" %>
|
||||
<div class="topic_prev">previous page</div>
|
||||
|
||||
@@ -10,6 +10,9 @@ Rails.application.routes.draw do
|
||||
resources :bulletins do
|
||||
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
|
||||
get 'load_quick_edit'
|
||||
end
|
||||
match "file_quick_add/:bulletin_id" => "bulletins#file_quick_add" ,:as => :file_quick_add
|
||||
match "file_quick_edit/:bulletin_id" => "bulletins#file_quick_edit" ,:as => :file_quick_edit
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user