Add isotope, categories for announcement page, sort for announcement

This commit is contained in:
Christophe Vilayphiou 2012-02-23 15:48:23 +08:00
parent 53ed4b0404
commit 63d7810b35
20 changed files with 704 additions and 43 deletions

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@
//= require jquery //= require jquery
//= require jquery_ujs //= require jquery_ujs
//= require bootstrap //= require bootstrap
//= require jquery.isotope.min
//= require jquery.tinyscrollbar.min //= require jquery.tinyscrollbar.min
//= require orbit-1.0 //= require orbit-1.0
//= require tinymce-jquery //= require tinymce-jquery

View File

@ -46,15 +46,25 @@ $(document).ready(function(){
$(this).parents('tr').next('.qe-block').find('#qe-' + $(this).attr('rel')).toggleClass('hide'); $(this).parents('tr').next('.qe-block').find('#qe-' + $(this).attr('rel')).toggleClass('hide');
}); });
$(document).on('click', '.sort-header > .sort', function() {
$.getScript($(this).attr('rel'));
});
/*tinyscrollbar&windows-Size*/ /*tinyscrollbar&windows-Size*/
resize(); resize();
$('#main-sidebar').css("height", viewportheight-40); $('#main-sidebar').css("height", viewportheight-40);
//$('#content-wrap .viewport').css("height", viewportheight-44);
//$('#content-wrap').css("width", viewportwidth-186);
$('#main-sidebar .viewport').css("height", viewportheight-40); $('#main-sidebar .viewport').css("height", viewportheight-40);
$('.post-title').css("width", viewportwidth-495); $('.post-title').css("width", viewportwidth-495);
$('#main-sidebar').tinyscrollbar(); $('#main-sidebar').tinyscrollbar();
$('#main-sidebar').tinyscrollbar({ size:(viewportheight-44)}); $('.detal-list').tinyscrollbar();
$('#main-sidebar').tinyscrollbar({size:(viewportheight-44)});
/*isotope*/
var $container = $('#isotope');
$container.isotope({
itemSelector : '.item',
layoutMode : 'masonry',
});
}); });

View File

@ -2,7 +2,7 @@ $("div.editable").live("mouseenter mouseleave", function (event) {
$(this).children('.edit_link').toggle(); $(this).children('.edit_link').toggle();
}); });
$("#page_design_id").live('change', function() { $("#page_design").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes'); $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
}); });

View File

@ -0,0 +1,109 @@
#isotope {
margin-top: 2px;
background-color:#f4f4f4;
}
.isotope-item {
z-index: 2;
}
.isotope-hidden.isotope-item {
pointer-events: none;
z-index: 1;
}
/**** Isotope CSS3 transitions ****/
.isotope,
.isotope .isotope-item {
-webkit-transition-duration: 0.8s;
-moz-transition-duration: 0.8s;
-o-transition-duration: 0.8s;
transition-duration: 0.8s;
}
.isotope {
-webkit-transition-property: height, width;
-moz-transition-property: height, width;
-o-transition-property: height, width;
transition-property: height, width;
}
.isotope .isotope-item {
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform, opacity;
-o-transition-property: top, left, opacity;
transition-property: transform, opacity;
}
/**** disabling Isotope CSS3 transitions ****/
.isotope.no-transition,
.isotope.no-transition .isotope-item,
.isotope .isotope-item.no-transition {
-webkit-transition-duration: 0s;
-moz-transition-duration: 0s;
-o-transition-duration: 0s;
transition-duration: 0s;
}
.w-a {
width: 388px;
}
.w-b {
width: 802px;
}
.h-a {
height: 315px;
}
.h-b {
height: 699px;
}
.item {
margin: 5px 0 15px 15px;
}
.item h3 {
margin: 5px 0;
}
.item h3 [class^="icons-"] {
margin: 3px 5px 0 3px;
}
.item .detail {
padding: 5px;
border: 1px solid rgba(0, 0, 0, 0.1);
background-color: #FFFFFF;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
}
.item .detail .totle {
font-size: 50px;
padding:10px 5px 20px 0;
margin: 0px;
text-align: right;
border-bottom:1px solid #d9d9d9;
}
.item .detail .totle span {
display: block;
font-size:18px;
color: #333;
padding-left: 5px;
text-align:left;
}
.item .detail .table th, .item .detail .table td {
border-top: none;
border-bottom: 1px solid #DDDDDD;
}
.item .detail .table tr td:first-child {
color: #666;;
}
.item .detail .table tr td:last-child {
text-align:right;
}
.item .h-a .my_scroll .viewport {
height: 248px;
}
.item .h-b .my_scroll .viewport {
height: 632px;
}

