Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e55fb632e4 |
No files matched your search
|
Before Width: | Height: | Size: 301 KiB After Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 348 KiB After Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -39,8 +39,10 @@ if($.support.touch) {
|
||||
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" />');
|
||||
} else {
|
||||
console.log('false')
|
||||
$(this).wrap('<div class="togglebox" />');
|
||||
}
|
||||
$('<label><b></b></label>').insertAfter($(this));
|
||||
@@ -71,6 +73,7 @@ if($.support.touch) {
|
||||
$(this).parent('.togglebox').removeClass('disable').closest('li').removeClass('disabled');
|
||||
};
|
||||
} else {
|
||||
console.log($(this))
|
||||
if($(this).prop('checked')) {
|
||||
$(this).parent('.togglebox').addClass('disable').closest('li').addClass('disabled');
|
||||
};
|
||||
@@ -540,6 +543,7 @@ function changeStatusHidden() {
|
||||
|
||||
// Document Ready
|
||||
$(function() {
|
||||
console.log('true')
|
||||
showFiltersOnPageRefresh();
|
||||
|
||||
new ini();
|
||||
|
||||
@@ -111,30 +111,30 @@ function customOpenSlide() {
|
||||
.closest('.navbar-inner')
|
||||
.addClass('active');
|
||||
pageslide.find('.content').css('padding', 0);
|
||||
// iFrameContent()
|
||||
iFrameContent()
|
||||
}
|
||||
});
|
||||
}
|
||||
// function iFrameContent() {
|
||||
// function iFrameFunction(iContents, pc) {
|
||||
// pc.each(function(index, el) {
|
||||
// if($(this).siblings('*').length == 0) {
|
||||
// var _parentH = $(this).parent('*').outerHeight();
|
||||
// $(this).css('min-height', _parentH);
|
||||
// }
|
||||
// });
|
||||
// iContents.find('#orbit-bar').hide();
|
||||
// iContents.find('.main_wrap').css('margin-top', 0);
|
||||
// iContents.find('a').not('.edit_link a').on('click', function(event) {
|
||||
// event.preventDefault();
|
||||
// }).css('cursor', 'default');
|
||||
// }
|
||||
// $('#pageslide_iframe').load(function() {
|
||||
// var $iContents = $(this).contents(),
|
||||
// $pc = $iContents.find('.page_content');
|
||||
// iFrameFunction($iContents, $pc);
|
||||
// });
|
||||
// }
|
||||
function iFrameContent() {
|
||||
function iFrameFunction(iContents, pc) {
|
||||
pc.each(function(index, el) {
|
||||
if($(this).siblings('*').length == 0) {
|
||||
var _parentH = $(this).parent('*').outerHeight();
|
||||
$(this).css('height', _parentH);
|
||||
}
|
||||
});
|
||||
iContents.find('#orbit-bar').hide();
|
||||
iContents.find('.main_wrap').css('margin-top', 0);
|
||||
iContents.find('a').not('.edit_link a').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
}).css('cursor', 'default');
|
||||
}
|
||||
$('#pageslide_iframe').load(function() {
|
||||
var $iContents = $(this).contents(),
|
||||
$pc = $iContents.find('.page_content');
|
||||
iFrameFunction($iContents, $pc);
|
||||
});
|
||||
}
|
||||
|
||||
function pageSetting(id, edit, ps) {
|
||||
$pageModule = $('#pageslide #page_module_app_id');
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
$(function() {
|
||||
// for toggle-check
|
||||
$('.role_filter_checked').on({
|
||||
change: function() {
|
||||
var _path = $(this).data('path');
|
||||
// var path = <%= @path %>
|
||||
$.ajax({
|
||||
url: _path,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {remote: true},
|
||||
})
|
||||
.done(function() {})
|
||||
.fail(function() {})
|
||||
.always(function() {});
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -3,5 +3,4 @@
|
||||
//= require lib/all-list
|
||||
//= require lib/jquery.fastLiveFilter.js
|
||||
//= require lib/checkbox.card.js
|
||||
//= require lib/jquery.form.js
|
||||
//= require lib/member/member-role.js
|
||||
//= require lib/jquery.form.js
|
||||
@@ -4,7 +4,7 @@
|
||||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
||||
// the compiled file.
|
||||
//
|
||||
//= require mobile/jquery-1.7.1
|
||||
//= require jquery
|
||||
//= require lib/jquery.preload.min.js
|
||||
//= require cycle2
|
||||
//= require mobile/jquery.mu.image.resize
|
||||
|
||||
@@ -24,10 +24,10 @@ $('#index').live('pageinit',function(){
|
||||
});
|
||||
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
||||
$(this).find(".newpic img").muImageResize({width: 280, height: 200});
|
||||
// $('.slideshow').cycle({
|
||||
// fx: $effect,
|
||||
// timeout: $timeout
|
||||
// });
|
||||
$('.slideshow').cycle({
|
||||
fx: $effect,
|
||||
timeout: $timeout
|
||||
});
|
||||
$(".newlist").css({
|
||||
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
||||
})
|
||||
@@ -113,10 +113,10 @@ $(window).bind("orientationchange", function(){
|
||||
});
|
||||
|
||||
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
||||
// $('.slideshow').cycle({
|
||||
// fx: $effect,
|
||||
// timeout: $timeout
|
||||
// });
|
||||
$('.slideshow').cycle({
|
||||
fx: $effect,
|
||||
timeout: $timeout
|
||||
});
|
||||
|
||||
$(".newlist").css({
|
||||
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
||||
|
||||
@@ -171,20 +171,12 @@ div[data-role="page"] {
|
||||
float: left;
|
||||
width: 280px;
|
||||
min-height: 490px;
|
||||
/*max-height: 490px;*/
|
||||
max-height: 490px;
|
||||
background-color: #FFFFFF;
|
||||
padding: 10px;
|
||||
margin: 0 10px 10px 0;
|
||||
box-shadow: 0px 3px 5px rgba(0,0,0,.1);
|
||||
}
|
||||
.content .orbit-cycle-slideshow {
|
||||
height: 300px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.content .orbit-cycle-slideshow img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
#index .content .newpic {
|
||||
width: 280px;
|
||||
height: 200px;
|
||||
@@ -326,22 +318,13 @@ 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;
|
||||
}
|
||||
@@ -350,9 +333,6 @@ div[id^="dialog"] .content {
|
||||
}
|
||||
}
|
||||
@media(min-width:768px) {
|
||||
.content .orbit-cycle-slideshow {
|
||||
height: 250px;
|
||||
}
|
||||
.main-menu ul {
|
||||
width: 480px;
|
||||
}
|
||||
@@ -364,9 +344,6 @@ div[id^="dialog"] .content {
|
||||
}
|
||||
}
|
||||
@media(min-width:800px) {
|
||||
.content .orbit-cycle-slideshow {
|
||||
height: 330px;
|
||||
}
|
||||
.main-menu ul {
|
||||
width: 480px;
|
||||
}
|
||||
@@ -375,9 +352,6 @@ div[id^="dialog"] .content {
|
||||
}
|
||||
}
|
||||
@media(min-width:961px) {
|
||||
.content .orbit-cycle-slideshow {
|
||||
height: 380px;
|
||||
}
|
||||
.main-menu ul {
|
||||
width: 480px;
|
||||
}
|
||||
|
||||
@@ -40,18 +40,8 @@ class Admin::ItemsController < OrbitBackendController
|
||||
m["main"] = [module_app.label, module_app.id.to_s]
|
||||
m["sub"] = module_app.app_pages.map{|name, data| [t(data["i18n"]), name]} rescue []
|
||||
m["sub"] << [I18n.t('default_widget.default_widget'),'default_widget'] if module_app.has_default_widget?
|
||||
|
||||
if module_app.key == 'member'
|
||||
m["category"] = RoleStatus.where(:role_id=> RoleStatus.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.where(:role_id=> RoleCategory.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
elsif module_app.key == 'member_staff'
|
||||
m["category"] = RoleStatus.where(:role_id=> RoleStatus.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.where(:role_id=> RoleCategory.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
else
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
end
|
||||
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
m["count"] = module_app.get_registration.get_data_count.to_a
|
||||
module_apps << m
|
||||
end
|
||||
|
||||
@@ -63,19 +63,8 @@ class Admin::PagePartsController < OrbitBackendController
|
||||
m = {}
|
||||
m["main"] = [module_app.label, module_app.id.to_s]
|
||||
m["sub"] = module_app.widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
|
||||
|
||||
|
||||
if module_app.key == 'member'
|
||||
m["category"] = RoleStatus.can_display.where(:role_id=> RoleStatus.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.can_display.where(:role_id=> RoleCategory.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
elsif module_app.key == 'member_staff'
|
||||
m["category"] = RoleStatus.can_display.where(:role_id=> RoleStatus.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.can_display.where(:role_id=> RoleCategory.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
else
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
end
|
||||
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
m["count"] = module_app.get_registration.get_data_count.to_a
|
||||
module_apps << m
|
||||
end
|
||||
|
||||
@@ -23,13 +23,6 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
def check_mobile_api_openness
|
||||
if !Site.first.mobile_api_openness_on
|
||||
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def site_restart
|
||||
Resque.enqueue(RestartServer)
|
||||
end
|
||||
@@ -245,7 +238,7 @@ class ApplicationController < ActionController::Base
|
||||
redirect_to ret
|
||||
end
|
||||
|
||||
def get_sorted_and_filtered(object_class, query = nil, objects = nil, pagination = true)
|
||||
def get_sorted_and_filtered(object_class, query = nil, objects = nil)
|
||||
if params[:filter] || params[:sort] || params[:new_filter]
|
||||
@filter = params[:filter]
|
||||
new_filter = params[:new_filter]
|
||||
@@ -353,11 +346,7 @@ class ApplicationController < ActionController::Base
|
||||
objects = get_bulletins_for_open_backend(objects)
|
||||
end
|
||||
|
||||
if pagination
|
||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||
else
|
||||
filter_authorized_objects(objects)
|
||||
end
|
||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
def get_bulletins_for_open_backend(objects)
|
||||
|
||||
@@ -40,7 +40,6 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
|
||||
def default_widget
|
||||
@search = params["search_query"].blank? ? false : true
|
||||
|
||||
if !params[:id].blank? and !params["clicked_field_name"].blank?
|
||||
clicked_field_name = params["clicked_field_name"].to_sym
|
||||
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
||||
@@ -70,10 +69,7 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
||||
end
|
||||
|
||||
if params[:filter_category_id] and !params[:filter_category_id].blank?
|
||||
@data = get_filter_data.page(params[:page_main]).per(@data_limit)
|
||||
|
||||
elsif @paginate || @search
|
||||
if @paginate || @search
|
||||
if @search
|
||||
@data = search_result.page(params[:page_main]).per(@data_limit) rescue []
|
||||
else #regular listing
|
||||
@@ -97,18 +93,6 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def get_filter_data
|
||||
model = @default_widget["query"].classify.constantize
|
||||
if params[:filter_category_id].is_a? Array
|
||||
data = model.where(:category_id.in => params[:filter_category_id])
|
||||
elsif params[:filter_category_id].is_a? String
|
||||
data = model.where(:category_id => params[:filter_category_id])
|
||||
end
|
||||
data.available_for_lang(I18n.locale).can_display.desc(:is_top, :postdate)
|
||||
end
|
||||
|
||||
|
||||
|
||||
def get_category_field_name
|
||||
@ori_class_name = @ori_class_name.constantize
|
||||
|
||||
@@ -7,7 +7,7 @@ class MobileController < ApplicationController
|
||||
def index
|
||||
date_now = Time.now
|
||||
@bulletins = Bulletin.all.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_main]).per(15)
|
||||
@ad_banner = AdBanner.find(:all, :conditions => {:title => /Home/i})[0]
|
||||
@ad_banner = AdBanner.where(title: "Banner")[0]
|
||||
end
|
||||
|
||||
def announcement
|
||||
|
||||
@@ -2,7 +2,6 @@ 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
|
||||
@@ -65,25 +64,23 @@ class PagesController < ApplicationController
|
||||
url = "/#{@item.path}"
|
||||
options = ''
|
||||
options << "#{options.blank? ? '?' : '&'}page_main=#{params[:page_main]}" unless params[:page_main].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}click=#{params[:click]}" unless params[:click].blank?
|
||||
# options << "#{options.blank? ? '?' : '&'}part_id=#{params[:page_part_id]}" unless params[:page_part_id].blank?
|
||||
|
||||
if params[:category_id].is_a? Array
|
||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('filter_category_id',params[:category_id])}" unless params[:category_id].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('category_id',params[:category_id])}" unless params[:category_id].blank?
|
||||
elsif params[:category_id].is_a? String
|
||||
options << "#{options.blank? ? '?' : '&'}filter_category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
||||
end
|
||||
|
||||
if params[:tag_id].is_a? Array
|
||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('filter_tag_id',params[:tag_id])}" unless params[:tag_id].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id',params[:tag_id])}" unless params[:tag_id].blank?
|
||||
elsif params[:category_id].is_a? String
|
||||
options << "#{options.blank? ? '?' : '&'}filter_tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
||||
end
|
||||
|
||||
|
||||
options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank?
|
||||
# uri = URI::escape(url + options)
|
||||
uri = url + options
|
||||
uri = URI::escape(url + options)
|
||||
#uri = URI::escape("#{url}?" + params.collect{|k,v| "#{k}=#{v}"}.join('&'))
|
||||
redirect_to(uri)unless save_from_no_lang_for_page
|
||||
end
|
||||
@@ -97,7 +94,6 @@ class PagesController < ApplicationController
|
||||
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}clicked_field_name=#{params[:clicked_field_name]}" unless params[:clicked_field_name].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}image_id=#{params[:image_id]}" unless params[:image_id].blank?
|
||||
redirect_to(url + options) unless save_from_no_lang_for_page
|
||||
end
|
||||
|
||||
@@ -109,95 +105,26 @@ class PagesController < ApplicationController
|
||||
protected
|
||||
|
||||
def get_item
|
||||
# if params[:page_id]
|
||||
# @item = Item.find(params[:page_id])
|
||||
# elsif params[:same_page_id]
|
||||
# @item = Item.find(params[:same_page_id])
|
||||
# else
|
||||
# category_ids = Array(params[:category_id]) unless params[:category_id].nil?
|
||||
# tag_ids = Array(params[:tag_id]) unless params[:tag_id].nil?
|
||||
# module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
|
||||
# default_query = { is_published: true, module_app_id: module_app.id, :app_frontend_url.in => [params[:app_action], 'default_widget'] }
|
||||
# specific_categories = { :category => category_ids }
|
||||
# in_categories = { :category.in => category_ids }
|
||||
# nil_categories = { :category.in => [nil, []] }
|
||||
# specific_tags = { :tag => tag_ids }
|
||||
# in_tags = { :tag.in => tag_ids }
|
||||
# nil_tags = { :tag.in => [nil, []] }
|
||||
|
||||
# if !category_ids.blank? && !tag_ids.blank?
|
||||
# @item = Item.where(default_query.merge(specific_categories).merge(specific_tags)).first
|
||||
# @item = Item.where(default_query.merge(specific_categories).merge(in_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(specific_categories).merge(nil_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(specific_tags).merge(in_categories)).first unless @item
|
||||
# @item = Item.where(default_query.merge(specific_tags).merge(nil_categories)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_categories).merge(in_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_categories).merge(nil_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_tags).merge(nil_categories)).first unless @item
|
||||
# elsif !category_ids.blank?
|
||||
# @item = Item.where(default_query.merge(specific_categories).merge(nil_tags)).first
|
||||
# @item = Item.where(default_query.merge(specific_categories)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_categories).merge(nil_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_categories)).first unless @item
|
||||
# elsif !tag_ids.blank?
|
||||
# @item = Item.where(default_query.merge(specific_tags).merge(nil_categories)).first
|
||||
# @item = Item.where(default_query.merge(specific_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_tags).merge(nil_categories)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_tags)).first unless @item
|
||||
# end
|
||||
# @item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
||||
# @item = Item.where(default_query.merge(nil_categories).merge(nil_tags)).first unless @item
|
||||
# @item = Item.where(default_query).first unless @item
|
||||
# end
|
||||
# raise PageError, 'Missing Frontend Page' if @item.nil?
|
||||
|
||||
# if params[:page_id]
|
||||
# @item = Item.find(params[:page_id])
|
||||
# elsif params[:same_page_id]
|
||||
# @item = Item.find(params[:same_page_id])
|
||||
# else
|
||||
# category_ids = params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]
|
||||
# tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
||||
# module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
# if !category_ids.blank? && !tag_ids.blank?
|
||||
# @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => tag_ids})
|
||||
# @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => [nil, []]}) unless @item
|
||||
# elsif !category_ids.blank?
|
||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :category.in => category_ids).any_in(tag: [nil, []]).first
|
||||
# elsif !tag_ids.blank?
|
||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :tag.in => tag_ids).any_in(category: [nil, []]).first
|
||||
# end
|
||||
# @item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil, []]},"category" => { "$in" => [nil, []]}).first unless @item
|
||||
# # @item = Item.root.children.where(:module_app_id => module_app.id).first
|
||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
|
||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
|
||||
# end
|
||||
# raise PageError,'Missing Frontend Page' if @item.nil?
|
||||
|
||||
if params[:page_id]
|
||||
@item = Item.find(params[:page_id])
|
||||
elsif params[:same_page_id]
|
||||
@item = Item.find(params[:same_page_id])
|
||||
else
|
||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
category_ids = params[:category_id] ? (params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]) : []
|
||||
category_ids = params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]
|
||||
tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
||||
|
||||
if !category_ids.blank?
|
||||
@item = Item.where(:category => category_ids).first
|
||||
else
|
||||
if params[:action] && params[:action] == "show_from_link"
|
||||
model = params[:app_action].classify.constantize rescue nil
|
||||
if !model.nil?
|
||||
item = model.find(params[:id])
|
||||
@item = Item.where(:category => [item.category_id.to_s]).first if !module_app.has_category.blank?
|
||||
end
|
||||
end
|
||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
if !category_ids.blank? && !tag_ids.blank?
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => tag_ids})
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => [nil, []]}) unless @item
|
||||
elsif !category_ids.blank?
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :category.in => category_ids).any_in(tag: [nil, []]).first
|
||||
elsif !tag_ids.blank?
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :tag.in => tag_ids).any_in(category: [nil, []]).first
|
||||
end
|
||||
|
||||
@item = Item.root.children.where(:module_app_id => module_app.id).first unless @item
|
||||
@item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil, []]},"category" => { "$in" => [nil, []]}).first unless @item
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
|
||||
end
|
||||
raise PageError,'Missing Frontend Page' if @item.nil?
|
||||
end
|
||||
@@ -217,8 +144,4 @@ 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
|
||||
@@ -14,7 +14,6 @@ class Site
|
||||
|
||||
field :frontend_open, :type => Boolean, :default => true
|
||||
field :backend_openness_on, :type => Boolean, :default => false
|
||||
field :mobile_api_openness_on, :type => Boolean, :default => false
|
||||
field :desktop_closed, :type => Boolean, :default => false
|
||||
field :sitemap_menu_in_header, :type => Boolean, :default => false
|
||||
field :enable_terms_of_use, :type => Boolean, :default => false
|
||||
|
||||
@@ -3,8 +3,6 @@ class RoleCategory < RoleFilter
|
||||
has_and_belongs_to_many :users
|
||||
belongs_to :role
|
||||
|
||||
scope :can_display,where(disable: false)
|
||||
|
||||
def self.get_role_data(role_key)
|
||||
|
||||
@role = Role.where(:key =>role_key).first
|
||||
|
||||
@@ -186,21 +186,20 @@ class User
|
||||
}.uniq!
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_field(role_type,field_key)
|
||||
def self.get_member_list_attribute_field_name(role_type,field_key)
|
||||
@attribute = ::Attribute.where(:key => role_type).first
|
||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first.title
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_value(user_id,field_id)
|
||||
# @attribute = ::Attribute.where(:key => role_type).first
|
||||
# @AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||
return ::AttributeValue.where(attribute_field_id: field_id, :user_id => user_id).first
|
||||
def self.get_member_list_attribute_value(user_id,role_type,field_key)
|
||||
@attribute = ::Attribute.where(:key => role_type).first
|
||||
@AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||
return ::AttributeValue.where(attribute_field_id: @AttributeField.id, :user_id => user_id).first
|
||||
end
|
||||
|
||||
def self.get_role_member_data_by_sort(role, field_key, role_status_id)
|
||||
def self.get_role_member_data_by_sort(role_status_id)
|
||||
a = Array.new
|
||||
attribute_field_data = get_member_list_attribute_field(role,field_key)
|
||||
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,attribute_field_data.id)['val'].to_i, t ] }
|
||||
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,"staff","job_title")['val'].to_i, t ] }
|
||||
member_data = a.sort
|
||||
member_data_tmp = member_data.collect {|v| v[1] }
|
||||
end
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<td class="action span3">
|
||||
<div class="toggle-control" style="float: right;">
|
||||
<div class="togglebox <%= attribute.disabled ? 'disabled' : '' %>">
|
||||
<%= check_box_tag 'accept', attribute.disabled ? 'fasle' : 'true', false ,{ :class => 'toggle-check role_filter_checked', :data=>{:deploy=>"right"}, :data=>{:path=> eval("admin_#{@attribute_type}_toggle_path(attribute)")}, :checked=> attribute.disabled} %>
|
||||
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@attribute_type}_toggle_path(attribute)"), method: :post, remote: true, class: "switch" %>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// $("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
|
||||
location.reload();
|
||||
$("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
|
||||
$.pageslide.close();
|
||||
openSlide();
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
<tr id="<%= dom_id role_filter %>" class="<%= role_filter.disable ? 'disable' : '' %>">
|
||||
<tr id="<%= dom_id role_filter %>" class="<% role_filter.disable ? 'disable' : '' %>">
|
||||
<td><span class="label label-info"><%= role_filter.key %></span></td>
|
||||
<% if @types.is_localized?(:title) %>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
@@ -18,7 +18,15 @@
|
||||
<td><%= role_filter.title %></td>
|
||||
<% end %>
|
||||
|
||||
<td class="action dsrgsdgsdg">
|
||||
<%= check_box_tag 'accept', role_filter.disable ? 'fasle' : 'true', false ,{ :class => 'toggle-check role_filter_checked', :data=>{:deploy=>"right"}, :data=>{:path=> eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)")}, :checked=> role_filter.disable} %>
|
||||
<td class="action">
|
||||
<%#= link_to role_filter.disable ? t(:disable) : t(:enable), polymorphic_path([:admin, role_filter]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"btn btn-mini btn-success", :type=>"button" %>
|
||||
|
||||
<div class="toggle-control" style="float: right;">
|
||||
<div class="togglebox <%= role_filter.disable ? 'disabled' : '' %>">
|
||||
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)"), method: :post, remote: true, class: "switch" %>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||
<% end %>
|
||||
@@ -10,6 +9,14 @@
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
|
||||
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), eval("new_admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_path(:role_id=>params[:role_id])"), class: "btn btn-primary open-slide" %>
|
||||
@@ -20,4 +27,4 @@
|
||||
<%= render 'index' %>
|
||||
</div>
|
||||
|
||||
<% @path = "/admin/#{@app_type == 'role_category' ? 'role_categorys' : @app_type }/" %>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// $("#role_filters_index").html("<%= j render 'index' %>")
|
||||
location.reload();
|
||||
$("#role_filters_index").html("<%= j render 'index' %>")
|
||||
$.pageslide.close();
|
||||
openSlide();
|
||||
@@ -2,6 +2,7 @@
|
||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||
@@ -9,6 +10,13 @@
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
|
||||
<li class="active"><%= @attribute.title %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary open-slide"%>
|
||||
|
||||
@@ -132,21 +132,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= I18n.t('site.mobile_version')%></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :mobile_on , :class=>"toggle-check", :data=> { disabled: true } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= I18n.t('site.mobile_api_openness_on') %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :mobile_api_openness_on , :class=>"toggle-check", :data=> { disabled: true } %>
|
||||
<span class="help-block">Make API available for Mobile Apps</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Language -->
|
||||
|
||||
@@ -1 +1 @@
|
||||
<%=render :partial=>"role",:collection=>Role.where(:disabled=>false).asc("_id")%>
|
||||
<%=render :partial=>"role",:collection=>Role.all.asc("_id")%>
|
||||
@@ -1,20 +1,12 @@
|
||||
<% if @menu_page %>
|
||||
<% if @menu_page && @menu_page.visible_children.size > 0 %>
|
||||
<div class='category_list'>
|
||||
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
|
||||
<ul class='list'>
|
||||
|
||||
<% @menu_page.visible_children.each do |child| %>
|
||||
<% if @menu_page.visible_children.nil?%>
|
||||
<p>Test</p>
|
||||
<li class="<%= @page_id.eql?(child.parent.id) ? 'active' : nil %>">
|
||||
<a href="<%= (child.parent.class.to_s.eql?('Page') ? '/' + child.parent.path : child.parent.url) %>"><%= child.parent.title %></a>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
|
||||
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -24,16 +24,8 @@
|
||||
<div class="wrap-inner">
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<% if !@role.blank? %>
|
||||
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
|
||||
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
|
||||
<% elsif !@attribute.blank? %>
|
||||
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
|
||||
<li class="active"><%= @attribute.title %></a></li>
|
||||
<% else %>
|
||||
<li><a href="<%= admin_users_new_interface_index_path %>">Member</a> <span class="divider">/</span></li>
|
||||
<li class="active">All</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= yield :right_nav %>
|
||||
</div>
|
||||
|
||||
@@ -41,6 +41,5 @@
|
||||
}
|
||||
</style>
|
||||
<% end %>
|
||||
<div id='last_update_date_wrap' style='display:none;'><div id='last_update_date'><%= @last_update_date %></div></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,9 @@
|
||||
<% end %>
|
||||
|
||||
<ul>
|
||||
<li>電話:<a href="tel:+886492563489">0492563489</a></li>
|
||||
<li>傳真:0492568302</li>
|
||||
<li>地址:南投縣草屯鎮中正路568號</li>
|
||||
<li>總機電話:<a href="tel:+886229393091">02-29393091</a></li>
|
||||
<li>傳真:02-29379611</li>
|
||||
<li>緊急重大事件通聯窗口:校內分機 66119、66110</li>
|
||||
<li>總值日室:<a href="tel:+88229387132">02-29387132</a></li>
|
||||
<li>駐警衛室:<a href="tel:+88229387129">02-29387129</a></li>
|
||||
</ul>
|
||||
@@ -5,6 +5,6 @@
|
||||
<div id='map_canvas'></div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
var $map_center = "23.979724,120.696806"
|
||||
var $map_center = "24.987449, 121.576117"
|
||||
var $map_zoom = 17
|
||||
</script>
|
||||
@@ -386,7 +386,6 @@ en:
|
||||
thumbnail: Thumbnail
|
||||
site:
|
||||
backend_openness_on: Backend Openness
|
||||
mobile_api_openness_on: Mobile API Openness
|
||||
default_image: Site default image
|
||||
description: Site description
|
||||
description_help: Description Guide
|
||||
@@ -400,7 +399,7 @@ en:
|
||||
keywords: Site keywords
|
||||
keywords_help: Keyword Guide
|
||||
language: Site language
|
||||
mobile_version: Enable Mobile Web
|
||||
mobile_version: Mobile version
|
||||
openness: Openness
|
||||
search: Site Search
|
||||
search_help: Please Enter the search argument for Google search.
|
||||
|
||||
@@ -389,7 +389,6 @@ zh_tw:
|
||||
frontend_closed: 前台關閉?
|
||||
frontend_open: 開啟前台
|
||||
backend_openness_on: 開啟開放式後台(訪客可遊覽)
|
||||
mobile_api_openness_on: 開啟手機API
|
||||
enable_personal_desktop: 開啟個人桌面
|
||||
default_image: 預設圖像
|
||||
description: 網站描述
|
||||
|
||||
@@ -8,13 +8,13 @@ defaults: &defaults
|
||||
|
||||
development:
|
||||
<<: *defaults
|
||||
database: orbit_site_new
|
||||
database: test_site
|
||||
|
||||
|
||||
|
||||
test:
|
||||
<<: *defaults
|
||||
database: orbit_site_new
|
||||
database: test_site
|
||||
|
||||
# set these environment variables on your prod server
|
||||
production:
|
||||
|
||||
@@ -3,18 +3,15 @@ production:
|
||||
hostname: localhost
|
||||
port: 8982
|
||||
log_level: WARNING
|
||||
solr_home: solr
|
||||
|
||||
development:
|
||||
solr:
|
||||
hostname: localhost
|
||||
port: 8982
|
||||
log_level: INFO
|
||||
solr_home: solr
|
||||
|
||||
test:
|
||||
solr:
|
||||
hostname: localhost
|
||||
port: 8981
|
||||
log_level: WARNING
|
||||
solr_home: solr
|
||||
@@ -12,9 +12,9 @@ module DefaultWidgetTagHelper
|
||||
if param.is_a?(Array) and !param.blank?
|
||||
params_str << param.collect{|t| "#{index}[]=#{t}"}.join("&")
|
||||
params.delete index
|
||||
params_str = params_str + "&"
|
||||
end
|
||||
end
|
||||
|
||||
params_str = params_str + (params_str.eql?("?") ? params.to_param : "&#{params.to_param}" )
|
||||
content_tag :div,:class=> 'more' do
|
||||
link_to I18n.t(@more_link[:label_i18n]),[eval("#{@more_link[:path_method]}"),params_str].join()
|
||||
|
||||
@@ -24,6 +24,7 @@ module ParserFrontEnd
|
||||
# tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
|
||||
# category = params[:category_id].blank? ? page[:category] : params[:category_id]
|
||||
body = Nokogiri::HTML(page.content)
|
||||
|
||||
if @edit
|
||||
body.css('.page_part').each do |page_part|
|
||||
part = PagePart.find(page_part['part_id']) rescue nil
|
||||
@@ -40,16 +41,13 @@ module ParserFrontEnd
|
||||
end
|
||||
|
||||
body.css('orbit_front').each do |front|
|
||||
|
||||
if front['value']
|
||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div id='#{front['id']}' class='#{front['class']}'>#{eval(front['value']).to_s}</div>")
|
||||
else
|
||||
ret = ''
|
||||
part = PagePart.find(front['part_id']) if front['part_id']
|
||||
ret << eval("\"#{front['path']}\"") rescue ''
|
||||
ar = args.to_param
|
||||
ar = URI.unescape(ar)
|
||||
ret << (ret.include?("?") ? "&#{ar}" : "?#{ar}") if args.present?
|
||||
ret << (ret.include?("?") ? "&#{args.to_param}" : "?#{args.to_param}") if args.present?
|
||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
|
||||
end
|
||||
front.swap(fragment)
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
namespace :gallery do
|
||||
task :migrate_albums => :environment do
|
||||
@albums = GalleryAlbum.all
|
||||
@albums.each do |album|
|
||||
newalbum = Album.new
|
||||
newalbum.name = album.name
|
||||
newalbum.description = album.description
|
||||
newalbum.cover = album.cover
|
||||
newalbum.cover_path = album.cover_path
|
||||
newalbum.tag_names = album.tag_names
|
||||
newalbum.category_id = album.category_id
|
||||
newalbum.save!
|
||||
@images = album.gallery_images
|
||||
@images.each do |image|
|
||||
img = newalbum.album_images.new
|
||||
img.title = image.title
|
||||
img.description = image.description
|
||||
img.file = image.file
|
||||
img.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -122,7 +122,7 @@ namespace :migrate do
|
||||
a.widgets = {}
|
||||
a.widgets[:widget1] = []
|
||||
a.widget_options_fields_i18n = {"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.album"}}
|
||||
a.widget_options = {"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"Album.all", "value"=>:id, "label"=>:name}}}
|
||||
a.widget_options = {"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}}
|
||||
a.save
|
||||
end
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace :new_ui do
|
||||
%w(ask ask_question ask_category),
|
||||
%w(asset asset),
|
||||
%w(faq qa),
|
||||
%w(gallery album gallery_category),
|
||||
%w(gallery gallery_album gallery_category),
|
||||
%w(location location),
|
||||
%w(personal_book writing_book),
|
||||
%w(personal_conference writing_conference),
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%if user_signed_in? && is_manager?%>
|
||||
<div class="modal-footer">
|
||||
<%= link_to t(:delete_), panel_calendar_new_back_end_event_path(@event),:class => "btn bt-del", :method => :delete, :remote => true %>
|
||||
<%= link_to t(:edit), edit_panel_calendar_new_back_end_event_path(@event),:class => "btn btn-primary",:id=>"edit_event_btn" ,:remote => true %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -48,7 +48,18 @@
|
||||
<div id="event_quick_view" class="modal" style="width: 300px; display:none; margin:0 0 0 0;"></div>
|
||||
<div id="event_create_space" class="modal" style="right: 8px; bottom: 50px; left: auto; top: auto; width: 400px; margin: 0;display:none;"></div>
|
||||
<div id="calendar-loading">Loading...</div>
|
||||
<div class="form-actions form-fixed">
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
</div>
|
||||
<%if is_manager?%>
|
||||
<div class="span4">
|
||||
<%= link_to "Add", new_panel_calendar_new_back_end_event_path, :class => "btn btn-primary pull-right", :id=>"create_event_btn", :ref=>"add-btn" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var calendar = new Calendar("#calendar");
|
||||
</script>
|
||||
<%end%>
|
||||
@@ -228,8 +228,8 @@ var galleryAPI = function(){
|
||||
next = imagecount + 1;
|
||||
prev = imagecount - 1;
|
||||
}
|
||||
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.theater.url});
|
||||
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.theater.url});
|
||||
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.url});
|
||||
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.url});
|
||||
};
|
||||
if(imageArray.length > 1)
|
||||
updateNavigation();
|
||||
|
||||
@@ -8,7 +8,7 @@ var galleryAPI = function(){
|
||||
g = this;
|
||||
this.urlVars = rcom.getUrlVars();
|
||||
this.albumArea = $("#orbit_gallery");
|
||||
this.loadArea = "theater";
|
||||
this.loadArea = null;
|
||||
this.tagList = $(".taglist ul");
|
||||
this.loading = $("#loading");
|
||||
// this.authenticated = false;
|
||||
@@ -19,7 +19,7 @@ var galleryAPI = function(){
|
||||
if(photo_id){
|
||||
var params = rcom.getUrlVars();
|
||||
var url = window.location.href.split("?")[0];
|
||||
params["image_id"] = photo_id;
|
||||
params["id"] = photo_id;
|
||||
for(i=0;i<params.length;i++){
|
||||
if(i == 0)
|
||||
url+="?"+params[i]+"="+params[params[i]];
|
||||
@@ -34,7 +34,7 @@ var galleryAPI = function(){
|
||||
|
||||
}
|
||||
|
||||
this.loadTheater = function(albumid,id){
|
||||
this.loadTheater = function(id){
|
||||
var imageArray;
|
||||
var imagecount = 0;
|
||||
// var picHeight = 0;
|
||||
@@ -163,6 +163,7 @@ var galleryAPI = function(){
|
||||
});
|
||||
}else{
|
||||
$img.attr({"src":dom.attr("data-content")}).css("height","auto").load(function(){
|
||||
console.log(dom.attr("data-content"));
|
||||
g.loadcomplete();
|
||||
$img.fadeIn(200);
|
||||
});;
|
||||
@@ -173,8 +174,9 @@ var galleryAPI = function(){
|
||||
$slidelist.stop().animate({'height':'0px'}, 300);
|
||||
$slidelist.find("ul").hide();
|
||||
if(rcom.getInternetExplorerVersion() == -1){
|
||||
|
||||
if(pageurl!=window.location){
|
||||
pageurl = window.location.pathname+"?id="+albumid+"&controller_action=theater&image_id="+pageurl;
|
||||
pageurl = window.location.pathname+"?id="+pageurl+"&controller_action=theater";
|
||||
window.history.pushState({path:pageurl},'',pageurl);
|
||||
}
|
||||
}else{
|
||||
@@ -203,8 +205,8 @@ var galleryAPI = function(){
|
||||
next = imagecount + 1;
|
||||
prev = imagecount - 1;
|
||||
}
|
||||
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.theater.url});
|
||||
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.theater.url});
|
||||
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.url});
|
||||
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.url});
|
||||
};
|
||||
if(imageArray.length > 1)
|
||||
updateNavigation();
|
||||
|
||||
@@ -6,32 +6,32 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
|
||||
|
||||
def show
|
||||
@tags = get_tags
|
||||
@image = AlbumImage.find(params[:id])
|
||||
@albumid = @image.album_id
|
||||
@album = Album.find(@albumid)
|
||||
@images = @album.album_images.all
|
||||
@image = GalleryImage.find(params[:id])
|
||||
@albumid = @image.gallery_album_id
|
||||
@album = GalleryAlbum.find(@albumid)
|
||||
@images = @album.gallery_images.all
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
images = params['images']
|
||||
images.each do |image|
|
||||
img = AlbumImage.find(image)
|
||||
img = GalleryImage.find(image)
|
||||
img.delete
|
||||
end
|
||||
if params['delete_cover'] == "true"
|
||||
album = Album.find(params['id'])
|
||||
album = GalleryAlbum.find(params['id'])
|
||||
album.update_attributes(:cover=>"default",:cover_path => nil)
|
||||
end
|
||||
render :json =>{"success"=>true}.to_json
|
||||
end
|
||||
|
||||
def update_image
|
||||
image = AlbumImage.find(params[:image_id])
|
||||
image.update_attributes(params[:album_image])
|
||||
image = GalleryImage.find(params[:image_id])
|
||||
image.update_attributes(params[:gallery_image])
|
||||
image.save
|
||||
@album = Album.find(image.album_id.to_s)
|
||||
@images = @album.album_images
|
||||
@album = GalleryAlbum.find(image.gallery_album_id.to_s)
|
||||
@images = @album.gallery_images
|
||||
@image_content = []
|
||||
@images.each do |image|
|
||||
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
||||
@@ -42,11 +42,11 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
|
||||
def delete_photos
|
||||
images = params['images']
|
||||
images.each do |image|
|
||||
img = AlbumImage.find(image)
|
||||
img = GalleryImage.find(image)
|
||||
img.delete
|
||||
end
|
||||
if params['delete_cover'] == "true"
|
||||
album = Album.find(params['album_id'])
|
||||
album = GalleryAlbum.find(params['album_id'])
|
||||
album.update_attributes(:cover=>"default",:cover_path => nil)
|
||||
end
|
||||
render :json =>{"success"=>true}.to_json
|
||||
@@ -57,13 +57,13 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
|
||||
tags = params[:tag_ids]
|
||||
i = nil
|
||||
images.each do |image|
|
||||
img = AlbumImage.find(image)
|
||||
img = GalleryImage.find(image)
|
||||
img.tagged_ids = tags
|
||||
img.save
|
||||
i = img
|
||||
end
|
||||
@album = Album.find(i.album_id.to_s)
|
||||
@images = @album.album_images
|
||||
@album = GalleryAlbum.find(i.gallery_album_id.to_s)
|
||||
@images = @album.gallery_images
|
||||
@image_content = []
|
||||
@images.each do |image|
|
||||
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
open_for_visitor :only => [:index, :show, :get_album_json, :get_imgs_json, :imgs]
|
||||
open_for_visitor :only => [:index, :show]
|
||||
open_for_manager :except => [:index,:show,:update]
|
||||
open_for_sub_manager :except => [:index, :show]
|
||||
|
||||
@@ -13,13 +13,12 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
@categories = get_categories_for_index
|
||||
@tags = get_tags
|
||||
category_ids = @categories.collect{|t| t.id}
|
||||
@albums = get_sorted_and_filtered("album", :category_id.in => category_ids)
|
||||
|
||||
@albums = get_sorted_and_filtered("gallery_album", :category_id.in => category_ids)
|
||||
end
|
||||
|
||||
def show
|
||||
@album = Album.find(params[:id])
|
||||
@images = @album.album_images
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@images = @album.gallery_images
|
||||
@image_content = []
|
||||
@images.each do |image|
|
||||
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
||||
@@ -34,12 +33,12 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
def new
|
||||
@categories = get_categories_for_index
|
||||
@tags = get_tags
|
||||
@album = Album.new
|
||||
@album = GalleryAlbum.new
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
album = Album.new(params[:album])
|
||||
album = GalleryAlbum.new(params[:gallery_album])
|
||||
album.save!
|
||||
redirect_to panel_gallery_back_end_albums_path
|
||||
end
|
||||
@@ -47,38 +46,38 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
|
||||
|
||||
def destroy
|
||||
album = Album.find(params[:id])
|
||||
album = GalleryAlbum.find(params[:id])
|
||||
album.destroy
|
||||
redirect_to panel_gallery_back_end_albums_path
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@album = Album.find(params[:id])
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@tags = get_tags
|
||||
end
|
||||
|
||||
def set_cover
|
||||
if params[:set_cover] == "true"
|
||||
album = Album.find(params[:album_id])
|
||||
image = AlbumImage.find(params[:image_id])
|
||||
album = GalleryAlbum.find(params[:album_id])
|
||||
image = GalleryImage.find(params[:image_id])
|
||||
album.update_attributes({:cover_path => image.file.thumb.url, :cover=>params[:image_id]})
|
||||
else
|
||||
album = Album.find(params[:album_id])
|
||||
album = GalleryAlbum.find(params[:album_id])
|
||||
album.update_attributes({:cover_path => nil, :cover=>"default"})
|
||||
end
|
||||
render :json =>{"success"=>true}.to_json
|
||||
end
|
||||
|
||||
def get_album_json
|
||||
albums = Album.all
|
||||
albums = GalleryAlbum.all
|
||||
output = Array.new
|
||||
|
||||
albums.each do |album|
|
||||
tag_names = Array.new
|
||||
|
||||
album.tag_ids.each do |tag|
|
||||
tag_names << get_tags.include?(tag)
|
||||
tag_names << GalleryTag.find(tag)[I18n.locale]
|
||||
end
|
||||
if album.cover_path
|
||||
cover_path = album.cover_path
|
||||
@@ -97,15 +96,15 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def get_imgs_json
|
||||
album = Album.find(params[:album_id])
|
||||
images = album.album_images.all
|
||||
album = GalleryAlbum.find(params[:album_id])
|
||||
images = album.gallery_images.all
|
||||
output = Array.new
|
||||
|
||||
images.each do |image|
|
||||
tags = Array.new
|
||||
|
||||
image.tag_ids.each do |tag|
|
||||
tags << get_tags.include?(tag)
|
||||
tags << GalleryTag.find(tag)[I18n.locale]
|
||||
end
|
||||
|
||||
output << {
|
||||
@@ -120,21 +119,21 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def imgs
|
||||
@album = Album.find(params[:album_id])
|
||||
@album = GalleryAlbum.find(params[:album_id])
|
||||
@tag_names = Array.new
|
||||
@images = @album.album_images.all
|
||||
@images = @album.gallery_images.all
|
||||
@output = Array.new
|
||||
@images.each do |values|
|
||||
tags = Array.new
|
||||
values.tag_ids.each do |tag|
|
||||
tags << get_tags.include?(tag)
|
||||
tags << GalleryTag.find(tag)[I18n.locale]
|
||||
end
|
||||
@output << { _id: values.id,
|
||||
theater_link: panel_gallery_back_end_album_image_path(values),
|
||||
description: values.description,
|
||||
title: values.title,
|
||||
file: values.file.as_json[:file],
|
||||
gallery_album_id: values.album_id,
|
||||
gallery_album_id: values.gallery_album_id,
|
||||
tag_ids: values.tag_ids,
|
||||
tag_names: tags}
|
||||
end
|
||||
@@ -144,11 +143,11 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
|
||||
|
||||
def upload_image
|
||||
@album = Album.find(params[:album_id])
|
||||
@album = GalleryAlbum.find(params[:album_id])
|
||||
@files = params['files']
|
||||
a = Array.new
|
||||
@files.each do |file|
|
||||
@image = @album.album_images.new
|
||||
@image = @album.gallery_images.new
|
||||
@image.file = file
|
||||
@image.save!
|
||||
a << {"thumbnail_url"=>@image.file.thumb.url,"url"=>panel_gallery_back_end_album_image_path(@image)}
|
||||
@@ -158,21 +157,21 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
|
||||
def new_images
|
||||
if params[:last_image_id] != ""
|
||||
@lastimage = AlbumImage.find(params[:last_image_id])
|
||||
@album = Album.find(params[:album_id])
|
||||
@newimages = @album.album_images.where(:created_at.gt => @lastimage.created_at)
|
||||
@lastimage = GalleryImage.find(params[:last_image_id])
|
||||
@album = GalleryAlbum.find(params[:album_id])
|
||||
@newimages = @album.gallery_images.where(:created_at.gt => @lastimage.created_at)
|
||||
else
|
||||
@album = Album.find(params[:album_id])
|
||||
@newimages = @album.album_images
|
||||
@album = GalleryAlbum.find(params[:album_id])
|
||||
@newimages = @album.gallery_images
|
||||
end
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
|
||||
def images_tags
|
||||
album = Album.find(params[:album_id])
|
||||
album = GalleryAlbum.find(params[:album_id])
|
||||
tags = Array.new
|
||||
images = album.album_images.all
|
||||
images = album.gallery_images.all
|
||||
images.each do |image|
|
||||
tags << {"id"=>image.id, "tags" => image.tag_ids}
|
||||
end
|
||||
@@ -180,10 +179,10 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def update
|
||||
@album = Album.find(params[:id])
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
tagsToDestroy = []
|
||||
tagsToAdd = []
|
||||
new_tags = params[:album][:tag_ids]
|
||||
new_tags = params[:gallery_album][:tag_ids]
|
||||
old_tags = @album.tagged_ids
|
||||
old_tags.each do |tag|
|
||||
if !new_tags.include?(tag)
|
||||
@@ -198,14 +197,14 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
end
|
||||
end
|
||||
update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||
@album.update_attributes(params[:album])
|
||||
@album.update_attributes(params[:gallery_album])
|
||||
redirect_to panel_gallery_back_end_album_path(@album)
|
||||
end
|
||||
|
||||
def update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||
# tagsToDestroy will contain all tag ids which have to be deleted from the galley_images
|
||||
# tagsToAdd will contain all tag ids which ve to be added in tall album_images
|
||||
@images = AlbumImage.all
|
||||
# tagsToAdd will contain all tag ids which ve to be added in tall gallery_images
|
||||
@images = GalleryImage.all
|
||||
@images.each do |image|
|
||||
image.tagged_ids.concat(tagsToAdd)
|
||||
tagsToDestroy.each do |tag|
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||
def index
|
||||
@albums = Album.where(:category_id.in => params[:category_id])
|
||||
@albums = GalleryAlbum.where(:category_id.in => params[:category_id])
|
||||
end
|
||||
|
||||
def show
|
||||
@album = Album.find(params[:id])
|
||||
@images = @album.album_images
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@images = @album.gallery_images
|
||||
end
|
||||
|
||||
def imgs
|
||||
@album = Album.find(params[:id])
|
||||
@images = @album.album_images.all
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@images = @album.gallery_images.all
|
||||
@output = Array.new
|
||||
@images.each do |values|
|
||||
tags = Tag.find(values.tagged_ids).map{|t| t.name}
|
||||
@@ -19,7 +19,7 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||
:description => values.description,
|
||||
:title => values.title,
|
||||
:file => values.file.as_json[:file],
|
||||
:gallery_album_id => values.album_id,
|
||||
:gallery_album_id => values.gallery_album_id,
|
||||
:tag_ids => values.tag_ids,
|
||||
:tag_names => tags}
|
||||
end
|
||||
@@ -27,9 +27,9 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def images_tags
|
||||
album = Album.find(params[:album_id])
|
||||
album = GalleryAlbum.find(params[:album_id])
|
||||
tags = Array.new
|
||||
images = album.album_images.all
|
||||
images = album.gallery_images.all
|
||||
images.each do |image|
|
||||
tags << {"id"=>image.id, "tags" => image.tag_ids}
|
||||
end
|
||||
@@ -37,10 +37,10 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def theater
|
||||
@image = AlbumImage.find(params[:image_id])
|
||||
@albumid = @image.album_id
|
||||
@album = Album.find(@albumid)
|
||||
@images = @album.album_images.all
|
||||
@image = GalleryImage.find(params[:id])
|
||||
@albumid = @image.gallery_album_id
|
||||
@album = GalleryAlbum.find(@albumid)
|
||||
@images = @album.gallery_images.all
|
||||
tags = @album.tagged_ids
|
||||
@tagnames = Tag.find(tags).map{|t| t.name}
|
||||
@back_link = panel_gallery_front_end_album_path(@albumid)
|
||||
|
||||
@@ -6,8 +6,8 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController
|
||||
vertical = @part.widget_options['vertical'].to_i rescue 0
|
||||
horizontal = @part.widget_options['horizontal'].to_i rescue 0
|
||||
|
||||
@album = Album.find(@part.widget_options['album_id']) rescue nil
|
||||
@album_images = @album.album_images if @album
|
||||
@album = GalleryAlbum.find(@part.widget_options['album_id']) rescue nil
|
||||
@album_images = @album.gallery_images if @album
|
||||
|
||||
|
||||
@settings = {"vertical"=>vertical,"horizontal"=>horizontal} #[note] horizontal has it's limitation from 2 to 6
|
||||
@@ -16,34 +16,27 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController
|
||||
@rnd = Random.new
|
||||
@images = []
|
||||
|
||||
if !@album_images.nil?
|
||||
if @album_images.count > @total
|
||||
@randoms = []
|
||||
until @randoms.count == @total do
|
||||
r = @rnd.rand(0...@album_images.count)
|
||||
if !@randoms.include?r
|
||||
@randoms << r
|
||||
image = @album_images[r]
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(@album,:image_id=>image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
end
|
||||
elsif @album_images.count == @total
|
||||
@album_images.each do |image|
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(@album,:image_id=>image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
else
|
||||
@album_images.each do |image|
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(@album,:image_id=>image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
until @images.count == @total do
|
||||
values = {"show_link"=>"javascript:void(0);","thumb"=>"assets/gallery/nodata.jpg"}
|
||||
if @album_images.count > @total
|
||||
@randoms = []
|
||||
until @randoms.count == @total do
|
||||
r = @rnd.rand(0...@album_images.count)
|
||||
if !@randoms.include?r
|
||||
@randoms << r
|
||||
image = @album_images[r]
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
end
|
||||
elsif @album_images.count == @total
|
||||
@album_images.each do |image|
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
else
|
||||
@album_images.each do |image|
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
until @images.count == @total do
|
||||
values = {"show_link"=>"javascript:void(0);","thumb"=>"assets/gallery/nodata.jpg"}
|
||||
@images << values
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class Album
|
||||
class GalleryAlbum
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
@@ -12,7 +12,7 @@ class Album
|
||||
field :tag_names
|
||||
|
||||
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
|
||||
has_many :album_images, :autosave => true, :dependent => :destroy
|
||||
accepts_nested_attributes_for :album_images, :allow_destroy => true
|
||||
has_many :gallery_images, :autosave => true, :dependent => :destroy
|
||||
accepts_nested_attributes_for :gallery_images, :allow_destroy => true
|
||||
|
||||
end
|
||||
@@ -9,7 +9,7 @@ class GalleryCategory
|
||||
|
||||
field :name, localize: true
|
||||
|
||||
has_many :albums, :autosave => true, :dependent => :destroy
|
||||
has_many :gallery_albums, :autosave => true, :dependent => :destroy
|
||||
|
||||
def title
|
||||
name
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AlbumImage
|
||||
class GalleryImage
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include OrbitTag::Taggable
|
||||
@@ -10,6 +10,6 @@ class AlbumImage
|
||||
|
||||
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
|
||||
|
||||
belongs_to :album
|
||||
belongs_to :gallery_album
|
||||
|
||||
end
|
||||
@@ -53,10 +53,6 @@ class GalleryUploader < CarrierWave::Uploader::Base
|
||||
process :resize_to_fill => [200, 200]
|
||||
end
|
||||
|
||||
version :theater do
|
||||
process :resize_to_limit => [1920, 1080]
|
||||
end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
# def extension_white_list
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div id="imgholder">
|
||||
<div class="rslide" style="position:relative; width:100%;">
|
||||
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.theater.url %>" alt="" /></a></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.gallery_album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||
<div class="rslidenav">
|
||||
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
||||
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="slidelist">
|
||||
<ul id='galleryimagelist' style="display:none;">
|
||||
<% @images.each_with_index do |image,i| %>
|
||||
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.theater.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" onload="gallery.loadcomplete();" /></a></li>
|
||||
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" onload="gallery.loadcomplete();" /></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -30,6 +30,34 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if is_admin? %>
|
||||
<!-- #TODO or 類別屬於他 -->
|
||||
<!-- tag part -->
|
||||
<div id="tag_panel" class="my_scroll">
|
||||
<div class="scrollbar">
|
||||
<div class="track">
|
||||
<div class="thumb">
|
||||
<div class="end"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
@locales = Array.new
|
||||
@site_valid_locales.each do |locale|
|
||||
@locales << locale
|
||||
end
|
||||
%>
|
||||
|
||||
<%# if @authenticated %>
|
||||
<div class="tag_search"><div class="icon-search"></div><input type="text" value="<%= t('gallery.search_tags') %>" onblur="if(this.value=='')this.value='<%= t('gallery.search_tags') %>';" onfocus="if(this.value=='<%= t("gallery.search_tags") %>')this.value='';" id="tag_search_box"> <div class="tag_save"><a class="btn bt-save"><i class="icon-ok"></i><%= I18n.t("gallery.save") %></a></div></div>
|
||||
<%# end %>
|
||||
|
||||
</div>
|
||||
|
||||
<%end%>
|
||||
|
||||
<!-- tag end -->
|
||||
<div class="form-actions form-fixed pagination-right rghead">
|
||||
<div class="rgfn">
|
||||
<%= link_to (content_tag(:i,I18n.t("gallery.back_to_photos"),:class=>"icon-arrow-left icon-black")),"",:class=>"bt-back btn pull-left btn-primary",:title=>I18n.t("gallery.back_to_photos")%>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<div class="controls" data-toggle="buttons-checkbox">
|
||||
<%@tags.each do |tag|%>
|
||||
<label class="checkbox inline btn <%= 'active' if @album.tag_ids.include?(tag.id) %>">
|
||||
<%= check_box_tag 'album[tag_ids][]', tag.id, @album.tag_ids.include?(tag.id)%>
|
||||
<%= check_box_tag 'gallery_album[tag_ids][]', tag.id, @album.tag_ids.include?(tag.id)%>
|
||||
<%= tag.name %>
|
||||
</label>
|
||||
<%end %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class='rgphoto'>
|
||||
<a title='<%= image.description %>' href='<%= theater_panel_gallery_front_end_album_path(@album,:image_id=>image) %>'>
|
||||
<a title='<%= image.description %>' href='<%= theater_panel_gallery_front_end_album_path(image) %>'>
|
||||
<img src='<%= image.file.thumb.url %>'/>
|
||||
</a>
|
||||
</div>
|
||||
@@ -6,7 +6,7 @@
|
||||
<div id="imgholder">
|
||||
<div class="rslide" style="position:relative; width:100%;">
|
||||
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.theater.url %>" alt="" /></a></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.gallery_album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||
<div class="rslidenav">
|
||||
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
||||
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="slidelist">
|
||||
<ul id='galleryimagelist' style="display:none;">
|
||||
<% @images.each_with_index do |image,i| %>
|
||||
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.theater.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" /></a></li>
|
||||
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" /></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -57,7 +57,8 @@
|
||||
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
||||
var gallery = new galleryAPI();
|
||||
gallery.initialize();
|
||||
gallery.loadTheater("<%= params[:id] %>","<%= params[:image_id] %>");
|
||||
gallery.loadArea = "theater";
|
||||
gallery.loadTheater("<%= params[:id] %>");
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<div class="albumname_edit">
|
||||
<label for=""><%= t("gallery.album_name") %></label>
|
||||
<div class="inputui rginput rgih26 w380"><input type="text" name="album[name_translations][<%= locale %>]" value="<%= @album_name[locale] %>" class="txtchange" /></div>
|
||||
<div class="inputui rginput rgih26 w380"><input type="text" name="gallery_album[name_translations][<%= locale %>]" value="<%= @album_name[locale] %>" class="txtchange" /></div>
|
||||
</div>
|
||||
|
||||
<div class='description_loader'>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</div> -->
|
||||
<div class="rslide" style="position:relative; width:100%;">
|
||||
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.gallery_album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||
<div class="rslidenav">
|
||||
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
||||
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
||||
|
||||
@@ -26,7 +26,7 @@ module Gallery
|
||||
# image :image
|
||||
# end
|
||||
|
||||
# categories_query 'GalleryCategory.all'
|
||||
categories_query 'GalleryCategory.all'
|
||||
# tags_query 'GalleryTag.all'
|
||||
|
||||
#* customize_widget "albums","gallery.widget.albums",:fields=>[],:style=>[],:options=>{"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}}
|
||||
@@ -37,7 +37,7 @@ module Gallery
|
||||
style ["1","2"]
|
||||
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"=>"Album.all", "value"=>:id, "label"=>:name}
|
||||
options "album_id",:i18n =>"gallery.album",:options_item => {"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
||||
include AdminHelper
|
||||
open_for_visitor :only => [:get_location_categories, :get_categorywise_locations]
|
||||
|
||||
def index
|
||||
@locations = LocationInfo.all
|
||||
@@ -90,43 +89,4 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
||||
|
||||
render :json => JSON.pretty_generate(@data)
|
||||
end
|
||||
|
||||
def get_location_categories
|
||||
check_mobile_api_openness
|
||||
location_categories = get_categories_for_index
|
||||
@data = Array.new
|
||||
|
||||
location_categories.each do |category|
|
||||
I18n.locale = :en
|
||||
name_en = category.title
|
||||
I18n.locale = :zh_tw
|
||||
name_zh_tw = category.title
|
||||
category_id = category.id.to_s
|
||||
@data << { name_en: name_en, name_zh_tw: name_zh_tw, category_id: category_id, location_link: "http://#{request.host_with_port}"+"/#{panel_location_back_end_locations_get_categorywise_locations_path}"+"?category_id=#{category_id}"}
|
||||
end
|
||||
|
||||
render :json => JSON.pretty_generate(@data)
|
||||
end
|
||||
|
||||
def get_categorywise_locations
|
||||
check_mobile_api_openness
|
||||
location_infos = LocationInfo.where(:category_id => params[:category_id])
|
||||
@data = Array.new
|
||||
|
||||
location_infos.each do |location|
|
||||
|
||||
picurl = location.file.blank? ? '' : "http://#{request.host_with_port + location.file.url}"
|
||||
thumburl = location.file.blank? ? '' : "http://#{request.host_with_port + location.file.thumb.url}"
|
||||
|
||||
@data << { id: location.id.to_s,
|
||||
name: location.name,
|
||||
pic_url: picurl,
|
||||
thumb_url: thumburl,
|
||||
longitude: location.longitude,
|
||||
latitude: location.latitude,
|
||||
description: location.description }
|
||||
end
|
||||
|
||||
render :json => JSON.pretty_generate(@data)
|
||||
end
|
||||
end
|
||||
@@ -3,9 +3,6 @@ Rails.application.routes.draw do
|
||||
namespace :location do
|
||||
namespace :back_end do
|
||||
match 'location_categories/list' => "location_categories#list"
|
||||
match "locations/get_locations" => "locations#get_locations"
|
||||
match "locations/get_categorywise_locations" => "locations#get_categorywise_locations"
|
||||
match "locations/get_location_categories" => "locations#get_location_categories"
|
||||
resources :location_categories
|
||||
match "locations/get_locations" => "locations#get_locations"
|
||||
match "locations/get_categories" => "locations#get_categories"
|
||||
|
||||
@@ -27,27 +27,22 @@ class Panel::Member::FrontEnd::MemberListsController < OrbitWidgetController
|
||||
@member_role = Role.where(:_id => @role_id)
|
||||
|
||||
@member_subroles = SubRole.where(:role_id => @role_id, :disabled => false)
|
||||
|
||||
@member_list_categorys = RoleCategory.can_display.any_in(:_id => params[:tag_id]).asc("key")
|
||||
|
||||
@member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key")
|
||||
@member_list_categorys = RoleCategory.where(:role_id => @role_id,disable: false).asc("key")
|
||||
|
||||
@mlcs = @member_list_categorys.map{|category| category.id.to_s }
|
||||
|
||||
@mcs = params[:mcid].blank? ? @mlcs.first : params[:mcid]
|
||||
|
||||
if !@member_list_categorys.blank? or !@member_status.blank?
|
||||
|
||||
if !@mcs.blank? and @mlcs.include?(@mcs)
|
||||
@member_lists = User.where(:role_ids => @role_id,:role_category_ids => @mcs).asc(:position)
|
||||
else
|
||||
@member_lists = User.where(:role_ids => @role_id).asc(:position)
|
||||
end
|
||||
if !params[:category_id].blank?
|
||||
@member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key")
|
||||
else
|
||||
# @member_lists = User.where(:role_ids => @role_id)
|
||||
@member_lists = ''
|
||||
@member_status = RoleStatus.can_display.where(:role_id => @role_id).asc("key")
|
||||
end
|
||||
|
||||
if !params[:mcid].blank?
|
||||
@member_lists = User.where(:role_ids => @role_id, :role_category_ids => params[:mcid])
|
||||
else
|
||||
@member_lists = User.where(:role_ids => @role_id)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<% if !@member_lists.blank? %>
|
||||
|
||||
<% @job_title_field = @member_lists.get_member_list_attribute_field("teacher","job_title") %>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="side"></div>
|
||||
@@ -12,7 +8,7 @@
|
||||
<% if !@member_list_categorys.blank? %>
|
||||
<ul class="o-members-nav">
|
||||
<% @member_list_categorys.each do |mc| %>
|
||||
<li class="<%= (params[:mcid] == mc.id.to_s or @mcs.to_s == mc.id.to_s) ? 'active' : '' %>"><a href="?&mcid=<%= mc.id %>"><%= mc.title %></a></li>
|
||||
<li class="<%= (params[:mcid] == mc.id.to_s) ? 'active' : '' %>"><a href="?&mcid=<%= mc.id %>"><%= mc.title %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
@@ -21,8 +17,6 @@
|
||||
|
||||
<div class="o-members">
|
||||
|
||||
<%# @member_lists = @member_lists.where(:role_category_ids => @mcs) if !@mcs.blank? and @mlcs.include?(@mcs) %>
|
||||
|
||||
<% @member_status.each do |ms| %>
|
||||
|
||||
<% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %>
|
||||
@@ -36,11 +30,11 @@
|
||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||
<% @job_title = show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"teacher","job_title").get_value_by_locale(I18n.locale))
|
||||
if @job_title != 'NoData' and !@job_title.blank?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_title_field.title %></b>
|
||||
<%= @member_lists.get_member_list_attribute_field_name("teacher","job_title") %></b>
|
||||
<%= @job_title %>
|
||||
</li>
|
||||
<% end %>
|
||||
@@ -61,10 +55,12 @@
|
||||
|
||||
<% elsif @item.frontend_style == 'Two' or @item.frontend_style.blank? %>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="side"></div>
|
||||
<div class="main">
|
||||
<div class="o-members view-columns">
|
||||
|
||||
<%# @member_lists = @member_lists.where(:role_category_ids => @mcs) if !@mcs.blank? %>
|
||||
|
||||
<% @member_status.each do |ms| %>
|
||||
|
||||
<% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %>
|
||||
@@ -78,10 +74,10 @@
|
||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||
<% @job_title = show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"teacher","job_title").get_value_by_locale(I18n.locale))
|
||||
if @job_title != 'NoData' and !@job_title.blank?
|
||||
%>
|
||||
<li><b class="o-members-label"><%= @job_title_field.title %></b><%= @job_title %></li>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("teacher","job_title") %></b><%= @job_title %></li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= t("users.email")%></b> <%= member.email %></li>
|
||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||
@@ -102,6 +98,5 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= stylesheet_link_tag "member/members" %>
|
||||
<%#= stylesheet_link_tag "member/members" %>
|
||||
@@ -36,7 +36,7 @@
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<%= render :partial=> "show_roles",:collection=>@member.roles.where(:disabled=>false).asc(:created_at) %>
|
||||
<%= render :partial=> "show_roles",:collection=>@member.roles.asc(:created_at) %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -8,36 +8,6 @@
|
||||
.o-members-category:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.o-members-nav {
|
||||
margin: 0 0 10px;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.o-members-nav:after {
|
||||
content: "";
|
||||
clear: both;
|
||||
display: block;
|
||||
height: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
.o-members-nav li {
|
||||
float: left;
|
||||
}
|
||||
.o-members-nav li + li {
|
||||
margin-left: 8px;
|
||||
}
|
||||
.o-members-nav li a {
|
||||
display: inline-block;
|
||||
line-height: 23px;
|
||||
padding: 5px 8px;
|
||||
height: 23px;
|
||||
background-color: #ccc;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.o-members-nav li.active a {
|
||||
color: #FFF;
|
||||
background-color: #0088CE;
|
||||
}
|
||||
.o-members-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
@@ -137,4 +107,4 @@
|
||||
font-size: 16px;
|
||||
margin: 0;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
@@ -27,25 +27,17 @@ class Panel::MemberStaff::FrontEnd::MemberStaffListsController < OrbitWidgetCont
|
||||
@member_role = Role.where(:_id => @role_id)
|
||||
|
||||
@member_subroles = SubRole.where(:role_id => @role_id, :disabled => false)
|
||||
|
||||
@member_list_categorys = RoleCategory.can_display.any_in(:_id => params[:tag_id]).asc("key")
|
||||
|
||||
@member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key")
|
||||
if !params[:category_id].blank?
|
||||
@member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key")
|
||||
|
||||
@mlcs = @member_list_categorys.map{|category| category.id.to_s }
|
||||
@member_lists = User.where(:role_ids => @role_id)
|
||||
|
||||
@mcs = params[:mcid].blank? ? @mlcs.first : params[:mcid]
|
||||
|
||||
if !@member_list_categorys.blank? or !@member_status.blank?
|
||||
|
||||
if !@mcs.blank? and @mlcs.include?(@mcs)
|
||||
@member_lists = User.where(:role_ids => @role_id,:role_category_ids => @mcs).asc(:position)
|
||||
else
|
||||
@member_lists = User.where(:role_ids => @role_id).asc(:position)
|
||||
end
|
||||
else
|
||||
# @member_lists = User.where(:role_ids => @role_id)
|
||||
@member_lists = ''
|
||||
@member_status = RoleStatus.can_display.where(:role_id => @role_id).asc("key")
|
||||
|
||||
@member_lists = User.where(:role_ids => @role_id)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,61 +1,29 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<% if !@member_lists.blank? %>
|
||||
|
||||
<% @job_title_field = @member_lists.get_member_list_attribute_field("staff","job_title") %>
|
||||
<% @job_business_field = @member_lists.get_member_list_attribute_field("staff","business") %>
|
||||
|
||||
<% if @item.frontend_style == 'Single' or @item.frontend_style == 'Two' %>
|
||||
<% if @item.frontend_style == 'Single' %>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="side"></div>
|
||||
<div class="main">
|
||||
|
||||
<% if !@member_list_categorys.blank? %>
|
||||
<ul class="o-members-nav">
|
||||
<% @member_list_categorys.each do |mc| %>
|
||||
<li class="<%= (params[:mcid] == mc.id.to_s or @mcs.to_s == mc.id.to_s) ? 'active' : '' %>"><a href="?&mcid=<%= mc.id %>"><%= mc.title %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% if @item.frontend_style == 'Single' %>
|
||||
|
||||
<div class="o-members">
|
||||
|
||||
<% @member_status.each do |ms| %>
|
||||
|
||||
<% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %>
|
||||
|
||||
<h3 class="o-members-category h3"><%= ms.title %></h3>
|
||||
<ul class="o-members-list">
|
||||
|
||||
<% @member_lists.where(:role_status_ids=>ms.id).each do |member| %>
|
||||
<% @member_lists.get_role_member_data_by_sort(ms.id).each do |member| %>
|
||||
|
||||
<li class="odd">
|
||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_title != 'NoData' and !@job_title.blank?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_title_field.title %></b>
|
||||
<%= @job_title %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %></b><%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title").get_value_by_locale(I18n.locale)) %></li>
|
||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
||||
|
||||
<% @job_business = @member_lists.get_member_list_attribute_value(member.id,@job_business_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_business != 'NoData' and !@job_business.blank?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_business_field.title %></b>
|
||||
<%= @job_business %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","business") %></b><%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business").get_value_by_locale(I18n.locale)) %></li>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","agent") %></b><%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent").get_value_by_locale(I18n.locale) %></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -65,47 +33,34 @@
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<% elsif @item.frontend_style == 'Two' %>
|
||||
<% elsif @item.frontend_style == 'Two' %>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="side"></div>
|
||||
<div class="main">
|
||||
<div class="o-members view-columns">
|
||||
|
||||
<% @member_status.each do |ms| %>
|
||||
|
||||
<% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %>
|
||||
|
||||
<h3 class="o-members-category h3"><%= ms.title %></h3>
|
||||
<ul class="o-members-list">
|
||||
|
||||
<% @member_lists.where(:role_status_ids=>ms.id).each_with_index do |member, i| %>
|
||||
<% @member_lists.get_role_member_data_by_sort(ms.id).each_with_index do |member, i| %>
|
||||
|
||||
<li <%= ( (i + 1) % 2 != 0 ) ? "class=odd" : '' %>>
|
||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_title != 'NoData' and !@job_title.blank?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_title_field.title %></b>
|
||||
<%= @job_title %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %></b><%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title").get_value_by_locale(I18n.locale)) %></li>
|
||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
||||
|
||||
|
||||
<% @job_business = @member_lists.get_member_list_attribute_value(member.id,@job_business_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_business != 'NoData' and !@job_business.blank?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_business_field.title %></b>
|
||||
<%= @job_business %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","business") %></b><%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business").get_value_by_locale(I18n.locale)) %></li>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","agent") %></b><%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent").get_value_by_locale(I18n.locale) %></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -115,64 +70,47 @@
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<% elsif @item.frontend_style == 'List' %>
|
||||
|
||||
<% if !@member_list_categorys.blank? %>
|
||||
<ul class="o-members-nav">
|
||||
<% @member_list_categorys.each do |mc| %>
|
||||
<li class="<%= (params[:mcid] == mc.id.to_s or @mcs.to_s == mc.id.to_s) ? 'active' : '' %>"><a href="?&mcid=<%= mc.id %>"><%= mc.title %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<div class="o-members view-ntu-lists">
|
||||
|
||||
<% @member_status.each do |ms| %>
|
||||
|
||||
<% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %>
|
||||
|
||||
<h3 class="o-members-category h3"><%= ms.title %></h3>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><span class="job_title"><%= @job_title_field.title %></span></td>
|
||||
<td><span class="job_title"><%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %></span></td>
|
||||
<td><span class="name"><%= t("users.name")%></span></td>
|
||||
<td><span class="tel"><%= t("users.office_tel")%></span></td>
|
||||
<td><span class="business"><%= @job_business_field.title %></span></td>
|
||||
<td><span class="business"><%= @member_lists.get_member_list_attribute_field_name("staff","business") %></span></td>
|
||||
<td><span class="agent"><%= @member_lists.get_member_list_attribute_field_name("staff","agent") %></span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<% @member_lists.where(:role_status_ids=>ms.id).each_with_index do |member, i| %>
|
||||
<% @member_lists.get_role_member_data_by_sort(ms.id).each_with_index do |member, i| %>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<span class="job_title">
|
||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_title != 'NoData' and !@job_title.blank?
|
||||
%>
|
||||
<%= @job_title %>
|
||||
<% end %>
|
||||
<%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title").get_value_by_locale(I18n.locale)) rescue '' %>
|
||||
</span>
|
||||
</td>
|
||||
<td><span class="name"><%= link_to member.name, "mailto:#{member.email}" %></span></td>
|
||||
<td><span class="tel"><%= member.office_tel %></span></td>
|
||||
<td>
|
||||
<span class="business">
|
||||
<% @job_business = @member_lists.get_member_list_attribute_value(member.id,@job_business_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_business != 'NoData' and !@job_business.blank?
|
||||
%>
|
||||
<%= @job_business %>
|
||||
<% end %>
|
||||
<%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business").get_value_by_locale(I18n.locale)) rescue '' %>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="agent">
|
||||
<%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent").get_value_by_locale(I18n.locale) rescue '' %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -183,12 +121,9 @@
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= stylesheet_link_tag "member_staff/members" %>
|
||||
<%= stylesheet_link_tag "member_staff/members" %>
|
||||
@@ -23,8 +23,8 @@ class Panel::WebResource::FrontEnd::WebLinksController < OrbitWidgetController
|
||||
date_now = Time.now
|
||||
|
||||
# @web_link_categorys = get_categories_for_index
|
||||
if !params[:filter_category_id].blank?
|
||||
@web_link_categorys = @module_app.categories.enabled.any_in(:_id => params[:filter_category_id])
|
||||
if !params[:category_id].blank?
|
||||
@web_link_categorys = @module_app.categories.enabled.any_in(:_id => params[:category_id])
|
||||
else
|
||||
@web_link_categorys = @module_app.categories.enabled
|
||||
end
|
||||
|
||||