Compare commits

..

2 Commits
master ... nkut

Author SHA1 Message Date
Manson Wang 9350533d11 NKUT footer displaying number of visitors and last update time 2014-02-07 15:44:18 +08:00
saurabhbhatia 6e39e4f240 Customizations for NKUT 2014-02-07 15:44:18 +08:00
30 changed files with 175 additions and 147 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 KiB

After

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 KiB

After

Width:  |  Height:  |  Size: 348 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -38,6 +38,8 @@ $(document).ready(function() {
}
}
})
$('.page_footer').append($('#last_update_date')[0]);
});
// Ad Banner FX code [end]

View File

@ -1,6 +1,4 @@
$(function() {
var ListCheckData = {},
ListCheck = function(element) {
var ListCheck = function(element) {
this.element = $(element);
this.element.data('exists', true);
if(this.element.context.parentNode.tagName == "TD") {
@ -13,70 +11,47 @@ $(function() {
this.element.before('<i class="icon-check-empty" />');
};
$.fn.listCheck = function () {
$(this).each(function() {
var $this = $(this),
$el = $this.find('input[type="checkbox"]');
$el.each(function (i) {
$.fn.listCheck = function (callback) {
this.each(function (i) {
if(!$(this).data('exists')) {
new ListCheck(this);
};
});
$this.on(clickEvent, $el, function(e) {
if($(e.target).prop('checked')) {
$(e.target).siblings('i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
this.on(clickEvent, function(e) {
if($(this).prop('checked')) {
$(this).siblings('i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
} else {
$(e.target).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
$(this).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
};
if($(e.target).closest('th').hasClass('listCheckHead')) {
$this.find('.listCheck input[type="checkbox"]').prop('checked', $(e.target).prop('checked'));
if($(e.target).prop('checked')) {
$this.find('.listCheck i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
if ($(this).closest('.listCheckHead').length) {
$('.listCheck .list-check').prop('checked', $(this).prop('checked'));
if($(this).prop('checked')) {
$('.listCheck i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
} else {
$this.find('.listCheck i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
$('.listCheck i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
}
};
var _isCheck = $this.find('tbody').find($el).filter(':checked').length,
_defaultLength = $this.find('tbody').find($el).length;
var _isCheck = $('tbody .list-check').filter(':checked').length,
_defaultLength = $('tbody .list-check').length;
if(_isCheck > 0 && _isCheck < _defaultLength) {
$this.find('.listCheckHead i').removeClass('icon-check-empty icon-check').addClass('icon-minus');
$('.listCheckHead i').removeClass('icon-check-empty icon-check').addClass('icon-minus');
} else if(!_isCheck) {
$this.find('.listCheckHead i').removeClass('icon-minus icon-check').addClass('icon-check-empty');
$('.listCheckHead i').removeClass('icon-minus icon-check').addClass('icon-check-empty');
} else {
$this.find('.listCheckHead i').removeClass('icon-check-empty icon-minus').addClass('icon-check');
$('.listCheckHead i').removeClass('icon-check-empty icon-minus').addClass('icon-check');
}
_isCheck ? $this.find('.list-active-btn').removeClass('disabled').data('actionable', true) : $this.find('.list-active-btn').addClass('disabled').data('actionable', false);
_isCheck ? $('.list-active-btn').removeClass('disabled').data('actionable', true) : $('.list-active-btn').addClass('disabled').data('actionable', false);
});
$this.on(clickEvent, '.list-active-btn', function(e) {
if(!$(this).hasClass('disabled')) {
ListCheckData.url = $(this).attr('rel');
ListCheckData.name = $this.find('tbody').find('input[type="checkbox"]').attr('name');
ListCheckData.action = $(this).data('checkAction');
ListCheckData.values = [];
ListCheckData.element = $this
$this.find('tbody').find('input[type="checkbox"]').each(function (i) {
this.checked && ListCheckData.values.push("ids[]=" + this.value);
});
console.log(ListCheckData.values.join("&"));
$('#dialog').modal('show');
return false;
};
function clearCheck() {
$('.list-check').each(function() {
$(this).prop('checked', false);
})
}
});
});
clearCheck($(this));
};
function clearCheck(element) {
element.find('input[type="checkbox"]').each(function() {
$(this).prop('checked', false).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
});
element.find('.list-active-btn').addClass('disabled');
};
function actionSuccess(e) {
ListCheckData.element.find('tbody').find('input[type="checkbox"]').each(function() {
$("tbody .list-check").each(function() {
switch(e) {
case 'list-be-hide':
$(this).filter(':checked').closest('tr').addClass('checkHide');
@ -92,17 +67,32 @@ $(function() {
};
$('.list-check').siblings('i').removeAttr('class').addClass('icon-check-empty').closest('tr').removeClass('checkHit');
});
clearCheck(ListCheckData.element);
clearCheck();
}
$(function() {
var $t = null,
_data = null;
clearCheck();
$('.list-check').listCheck();
$('.list-active-btn').data('actionable', false).on(clickEvent, function(e) {
$t = $(this)
_data = $(this).data()
_data.actionable ? $('#dialog').modal('show') : "";
e.preventDefault();
});
$('.delete-item').on(clickEvent, function() {
if(ListCheckData.url.indexOf("?") > -1) {
$.ajax(ListCheckData.url + "&" + ListCheckData.values.join("&")).done(function() {
actionSuccess(ListCheckData.action);
var _v = [];
$("tbody .list-check").each(function() {
this.checked && _v.push("ids[]="+this.value)
});
var _t = $t.attr("rel");
if(_t.indexOf("?") > -1) {
$.ajax(_t + "&" + _v.join("&")).done(function() {
actionSuccess(_data.checkAction)
});
} else {
$.ajax(ListCheckData.url + "?" + ListCheckData.values.join("&")).done(function() {
actionSuccess(ListCheckData.action);
$.ajax(_t + "?" + _v.join("&")).done(function() {
actionSuccess(_data.checkAction)
});
}
$('#dialog').modal('hide');

View File

@ -4,8 +4,8 @@
vertical-align: middle;
padding: 0 0 0 10px!important;
}
.listCheckHead input[type="checkbox"],
.listCheck input[type="checkbox"] {
.listCheckHead .list-check,
.listCheck .list-check {
position: absolute;
margin: -12px 0 0 -1px;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";

View File

@ -179,6 +179,7 @@ div[data-role="page"] {
}
.content .orbit-cycle-slideshow {
height: 300px;
overflow: hidden;
}
.content .orbit-cycle-slideshow img {
width: 100%;
@ -325,13 +326,22 @@ div[id^="dialog"] .content {
margin-bottom: 5px;
}
@media(min-width:320px){
.content .orbit-cycle-slideshow {
height: 130px;
}
}
@media(min-width: 480px){
.content .orbit-cycle-slideshow {
height: 170px;
}
.content .newitem {
width: 440px;
}
}
@media(min-width:600px) {
.content .orbit-cycle-slideshow {
height: 200px;
}
.main-menu ul {
width: 420px;
}
@ -340,6 +350,9 @@ div[id^="dialog"] .content {
}
}
@media(min-width:768px) {
.content .orbit-cycle-slideshow {
height: 250px;
}
.main-menu ul {
width: 480px;
}
@ -351,6 +364,9 @@ div[id^="dialog"] .content {
}
}
@media(min-width:800px) {
.content .orbit-cycle-slideshow {
height: 330px;
}
.main-menu ul {
width: 480px;
}
@ -359,6 +375,9 @@ div[id^="dialog"] .content {
}
}
@media(min-width:961px) {
.content .orbit-cycle-slideshow {
height: 380px;
}
.main-menu ul {
width: 480px;
}

View File

@ -1,7 +1,6 @@
class OrbitBackendController < ApplicationController
include OrbitCategory::Categorizing
include OrbitCoreLib::Authorization
include OrbitCoreLib::PermissionUtility
include OrbitTag::Tagging
include AdminHelper
include ApplicationHelper

View File

@ -2,6 +2,7 @@ class PagesController < ApplicationController
include ApplicationHelper
before_filter :get_item, :only => [:index_from_link, :show_from_link]
before_filter :check_frontend_open, :only => [:index,:show]
before_filter :get_last_update_date, :only => [:index,:show]
# caches_page :index
def index
@ -226,4 +227,8 @@ class PagesController < ApplicationController
return false
end
end
def get_last_update_date
@last_update_date = t(:total_visitors)+' : '+ Impression.count.to_s+' | '+t(:update_at)+' : '+Bulletin.order_by(:updated_at.desc).limit(1).first[:updated_at].to_s
end
end

View File

@ -12,13 +12,13 @@ module OrbitBackendHelper
def show_form_status_field(object)
#by_object = (!object.is_expired? and object.is_pending?)
by_user = ((object.category.user_is_authorized_by_title?(current_user,"category_approval_#{@module_app.key}") rescue nil) or is_manager? or is_admin?)
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
by_user
end
def show_approval_link(object)
by_object = (!object.is_expired? and object.is_pending?)
by_user = ((object.category.user_is_authorized_by_title?(current_user,"category_approval_#{@module_app.key}") rescue nil) or is_manager? or is_admin?)
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
by_object and by_user
end
@ -306,7 +306,7 @@ module OrbitBackendHelper
content_tag :li, link_to(t(quick[:translation] || :authorization_), eval("#{quick[:link]}"), class: "preview_trigger #{quick[:class]}")
end
when 'edit'
if authorization && approvable || is_manager?
if authorization && approvable
content_tag :li, link_to(t(quick[:translation] || :edit), quick[:link].nil? ? '#' : eval("#{quick[:link]}('#{object.id}'#{link_option})"), class: quick[:class], data: eval("#{quick[:data]}"))
end
when 'delete'

View File

@ -194,7 +194,6 @@ class ModuleApp
# authorization
def update_auth_approval_users
user_ids = self.auth_approvals.inject([]) do |users, auth|
auth = auth.class.find(auth.id)
users += auth.authorized_users.map{|user| user.id}
end
self.update_attribute(:auth_approval_users, user_ids.uniq)

View File

@ -63,7 +63,7 @@
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade in active list-check" id="send-log">
<div class="tab-pane fade in active" id="send-log">
<p class="">
<a href="#" class="btn list-active-btn disabled" data-check-action="list-be-remove" rel="/panel/announcement/back_end/bulletins/delete"><i class="icons-trash"></i></a>
</p>
@ -71,7 +71,7 @@
<thead>
<tr>
<th>
<input type="checkbox" name="to_delete[]" value="b" />
<input type="checkbox" class="list-check" name="to_delete[]" value="b" />
</th>
<th><%= t(:sent_date) %></th>
<th><%= t(:subject) %></th>
@ -81,10 +81,26 @@
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox" class="list-check" name="to_delete[]" value="b" />
</td>
<td>2014-01-16 17:57</td>
<td>【轉知】國家教育研究院辦理普通高級中學語文及社會領域課綱微調分區公聽會
<div class="quick-edit">
<ul class="nav nav-pills">
<li><a href="#" class="text-error"><%= t(:delete_) %></a></li>
</ul>
</div>
</td>
<td>alluser@tea.ntue.edu.tw</td>
<td>蔣 欣潔</td>
<td>er_email</td>
</tr>
</tbody>
</table>
</div>
<div class="tab-pane fade in list-check" id="waiting-sent">
<div class="tab-pane fade in" id="waiting-sent">
<p class="">
<a href="#" class="btn list-active-btn disabled" data-check-action="list-be-remove" rel="/panel/announcement/back_end/bulletins/delete"><i class="icons-trash"></i></a>
</p>
@ -92,15 +108,32 @@
<thead>
<tr>
<th>
<input type="checkbox" name="to_delete[]" value="b" />
<input type="checkbox" class="list-check" name="to_delete[]" value="b" />
</th>
<th><%= t(:sent_date) %></th>
<th><%= t(:subject) %></th>
<th><%= t(:mail_to) %></th>
<th><%= t(:mail_from_app) %></th>
<th>Sentdate</th>
<th>Subject</th>
<th>Mail To</th>
<th>Mail User</th>
<th>Mail From App</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox" class="list-check" name="to_delete[]" value="b" />
</td>
<td>2014-01-16 17:57</td>
<td>【轉知】國家教育研究院辦理普通高級中學語文及社會領域課綱微調分區公聽會
<div class="quick-edit">
<ul class="nav nav-pills">
<li><a href="#" class="text-error"><%= t(:delete_) %></a></li>
</ul>
</div>
</td>
<td>alluser@tea.ntue.edu.tw</td>
<td>蔣 欣潔</td>
<td>er_email</td>
</tr>
</tbody>
</table>
</div>

View File

@ -66,7 +66,7 @@
<div id="module-content">
<div class="nano">
<div class="content list-check">
<div class="content">
<%=render :partial => @right_partial %>
</div>
</div>

View File

@ -41,5 +41,6 @@
}
</style>
<% end %>
<div id='last_update_date_wrap' style='display:none;'><div id='last_update_date'><%= @last_update_date %></div></div>
</body>
</html>

View File

@ -1,11 +0,0 @@
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
Resque.redis.client.disconnect
Resque.redis = Redis.new(:host => 'localhost', :port => 6379)
Resque.redis.namespace = Site.first.resque_namespace rescue APP_CONFIG['orbit']
else
# We're in conservative spawning mode. We don't need to do anything.
end
end
end

View File

@ -225,13 +225,11 @@ en:
groups: Groups
help: Help
hidden: Hidden
is_hidden: Hidden
hide: Hide
hits: Hits
homepage: Homepage
horizontal: Horizontal
hot: Hot
is_hot: Hot
image: Image
images: Images
info: Information
@ -347,13 +345,11 @@ en:
public_r_tag: System Widget
text: Text Area
passed: Approved
is_checked: Approved
password: Password
password_change: Change password
password_confirmation: Password confirmation
password_current: Current password
pending: Pending
is_pending: Pending
personal_plugins:
author : "Author"
edit_brief_intro : "Edit Brief Intro."
@ -396,7 +392,6 @@ en:
register: Register
registered: Registered
rejected: Rejected
is_rejected: Rejected
rejected_reason: 'Reason:'
rejected_reason_empty: "Approval rejected, no referencable information"
related_links: Related Links
@ -524,7 +519,6 @@ en:
to_search: Set as Search Key
to_show: Display in frontend
top: Top
is_top: Top
total_visitors: Total Visitors
traffic: Traffic
type: Field Type

View File

@ -348,13 +348,11 @@ zh_tw:
public_r_tag: 系統模塊
text: 文字區域
passed: 通過審核
is_checked: 通過審核
password: 密碼
password_change: 更改密碼
password_confirmation: 確認密碼
password_current: 目前的密碼
pending: 待審核
is_pending: 待審核
personal_plugins:
author : "著作人"
edit_brief_intro : "編輯摘要"
@ -396,7 +394,6 @@ zh_tw:
register: 註冊
registered: 已註冊
rejected: 拒絕
is_rejected: 拒絕
rejected_reason: 拒絕原因:'
rejected_reason_empty: "拒絕核准, 沒有參考資訊"
related_links: 相關連結

View File

@ -234,7 +234,7 @@ module OrbitCoreLib
when :sub_manager
@open ||= check_sub_manager
when :approver
@open ||= check_approver
@open ||= check_sub_manager
when :user
@open ||= true
when :visitor

View File

@ -45,7 +45,7 @@
<thead>
<tr>
<% if is_admin? %>
<th><input type="checkbox" /></th>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span1"><%= t('personal_book.year') %></th>
<th><%= t('personal_book.book_title') %></th>

View File

@ -45,7 +45,7 @@
<thead>
<tr>
<% if is_admin? %>
<th><input type="checkbox" /></th>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span1"><%= t('personal_conference.year') %></th>
<th><%= t('module_name.personal_conference') %></th>

View File

@ -45,7 +45,7 @@
<thead>
<tr>
<% if is_admin? %>
<th><input type="checkbox" /></th>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span2"><%= t('date_') %></th>
<th><%= t('personal_diploma.school_name') %></th>

View File

@ -45,7 +45,7 @@
<thead>
<tr>
<% if is_admin? %>
<th><input type="checkbox" /></th>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span2"><%= t('date_') %></th>
<th><%= t('personal_experience.organizationt_title') %></th>

View File

@ -45,7 +45,7 @@
<thead>
<tr>
<% if is_admin? %>
<th><input type="checkbox" /></th>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span1"><%= t('personal_honor.year') %></th>
<th><%= t('personal_honor.award_name') %></th>

View File

@ -44,7 +44,7 @@
<thead>
<tr>
<% if is_admin? %>
<th><input type="checkbox" /></th>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span1"><%= t('personal_journal.year') %></th>
<th><%= t('module_name.personal_journal') %></th>

View File

@ -45,7 +45,7 @@
<thead>
<tr>
<% if is_admin? %>
<th><input type="checkbox" /></th>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span1"><%= t('personal_lab.year') %></th>
<th><%= t('personal_lab.lab_title') %></th>

View File

@ -45,7 +45,7 @@
<thead>
<tr>
<% if is_admin? %>
<th><input type="checkbox" /></th>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span2"><%= t('personal_patent.publication_date') %></th>
<th><%= t('personal_patent.patent_title') %></th>

View File

@ -45,7 +45,7 @@
<thead>
<tr>
<% if is_admin? %>
<th><input type="checkbox" /></th>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span2"><%= t('personal_project.period') %></th>
<th><%= t('personal_project.project_title') %></th>

View File

@ -45,7 +45,7 @@
<thead>
<tr>
<% if is_admin? %>
<th><input type="checkbox" /></th>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span2"><%= t('personal_research.publication_date') %></th>
<th><%= t('personal_research.research_title') %></th>