View File

@ -11,4 +11,5 @@
*= require widget *= require widget
*= require style *= require style
*= require scroll_style *= require scroll_style
*= require isotope
*/ */

View File

@ -11,6 +11,7 @@ class Admin::ModuleAppsController < ApplicationController
def reload_frontend_pages def reload_frontend_pages
@module_app = ModuleApp.find(params[:id]) @module_app = ModuleApp.find(params[:id])
@categories = @module_app.key.eql?('announcement') ? BulletinCategory.all : nil
respond_to do |format| respond_to do |format|
format.js {} format.js {}
end end

View File

@ -31,6 +31,7 @@ class Admin::PagesController < ApplicationController
@designs = Design.all.entries @designs = Design.all.entries
@design = @item.design ? @item.design : @designs.first @design = @item.design ? @item.design : @designs.first
@app_frontend_urls = @item.module_app.app_pages if @item.module_app @app_frontend_urls = @item.module_app.app_pages if @item.module_app
@categories = BulletinCategory.all if @item.module_app && @item.module_app.key.eql?('announcement')
end end
def create def create

View File

@ -73,6 +73,17 @@ module ApplicationHelper
{:sort => column, :direction => direction} {:sort => column, :direction => direction}
end end
def is_sort_active?(name)
res = ''
res << ' select' if params[:sort].eql?(name)
res << ' active' if params[:sort].eql?(name) && params[:direction].eql?('asc')
res
end
def is_sort?(name)
' web-symbol' if params[:sort].eql?(name)
end
def add_filter(param_name, value) def add_filter(param_name, value)
filter = params[:filter] rescue nil filter = params[:filter] rescue nil
if filter && filter.has_key(param_name) if filter && filter.has_key(param_name)

View File

@ -1 +1,464 @@
Dashboard <div id="isotope">
<div class="item element">
<h3><i class="icons-member"></i><a href="">Member</a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-content"></i><a href="">Content</a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-asset"></i><a href="">Asset</a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href="">Traffic</a></h3>
<div class="detail w-a h-b">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href="">Site info</a></h3>
<div class="detail w-b h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href="">Connection</a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1 +1,2 @@
$('#app_page_url').html("<%= escape_javascript(select 'page','app_frontend_url', @module_app.app_pages) %>"); $('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', @module_app.app_pages) %>");
$('#app_page_category').html("<%= escape_javascript(select 'page', 'category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}) if @categories %>");

View File

@ -27,6 +27,7 @@
<%= t('admin.module_app') %> <%= t('admin.module_app') %>
<%= render :partial => "admin/module_apps/app_selector", :locals => { :f => f } %> <%= render :partial => "admin/module_apps/app_selector", :locals => { :f => f } %>
<span id="app_page_url"><%= select('page','app_frontend_url', @app_frontend_urls ) rescue ''%> </span> <span id="app_page_url"><%= select('page','app_frontend_url', @app_frontend_urls ) rescue ''%> </span>
<span id="app_page_category"><%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]} ) rescue ''%> </span>
</p> </p>
<p> <p>
<%= f.label :is_published, "#{t('admin.is_published')} ?" %> <%= f.label :is_published, "#{t('admin.is_published')} ?" %>

View File

