member plugin edit
This commit is contained in:
commit
bc44d38948
319 files changed
+5405
-2763
No files matched your search
@@ -15,4 +15,3 @@
|
||||
//= require orbitTimeline
|
||||
//= require orbitdesktop
|
||||
//= require desktop/books_pages
|
||||
//= require desktop/seminar_pages
|
||||
@@ -1,58 +0,0 @@
|
||||
orbitDesktop.prototype.initializeSeminar = function(target,url,cache){
|
||||
|
||||
this.initializeSeminar.list = function(){
|
||||
var bindHandlers = function(){
|
||||
o.tinyscrollbar_ext({
|
||||
main : ".tinycanvas",
|
||||
fill : ".list_t"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
bindHandlers();
|
||||
|
||||
}
|
||||
|
||||
this.initializeSeminar.addseminar = function(){
|
||||
var bindHandlers = function(){
|
||||
o.simple_drop_down();
|
||||
|
||||
o.tinyscrollbar_ext({
|
||||
main: '.tinycanvas',
|
||||
fill: '.s_grid_con'
|
||||
})
|
||||
}
|
||||
|
||||
bindHandlers();
|
||||
|
||||
}
|
||||
this.initializeSeminar.seminar = function(){
|
||||
var bindHandlers = function(){
|
||||
o.simple_drop_down();
|
||||
|
||||
o.tinyscrollbar_ext({
|
||||
main: '.tinycanvas',
|
||||
fill: '.s_grid_con'
|
||||
})
|
||||
}
|
||||
|
||||
bindHandlers();
|
||||
|
||||
}
|
||||
this.initializeSeminar.rues = function(){
|
||||
var bindHandlers = function(){
|
||||
o.simple_drop_down();
|
||||
|
||||
o.tinyscrollbar_ext({
|
||||
main: '.tinycanvas',
|
||||
fill: '.s_grid_con'
|
||||
})
|
||||
}
|
||||
|
||||
bindHandlers();
|
||||
|
||||
}
|
||||
|
||||
this.initializeSeminar.list();
|
||||
|
||||
}
|
||||
@@ -25,8 +25,8 @@ $('#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:'scrollLeft',
|
||||
timeout: 6000,
|
||||
fx: $effect,
|
||||
timeout: $timeout
|
||||
});
|
||||
$(".newlist").css({
|
||||
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
||||
@@ -40,8 +40,9 @@ $('#index').live('pageinit',function(){
|
||||
$('#announcement_content').live('pageinit',function(){
|
||||
$(this).find(".newpic img").muImageResize({width: 320, height: 220});
|
||||
});
|
||||
var mobileDemo = { 'center': '24.987449, 121.576117', 'zoom': 17 };
|
||||
|
||||
$('#map').live('pageinit', function() {
|
||||
var mobileDemo = { 'center': $map_center, 'zoom': $map_zoom };
|
||||
var $windowH = $(window).height();
|
||||
$("#map_canvas").css({
|
||||
'height' : $windowH,
|
||||
@@ -50,7 +51,7 @@ $('#map').live('pageinit', function() {
|
||||
$('#map_canvas').gmap({'center': mobileDemo.center, 'zoom': mobileDemo.zoom, 'disableDefaultUI':false, 'callback': function() {
|
||||
var self = this;
|
||||
self.addMarker({'position': this.get('map').getCenter() }).click(function() {
|
||||
self.openInfoWindow({ 'content': "<%= I18n.t('mobile.location_description') %>" }, this);
|
||||
self.openInfoWindow({ 'content': $info }, this);
|
||||
});
|
||||
}});
|
||||
}).load('basic_map');
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
//= require jquery.form
|
||||
//= require bootstrap
|
||||
//= require jquery.masonry.min
|
||||
//= require jquery.isotope.min
|
||||
//= require jquery.tinyscrollbar.min
|
||||
//= require orbit-1.0
|
||||
//= require tinymce-jquery
|
||||
|
||||
@@ -1,28 +1,42 @@
|
||||
$(document).on('click', '.orbit-bar-search', function (){
|
||||
if ($(this).parents('.search').hasClass('visible')){
|
||||
$(this).parents('.search').stop().animate({
|
||||
'width':'28px',
|
||||
},500);
|
||||
$('.navbar-search').stop().animate({
|
||||
'left':'30px',
|
||||
'opacity':'0',
|
||||
},200);
|
||||
$(this).parents('.search').css({
|
||||
'background-color': 'transparent',
|
||||
});
|
||||
$(this).parents('.search').removeClass('visible');
|
||||
}
|
||||
else{
|
||||
$(this).parents('.search').stop().animate({
|
||||
'width':'265px',
|
||||
},200);
|
||||
$('.navbar-search').stop().animate({
|
||||
'left':'7px',
|
||||
'opacity':'1'
|
||||
},500);
|
||||
$(this).parents('.search').css({
|
||||
'background-color': 'rgba(0, 0, 0, 0.5)',
|
||||
});
|
||||
$(this).parents('.search').addClass('visible');
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.search').tooltip({
|
||||
placement: "bottom"
|
||||
});
|
||||
});
|
||||
$(document).on('mouseenter', '.orbit-bar-search', function (){
|
||||
$(this).parents('.search').stop().animate({
|
||||
'width':'265px',
|
||||
},200);
|
||||
$('.navbar-search').stop().animate({
|
||||
'left':'4px',
|
||||
'opacity':'1'
|
||||
},500);
|
||||
$(this).parents('.search').css({
|
||||
'background-color': 'rgba(0, 0, 0, 0.5)',
|
||||
});
|
||||
$(this).parents('.search').addClass('visible');
|
||||
});
|
||||
|
||||
|
||||
$(document).on('mouseleave', '.search.visible', function (){
|
||||
$(this).stop().animate({
|
||||
'width':'28px',
|
||||
},500);
|
||||
$('.navbar-search').stop().animate({
|
||||
'left':'30px',
|
||||
'opacity':'0',
|
||||
},200);
|
||||
$(this).css({
|
||||
'background-color': 'transparent',
|
||||
});
|
||||
$(this).removeClass('visible');
|
||||
});
|
||||
|
||||
$(document).on("mouseenter",".orbit-bar-language, .language-menu",function(){
|
||||
$(this).parents('.language').addClass("open")
|
||||
})
|
||||
|
||||
$(document).on("mouseleave",".orbit-bar-language, .language-menu",function(){
|
||||
$(this).parents('.language').removeClass("open")
|
||||
})
|
||||
@@ -1,5 +1,11 @@
|
||||
function get_part_id(){
|
||||
return $(".edit_page_part").attr("action").split('/').pop();
|
||||
return $(".edit_page_part,.edit_page").attr("action").split('/').pop();
|
||||
}
|
||||
|
||||
function get_object_path(){
|
||||
a = window.location.href.split('/');
|
||||
a.pop();
|
||||
return a.join('/');
|
||||
}
|
||||
|
||||
$("div.editable").live("mouseenter mouseleave", function (event) {
|
||||
@@ -10,26 +16,26 @@ $("#page_design").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
|
||||
});
|
||||
|
||||
$("#page_module_app_id").live('change', function() {
|
||||
var app_id = $(this).val();
|
||||
if(app_id!=''){
|
||||
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_frontend_pages',function(data, textStatus){
|
||||
if(textStatus == 'success'){
|
||||
$(this).after(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
$("#app_page_url").children().remove();
|
||||
}
|
||||
});
|
||||
// $("#page_module_app_id").live('change', function() {
|
||||
// var app_id = $(this).val();
|
||||
// if(app_id!=''){
|
||||
// $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_after_module_changed',function(data, textStatus){
|
||||
// if(textStatus == 'success'){
|
||||
// $(this).after(data);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// else{
|
||||
// $("#app_page_url").children().remove();
|
||||
// }
|
||||
// });
|
||||
|
||||
$("#module_app_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_widgets?part_id=' + get_part_id());
|
||||
$.getScript(get_object_path() + '/reload_after_module_changed?module_app_id='+$(this).val()); //?part_id=' + get_part_id());
|
||||
});
|
||||
|
||||
$("#widget_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_widget_styles?module_app_id=' + $("#module_app_list select").val() + '&part_id=' + get_part_id());
|
||||
$("#widget_list select,#frontend_list select").live('change', function() {
|
||||
$.getScript(get_object_path() +'/reload_after_list_changed?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() );//+ '&part_id=' + get_part_id());
|
||||
});
|
||||
|
||||
$("#tag_list select").live('change', function() {
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//= require jquery.ui.sortable
|
||||
//= require jquery_ujs
|
||||
//= require bootstrap
|
||||
//= require jquery.isotope.min
|
||||
//= require jquery.tinyscrollbar.min
|
||||
//= require orbit-1.0
|
||||
//= require orbit-bar-search
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
label{
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
.style_switch{}
|
||||
|
||||
.style_switch ul{}
|
||||
.style_switch ul{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.style_switch li{
|
||||
float: left;
|
||||
@@ -9,19 +14,22 @@
|
||||
width: 103px;
|
||||
}
|
||||
.style_radio{
|
||||
margin: 0 0 5px 10px;
|
||||
cursor: pointer;
|
||||
margin: 0 0 0 10px;
|
||||
}
|
||||
.style_img{
|
||||
display: block;
|
||||
margin: 0 0 5px;
|
||||
margin: 5px 0 5px -28px;
|
||||
}
|
||||
|
||||
.style_description{
|
||||
color: #6B6B6B;
|
||||
display: block;
|
||||
margin: 0 0 0 5px;
|
||||
font-size: 12px;
|
||||
margin: 0 0 0 -25px;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
label{
|
||||
white-space: nowrap !important ;
|
||||
}
|
||||
white-space: nowrap !important ;
|
||||
}
|
||||
@@ -13,7 +13,6 @@
|
||||
*= require list
|
||||
*= require widget
|
||||
*= require scroll_style
|
||||
*= require isotope
|
||||
*= require icons
|
||||
*= require site-map
|
||||
*= require lib/bootstrap-datetimepicker
|
||||
|
||||
@@ -9,32 +9,6 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
end
|
||||
|
||||
|
||||
def reload_frontend_pages
|
||||
@categories =[]
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
|
||||
@frontend_path = @module_app.widgets.keys[0] if ( !@module_app.widgets.blank? && @module_app.widgets[0].blank? )
|
||||
|
||||
@frontend_style = @module_app.widgets[@frontend_path] if ( !@frontend_path.blank? )
|
||||
|
||||
case @module_app.key
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'news'
|
||||
@categories = NewsBulletinCategory.all
|
||||
@tags = NewsTag.all
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
@tags = WebResourceTag.all
|
||||
when 'archive'
|
||||
@categories = ArchiveFileCategory.all
|
||||
@tags = ArchiveTag.all
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
def module_auth_proc
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
@@ -136,7 +110,6 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
end
|
||||
#user is not permited to do that
|
||||
flash[:notice] = t('app_auth.operation_not_permitted')
|
||||
render :nothing => true, :status => 403
|
||||
end
|
||||
|
||||
render :nothing => true,:status => 403
|
||||
end
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::ObjectAuthsController < ApplicationController
|
||||
include OrbitCoreLib::PermissionUnility
|
||||
include OrbitCoreLib::PermissionUtility
|
||||
layout "new_admin"
|
||||
before_filter :force_order
|
||||
# before_filter :is_admin? ,:only => :index
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
|
||||
include OrbitCoreLib::PermissionUnility
|
||||
include OrbitCoreLib::PermissionUtility
|
||||
before_filter :force_order
|
||||
|
||||
|
||||
def set_module_app
|
||||
@module_app = ModuleApp.where(:title=>'Announcement').first
|
||||
end
|
||||
|
||||
|
||||
def setting
|
||||
@sys_users = User.all(conditions: {admin: false}).includes(:avatar).not_guest_user
|
||||
@@ -59,6 +63,7 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
|
||||
|
||||
def force_order
|
||||
authenticate_user!
|
||||
set_module_app
|
||||
setup_vars
|
||||
check_if_user_can_do_object_auth
|
||||
end
|
||||
|
||||
@@ -25,31 +25,28 @@ class Admin::PagePartsController < ApplicationController
|
||||
def edit
|
||||
@part = PagePart.find(params[:id])
|
||||
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
|
||||
@module_app = @part.module_app ? @part.module_app : @module_apps[0]
|
||||
@module_app = @part.module_app ? @part.module_app : nil
|
||||
@user_choose = @part.widget_path
|
||||
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
|
||||
@tag_objects = @r_tag.classify.constantize.all rescue nil
|
||||
|
||||
if @module_app
|
||||
@widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0]
|
||||
@widget_style = @module_app.get_widget_style[@widget_path][:style] unless @widget_path.nil? or @module_app.nil?
|
||||
end
|
||||
|
||||
|
||||
unless @module_app.nil?
|
||||
@categories = @module_app.get_categories
|
||||
@tags = @module_app.get_tags
|
||||
end
|
||||
|
||||
@widget_path = @part.widget_path ? @part.widget_path : (@module_app.widgets.keys[0] rescue nil)
|
||||
|
||||
@widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0]
|
||||
|
||||
if @module_app.widgets.any?{|b| b.class == Array}
|
||||
if @module_app && @module_app.widgets.any?{|b| b.class == Array}
|
||||
@widget_style = @module_app.widgets[@widget_path] if !@widget_path.blank? && !@module_app.widgets.blank?
|
||||
end
|
||||
|
||||
case @module_app.key
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'gallery'
|
||||
@albums = GalleryAlbum.all
|
||||
@tags = []
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
@tags = WebResourceTag.all
|
||||
when 'archive'
|
||||
@categories = ArchiveFileCategory.all
|
||||
@tags = ArchiveTag.all
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -59,9 +56,12 @@ class Admin::PagePartsController < ApplicationController
|
||||
def update
|
||||
@part = PagePart.find(params[:id])
|
||||
|
||||
params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type] ) if params[:page_part][:widget_field]
|
||||
params[:page_part][:widget_field_type] = nil
|
||||
|
||||
params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type] ) if params[:page_part][:widget_field]
|
||||
params[:page_part][:widget_field_type] = nil
|
||||
|
||||
if params[:page_part][:module_app].blank?
|
||||
params[:page_part][:module_app] = nil
|
||||
end
|
||||
if @part.update_attributes(params[:page_part])
|
||||
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
|
||||
flash.now[:notice] = t('update.success.content')
|
||||
@@ -91,30 +91,14 @@ class Admin::PagePartsController < ApplicationController
|
||||
end
|
||||
|
||||
def reload_widgets
|
||||
@part = PagePart.find params[:part_id]
|
||||
@categories =[]
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
|
||||
@widget_path = @module_app.widgets.keys[0] if ( @module_app.widgets[0].blank? )
|
||||
|
||||
@part = PagePart.find params[:id]
|
||||
@module_app = ModuleApp.find(params[:module_app_id]) rescue nil
|
||||
@categories =@module_app ? @module_app.get_categories : []
|
||||
@tags =@module_app ? @module_app.get_tags : []
|
||||
@widget_path = @module_app.widgets.keys[0] if (@module_app && @module_app.widgets[0].blank? )
|
||||
@widget_style = @module_app.widgets[@widget_path] if ( !@widget_path.blank? )
|
||||
|
||||
case @module_app.key
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'gallery'
|
||||
@albums = GalleryAlbum.all
|
||||
@tags = []
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
@tags = WebResourceTag.all
|
||||
when 'archive'
|
||||
@categories = ArchiveFileCategory.all
|
||||
@tags = ArchiveTag.all
|
||||
end
|
||||
|
||||
@part.widget_path = @module_app.widgets.first if @module_app.needs_to_widget_option?
|
||||
@part.widget_path = @module_app.widgets.first if( @module_app)
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
@@ -122,9 +106,11 @@ class Admin::PagePartsController < ApplicationController
|
||||
|
||||
def reload_widget_styles
|
||||
@module_app = ModuleApp.find(params[:module_app_id])
|
||||
@part = PagePart.find params[:part_id]
|
||||
@user_choose =@widget_path= params[:id]
|
||||
@widget_style = @module_app.widgets[params[:id]]
|
||||
|
||||
@part = PagePart.find params[:id]
|
||||
@user_choose =@widget_path= params[:frontend]
|
||||
@widget_style = @module_app.widgets[@widget_path]
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
|
||||
@@ -19,15 +19,21 @@ helper Admin::PagePartsHelper
|
||||
end
|
||||
|
||||
def edit
|
||||
@item = Page.find(params[:id])
|
||||
@item = @page =Page.find(params[:id])
|
||||
@user_choose = @item.app_frontend_url
|
||||
@apps = ModuleApp.excludes(app_pages: nil).entries
|
||||
|
||||
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
|
||||
|
||||
@designs = Design.all.entries
|
||||
@design = @item.design ? @item.design : @designs.first
|
||||
@app_frontend_urls = @item.module_app.app_pages if @item.module_app
|
||||
|
||||
|
||||
if @item.module_app
|
||||
@app_frontend_urls = @item.module_app.app_pages.map{|t| [I18n.t(t[0]),t[1]]}
|
||||
@app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if @item.module_app.has_default_widget?
|
||||
end
|
||||
|
||||
|
||||
if @item.module_app
|
||||
@module_app = @item.module_app
|
||||
|
||||
@@ -84,13 +90,13 @@ helper Admin::PagePartsHelper
|
||||
def update
|
||||
@item = Page.find(params[:id])
|
||||
|
||||
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
|
||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||
end
|
||||
|
||||
params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type] ) if params[:page][:frontend_field]
|
||||
params[:page][:frontend_field_type] = nil
|
||||
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
|
||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||
end
|
||||
|
||||
params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type] ) if params[:page][:frontend_field]
|
||||
params[:page][:frontend_field_type] = nil
|
||||
|
||||
if @item.update_attributes(params[:page])
|
||||
flash[:notice] = t('update.success.page')
|
||||
respond_to do |format|
|
||||
@@ -123,7 +129,42 @@ helper Admin::PagePartsHelper
|
||||
format.js { @item = @item.parent }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def reload_front_end_setting
|
||||
@page = Page.find params[:id]
|
||||
@module_app = ModuleApp.find params[:module_app_id]
|
||||
@chosen_frontend = @user_choose = params[:frontend]
|
||||
end
|
||||
|
||||
def reload_frontend_pages
|
||||
@page = Page.find params[:id] rescue nil
|
||||
# @categories =[]
|
||||
@module_app = ModuleApp.find(params[:module_app_id]) rescue nil
|
||||
@app_frontend_urls = @module_app.nil? ? nil : @module_app.app_pages.map{|t| [I18n.t(t[0]),t[1]]}
|
||||
@app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if(@module_app && @module_app.has_default_widget?)
|
||||
|
||||
case (@module_app.nil? ? nil : @module_app.key )
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'news'
|
||||
@categories = NewsBulletinCategory.all
|
||||
@tags = NewsTag.all
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
@tags = WebResourceTag.all
|
||||
when 'archive'
|
||||
@categories = ArchiveFileCategory.all
|
||||
@tags = ArchiveTag.all
|
||||
else
|
||||
@categories = []
|
||||
@tags = []
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
def reload_themes
|
||||
@design = Design.find(params[:id])
|
||||
@themes = @design.themes
|
||||
|
||||
@@ -4,7 +4,7 @@ class Admin::PluginsController < ApplicationController
|
||||
|
||||
def index
|
||||
|
||||
@plugins = OrbitApp::Module::Registration.all
|
||||
@plugins = OrbitApp::Plugin::Registration.all
|
||||
|
||||
if(!params[:show_plugin_profile].nil?)
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
|
||||
def show
|
||||
@user = User.find(params[:id])
|
||||
@plugins = OrbitApp::Module::Registration.all
|
||||
@plugins = OrbitApp::Plugin::Registration.all
|
||||
|
||||
@profile_data = []
|
||||
@teacher_data = []
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
class DefaultWidgetController< OrbitWidgetController
|
||||
|
||||
def front_end_available(var)
|
||||
@page_part = PagePart.find params[:part_id]
|
||||
@page_part = case params[:item_type]
|
||||
when "page"
|
||||
Page.find params[:page_id]
|
||||
when "page_part"
|
||||
PagePart.find params[:part_id]
|
||||
end
|
||||
@page_part.module_app.enable_frontend?
|
||||
end
|
||||
|
||||
@@ -9,11 +14,17 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
@tag_class = nil
|
||||
|
||||
@default_widget = @page_part.module_app.get_default_widget
|
||||
@widget_image_field = @default_widget[:image]
|
||||
data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
||||
@widget_image_field = @default_widget["image"] || @default_widget[:image]
|
||||
data_limit = case @page_part
|
||||
when Page
|
||||
@fields = @page_part.frontend_field
|
||||
@page_part.frontend_data_count.is_a?(Fixnum) ? @page_part.frontend_data_count : (@page_part.frontend_data_count.to_i rescue 3)
|
||||
when PagePart
|
||||
@fields = @page_part.widget_field
|
||||
@page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
||||
end
|
||||
@data = eval(@default_widget["query"]).limit(data_limit).includes(@widget_image_field)
|
||||
@fields = @page_part.widget_field
|
||||
|
||||
|
||||
case params[:type]
|
||||
when "typeA"
|
||||
@tag_class = 'default_widget_typeA'
|
||||
@@ -26,15 +37,6 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
render "typeC"
|
||||
end
|
||||
|
||||
# {"inner"=>"true",
|
||||
# "category_id"=>"false",
|
||||
# "tag_id"=>"",
|
||||
# "page"=>"",
|
||||
# "search_query"=>"",
|
||||
# "part_title"=>"",
|
||||
# "part_id"=>"50ac426f83e75219d20000a7",
|
||||
# "controller"=>"default_widget",
|
||||
# "action"=>"default_widget",
|
||||
# "type"=>"typeA"}
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,75 +0,0 @@
|
||||
class DesktopPublicationsController< ApplicationController
|
||||
def journal_p
|
||||
render "desktop/journal_p", :layout => false
|
||||
end
|
||||
|
||||
def journal_p_list
|
||||
render "desktop/journal_pages/list", :layout => false
|
||||
end
|
||||
|
||||
def journal_p_add
|
||||
debugger
|
||||
render "desktop/journal_pages/add", :layout => false
|
||||
end
|
||||
|
||||
def books
|
||||
render "desktop/books", :layout => false
|
||||
end
|
||||
|
||||
def books_list
|
||||
render "desktop/books/list", :layout => false
|
||||
end
|
||||
|
||||
def books_add
|
||||
render "desktop/books/add", :layout => false
|
||||
end
|
||||
|
||||
def seminar_p
|
||||
render "desktop/seminar_p", :layout => false
|
||||
end
|
||||
|
||||
def seminar_p_list
|
||||
render "desktop/seminar_pages/list", :layout => false
|
||||
end
|
||||
|
||||
def seminar_p_add
|
||||
render "desktop/seminar_pages/add", :layout => false
|
||||
end
|
||||
|
||||
def create_journal
|
||||
Journal.create(user_id: current_user.id, title: "Ice Cream Sandwich")
|
||||
b = Array.new
|
||||
b << {"success"=>"true"}
|
||||
render :json=>b.to_json
|
||||
end
|
||||
|
||||
def getjournals
|
||||
@journals = current_user.journals
|
||||
data = Array.new
|
||||
@journals.each do |journal|
|
||||
@papers = journal.papers.all
|
||||
data << {"title" => journal.title, "papers" => @papers}
|
||||
end
|
||||
render :json=>data.to_json
|
||||
end
|
||||
|
||||
def delete_journal
|
||||
@journals = Journal.find("")
|
||||
@journals.delete
|
||||
b = Array.new
|
||||
b << {"success"=>"true"}
|
||||
render :json=>b.to_json
|
||||
end
|
||||
|
||||
def update_journal
|
||||
@journal = Journal.find("4ff2d6ebbd98eb02b9000017")
|
||||
@papers = @journal.papers
|
||||
@papers.each do |paper|
|
||||
paper.update_attributes(:user_id => current_user.id)
|
||||
end
|
||||
b = Array.new
|
||||
|
||||
b << {"success"=>"true"}
|
||||
render :json=>b.to_json
|
||||
end
|
||||
end
|
||||
@@ -1,10 +1,6 @@
|
||||
require 'mime/types'
|
||||
|
||||
class DesktopPublicationsController< ApplicationController
|
||||
#def journal_p
|
||||
# render "desktop/journal_p", :layout => false
|
||||
#end
|
||||
|
||||
def books
|
||||
render "desktop/books", :layout => false
|
||||
end
|
||||
@@ -16,44 +12,4 @@ class DesktopPublicationsController< ApplicationController
|
||||
def books_add
|
||||
render "desktop/books/add", :layout => false
|
||||
end
|
||||
|
||||
def seminar_p
|
||||
render "desktop/seminar_p", :layout => false
|
||||
end
|
||||
|
||||
def seminar_p_list
|
||||
render "desktop/seminar_pages/list", :layout => false
|
||||
end
|
||||
|
||||
def seminar_p_add
|
||||
render "desktop/seminar_pages/add", :layout => false
|
||||
end
|
||||
|
||||
# def create_journal
|
||||
# Journal.create(user_id: current_user.id, title: "Ice Cream Sandwich")
|
||||
# b = Array.new
|
||||
# b << {"success"=>"true"}
|
||||
# render :json=>b.to_json
|
||||
# end
|
||||
#
|
||||
#
|
||||
# def delete_journal
|
||||
# @journals = Journal.find("")
|
||||
# @journals.delete
|
||||
# b = Array.new
|
||||
# b << {"success"=>"true"}
|
||||
# render :json=>b.to_json
|
||||
# end
|
||||
#
|
||||
# def update_journal
|
||||
# @journal = Journal.find("4ff2d6ebbd98eb02b9000017")
|
||||
# @papers = @journal.papers
|
||||
# @papers.each do |paper|
|
||||
# paper.update_attributes(:user_id => current_user.id)
|
||||
# end
|
||||
# b = Array.new
|
||||
#
|
||||
# b << {"success"=>"true"}
|
||||
# render :json=>b.to_json
|
||||
# end
|
||||
end
|
||||
@@ -1,10 +1,6 @@
|
||||
class OrbitBackendController < ApplicationController
|
||||
#before_filter :setup_vars
|
||||
#before_filter :set_current_user
|
||||
|
||||
# before_filter {|c| c.front_end_available(@app_title)}
|
||||
# before_filter :check_user_can_use
|
||||
include OrbitCoreLib::PermissionUnility
|
||||
include OrbitCoreLib::AppBackendUtility
|
||||
include OrbitCoreLib::PermissionUtility
|
||||
include AdminHelper
|
||||
include ApplicationHelper
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
class OrbitFrontendController< OrbitFrontendComponentController
|
||||
|
||||
|
||||
end
|
||||
@@ -1,3 +1,4 @@
|
||||
class OrbitWidgetController< OrbitFrontendComponentController
|
||||
|
||||
|
||||
end
|
||||
@@ -10,43 +10,85 @@ module Admin::PagePartsHelper
|
||||
end
|
||||
|
||||
def widget_field_options(i,local_item=nil)
|
||||
local_item = @part if local_item.nil?
|
||||
options = @module_app.widget_fields.collect{|widget_field| [I18n.t(widget_field[1]), widget_field[0]]}
|
||||
options_for_select(options, (local_item[:widget_field][i][0] if (local_item && !local_item[:widget_field].blank? && !local_item[:widget_field][i].blank?)) )
|
||||
local_item = @part if local_item.nil? && @part
|
||||
local_item = @page if local_item.nil? && @page
|
||||
|
||||
options = @module_app.widget_fields.collect do |widget_field|
|
||||
label = I18n.t("#{@module_app.key}.default_widget.#{widget_field[0]}")
|
||||
[label, widget_field[0]]
|
||||
end
|
||||
|
||||
case local_item
|
||||
when Page
|
||||
options_for_select(options, (local_item[:frontend_field][i][0] if (local_item && !local_item[:frontend_field].blank? && !local_item[:frontend_field][i].blank?)) )
|
||||
when PagePart
|
||||
options_for_select(options, (local_item[:widget_field][i][0] if (local_item && !local_item[:widget_field].blank? && !local_item[:widget_field][i].blank?)) )
|
||||
end
|
||||
end
|
||||
|
||||
def widget_fiield_type_options(i,local_item=nil)
|
||||
options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
|
||||
local_item = @part if local_item.nil?
|
||||
options_for_select(options, (local_item[:widget_field][i][1] if (local_item && !local_item[:widget_field].blank? && !local_item[:widget_field][i].blank?)) )
|
||||
local_item = @part if local_item.nil? && @part
|
||||
local_item = @page if local_item.nil? && @page
|
||||
|
||||
case local_item
|
||||
when Page
|
||||
options_for_select(options, (local_item[:frontend_field][i][1] if (local_item && !local_item[:frontend_field].blank? && !local_item[:frontend_field][i].blank?)) )
|
||||
when PagePart
|
||||
options_for_select(options, (local_item[:widget_field][i][1] if (local_item && !local_item[:widget_field].blank? && !local_item[:widget_field][i].blank?)) )
|
||||
end
|
||||
end
|
||||
|
||||
def tag_checked_value(part,radio_value)
|
||||
part and (part[:tag] == radio_value) ? true : false
|
||||
if radio_value.blank?
|
||||
(part.nil? || part[:tag].blank?)? true : false
|
||||
else
|
||||
part and (part[:tag] == radio_value.to_s) ? true : false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def category_checked_value(part,radio_value)
|
||||
part and (part[:category] == radio_value) ? true : false
|
||||
if radio_value.blank?
|
||||
(part.nil? || part[:category].blank?)? true : false
|
||||
else
|
||||
part and (part[:category] == radio_value.to_s) ? true : false
|
||||
end
|
||||
end
|
||||
|
||||
def style_checked_value(part,radio_value)
|
||||
part and (part.widget_style == radio_value) ? true : false
|
||||
case part
|
||||
when Page
|
||||
if part.frontend_style.nil? && radio_value == "typeA"
|
||||
true
|
||||
else
|
||||
(part.frontend_style == radio_value) ? true : false
|
||||
end
|
||||
when PagePart
|
||||
if part.widget_style.nil? && radio_value == "typeA"
|
||||
true
|
||||
else
|
||||
(part.widget_style == radio_value) ? true : false
|
||||
end
|
||||
when nil
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def nil_radio_button(part,tag_or_cate)
|
||||
field_name = case part
|
||||
when PagePart
|
||||
'page_part'
|
||||
when Page
|
||||
'page'
|
||||
end
|
||||
content_tag :label,:class=>"radio inline" do
|
||||
op = radio_button("page_part", tag_or_cate, '' , :checked => eval("#{tag_or_cate}_checked_value(part,'')"))
|
||||
op = radio_button(field_name, tag_or_cate, '' , :checked => eval("#{tag_or_cate}_checked_value(part,'')"))
|
||||
op << I18n.t("default_widget.no_value")
|
||||
end
|
||||
end
|
||||
|
||||
def show_default_widget_setting_panel
|
||||
if @module_app.has_default_widget? && (!@user_choose.nil? && @user_choose== 'default_widget') #&& @part.widget_path == 'default_widget'
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
@module_app && @module_app.has_default_widget? && (!@user_choose.nil? && @user_choose== 'default_widget') #&& @part.widget_path == 'default_widget'
|
||||
end
|
||||
|
||||
def show_custom_widget_setting_panel
|
||||
|
||||
@@ -16,7 +16,7 @@ module AdminHelper
|
||||
end
|
||||
|
||||
def is_admin?
|
||||
current_or_guest_user.admin?
|
||||
current_or_guest_user.admin? rescue false
|
||||
end
|
||||
|
||||
def is_member?
|
||||
|
||||
@@ -54,8 +54,14 @@ module ApplicationHelper
|
||||
raw(formatted_messages.join)
|
||||
end
|
||||
|
||||
def link_back
|
||||
link_to t('back'), get_go_back, :class => 'nav'
|
||||
def link_back(custom_class=nil)
|
||||
case custom_class
|
||||
when nil
|
||||
link_to t('back'), get_go_back, :class => 'nav'
|
||||
else
|
||||
link_to t('back'), get_go_back, :class => custom_class
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Clean the link back
|
||||
@@ -197,7 +203,6 @@ module ApplicationHelper
|
||||
javascripts << "<script type='text/javascript' src='/static/jquery.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/bootstrap.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/jquery.tinyscrollbar.min.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/jquery.isotope.min.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-member.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n"
|
||||
|
||||
@@ -49,7 +49,8 @@ module DefaultWidgetHelper
|
||||
when nil
|
||||
eval method_entry
|
||||
else
|
||||
eval("#{method_entry}('#{object}')" )
|
||||
object = "'#{object.to_s}'" if object.class == BSON::ObjectId
|
||||
eval("#{method_entry}(#{object})" )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+3
-2
@@ -4,7 +4,8 @@ class Item
|
||||
include Mongoid::Timestamps
|
||||
include Mongoid::Tree
|
||||
include Mongoid::Tree::Ordering
|
||||
|
||||
LIST = YAML.load(File.read('config/list.yml'))
|
||||
|
||||
field :name
|
||||
field :path
|
||||
field :is_published, :type => Boolean, :default => false
|
||||
@@ -15,7 +16,7 @@ class Item
|
||||
|
||||
|
||||
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
|
||||
validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
|
||||
# validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
|
||||
validates_uniqueness_of :name, :scope => :parent_id
|
||||
validates_presence_of :name
|
||||
validates_associated :parent, :children
|
||||
|
||||
+107
-88
@@ -1,111 +1,130 @@
|
||||
class ModuleApp
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include OrbitCoreLib::ObjectTokenUnility
|
||||
include OrbitCoreLib::ObjectTokenUtility
|
||||
include OrbitApp::ModuleAppMembershipTools
|
||||
|
||||
field :key
|
||||
field :title
|
||||
field :version
|
||||
field :organization
|
||||
field :author
|
||||
field :intro
|
||||
field :update_info
|
||||
field :create_date
|
||||
field :enable_frontend, type: Boolean, :default => true
|
||||
field :sidebar_order#,type: Integer
|
||||
|
||||
def refetch_setting!(reg)
|
||||
# %w{module_label category base_url version organization author intro update_info create_date}.each do |field|
|
||||
# self[field.to_sym] = reg.send field
|
||||
# end
|
||||
self[:app_pages] = reg.get_app_pages
|
||||
self[:enable_frontend] = reg.get_enable_frontend
|
||||
self[:get_widget_style] = reg.get_widgets
|
||||
self[:using_default_widget] = !reg.get_default_widget.blank?
|
||||
self[:widgets] = reg.get_widgets
|
||||
end
|
||||
|
||||
|
||||
field :app_pages ,type: Array
|
||||
# field :widgets ,type: Array
|
||||
field :widgets ,type: Hash
|
||||
field :widget_fields ,type: Array
|
||||
field :widget_options,type:Hash
|
||||
field :widget_options_fields_i18n,type:Hash
|
||||
field :widget_fields_link_method,type:Hash
|
||||
field :get_default_widget,type:Hash
|
||||
# def app_pages
|
||||
# get_registration.get_app_pages
|
||||
# end
|
||||
|
||||
|
||||
def enable_frontend?
|
||||
self[:enable_frontend]
|
||||
end
|
||||
|
||||
def get_default_widget
|
||||
raise 'Need to link with OrbitApp [type: Array]'
|
||||
end
|
||||
|
||||
|
||||
def get_widget_for_select
|
||||
widgets = get_widget_style
|
||||
ary = widgets.collect do |k,v|
|
||||
if k == 'default_widget'
|
||||
[I18n.t('widget.default_widget'),'default_widget']
|
||||
else
|
||||
[I18n.t(v[:label]),k]
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# def get_widget_style
|
||||
# get_registration.get_widgets
|
||||
# end
|
||||
|
||||
def has_default_widget?
|
||||
self[:widgets].has_key? 'default_widget'
|
||||
end
|
||||
|
||||
def label
|
||||
I18n.t(label_i18n)
|
||||
end
|
||||
|
||||
def label_i18n
|
||||
reg = get_registration
|
||||
reg.nil? ? 'Init is not defined completely' : get_registration.get_label_i18n
|
||||
end
|
||||
|
||||
|
||||
# def needs_to_widget_option?
|
||||
# if self.widget_options
|
||||
# self.widget_options.has_key? widgets.first
|
||||
# else
|
||||
# false
|
||||
# end
|
||||
# end
|
||||
|
||||
def using_default_widget?
|
||||
# !get_registration.get_default_widget.blank?
|
||||
self[:get_default_widget]
|
||||
end
|
||||
|
||||
def widget_fields
|
||||
# binding.pry
|
||||
# raise 'Need to link with OrbitApp [type: Array]'
|
||||
get_registration.get_default_widget_fields
|
||||
end
|
||||
|
||||
# def widgets
|
||||
# # get_registration.get_widgets
|
||||
# # get_registration.get_default_widget
|
||||
# end
|
||||
|
||||
def widget_options(widget_path=nil)
|
||||
get_registration.get_widget_by_path(widget_path)
|
||||
# raise 'Need to link with OrbitApp [type: Hash]'
|
||||
end
|
||||
|
||||
def widget_options_fields_i18n
|
||||
raise 'Need to link with OrbitApp [type: Hash]'
|
||||
end
|
||||
|
||||
def widget_fields_link_method
|
||||
raise 'Need to link with OrbitApp [type: Hash]'
|
||||
end
|
||||
|
||||
|
||||
has_many :managers,as: :managing_app ,:class_name => "AppManager" ,:dependent => :destroy#,:foreign_key => "managing_app_id",:inverse_of => :managing_app
|
||||
has_many :sub_managers,as: :sub_managing_app ,:class_name => "AppManager", :dependent => :destroy#,:foreign_key => "sub_managing_app_id",:inverse_of => :sub_managing_app
|
||||
|
||||
has_many :tags
|
||||
# # has_many :tags
|
||||
has_many :page_parts
|
||||
has_many :pages
|
||||
|
||||
has_one :app_auth,dependent: :delete
|
||||
|
||||
before_save :set_key
|
||||
|
||||
def is_manager?(user)
|
||||
managing_users.include?(user)
|
||||
end
|
||||
|
||||
def is_sub_manager?(user)
|
||||
sub_managing_users.include?(user) || is_manager?(user)
|
||||
end
|
||||
|
||||
def managing_users
|
||||
self.managers.collect{ |t| t.user }
|
||||
end
|
||||
|
||||
def sub_managing_users
|
||||
self.sub_managers.collect{ |t| t.user }
|
||||
end
|
||||
|
||||
def assign_manager(user,assigner)
|
||||
manager = AppManager.first(conditions: {managing_app_id: self.id,user_id: user.id}) rescue nil
|
||||
if manager.nil?
|
||||
manager = self.managers.create(:user_id => user.id,:rule_creator_id => (assigner.id rescue nil))
|
||||
end
|
||||
manager
|
||||
end
|
||||
|
||||
def assign_sub_manager(user,assigner)
|
||||
submanager = AppManager.first(conditions: {sub_managing_app_id: self.id,user_id: user.id}) rescue nil
|
||||
if submanager.nil? && !self.managing_users.include?(user)
|
||||
submanager = self.sub_managers.create(:user_id => user.id,:rule_creator_id => (assigner.id rescue nil) )
|
||||
end
|
||||
submanager
|
||||
end
|
||||
|
||||
def remove_manager(user)
|
||||
manager = AppManager.first(conditions: {managing_app_id: self.id,user_id: user.id}) rescue nil
|
||||
if manager
|
||||
manager.destroy
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def remove_sub_manager(user)
|
||||
submanager = AppManager.first(conditions: {sub_managing_app_id: self.id,user_id: user.id}) rescue nil
|
||||
if submanager
|
||||
submanager.destroy
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def needs_to_widget_option?
|
||||
if self.widget_options
|
||||
self.widget_options.has_key? widgets.first
|
||||
else
|
||||
false
|
||||
end
|
||||
|
||||
def get_tags
|
||||
get_registration.get_tags
|
||||
end
|
||||
|
||||
def has_default_widget?
|
||||
case self[:widgets]
|
||||
when Array
|
||||
false
|
||||
when Hash
|
||||
self[:widgets].has_key? 'default_widget'
|
||||
end
|
||||
|
||||
def get_categories
|
||||
get_registration.get_categories
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def set_key
|
||||
self.key = self.title.underscore.singularize if self.title
|
||||
def module_name
|
||||
I18n.t(get_registration.get_label_i18n)
|
||||
end
|
||||
|
||||
def get_registration
|
||||
OrbitApp::Module::Registration.find_by_key(key)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
class ObjectAuth < PrototypeAuth
|
||||
include OrbitCoreLib::ObjectTokenUnility
|
||||
include OrbitCoreLib::ObjectTokenUtility
|
||||
validates_uniqueness_of :title ,:scope => [:obj_authable_type,:obj_authable_id] #{ |c| }
|
||||
belongs_to :obj_authable, polymorphic: true
|
||||
after_save :check_user_has_can_access_app
|
||||
|
||||
@@ -23,6 +23,15 @@ class PagePart
|
||||
before_save :delete_empty_widget_field
|
||||
after_save :update_parent
|
||||
|
||||
# def module_app
|
||||
# if self[:module_app]
|
||||
# self[:module_app]
|
||||
# elsif self[:kind] == 'module_widget'
|
||||
# self.page.module_app
|
||||
# else
|
||||
# nil
|
||||
# end
|
||||
# end
|
||||
|
||||
protected
|
||||
|
||||
@@ -37,5 +46,4 @@ class PagePart
|
||||
self.page.save
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -0,0 +1,61 @@
|
||||
class LocationUploader < CarrierWave::Uploader::Base
|
||||
|
||||
# Include RMagick or ImageScience support:
|
||||
# include CarrierWave::RMagick
|
||||
# include CarrierWave::ImageScience
|
||||
include CarrierWave::MiniMagick
|
||||
|
||||
# Choose what kind of storage to use for this uploader:
|
||||
# storage :file
|
||||
# storage :s3
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
"location/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
# def default_url
|
||||
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
||||
# end
|
||||
|
||||
# Process files as they are uploaded:
|
||||
# process :scale => [200, 300]
|
||||
#
|
||||
# def scale(width, height)
|
||||
# # do something
|
||||
# end
|
||||
|
||||
# Create different versions of your uploaded files:
|
||||
# version :thumb do
|
||||
# process :scale => [50, 50]
|
||||
# end
|
||||
|
||||
version :thumb do
|
||||
process :resize_to_fill => [150, 120]
|
||||
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
|
||||
# %w(jpg jpeg gif png)
|
||||
# end
|
||||
|
||||
# Override the filename of the uploaded files:
|
||||
# def filename
|
||||
# "something.jpg" if original_filename
|
||||
# end
|
||||
|
||||
# def manipulate!
|
||||
# raise current_path.inspect
|
||||
# image = ::MiniMagick::Image.open(current_path)
|
||||
# image = yield(image)
|
||||
# image.write(current_path)
|
||||
# ::MiniMagick::Image.open(current_path)
|
||||
# rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
|
||||
# raise CarrierWave::ProcessingError.new("Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: #{e}")
|
||||
# end
|
||||
|
||||
end
|
||||
|
||||
@@ -1 +1 @@
|
||||
<%= f.select :module_app_id, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
|
||||
<%= f.select :module_app_id, @apps.collect { |t| [t.module_name, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
|
||||
@@ -1,5 +0,0 @@
|
||||
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', @module_app.app_pages) %>");
|
||||
$('#app_page_frontend_style').html("<%= escape_javascript(select 'page', 'frontend_style', @module_app.widgets[@frontend_path]) if !@frontend_path.blank? %>");
|
||||
$('#app_page_category').html("<%= j (select 'page', 'category', @categories.collect{|category| [category.title, category.id]}, {:include_blank => true}) if @categories %>");
|
||||
$('#app_page_tag').html("<%= j (select 'page', 'tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, {:include_blank => true}) if @tags %>");
|
||||
$('#app_page_frontend_field').html("<%= j render '../admin/pages/frontend_fields' %>")
|
||||
@@ -1,12 +1,20 @@
|
||||
<div class="style_switch well">
|
||||
<label><%= t("default_widget.select_widget_style") %></label>
|
||||
<% if @module_app.widgets[@widget_path].blank? %>
|
||||
<%= t("default_widget.no_support_setting")%>
|
||||
<%else%>
|
||||
<%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]) %>
|
||||
<% end %>
|
||||
<% if(@module_app.widget_options && @module_app.widget_options.has_key?(@widget_path)) %>
|
||||
<label><%= t("default_widget.select_widget_ext_option") %></label>
|
||||
<%= render :partial=> "widget_ext_options" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="style_switch control-group">
|
||||
<label class="control-label">
|
||||
<%= t("default_widget.select_widget_style") %>
|
||||
</label>
|
||||
<div class="controls well">
|
||||
<% if @module_app.nil? || @module_app.widgets.nil? || (@module_app.widgets[@widget_path].blank? rescue true) %>
|
||||
<%= t("default_widget.no_support_setting")%>
|
||||
<%else%>
|
||||
<%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]["style"]) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% if(@module_app && @module_app.widget_options(@widget_path)) %>
|
||||
<div class="style_switch control-group">
|
||||
<label class="control-label"><%= t("default_widget.select_widget_ext_option") %></label>
|
||||
<div class="controls well" >
|
||||
<%= render :partial=> "widget_ext_options" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1,4 +1,19 @@
|
||||
<div id="widget_field" class="well clear">
|
||||
<% case object%>
|
||||
<% when PagePart %>
|
||||
<% object_name = 'page_part' %>
|
||||
<% field_name = 'widget_field' %>
|
||||
<% data_count = 'widget_data_count' %>
|
||||
<% when Page %>
|
||||
<% object_name = 'page' %>
|
||||
<% field_name = 'frontend_field' %>
|
||||
<% data_count = 'frontend_data_count' %>
|
||||
<% end %>
|
||||
|
||||
<div class="style_switch control-group">
|
||||
<label class="control-label">
|
||||
<%= t("default_widget.fields_") %>
|
||||
</label>
|
||||
<div id="widget_field" class="well clear controls">
|
||||
|
||||
|
||||
<div class="rows clear">
|
||||
@@ -16,19 +31,24 @@
|
||||
<div class="rows clear">
|
||||
<span class="span4">
|
||||
<%= i+1 %>
|
||||
<%= select_tag "page_part[widget_field][]", widget_field_options(i), :include_blank => true %>
|
||||
<%= select_tag "#{object_name}[#{field_name}][]", widget_field_options(i), :include_blank => true %>
|
||||
</span>
|
||||
<span class="span3">
|
||||
<%= select_tag "page_part[widget_field_type][]", widget_fiield_type_options(i), :include_blank => true %> <br />
|
||||
<%= select_tag "#{object_name}[#{field_name}_type][]", widget_fiield_type_options(i), :include_blank => true %> <br />
|
||||
</span>
|
||||
<span class="span5"></span>
|
||||
</div>
|
||||
</div><br/>
|
||||
<% end %>
|
||||
<br/>
|
||||
<div class="rows clear">
|
||||
<span class="span4"><%= label_tag t("default_widget.widget_data_count") %></span>
|
||||
<span class="span4">
|
||||
<%= label_tag t("default_widget.widget_data_count") %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="rows clear">
|
||||
<span class="span4"><%= text_field_tag :widget_data_count,@part.widget_data_count %></span>
|
||||
<span class="span4">
|
||||
<%= text_field_tag "#{object_name}[#{data_count}]",object.send(data_count) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,45 +1,58 @@
|
||||
<div class="style_switch well">
|
||||
<label><%= t("default_widget.select_widget_style") %></label>
|
||||
<% field_name='' %>
|
||||
<% case object %>
|
||||
<% when Page %>
|
||||
<% field_name = "page[frontend_style]" %>
|
||||
<% when PagePart %>
|
||||
<% field_name = "page_part[widget_style]" %>
|
||||
<% end %>
|
||||
|
||||
<div class="style_switch control-group">
|
||||
<label class="control-label">
|
||||
<%= t("default_widget.select_widget_style") %>
|
||||
</label>
|
||||
<div class="controls well">
|
||||
<ul class="clear">
|
||||
<li>
|
||||
<label class="radio style_radio">
|
||||
<%= radio_button_tag :widget_style,"typeA",:checked => style_checked_value(@part,"typeA") %>
|
||||
<%= radio_button_tag field_name,"typeA",style_checked_value(object,"typeA") %>
|
||||
1
|
||||
</label>
|
||||
<span class="style_img"><%=image_tag 'module/default_widgets/style01.png'%></span>
|
||||
<span class="style_description"><%= t("default_widget.caption.typeA") %></span>
|
||||
<span class="style_description"><%= t("default_widget.caption.typeA") %></span>
|
||||
</label>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<label class="radio style_radio">
|
||||
<%= radio_button_tag :widget_style,"typeB_style2",:checked => style_checked_value(@part,"typeB_style2") %>
|
||||
<%= radio_button_tag field_name,"typeB_style2",style_checked_value(object,"typeB_style2") %>
|
||||
2
|
||||
</label>
|
||||
<span class="style_img"><%=image_tag 'module/default_widgets/style02.png'%></span>
|
||||
<span class="style_description"><%= t("default_widget.caption.typeA") %></span>
|
||||
<span class="style_description"><%= t("default_widget.caption.typeB_style2") %></span>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="radio style_radio">
|
||||
<%= radio_button_tag :widget_style,"typeB_style3",:checked => style_checked_value(@part,"typeB_style3") %>
|
||||
<%= radio_button_tag field_name,"typeB_style3",style_checked_value(object,"typeB_style3") %>
|
||||
3
|
||||
</label>
|
||||
<span class="style_img"><%=image_tag 'module/default_widgets/style03.png'%></span>
|
||||
<span class="style_description"><%= t("default_widget.caption.typeB_style3") %></span>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="radio style_radio">
|
||||
<%= radio_button_tag :widget_style,"typeB_style4",:checked => style_checked_value(@part,"typeB_style4") %>
|
||||
<%= radio_button_tag field_name,"typeB_style4",style_checked_value(object,"typeB_style4") %>
|
||||
4
|
||||
</label>
|
||||
<span class="style_img"><%=image_tag 'module/default_widgets/style04.png'%></span>
|
||||
<span class="style_description"><%= t("default_widget.caption.typeB_style4") %></span>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="radio style_radio">
|
||||
<%= radio_button_tag :widget_style,"typeC",:checked => style_checked_value(@part,"typeC") %>
|
||||
<%= radio_button_tag field_name,"typeC",style_checked_value(object,"typeC") %>
|
||||
5
|
||||
</label>
|
||||
<span class="style_img"><%=image_tag 'module/default_widgets/style05.png'%></span>
|
||||
<span class="style_description"><%= t("default_widget.caption.typeC") %></span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,10 +1,11 @@
|
||||
<%= stylesheet_link_tag "admin/default_widget_setting" %>
|
||||
|
||||
<%= form_for @part, :url => admin_page_part_path(@part) do |f| %>
|
||||
|
||||
<%= form_for @part, :url => admin_page_part_path(@part),:html=>{:class=>"clear form-horizontal edit_page_part"} do |f| %>
|
||||
<% LIST[:page_part_kinds].each do |kind| %>
|
||||
<%= label_tag '',:class=>'checkbox inline' do %>
|
||||
<%= f.radio_button :kind, kind, :class => 'part_kind' %>
|
||||
<%= t(kind, :scope => 'page_part_kinds') %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% LIST[:page_part_kinds].each do |kind| %>
|
||||
<div id='<%= "part_#{kind}" %>' class='part_kind_partial' style="display:<%= kind.eql?(@part.kind) ? 'block' : 'none' %>">
|
||||
@@ -12,7 +13,9 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
<%= f.submit t(:update_) %> <%= link_back %>
|
||||
</p>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= f.submit t(:update_),:class=>"btn btn-primary" %>
|
||||
<%= link_back("btn") %>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1,39 +1,47 @@
|
||||
<div>
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<p>
|
||||
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %>
|
||||
<%= f.text_field locale, :value => (@part.title_translations[locale] rescue nil),:size=>30 %>
|
||||
</p>
|
||||
<% end %>
|
||||
<div class="control-group">
|
||||
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}",:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, :value => (@part.title_translations[locale] rescue nil),:size=>30 %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<p id="module_app_list">
|
||||
<label for="age_part[module_app]"><%= t "default_widget.select_module_app" %></label>
|
||||
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :title, :selected => @module_app.id), {}, {:rel => admin_page_parts_path} %>
|
||||
</p>
|
||||
|
||||
<div id="module_app_list" class="control-group">
|
||||
<label for="page_part[module_app]" class="control-label">
|
||||
<%= t "default_widget.select_module_app" %>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, :selected => (@module_app.id rescue nil)), {:include_blank => true }, {:rel => admin_page_parts_path,:id=>"page_module_app_id"} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="widget_list">
|
||||
<label for="age_part[widget_path]"><%= t "default_widget.select_widget_path" %></label>
|
||||
<%= f.select :widget_path, @module_app.widgets.collect{|k,v| [k.humanize, k]}, {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %>
|
||||
</p>
|
||||
<div id="widget_list" class="control-group">
|
||||
<label for="page_part[widget_path]" class="control-label">
|
||||
<%= t "default_widget.select_widget_path" %>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<%= f.select :widget_path, @module_app ? @module_app.widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} : [], {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="widget_option">
|
||||
<div id="widget_data_source_category" class="well">
|
||||
<%= render :partial => 'widget_data_source_category' %>
|
||||
<div id="widget_data_source_category" class="control-group">
|
||||
<%= render :partial => 'widget_data_source_category' ,:locals=>{:object=>@part}%>
|
||||
</div>
|
||||
<div id="widget_data_source_tag" class="well">
|
||||
<%= render :partial => 'widget_data_source_tag' %>
|
||||
<div id="widget_data_source_tag" class="control-group">
|
||||
<%= render :partial => 'widget_data_source_tag' ,:locals=>{:object=>@part} %>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="widget_setting">
|
||||
<%= render :partial => 'widget_setting' ,:locals=>{:f=>f} %>
|
||||
<%= render :partial => 'widget_setting' ,:locals=>{:f=>f,:object=>@part} %>
|
||||
</div>
|
||||
<!-- <span id="widget_options">
|
||||
|
||||
</span> -->
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="style_switch control-group">
|
||||
<label class="control-label">
|
||||
<%= t(label_i18n) %>
|
||||
</label>
|
||||
<div class="controls well">
|
||||
<%= t('default_widget.no_support_setting') %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,12 +1,22 @@
|
||||
<label><%= t "default_widget.data_source.tag" %></label>
|
||||
<% case object %>
|
||||
<% when Page %>
|
||||
<% field_name = 'page' %>
|
||||
<% when PagePart %>
|
||||
<% field_name = 'page_part' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<label class="control-label"><%= t "default_widget.data_source.category" %></label>
|
||||
<div class="well controls">
|
||||
<% if @categories %>
|
||||
<fieldset>
|
||||
<%= nil_radio_button(@part,:category) %>
|
||||
<%= content_tag_for(:label, @categories,:class=>"radio inline") do |category|%>
|
||||
<%= radio_button("page_part", "category", category.id, :checked => category_checked_value(@part,category.id) )%>
|
||||
<%= category.title%>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
<% else %>
|
||||
<%= t("default_widget.no_support_setting")%>
|
||||
<% end %>
|
||||
<fieldset>
|
||||
<%= nil_radio_button(object,:category) %>
|
||||
<%= content_tag_for(:label, @categories,:class=>"radio inline") do |category|%>
|
||||
<%= radio_button_tag("#{field_name}[category]", category.id, category_checked_value(object,category.id) )%>
|
||||
<%= category.title%>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
<% else %>
|
||||
<%= t("default_widget.no_support_setting")%>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,12 +1,22 @@
|
||||
<label><%= t "default_widget.data_source.category" %></label>
|
||||
<% case object %>
|
||||
<% when Page %>
|
||||
<% field_name = 'page' %>
|
||||
<% when PagePart %>
|
||||
<% field_name = 'page_part' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<label class="control-label"><%= t "default_widget.data_source.tag" %></label>
|
||||
<div class="well controls">
|
||||
<% if @categories %>
|
||||
<fieldset>
|
||||
<%= nil_radio_button(@part,:tag) %>
|
||||
<%= nil_radio_button(object,:tag) %>
|
||||
<%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%>
|
||||
<%= radio_button("page_part", "tag", tag.id, :checked => tag_checked_value(@part,tag.id) )%>
|
||||
<%= radio_button_tag("#{field_name}[tag]", tag.id, tag_checked_value(object,tag.id) ) %>
|
||||
<%= tag[I18n.locale]%>
|
||||
<% end %>
|
||||
<% end if @tags%>
|
||||
</fieldset>
|
||||
<% else %>
|
||||
<%= t("default_widget.no_support_setting")%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,5 +1,6 @@
|
||||
<% @module_app.widget_options[@widget_path].each do |key,options| %>
|
||||
<%= label_tag(t(@module_app.widget_options_fields_i18n[@widget_path][key]))%>
|
||||
<% @module_app.widget_options(@widget_path).get_options.each do |key,settings| %>
|
||||
<% options = settings[:opts] %>
|
||||
<%= label_tag(t(settings[:label_i18n]))%>
|
||||
<% case options%>
|
||||
<% when Hash%>
|
||||
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)) %>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<% if show_default_widget_setting_panel %>
|
||||
<div id="default_widget">
|
||||
<%= render :partial => 'default_widget_style_panel',:locals=>{:f=>f} %>
|
||||
<%= render :partial => 'default_widget_setting' %>
|
||||
<%= render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:f=>f,:object=>object} %>
|
||||
<%= render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>object} %>
|
||||
</div>
|
||||
<% elsif show_custom_widget_setting_panel %>
|
||||
<div id="custom_widget">
|
||||
<%= render :partial => 'custom_widget_setting' %>
|
||||
<%= render :partial => 'admin/page_parts/custom_widget_setting',:locals=>{:object=>object} %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1 +0,0 @@
|
||||
<%= select 'page_part', 'category', @categories.collect{|category| [category.title, category.id]}, :selected => (@part ? @part[:category] : nil), :include_blank => true if @categories && @categories.size > 0 %>
|
||||
@@ -1 +0,0 @@
|
||||
<%= select 'page_part', 'tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, :selected => (@part ? @part[:tag] : nil), :include_blank => true if @tags && @tags.size > 0 %>
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
<% if show_default_widget_setting_panel %>
|
||||
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>");
|
||||
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting' %>");
|
||||
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel',:locals=>{:object=>@part} %>");
|
||||
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting',:locals=>{:object=>@part} %>");
|
||||
<% elsif show_custom_widget_setting_panel %>
|
||||
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
|
||||
<% end %>
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| k},@part.widget_path) %>");
|
||||
$("#widget_data_source_category").html("<%= j render :partial => 'widget_data_source_category' %>");
|
||||
$("#widget_data_source_tag").html("<%= j render :partial => 'widget_data_source_tag' %>");
|
||||
<% if @module_app%>
|
||||
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| [I18n.t(v['i18n']),k]},@part.widget_path) %>");
|
||||
$("#widget_data_source_category").html("<%= j render :partial => 'widget_data_source_category',:locals=>{:object=>@part} %>");
|
||||
$("#widget_data_source_tag").html("<%= j render :partial => 'widget_data_source_tag',:locals=>{:object=>@part} %>");
|
||||
|
||||
<% if !@part.widget_path.blank? %>
|
||||
<% if show_default_widget_setting_panel %>
|
||||
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>");
|
||||
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting' %>");
|
||||
<% elsif show_custom_widget_setting_panel %>
|
||||
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
|
||||
<% if @part %>
|
||||
<% if show_default_widget_setting_panel %>
|
||||
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>");
|
||||
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting',:locals=>{:object=>@part} %>");
|
||||
<% elsif show_custom_widget_setting_panel %>
|
||||
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
$('#widget_option').find("div.well.controls").html("<%= t('default_widget.no_support_setting')%>");
|
||||
$('#widget_setting').html("<%=j render :partial=> 'reset',:locals=>{:label_i18n=>'default_widget.select_widget_style'}%>");
|
||||
$('#widget_list select').html("<%= j options_for_select([]) %>");
|
||||
<% end %>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<%= f.select :module_app_id, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
|
||||
<%= f.select :module_app_id, @apps.collect { |t| [t.module_name, t.id] }, {:include_blank => true} ,{:rel => admin_pages_path } %>
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="control-group">
|
||||
<label class="control-label">
|
||||
<%= t("default_widget.select_widget_style") %>
|
||||
</label>
|
||||
<div class="controls well">
|
||||
<%= t("default_widget.no_support_setting")%>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,9 +2,12 @@
|
||||
<%= f.hidden_field :parent, :value => (@item.parent.id rescue nil) %>
|
||||
|
||||
<div class="control-group">
|
||||
<%= f.label :name, t(:name), :class => 'control-label' %>
|
||||
<%= f.label :name, '*'+t(:name), :class => 'control-label' %>
|
||||
|
||||
|
||||
<div class="controls">
|
||||
<%= f.text_field :name, :class => 'text input-xlarge' %>
|
||||
<span class="help-inline">請輸入數字或英文,不可使用空白</span>
|
||||
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,36 +38,37 @@
|
||||
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<%= f.label :name, t(:module), :class => 'control-label' %>
|
||||
|
||||
<div class="control-group" id="module_app_list">
|
||||
<%= f.label '',t("default_widget.select_module_app"), :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= render :partial => "app_selector", :locals => { :f => f } %>
|
||||
<span id="app_page_url">
|
||||
<%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%>
|
||||
</span>
|
||||
<span id="app_page_frontend_style">
|
||||
<%= select('page','frontend_style', @frontend_style, :selected => @item[:frontend_style], :include_blank => true ) rescue ''%>
|
||||
</span>
|
||||
<span id="app_page_category">
|
||||
<%= select('page','category', @categories.collect{|category| [category.title, category.id]}, :selected => @item[:category], :include_blank => true ) rescue ''%>
|
||||
</span>
|
||||
<span id="app_page_tag">
|
||||
<%= select('page','tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, :selected => @item[:tag], :include_blank => true ) rescue ''%>
|
||||
</span>
|
||||
<span id="app_page_frontend_field">
|
||||
<%= render 'frontend_fields' %>
|
||||
</span>
|
||||
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<%= f.label :frontend_data_count, t(:frontend_data_count), :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.text_field :frontend_data_count %>
|
||||
|
||||
<div class="control-group" id="frontend_list">
|
||||
<%= f.label '', t("front_page.select_app_url"), :class => 'control-label' %>
|
||||
<div class="controls" id="app_page_url">
|
||||
<%= select('page','app_frontend_url', @app_frontend_urls || [], :selected => @item.app_frontend_url ) rescue ''%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="app_page_category" class="control-group">
|
||||
<%= render :partial=>"admin/page_parts/widget_data_source_category",:locals=>{:object=>@item} %>
|
||||
</div>
|
||||
|
||||
<div id="app_page_tag" class="control-group">
|
||||
<%= render :partial=>"admin/page_parts/widget_data_source_tag" ,:locals=>{:object=>@item}%>
|
||||
</div>
|
||||
|
||||
<div id="frontend_setting">
|
||||
<%= render :partial => 'frontend_setting', :locals=>{:object=>@item,:f=>f} %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<%= f.label :is_published, "#{t(:is_published)} ?", :class => 'control-label' %>
|
||||
<%= f.label :is_published, "#{t('front_page.is_published')} ?", :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<label class="radio">
|
||||
<%= f.radio_button :is_published, true %>
|
||||
@@ -78,7 +82,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<%= f.label :menu_enabled_for, "#{t(:menu_enabled_for)}:", :class => 'control-label' %>
|
||||
<%= f.label :menu_enabled_for, "#{t('front_page.menu_enable_lang')}:", :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<% @site_valid_locales.each do |valid_locale| %>
|
||||
<label class="checkbox">
|
||||
@@ -92,7 +96,7 @@
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<%= f.label :enabled_for, "#{t(:enabled_for)}:", :class => 'control-label' %>
|
||||
<%= f.label :enabled_for, "#{t('front_page.link_enable_lang')}:", :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<% @site_valid_locales.each do |valid_locale| %>
|
||||
<label class="checkbox">
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<% if show_default_widget_setting_panel %>
|
||||
<%= render :partial=>'admin/page_parts/widget_setting',:locals=>{:object=>object,:f=>f} %>
|
||||
<% end %>
|
||||
@@ -1,3 +1,4 @@
|
||||
<%= stylesheet_link_tag "admin/default_widget_setting" %>
|
||||
<% content_for :sidebar do %>
|
||||
<%= render 'admin/items/site_map_left_bar' %>
|
||||
<% end -%>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<% if show_default_widget_setting_panel %>
|
||||
// $('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@page} %>");
|
||||
|
||||
$('#frontend_setting').html("<%= j render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:object=>@page} %>");
|
||||
$('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@page} %>");
|
||||
<% else %>
|
||||
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
|
||||
<% end %>
|
||||
@@ -0,0 +1,33 @@
|
||||
<% if @module_app %>
|
||||
$('#app_page_category').html("<%= j render :partial => 'admin/page_parts/widget_data_source_category' ,:locals=>{:object=>@page}%>");
|
||||
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@page} %>");
|
||||
|
||||
<% if !@module_app.app_pages.blank? %>
|
||||
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', options_for_select(@app_frontend_urls, @app_frontend_urls.first)) %>");
|
||||
<%else %>
|
||||
$('#app_page_url').html("<%= t('default_widget.no_support_setting')%>");
|
||||
<% end %>
|
||||
|
||||
<% if @app_frontend_urls.first =='default_widget' %>
|
||||
$('#app_page_frontend_style').html("<%= escape_javascript(select 'page', 'frontend_style', @module_app.widgets[@frontend_path]) if !@frontend_path.blank? %>");
|
||||
<% else %>
|
||||
$('#app_page_frontend_style').html("<%= t('default_widget.no_support_setting')%>");
|
||||
<% end %>
|
||||
|
||||
<% if show_default_widget_setting_panel %>
|
||||
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@page} %>");
|
||||
|
||||
$('#frontend_setting').html("<%= j render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:object=>@page} %>");
|
||||
$('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@page} %>");
|
||||
<% else %>
|
||||
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
|
||||
<% end %>
|
||||
<% else %>
|
||||
|
||||
$('#app_page_url').html("<%= t('default_widget.no_support_setting')%>");
|
||||
$('#app_page_category').find("div.well.controls").html("<%= t('default_widget.no_support_setting')%>");
|
||||
$('#app_page_tag').find("div.well.controls").html("<%= t('default_widget.no_support_setting')%>");
|
||||
|
||||
$('#app_page_url').html("<%= t('default_widget.no_support_setting')%>");
|
||||
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
|
||||
<% end %>
|
||||
@@ -5,7 +5,6 @@
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "member" %>
|
||||
<%= stylesheet_link_tag "site-map" %>
|
||||
<%= stylesheet_link_tag "isotope" %>
|
||||
<% end -%>
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "member" %>
|
||||
<%= stylesheet_link_tag "site-map" %>
|
||||
<%= stylesheet_link_tag "isotope" %>
|
||||
<% end -%>
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "member" %>
|
||||
<%= stylesheet_link_tag "site-map" %>
|
||||
<%= stylesheet_link_tag "isotope" %>
|
||||
<% end -%>
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<li class="dock_item"><a callback-method='initializeJournalPapers' href="<%= panel_personal_journal_desktop_journal_p_path %>" class="widget_fn wh3 hh3" id='d_journal_p' custom-load="journal" onclick="return false;"><span class="widget_icon"><img src="" alt="Journal Papers" id="journal_p_icon" width="30" height="30"/></span></a></li>
|
||||
|
||||
<li class="dock_item"><a callback-method='initializeSeminar' href="<%= desktop_publications_seminar_p_path %>" class="widget_fn wh3 hh3" id='d_seminar_p' custom-load="seminar" onclick="return false;"><span class="widget_icon"><img src="" alt="Seminar Papers" id="seminar_p_icon" width="30" height="30"/></span></a></li>
|
||||
<li class="dock_item"><a callback-method='initializeConference' href="<%= panel_personal_conference_desktop_conference_p_path %>" class="widget_fn wh3 hh3" id='d_conference_p' custom-load="conference" onclick="return false;"><span class="widget_icon"><img src="" alt="Conference Papers" id="conference_p_icon" width="30" height="30"/></span></a></li>
|
||||
|
||||
<li class="dock_item"><a callback-method='initializeBooks' href="<%= desktop_publications_books_path %>" class="widget_fn wh3 hh3" id='d_books' onclick="return false;"><span class="widget_icon"><img src="" alt="Books" id="books_icon" width="30" height="30"/></span></a></li>
|
||||
|
||||
@@ -103,3 +103,4 @@
|
||||
o.notify("Welcome "+o.currentUsername+"!!","alert",3);
|
||||
</script>
|
||||
<%= javascript_include_tag "personal_journal" %>
|
||||
<%= javascript_include_tag "personal_conference" %>
|
||||
@@ -41,10 +41,10 @@
|
||||
<div class="overview">
|
||||
<div class="s_grid_con s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Seminar Title</textarea></li>
|
||||
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Conference Title</textarea></li>
|
||||
<li class="s_grid_row">
|
||||
<label>Paper type</label><input type="radio" name="" value="Books" />Oral<input type="radio" name="" value="Chapter" />Poster</li>
|
||||
<li class="s_grid_row"><label>Seminar time</label></li>
|
||||
<li class="s_grid_row"><label>Conference time</label></li>
|
||||
|
||||
<li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1">
|
||||
<option value=""></option>
|
||||
@@ -104,4 +104,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,10 +41,10 @@
|
||||
<div class="overview">
|
||||
<div class="s_grid_con s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Seminar Title</textarea></li>
|
||||
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Conference Title</textarea></li>
|
||||
<li class="s_grid_row">
|
||||
<label>Paper type</label><input type="radio" name="" value="Books" />Oral<input type="radio" name="" value="Chapter" />Poster</li>
|
||||
<li class="s_grid_row"><label>Seminar time</label></li>
|
||||
<li class="s_grid_row"><label>Conference time</label></li>
|
||||
|
||||
<li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1">
|
||||
<option value=""></option>
|
||||
@@ -104,4 +104,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,10 +41,10 @@
|
||||
<div class="overview">
|
||||
<div class="s_grid_con s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Seminar Title</textarea></li>
|
||||
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Conference Title</textarea></li>
|
||||
<li class="s_grid_row">
|
||||
<label>Paper type</label><input type="radio" name="" value="Books" />Oral<input type="radio" name="" value="Chapter" />Poster</li>
|
||||
<li class="s_grid_row"><label>Seminar time</label></li>
|
||||
<li class="s_grid_row"><label>Conference time</label></li>
|
||||
|
||||
<li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1">
|
||||
<option value=""></option>
|
||||
@@ -104,4 +104,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,33 +0,0 @@
|
||||
<div id="seminar_p">
|
||||
<div id="content">
|
||||
<div id="header" class="hh3">
|
||||
<div class="dtitle w2 hh3 hp">
|
||||
<span class="thmtxth">Seminar</span>
|
||||
</div>
|
||||
<div id="search_app" class="hfn w2 hh2 hp thmc3">
|
||||
<input type="text" class="ini_input form" value="Search" id="searchbox" />
|
||||
<input type="submit" class="ini_input submit thmc1" value="Submit"/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="holder">
|
||||
<div id="panel_l" class="ph">
|
||||
<div class="s_menu sm_v" content-type="menu">
|
||||
<ul id='setting_left_nav'>
|
||||
<li><a href="<%= desktop_publications_seminar_p_list_path %>" callback-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
|
||||
<li><a href="<%= desktop_publications_seminar_p_add_path %>" callback-method="addseminar" custom-load="add" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
|
||||
<li><a href="<%= desktop_publications_seminar_p_add_path %>" callback-method="seminar" class="admtxt hh2 w2 hp" onclick='return false;'>Seminar</a></li>
|
||||
<li><a href="<%= desktop_publications_seminar_p_list_path %>" callback-method="rues" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags & Keywords</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Analysis</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Import</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Export</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panel_r" container="true" class="ph pw admbg hp">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,107 +0,0 @@
|
||||
<div class="toolbar hh2">
|
||||
<div class="fn_g hp">
|
||||
<button class="fn_btn hh2 thmc2 thmtxt">Save</button>
|
||||
<button class="fn_btn hh2 admbg2">Cancel</button>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Year</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">2012</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2011</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2010</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2009</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2008</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2007</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2006</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2005</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2004</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2003</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2002</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">2001</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Language</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">English</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Chinese</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="paper_add" class="tinycanvas vp">
|
||||
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
|
||||
<div class="viewport">
|
||||
<div class="overview">
|
||||
<div class="s_grid_con s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Seminar Title</textarea></li>
|
||||
<li class="s_grid_row">
|
||||
<label>Paper type</label><input type="radio" name="" value="Books" />Oral<input type="radio" name="" value="Chapter" />Poster</li>
|
||||
<li class="s_grid_row"><label>Seminar time</label></li>
|
||||
|
||||
<li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
<label class="s_grid s_grid_1">Year</label>
|
||||
<select name="" id="" class="s_grid s_grid_1">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
<label class="s_grid s_grid_1">Month</label>
|
||||
<select name="" id="" class="s_grid s_grid_1">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
<label class="s_grid s_grid_1">Day</label>
|
||||
</li>
|
||||
|
||||
<li class="s_grid_row"><input class="s_grid s_grid_2" type="text" value="Location"><input class="s_grid s_grid_2" type="text" value="Sponsor"></li>
|
||||
<li class="s_grid_row"><label class="s_grid_2 s_grid" for="">Reference URL</label><input class="s_grid_4 s_grid" type="text" value="www.sample.com"></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="s_grid_con s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row"><textarea class="s_grid s_grid_6" name="" id="">Author</textarea><span class="icon-plus input_append"></span></li>
|
||||
<li class="s_grid_row">
|
||||
<select name="" id="" class="s_grid s_grid_4">
|
||||
<option value="">Author Type</option>
|
||||
<option value="">First Author</option>
|
||||
<option value="">Corresponding Author</option>
|
||||
<option value="">Second Author</option>
|
||||
<option value="">Third Author</option>
|
||||
<option value="">Fourth Author</option>
|
||||
</select>
|
||||
<select name="" id="" class="s_grid s_grid_2">
|
||||
<option value="">Status</option>
|
||||
<option value="">Published</option>
|
||||
<option value="">Pending</option>
|
||||
<option value="">Writing</option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="s_grid_row"><label class="s_grid s_grid_2" for="">Date of Publication</label><input class="s_grid s_grid_4" type="text" value="2012 / 05 / 01"></li>
|
||||
|
||||
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" value="Tags"><span class="icon-plus input_append"></li>
|
||||
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" value="Keywords"><span class="icon-plus input_append"></li>
|
||||
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" value="Associated Project"><span class="icon-plus input_append"></span></li>
|
||||
<li class="s_grid_row"><label class="s_grid s_grid_2" for="">Abstract</label><input type="file"></li>
|
||||
<li class="s_grid_row"><label class="s_grid s_grid_2" for="">Full Text</label><input type="file"></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="s_grid_con s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row"><textarea name="" id="" rows="20" class="s_grid s_grid_6">Abstract</textarea></li>
|
||||
<li class="s_grid_row"><textarea name="" id="" rows="6" class="s_grid s_grid_6">Note</textarea></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,75 +0,0 @@
|
||||
<div class="toolbar hh2">
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2"><span class="icon-check"></span></div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_selection_options">
|
||||
<li><a class="hp hh2 admtxt" href="all">All</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="none">None</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">More</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">Delete</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Tag</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Tag</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Starred</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">MIT</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Status</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Published</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Pending</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">View</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_view_selection">
|
||||
<li><a class="hp hh2 admtxt" href="journal">Journal</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="title">Title</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="file">File</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="keywords">Keywords</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="abstract">Abstract</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="paper_list" class="tinycanvas vp">
|
||||
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
|
||||
<div class="viewport">
|
||||
<div class="overview">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -10,25 +10,19 @@
|
||||
</div>
|
||||
<ul class="nav">
|
||||
<li><a href="<%= root_path %>" data-icons=""></a></li>
|
||||
<!-- <li><a href="<%= desktop_path %>" data-icons=""></a></li> -->
|
||||
<li><a href="<%= desktop_path %>" data-icons=""></a></li>
|
||||
</ul>
|
||||
<ul class="nav pull-right">
|
||||
<!--
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-icons="" href="#" data-toggle="dropdown"></a>
|
||||
<ul class="dropdown-menu">
|
||||
<% t('ntu.site_names').each do |site| %>
|
||||
<li><%= link_to site[1], get_link(site[0]) %></li>
|
||||
<% end %>
|
||||
<% #t('ntu.site_names').each do |site| %>
|
||||
<li><%#= link_to site[1], get_link(site[0]) %></li>
|
||||
<%# end %>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown language">
|
||||
<a class="dropdown-toggle" href="#" data-toggle="dropdown" data-icons=""></a>
|
||||
<ul class="dropdown-menu language-menu">
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil) %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
-->
|
||||
<li class="search clear" title="<%= t :search_google %>">
|
||||
<a class="orbit-bar-search" href="#" data-icons=""></a>
|
||||
<form class="navbar-search" method="get" action="http://www.google.com/custom">
|
||||
@@ -41,6 +35,14 @@
|
||||
<%= text_field_tag 'q','',{:class => "search-query span3",:placeholder=> t(:search_google) ,:disabled=> ((@site.search["sitesearch"] || @site.search["domains"] ).blank? rescue true)}%>
|
||||
</form>
|
||||
</li>
|
||||
<li class="dropdown language">
|
||||
<a class="dropdown-toggle orbit-bar-language" href="#" data-toggle="dropdown" data-icons=""></a>
|
||||
<ul class="dropdown-menu language-menu">
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil) %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% if user_signed_in? %>
|
||||
<li class="dropdown active">
|
||||
<a class="orbit-bar-account" href="#" data-toggle="dropdown">
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
<div class="viewport">
|
||||
<div class="overview">
|
||||
<ul class="nav nav-list">
|
||||
<%= render ((local_assigns.has_key? :side_bar_content) ? side_bar_content : 'layouts/side_bar_content') %>
|
||||
<%= render :partial=> 'layouts/side_bar_content'%>
|
||||
<%#= render ((local_assigns.has_key? :side_bar_content) ? side_bar_content : 'layouts/side_bar_content') %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,78 +1,15 @@
|
||||
<%#= content_tag :li, :class => active_for_controllers('purchases') do -%>
|
||||
<%#= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %>
|
||||
<%# end -%>
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "/static/kernel.js" %>
|
||||
<% end %>
|
||||
|
||||
<%= content_tag :li, :class => (active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals') || active_for_app_auth('Announcement') || active_for_ob_auths_object("BulletinCategory") ) do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-megaphone') + content_tag(:span, t('announcement.announcement')), panel_announcement_back_end_bulletins_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals')||active_for_ob_auths_object("BulletinCategory"))) do -%>
|
||||
<%= content_tag :li, link_to((t('announcement.all_articles') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index')if (is_manager? rescue nil) %>
|
||||
<%= content_tag :li, link_to((t('announcement.add_new') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') if (is_manager? rescue nil) %>
|
||||
<%= content_tag :li, link_to((t('announcement.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_bulletin_categorys_path), :class =>( active_for_action('bulletin_categorys', 'index') || active_for_ob_auths_object("BulletinCategory") )if (is_manager? rescue nil) %>
|
||||
<%= content_tag :li, link_to((t('announcement.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_tags_path), :class => active_for_action('/panel/announcement/back_end/tags', 'index')if (is_manager? rescue nil) %>
|
||||
<%= content_tag :li, link_to((t('announcement.bulletin.approval_setting') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_approval_setting_path), :class => active_for_action('approvals', 'setting') if (is_manager? rescue nil) %>
|
||||
<%= content_tag :li, link_to((t(:module_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "announcement"}))), :class => active_for_app_auth('Announcement') if (is_admin? rescue nil) %>
|
||||
|
||||
<% end -%>
|
||||
|
||||
<% end -%>
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers('page_contexts') || active_for_app_auth('page_content') || active_for_ob_auths_object("PageContext") do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-newspaper') + content_tag(:span, t(:page)), panel_page_content_back_end_page_contexts_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('page_contexts')) do -%>
|
||||
<%= content_tag :li, link_to((t(:module_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "page_content"}))), :class => active_for_app_auth('page_content') if (is_admin? rescue nil) %>
|
||||
<% end -%>
|
||||
|
||||
<% end -%>
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') ||active_for_ob_auths_object("AdBanner") ||active_for_app_auth('ad_banner') do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-landscape') + content_tag(:span, t(:ad_banner)), admin_ad_banners_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('ad_banners', 'ad_images') ) do -%>
|
||||
<%= content_tag :li, link_to((t(:module_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "ad_banner"}))), :class => active_for_app_auth('ad_banners') if (is_admin? rescue nil) %>
|
||||
<% end -%>
|
||||
<% end %>
|
||||
<%OrbitApp::Module::SideBarRegisition.all.each do |t| %>
|
||||
<%= t.render(request,params,current_user,@module_app) %>
|
||||
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys') || active_for_app_auth('web_resource') || active_for_ob_auths_object("WebLinkCategory") do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-link') + content_tag(:span, t(:link)), panel_web_resource_back_end_web_links_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys')) do -%>
|
||||
<%= content_tag :li, link_to((t(:list_) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_web_resource_back_end_web_links_path), :class => active_for_action('web_links', 'index')if (is_manager? rescue nil) %>
|
||||
<%= content_tag :li, link_to((t(:link) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_links', 'new') if (is_manager? rescue nil)%>
|
||||
<%= content_tag :li, link_to((t(:categories) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_web_resource_back_end_web_link_categorys_path), :class => (active_for_action('web_link_categorys', 'index') || active_for_ob_auths_object("WebLinkCategory")) if (is_manager? rescue nil)%>
|
||||
<%= content_tag :li, link_to((t(:tags) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_web_resource_back_end_tags_path), :class => active_for_action('/panel/web_resource/back_end/tags', 'index') if (is_manager? rescue nil)%>
|
||||
<%= content_tag :li, link_to((t(:module_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "web_resource"}))), :class => active_for_app_auth('web_resource') if (is_admin? rescue nil) %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers('albums','album_images','gallery_categories','/panel/gallery/back_end/tags') || active_for_app_auth("gallery") do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-pictures') + content_tag(:span, t("gallery.gallery")), panel_gallery_back_end_albums_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('albums') ) do -%>
|
||||
<%= content_tag(:li, link_to((t('gallery.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_gallery_back_end_gallery_categories_path), :class => active_for_action('gallery_categories','index') )if (is_manager? rescue nil)%>
|
||||
<%= content_tag :li, link_to((t('gallery.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_gallery_back_end_tags_path), :class => active_for_action('/panel/gallery/back_end/tags', 'index') if (is_manager? rescue nil) %>
|
||||
<%= content_tag :li, link_to((t(:module_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "gallery"}))), :class => active_for_app_auth('gallery') if (is_admin? rescue nil) %>
|
||||
<% end -%>
|
||||
<% end %>
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers('archive_files', 'panel/archive/back_end/tags', 'archive_file_categorys') do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-archive') + content_tag(:span, t(:archive)), panel_archive_back_end_archive_files_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('archive_files', 'tags', 'archive_file_categorys')) do -%>
|
||||
<%= content_tag :li, link_to((t(:all) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_archive_files_path), :class => active_for_action('archive_file', 'index')if (is_manager? rescue nil) %>
|
||||
<%= content_tag :li, link_to((t(:add) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_archive_back_end_archive_file_path), :class => active_for_action('archive_file', 'new') if (is_admin? rescue nil)%>
|
||||
<%= content_tag(:li, link_to((t(:categories) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_archive_file_categorys_path), :class => active_for_action('archive_file_categorys', 'index'))if (is_manager? rescue nil)%>
|
||||
<%= content_tag :li, link_to((t(:tags) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_tags_path), :class => active_for_action('tags', 'index') if (is_manager? rescue nil)%>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers('cals','panel/calendar/back_end/tags') || active_for_app_auth("calendar") do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-calendar') + content_tag(:span, t("calendar.calendar")), panel_calendar_back_end_cals_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('cals','calendar_categories') ) do -%>
|
||||
<%= content_tag :li, link_to((t('calendar.calendars') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_calendar_back_end_cal_path), :class => active_for_action('cals','new') if (is_manager? rescue nil)%>
|
||||
<%= content_tag :li, link_to(t(:tags), panel_calendar_back_end_tags_path), :class => active_for_action('/panel/calendar/back_end/tags', 'index')if (is_manager? rescue nil) %>
|
||||
<% end -%>
|
||||
<% end %>
|
||||
<%= content_tag :li, :class => active_for_controllers('locations') do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-location') + content_tag(:span, t(:location)), panel_location_back_end_locations_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('locations') ) do -%>
|
||||
<% end -%>
|
||||
<% end %>
|
||||
|
||||
<div class="content">
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<% else %>
|
||||
<%= render 'layouts/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<div id="main-wrap">
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<%= render 'header_dialog_copyright' %>
|
||||
<% end %>
|
||||
|
||||
<p>本網站著作權屬於國立政治大學。</p>
|
||||
<p>RulingDigital 銳綸數位建置</p>
|
||||
<p><%= t('mobile.copytight') %></p>
|
||||
<p><%= t('mobile.copytight_orbit') %></p>
|
||||
@@ -23,4 +23,5 @@
|
||||
<script type='text/javascript'>
|
||||
var $effect = "<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>"
|
||||
var $timeout = "<%= @ad_banner.transition_msec %>"
|
||||
var $info = "<%= t('mobile.location_description').html_safe %>"
|
||||
</script>
|
||||
@@ -2,4 +2,9 @@
|
||||
<%= render 'header_map' %>
|
||||
<% end %>
|
||||
|
||||
<div id='map_canvas'></div>
|
||||
<div id='map_canvas'></div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
var $map_center = "24.987449, 121.576117"
|
||||
var $map_zoom = 17
|
||||
</script>
|
||||
Reference in new issue
Block a user