Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4697a0d237 |
No files matched your search
@@ -38,11 +38,9 @@ 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') == 'true') {
|
||||
console.log('true')
|
||||
$(this).wrap('<div class="togglebox disable" />');
|
||||
if($(this).attr('type') == "hidden" && $(this).attr('value')) {
|
||||
$(this).wrap('<div class="togglebox disabled" />');
|
||||
} else {
|
||||
console.log('false')
|
||||
$(this).wrap('<div class="togglebox" />');
|
||||
}
|
||||
$('<label><b></b></label>').insertAfter($(this));
|
||||
@@ -543,7 +541,6 @@ function changeStatusHidden() {
|
||||
|
||||
// Document Ready
|
||||
$(function() {
|
||||
console.log('true')
|
||||
showFiltersOnPageRefresh();
|
||||
|
||||
new ini();
|
||||
|
||||
@@ -189,10 +189,8 @@ function pageSetting(id, edit, ps) {
|
||||
if(_arr !== -1) {
|
||||
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||
}
|
||||
var $all = $pageCategory.siblings('.checkbox').children('.select_all'),
|
||||
$hiddenInput = $pageCategory.siblings('input[type="hidden"]');
|
||||
_selectData.module.category.length ? $hiddenInput.removeAttr('name') : $hiddenInput.attr('name', 'page[category][]');
|
||||
_selectData.module.category.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
||||
var $all = $pageCategory.siblings('.checkbox').children('.select_all')
|
||||
_selectData.module.category.length > 1 && _selectData.module.category.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
||||
});
|
||||
$pageCategoryGroup.show();
|
||||
}
|
||||
@@ -203,10 +201,8 @@ function pageSetting(id, edit, ps) {
|
||||
if(_arr !== -1) {
|
||||
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||
}
|
||||
var $all = $pageTags.siblings('.checkbox').children('.select_all'),
|
||||
$hiddenInput = $pageTags.siblings('input[type="hidden"]');
|
||||
_selectData.module.tags.length ? $hiddenInput.removeAttr('name') : $hiddenInput.attr('name', 'page[tag][]');
|
||||
_selectData.module.tags.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
||||
var $all = $pageTags.siblings('.checkbox').children('.select_all')
|
||||
_selectData.module.tags.length > 1 && _selectData.module.tags.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
||||
});
|
||||
$pageTagsGroup.show();
|
||||
}
|
||||
@@ -401,7 +397,6 @@ $(function() {
|
||||
|
||||
if(event.target.id == 'page_module_app_id') {
|
||||
$pageCategory.empty();
|
||||
var $hiddenInputA = $pageCategory.siblings('input[type="hidden"]');
|
||||
if(val.category.length > 0) {
|
||||
$.each(val.category, function(index, val) {
|
||||
if(val !== 0) {
|
||||
@@ -411,17 +406,14 @@ $(function() {
|
||||
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||
}
|
||||
var $all = $pageCategory.siblings('.checkbox').children('.select_all');
|
||||
_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);
|
||||
_boolean && _val == _select.main && _select.category.length > 1 && _select.category.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
||||
}
|
||||
});
|
||||
$pageCategoryGroup.slideDown(300);
|
||||
$pageCategoryGroup.show();
|
||||
} else {
|
||||
$pageCategoryGroup.slideUp(300);
|
||||
$hiddenInputA.removeAttr('name');
|
||||
$pageCategoryGroup.hide();
|
||||
}
|
||||
$pageTags.empty();
|
||||
var $hiddenInputB = $pageTags.siblings('input[type="hidden"]');
|
||||
if(val.tags.length > 0) {
|
||||
$.each(val.tags, function(index, val) {
|
||||
if(val !== 0) {
|
||||
@@ -431,14 +423,12 @@ $(function() {
|
||||
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||
}
|
||||
var $all = $pageTags.siblings('.checkbox').children('.select_all');
|
||||
_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);
|
||||
_boolean && _val == _select.main && _select.tags.length > 1 && _select.tags.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
||||
}
|
||||
});
|
||||
$pageTagsGroup.slideDown(300);
|
||||
$pageTagsGroup.show();
|
||||
} else {
|
||||
$pageTagsGroup.slideUp(300);
|
||||
$hiddenInputB.removeAttr('name');
|
||||
$pageTagsGroup.hide();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -471,10 +461,8 @@ $(function() {
|
||||
if($checked.hasClass('select_all')) {
|
||||
if($checked.prop('checked')) {
|
||||
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', true);
|
||||
$checked.closest('.checkbox').siblings('input[type="hidden"]').removeAttr('name');
|
||||
} else {
|
||||
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', false);
|
||||
$checked.closest('.checkbox').siblings('input[type="hidden"]').attr('name', 'page['+$checked.closest('.checkbox-groups').data('for')+'][]');
|
||||
}
|
||||
} else if($checked.hasClass('lang-enable')) {
|
||||
var checkboxes = $checked.closest('.groups').find('input[type="checkbox"]');
|
||||
@@ -495,11 +483,10 @@ $(function() {
|
||||
var _l = $checked.closest('.groups').find('input[type="checkbox"]').length,
|
||||
_c = $checked.closest('.groups').find('input[type="checkbox"]:checked').length;
|
||||
if(_l == _c) {
|
||||
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', true);
|
||||
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', true)
|
||||
} else {
|
||||
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false);
|
||||
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false)
|
||||
};
|
||||
_c == 0 ? $checked.closest('.groups').siblings('input[type="hidden"]').attr('name', 'page['+$checked.closest('.checkbox-groups').data('for')+'][]') : $checked.closest('.groups').siblings('input[type="hidden"]').removeAttr('name');
|
||||
}
|
||||
return false;
|
||||
} else if($checked.attr('type') == 'radio' && !$(this).closest('div').hasClass('active-mune')) {
|
||||
|
||||
@@ -222,7 +222,7 @@ $(function() {
|
||||
});
|
||||
$('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
||||
if($(this).hasClass('togglebox')) {
|
||||
if($(this).hasClass('disable')) {
|
||||
if($(this).hasClass('disabled')) {
|
||||
$(this).find('.toggle-check')
|
||||
.attr('value', 'false')
|
||||
.closest('.attributes')
|
||||
@@ -237,7 +237,7 @@ $(function() {
|
||||
.children('.attributes-body')
|
||||
.fadeOut(300);
|
||||
}
|
||||
$(this).toggleClass('disable');
|
||||
$(this).toggleClass('disabled');
|
||||
};
|
||||
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('disable')) {
|
||||
if($(this).hasClass('disabled')) {
|
||||
$(this).find('.toggle-check')
|
||||
.attr('value', 'false')
|
||||
.closest('.attributes')
|
||||
@@ -411,7 +411,7 @@ $(function() {
|
||||
$(this).parent('.field-type').removeClass('in');
|
||||
});
|
||||
}
|
||||
$(this).toggleClass('disable');
|
||||
$(this).toggleClass('disabled');
|
||||
};
|
||||
if($(this).hasClass('delete')) {
|
||||
$(this).closest('.attributes').fadeOut(300, function() {
|
||||
|
||||
@@ -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('disable');
|
||||
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disabled');
|
||||
}
|
||||
$('.set-sidebar-state').on({
|
||||
change: function() {
|
||||
|
||||
@@ -23,9 +23,7 @@ class Admin::PagePartsController < OrbitBackendController
|
||||
@class_options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
|
||||
@partial = 'default_widget'
|
||||
else
|
||||
|
||||
# @frontend_styles = @module_app.widgets[params[:val]]["style"] rescue nil
|
||||
@frontend_styles = @module_app.widgets[@part.widget_path]["style"] rescue nil
|
||||
@frontend_styles = @module_app.widgets[params[:val]]["style"] rescue nil
|
||||
@partial = 'custom_widget' if @frontend_styles.present?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -21,16 +21,6 @@ class Admin::PagesController < Admin::ItemsController
|
||||
end
|
||||
|
||||
def update
|
||||
if params[:page][:category]
|
||||
if params[:page][:category][0] == ""
|
||||
params[:page][:category] = []
|
||||
end
|
||||
end
|
||||
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?
|
||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||
|
||||
@@ -28,22 +28,20 @@
|
||||
<%= select_tag "page[app_frontend_url]", nil, class: "input-xlarge change" %>
|
||||
</div>
|
||||
|
||||
<div class="checkbox-groups hide" id="page-category-groups" data-for="category">
|
||||
<div class="checkbox-groups hide" id="page-category-groups">
|
||||
<%= f.label :categories, t(:categories) %>
|
||||
<%= content_tag :label, class: "checkbox" do %>
|
||||
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
||||
<% end %>
|
||||
<div class="groups" id="page-category"></div>
|
||||
<input type="hidden">
|
||||
</div>
|
||||
|
||||
<div class="checkbox-groups hide" id="page-tags-groups" data-for="tag">
|
||||
<div class="checkbox-groups hide" id="page-tags-groups">
|
||||
<%= f.label :tags, t(:tags) %>
|
||||
<%= content_tag :label, class: "checkbox" do %>
|
||||
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
||||
<% end %>
|
||||
<div class="groups" id="page-tags"></div>
|
||||
<input type="hidden">
|
||||
</div>
|
||||
|
||||
<div class="display-mode"></div>
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
<% else %>
|
||||
<%= link_to node.title, node.url %>
|
||||
<% end %>
|
||||
|
||||
<div class="item-menu">
|
||||
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), eval("admin_#{node.class.to_s.downcase}_path(node)"), class: "view-page open-slide tip", title: t(:view), data: {title: node.title} if node.class.to_s.eql?('Page') %>
|
||||
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), "/#{node.path}?edit=true", class: "view-page open-slide tip", title: t(:view), data: {title: node.title} if node.class.to_s.eql?('Page') %>
|
||||
<% if node.class.to_s.downcase.eql?("page") %>
|
||||
<%= link_to content_tag(:i, nil, class: "icon-edit"), "#page", class: "open-slide tip page edit", title: t('editing.page'), data: {title: t('editing.page'), id: node.id.to_s, parent: node.parent_id.to_s, form: {name: node.name}.merge(node.title_translations)} %>
|
||||
<% elsif node.class.to_s.downcase.eql?("link") %>
|
||||
|
||||
@@ -3,25 +3,4 @@
|
||||
<div class="controls">
|
||||
<%= select 'page_part', 'widget_style', @frontend_styles, {:selected => (@part && @part[:widget_style])}, class: "input-xlarge" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group input-content">
|
||||
<% @module_app.widget_options.tap { |widget|%>
|
||||
<% widget.each { |w|%>
|
||||
<% w.get_options.each do |key, settings| %>
|
||||
<% options = settings[:opts] %>
|
||||
<%= label_tag(t(settings[:label_i18n], :class=>"control-label muted"))%>
|
||||
<% case options%>
|
||||
<% when Hash%>
|
||||
<div class="controls">
|
||||
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)), class: "input-xlarge" %>
|
||||
</div>
|
||||
<% else%>
|
||||
<div class="controls">
|
||||
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)), class: "input-xlarge" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
@@ -1,18 +0,0 @@
|
||||
<% if (not(@selected[:module_app].widget_options(@selected[:app_frontend_url]).blank?) and @selected[:app_frontend_url]!='default_widget')%>
|
||||
|
||||
|
||||
<% @selected[:module_app].widget_options(@selected[:app_frontend_url]).get_options.each do |key,settings| %>
|
||||
<% options = settings[:opts] %>
|
||||
<%= label_tag(t(settings[:label_i18n]))%>
|
||||
<% case options%>
|
||||
<% when Hash%>
|
||||
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)) %>
|
||||
<% else%>
|
||||
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)) %>
|
||||
<!-- (@part[:widget_field][i][0] if (@part && !@part[:widget_field].blank? && !@part[:widget_field][i].blank?)) ) -->
|
||||
<% end %>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
@@ -5,7 +5,12 @@
|
||||
|
||||
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
|
||||
<div class="attributes-header clearfix">
|
||||
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
|
||||
<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>
|
||||
<h4><%= role.title %><%= t(:role_info)%></h4>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<ul class="nav nav-pills filter-nav pull-right">
|
||||
<li class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a href="#collapse-role" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="filter-group accordion-group">
|
||||
<div class="accordion-body collapse" id="collapse-role">
|
||||
<div class="accordion-body collapse" id="collapse-status">
|
||||
|
||||
<%= render :partial => "filter"%>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<ul class="nav nav-pills filter-nav pull-right">
|
||||
<li class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a href="#collapse-role" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="filter-group accordion-group">
|
||||
<div class="accordion-body collapse" id="collapse-role">
|
||||
<div class="accordion-body collapse" id="collapse-status">
|
||||
|
||||
<%= render :partial => "filter"%>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div style='position:relative'>
|
||||
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class="orbit-cycle-slideshow" data-cycle-timeout="<%= @ad_banner.timeout_millisecond %>" data-cycle-fx="<%= @ad_banner.ad_fx %>" data-cycle-pager=".banner_nav_<%= @ad_banner.title.dehumanize %>" data-cycle-pager-template="<li class='needed'><a href='#'></a></li>" data-cycle-pager-active-class="activeSlide" data-cycle-random='true' style="z-index: 0">
|
||||
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class="orbit-cycle-slideshow" data-cycle-timeout="<%= @ad_banner.timeout_millisecond %>" data-cycle-fx="<%= @ad_banner.ad_fx %>" data-cycle-pager=".banner_nav_<%= @ad_banner.title.dehumanize %>" data-cycle-pager-template="<li><a href='#'></a></li>" data-cycle-pager-active-class="activeSlide" data-cycle-random='true' style="z-index: 0">
|
||||
<% @ad_banner.ad_images.can_display.each do |ad_image| %>
|
||||
<% link = ad_image_link(ad_image) %>
|
||||
<%= image_tag ad_image.file, width: @ad_banner.width, height: @ad_banner.height, link_open: ad_image.link_open, link_url: link, style: "display:none; #{'cursor:pointer;' if link.present?}" %>
|
||||
@@ -17,12 +17,6 @@
|
||||
<% end %>
|
||||
$.preload(a, 2, function(){
|
||||
$('.orbit-cycle-slideshow').cycle();
|
||||
var lis = $("ul.banner_nav_<%= @ad_banner.title.dehumanize %> li");
|
||||
if( lis.length > a.length ){
|
||||
for( i = lis.length - 1; i > a.length - 1; i-- ){
|
||||
lis[i].remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
|
||||
+1
-1
@@ -24,4 +24,4 @@ production:
|
||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||
<<: *defaults
|
||||
database: orbit_site_new
|
||||
database: test_site
|
||||
@@ -48,7 +48,13 @@ module ParserFrontEnd
|
||||
ret = ''
|
||||
part = PagePart.find(front['part_id']) if front['part_id']
|
||||
ret << eval("\"#{front['path']}\"") rescue ''
|
||||
ret << (ret.include?("?") ? "&#{args.to_param}" : "?#{args.to_param}") if args
|
||||
args.each do |index,arg|
|
||||
if index=="tag_id" || index=="category_id"
|
||||
ret << (ret.include?("?") ? "&#{index}[]=#{arg}": "?#{index}[]=#{arg}" )
|
||||
else
|
||||
ret << (ret.include?("?") ? "&#{index}=#{arg}": "?#{index}=#{arg}" )
|
||||
end
|
||||
end if args
|
||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
|
||||
end
|
||||
front.swap(fragment)
|
||||
|
||||
+19
-20
@@ -9,30 +9,19 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def search_result
|
||||
if params[:search_query] == ""
|
||||
@bulletins = get_bulletins_for_index
|
||||
|
||||
else
|
||||
@search = Bulletin.solr_search do
|
||||
fulltext params[:search_query]
|
||||
with(:frontend_search,true)
|
||||
with(:available_lang).any_of([I18n.locale.to_s])
|
||||
end
|
||||
# @bulletins = Bulletin.where(:category_id.in => params[:category_id]).and(:is_rejected=>false).and(:is_pending=>false)
|
||||
|
||||
search_result = @search.results.collect{|result| result.id}
|
||||
|
||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
|
||||
end
|
||||
end
|
||||
|
||||
def index
|
||||
@bulletins = get_bulletins_for_index
|
||||
end
|
||||
|
||||
def get_bulletins_for_index
|
||||
|
||||
@item = Page.find(params[:page_id]) rescue nil
|
||||
|
||||
@item = Page.find(params[:page_id]) rescue nil
|
||||
if @item
|
||||
if @item.frontend_data_count
|
||||
@page_num = @item.frontend_data_count
|
||||
@@ -41,23 +30,33 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
end
|
||||
@frontend_style = @item.frontend_style
|
||||
end
|
||||
|
||||
@item = Page.find(params[:page_id]) rescue nil
|
||||
if !params[:search_query].blank?
|
||||
@search = Bulletin.solr_search do
|
||||
fulltext params[:search_query]
|
||||
with(:frontend_search,true)
|
||||
with(:available_lang).any_of([I18n.locale.to_s])
|
||||
end
|
||||
search_result = @search.results.collect{|result| result.id}
|
||||
|
||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
|
||||
else
|
||||
date_now = Time.now
|
||||
if !params[:category_id].blank? && !params[:tag_id].blank?
|
||||
@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])
|
||||
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id => params[:category_id], :tagged_ids => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
|
||||
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)
|
||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
|
||||
elsif !params[:tag_id].blank?
|
||||
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(: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(:tagged_ids => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||
else
|
||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||
end
|
||||
# delayed_impressionist(@tag) if @tag
|
||||
@bulletins
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@item = Page.find(params[:page_id]) rescue nil
|
||||
|
||||
+3
-3
@@ -39,7 +39,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||
@bulletins = Bulletin.available_for_lang(I18n.locale).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(@page_num)
|
||||
end
|
||||
|
||||
@categories = @module_app.categories.enabled
|
||||
@categories = get_categories_for_index
|
||||
|
||||
end
|
||||
|
||||
@@ -62,7 +62,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||
@bulletins = Bulletin.available_for_lang(I18n.locale).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(@page_num )
|
||||
end
|
||||
|
||||
@categories = @module_app.categories.enabled
|
||||
@categories = get_categories_for_index
|
||||
|
||||
end
|
||||
|
||||
@@ -139,7 +139,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||
|
||||
def bulletins_side_bar
|
||||
@tags_and_class = @module_app.sorted_tags_for_cloud
|
||||
@categories = @module_app.categories.enabled
|
||||
@categories = get_categories_for_index
|
||||
end
|
||||
|
||||
def bulletins_search_block
|
||||
|
||||
vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
Vendored
+1
@@ -1,6 +1,7 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<h1 class="h1"><%= @page.title rescue nil %></h1>
|
||||
|
||||
<table class="table table-bordered">
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<h1 class="h1"><%= @page.title rescue nil %></h1>
|
||||
|
||||
<table class="table table-bordered">
|
||||
@@ -22,7 +23,7 @@
|
||||
<% @bulletins.each do |post| %>
|
||||
<tr>
|
||||
<td><%= post.bulletin_category.title rescue nil %></td>
|
||||
<td><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.category_id) %>
|
||||
<td><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
||||
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
||||
</td>
|
||||
<td><%= display_date_time(post.postdate) %></td>
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
<%= stylesheet_link_tag "default_widget" %>
|
||||
<script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.js'></script>
|
||||
<!-- <script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.degsin.js'></script> -->
|
||||
<script type='text/javascript' src='/assets/jquery.mu.image.resize.js'></script>
|
||||
<script type='text/javascript' src='/assets/jquery.mu.image.resize.degsin.js'></script>
|
||||
|
||||
<div id="bulletin_widget">
|
||||
<%= render 'index' %>
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ module Announcement
|
||||
image :image
|
||||
field :postdate
|
||||
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
|
||||
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:category,:id]}}
|
||||
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:bulletin_category,:id]}}
|
||||
field :subtitle
|
||||
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
||||
end
|
||||
|
||||
+2
-2
@@ -37,14 +37,14 @@ class Panel::Faq::FrontEnd::QasController < OrbitWidgetController
|
||||
|
||||
def show
|
||||
@qa = Qa.find(params[:id])
|
||||
# get_categorys
|
||||
get_categorys
|
||||
end
|
||||
|
||||
|
||||
protected
|
||||
|
||||
def get_categorys
|
||||
# @qa_categorys = QaCategory.excludes('disable' => true)
|
||||
@qa_categorys = QaCategory.excludes('disable' => true)
|
||||
end
|
||||
|
||||
end
|
||||
+1
-1
@@ -22,7 +22,7 @@ class Qa
|
||||
accepts_nested_attributes_for :qa_files, :allow_destroy => true
|
||||
accepts_nested_attributes_for :qa_links, :allow_destroy => true
|
||||
|
||||
# belongs_to :qa_category
|
||||
belongs_to :qa_category
|
||||
|
||||
before_save :clean_values
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<h1 class="h1"><%= @qa.title %></h1>
|
||||
<div class="info">
|
||||
<div class="info1">
|
||||
<span><%= t(:category) %>:<%= @qa.category.title rescue nil %></span>
|
||||
<span><%= t(:category) %>:<%= @qa.qa_category.title rescue nil %></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="news_paragraph">
|
||||
|
||||
Vendored
+8
-7
@@ -16,7 +16,7 @@ module Faq
|
||||
end
|
||||
end
|
||||
|
||||
# category ["QaCategory"]
|
||||
category ["QaCategory"]
|
||||
data_count 1..20
|
||||
|
||||
taggable
|
||||
@@ -25,9 +25,9 @@ module Faq
|
||||
|
||||
widgets do
|
||||
default_widget do
|
||||
query 'Qa'
|
||||
enable ['typeA']
|
||||
link_field :qa_category_with_title,{:method => 'panel_faq_front_end_qas_path',:args=>{:category_id => [:category,:id]}}
|
||||
query 'Qa.all'
|
||||
# enable ['typeA']
|
||||
link_field :qa_category_with_title,{:method => 'panel_faq_front_end_qas_path',:args=>{:category_id => [:qa_category,:id]}}
|
||||
link_field :title, {:method => 'panel_faq_front_end_qa_path',:args=>:self}
|
||||
link_to_more 'panel_faq_front_end_qas_path',:title_i18n=> 'faq.default_widget.to_more'
|
||||
end
|
||||
@@ -45,7 +45,7 @@ module Faq
|
||||
side_bar do
|
||||
head_label_i18n 'faq.faq',:icon_class=>"icons-help"
|
||||
available_for [:admin,:guest,:manager,:sub_manager]
|
||||
active_for_controllers ({:private=>['qas', 'qa_categorys','module_tags', 'categories']})
|
||||
active_for_controllers ({:private=>['qas', 'qa_categorys']})
|
||||
active_for_object_auth ['QaCategory']
|
||||
|
||||
head_link_path "panel_faq_back_end_qas_path"
|
||||
@@ -65,10 +65,11 @@ module Faq
|
||||
context_link 'categories',
|
||||
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
|
||||
:priority=>3,
|
||||
:active_for_category => 'Faq',
|
||||
:active_for_category => 'Qa',
|
||||
:available_for => [:manager]
|
||||
|
||||
context_link 'tags',
|
||||
:link_path=>"admin_module_tags_path(module_app_id: get_module_app)" ,
|
||||
:link_path=>"admin_module_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Faq'}))" ,
|
||||
:priority=>4,
|
||||
:active_for_tag => 'Faq',
|
||||
:available_for => [:manager]
|
||||
|
||||
+67
-2
@@ -32,8 +32,73 @@ var galleryAPI = function(){
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$(document).ready(function(){
|
||||
//bindHandlers();
|
||||
})
|
||||
var bindHandlers = function(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.loadAlbums = function(id){
|
||||
g.albumArea.find(".rghead .rgfn a").click(function(){g.makeNewAlbum($(this).attr("href"))});
|
||||
g.albumArea.addClass('o_gallery');
|
||||
g.albumArea.find("#imgholder").empty();
|
||||
if(id!="all"){
|
||||
var cids = [];
|
||||
var tids = [];
|
||||
var href = null;
|
||||
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
||||
for(var i = 0; i < hashes.length; i++){
|
||||
hash = hashes[i].split('=');
|
||||
if(hash[0]=="cat"){
|
||||
cids.push(hash[1]);
|
||||
href = "cat="+hash[1];
|
||||
}else if(hash[0]=="tag"){
|
||||
tids.push(hash[1]);
|
||||
href = "tag="+hash[1];
|
||||
}
|
||||
$("#filter .filter_btns a[href='"+href+"']").addClass("active");
|
||||
}
|
||||
if(cids.length == 0)
|
||||
cids = "all";
|
||||
}else{
|
||||
var cids = "all";
|
||||
}
|
||||
$.getJSON("/panel/gallery/front_end/get_albums",{"cid":cids,"tid":tids,"inner":true},function(categories){
|
||||
$.each(categories,function(x,category){
|
||||
$.each(category,function(i,album){
|
||||
album.description = (album.description?album.description:"<%= I18n.t('gallery.no_description') %>")
|
||||
if(album.cover == "default")
|
||||
var $img = $("<div class='rgalbum'><a title='"+album.description+"' href='"+album.show_path+"'><img src='../../../assets/gallery/default.jpg'/></a><span class='albumname'><a title='"+album.description+"' href='?album="+album._id+"'>"+album.name+"</a></span><span class='categoryname'><i class='icon-folder-close'></i> "+album.category_name+"</span><span class='tagnames'></span></div>");
|
||||
else
|
||||
var $img = $("<div class='rgalbum'><a title='"+album.description+"' href='"+album.show_path+"'><img src='"+album.cover_path+"'/></a><span class='albumname'><a title='"+album.description+"' href='?album="+album._id+"'>"+album.name+"</a></span><span class='categoryname'><i class='icon-folder-close'></i> "+album.category_name+"</span><span class='tagnames'></span></div>");
|
||||
var tag_string = "";
|
||||
for(tag in album.tag_names){
|
||||
if(tag == album.tag_names.length-1)
|
||||
tag_string+= '<span class="tags">' + album.tag_names[tag] + '</span>';
|
||||
else
|
||||
tag_string+= '<span class="tags">' + album.tag_names[tag] + ', </span>';
|
||||
}
|
||||
$img.find(".tagnames").html(tag_string);
|
||||
g.albumArea.find("#imgholder").append($img);
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
this.loadImages = function(id){
|
||||
g.albumArea.addClass('o_album');
|
||||
g.albumArea.find("#imgholder").empty();
|
||||
$.getJSON("panel/gallery/front_end/albums/"+id+"/imgs",{inner:true},function(album){
|
||||
$.each(album.images,function(i,image){
|
||||
var thumb = image.file.thumb.url;
|
||||
image.description = (image.description?image.description:"<%= I18n.t('gallery.no_description') %>")
|
||||
var $img = $("<div class='rgphoto'><a title='"+image.description+"' href='"+image.theater_link+"'><img src='"+thumb+"'/></a></div>");
|
||||
g.albumArea.find("#imgholder").append($img);
|
||||
})
|
||||
})
|
||||
}
|
||||
this.loadTheater = function(id){
|
||||
var imageArray;
|
||||
var imagecount = 0;
|
||||
@@ -213,7 +278,7 @@ var galleryAPI = function(){
|
||||
}
|
||||
|
||||
var preparestage = function(albumid){
|
||||
$.getJSON("/panel/gallery/front_end/albums/"+albumid+"/imgs",{"inner":true},function(album){
|
||||
$.getJSON("panel/gallery/front_end/albums/"+albumid+"/imgs",{"inner":true},function(album){
|
||||
imageArray = eval(album.images);
|
||||
$.each(album.images,function(i,image){
|
||||
if(image._id == id)
|
||||
|
||||
Vendored
+47
-2
@@ -1,11 +1,56 @@
|
||||
class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||
def index
|
||||
@albums = GalleryAlbum.where(:category_id.in => params[:category_id])
|
||||
end
|
||||
|
||||
def show
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@images = @album.gallery_images
|
||||
@tags = Tag.find(@album.tagged_ids).map{|t| t.name}
|
||||
end
|
||||
|
||||
def get_albums
|
||||
@categoryids = params["cid"]
|
||||
@tags = params["tid"]
|
||||
@albums = Array.new
|
||||
if @categoryids == "all"
|
||||
if @tags
|
||||
if @tags.kind_of?(Array)
|
||||
@tags.each do |tag|
|
||||
@albums << GalleryAlbum.where(tagged_ids: tag)
|
||||
end
|
||||
else
|
||||
@albums << GalleryAlbum.where(tagged_ids: @tags)
|
||||
end
|
||||
else
|
||||
@albums << GalleryAlbum.all
|
||||
end
|
||||
else
|
||||
@categoryids.each do |id|
|
||||
category = Category.find(id)
|
||||
if @tags
|
||||
if @tags.kind_of?(Array)
|
||||
@tags.each do |tag|
|
||||
@albums << category.gallery_albums.where(tagged_ids: tag)
|
||||
end
|
||||
else
|
||||
@albums << category.gallery_albums.where(tagged_ids: @tags)
|
||||
end
|
||||
else
|
||||
@albums << category.gallery_albums.all
|
||||
end
|
||||
end
|
||||
end
|
||||
@output = Array.new
|
||||
@albums.each do |album|
|
||||
@albs = Array.new
|
||||
album.each do |values|
|
||||
tags = Tag.find(values.tagged_ids).map{|t| t.name}
|
||||
category = Category.find(values.category_id).title
|
||||
|
||||
@albs << {"_id"=>values.id,"show_path"=>panel_gallery_front_end_album_path(values),"cover"=>values.cover,"cover_path"=>values.cover_path,"description"=>values.description,"category_name"=>category,"gallery_category_id" => values.category_id,"name"=>values.name,"tag_ids"=>values.tag_ids,"tag_names"=>tags}
|
||||
end
|
||||
@output << @albs
|
||||
end
|
||||
render :json=>@output.to_json
|
||||
end
|
||||
|
||||
def imgs
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
<div class='rgalbum'>
|
||||
<a title='<%= album.name %>' href='<%= panel_gallery_front_end_album_path(album) %>'>
|
||||
<% if album.cover == "default" %>
|
||||
<%= image_tag "gallery/default.jpg" %>
|
||||
<% else %>
|
||||
<img src="<%= album.cover_path %>">
|
||||
<% end %>
|
||||
</a>
|
||||
<span class='albumname'>
|
||||
<a title='<%= album.description %>' href='<%= panel_gallery_front_end_album_path(album) %>'><%= album.name %></a>
|
||||
</span>
|
||||
<span class='categoryname'><i class='icon-folder-close'></i><%= Category.find(album.category_id).title %></span>
|
||||
<span class='tagnames'></span>
|
||||
</div>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<div class='rgphoto'>
|
||||
<a title='<%= image.description %>' href='<%= theater_panel_gallery_front_end_album_path(image) %>'>
|
||||
<img src='<%= image.file.thumb.url %>'/>
|
||||
</a>
|
||||
</div>
|
||||
+32
-4
@@ -1,14 +1,42 @@
|
||||
|
||||
|
||||
<%= stylesheet_link_tag "gallery_frontend" %>
|
||||
|
||||
<%#= stylesheet_link_tag "gallery" %>
|
||||
<div id="orbit_gallery" class="rg">
|
||||
|
||||
<div class="rgbody">
|
||||
<div id="imgholder">
|
||||
<% @albums.each do |album| %>
|
||||
<%= render :partial => "album", :object => album %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rghead">
|
||||
<div class="rgfn">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "galleryAPI_frontend" %>
|
||||
<%#= javascript_include_tag "jquery.tinyscrollbar" %>
|
||||
<%= javascript_include_tag "rss" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
||||
var gallery = new galleryAPI();
|
||||
gallery.initialize();
|
||||
if(typeof gallery.urlVars['cat']!= "undefined"){
|
||||
gallery.loadArea = "albums";
|
||||
gallery.loadAlbums(gallery.urlVars['cat']);
|
||||
}else if(typeof gallery.urlVars['tag']!= "undefined"){
|
||||
gallery.loadArea = "albums";
|
||||
gallery.loadAlbums(gallery.urlVars['tag']);
|
||||
}else{
|
||||
gallery.loadArea = "albums";
|
||||
gallery.loadAlbums("all");
|
||||
}
|
||||
</script>
|
||||
|
||||
+36
-3
@@ -1,12 +1,45 @@
|
||||
|
||||
<%= stylesheet_link_tag "gallery_frontend" %>
|
||||
|
||||
<div id="orbit_gallery" class="rg">
|
||||
<div class="rgbody">
|
||||
<div id="imgholder">
|
||||
<% @images.each do |image| %>
|
||||
<%= render :partial => "image", :object => image %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- tag part -->
|
||||
<!-- add "album_tags" or "photo_tags" class to .taglist -->
|
||||
<div class="taglist">
|
||||
<h3 class="taglist_title"><%= t('gallery.album_tag') %></h3>
|
||||
<ul>
|
||||
<% @tags.each do |tag|%>
|
||||
<li><%= tag %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- tag end -->
|
||||
<div class="form-actions form-fixed pagination-right rghead">
|
||||
<div class="rgfn">
|
||||
<a class="bt-back rgbt" title="<%= I18n.t("gallery.back_to_albums") %>" href="<%= panel_gallery_front_end_albums_path %>"><i class="icon-arrow-left"></i> <%= I18n.t("gallery.back_to_albums") %></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "galleryAPI_frontend" %>
|
||||
<%#= javascript_include_tag "jquery.tinyscrollbar" %>
|
||||
<%= javascript_include_tag "rss" %>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
||||
var gallery = new galleryAPI();
|
||||
gallery.initialize();
|
||||
gallery.loadArea = "images";
|
||||
gallery.loadImages("<%= params[:id] %>");
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ module Gallery
|
||||
|
||||
customize_widget "widget1" do
|
||||
widget_i18n "gallery.widget.widget1"
|
||||
style ["1","2"]
|
||||
style []
|
||||
options "vertical",:i18n => "gallery.widget_option.vertical",:options_item=>[1, 2]
|
||||
options "horizontal",:i18n => "gallery.widget_option.horizontal",:options_item=>[1, 2,3,4,5,6]
|
||||
options "album_id",:i18n =>"gallery.album",:options_item => {"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}
|
||||
|
||||
-1
@@ -50,7 +50,6 @@ module Videos
|
||||
#* customize_widget_options_fields_i18n({"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.album"}} )
|
||||
customize_widget "channel_videos" do
|
||||
widget_i18n "videos.widget.channel_videos"
|
||||
style ["1","2"]
|
||||
options "channel_videos",:i18n =>"videos.channel_videos",:options_item => {"query"=>"ChannelVideo.all", "value"=>:id, "label"=>:channel_name}
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user