@ -98,8 +98,9 @@ module ParserBackEnd
c.define_tag 'content' do |tag| c.define_tag 'content' do |tag|
ret = '' ret = ''
if (tag.attributes["main"] == "true" && !page.module_app.nil?) if (tag.attributes["main"] == "true" && !page.module_app.nil?)
# ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}?inner=true'></div>" ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}?inner=true&page_id=#{page.id}"
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}?inner=true&page_id=#{page.id}'></div>" ret << "&bulletin_category_id=#{page.category}" if page.category
ret << "'></div>"
else else
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s }
ret << "<div id='#{tag.attr['name']}' part_id='#{part.id}' class='editable' style='border:solid 1px; margin:5px; padding:5px;'>" ret << "<div id='#{tag.attr['name']}' part_id='#{part.id}' class='editable' style='border:solid 1px; margin:5px; padding:5px;'>"

View File

@ -76,6 +76,7 @@ module ParserFrontEnd
res << "<script type='text/javascript' src='/static/kernel.js'></script>" res << "<script type='text/javascript' src='/static/kernel.js'></script>"
res << "<script type='text/javascript' src='/assets/bootstrap.js'></script>" res << "<script type='text/javascript' src='/assets/bootstrap.js'></script>"
res << "<script type='text/javascript' src='/assets/jquery.tinyscrollbar.min.js'></script>" res << "<script type='text/javascript' src='/assets/jquery.tinyscrollbar.min.js'></script>"
res << "<script type='text/javascript' src='/assets/jquery.isotope.min.js'></script>"
res << "<script type='text/javascript' src='/assets/orbit-1.0.js'></script>" res << "<script type='text/javascript' src='/assets/orbit-1.0.js'></script>"
res << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>" res << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>"
page.design.javascripts.each do |js| page.design.javascripts.each do |js|
@ -124,8 +125,9 @@ module ParserFrontEnd
if (tag.attributes["main"] == "true" && !page.module_app.nil?) if (tag.attributes["main"] == "true" && !page.module_app.nil?)
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}" ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}"
ret << "/#{id}" if id ret << "/#{id}" if id
# ret << "?inner=true'></div>" ret << "?inner=true&page_id=#{page.id}"
ret << "?inner=true&page_id=#{page.id}'></div>" ret << "&bulletin_category_id=#{page.category}" if page.category
ret << "'></div>"
else else
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil
case part.kind case part.kind

View File

@ -12,7 +12,9 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
# @bulletins = Bulletin.where("bulletin_category_id" => params[:bulletin_category_id]).desc("postdate") if params[:bulletin_category_id] # @bulletins = Bulletin.where("bulletin_category_id" => params[:bulletin_category_id]).desc("postdate") if params[:bulletin_category_id]
@bulletins = Bulletin.search(params[:search], params[:category_id]).order_by([params[:sort], params[:direction]]) # @bulletins = Bulletin.search(params[:search], params[:category_id])
# @bulletins = Bulletin.all.order_by([params[:sort], params[:direction]])
@bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.all
@bulletin_categories = BulletinCategory.all @bulletin_categories = BulletinCategory.all
module_app = ModuleApp.first(:conditions => {:key => 'announcement'}) module_app = ModuleApp.first(:conditions => {:key => 'announcement'})
@ -20,6 +22,7 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js
format.xml { render :xml => @bulletins } format.xml { render :xml => @bulletins }
end end
end end
@ -146,5 +149,35 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true)) @bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
end end
def get_sorted_bulletins
bulletins = Bulletin.all
case params[:sort]
when 'postdate', 'deadline'
bulletins.order_by([params[:sort], params[:direction]])
when 'category'
category_ids = bulletins.distinct(:bulletin_category_id)
categories = BulletinCategory.find(category_ids) if category_ids
if categories
h = Hash.new
categories.each { |category| h[category.i18n_variable[I18n.locale]] = category.id }
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
sorted_categorys = sorted.collect {|a| bulletins.where(:bulletin_category_id => a[1]).entries }
sorted_categorys.flatten
else
nil
end
when 'title'
h = Hash.new
bulletins.each { |bulletin| h[bulletin.title[I18n.locale]] = bulletin }
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
sorted.collect {|a| a[1] }
when 'status'
# a << bulletins.order_by(:is_top, params[:direction]).order_by
# a << bulletins.where(:is_hot => true).entries
# a << bulletins.where(:is_hidden => true).entries
# a.flatten.uniq
end
end
end end

