Compare commits

..
Author SHA1 Message Date
harrybomrah 11063d8512 items.js modified for new page setting 2013-11-08 18:28:08 +08:00
harrybomrah 03ea69b122 two major fix for site setting and bulletin controller 2013-11-08 16:34:26 +08:00
harrybomrah 9e432a5a93 fixed announcement rendering.. 2013-11-08 12:58:34 +08:00
saurabhbhatia 2f61f55be2 Rays fixes 2013-11-08 12:55:04 +08:00
7 changed files with 22 additions and 21 deletions

No files matched your search

@@ -38,9 +38,11 @@ if($.support.touch) {
$checked.each(function() {
if(!$(this).closest('div').hasClass('togglebox')) {
$(this).wrap('<div class="toggle-control"/>');
if($(this).attr('type') == "hidden" && $(this).attr('value')) {
$(this).wrap('<div class="togglebox disabled" />');
if($(this).attr('type') == "hidden" && $(this).attr('value') == 'true') {
console.log('true')
$(this).wrap('<div class="togglebox disable" />');
} else {
console.log('false')
$(this).wrap('<div class="togglebox" />');
}
$('<label><b></b></label>').insertAfter($(this));
@@ -541,6 +543,7 @@ function changeStatusHidden() {
// Document Ready
$(function() {
console.log('true')
showFiltersOnPageRefresh();
new ini();
@@ -411,7 +411,7 @@ $(function() {
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
}
var $all = $pageCategory.siblings('.checkbox').children('.select_all');
_val == _select.main && _select.category.length ? $hiddenInputA.removeAttr('name') : $hiddenInputA.attr('name', 'page[category][]');
_boolean && _val == _select.main && _select.category.length ? $hiddenInputA.removeAttr('name') : $hiddenInputA.attr('name', 'page[category][]');
_boolean && _val == _select.main && _select.category.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
}
});
@@ -431,7 +431,7 @@ $(function() {
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
}
var $all = $pageTags.siblings('.checkbox').children('.select_all');
_val == _select.main && _select.tags.length ? $hiddenInputB.removeAttr('name') : $hiddenInputB.attr('name', 'page[tag][]');
_boolean && _val == _select.main && _select.tags.length ? $hiddenInputB.removeAttr('name') : $hiddenInputB.attr('name', 'page[tag][]');
_boolean && _val == _select.main && _select.tags.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
}
});
@@ -222,7 +222,7 @@ $(function() {
});
$('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
if($(this).hasClass('togglebox')) {
if($(this).hasClass('disabled')) {
if($(this).hasClass('disable')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.closest('.attributes')
@@ -237,7 +237,7 @@ $(function() {
.children('.attributes-body')
.fadeOut(300);
}
$(this).toggleClass('disabled');
$(this).toggleClass('disable');
};
if($(this).hasClass('remove-input')) {
$(this).closest('.input-append').fadeOut(300, function() {
@@ -382,7 +382,7 @@ $(function() {
});
$('#attributes-area').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
if($(this).hasClass('togglebox')) {
if($(this).hasClass('disabled')) {
if($(this).hasClass('disable')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.closest('.attributes')
@@ -411,7 +411,7 @@ $(function() {
$(this).parent('.field-type').removeClass('in');
});
}
$(this).toggleClass('disabled');
$(this).toggleClass('disable');
};
if($(this).hasClass('delete')) {
$(this).closest('.attributes').fadeOut(300, function() {
+1 -1
View File
@@ -51,7 +51,7 @@ $(function() {
}
if($('.set-sidebar-state').length) {
if(window.localStorage.getItem('sidebarState') == 1) {
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disabled');
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disable');
}
$('.set-sidebar-state').on({
change: function() {
+8 -4
View File
@@ -21,11 +21,15 @@ class Admin::PagesController < Admin::ItemsController
end
def update
if params[:page][:category][0] == ""
params[:page][:category] = []
if params[:page][:category]
if params[:page][:category][0] == ""
params[:page][:category] = []
end
end
if params[:page][:tag][0] == ""
params[:page][:tag] = []
if params[:page][:tag]
if params[:page][:tag][0] == ""
params[:page][:tag] = []
end
end
@item = Page.find(params[:id])
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
@@ -5,12 +5,7 @@
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
<div class="attributes-header clearfix">
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= role_disable ? 'disabled' : '' %>">
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
<label><b></b></label>
</div>
</div>
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
<h4><%= role.title %><%= t(:role_info)%></h4>
</div>
@@ -26,7 +26,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
end
def index
@bulletins = get_bulletins_for_index
end
def get_bulletins_for_index
@@ -47,7 +47,6 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
# @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in=>params[:category_id],:tagged_ids.in=>params[:tag_id])
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
debugger
elsif !params[:category_id].blank?
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil