Compare commits
32
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fad5445da | ||
|
|
a38cf6304e | ||
|
|
20e2f07b26 | ||
|
|
c291f15e23 | ||
|
|
ce8e9c0a5f | ||
|
|
dc5ef21516 | ||
|
|
ea3f9c8163 | ||
|
|
e129b25554 | ||
|
|
7028390248 | ||
|
|
8f3a68b3d7 | ||
|
|
eeb7f72876 | ||
|
|
a49562e341 | ||
|
|
a3d921c47a | ||
|
|
6d5b3a35e9 | ||
|
|
2e5b3e8ef7 | ||
|
|
635f82db2f | ||
|
|
182729a7fe | ||
|
|
a1840c86de | ||
|
|
3d091b692d | ||
|
|
f91c08ce4b | ||
|
|
528f7d28b9 | ||
|
|
5f3f27fe9a | ||
|
|
c575dbd33a | ||
|
|
405c2c5a12 | ||
|
|
5e0696890a | ||
|
|
afff07ec89 | ||
|
|
82ce516d7a | ||
|
|
989002a5ae | ||
|
|
72a37afddb | ||
|
|
ed569601c3 | ||
|
|
9e432a5a93 | ||
|
|
2f61f55be2 |
No files matched your search
@@ -38,8 +38,8 @@ if($.support.touch) {
|
||||
$checked.each(function() {
|
||||
if(!$(this).closest('div').hasClass('togglebox')) {
|
||||
$(this).wrap('<div class="toggle-control"/>');
|
||||
if($(this).attr('type') == "hidden" && $(this).attr('value')) {
|
||||
$(this).wrap('<div class="togglebox disabled" />');
|
||||
if($(this).attr('type') == "hidden" && $(this).attr('value') == 'true') {
|
||||
$(this).wrap('<div class="togglebox disable" />');
|
||||
} else {
|
||||
$(this).wrap('<div class="togglebox" />');
|
||||
}
|
||||
@@ -71,7 +71,6 @@ 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');
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ var banner_index = 0;
|
||||
$(document).ready(function() {
|
||||
$.each($(".dymanic_load"),function(){
|
||||
if($(this).attr("path")==''){
|
||||
$(this).html("App setting Failed");
|
||||
$(this).html("");
|
||||
}else{
|
||||
ajax_load_proc($(this),$(this).attr("path"));
|
||||
}
|
||||
@@ -16,7 +16,7 @@ $(document).ready(function() {
|
||||
function ajax_load_proc(wapper,url,isBanner){
|
||||
$.get(encodeURI(url), {}, function(respText,textSta,XML){
|
||||
if (textSta == 'success') {
|
||||
wapper.html(respText);
|
||||
if (respText.indexOf("<title>") == -1) wapper.html(respText);
|
||||
};
|
||||
if(textSta == 'error')
|
||||
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
|
||||
|
||||
@@ -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('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('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 pageSetting(id, edit, ps) {
|
||||
$pageModule = $('#pageslide #page_module_app_id');
|
||||
@@ -411,7 +411,7 @@ $(function() {
|
||||
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||
}
|
||||
var $all = $pageCategory.siblings('.checkbox').children('.select_all');
|
||||
_val == _select.main && _select.category.length ? $hiddenInputA.removeAttr('name') : $hiddenInputA.attr('name', 'page[category][]');
|
||||
_boolean && _val == _select.main && _select.category.length ? $hiddenInputA.removeAttr('name') : $hiddenInputA.attr('name', 'page[category][]');
|
||||
_boolean && _val == _select.main && _select.category.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
||||
}
|
||||
});
|
||||
@@ -431,7 +431,7 @@ $(function() {
|
||||
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||
}
|
||||
var $all = $pageTags.siblings('.checkbox').children('.select_all');
|
||||
_val == _select.main && _select.tags.length ? $hiddenInputB.removeAttr('name') : $hiddenInputB.attr('name', 'page[tag][]');
|
||||
_boolean && _val == _select.main && _select.tags.length ? $hiddenInputB.removeAttr('name') : $hiddenInputB.attr('name', 'page[tag][]');
|
||||
_boolean && _val == _select.main && _select.tags.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
$(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() {});
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -222,7 +222,7 @@ $(function() {
|
||||
});
|
||||
$('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
||||
if($(this).hasClass('togglebox')) {
|
||||
if($(this).hasClass('disabled')) {
|
||||
if($(this).hasClass('disable')) {
|
||||
$(this).find('.toggle-check')
|
||||
.attr('value', 'false')
|
||||
.closest('.attributes')
|
||||
@@ -237,7 +237,7 @@ $(function() {
|
||||
.children('.attributes-body')
|
||||
.fadeOut(300);
|
||||
}
|
||||
$(this).toggleClass('disabled');
|
||||
$(this).toggleClass('disable');
|
||||
};
|
||||
if($(this).hasClass('remove-input')) {
|
||||
$(this).closest('.input-append').fadeOut(300, function() {
|
||||
@@ -382,7 +382,7 @@ $(function() {
|
||||
});
|
||||
$('#attributes-area').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
||||
if($(this).hasClass('togglebox')) {
|
||||
if($(this).hasClass('disabled')) {
|
||||
if($(this).hasClass('disable')) {
|
||||
$(this).find('.toggle-check')
|
||||
.attr('value', 'false')
|
||||
.closest('.attributes')
|
||||
@@ -411,7 +411,7 @@ $(function() {
|
||||
$(this).parent('.field-type').removeClass('in');
|
||||
});
|
||||
}
|
||||
$(this).toggleClass('disabled');
|
||||
$(this).toggleClass('disable');
|
||||
};
|
||||
if($(this).hasClass('delete')) {
|
||||
$(this).closest('.attributes').fadeOut(300, function() {
|
||||
|
||||
@@ -51,7 +51,7 @@ $(function() {
|
||||
}
|
||||
if($('.set-sidebar-state').length) {
|
||||
if(window.localStorage.getItem('sidebarState') == 1) {
|
||||
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disabled');
|
||||
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disable');
|
||||
}
|
||||
$('.set-sidebar-state').on({
|
||||
change: function() {
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
//= require lib/all-list
|
||||
//= require lib/jquery.fastLiveFilter.js
|
||||
//= require lib/checkbox.card.js
|
||||
//= require lib/jquery.form.js
|
||||
//= require lib/jquery.form.js
|
||||
//= require lib/member/member-role.js
|
||||
@@ -40,8 +40,18 @@ 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?
|
||||
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 ''
|
||||
|
||||
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["count"] = module_app.get_registration.get_data_count.to_a
|
||||
module_apps << m
|
||||
end
|
||||
|
||||
@@ -63,8 +63,19 @@ 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 []
|
||||
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 ''
|
||||
|
||||
|
||||
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["count"] = module_app.get_registration.get_data_count.to_a
|
||||
module_apps << m
|
||||
end
|
||||
|
||||
@@ -21,11 +21,15 @@ class Admin::PagesController < Admin::ItemsController
|
||||
end
|
||||
|
||||
def update
|
||||
if params[:page][:category][0] == ""
|
||||
params[:page][:category] = []
|
||||
if params[:page][:category]
|
||||
if params[:page][:category][0] == ""
|
||||
params[:page][:category] = []
|
||||
end
|
||||
end
|
||||
if params[:page][:tag][0] == ""
|
||||
params[:page][:tag] = []
|
||||
if params[:page][:tag]
|
||||
if params[:page][:tag][0] == ""
|
||||
params[:page][:tag] = []
|
||||
end
|
||||
end
|
||||
@item = Page.find(params[:id])
|
||||
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
|
||||
|
||||
@@ -40,6 +40,7 @@ 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}})")
|
||||
@@ -69,7 +70,10 @@ 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 @paginate || @search
|
||||
if params[:click]
|
||||
@data = get_more_btn_data.page(params[:page_main]).per(@data_limit)
|
||||
|
||||
elsif @paginate || @search
|
||||
if @search
|
||||
@data = search_result.page(params[:page_main]).per(@data_limit) rescue []
|
||||
else #regular listing
|
||||
@@ -93,6 +97,15 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def get_more_btn_data
|
||||
filterids = PagePart.find(params[:part_id]).category
|
||||
model = eval(@default_widget["query"])
|
||||
data = model.where(:category_id.in => filterids)
|
||||
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
|
||||
|
||||
@@ -344,7 +344,7 @@ class DesktopController< ApplicationController
|
||||
|
||||
def check_desktop_open
|
||||
@site = Site.first
|
||||
if @site.desktop_closed #Need to be change
|
||||
if !@site.desktop_closed #Need to be change
|
||||
redirect_to '/admin/dashboards'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@ class OrbitBackendController < ApplicationController
|
||||
status << 'is_top'
|
||||
status << 'is_hot'
|
||||
status << 'is_hidden' unless is_guest?
|
||||
if @module_app.is_approvable && is_manager?
|
||||
if @module_app.is_approvable && (is_manager? || is_sub_manager?)
|
||||
status << 'is_pending'
|
||||
status << 'is_checked'
|
||||
status << 'is_rejected'
|
||||
|
||||
@@ -14,7 +14,7 @@ class OrbitMemberController < ApplicationController
|
||||
status << 'is_top'
|
||||
status << 'is_hot'
|
||||
status << 'is_hidden' unless is_guest?
|
||||
if @module_app.is_approvable && is_manager?
|
||||
if @module_app.is_approvable && (is_manager? || is_sub_manager?)
|
||||
status << 'is_pending'
|
||||
status << 'is_checked'
|
||||
status << 'is_rejected'
|
||||
|
||||
@@ -64,6 +64,8 @@ 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('category_id',params[:category_id])}" unless params[:category_id].blank?
|
||||
@@ -105,26 +107,78 @@ 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.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
|
||||
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.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
|
||||
@item = Item.root.children.where(:module_app_id => module_app.id).first
|
||||
end
|
||||
raise PageError,'Missing Frontend Page' if @item.nil?
|
||||
end
|
||||
|
||||
@@ -12,13 +12,13 @@ module OrbitBackendHelper
|
||||
|
||||
def show_form_status_field(object)
|
||||
#by_object = (!object.is_expired? and object.is_pending?)
|
||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin?)
|
||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
|
||||
by_user
|
||||
end
|
||||
|
||||
def show_approval_link(object)
|
||||
by_object = (!object.is_expired? and object.is_pending?)
|
||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin?)
|
||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
|
||||
by_object and by_user
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
class UserMailer < Devise::Mailer
|
||||
default :from => "noreply@rulingcom.com"
|
||||
|
||||
def password_reset(user, password)
|
||||
@user = user
|
||||
@password = password
|
||||
mail(:to => user.email,
|
||||
:subject => 'Password Reset Notification')
|
||||
end
|
||||
end
|
||||
@@ -3,6 +3,8 @@ 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,20 +186,21 @@ class User
|
||||
}.uniq!
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_field_name(role_type,field_key)
|
||||
def self.get_member_list_attribute_field(role_type,field_key)
|
||||
@attribute = ::Attribute.where(:key => role_type).first
|
||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first.title
|
||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||
end
|
||||
|
||||
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
|
||||
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
|
||||
end
|
||||
|
||||
def self.get_role_member_data_by_sort(role_status_id)
|
||||
def self.get_role_member_data_by_sort(role, field_key, role_status_id)
|
||||
a = Array.new
|
||||
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 ] }
|
||||
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 ] }
|
||||
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' : '' %>">
|
||||
<%= 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" %>
|
||||
<%= 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} %>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
$("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
|
||||
// $("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
|
||||
location.reload();
|
||||
$.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,15 +18,7 @@
|
||||
<td><%= role_filter.title %></td>
|
||||
<% end %>
|
||||
|
||||
<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 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>
|
||||
</tr>
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||
<% end %>
|
||||
@@ -9,14 +10,6 @@
|
||||
<%= 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" %>
|
||||
@@ -27,4 +20,4 @@
|
||||
<%= render 'index' %>
|
||||
</div>
|
||||
|
||||
|
||||
<% @path = "/admin/#{@app_type == 'role_category' ? 'role_categorys' : @app_type }/" %>
|
||||
@@ -1,3 +1,4 @@
|
||||
$("#role_filters_index").html("<%= j render 'index' %>")
|
||||
// $("#role_filters_index").html("<%= j render 'index' %>")
|
||||
location.reload();
|
||||
$.pageslide.close();
|
||||
openSlide();
|
||||
@@ -2,7 +2,6 @@
|
||||
<%= 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" %>
|
||||
@@ -10,13 +9,6 @@
|
||||
<%= 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"%>
|
||||
|
||||
@@ -5,12 +5,7 @@
|
||||
|
||||
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
|
||||
<div class="attributes-header clearfix">
|
||||
<div class="toggle-control" style="float: right;">
|
||||
<div class="togglebox <%= role_disable ? 'disabled' : '' %>">
|
||||
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
</div>
|
||||
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
|
||||
<h4><%= role.title %><%= t(:role_info)%></h4>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
<%=render :partial=>"role",:collection=>Role.all.asc("_id")%>
|
||||
<%=render :partial=>"role",:collection=>Role.where(:disabled=>false).asc("_id")%>
|
||||
@@ -1,22 +1,36 @@
|
||||
<section id="main-wrap">
|
||||
<div class="sign-in have-other-sign-in">
|
||||
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
|
||||
-->
|
||||
|
||||
<h1 class="login-logo"><%= t(:ruling_site) %></h1>
|
||||
<div id="signin-header">
|
||||
<h3><%= t(:forgot_password) %></h3>
|
||||
</div>
|
||||
<div id="container" class="sign-in">
|
||||
<%= form_for :user, :url => user_password_path, :html => {:class => 'user_new form-horizontal'} do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
<div class="content">
|
||||
<div class="main">
|
||||
<div class="control-group clear">
|
||||
<%= f.label :email %>
|
||||
<%= f.email_field :email, :placeholder => t(:email), :style => "width: 330px;" %>
|
||||
<span class="help-inline">Please correct the error</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions clear">
|
||||
<%= content_tag :button, "Send me reset password instructions", :type => :submit, :class => 'btn btn-primary pull-right' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form">
|
||||
<h3 class="login-logo">Reset Your Password</h3>
|
||||
<div>
|
||||
<input name="utf8" type="hidden" value="" />
|
||||
<input name="authenticity_token" type="hidden" value="" />
|
||||
</div>
|
||||
<!-- <div class="other-sign-in">
|
||||
<a class="btn btn-primary" type="submit">Other Sign In</a>
|
||||
<p>or</p>
|
||||
</div> -->
|
||||
<div class="form-block">
|
||||
<div class="form-list clearfix">
|
||||
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
||||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :class => 'user_new form-horizontal' }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div class="control-group clear">
|
||||
<label for="user_email">
|
||||
<i class="icons-mail "></i>
|
||||
</label>
|
||||
<%= f.text_field :email, :placeholder => t(:email), :id=>"user_email" %>
|
||||
</div>
|
||||
<%= content_tag :button, "Reset Password", :type => :submit, :class => 'btn btn-primary' %>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -1,5 +1,3 @@
|
||||
<!-- Orbit Bar -->
|
||||
<!--#include virtual="include/orbit_bar.html"-->
|
||||
<section id="main-wrap">
|
||||
<div class="sign-in have-other-sign-in">
|
||||
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
|
||||
@@ -35,25 +33,22 @@
|
||||
</label>
|
||||
<%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %>
|
||||
</div>
|
||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||
</form>
|
||||
|
||||
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
||||
<div class="control-group clear">
|
||||
<label for="user_email">
|
||||
<i class="icon-user"></i>
|
||||
</label>
|
||||
<input type="text" id="user_id" name="user[id]" placeholder="帳號" />
|
||||
</div>
|
||||
<div class="control-group clear">
|
||||
<label for="user_password">
|
||||
<i class="icons-mail"></i>
|
||||
</label>
|
||||
<input type="text" id="user_email" name="user[email]" placeholder="電子郵件" />
|
||||
</div>
|
||||
<br/>
|
||||
<label class="checkbox">
|
||||
<% if devise_mapping.rememberable? -%>
|
||||
<%= f.check_box :remember_me %> <small><%= f.label :remember_me %></small>
|
||||
<% end -%>
|
||||
</label>
|
||||
|
||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<%= link_to content_tag(:small, t(:forgot_password)), new_user_password_path %>
|
||||
</div>
|
||||
<br/>
|
||||
<!-- <div class="register">
|
||||
<button class="btn btn-inverse" type="submit">Register</button>
|
||||
</div> -->
|
||||
|
||||
@@ -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><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 class='needed'><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,6 +17,12 @@
|
||||
<% 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,12 +1,20 @@
|
||||
<% if @menu_page && @menu_page.visible_children.size > 0 %>
|
||||
<% if @menu_page %>
|
||||
<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 %>
|
||||
@@ -33,7 +33,7 @@
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="orbit-user">
|
||||
<li><%= link_to content_tag(:i, nil, class: 'icons-tools') + ' ' + t("users.change_passwd"), admin_users_new_interface_setting_account_path(current_user), tabindex: '-1' %></li>
|
||||
<li><%= link_to content_tag(:i, nil, class: 'icons-vcard') + ' ' + t("users.user_basic_data"), admin_users_new_interface_edit_user_data_path(current_user), tabindex: '-1' %></li>
|
||||
<% if @site.desktop_closed.blank? %>
|
||||
<% if @site.desktop_closed %>
|
||||
<li><%= link_to content_tag(:i, nil, class: 'icons-screen') + ' ' + t(:desktop), desktop_path, tabindex: '-1' %></li>
|
||||
<% end %>
|
||||
<li><%= link_to content_tag(:i, nil, class: 'icons-logout') + ' ' + t(:logout), destroy_user_session_path, tabindex: '-1' %></li>
|
||||
@@ -69,10 +69,10 @@
|
||||
<%= f.password_field :password, class: "input-xlarge", placeholder: t(:password) %>
|
||||
</div>
|
||||
<div class="pull-left" style="width: 150px;">
|
||||
<!-- <label class="checkbox">
|
||||
<input type="checkbox" value="">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="user[remember_me]" value="1" checked="checked" />
|
||||
<small>Remember me</small>
|
||||
</label> -->
|
||||
</label>
|
||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
|
||||
@@ -24,8 +24,16 @@
|
||||
<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>
|
||||
|
||||
@@ -15,7 +15,7 @@ Orbit::Application.configure do
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# Don't care if the mailer can't send
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
config.action_mailer.raise_delivery_errors = true
|
||||
|
||||
# Print deprecation notices to the Rails logger
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
Devise.setup do |config|
|
||||
# ==> Mailer Configuration
|
||||
# Configure the e-mail address which will be shown in DeviseMailer.
|
||||
config.mailer_sender = "please-change-me@config-initializers-devise.com"
|
||||
config.mailer_sender = "UserMailer"
|
||||
|
||||
# Configure the class responsible to send e-mails.
|
||||
# config.mailer = "Devise::Mailer"
|
||||
config.mailer = "Devise::Mailer"
|
||||
|
||||
# ==> ORM configuration
|
||||
# Load and configure the ORM. Supports :active_record (default) and
|
||||
@@ -61,7 +61,7 @@ Devise.setup do |config|
|
||||
|
||||
# ==> Configuration for :rememberable
|
||||
# The time the user will be remembered without asking for credentials again.
|
||||
# config.remember_for = 2.weeks
|
||||
config.remember_for = 2.weeks
|
||||
|
||||
# If true, a valid remember token can be re-used between multiple browsers.
|
||||
# config.remember_across_browsers = true
|
||||
|
||||
+3
-3
@@ -8,13 +8,13 @@ defaults: &defaults
|
||||
|
||||
development:
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
database: orbit_site_new
|
||||
|
||||
|
||||
|
||||
test:
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
database: orbit_site_new
|
||||
|
||||
# set these environment variables on your prod server
|
||||
production:
|
||||
@@ -24,4 +24,4 @@ production:
|
||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
database: orbit_site_new
|
||||
@@ -12,10 +12,11 @@ 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}" )
|
||||
params_str = params_str + "&click=more_btn&page_part_id=#{@params[:part_id]}"
|
||||
content_tag :div,:class=> 'more' do
|
||||
link_to I18n.t(@more_link[:label_i18n]),[eval("#{@more_link[:path_method]}"),params_str].join()
|
||||
end
|
||||
|
||||
@@ -19,13 +19,12 @@ module ParserFrontEnd
|
||||
end
|
||||
|
||||
def parse_page_content(page,args={})
|
||||
|
||||
args["category_id"] = args["category_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if !args["category_id"].blank? and args["category_id"].is_a?(String)
|
||||
args["tag_id"] = args["tag_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if !args["tag_id"].blank? and args["tag_id"].is_a? String
|
||||
# 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
|
||||
@@ -42,19 +41,14 @@ 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 ''
|
||||
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
|
||||
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)
|
||||
|
||||
+2
-2
@@ -9,6 +9,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def search_result
|
||||
debugger
|
||||
if params[:search_query] == ""
|
||||
@bulletins = get_bulletins_for_index
|
||||
|
||||
@@ -26,7 +27,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def index
|
||||
|
||||
@bulletins = get_bulletins_for_index
|
||||
end
|
||||
|
||||
def get_bulletins_for_index
|
||||
@@ -47,7 +48,6 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||
# @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in=>params[:category_id],:tagged_ids.in=>params[:tag_id])
|
||||
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
|
||||
debugger
|
||||
elsif !params[:category_id].blank?
|
||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
|
||||
|
||||
Vendored
+3
-6
@@ -53,7 +53,7 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
|
||||
<% if !@category_id.blank? %>
|
||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||
<% else %>
|
||||
@@ -100,7 +100,7 @@
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
|
||||
<% if !@category_id.blank? %>
|
||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||
<% else %>
|
||||
@@ -149,7 +149,6 @@
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% if !@category_id.blank? %>
|
||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||
<% else %>
|
||||
@@ -198,8 +197,7 @@
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
<% if !@category_id.blank? %>
|
||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||
<% else %>
|
||||
@@ -246,7 +244,6 @@
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% if !@category_id.blank? %>
|
||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||
<% else %>
|
||||
|
||||
+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 => [:bulletin_category,:id]}}
|
||||
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:category,:id]}}
|
||||
field :subtitle
|
||||
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
||||
end
|
||||
|
||||
+9
-1
@@ -10,4 +10,12 @@
|
||||
<tbody>
|
||||
<%= render partial: 'category', collection: @categories %>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %>
|
||||
</div>
|
||||
<div class="pagination pagination-centered">
|
||||
<%= paginate @categories unless @categories.blank? %>
|
||||
</div>
|
||||
</div>
|
||||
+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.qa_category.title rescue nil %></span>
|
||||
<span><%= t(:category) %>:<%= @qa.category.title rescue nil %></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="news_paragraph">
|
||||
|
||||
Vendored
+7
-8
@@ -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.all'
|
||||
# enable ['typeA']
|
||||
link_field :qa_category_with_title,{:method => 'panel_faq_front_end_qas_path',:args=>{:category_id => [:qa_category,:id]}}
|
||||
query 'Qa'
|
||||
enable ['typeA']
|
||||
link_field :qa_category_with_title,{:method => 'panel_faq_front_end_qas_path',:args=>{:category_id => [: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']})
|
||||
active_for_controllers ({:private=>['qas', 'qa_categorys','module_tags', 'categories']})
|
||||
active_for_object_auth ['QaCategory']
|
||||
|
||||
head_link_path "panel_faq_back_end_qas_path"
|
||||
@@ -65,11 +65,10 @@ module Faq
|
||||
context_link 'categories',
|
||||
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
|
||||
:priority=>3,
|
||||
:active_for_category => 'Qa',
|
||||
:active_for_category => 'Faq',
|
||||
:available_for => [:manager]
|
||||
|
||||
context_link 'tags',
|
||||
:link_path=>"admin_module_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Faq'}))" ,
|
||||
:link_path=>"admin_module_tags_path(module_app_id: get_module_app)" ,
|
||||
:priority=>4,
|
||||
:active_for_tag => 'Faq',
|
||||
:available_for => [:manager]
|
||||
|
||||
+1
-1
@@ -176,7 +176,7 @@ var galleryAPI = function(){
|
||||
if(rcom.getInternetExplorerVersion() == -1){
|
||||
|
||||
if(pageurl!=window.location){
|
||||
pageurl = window.location.pathname.replace("/","")+"?id="+pageurl+"&controller_action=theater";
|
||||
pageurl = window.location.pathname+"?id="+pageurl+"&controller_action=theater";
|
||||
window.history.pushState({path:pageurl},'',pageurl);
|
||||
}
|
||||
}else{
|
||||
|
||||
Whitespace-only changes.
@@ -0,0 +1,131 @@
|
||||
var Locations = function(ls){
|
||||
l = this;
|
||||
this.name = "Locations";
|
||||
this.locations = ls;
|
||||
this.markerCounts = 0;
|
||||
var map = null,
|
||||
infowindow = new google.maps.InfoWindow(),
|
||||
default_location = new google.maps.LatLng( 24.8043107, 121.03042159999995 ),
|
||||
infowindow_template = "<div class='title'></div><div class='image'><img class='thumbnail' src='' /></div>",
|
||||
markers = [];
|
||||
|
||||
|
||||
var initialize = function() {
|
||||
google.maps.visualRefresh = true;
|
||||
var location = ( l.locations.length ? new google.maps.LatLng( l.locations[0].latitude, l.locations[0].longitude ) : default_location ),
|
||||
mapOptions = {
|
||||
zoom: 16,
|
||||
center: location,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
};
|
||||
|
||||
map = new google.maps.Map( document.getElementById('map'), mapOptions );
|
||||
|
||||
for( i = 0; i < l.locations.length; i++ ){
|
||||
markers.push( addMarker( new google.maps.LatLng(l.locations[i].latitude, l.locations[i].longitude), l.locations[i].color, i, function( index ){
|
||||
|
||||
}) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var addMarker = function( location, pinColor, index, markerCallback ){
|
||||
|
||||
var pin = getPin(( pinColor.substr( 0, 1 ) == "#" ? pinColor.replace("#","") : pinColor )),
|
||||
marker = new google.maps.Marker({
|
||||
map: map,
|
||||
icon: pin.image,
|
||||
shadow: pin.shadow,
|
||||
position: location,
|
||||
zIndex: 10
|
||||
});
|
||||
|
||||
google.maps.event.addListener( marker, 'click', function() {
|
||||
|
||||
infowindow.setContent( getTemplate( index ) );
|
||||
infowindow.open( map, marker );
|
||||
if( typeof markerCallback == "function" )
|
||||
markerCallback.call( this, index );
|
||||
|
||||
});
|
||||
|
||||
l.markerCounts++;
|
||||
return {"marker" : marker, "category_id" : l.locations[index].category_id};
|
||||
}
|
||||
|
||||
|
||||
|
||||
var getTemplate = function( obj ){
|
||||
|
||||
var object = ( typeof obj == "number" ? l.locations[obj] : ( typeof obj == "object" ? obj : null ) );
|
||||
|
||||
if ( object ){
|
||||
|
||||
var template = $( "<div></div>" );
|
||||
template.html( infowindow_template );
|
||||
template.find( '.title' ).text( object.name );
|
||||
template.find( "img.thumbnail" ).attr( "src", object.file.thumb.url );
|
||||
return template.html();
|
||||
|
||||
}else{
|
||||
|
||||
throw new InvalidObjectError();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var getPin = function( color ){
|
||||
|
||||
var pinImage = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + color,
|
||||
new google.maps.Size(21, 34),
|
||||
new google.maps.Point(0,0),
|
||||
new google.maps.Point(10, 34));
|
||||
|
||||
var pinShadow = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_shadow",
|
||||
new google.maps.Size(40, 37),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(12, 35));
|
||||
|
||||
return {"image":pinImage,"shadow":pinShadow};
|
||||
}
|
||||
|
||||
this.getMarker = function( index ){
|
||||
return markers[index];
|
||||
}
|
||||
this.getAllMarkers = function( ){
|
||||
return markers;
|
||||
}
|
||||
|
||||
this.clearFilter = function(){
|
||||
var m = l.getAllMarkers();
|
||||
for( i = 0; i < m.length; i++ ){
|
||||
m[i].marker.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
this.filterMarkers = function( categories ){
|
||||
var filtered = [],
|
||||
m = l.getAllMarkers();
|
||||
|
||||
for( i = 0; i < m.length; i++ ){
|
||||
m[i].marker.setVisible(false);
|
||||
}
|
||||
for( i = 0; i < categories.length; i++ ){
|
||||
filtered = filtered.concat(m.filter(function(a){return a.category_id == categories[i]}));
|
||||
}
|
||||
for( i = 0; i < filtered.length; i++ ){
|
||||
filtered[i].marker.setVisible(true);
|
||||
}
|
||||
return filtered;
|
||||
}
|
||||
initialize();
|
||||
|
||||
}
|
||||
|
||||
var InvalidObjectError = function(){
|
||||
this.name = "InvalidObjectError";
|
||||
this.message = "Object not valid";
|
||||
}
|
||||
|
||||
InvalidObjectError.prototype = new Error();
|
||||
InvalidObjectError.prototype.constructor = InvalidObjectError;
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
// Place all the behaviors and hooks related to the matching controller here.
|
||||
// All this logic will automatically be available in application.js.
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
class Panel::Location::BackEnd::LocationCategoriesController < OrbitBackendController
|
||||
def index
|
||||
@module_app_id = @module_app.id rescue nil
|
||||
@categories = get_categories_for_index
|
||||
@categories = @categories.page(params[:page]).per(10)
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @categories }
|
||||
end
|
||||
end
|
||||
|
||||
def list
|
||||
@module_app_id = @module_app.id rescue nil
|
||||
@categories = get_categories_for_index
|
||||
@categories = @categories.page(params[:page]).per(10)
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
end
|
||||
Vendored
+9
-1
@@ -2,8 +2,13 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
||||
include AdminHelper
|
||||
|
||||
def index
|
||||
@location_infos = LocationInfo.all
|
||||
@locations = LocationInfo.all
|
||||
@categories = get_categories_for_index
|
||||
@location_infos = [];
|
||||
@locations.each do |loc|
|
||||
loc['color'] = Category.find(loc.category_id).custom_value
|
||||
@location_infos << loc
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @locations }
|
||||
@@ -22,6 +27,8 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
||||
|
||||
def edit
|
||||
@location_info = LocationInfo.find(params[:id])
|
||||
@categories = get_categories_for_index
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@@ -34,6 +41,7 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
||||
|
||||
def create
|
||||
@location_info = LocationInfo.new(params[:location_info])
|
||||
@categories = get_categories_for_index
|
||||
if @location_info.save
|
||||
flash[:success] = "Success!!"
|
||||
redirect_to panel_location_back_end_locations_url
|
||||
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
class Panel::Location::FrontEnd::LocationsController < OrbitWidgetController
|
||||
def index
|
||||
@categories = @module_app.categories.enabled
|
||||
@locations = LocationInfo.all
|
||||
|
||||
@location_infos = [];
|
||||
@locations.each do |loc|
|
||||
loc['color'] = Category.find(loc.category_id).custom_value
|
||||
@location_infos << loc
|
||||
end
|
||||
end
|
||||
end
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
class Panel::Location::Widget::LocationsController < OrbitWidgetController
|
||||
def location_widget
|
||||
@categories = params[:category_id]
|
||||
locations = LocationInfo.where(:category_id.in => @categories)
|
||||
@url = "http://maps.googleapis.com/maps/api/staticmap?zoom=16&size=400x400&maptype=roadmap%20&sensor=false&"
|
||||
markers = ""
|
||||
locations.each do |loc|
|
||||
color = Category.find(loc.category_id).custom_value
|
||||
color.gsub!("#","")
|
||||
markers = markers + "markers=color:0x#{color}|#{loc.latitude},#{loc.longitude}&"
|
||||
end
|
||||
@url = @url + markers.chop
|
||||
# http://maps.googleapis.com/maps/api/staticmap?zoom=13&size=600x300&maptype=roadmap%20&markers=color:0xCF2C9B|40.702147,-74.015794&markers=color:CF2C9B|label:G|40.711614,-74.012318%20&markers=color:red|color:red|label:C|40.718217,-73.998284&sensor=false
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<tr class="<%= 'disable' if category.disable %>">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<td>
|
||||
<%= category.title_translations[locale] %>
|
||||
<% if i == 0 %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills">
|
||||
<% if is_admin?%>
|
||||
<li><%= link_to t(:edit), '#', class: "open-slide", data: {title: t(:edit_category), id: category.id.to_s, module: @module_app_id.to_s, form: category.title_translations.merge(color: category.custom_value)} %></li>
|
||||
<li><%= link_to show_toggle_archive_btn(category), toggle_admin_module_app_category_path(@module_app_id, category), method: :post, remote: true, class: "archive_toggle" %></li>
|
||||
<% end %>
|
||||
<% if is_manager? || is_admin? %>
|
||||
<li><%= link_to t(:category_auth), admin_authorizations_path(@module_app.key, 'category_authorization', category.id) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
<td><span class="badge" style="background-color: <%= category.custom_value %>;"><%= category.custom_value %></span></td>
|
||||
</tr>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<%= flash_messages %>
|
||||
<%= f.error_messages %>
|
||||
<%= label_tag("color", t("location.color")) %>
|
||||
<div class="input-append">
|
||||
<%= f.text_field :custom_value, id: "color", :class => "color-picker miniColors input-small", :size => "7", :maxlength => "7", :autocomplete=>"off",:value=>"9100FF" %>
|
||||
</div>
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<%= label_tag "name-#{locale}", "#{t(:name)} (#{I18nVariable.from_locale(locale)})" %>
|
||||
<%= f.text_field locale, :class => 'input-large', :value => (@category.title_translations[locale] rescue ''), placeholder: t(:name), id: locale %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<%= stylesheet_link_tag "jquery.miniColors" %>
|
||||
|
||||
<%= javascript_include_tag "jquery.miniColors.min" %>
|
||||
|
||||
<%= javascript_include_tag "admin/categories" %>
|
||||
|
||||
<div id="categories_index">
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr class="sort-header">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<th class="<%= 'span5' if i <= 1 %>"><a href="#"><%= t(:_locale, :locale => locale) %></a></th>
|
||||
<% end %>
|
||||
<th class="span2"><a href="#"><%= t('event_category.color') %></a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= render partial: 'category', collection: @categories %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %>
|
||||
</div>
|
||||
<div class="pagination pagination-centered">
|
||||
<%= paginate @categories unless @categories.blank? %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pageslide">
|
||||
<div class="page-title clearfix">
|
||||
<a class="pull-right" href="javascript:$.pageslide.close()">
|
||||
<i class="icons-arrow-left-2"></i>
|
||||
</a>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="view-page">
|
||||
<div class="nano">
|
||||
<div class="content">
|
||||
<%= form_for :category, url: nil, html:{:id=>"color"}, remote: true do |f| %>
|
||||
<fieldset>
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
<div class="form-actions">
|
||||
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
|
||||
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
if($('.color-picker').length > 0){
|
||||
$('.color-picker').miniColors(); // just in category view
|
||||
$('.miniColors-trigger').addClass('btn');
|
||||
}
|
||||
$("form#color").bind("ajax:complete",function(){
|
||||
$.get("<%= panel_location_back_end_location_categories_list_path %>",function(data){
|
||||
$("#categories_index").html(data);
|
||||
openSlide();
|
||||
})
|
||||
})
|
||||
</script>
|
||||
vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/list.html.erb
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr class="sort-header">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<th class="<%= 'span5' if i <= 1 %>"><a href="#"><%= t(:_locale, :locale => locale) %></a></th>
|
||||
<% end %>
|
||||
<th class="span2"><a href="#"><%= t('location_category.color') %></a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= render partial: 'category', collection: @categories %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %>
|
||||
</div>
|
||||
<div class="pagination pagination-centered">
|
||||
<%= paginate @categories unless @categories.blank? %>
|
||||
</div>
|
||||
</div>
|
||||
Vendored
+1
-1
@@ -19,8 +19,8 @@
|
||||
<div class="control-group">
|
||||
<label class="control-label" for=""><%= t 'coordinates' %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :latitude, :class=>"span2", :placeholder => "Latitude" %>
|
||||
<%= f.text_field :longitude, :class=>"span2", :placeholder => "Longitude" %>
|
||||
<%= f.text_field :latitude, :class=>"span2", :placeholder => "Langitude" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Vendored
+40
@@ -1,3 +1,5 @@
|
||||
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
|
||||
<%= javascript_include_tag "location" %>
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -28,6 +30,44 @@
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
Categories :
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<% @categories.each do |category| %>
|
||||
<button class="btn cat-filter" data-category='<%= category.id %>'><%= category.title %></button>
|
||||
<% end %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" id="clear_filter">Clear Filter</a>
|
||||
<div id="map" style="width: 100%; height: 500px;"></div>
|
||||
<%if is_manager? %>
|
||||
<td><%= link_to 'Add', new_panel_location_back_end_location_path, :class => "btn btn-primary pull-right", :id=>"create_event_btn", :ref=>"add-btn"%></td>
|
||||
<% end %>
|
||||
<script>
|
||||
|
||||
var loc = new Locations(<%= @location_infos.to_json.html_safe %>);
|
||||
jQuery(document).ready(function($) {
|
||||
var filterCategories = [];
|
||||
$("button.cat-filter").bind( clickEvent,function(){
|
||||
var catid = $( this ).data('category');
|
||||
|
||||
if ( $( this ).hasClass('active') ){
|
||||
$( this ).removeClass('active');
|
||||
var index = filterCategories.indexOf(filterCategories.filter(function(a,i){ return a == catid })[0]);
|
||||
filterCategories.splice( index, 1 );
|
||||
}else{
|
||||
$( this ).addClass('active');
|
||||
filterCategories.push( catid );
|
||||
}
|
||||
loc.filterMarkers(filterCategories);
|
||||
})
|
||||
|
||||
$("a#clear_filter").bind( clickEvent, function(){
|
||||
filterCategories = [];
|
||||
$("button.cat-filter").removeClass('active');
|
||||
loc.clearFilter();
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
<%= javascript_include_tag "location" %>
|
||||
<div>
|
||||
Categories :
|
||||
<% @categories.each do |category| %>
|
||||
<input type="checkbox" class="btn cat-filter" data-category='<%= category.id %>' /><%= category.title %>
|
||||
<% end %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" id="clear_filter">Clear Filter</a>
|
||||
<div id="map" style="width: 100%; height: 500px;"></div>
|
||||
<script>
|
||||
var loc = null;
|
||||
var initialize = function(){
|
||||
loc = new Locations(<%= @location_infos.to_json.html_safe %>);
|
||||
}
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
var filterCategories = [];
|
||||
$("input.cat-filter").bind( "click",function(){
|
||||
var catid = $( this ).data('category');
|
||||
|
||||
if ( !$( this ).is(':checked') ){
|
||||
|
||||
var index = filterCategories.indexOf(filterCategories.filter(function(a,i){ return a == catid })[0]);
|
||||
filterCategories.splice( index, 1 );
|
||||
}else{
|
||||
|
||||
filterCategories.push( catid );
|
||||
}
|
||||
loc.filterMarkers(filterCategories);
|
||||
})
|
||||
|
||||
$("a#clear_filter").bind( "click", function(){
|
||||
filterCategories = [];
|
||||
$("input.cat-filter").prop('checked',false);
|
||||
loc.clearFilter();
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
<script src="http://maps.google.com/maps/api/js?sensor=true&callback=initialize"></script>
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
<a href="<%= panel_location_front_end_locations_path %>" >
|
||||
<%= image_tag @url, :width=>"300", :height=>"300" %>
|
||||
</a>
|
||||
+8
-1
@@ -2,12 +2,19 @@ Rails.application.routes.draw do
|
||||
namespace :panel do
|
||||
namespace :location do
|
||||
namespace :back_end do
|
||||
|
||||
match 'location_categories/list' => "location_categories#list"
|
||||
resources :location_categories
|
||||
match "locations/get_locations" => "locations#get_locations"
|
||||
match "locations/get_categories" => "locations#get_categories"
|
||||
|
||||
resources :locations
|
||||
end
|
||||
namespace :front_end do
|
||||
resources :locations
|
||||
end
|
||||
namespace :widget do
|
||||
match "location_widget" => "locations#location_widget"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
+21
-13
@@ -4,15 +4,17 @@ module Location
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
# personal_plugin :enable => true,:path=>"panel/location/plugin/profile",:i18n=>'admin.location'
|
||||
|
||||
# version "0.1"
|
||||
# organization "Rulingcom"
|
||||
# author "RD dep"
|
||||
# intro "I am intro"
|
||||
# update_info 'some update_info'
|
||||
version "0.1"
|
||||
organization "Rulingcom"
|
||||
author "RD dep"
|
||||
intro "I am intro"
|
||||
update_info 'some update_info'
|
||||
|
||||
# front_end do
|
||||
# app_page 'bulletins'
|
||||
# end
|
||||
front_end do
|
||||
app_page 'locations' do
|
||||
frontend_i18n 'location.location'
|
||||
end
|
||||
end
|
||||
|
||||
# category ["BulletinCategory"]
|
||||
|
||||
@@ -33,31 +35,37 @@ module Location
|
||||
|
||||
categorizable
|
||||
authorizable
|
||||
|
||||
widgets do
|
||||
customize_widget "location_widget" do
|
||||
widget_i18n "location.location"
|
||||
end
|
||||
end
|
||||
|
||||
side_bar do
|
||||
head_label_i18n 'location.location',:icon_class=>"icons-location"
|
||||
available_for [:admin,:guest,:manager,:sub_manager]
|
||||
active_for_controllers ({:private=>['locations']})
|
||||
active_for_controllers ({:private=>['locations','location_categories']})
|
||||
|
||||
head_link_path "panel_location_back_end_locations_path"
|
||||
|
||||
context_link 'location.all_locations',
|
||||
:link_path=>"panel_location_back_end_locations_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{:localtions=>:index},
|
||||
:active_for_action=>{:locations=>:index},
|
||||
:available_for => [:manager]
|
||||
|
||||
context_link 'location.add_location',
|
||||
:link_path=>"new_panel_location_back_end_location_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{:localtions=>:new},
|
||||
:active_for_action=>{:locations=>:new},
|
||||
:available_for => [:manager]
|
||||
|
||||
|
||||
context_link 'location.categories',
|
||||
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
|
||||
:link_path=>"panel_location_back_end_location_categories_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{:localtion_categories=>:index},
|
||||
:active_for_category => 'Location',
|
||||
:available_for => [:manager]
|
||||
|
||||
end
|
||||
|
||||
Vendored
+16
-11
@@ -27,22 +27,27 @@ 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_list_categorys = RoleCategory.where(:role_id => @role_id,disable: false).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 }
|
||||
|
||||
@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_status = RoleStatus.can_display.where(:role_id => @role_id).asc("key")
|
||||
# @member_lists = User.where(:role_ids => @role_id)
|
||||
@member_lists = ''
|
||||
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
|
||||
|
||||
Vendored
+15
-10
@@ -1,5 +1,9 @@
|
||||
<% # 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>
|
||||
@@ -8,7 +12,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) ? 'active' : '' %>"><a href="?&mcid=<%= mc.id %>"><%= mc.title %></a></li>
|
||||
<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 %>
|
||||
@@ -17,6 +21,8 @@
|
||||
|
||||
<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 %>
|
||||
@@ -30,11 +36,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 = show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"teacher","job_title").get_value_by_locale(I18n.locale))
|
||||
<% @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">
|
||||
<%= @member_lists.get_member_list_attribute_field_name("teacher","job_title") %></b>
|
||||
<%= @job_title_field.title %></b>
|
||||
<%= @job_title %>
|
||||
</li>
|
||||
<% end %>
|
||||
@@ -55,12 +61,10 @@
|
||||
|
||||
<% 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 %>
|
||||
@@ -74,10 +78,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 = show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"teacher","job_title").get_value_by_locale(I18n.locale))
|
||||
<% @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"><%= @member_lists.get_member_list_attribute_field_name("teacher","job_title") %></b><%= @job_title %></li>
|
||||
<li><b class="o-members-label"><%= @job_title_field.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>
|
||||
@@ -98,5 +102,6 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%#= stylesheet_link_tag "member/members" %>
|
||||
<%= stylesheet_link_tag "member/members" %>
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<%= render :partial=> "show_roles",:collection=>@member.roles.asc(:created_at) %>
|
||||
<%= render :partial=> "show_roles",:collection=>@member.roles.where(:disabled=>false).asc(:created_at) %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
+31
-1
@@ -8,6 +8,36 @@
|
||||
.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;
|
||||
@@ -107,4 +137,4 @@
|
||||
font-size: 16px;
|
||||
margin: 0;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
+15
-7
@@ -27,17 +27,25 @@ 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")
|
||||
|
||||
if !params[:category_id].blank?
|
||||
@member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key")
|
||||
@member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key")
|
||||
|
||||
@member_lists = User.where(:role_ids => @role_id)
|
||||
@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
|
||||
else
|
||||
@member_status = RoleStatus.can_display.where(:role_id => @role_id).asc("key")
|
||||
|
||||
@member_lists = User.where(:role_ids => @role_id)
|
||||
|
||||
# @member_lists = User.where(:role_ids => @role_id)
|
||||
@member_lists = ''
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
+93
-28
@@ -1,29 +1,61 @@
|
||||
<% # 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' %>
|
||||
<% if @item.frontend_style == 'Single' or @item.frontend_style == 'Two' %>
|
||||
|
||||
<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.get_role_member_data_by_sort(ms.id).each do |member| %>
|
||||
<% @member_lists.where(:role_status_ids=>ms.id).each do |member| %>
|
||||
|
||||
<li class="odd">
|
||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<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>
|
||||
<% @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"><%= 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>
|
||||
<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>
|
||||
|
||||
<% @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 %>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -33,34 +65,47 @@
|
||||
|
||||
<% 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.get_role_member_data_by_sort(ms.id).each_with_index do |member, i| %>
|
||||
<% @member_lists.where(:role_status_ids=>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">
|
||||
<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>
|
||||
<% @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"><%= 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>
|
||||
<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>
|
||||
|
||||
|
||||
<% @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 %>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -70,47 +115,64 @@
|
||||
|
||||
<% 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"><%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %></span></td>
|
||||
<td><span class="job_title"><%= @job_title_field.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"><%= @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>
|
||||
<td><span class="business"><%= @job_business_field.title %></span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<% @member_lists.get_role_member_data_by_sort(ms.id).each_with_index do |member, i| %>
|
||||
<% @member_lists.where(:role_status_ids=>ms.id).each_with_index do |member, i| %>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<span class="job_title">
|
||||
<%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title").get_value_by_locale(I18n.locale)) rescue '' %>
|
||||
<% @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 %>
|
||||
</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">
|
||||
<%= 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 '' %>
|
||||
<% @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 %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -121,9 +183,12 @@
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= stylesheet_link_tag "member_staff/members" %>
|
||||
<%= stylesheet_link_tag "member_staff/members" %>
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
quick_edit_link type: 'edit',
|
||||
link: 'edit_panel_page_content_back_end_page_context_path'
|
||||
quick_edit_link type: 'authorization',
|
||||
link: "admin_authorizations_path(@module_app.key, 'page_context', object.id)"
|
||||
link: "admin_authorizations_path(@module_app.key, 'page_context_authorization', object.id)"
|
||||
field type: 'associated',
|
||||
db_field: 'page',
|
||||
model_field: 'path',
|
||||
|
||||
Reference in new issue
Block a user