View File

@ -11,8 +11,11 @@ class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController
def index def index
date_now = Time.now date_now = Time.now
if params[:bulletin_category_id]
@bulletins = Bulletin.where(:bulletin_category_id => params[:bulletin_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(1)
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(1) @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(1)
end
get_categorys get_categorys
end end

View File

@ -0,0 +1,36 @@
<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 id="sort-status" class="sort span1 <%= is_sort_active?('status') %>">
<%= link_to (t('bulletin.status') + content_tag(:b, nil)), panel_announcement_back_end_bulletins_path(sortable('status')) %>
</th>
<th id="sort-category" 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 id="sort-title" 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 id="sort-postdate" 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 id="sort-deadline" 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 id="sort-tags" class="sort span1-2">
<%= link_to (t('bulletin.tags') + content_tag(:b, nil)), panel_announcement_back_end_bulletins_path(sortable('tags')) %>
</th>
<th id="sort-update_user_id" class="sort span1-2">
<%= link_to (t('bulletin.last_modified') + content_tag(:b, nil)), panel_announcement_back_end_bulletins_path(sortable('update_user_id')) %>
</th>
</tr>
</thead>
<tbody class="sort-holder">
<%= render :partial => 'bulletin', :collection => @bulletins %>
</tbody>

View File

@ -3,7 +3,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">Picture</label> <label class="control-label">Picture</label>
<div class="control-group"> <div class="control-group">
<img class="pull-left upload-picture" src="img/default-img.png" /> <img class="pull-left upload-picture" src="" />
<div class="controls file-upload"> <div class="controls file-upload">
<label class="control-label btn" for="input-upload"> <label class="control-label btn" for="input-upload">
Browse/選擇檔案 Browse/選擇檔案

View File

@ -1,31 +1,6 @@
<%= render 'filter' %> <%= render 'filter' %>
<table class="table main-list"> <table id="bulettin_sort_list" class="table main-list">
<thead> <%= render 'bulletins' %>
<tr>
<th class="span1 strong">
<input type="checkbox">
<a href class="list-remove"><i class="icon-trash"></i></a>
</th>
<th id="sort-status" class="sort span1">
<%= link_to (t('bulletin.status') + content_tag(:b, nil, :class => "web-symbol")), panel_announcement_back_end_bulletins_path(sortable('status')) %>
</th>
<th id="sort-status" class="sort span1-2">
<%= link_to (t('bulletin.category') + content_tag(:b, nil, :class => "web-symbol")), panel_announcement_back_end_bulletins_path(sortable('category')) %>
</th>
<%= link_to content_tag(:th, (t('bulletin.title') + content_tag(:b, nil, :class => "web-symbol")), :id => "sort-title", :class => "sort span7 select active"), panel_announcement_back_end_bulletins_path %>
<th id="sort-status" class="sort span1-2">
<%= link_to (t('bulletin.start_date') + content_tag(:b, nil, :class => "web-symbol")), panel_announcement_back_end_bulletins_path(sortable('start_date')) %>
</th>
<th id="sort-status" class="sort span1-2">
<%= link_to (t('bulletin.end_date') + content_tag(:b, nil, :class => "web-symbol")), panel_announcement_back_end_bulletins_path(sortable('end_date')) %>
</th>
<%= link_to content_tag(:th, (t('bulletin.tags') + content_tag(:b, nil, :class => "web-symbol")), :id => "sort-tags", :class => "sort span1-2"), panel_announcement_back_end_bulletins_path %>
<%= link_to content_tag(:th, (t('bulletin.last_modified') + content_tag(:b, nil, :class => "web-symbol")), :id => "sort-lastModified", :class => "sort span1-2"), panel_announcement_back_end_bulletins_path %>
</tr>
</thead>
<tbody>
<%= render :partial => 'bulletin', :collection => @bulletins %>
</tbody>
</table> </table>
<div class="form-actions"> <div class="form-actions">

View File

@ -0,0 +1 @@
$("#bulettin_sort_list").html("<%= j render 'bulletins' %>")