Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
638ed73d21 | ||
|
|
096aec3406 | ||
|
|
622534e5db | ||
|
|
52c896d8c5 | ||
|
|
028c689739 | ||
|
|
f81894af90 | ||
|
|
09e0d5bd92 | ||
|
|
1159375de7 | ||
|
|
dc3593c162 | ||
|
|
843775a2c0 | ||
|
|
16c26e3273 | ||
|
|
1021ac2e9b | ||
|
|
ab04070a8e | ||
|
|
5ec011a5ff | ||
|
|
cd8448d447 | ||
|
|
7990d4388c | ||
|
|
367cf67928 | ||
|
|
e7c04c6e6e | ||
|
|
6ac600fb5c | ||
|
|
42dcf0a2d2 | ||
|
|
c35d42d671 | ||
|
|
5332162646 | ||
|
|
1d0ea6718f | ||
|
|
6fc47d7afd | ||
|
|
04ff345b94 | ||
|
|
79c4cd2075 | ||
|
|
2a41e3440e | ||
|
|
e29b08d0dc | ||
|
|
58fb2d1c73 | ||
|
|
d5bb2a1889 | ||
|
|
b535f2cf9c | ||
|
|
f2a27c6b40 | ||
|
|
9613a52305 | ||
|
|
a067bcd304 | ||
|
|
b487740035 | ||
|
|
dc8815d619 | ||
|
|
b5b416d531 | ||
|
|
f27f96b994 | ||
|
|
1e3cffee0a | ||
|
|
e4a16eab3a | ||
|
|
cd1d4356fb | ||
|
|
d5357ea63c | ||
|
|
50bb2a870c | ||
|
|
a93945cd45 | ||
|
|
249644e72c | ||
|
|
f16d1908be | ||
|
|
c8be884291 | ||
|
|
6280fdfba0 | ||
|
|
2a9948868f | ||
|
|
e4514a353a | ||
|
|
d2a07d9ffb | ||
|
|
93909eeca0 | ||
|
|
e45b7e09a0 | ||
|
|
bd3462df7f | ||
|
|
f5f1822f0a | ||
|
|
d532ded8e4 | ||
|
|
8456a91968 | ||
|
|
ba7ac5d954 | ||
|
|
9cc1e95cb1 | ||
|
|
c1cbfddf4b | ||
|
|
3595c59810 | ||
|
|
789e02e313 | ||
|
|
bb8bc9a529 | ||
|
|
6430e60577 | ||
|
|
17d7912e07 | ||
|
|
911cfdc980 | ||
|
|
579bc3c245 | ||
|
|
8c98645a69 | ||
|
|
9e10a3c944 | ||
|
|
f920a4f6ba | ||
|
|
3328a41b55 | ||
|
|
06203d27b9 | ||
|
|
865be29b37 | ||
|
|
0eeb7db1a8 | ||
|
|
7216676c40 | ||
|
|
fa857cfeea | ||
|
|
a3f1b8d54a | ||
|
|
e9d6fa8787 | ||
|
|
6e032a8757 | ||
|
|
1558cfdb4e | ||
|
|
9e4686a565 | ||
|
|
fef7cc4ed2 | ||
|
|
7f0821ea84 | ||
|
|
2c0761aafb | ||
|
|
1e5ad750cd | ||
|
|
335991e152 | ||
|
|
131dd3fea8 | ||
|
|
6d8698af63 | ||
|
|
00ddd94314 | ||
|
|
8045a18230 | ||
|
|
81a89d2d7c | ||
|
|
4209356e9d | ||
|
|
3123c5de0a | ||
|
|
82b6be483a | ||
|
|
ff64fb5230 | ||
|
|
2bc9d3424a | ||
|
|
5591b06ee6 | ||
|
|
b970ea1e0e | ||
|
|
155722519b | ||
|
|
45e987d6f5 | ||
|
|
399dfad392 | ||
|
|
53e5c57970 | ||
|
|
e75873273c | ||
|
|
4c217ec12f | ||
|
|
452da1b8ec | ||
|
|
ec40591489 | ||
|
|
4078d426a6 | ||
|
|
c474fa063f | ||
|
|
d24bd176cc |
No files matched your search
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 78 B |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
@@ -0,0 +1,102 @@
|
||||
!function ($) {
|
||||
$.fn.checkListLength = function (param){
|
||||
_defaultSettings = {
|
||||
onlyOne: null,
|
||||
};
|
||||
_set = $.extend(_defaultSettings, param);
|
||||
$this = this;
|
||||
$li = this.children('li');
|
||||
$dropzone = $('#dropzone');
|
||||
if(($li.length - _set.onlyOne) == 0) {
|
||||
$('#dropzone').fadeIn(300);
|
||||
} else {
|
||||
$('#dropzone').fadeOut(300);
|
||||
};
|
||||
$('#file-list').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
|
||||
}
|
||||
}(window.jQuery);
|
||||
$(function () {
|
||||
'use strict';
|
||||
// Initialize the jQuery File Upload widget:
|
||||
$('#fileupload').fileupload({
|
||||
maxFileSize: 5000000,
|
||||
acceptFileTypes: /(\.|\/)(gif|jpe?g|png|pdf|doc|docx|ppt|pptx|xls|xlsx)$/i,
|
||||
dropZone: $('#dropzone'),
|
||||
headers:{
|
||||
'X-CSRF-Token': $('meta[name="csrf-token"]').attr("content")
|
||||
}
|
||||
}).bind('fileuploadstop', function (e, data) {
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
$(document).ready(function(){
|
||||
var insertBtn = $("#insert_btn"),
|
||||
deleteBtn = $("#delete_btn"),
|
||||
url = null;
|
||||
|
||||
$("#asset_sort_list").on(clickEvent,"input[type=checkbox]",function(){
|
||||
if($("#asset_sort_list input[type=checkbox]:checked").length == 1){
|
||||
url = window.location.protocol + "//" + window.location.host + $("#url_" + $("input[type=checkbox]:checked").val()).val();
|
||||
insertBtn.show();
|
||||
}else{
|
||||
insertBtn.hide();
|
||||
url = null;
|
||||
}
|
||||
if($("#asset_sort_list input[type=checkbox]:checked").length)
|
||||
deleteBtn.show();
|
||||
else
|
||||
deleteBtn.hide();
|
||||
})
|
||||
insertBtn.bind(clickEvent,function(){
|
||||
var alt_text = $("#"+language+"_desc_"+$("input[type=checkbox]:checked").val()).val();
|
||||
alt_text = (alt_text ? alt_text : "This is an image");
|
||||
if(url){
|
||||
window.opener.CKEDITOR.tools.callFunction( funcNum, url, function() {
|
||||
var element,
|
||||
dialog = this.getDialog();
|
||||
if ( dialog.getName() == 'image' ) {
|
||||
element = dialog.getContentElement( 'info', 'txtAlt' );
|
||||
if ( element )
|
||||
element.setValue( alt_text );
|
||||
}
|
||||
});
|
||||
window.close();
|
||||
}
|
||||
})
|
||||
deleteBtn.bind( clickEvent,function(){
|
||||
var items_to_delete = [],
|
||||
type = getUrlParam("type");
|
||||
$("input[type=checkbox]:checked").each(function(){
|
||||
items_to_delete.push($(this).val());
|
||||
})
|
||||
$.post("<%= delete_files_admin_assets_path %>",{"files":items_to_delete,"type":type},function(){
|
||||
deleteBtn.hide();
|
||||
})
|
||||
})
|
||||
var currentEdit = null;
|
||||
$(document).on("ajax:success","form[data-remote=true]",function(evt, data, xhr){
|
||||
currentEdit.replaceWith($(data));
|
||||
$("#editform").modal("hide");
|
||||
})
|
||||
|
||||
$("#asset_sort_list").on(clickEvent,".editform",function(){
|
||||
currentEdit = $(this).parent().parent();
|
||||
$.get($(this).attr("href"),function(data){
|
||||
$("#editform").html(data).modal("show");
|
||||
})
|
||||
return false;
|
||||
})
|
||||
|
||||
function getUrlParam( paramName ) {
|
||||
var reParam = new RegExp( '(?:[\?&]|&)' + paramName + '=([^&]+)', 'i' ) ;
|
||||
var match = window.location.search.match(reParam) ;
|
||||
|
||||
return ( match && match.length > 1 ) ? match[ 1 ] : null ;
|
||||
}
|
||||
var funcNum = getUrlParam( 'CKEditorFuncNum' ),
|
||||
t = getUrlParam('CKEditor').split("_"),
|
||||
language = t[t.length-1];
|
||||
|
||||
language = (language == "tw" ? "zh_tw" : language);
|
||||
|
||||
})
|
||||
@@ -38,7 +38,11 @@ if($.support.touch) {
|
||||
$checked.each(function() {
|
||||
if(!$(this).closest('div').hasClass('togglebox')) {
|
||||
$(this).wrap('<div class="toggle-control"/>');
|
||||
$(this).wrap('<div class="togglebox" />');
|
||||
if($(this).attr('type') == "hidden" && $(this).attr('value')) {
|
||||
$(this).wrap('<div class="togglebox disabled" />');
|
||||
} else {
|
||||
$(this).wrap('<div class="togglebox" />');
|
||||
}
|
||||
$('<label><b></b></label>').insertAfter($(this));
|
||||
if($(this).data().deploy) {
|
||||
switch($(this).data().deploy) {
|
||||
@@ -252,8 +256,8 @@ if($.support.touch) {
|
||||
$arrow = $('.sub-nav-arrow'),
|
||||
$wrap = $('#main-wrap'),
|
||||
$wrapLeft = $wrap.css('margin-left'),
|
||||
$position = 0,
|
||||
$arrowHeightFormat = $('.position').height()-8;
|
||||
$position = $arrow.outerHeight(true)*-1,
|
||||
$arrowHeightFormat = $arrow.outerHeight(true)/2;
|
||||
if($('#sidebar').length>0) {
|
||||
$wrap.css({'margin-left': 61});
|
||||
$wrapLeft = 61;
|
||||
@@ -270,7 +274,7 @@ if($.support.touch) {
|
||||
}
|
||||
|
||||
// Arrow defaults position
|
||||
$position = $el.eq($elIndex).offset().top-$el.eq($elIndex).height()/2+$arrowHeightFormat-$(document).scrollTop();
|
||||
$position = $el.eq($elIndex).position().top+$el.eq($elIndex).height()/2-$arrowHeightFormat+$('.scroller').position().top;
|
||||
$arrow.css({
|
||||
'top': $position,
|
||||
});
|
||||
@@ -281,7 +285,7 @@ if($.support.touch) {
|
||||
$el.on(mouseenterEvent, function(e) {
|
||||
$block.siblings().removeClass('show').eq($(this).index()).addClass('show');
|
||||
$arrow.stop(true, false).animate({
|
||||
top: ($(this).offset().top-$(this).height()/2)+$arrowHeightFormat-$(document).scrollTop(),
|
||||
top: ($(this).position().top+$(this).height()/2)-$arrowHeightFormat+$('.scroller').position().top,
|
||||
},{
|
||||
duration: 500,
|
||||
easing: 'easeInOutBack',
|
||||
@@ -325,7 +329,7 @@ if($.support.touch) {
|
||||
})
|
||||
};
|
||||
// $el.on('mouseleave', function() {
|
||||
// $el.hasClass('active') ? $position = $el.eq($elIndex).offset().top-$el.eq($elIndex).height()/2+$arrowHeightFormat-$(document).scrollTop() : 0;
|
||||
// $el.hasClass('active') ? $position = $el.eq($elIndex).position().top+$el.eq($elIndex).height()/2-$arrowHeightFormat+$('.scroller').position().top;
|
||||
// $(this).hasClass('active') ? '':$(this).children('span').removeClass('hover');
|
||||
// });
|
||||
$block.on({
|
||||
@@ -372,9 +376,9 @@ if($.support.touch) {
|
||||
|
||||
|
||||
if($elIndex === null) {
|
||||
$position = 0;
|
||||
$position = $arrow.outerHeight(true)*-1;
|
||||
} else {
|
||||
$position = $el.eq($elIndex).offset().top-$el.eq($elIndex).height()/2+$arrowHeightFormat-$(document).scrollTop();
|
||||
$position = $el.eq($elIndex).position().top+$el.eq($elIndex).height()/2-$arrowHeightFormat+$('.scroller').position().top;
|
||||
}
|
||||
$arrow.stop(true, false).animate({
|
||||
top: $position,
|
||||
@@ -409,8 +413,8 @@ if($.support.touch) {
|
||||
});
|
||||
// Sidebar Nav Drag
|
||||
if(/MSIE 8.0/g.test($ua)){
|
||||
$arrow.remove();
|
||||
$sidebarMenu.addClass('nano')
|
||||
.css({'position': 'relative', 'top': '0px'})
|
||||
.children('.scroller')
|
||||
.addClass('content')
|
||||
.removeClass('scroller');
|
||||
@@ -472,6 +476,15 @@ if($.support.touch) {
|
||||
}(window.jQuery);
|
||||
|
||||
|
||||
var ini = function() {
|
||||
api = this
|
||||
api.modal = function(e) {
|
||||
$('#dialog a.delete-item').attr("href", e);
|
||||
$('#dialog').modal('show');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var ini = function() {
|
||||
api = this
|
||||
api.modal = function(e) {
|
||||
@@ -490,15 +503,14 @@ function openSlide() {
|
||||
$(window).resize(function() {
|
||||
$(this).width() > 1440 ? $pageslideW = 1024 : $pageslideW = 954;
|
||||
})
|
||||
$openSlide.each(function() {
|
||||
if($(this).hasClass('view-page')) {
|
||||
$(this).pageslide({ W: $pageslideW, iframe: true });
|
||||
} else if($('.item-groups').length) {
|
||||
$(this).pageslide({ W: 324 });
|
||||
} else {
|
||||
$(this).pageslide();
|
||||
};
|
||||
});
|
||||
if($('.item-groups').length) {
|
||||
$os = $openSlide.not('.view-page');
|
||||
$vp = $openSlide.filter('.view-page.open-slide');
|
||||
$os.pageslide({ W: 624 });
|
||||
$vp.pageslide({ W: $pageslideW, iframe: true });
|
||||
} else {
|
||||
$openSlide.pageslide();
|
||||
};
|
||||
$('.bottomnav .open-slide').on('click', function() {
|
||||
$('.table tr').removeClass('active');
|
||||
$('.filter-item').removeClass('active')
|
||||
@@ -506,8 +518,8 @@ function openSlide() {
|
||||
}
|
||||
|
||||
function formTip() {
|
||||
if($('.main-forms').length && $('.add-on').length) {
|
||||
$('.main-forms .add-on, .main-forms .file-link').tooltip({
|
||||
if($('.main-forms').length && $('.add-on').length || $('.phtot-action').length) {
|
||||
$('.main-forms .add-on, .main-forms .file-link, .phtot-action li').tooltip({
|
||||
position: {
|
||||
my: "center bottom-4",
|
||||
at: "center top"
|
||||
@@ -565,7 +577,7 @@ $(function() {
|
||||
if($('#sidebar').length) {
|
||||
if(!/MSIE 8.0/g.test(navigator.userAgent)){
|
||||
document.getElementById('sidebar').addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
|
||||
};
|
||||
}
|
||||
}
|
||||
if($('#pageslide').length) {
|
||||
openSlide();
|
||||
|
||||
@@ -26,10 +26,11 @@ CKEDITOR.editorConfig = function( config ) {
|
||||
// config.filebrowserImageBrowseUrl = '/browser/browse.php?type=Images';
|
||||
// config.filebrowserUploadUrl = '/uploader/upload.php';
|
||||
|
||||
config.filebrowserBrowseUrl = "<%= Rails.application.routes.url_helpers.file_upload_admin_assets_path %>"
|
||||
config.filebrowserUploadUrl = "<%= Rails.application.routes.url_helpers.file_upload_admin_assets_path %>"
|
||||
config.filebrowserBrowseUrl = "<%= Rails.application.routes.url_helpers.admin_assets_path %>?module_app_id=<%= ModuleApp.first(conditions: {title: 'Asset'}).id.to_s %>";
|
||||
config.filebrowserImageBrowseUrl = "<%= Rails.application.routes.url_helpers.admin_assets_path %>?type=images&module_app_id=<%= ModuleApp.first(conditions: {title: 'Asset'}).id.to_s %>";
|
||||
// config.filebrowserUploadUrl = "<%= Rails.application.routes.url_helpers.file_upload_admin_assets_path %>";
|
||||
|
||||
config.contentsCss = '/orbit_4.0.1/assets/javascripts/lib/ckeditor/plugins/stylesheetparser/samples/assets/sample.css';
|
||||
// config.contentsCss = '/orbit_4.0.1/assets/javascripts/lib/ckeditor/plugins/stylesheetparser/samples/assets/sample.css';
|
||||
|
||||
// Load from a list of definitions.
|
||||
// config.stylesSet = [
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
(function(a){CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;"undefined"!=typeof a&&(a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g))var k=d,d=g,g=k;var i=[],d=d||{};this.each(function(){var b=
|
||||
a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,j=new a.Deferred;i.push(j.promise());if(c&&!f)g&&g.apply(c,[this]),j.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),j.resolve()):setTimeout(arguments.callee,100)},0)},null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",
|
||||
!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",[e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit();
|
||||
return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);j.resolve()}else setTimeout(arguments.callee,
|
||||
100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,i).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}}),CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var k=this,i=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});i.push(f.promise());
|
||||
return!0}return g.call(b,d)});if(i.length){var b=new a.Deferred;a.when.apply(this,i).done(function(){b.resolveWith(k)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}})))})(window.jQuery);
|
||||
@@ -17,4 +17,8 @@
|
||||
//= require desktop/jquery.gridster
|
||||
//= require desktop/books_pages
|
||||
//= require select2
|
||||
//= require jquery.isotope.min.js
|
||||
//= require orbit_js_1.0.1-front-end
|
||||
//= require ckeditor/init
|
||||
//= require ckeditor/jquery-ckeditor
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
//for forms
|
||||
//form-type = "ajax_form" will turn form to ajax submit
|
||||
//notification = string will display after the form is succesfully submitted
|
||||
//response-type = "json"|"script"|"xml|html" default is json
|
||||
|
||||
//for layout tinyscrollbar
|
||||
//content-layout="datalist|column|simple" datalist is for data list from database.. column is usually for forms and some other pages.. simple is without any columns, the page will be displayed as it is.. base width will be considered the default width for tinyscrollbar
|
||||
@@ -28,6 +29,9 @@
|
||||
//column="true" this option is only for column layout... the columns will be formed on this column=true attribute and it should be a div
|
||||
//item=true this attribute should be present in the li tag. li with this attribute are considered as a separate item.
|
||||
|
||||
//enableLanguageSelect( dom ) children <a> will be binded with language, data-lang = string ex "en"|"zh_tw" will toggle all data-langunage throughout the page
|
||||
//enableSharing( dom ) children <a> will be binded with share, data-mode = string ex "public"|"private" will change the mode for all the selected items. the dom with class should have data-link = url data-var = vaiable_name, default will be mode
|
||||
|
||||
|
||||
$.extend($.expr[':'], {
|
||||
'containsi': function (elem, i, match, array) {
|
||||
@@ -222,7 +226,8 @@ var orbitDesktop = function(dom){
|
||||
|
||||
this.bindDesktopEvents = function(){ //this function will bind the global handlers to thd desktop, for example doc
|
||||
$(".docklist a").click(function(){
|
||||
o.menu_item($(this));
|
||||
if( !$( this ).hasClass( 'disable' ) )
|
||||
o.menu_item($(this));
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -247,16 +252,12 @@ var orbitDesktop = function(dom){
|
||||
|
||||
$("body").on("submit","form[form-type=ajax_form]",function(){
|
||||
var callback_method = $(this).attr("callback-method"),
|
||||
dt = null,
|
||||
dt = ($(this).attr("response-type") == null ? "json" : $(this).attr("response-type")),
|
||||
notification = $(this).attr("notification");
|
||||
dt = $(this).attr("response-type");
|
||||
if(dt == null){
|
||||
dt = "json";
|
||||
}
|
||||
var options = {
|
||||
dataType : dt,
|
||||
resetForm : true,
|
||||
success:function(responseText, statusText, xhr, $form){
|
||||
resetForm : false,
|
||||
success: function(responseText, statusText, xhr, $form){
|
||||
if(typeof callback_method != "undefined"){
|
||||
if(callback_method != ""){
|
||||
window.o[o.data_method][callback_method](responseText,statusText,xhr,$form);
|
||||
@@ -265,7 +266,7 @@ var orbitDesktop = function(dom){
|
||||
if(typeof notification == "string")
|
||||
o.notify(notification,"success");
|
||||
},
|
||||
error:function(){
|
||||
error: function(){
|
||||
o.notify("Please try again later!","imp");
|
||||
}
|
||||
}
|
||||
@@ -274,10 +275,11 @@ var orbitDesktop = function(dom){
|
||||
});
|
||||
|
||||
$("body").on("click","*[ajax-remote]",function(){
|
||||
var $e = $(this);
|
||||
var t = $e.attr("ajax-remote");
|
||||
var classes_to_toggle = $e.attr("toggle-onclick");
|
||||
var exe = $e.attr("callback-method"); // (typeof $e.attr("callback-method") == "function"? $e.attr("callback-method") : "");
|
||||
var $e = $(this),
|
||||
t = $e.attr("ajax-remote"),
|
||||
classes_to_toggle = $e.attr("toggle-onclick"),
|
||||
responsetype = $e.attr('response-type') ? $e.attr('response-type') : "html",
|
||||
exe = $e.attr("callback-method"); // (typeof $e.attr("callback-method") == "function"? $e.attr("callback-method") : "");
|
||||
if(classes_to_toggle){
|
||||
$e.toggleClass(classes_to_toggle);
|
||||
}
|
||||
@@ -289,9 +291,9 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
var ca = $e.attr("content-holder");
|
||||
var a = function(){
|
||||
|
||||
$.ajax({
|
||||
type : t,
|
||||
dataType : responsetype,
|
||||
url : $e.attr("href"),
|
||||
success : function(data){
|
||||
if(typeof data == "string"){
|
||||
@@ -302,6 +304,7 @@ var orbitDesktop = function(dom){
|
||||
// $("div[container=true]").html(data);
|
||||
}
|
||||
}
|
||||
|
||||
if(exe)
|
||||
window.o[o.data_method][exe](data,$e);
|
||||
if(t == "delete"){
|
||||
@@ -330,13 +333,9 @@ var orbitDesktop = function(dom){
|
||||
});
|
||||
|
||||
$(window).resize(function(){
|
||||
// var ww = $(window).width();
|
||||
// $("img#thmbackground").attr({"width":ww});
|
||||
// if( $('.tinycanvas').length > 0 ){
|
||||
$('.tinycanvas').tinyscrollbar_update('relative');
|
||||
// }
|
||||
if($(o.contentHolder).find("div.app_frame").length > 0){
|
||||
$(o.contentHolder).find("div.app_frame").each(function(){
|
||||
$('.tinycanvas').tinyscrollbar_update('relative');
|
||||
if($("body").find("div.app_frame").length > 0){
|
||||
$("body").find("div.app_frame").each(function(){
|
||||
var app_holder_height = $(this).height() - 60;
|
||||
var app_holder_width = $(this).width();
|
||||
$(this).find("div.app_holder").height(app_holder_height);
|
||||
@@ -361,14 +360,6 @@ var orbitDesktop = function(dom){
|
||||
var extractLast = function( term ) {
|
||||
return split( term ).pop();
|
||||
}
|
||||
|
||||
|
||||
// $("body").on("keydown","*[autocomplete]", function( event ) {
|
||||
// var autocompleteList = $(this).attr("autocomplete-list");
|
||||
// console.log($(this));
|
||||
|
||||
// });
|
||||
//
|
||||
};
|
||||
|
||||
this.layout_data = function(h){
|
||||
@@ -460,13 +451,51 @@ var orbitDesktop = function(dom){
|
||||
$("div[container=true] div.overview").html(f.markup);
|
||||
var settings = {main : ".tinycanvas"};
|
||||
var tsettings = {};
|
||||
|
||||
var ist = function(){
|
||||
$('#holder').css('height', $('#container').height() - 72);
|
||||
$('.tinycanvas').css('height', $('#holder').height() - 36);
|
||||
var dom = $("*[isotope=true]").isotope({
|
||||
layoutMode: 'fitColumns',
|
||||
onLayout: function($elems, instance){
|
||||
$elems.width(base_width);
|
||||
setTimeout(function(){
|
||||
dom.isotope('reLayout',function(){
|
||||
$("div[container=true] div.overview").width(dom.width());
|
||||
o.tinyscrollbar.tinyscrollbar_update("relative");
|
||||
})
|
||||
},500);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(window).resize(function(){
|
||||
if($("*[isotope=true]").length > 0){
|
||||
$('#holder').css('height', $('#container').height() - 72);
|
||||
$('.tinycanvas').css('height', $('#panel_r').height() - 36);
|
||||
$(".isotope").isotope('reLayout',function(){
|
||||
$("div[container=true] div.overview").width($(".isotope").width());
|
||||
o.tinyscrollbar.tinyscrollbar_update("relative");
|
||||
});
|
||||
}
|
||||
});
|
||||
$('.s_grid_h_full').parent().css('height','100%');
|
||||
|
||||
return dom;
|
||||
}
|
||||
|
||||
if($("*[isotope=true]").length > 0){
|
||||
var dom = ist();
|
||||
f.width = dom.width();
|
||||
}
|
||||
|
||||
if(f.width){
|
||||
settings.fill = f.width;
|
||||
}
|
||||
if(pagination_variable){
|
||||
var page_no = 1;
|
||||
tsettings.onMove = function(x){
|
||||
if(x < 50){
|
||||
tsettings.onMove = function(e){
|
||||
if(e < 50){
|
||||
if(!pagination_link)
|
||||
pagination_link = o.lastlink;
|
||||
if(o.paging){
|
||||
@@ -477,6 +506,8 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// call other functions here
|
||||
o.tinyscrollbar_ext(settings,tsettings);
|
||||
o.simple_drop_down();
|
||||
@@ -484,6 +515,7 @@ var orbitDesktop = function(dom){
|
||||
o.use_select2();
|
||||
o.check_simple_layout();
|
||||
}
|
||||
|
||||
this.paging = true;
|
||||
this.pagination = function(link,variable,page_no){
|
||||
var retvalue = null;
|
||||
@@ -492,17 +524,31 @@ var orbitDesktop = function(dom){
|
||||
type : "get",
|
||||
success : function(html){
|
||||
var f = o.layout_data.generate_layout_html(html);
|
||||
// console.log(f.total)
|
||||
if(f.total > 0){
|
||||
$("div[container=true] .overview").append(f.markup);
|
||||
if(f.width){
|
||||
var w = $("div[container=true] .overview").width();
|
||||
$("div[container=true] .overview").width(w+f.width);
|
||||
if($("*[isotope=true]").length > 0){
|
||||
var $ul = $(f.markup),
|
||||
elems = $ul.children("li[item=true]");
|
||||
if(elems.length > 1)
|
||||
o.paging = true;
|
||||
else
|
||||
o.paging = false;
|
||||
$(".isotope").append(elems).isotope("appended",elems,function(){
|
||||
$(".isotope").isotope("reLayout",function(){
|
||||
$("div[container=true] div.overview").width($(".isotope").width()+50);
|
||||
o.tinyscrollbar.tinyscrollbar_update("relative");
|
||||
})
|
||||
});
|
||||
}else{
|
||||
if(f.total > 0){
|
||||
$("div[container=true] .overview").append(f.markup);
|
||||
if(f.width){
|
||||
var w = $("div[container=true] .overview").width();
|
||||
$("div[container=true] .overview").width(w+f.width);
|
||||
}
|
||||
o.tinyscrollbar.tinyscrollbar_update("relative");
|
||||
o.paging = true;
|
||||
} else {
|
||||
o.paging = false;
|
||||
}
|
||||
o.tinyscrollbar.tinyscrollbar_update("relative");
|
||||
o.paging = true;
|
||||
} else {
|
||||
o.paging = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -655,6 +701,15 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
})
|
||||
o.highlight_sub_menu_item(dom);
|
||||
} else {
|
||||
o.lastlink = dom.attr("href");
|
||||
$.ajax({
|
||||
url : dom.attr("href"),
|
||||
type : "get",
|
||||
success : function(data){
|
||||
o.layout_data(data);
|
||||
}
|
||||
})
|
||||
}
|
||||
if(dom.length == 0)
|
||||
o.layout_data(data);
|
||||
@@ -1825,6 +1880,42 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
}
|
||||
}
|
||||
this.enablelanguageSelect = function(){
|
||||
$(".language_select a").click(function(event) {
|
||||
$("*[data-language]").hide();
|
||||
$("*[data-language="+$(this).data("lang")+"]").show();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
this.enableSharing = function( dom ){
|
||||
var el = $( dom ),
|
||||
variable = ( el.data( 'var' ) ? el.data( "var" ) : "mode"),
|
||||
_url = el.data( 'link' ) + "?" + variable + "=",
|
||||
classes = [];
|
||||
|
||||
el.find( "a" ).each( function(){
|
||||
classes.push( $( this ).attr( "item-class" ) ? $( this ).attr( "item-class" ) : $( this ).data( 'mode' ) );
|
||||
})
|
||||
|
||||
el.find( "a" ).click( function(){
|
||||
var ids = [],
|
||||
mode = $( this ).data( 'mode' ),
|
||||
inject_class = $( this ).attr( 'item-class' ) ? $( this ).attr( 'item-class' ) : mode;
|
||||
|
||||
$( ".overview li[item=true] a.icon-check" ).each( function(){
|
||||
ids.push( $( this ).data( 'id' ) );
|
||||
$( "li[data-id="+ $( this ).data( 'id' ) +"]").removeClass( classes.join( " " ) ).addClass( inject_class );
|
||||
})
|
||||
$.ajax({
|
||||
url : _url + mode,
|
||||
data : {"ids" : ids},
|
||||
datatype : "json",
|
||||
})
|
||||
return false;
|
||||
})
|
||||
}
|
||||
|
||||
this.minimizeBarManager = function(){
|
||||
var minimizedApps = [],
|
||||
minimizeBar = $("#minimizebar");
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Isotope v1.5.25
|
||||
* An exquisite jQuery plugin for magical layouts
|
||||
* http://isotope.metafizzy.co
|
||||
*
|
||||
* Commercial use requires one-time purchase of a commercial license
|
||||
* http://isotope.metafizzy.co/docs/license.html
|
||||
*
|
||||
* Non-commercial use is licensed under the MIT License
|
||||
*
|
||||
* Copyright 2013 Metafizzy
|
||||
*/
|
||||
(function(a,b,c){"use strict";var d=a.document,e=a.Modernizr,f=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},g="Moz Webkit O Ms".split(" "),h=function(a){var b=d.documentElement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e<h;e++){c=g[e]+a;if(typeof b[c]=="string")return c}},i=h("transform"),j=h("transitionProperty"),k={csstransforms:function(){return!!i},csstransforms3d:function(){var a=!!h("perspective");if(a){var c=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d="@media ("+c.join("transform-3d),(")+"modernizr)",e=b("<style>"+d+"{#modernizr{height:3px}}"+"</style>").appendTo("head"),f=b('<div id="modernizr" />').appendTo("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasOwnProperty(l)||e.addTest(l,k[l]);else{e=a.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addClass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isoTransform",e),a.style[i]=m};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[j],r=h("transitionDuration"));var s=b.event,t=b.event.handle?"handle":"dispatch",u;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",u&&clearTimeout(u),u=setTimeout(function(){s[t].apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var v=["width","height"],w=b(a);b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(a){this.options=b.extend({},b.Isotope.settings,a),this.styleQueue=[],this.elemCount=0;var c=this.element[0].style;this.originalStyle={};var d=v.slice(0);for(var e in this.options.containerStyle)d.push(e);for(var f=0,g=d.length;f<g;f++)e=d[f],this.originalStyle[e]=c[e]||"";this.element.css(this.options.containerStyle),this._updateAnimationEngine(),this._updateUsingTransforms();var h={"original-order":function(a,b){return b.elemCount++,b.elemCount},random:function(){return Math.random()}};this.options.getSortData=b.extend(this.options.getSortData,h),this.reloadItems(),this.offset={left:parseInt(this.element.css("padding-left")||0,10),top:parseInt(this.element.css("padding-top")||0,10)};var i=this;setTimeout(function(){i.element.addClass(i.options.containerClass)},0),this.options.resizable&&w.bind("smartresize.isotope",function(){i.resize()}),this.element.delegate("."+this.options.hiddenClass,"click",function(){return!1})},_getAtoms:function(a){var b=this.options.itemSelector,c=b?a.filter(b).add(a.find(b)):a,d={position:"absolute"};return c=c.filter(function(a,b){return b.nodeType===1}),this.usingTransforms&&(d.left=0,d.top=0),c.css(d).addClass(this.options.itemClass),this.updateSortData(c,!0),c},_init:function(a){this.$filteredAtoms=this._filter(this.$allAtoms),this._sort(),this.reLayout(a)},option:function(a){if(b.isPlainObject(a)){this.options=b.extend(!0,this.options,a);var c;for(var d in a)c="_update"+f(d),this[c]&&this[c]()}},_updateAnimationEngine:function(){var a=this.options.animationEngine.toLowerCase().replace(/[ _\-]/g,""),b;switch(a){case"css":case"none":b=!1;break;case"jquery":b=!0;break;default:b=!e.csstransitions}this.isUsingJQueryAnimation=b,this._updateUsingTransforms()},_updateTransformsEnabled:function(){this._updateUsingTransforms()},_updateUsingTransforms:function(){var a=this.usingTransforms=this.oLine truncated
|
||||
@@ -7,32 +7,29 @@ function append_id(){
|
||||
};
|
||||
}
|
||||
|
||||
$("div.editable").live("mouseenter mouseleave", function (event) {
|
||||
$(this).children('.edit_link').toggle();
|
||||
$(document).on('change', 'select', function(e) {
|
||||
if(!e.target.className == 'widget_field_select') {
|
||||
switch(e.target.id) {
|
||||
case 'page_module_app_id':
|
||||
$.getScript($(this).attr('rel') + '?module_app_id='+$(this).val() + append_id());
|
||||
break;
|
||||
case 'page_app_frontend_url':
|
||||
case 'page_part_widget_path':
|
||||
$.getScript($(this).attr('rel') +'?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() + append_id() );
|
||||
break;
|
||||
case 'page_design':
|
||||
$.getScript($(this).attr('rel') + '?design_id=' + $(this).val() + append_id());
|
||||
break;
|
||||
case 'page_part_public_r_tag':
|
||||
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + append_id());
|
||||
break;
|
||||
};
|
||||
} else {
|
||||
$.getScript($(this).attr('rel') + '?widget_field_value='+ $(this).val()+'&dom_id=' + $(this).attr("id") + '&field_seri=' +$(this).attr('field_seri')+ '&module_app_id=' +$("#page_module_app_id,page_part_module_app_id").val() + append_id() );
|
||||
}
|
||||
});
|
||||
|
||||
$("#page_design").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?design_id=' + $(this).val() + append_id());
|
||||
});
|
||||
|
||||
|
||||
$("#module_app_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?module_app_id='+$(this).val() + append_id());
|
||||
});
|
||||
|
||||
$("#widget_list select, #frontend_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') +'?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() + append_id() );
|
||||
});
|
||||
|
||||
$("#tag_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + append_id() );
|
||||
});
|
||||
|
||||
$("select.widget_field_select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?widget_field_value='+ $(this).val()+'&dom_id=' + $(this).attr("id") + '&field_seri=' +$(this).attr('field_seri')+ '&module_app_id=' +$("#page_module_app_id,page_part_module_app_id").val() + append_id() );
|
||||
});
|
||||
|
||||
$('.part_kind').live('click', function() {
|
||||
$(document).on('click', '.part_kind', function(event) {
|
||||
$('.part_kind_partial').hide();
|
||||
$('#part_' + $(this).attr('value')).show();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,124 @@
|
||||
/* ===================================================
|
||||
* jquery-lite-image-resize v.1.0.1
|
||||
* https://github.com/RayChang/jquery-lite-image-resize
|
||||
* ===================================================
|
||||
* How to use ?
|
||||
*
|
||||
* HTML element closest to the image to add class "resizeimg".
|
||||
*
|
||||
* Example:
|
||||
* <div class="resizeimg">
|
||||
* <img src="images url" />
|
||||
* </div>
|
||||
*
|
||||
* Or you can use:
|
||||
* $('your class').rsImg();
|
||||
*
|
||||
* Note : HTML structure must be a structure like the example above.
|
||||
*
|
||||
*/
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var ResizeImg = function(element) {
|
||||
this.element = $(element);
|
||||
this.element.data('exists', true);
|
||||
};
|
||||
ResizeImg.prototype.resize = function() {
|
||||
var $img = this.element.children('img').eq(0),
|
||||
elW = this.element.innerWidth(),
|
||||
elH = this.element.innerHeight(),
|
||||
elScale = elW/elH,
|
||||
image = document.createElement("img");
|
||||
image.src = $img.attr('src');
|
||||
this.element.css({
|
||||
'position': 'relative',
|
||||
'overflow': 'hidden',
|
||||
});
|
||||
function imageLoadComplete() {
|
||||
var imgW = image.width,
|
||||
imgH = image.height,
|
||||
imgScale = imgW/imgH,
|
||||
portrait = {
|
||||
'position': 'absolute',
|
||||
'height': '100%',
|
||||
'width': 'auto',
|
||||
'max-width': 'none',
|
||||
'left': '50%',
|
||||
'top': 0,
|
||||
'margin-left': imgW*(elH/imgH)/-2
|
||||
},
|
||||
landscape = {
|
||||
'position': 'absolute',
|
||||
'height': 'auto',
|
||||
'max-height': 'none',
|
||||
'width': '100%',
|
||||
'left': 0,
|
||||
'top': '50%',
|
||||
'margin-top': imgH*(elW/imgW)/-2
|
||||
},
|
||||
center = {
|
||||
'position': 'absolute',
|
||||
'height': '100%',
|
||||
'width': '100%',
|
||||
'top': 0,
|
||||
'left': 0
|
||||
};
|
||||
if(imgScale < 1) {
|
||||
if(elScale < 1) {
|
||||
if(elScale > imgScale) {
|
||||
$img.css(landscape);
|
||||
} else {
|
||||
$img.css(portrait);
|
||||
};
|
||||
} else {
|
||||
$img.css(landscape);
|
||||
};
|
||||
};
|
||||
|
||||
if(imgScale > 1) {
|
||||
if(elScale > 1) {
|
||||
if(elScale > imgScale) {
|
||||
$img.css(landscape);
|
||||
} else {
|
||||
$img.css(portrait);
|
||||
};
|
||||
} else {
|
||||
$img.css(portrait);
|
||||
};
|
||||
};
|
||||
|
||||
if(imgScale == 1) {
|
||||
if(elScale < 1) {
|
||||
$img.css(portrait);
|
||||
} else if(elScale > 1) {
|
||||
$img.css(landscape);
|
||||
} else {
|
||||
$img.css(center);
|
||||
};
|
||||
};
|
||||
$img.fadeTo(500, 1);
|
||||
|
||||
}
|
||||
if(/MSIE 8.0/g.test($ua)) {
|
||||
imageLoadComplete();
|
||||
} else {
|
||||
image.onload = imageLoadComplete;
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.rsImg = function () {
|
||||
this.each(function () {
|
||||
if(!$(this).data('exists')) {
|
||||
$(this).children("img").fadeTo(0,0);
|
||||
new ResizeImg(this).resize();
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
$('.resizeimg').rsImg();
|
||||
});
|
||||
}(window.jQuery);
|
||||
@@ -12,13 +12,14 @@
|
||||
!(function($){
|
||||
// Convenience vars for accessing elements
|
||||
var $body = $('#main-wrap'),
|
||||
$bottomNav = $('.bottomnav'),
|
||||
$pageslide = $('#pageslide'),
|
||||
$viewPage = $('#view-page');
|
||||
|
||||
var _sliding = false, // Mutex to assist closing only once
|
||||
_lastCaller; // Used to keep track of last element to trigger pageslide
|
||||
|
||||
// If the pageslide element doesn't exist, create it
|
||||
// If the pageslide element doesn't exist, create it
|
||||
if( $pageslide.length == 0 ) {
|
||||
$pageslide = $('<div />').attr( 'id', 'pageslide' )
|
||||
.css( 'display', 'none' )
|
||||
@@ -28,11 +29,12 @@
|
||||
/*
|
||||
* Private methods
|
||||
*/
|
||||
function _load( url, useIframe ) {
|
||||
function _load( url, useIframe, callback,element ) {
|
||||
// Are we loading an element from the page or a URL?
|
||||
if ( url.indexOf("#") === 0 ) {
|
||||
// Load a page element
|
||||
$(url).clone(true).appendTo( $pageslide.empty() ).show();
|
||||
if(callback)callback.call(this,$pageslide,element);
|
||||
} else {
|
||||
// Load a URL. Into an iframe?
|
||||
if( useIframe ) {
|
||||
@@ -49,9 +51,11 @@
|
||||
$viewPage.find('.content').html( iframe );
|
||||
$viewPage.clone(true).appendTo( $pageslide.empty() ).show();
|
||||
$viewPage.find('.content').empty();
|
||||
if(callback)callback.call(this,$viewPage,element);
|
||||
} else {
|
||||
$viewPage.find('.content').load(url, function(){
|
||||
$viewPage.clone(true).appendTo( $pageslide.empty() ).show();
|
||||
if(callback)callback.call(this,$viewPage,element);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -64,10 +68,11 @@
|
||||
function _start( direction, speed ) {
|
||||
var slideWidth = $pageslide.outerWidth( true ),
|
||||
bodyAnimateIn = {},
|
||||
bottomnavAnimateIn = {},
|
||||
slideAnimateIn = {};
|
||||
|
||||
// If the slide is open or opening, just ignore the call
|
||||
if( $pageslide.is(':visible') || _sliding ) return;
|
||||
if( $pageslide.is(':visible') || _sliding ) return;
|
||||
_sliding = true;
|
||||
|
||||
switch( direction ) {
|
||||
@@ -83,6 +88,7 @@
|
||||
$pageslide.css({ left: '-' + (slideWidth-61) + 'px', right: 'auto' });
|
||||
};
|
||||
bodyAnimateIn['margin-left'] = '+=' + slideWidth;
|
||||
bottomnavAnimateIn['left'] = '+=' + slideWidth;
|
||||
if($(window).width() <= 1440 && slideWidth > 963 ) {
|
||||
bodyAnimateIn['width'] = $body.width();
|
||||
}
|
||||
@@ -92,6 +98,7 @@
|
||||
|
||||
// Animate the slide, and attach this slide's settings to the element
|
||||
$body.animate(bodyAnimateIn, speed);
|
||||
$bottomNav.animate(bottomnavAnimateIn, speed);
|
||||
$pageslide.show().animate(slideAnimateIn, speed, function() {
|
||||
_sliding = false;
|
||||
$pageslide.children('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
|
||||
@@ -108,7 +115,7 @@
|
||||
$.fn.pageslide = function(options) {
|
||||
var $elements = this;
|
||||
// On click
|
||||
$elements.on(clickEvent, function(e) {
|
||||
$elements.bind(clickEvent, function(e) {
|
||||
var $self = $(this),
|
||||
settings = $.extend({ href: $self.attr('href') }, options);
|
||||
|
||||
@@ -121,7 +128,7 @@
|
||||
$.pageslide.close();
|
||||
} else {
|
||||
// Open
|
||||
$.pageslide( settings );
|
||||
$.pageslide( settings,$self );
|
||||
|
||||
if($('.item-groups').length) {
|
||||
$('.item-menu > a, .navbar-inner').removeClass("active");
|
||||
@@ -140,7 +147,16 @@
|
||||
$pageName = $self.parents('.item-title').children('a').text();
|
||||
$('.page-name').text($pageName);
|
||||
} else if($('.tags-groups').length) {
|
||||
$(this).parents('li').addClass("active").siblings().removeClass("active").parent('ul').siblings().children('li').removeClass("active");
|
||||
if($('.gallery').length) {
|
||||
$(this).closest('.rgalbum').addClass('active-single').siblings().removeClass('active-single');
|
||||
if($(this).closest('ul').hasClass('photo-action')) {
|
||||
$('.checkbox').prop('checked', false);
|
||||
$('.rgalbum').removeClass('active');
|
||||
$('.deletephoto, .deselect, .addtags').addClass('hide');
|
||||
}
|
||||
} else {
|
||||
$(this).closest('li').addClass("active").siblings().removeClass("active").parent('ul').siblings().children('li').removeClass("active");
|
||||
}
|
||||
} else {
|
||||
$(this).parents("tr").addClass("active").siblings().removeClass("active");;
|
||||
}
|
||||
@@ -151,9 +167,9 @@
|
||||
};
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
};
|
||||
|
||||
/*
|
||||
* Default settings
|
||||
*/
|
||||
$.fn.pageslide.defaults = {
|
||||
@@ -164,18 +180,18 @@
|
||||
href: null, // Override the source of the content. Optional in most cases, but required when opening pageslide programmatically.
|
||||
W: 264,
|
||||
closeFn : null,
|
||||
openFn : null
|
||||
openFn : null,
|
||||
loadComplete : null
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
|
||||
// Open the pageslide
|
||||
$.pageslide = function( options ) {
|
||||
// Extend the settings with those the user has provided
|
||||
|
||||
// Open the pageslide
|
||||
$.pageslide = function( options,element ) {
|
||||
// Extend the settings with those the user has provided
|
||||
var settings = $.extend({}, $.fn.pageslide.defaults, options);
|
||||
|
||||
var convertToFunction = function(fn){
|
||||
var x = new Function();
|
||||
x = fn;
|
||||
@@ -190,16 +206,19 @@
|
||||
if(settings.closeFn) {
|
||||
$.fn.pageslide.defaults.closeFn = convertToFunction(settings.closeFn);
|
||||
}
|
||||
|
||||
// Are we trying to open in different direction?
|
||||
if(settings.loadComplete) {
|
||||
$.fn.pageslide.defaults.loadComplete = convertToFunction(settings.loadComplete);
|
||||
}
|
||||
|
||||
// Are we trying to open in different direction?
|
||||
if( ($pageslide.is(':visible') && $pageslide.data( 'W' ) != settings.W) || ($pageslide.is(':visible') && $pageslide.data( 'direction' ) != settings.direction) ) {
|
||||
$.pageslide.close(function(){
|
||||
$pageslide.css({'width': settings.W});
|
||||
_load( settings.href, settings.iframe );
|
||||
_load( settings.href, settings.iframe, settings.loadComplete, element );
|
||||
_start( settings.direction, settings.speed );
|
||||
});
|
||||
} else {
|
||||
_load( settings.href, settings.iframe );
|
||||
_load( settings.href, settings.iframe, settings.loadComplete,element );
|
||||
if( $pageslide.is(':hidden') ) {
|
||||
$pageslide.css({'width': settings.W});
|
||||
_start( settings.direction, settings.speed );
|
||||
@@ -218,18 +237,19 @@
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
// Close the pageslide
|
||||
$.pageslide.close = function( callback ) {
|
||||
// Close the pageslide
|
||||
$.pageslide.close = function( callback ) {
|
||||
var $pageslide = $('#pageslide'),
|
||||
slideWidth = $pageslide.outerWidth( true ),
|
||||
speed = $pageslide.data( 'speed' ),
|
||||
bodyAnimateIn = {},
|
||||
bottomnavAnimateIn = {};
|
||||
slideAnimateIn = {}
|
||||
|
||||
|
||||
// If the slide isn't open, just ignore the call
|
||||
if( $pageslide.is(':hidden') || _sliding ) return;
|
||||
if( $pageslide.is(':hidden') || _sliding ) return;
|
||||
_sliding = true;
|
||||
|
||||
switch( $pageslide.data( 'direction' ) ) {
|
||||
@@ -239,9 +259,10 @@
|
||||
break;
|
||||
default:
|
||||
bodyAnimateIn['margin-left'] = '-=' + slideWidth;
|
||||
bottomnavAnimateIn['left'] = '-=' + slideWidth;
|
||||
slideAnimateIn['left'] = '-=' + slideWidth;
|
||||
if($pageslide.find('.preview').length) {
|
||||
// $pageslide.find('.preview').cycle('destroy');
|
||||
$pageslide.find('.preview').cycle('destroy');
|
||||
$pageslide.find('.preview img').removeAttr('style');
|
||||
}
|
||||
break;
|
||||
@@ -257,11 +278,13 @@
|
||||
}
|
||||
} else if($('.tags-groups').length) {
|
||||
$('.tags-groups').children('li').removeClass("active");
|
||||
$('.rgalbum').removeClass("active-single");
|
||||
} else {
|
||||
$("tr").removeClass("active");
|
||||
};
|
||||
|
||||
$pageslide.animate(slideAnimateIn, speed);
|
||||
$bottomNav.animate(bottomnavAnimateIn, speed);
|
||||
$body.animate(bodyAnimateIn, speed, function() {
|
||||
$pageslide.hide();
|
||||
_sliding = false;
|
||||
@@ -287,26 +310,33 @@
|
||||
$.fn.pageslide.defaults.openFn = callback;
|
||||
};
|
||||
};
|
||||
|
||||
/* Events */
|
||||
|
||||
// Don't let clicks to the pageslide close the window
|
||||
|
||||
//data load complete callback
|
||||
$.pageslide.loadComplete = function(callback) {
|
||||
if(typeof callback === "function"){
|
||||
$.fn.pageslide.defaults.loadComplete = callback;
|
||||
};
|
||||
};
|
||||
|
||||
/* Events */
|
||||
|
||||
// Don't let clicks to the pageslide close the window
|
||||
$pageslide.click(function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
// Close the pageslide if the document is clicked or the users presses the ESC key, unless the pageslide is modal
|
||||
$(document).bind('click keyup', function(e) {
|
||||
// If this is a keyup event, let's see if it's an ESC key
|
||||
// Close the pageslide if the document is clicked or the users presses the ESC key, unless the pageslide is modal
|
||||
$(document).bind('click keyup', function(e) {
|
||||
// If this is a keyup event, let's see if it's an ESC key
|
||||
if( e.type == "keyup" && e.keyCode != 27) return;
|
||||
|
||||
// Make sure it's visible, and we're not modal
|
||||
if( $pageslide.is( ':visible' ) && !$pageslide.data( 'modal' ) ) {
|
||||
$.pageslide.close();
|
||||
}
|
||||
});
|
||||
|
||||
// Make sure it's visible, and we're not modal
|
||||
if( $pageslide.is( ':visible' ) && !$pageslide.data( 'modal' ) ) {
|
||||
$.pageslide.close();
|
||||
}
|
||||
});
|
||||
function setScroll(){
|
||||
$pageslide.children('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true }); // set nano scroll
|
||||
};
|
||||
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,106 @@
|
||||
var ListCheck = function(element) {
|
||||
this.element = $(element);
|
||||
this.element.data('exists', true);
|
||||
if(this.element.context.parentNode.tagName == "TD") {
|
||||
this.elementWrap = $(this.element.context.parentNode);
|
||||
this.elementWrap.addClass('listCheck');
|
||||
} else if(this.element.context.parentNode.tagName == "TH") {
|
||||
this.elementWrap = $(this.element.context.parentNode);
|
||||
this.elementWrap.addClass('listCheckHead');
|
||||
}
|
||||
this.element.before('<i class="icon-check-empty" />');
|
||||
};
|
||||
|
||||
$.fn.listCheck = function (callback) {
|
||||
this.each(function (i) {
|
||||
if(!$(this).data('exists')) {
|
||||
new ListCheck(this);
|
||||
};
|
||||
});
|
||||
this.on(clickEvent, function(e) {
|
||||
if($(this).prop('checked')) {
|
||||
$(this).siblings('i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
|
||||
} else {
|
||||
$(this).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
||||
};
|
||||
if ($(this).closest('.listCheckHead').length) {
|
||||
$('.listCheck .list-check').prop('checked', $(this).prop('checked'));
|
||||
if($(this).prop('checked')) {
|
||||
$('.listCheck i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
|
||||
} else {
|
||||
$('.listCheck i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
||||
}
|
||||
};
|
||||
|
||||
var _isCheck = $('tbody .list-check').filter(':checked').length,
|
||||
_defaultLength = $('tbody .list-check').length;
|
||||
|
||||
if(_isCheck > 0 && _isCheck < _defaultLength) {
|
||||
$('.listCheckHead i').removeClass('icon-check-empty icon-check').addClass('icon-minus');
|
||||
} else if(!_isCheck) {
|
||||
$('.listCheckHead i').removeClass('icon-minus icon-check').addClass('icon-check-empty');
|
||||
} else {
|
||||
$('.listCheckHead i').removeClass('icon-check-empty icon-minus').addClass('icon-check');
|
||||
}
|
||||
_isCheck ? $('.list-active-btn').removeClass('disabled').data('actionable', true) : $('.list-active-btn').addClass('disabled').data('actionable', false);
|
||||
});
|
||||
};
|
||||
function clearCheck() {
|
||||
$('.list-check').each(function() {
|
||||
$(this).prop('checked', false);
|
||||
})
|
||||
}
|
||||
function actionSuccess(e) {
|
||||
$("tbody .list-check").each(function() {
|
||||
switch(e) {
|
||||
case 'list-be-hide':
|
||||
$(this).filter(':checked').closest('tr').addClass('checkHide');
|
||||
break;
|
||||
case 'list-be-show':
|
||||
$(this).filter(':checked').closest('tr').removeClass('checkHide');
|
||||
break;
|
||||
case 'list-be-remove':
|
||||
$(this).filter(':checked').closest('tr').fadeOut(300, function() {
|
||||
$(this).remove();
|
||||
});
|
||||
break;
|
||||
};
|
||||
$('.list-check').siblings('i').removeAttr('class').addClass('icon-check-empty').closest('tr').removeClass('checkHit');
|
||||
});
|
||||
clearCheck();
|
||||
}
|
||||
$(function() {
|
||||
var $t = null,
|
||||
_data = null;
|
||||
clearCheck();
|
||||
$('.list-check').listCheck();
|
||||
$('.list-active-btn').data('actionable', false).on(clickEvent, function(e) {
|
||||
$t = $(this)
|
||||
_data = $(this).data()
|
||||
_data.actionable ? $('#dialog').modal('show') : "";
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$("#dialog").on(clickEvent, '.delete-item', function() {
|
||||
var _v = [],
|
||||
_t = $t.attr("rel");
|
||||
|
||||
$("tbody .list-check:checked").each(function() {
|
||||
_v.push(this.value);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url : _t,
|
||||
type:"get",
|
||||
data : {"ids":_v},
|
||||
dataType : "json",
|
||||
success : function(){
|
||||
actionSuccess(_data.checkAction);
|
||||
}
|
||||
})
|
||||
|
||||
$('#dialog').modal('hide');
|
||||
$('.list-active-btn').addClass('disabled').data('actionable', false);
|
||||
})
|
||||
|
||||
});
|
||||
@@ -1,37 +1,3 @@
|
||||
function loadViewPage(url, id) {
|
||||
var $listView = $(id);
|
||||
|
||||
$listView.empty().removeClass('in active');
|
||||
$listView.load(url, function(response, status, xhr) {
|
||||
$(this).addClass('in active');
|
||||
$('#member-card').imagesLoaded(function() {
|
||||
$('#member-card .member-avatar img').muImageResize({width: 150, height:150});
|
||||
});
|
||||
$('#member-abstract').imagesLoaded(function() {
|
||||
$('#member-abstract .member-avatar img').muImageResize({width: 250, height:120});
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$search = window.location.pathname.substring(1);
|
||||
$search = $search.split("/");
|
||||
$search = $search[$search.length-1];
|
||||
$viewType = window.localStorage.getItem('viewType') || '#member-list';
|
||||
$viewSwitchNo = window.localStorage.getItem('viewSwitchNo') || 0;
|
||||
if($search == 'users-registrant-list.shtml') {
|
||||
loadViewPage('member-registrant-list.html ' + $viewType, '#list-view');
|
||||
} else {
|
||||
loadViewPage('member-list.html ' + $viewType, '#list-view');
|
||||
};
|
||||
$('.view-switch').children('.btn').eq($viewSwitchNo).addClass('active');
|
||||
$('.view-switch').delegate(".btn", 'click', function(e){
|
||||
var url = $(this).attr('href'),
|
||||
ID = url.split("#"),
|
||||
ID = '#' + ID[ID.length-1];
|
||||
window.localStorage.setItem('viewType', ID);
|
||||
window.localStorage.setItem('viewSwitchNo', $(this).index());
|
||||
loadViewPage(url, '#list-view');
|
||||
e.preventDefault();
|
||||
});
|
||||
$('.member-avatar').rsImg();
|
||||
})
|
||||
@@ -1,3 +1,4 @@
|
||||
var H,P = [];
|
||||
// Go to
|
||||
!function ($) {
|
||||
$.fn.goTo = function (){
|
||||
@@ -13,43 +14,45 @@
|
||||
}
|
||||
}(window.jQuery);
|
||||
function checkHeight() {
|
||||
if($('#member-module').height() > $(window).height()) {
|
||||
H = $(window).height()-
|
||||
parseInt($('.wrap-inner').css('padding-top'))+
|
||||
parseInt($('.wrap-inner').css('padding-bottom'))-
|
||||
$('#orbit-bar').outerHeight(true);
|
||||
}else{
|
||||
H = $(window).height()-
|
||||
parseInt($('.wrap-inner').css('padding-top'))+
|
||||
parseInt($('.wrap-inner').css('padding-bottom'))-
|
||||
$('#filter').outerHeight()+
|
||||
parseInt($('#filter').css('margin-bottom'))-
|
||||
$('#orbit-bar').outerHeight(true);
|
||||
};
|
||||
// if($('#member-module').height() > $(window).height()) {
|
||||
// H = $(window).height()-
|
||||
// parseInt($('.wrap-inner').css('padding-top'))+
|
||||
// parseInt($('.wrap-inner').css('padding-bottom'))-
|
||||
// $('#orbit-bar').outerHeight(true);
|
||||
// }else{
|
||||
// H = $(window).height()-
|
||||
// parseInt($('.wrap-inner').css('padding-top'))+
|
||||
// parseInt($('.wrap-inner').css('padding-bottom'))-
|
||||
// $('#filter').outerHeight()+
|
||||
// parseInt($('#filter').css('margin-bottom'))-
|
||||
// $('#orbit-bar').outerHeight(true);
|
||||
// };
|
||||
H = $(window).height()-
|
||||
parseInt($('.wrap-inner').css('padding-top'))-
|
||||
$('#orbit-bar').outerHeight(true);
|
||||
$('#basic-info').height(H);
|
||||
$('#member-roles').height(H-$('.member-avatar').outerHeight(true)-parseInt($('#member-roles').css('margin-top')))
|
||||
$('#member-roles').height(H-$('.member-avatar').outerHeight(true)-parseInt($('#member-roles').css('margin-top'))+20);
|
||||
$('#module-content').height(H-$('#module-navbar .navbar').outerHeight(true)-$('.bottomnav').innerHeight());
|
||||
};
|
||||
|
||||
$(function() {
|
||||
var H;
|
||||
checkHeight();
|
||||
$(window).resize(function() {
|
||||
checkHeight();
|
||||
// setModuleBlockWidth();
|
||||
});
|
||||
$('.wrap-inner').css('padding-bottom', 0);
|
||||
$(window).resize(checkHeight);
|
||||
$('#member-roles h4 > span').each(function() {
|
||||
$(this).css('margin-left',function() {
|
||||
return $(this).innerWidth()/2*-1;
|
||||
})
|
||||
})
|
||||
$('#basic-info').scrollToFixed({
|
||||
marginTop: $('#orbit-bar').outerHeight(true)+20,
|
||||
});
|
||||
$('#module-navbar').scrollToFixed({
|
||||
marginTop: $('#orbit-bar').outerHeight(true),
|
||||
});
|
||||
// $('#basic-info').scrollToFixed({
|
||||
// marginTop: $('#orbit-bar').outerHeight(true)+20,
|
||||
// });
|
||||
// $('#module-navbar').scrollToFixed({
|
||||
// marginTop: $('#orbit-bar').outerHeight(true),
|
||||
// });
|
||||
// $('.member-avatar').imagesLoaded(function() {
|
||||
// $('#basic-info .member-avatar img').muImageResize({width: 100, height:100});
|
||||
// });
|
||||
$('#member-roles').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
|
||||
})
|
||||
$('.member-avatar').rsImg();
|
||||
$('#member-roles, #module-content .nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
|
||||
});
|
||||
@@ -191,12 +191,17 @@ function returnAddressForm(element, decide) {
|
||||
|
||||
$(function() {
|
||||
appendIndex = null;
|
||||
if($('#new-user-forms').length) {
|
||||
if($('#user-forms').length) {
|
||||
addressVal = [];
|
||||
addressArray = [];
|
||||
addressInputId = [];
|
||||
roleType = null;
|
||||
returnDecide = false;
|
||||
$('.attributes').each(function() {
|
||||
if($(this).find('.toggle-check').attr('value') == "true") {
|
||||
$(this).addClass('disabled').children('.attributes-body').hide();
|
||||
}
|
||||
});
|
||||
$('.returnDecide').on(clickEvent, function() {
|
||||
returnDecide = true;
|
||||
})
|
||||
@@ -215,21 +220,21 @@ $(function() {
|
||||
});
|
||||
$('#address-field').on('show', getAddressForm($trigger, $('#address-field'), true));
|
||||
});
|
||||
$('#new-user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
||||
$('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
||||
if($(this).hasClass('togglebox')) {
|
||||
if($(this).hasClass('disabled')) {
|
||||
$(this).find('.toggle-check')
|
||||
.attr('value', 'false')
|
||||
.closest('.attributes')
|
||||
.removeClass('disabled')
|
||||
.find('.attributes-body')
|
||||
.children('.attributes-body')
|
||||
.fadeIn(300);
|
||||
} else {
|
||||
$(this).find('.toggle-check')
|
||||
.attr('value', 'true')
|
||||
.closest('.attributes')
|
||||
.addClass('disabled')
|
||||
.find('.attributes-body')
|
||||
.children('.attributes-body')
|
||||
.fadeOut(300);
|
||||
}
|
||||
$(this).toggleClass('disabled');
|
||||
@@ -422,12 +427,13 @@ $(function() {
|
||||
if($(this).hasClass('trigger')) {
|
||||
// appendIndex = $(this).closest('.controls').find('.input-append').length;
|
||||
appendIndex = $(this).closest('.controls').find('.input-append:last-child').children('input:first-child').attr('name');
|
||||
appendIndex = appendIndex.split("][");
|
||||
appendIndex = parseInt(appendIndex[appendIndex.length-2])+1;
|
||||
// appendIndex = appendIndex.split("][");
|
||||
// appendIndex = parseInt(appendIndex[appendIndex.length-2])+1;
|
||||
appendIndex = parseInt(appendIndex.match(/[^[\D\]]+(?=])/g)[1])+1;
|
||||
console.log(appendIndex)
|
||||
attributeIndex = $(this).closest('.attributes').index();
|
||||
templateType = $(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref');
|
||||
$("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target'));
|
||||
|
||||
inputAppendLength();
|
||||
};
|
||||
if($(this).hasClass('remove-input')) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$(function() {
|
||||
function textareaResizable() {
|
||||
var $btnW = null,
|
||||
$textareaLangBtnGroup = $('.textarea-lang > .btn-group'),
|
||||
$textareaLang = $('.textarea-lang'),
|
||||
@@ -8,12 +8,12 @@ $(function() {
|
||||
$btnW = 4
|
||||
$(this).find('.btn').each(function() {
|
||||
$btnW += $(this).outerWidth(true);
|
||||
$(this).on('click', function() {
|
||||
$(this).on(clickEvent, function() {
|
||||
var $id = $($(this).attr('href'));
|
||||
if($id.find('.ui-wrapper').height() < 96) {
|
||||
$id.find('.ui-wrapper').height(96)
|
||||
}
|
||||
})
|
||||
};
|
||||
});
|
||||
});
|
||||
});
|
||||
$textarea.each(function() {
|
||||
@@ -26,4 +26,7 @@ $(function() {
|
||||
minWidth: $btnW+114,
|
||||
handles: "se",
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
textareaResizable();
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
$(function() {
|
||||
$('.module-area [data-toggle=buttons-checkbox]').find('input[type="checkbox"]').each(function() {
|
||||
$(this).prop('checked') ? $(this).siblings('input[type="hidden"]').val(1) : $(this).siblings('input[type="hidden"]').val(0);
|
||||
});
|
||||
$('.module-area').delegate('input[type="checkbox"]', clickEvent, function(event) {
|
||||
$(this).prop('checked') ? $(this).siblings('input[type="hidden"]').val(1) : $(this).siblings('input[type="hidden"]').val(0);
|
||||
});
|
||||
});
|
||||
@@ -83,6 +83,7 @@ legend {
|
||||
min-width: 61px;
|
||||
z-index: 1030;
|
||||
position: fixed;
|
||||
padding-top: 40px;
|
||||
background-color: #171717;
|
||||
-webkit-box-shadow: inset -1px 0px 10px #000000;
|
||||
-moz-box-shadow: inset -1px 0px 10px #000000;
|
||||
@@ -91,12 +92,14 @@ legend {
|
||||
}
|
||||
#sidebar #sidebar-menu {
|
||||
position: absolute;
|
||||
top: 88px;
|
||||
top: 85px;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
z-index: 0;
|
||||
display: block;
|
||||
width: 61px;
|
||||
/*overflow: auto;*/
|
||||
}
|
||||
#sidebar #sidebar-menu.nano {
|
||||
top: 0;
|
||||
}
|
||||
#sidebar .scroller {
|
||||
position: absolute;
|
||||
@@ -120,16 +123,12 @@ legend {
|
||||
list-style: none;
|
||||
}
|
||||
#sidebar > h2.position {
|
||||
top: 40px;
|
||||
margin: 0;
|
||||
width: 61px;
|
||||
color: #FFFFFF;
|
||||
font-weight: normal;
|
||||
font-size: 2.4em;
|
||||
line-height: 47px;
|
||||
line-height: 46px\9;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
position: relative;
|
||||
background-color: #08c;
|
||||
background-image: -moz-linear-gradient(top, #08c, #006091);
|
||||
background-image: -ms-linear-gradient(top, #08c, #006091);
|
||||
@@ -158,24 +157,20 @@ legend {
|
||||
}
|
||||
#sidebar > h2.position a {
|
||||
color: #FFFFFF;
|
||||
padding: 6px 6px 5px;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
-webkit-text-shadow: 0px -1px 0px #333333;
|
||||
-moz-text-shadow: 0px -1px 0px #333333;
|
||||
-o-text-shadow: 0px -1px 0px #333333;
|
||||
text-shadow: 0px -1px 0px #333333;
|
||||
}
|
||||
#sidebar > h2.position a i {
|
||||
line-height: 45px;
|
||||
}
|
||||
#sidebar .sidebar-nav > li {
|
||||
min-width: 61px;
|
||||
height: 45px;
|
||||
}
|
||||
#sidebar .sidebar-nav > li.active {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
#sidebar .sidebar-nav > li.active .sub-nav-block {
|
||||
display: block;
|
||||
}
|
||||
#sidebar .sidebar-nav > li.active > a > span {
|
||||
#sidebar .sidebar-nav > li.active span {
|
||||
color: #FFFFFF;
|
||||
cursor: pointer;
|
||||
-webkit-text-shadow: 0px -1px 0px #636363;
|
||||
@@ -183,8 +178,7 @@ legend {
|
||||
-o-text-shadow: 0px -1px 0px #636363;
|
||||
text-shadow: 0px -1px 0px #636363;
|
||||
}
|
||||
#sidebar .sidebar-nav > li > a > span {
|
||||
padding: 10px;
|
||||
#sidebar .sidebar-nav > li span {
|
||||
color: #B0B0B0;
|
||||
display: block;
|
||||
-webkit-text-shadow: 0px 1px 0px #000000;
|
||||
@@ -192,8 +186,15 @@ legend {
|
||||
-o-text-shadow: 0px 1px 0px #000000;
|
||||
text-shadow: 0px 1px 0px #000000;
|
||||
}
|
||||
#sidebar .sidebar-nav > li > a > span > i {
|
||||
font-size: 1.7em;
|
||||
#sidebar .sidebar-nav > li a {
|
||||
display: block;
|
||||
}
|
||||
#sidebar .sidebar-nav > li i {
|
||||
font-size: 1.6em;
|
||||
line-height: 60px;
|
||||
}
|
||||
#sidebar .sidebar-nav > li.active i {
|
||||
font-size: 2.2em;
|
||||
}
|
||||
#sidebar .sub-nav-block-list {
|
||||
top: 40px;
|
||||
@@ -274,7 +275,7 @@ legend {
|
||||
}
|
||||
#sidebar .sub-nav-arrow {
|
||||
left: 53px;
|
||||
top: -10px;
|
||||
top: -16px;
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
z-index: -1;
|
||||
@@ -282,7 +283,6 @@ legend {
|
||||
border-style: solid;
|
||||
border-width: 8px 8px 8px 0;
|
||||
border-color: transparent #0088CC transparent transparent;
|
||||
display: none\9; /* 用IE的去死 */
|
||||
}
|
||||
|
||||
|
||||
@@ -300,14 +300,15 @@ legend {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
width: 100%;
|
||||
border-radius: 1px;
|
||||
background-color: rgba(0, 136, 204, .3);
|
||||
border-radius: 50%/1px;
|
||||
background-color: rgba(0, 136, 204, .6);
|
||||
}
|
||||
|
||||
|
||||
/* Main Wrap */
|
||||
#main-wrap {
|
||||
padding-top: 40px;
|
||||
position: relative;
|
||||
}
|
||||
#main-wrap .wrap-inner {
|
||||
padding: 60px 20px 20px;
|
||||
@@ -419,6 +420,7 @@ legend {
|
||||
/* Search Clear */
|
||||
.searchClear {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
.searchClear .icon-search {
|
||||
position: absolute;
|
||||
@@ -520,10 +522,9 @@ legend {
|
||||
padding: 0px 5px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
max-width: 500px;
|
||||
max-width: 300px;
|
||||
border-radius: 3px;
|
||||
background-color: #0088CC;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#sideset .ui-tooltip.sidebar-tooltip:after {
|
||||
display: none;
|
||||
@@ -533,10 +534,9 @@ legend {
|
||||
padding: 0px 5px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
max-width: 500px;
|
||||
max-width: 300px;
|
||||
border-radius: 3px;
|
||||
background-color: #000000;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.ui-tooltip:after {
|
||||
content: '';
|
||||
@@ -551,6 +551,135 @@ legend {
|
||||
border-color: #000000 transparent transparent transparent;
|
||||
}
|
||||
|
||||
/* Sign In */
|
||||
#sign-in {
|
||||
background-color: #F3F3F3;
|
||||
background-repeat: no-repeat;
|
||||
background : -webkit-radial-gradient(center center,circle cover, #F3F3F3 10%, #DBDBDB 100%);
|
||||
background : -moz-radial-gradient(center center,circle cover, #F3F3F3 10%, #DBDBDB 100%);
|
||||
background : -o-radial-gradient(center center,circle cover, #F3F3F3 10%, #DBDBDB 100%);
|
||||
background : -ms-radial-gradient(center center,circle cover, #F3F3F3 10%, #DBDBDB 100%);
|
||||
background : -radial-gradient(center center,circle cover, #F3F3F3 10%, #DBDBDB 100%);
|
||||
}
|
||||
.sign-in {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
width: 300px;
|
||||
margin: 150px auto 0;
|
||||
}
|
||||
.sign-in .other-sign-in {
|
||||
display: none;
|
||||
}
|
||||
.sign-in .login-logo {
|
||||
margin: 0;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid #ededed;
|
||||
}
|
||||
.sign-in .alert {
|
||||
box-shadow: 0 3px 10px #CBCBCB;
|
||||
text-align: left;
|
||||
}
|
||||
.sign-in .form {
|
||||
background-color: #FFF;
|
||||
box-shadow: 0 10px 20px #CBCBCB;
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.sign-in .form-block {
|
||||
overflow: hidden;
|
||||
}
|
||||
.sign-in .form-list {
|
||||
width: 555px;
|
||||
}
|
||||
.sign-in .content {
|
||||
float: left;
|
||||
margin-bottom: 0;
|
||||
position: relative;
|
||||
}
|
||||
.sign-in .content + .content {
|
||||
margin-left: 15px;
|
||||
}
|
||||
.sign-in .control-group {
|
||||
position: relative;
|
||||
width: 270px;
|
||||
margin: 0;
|
||||
}
|
||||
.sign-in .control-group label {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 39px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
margin: 0;
|
||||
color: #5C5C5C;
|
||||
}
|
||||
.sign-in .control-group input {
|
||||
width: 222px;
|
||||
height: 30px;
|
||||
padding: 4px 6px 4px 40px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.sign-in .btn {
|
||||
display: block;
|
||||
padding: 4px 0;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.sign-in .other-sign-in {
|
||||
position: relative;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 30px;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid #ededed;
|
||||
}
|
||||
.sign-in .other-sign-in p {
|
||||
position: absolute;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background-color: #FFF;
|
||||
padding: 0 10px;
|
||||
margin-bottom: 0;
|
||||
margin-left: -25px;
|
||||
line-height: 30px;
|
||||
left: 50%;
|
||||
bottom: -15px;
|
||||
font-size: 1.3em;
|
||||
color: #b1b1b1;
|
||||
}
|
||||
.sign-in .checkbox {
|
||||
position: absolute;
|
||||
text-align: left;
|
||||
bottom: 47px;
|
||||
}
|
||||
.sign-in .switchboard {
|
||||
color: #08C;
|
||||
cursor: pointer;
|
||||
}
|
||||
.sign-in .switchboard span,
|
||||
.sign-in .switchboard.active i {
|
||||
display: inline;
|
||||
}
|
||||
.sign-in .switchboard.active span,
|
||||
.sign-in .switchboard i {
|
||||
display: none;
|
||||
}
|
||||
.register {
|
||||
box-shadow: inset 0 5px 5px #E0E0E0;
|
||||
background-color: #eee;
|
||||
padding: 15px;
|
||||
margin: 15px -15px -15px;
|
||||
}
|
||||
.register .btn {
|
||||
margin: 0;
|
||||
}
|
||||
.have-other-sign-in {
|
||||
margin: 80px auto 0;
|
||||
}
|
||||
.have-other-sign-in .other-sign-in {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* IE go die */
|
||||
:root #sidebar .sub-nav-block:before {
|
||||
display: block\9;
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
top: 0px;
|
||||
left: -10px;
|
||||
right: -10px;
|
||||
height: 40px;
|
||||
z-index: 1041;
|
||||
position: fixed;
|
||||
margin-bottom: 0;
|
||||
height: 40px;
|
||||
}
|
||||
#orbit-bar .orbitlogo {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
padding: 0!important;
|
||||
background-size: 70%;
|
||||
display: inline-block;
|
||||
display: block;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url(<%= asset_path 'orbit-logo.svg' %>);
|
||||
@@ -19,8 +20,23 @@
|
||||
/* For Suck IE */
|
||||
background-image: url(<%= asset_path 'orbit-logo.png' %>)\9;
|
||||
}
|
||||
#orbit-bar .dropdown-menu li > a {
|
||||
padding: 0 20px;
|
||||
display: block;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
#orbit-bar .dropdown-menu li i {
|
||||
float: left;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
line-height: 30px;
|
||||
height: 100%;
|
||||
}
|
||||
#orbit-bar.navbar .nav > li > a {
|
||||
color: #EEE;
|
||||
padding: 0 15px;
|
||||
display: block;
|
||||
text-shadow: 0 -1px 0 #000;
|
||||
border-right: 1px solid #363636;
|
||||
box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.3);
|
||||
@@ -34,6 +50,11 @@
|
||||
background-color: #0095CF;
|
||||
text-shadow: 0 -1px 0 #014380;
|
||||
}
|
||||
#orbit-bar.navbar .nav > li > a > [class^="icon"],
|
||||
#orbit-bar.navbar .nav > li > a > [class*=" icon"] {
|
||||
line-height: 40px;
|
||||
display: block;
|
||||
}
|
||||
#orbit-bar.navbar .nav li.dropdown.open > .dropdown-toggle,
|
||||
#orbit-bar.navbar .nav li.dropdown.active > .dropdown-toggle,
|
||||
#orbit-bar.navbar .nav li.dropdown.open.active > .dropdown-toggle {
|
||||
@@ -41,9 +62,7 @@
|
||||
text-shadow: 0 -1px 0 #014380;
|
||||
}
|
||||
#orbit-bar .navbar-inner {
|
||||
height: 40px;
|
||||
border-width: 0;
|
||||
min-height: 40px;
|
||||
background-color: #333333;
|
||||
-webkit-border-radius: 0px;
|
||||
-moz-border-radius: 0px;
|
||||
@@ -66,6 +85,10 @@
|
||||
right: auto;
|
||||
bottom: auto;
|
||||
}
|
||||
#orbit-bar .nav > li {
|
||||
display: block;
|
||||
line-height: 40px;
|
||||
}
|
||||
#orbit-bar .nav [class^="icon"],
|
||||
#orbit-bar .nav [class*=" icon"] {
|
||||
font-size: 1.5em;
|
||||
@@ -92,17 +115,45 @@
|
||||
#orbit-bar .modal .input-prepend {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
#orbit-bar .modal .other-sign-in {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 30px;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid #EDEDED;
|
||||
}
|
||||
#orbit-bar .modal .other-sign-in .btn {
|
||||
padding: 4px 0;
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
#orbit-bar .modal .other-sign-in p {
|
||||
position: absolute;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background-color: #FFF;
|
||||
padding: 0 10px;
|
||||
margin-bottom: 0;
|
||||
margin-left: -25px;
|
||||
line-height: 30px;
|
||||
left: 50%;
|
||||
bottom: -15px;
|
||||
font-size: 1.3em;
|
||||
color: #B1B1B1;
|
||||
}
|
||||
|
||||
/*Search*/
|
||||
#orbit-bar #search {
|
||||
margin-bottom: 0;
|
||||
position: relative;
|
||||
padding: 8px 10px 0;
|
||||
padding: 0 10px;
|
||||
border-right: 1px solid #363636;
|
||||
box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
#orbit-bar #search form {
|
||||
margin-bottom: 8px;
|
||||
margin: 8px 0;
|
||||
}
|
||||
#orbit-bar #search input[type="text"] {
|
||||
height: 14px;
|
||||
@@ -110,6 +161,7 @@
|
||||
font-size: 13px;
|
||||
padding-left: 25px;
|
||||
padding-right: 25px;
|
||||
display: block;
|
||||
-webkit-border-radius: 12px;
|
||||
-moz-border-radius: 12px;
|
||||
-o-border-radius: 12px;
|
||||
@@ -122,15 +174,16 @@
|
||||
#orbit-bar #search .search-clear {
|
||||
position: absolute;
|
||||
color: #A3A3A3;
|
||||
top: 14px;
|
||||
top: 16px;
|
||||
}
|
||||
#orbit-bar #search .icon-search {
|
||||
left: 13px;
|
||||
top: 15px;
|
||||
left: 15px;
|
||||
font-size: 1.2em;
|
||||
width: 1.25em;
|
||||
margin-top: 0;
|
||||
}
|
||||
#orbit-bar #search .search-clear {
|
||||
right: 14px;
|
||||
right: 13px;
|
||||
font-size: 1.3em;
|
||||
}
|
||||
#orbit-bar #search .search-clear:hover {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.noSelect {
|
||||
.noSelect, .noSelect * {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
@@ -220,7 +220,7 @@
|
||||
.s_form .s_table td {
|
||||
vertical-align: middle; }
|
||||
.s_form .s_table thead th {
|
||||
border-bottom: solid 1px #eeeeee; }
|
||||
border-bottom: solid 1px #eee; }
|
||||
|
||||
/* simple select */
|
||||
.s_select_g {
|
||||
@@ -311,7 +311,7 @@
|
||||
width: 16px;
|
||||
height: 20px;
|
||||
background-color: #000;
|
||||
border: solid 2px white;
|
||||
border: solid 2px #fff;
|
||||
cursor: pointer;
|
||||
-webkit-transition: left 0.3s ease;
|
||||
-moz-transition: left 0.3s ease;
|
||||
@@ -366,7 +366,7 @@
|
||||
width: 100%; }
|
||||
.tinycanvas .overview > .column {
|
||||
float: left;
|
||||
border-right: solid 1px #eeeeee;
|
||||
border-right: solid 1px #eee;
|
||||
padding: 0 12px 0 0;
|
||||
margin: 0 12px 0 0;
|
||||
height: 100%; }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@import "desktop-helper";
|
||||
|
||||
.noSelect {
|
||||
.noSelect, .noSelect * {
|
||||
@include no-select;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,14 @@
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
.form_fix {
|
||||
textarea {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
input {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
// fixed width column with 12px gutter
|
||||
// 276px width for 8 columns
|
||||
// 420px width for 12 columns
|
||||
|
||||
@@ -223,7 +223,8 @@ a.admtxt.admbg2:hover {
|
||||
width: 100%; }
|
||||
|
||||
.pw {
|
||||
width: 540px; }
|
||||
/*width: 540px;*/
|
||||
}
|
||||
|
||||
.h1 {
|
||||
height: 120px; }
|
||||
@@ -322,6 +323,29 @@ a.admtxt.admbg2:hover {
|
||||
float: left; }
|
||||
.docklist .d_cate:hover .dock_child {
|
||||
display: block; }
|
||||
.disable {
|
||||
opacity: .3;
|
||||
}
|
||||
.disable a {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.private {
|
||||
position: relative;
|
||||
padding-right: 10px;
|
||||
width: 300px;
|
||||
opacity: .3 !important;
|
||||
}
|
||||
.private:after {
|
||||
content: "\e073";
|
||||
display: inline-block;
|
||||
font-family: 'entypo';
|
||||
font-size: 1.5em;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
text-decoration: inherit;
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
.fn_des.admtxt {
|
||||
line-height: 60px;
|
||||
@@ -375,7 +399,8 @@ a.admtxt.admbg2:hover {
|
||||
background-color: #fff;
|
||||
margin-left: 252px;
|
||||
position: relative;
|
||||
width: auto; }
|
||||
width: calc(100% - 272px);
|
||||
}
|
||||
|
||||
/* Desktop Notification */
|
||||
#orbitnote {
|
||||
@@ -712,7 +737,8 @@ a.admtxt.admbg2:hover {
|
||||
|
||||
/* list item */
|
||||
.list_t_item {
|
||||
overflow: hidden; }
|
||||
overflow: hidden;
|
||||
height: 100px; }
|
||||
|
||||
.list_t_title {
|
||||
padding-bottom: 6px;
|
||||
@@ -746,7 +772,8 @@ a.admtxt.admbg2:hover {
|
||||
-webkit-text-size-adjust: none; }
|
||||
.list_item_function a :first-child {
|
||||
margin-left: 0; }
|
||||
.datalist_item:hover .list_item_function {
|
||||
.datalist_item:hover .list_item_function,
|
||||
.list_t_item:hover .list_item_function {
|
||||
bottom: 0; }
|
||||
|
||||
/* App */
|
||||
@@ -798,7 +825,7 @@ a.admtxt.admbg2:hover {
|
||||
/*Tooltip popup */
|
||||
.desktop_toolpopup {
|
||||
position: absolute;
|
||||
z-index: 10px;
|
||||
z-index: 10;
|
||||
display: none;
|
||||
padding: 12px;
|
||||
cursor: default;
|
||||
|
||||
@@ -824,7 +824,7 @@ a:focus { outline: none; }
|
||||
/*Tooltip popup */
|
||||
.desktop_toolpopup {
|
||||
position: absolute;
|
||||
z-index: 10px;
|
||||
z-index: 10;
|
||||
display: none;
|
||||
padding: 12px;
|
||||
cursor: default;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
@media only screen and (min-width: 1240px){
|
||||
|
||||
#panel_r.pw { width: 800px; }
|
||||
/*#panel_r.pw { width: 800px; }*/
|
||||
|
||||
}
|
||||
@media only screen and (min-width: 1900px){
|
||||
|
||||
#panel_r.pw { width: 1400px; }
|
||||
/*#panel_r.pw { width: 1400px; }*/
|
||||
|
||||
}
|
||||
@@ -14,4 +14,5 @@
|
||||
*= require desktop/desktop-media
|
||||
*= require desktop/desktop-select2
|
||||
*= require desktop/desktop-timeline
|
||||
*= require desktop/isotope.css
|
||||
*/
|
||||
@@ -0,0 +1,72 @@
|
||||
#side {
|
||||
height: auto;
|
||||
min-height: 516px;
|
||||
right: 0;
|
||||
bottom: 12px;
|
||||
}
|
||||
#rwidget {
|
||||
height: 100%;
|
||||
}
|
||||
#container {
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 12px;
|
||||
left: 0;
|
||||
min-height: 588px;
|
||||
}
|
||||
#panel_l, #panel_r {
|
||||
height: 100%;
|
||||
}
|
||||
.isotope {
|
||||
height: 100%;
|
||||
}
|
||||
.isotope .s_grid_row {
|
||||
width: 420px;
|
||||
margin: 0 24px 12px 0;
|
||||
}
|
||||
.s_grid_row .s_grid_h_full {
|
||||
height: 100%;
|
||||
}
|
||||
.list_t_item {
|
||||
float: left;
|
||||
display: inline;
|
||||
}
|
||||
.isotope,
|
||||
.isotope .isotope-item {
|
||||
/* change duration value to whatever you like */
|
||||
-webkit-transition-duration: 0.8s;
|
||||
-moz-transition-duration: 0.8s;
|
||||
-ms-transition-duration: 0.8s;
|
||||
-o-transition-duration: 0.8s;
|
||||
transition-duration: 0.8s;
|
||||
}
|
||||
|
||||
.isotope {
|
||||
-webkit-transition-property: height, width;
|
||||
-moz-transition-property: height, width;
|
||||
-ms-transition-property: height, width;
|
||||
-o-transition-property: height, width;
|
||||
transition-property: height, width;
|
||||
}
|
||||
|
||||
.isotope .isotope-item {
|
||||
-webkit-transition-property: -webkit-transform, opacity;
|
||||
-moz-transition-property: -moz-transform, opacity;
|
||||
-ms-transition-property: -ms-transform, opacity;
|
||||
-o-transition-property: -o-transform, opacity;
|
||||
transition-property: transform, opacity;
|
||||
}
|
||||
|
||||
/**** disabling Isotope CSS3 transitions ****/
|
||||
|
||||
.isotope.no-transition,
|
||||
.isotope.no-transition .isotope-item,
|
||||
.isotope .isotope-item.no-transition {
|
||||
-webkit-transition-duration: 0s;
|
||||
-moz-transition-duration: 0s;
|
||||
-ms-transition-duration: 0s;
|
||||
-o-transition-duration: 0s;
|
||||
transition-duration: 0s;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
.table .listCheckHead,
|
||||
.table .listCheck {
|
||||
width: 30px;
|
||||
vertical-align: middle;
|
||||
padding: 0 0 0 10px!important;
|
||||
}
|
||||
.listCheckHead .list-check,
|
||||
.listCheck .list-check {
|
||||
position: absolute;
|
||||
margin: -12px 0 0 -1px;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
|
||||
opacity: 0;
|
||||
}
|
||||
.listCheckHead i,
|
||||
.listCheck i {
|
||||
display: block;
|
||||
}
|
||||
.checkHide td {
|
||||
background-color: #E6E6E6 !important;
|
||||
color: #B9B9B9;
|
||||
}
|
||||
.checkHide a {
|
||||
color: #B9B9B9;
|
||||
}
|
||||
.checkHit td {
|
||||
background-color: #FFFEDB !important;
|
||||
}
|
||||
@@ -280,6 +280,17 @@
|
||||
line-height: 26px;
|
||||
margin: 0;
|
||||
}
|
||||
.main-forms .attributes-header h4 b {
|
||||
padding: 0 1px;
|
||||
border-style: dotted;
|
||||
border-width: 0 2px;
|
||||
border-color: #AAA;
|
||||
margin-right: 5px;
|
||||
cursor: move;
|
||||
}
|
||||
.main-forms .attributes-header h4 i {
|
||||
cursor: pointer;
|
||||
}
|
||||
.main-forms .field-type {
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 5px;
|
||||
@@ -307,7 +318,7 @@
|
||||
.main-forms .field-type .control-group:last-child {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#new-user-forms .control-group .add-target .input-append,
|
||||
#user-forms .control-group .add-target .input-append,
|
||||
.main-forms .field-type .control-group .add-target .input-append {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
@@ -324,7 +335,7 @@
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
|
||||
#new-user-forms .control-group .add-target .input-append input.last {
|
||||
#user-forms .control-group .add-target .input-append input.last {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,13 @@
|
||||
.main-list td {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.main-list td input[type="text"] {
|
||||
margin-bottom: 0;
|
||||
margin-left: -.4em;
|
||||
margin-right: 3px;
|
||||
padding: 0 .3em;
|
||||
width: 4em;
|
||||
}
|
||||
.main-list td.action {
|
||||
vertical-align: middle;
|
||||
text-align: right;
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
#list-view h4 a {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* List */
|
||||
@@ -106,10 +111,31 @@
|
||||
#list-view #member-abstract .member-avatar .action > a.trash {
|
||||
background-color: #b94a48;
|
||||
}
|
||||
#list-view #member-abstract .member-avatar > span {
|
||||
/*#list-view #member-abstract .member-avatar:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 250px;
|
||||
height: 120px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: block;
|
||||
margin: 0;
|
||||
background-color: #000000;
|
||||
-webkit-border-radius: 5px 5px 0 0;
|
||||
-moz-border-radius: 5px 5px 0 0;
|
||||
border-radius: 5px 5px 0 0;
|
||||
opacity: 0;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||
filter: alpha(opacity=0);
|
||||
}*/
|
||||
#list-view #member-abstract > li .member-avatar:after {
|
||||
-webkit-backface-visibility: hidden;
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: block;
|
||||
margin: 0;
|
||||
background-color: #000000;
|
||||
@@ -120,7 +146,8 @@
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||
filter: alpha(opacity=0);
|
||||
}
|
||||
#list-view #member-abstract > li:hover .member-avatar > span {
|
||||
#list-view #member-abstract > li:hover .member-avatar:after {
|
||||
-webkit-backface-visibility: hidden;
|
||||
opacity: .4;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
|
||||
filter: alpha(opacity=40);
|
||||
@@ -159,11 +186,6 @@
|
||||
float: left;
|
||||
position: relative;
|
||||
}
|
||||
#list-view #member-card > li:hover .member-avatar > span {
|
||||
opacity: 0.4;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
|
||||
filter: alpha(opacity=40);
|
||||
}
|
||||
#list-view #member-card > li:hover .member-avatar .action {
|
||||
visibility: visible;
|
||||
}
|
||||
@@ -183,14 +205,37 @@
|
||||
#list-view #member-card .member-avatar.gender-woman {
|
||||
border-color: #FF3196;
|
||||
}
|
||||
#list-view #member-card .member-avatar.gender-none {
|
||||
#list-view #member-card .member-avatar.gender-nene {
|
||||
border-color: #DDDDDD;
|
||||
}
|
||||
#list-view #member-card .member-avatar img {
|
||||
/*width: 100%;*/
|
||||
max-width: none;
|
||||
}
|
||||
#list-view #member-card .member-avatar > span {
|
||||
#list-view #member-card > li .member-avatar:after {
|
||||
-webkit-backface-visibility: hidden;
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: block;
|
||||
margin: 0;
|
||||
background-color: #000000;
|
||||
-webkit-border-radius: 50%;
|
||||
-moz-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
opacity: 0;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
#list-view #member-card > li:hover .member-avatar:after {
|
||||
opacity: .4;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
|
||||
filter: alpha(opacity=40);
|
||||
}
|
||||
/*#list-view #member-card .member-avatar > span {
|
||||
position: absolute;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
@@ -203,7 +248,7 @@
|
||||
opacity: 0;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||
filter: alpha(opacity=0);
|
||||
}
|
||||
}*/
|
||||
#list-view #member-card .member-avatar .action {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
@@ -262,22 +307,25 @@
|
||||
margin-top: 20px;
|
||||
}
|
||||
#profile #basic-info .member-avatar {
|
||||
width: 106px;
|
||||
height: 106px;
|
||||
width: 103px;
|
||||
height: 103px;
|
||||
float: left;
|
||||
}
|
||||
#profile #basic-info .member-avatar img {
|
||||
border: 3px solid #ffffff;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
-webkit-border-radius: 9px;
|
||||
-moz-border-radius: 9px;
|
||||
border-radius: 9px;
|
||||
}
|
||||
#profile #basic-info .member-avatar.gender-man img {
|
||||
#profile #basic-info .member-avatar:after {
|
||||
content: "";
|
||||
-webkit-backface-visibility: hidden;
|
||||
}
|
||||
#profile #basic-info .member-avatar.gender-man {
|
||||
border-color: #34ADFF;
|
||||
}
|
||||
#profile #basic-info .member-avatar.gender-woman img {
|
||||
#profile #basic-info .member-avatar.gender-woman {
|
||||
border-color: #FF3196;
|
||||
}
|
||||
#profile #basic-info .member-avatar.gender-none img {
|
||||
#profile #basic-info .member-avatar.gender-none {
|
||||
border-color: #DDDDDD;
|
||||
}
|
||||
#profile #member-roles {
|
||||
@@ -313,20 +361,27 @@
|
||||
#profile #member-roles .roles dd {
|
||||
color: #999999;
|
||||
}
|
||||
#profile #module-navbar {
|
||||
margin-left: 10px;
|
||||
}
|
||||
#profile #module-navbar .navbar {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
#profile #member-module {
|
||||
margin-left: 360px;
|
||||
}
|
||||
#profile #member-module #module-navbar.scroll-to-fixed-fixed {
|
||||
background-color: #F3F3F3;
|
||||
padding-top: 20px;
|
||||
}
|
||||
#profile #member-module #module-navbar.scroll-to-fixed-fixed .navbar {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#profile #member-module #module-content {
|
||||
padding: 0 10px;
|
||||
padding: 0 0 0 10px;
|
||||
}
|
||||
#profile #member-module #module-content .content {
|
||||
right: 10px;
|
||||
padding-bottom: 10px;
|
||||
outline: none;
|
||||
}
|
||||
#profile #member-module #module-content .list-active {
|
||||
padding-bottom: 8px;
|
||||
/*border-bottom: 1px solid #DDD;*/
|
||||
}
|
||||
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 979px) {
|
||||
|
||||
@@ -6,22 +6,22 @@
|
||||
.tags .lead .badge {
|
||||
margin-top: 5px;
|
||||
}
|
||||
.tags .tags-groups {
|
||||
.tags-groups {
|
||||
list-style: none;
|
||||
margin: 0 0 20px;
|
||||
padding: 0;
|
||||
}
|
||||
.tags .tags-groups:after {
|
||||
.tags-groups:after {
|
||||
content: "";
|
||||
clear: both;
|
||||
height: 0;
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
}
|
||||
.tags .tags-groups.module-tags li.default a {
|
||||
.tags-groups.module-tags li.default a {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.tags .tags-groups li {
|
||||
.tags-groups li {
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
width: auto;
|
||||
@@ -39,7 +39,7 @@
|
||||
-o-transition: all .2s linear;
|
||||
transition: all .2s linear;
|
||||
}
|
||||
.tags .tags-groups li.mark {
|
||||
.tags-groups li.mark {
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
@@ -49,28 +49,28 @@
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
.tags .tags-groups li.active {
|
||||
.tags-groups li.active {
|
||||
background-color: #3a87ad;
|
||||
}
|
||||
.tags .tags-groups li.active .amount {
|
||||
.tags-groups li.active .amount {
|
||||
color: #8cb8be;
|
||||
}
|
||||
.tags .tags-groups li a {
|
||||
.tags-groups li a {
|
||||
text-decoration: none;
|
||||
color: #ededed;
|
||||
}
|
||||
.tags .tags-groups li .amount {
|
||||
.tags-groups li .amount {
|
||||
color: #fdcf3b;
|
||||
float: right;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.tags .tags-groups li .card {
|
||||
.tags-groups li .card {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
.tags .tags-groups li .card:after {
|
||||
.tags-groups li .card:after {
|
||||
font-family: FontAwesome;
|
||||
content: '\f111';
|
||||
color: #fdcf3b;
|
||||
@@ -82,13 +82,13 @@
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.tags .tags-groups li .card.active:after {
|
||||
.tags-groups li .card.active:after {
|
||||
content: '\f058';
|
||||
font-size: 18px;
|
||||
left: -2px;
|
||||
top: 1px;
|
||||
}
|
||||
.tags .tags-groups li .card input {
|
||||
.tags-groups li .card input {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
@@ -110,10 +110,10 @@
|
||||
#tags-merger form {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
#tags-merger .tags .tags-groups li {
|
||||
#tags-merger .tags-groups li {
|
||||
cursor: pointer;
|
||||
}
|
||||
#tags-merger .tags .tags-groups li.def {
|
||||
#tags-merger .tags-groups li.def {
|
||||
background-color: #468847;
|
||||
}
|
||||
#tags-merger .modal-body .pull-left {
|
||||
@@ -127,22 +127,22 @@
|
||||
|
||||
|
||||
|
||||
.tags .tags-groups li.default {
|
||||
.tags-groups li.default {
|
||||
background-color: #468847;
|
||||
}
|
||||
.tags .tags-groups li.default.active {
|
||||
.tags-groups li.default.active {
|
||||
background-color: #3a87ad;
|
||||
}
|
||||
.tags .tags-groups li.default .amount {
|
||||
.tags-groups li.default .amount {
|
||||
color: #8cbe9a;
|
||||
}
|
||||
.tags .tags-groups li.default.active .amount {
|
||||
.tags-groups li.default.active .amount {
|
||||
color: #8cb8be;
|
||||
}
|
||||
.tags .tags-groups li.default .card:after {
|
||||
.tags-groups li.default .card:after {
|
||||
color: #8cbe9a;
|
||||
}
|
||||
.tags .tags-groups li.active .card:after {
|
||||
.tags-groups li.active .card:after {
|
||||
color: #8cb8be;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
margin-top: 4px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.topnav .btn-group {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* Bottom Nav */
|
||||
.bottomnav {
|
||||
@@ -41,6 +44,16 @@
|
||||
.bottomnav .action {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.bottomnav .divider {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
margin: 0 5px;
|
||||
background-color: #E0E0E0;
|
||||
width: 1px;
|
||||
height: 16px;
|
||||
top: 5px;
|
||||
box-shadow: 1px 0 0 #FFF;
|
||||
}
|
||||
.bottomnav .pagination {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
class Admin::AdBannersController < OrbitBackendController
|
||||
|
||||
before_filter :force_order_for_visitor,:only=>[:index, :show]
|
||||
before_filter :force_order_for_user,:except => [:index, :show]
|
||||
before_filter :for_app_sub_manager,:except => [:index, :show]
|
||||
before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview]
|
||||
|
||||
open_for_visitor :only => [:index, :show]
|
||||
open_for_manager :except => [:index,:show,:update,:realtime_preview]
|
||||
open_for_sub_manager :except => [:index, :show]
|
||||
|
||||
def rename
|
||||
@ad_banner = AdBanner.find(params[:id])
|
||||
@@ -60,6 +57,7 @@ class Admin::AdBannersController < OrbitBackendController
|
||||
def index
|
||||
@ad_banners = AdBanner.all
|
||||
@active = @ad_banners.first
|
||||
@tags = get_tags
|
||||
end
|
||||
|
||||
end
|
||||
@@ -3,7 +3,17 @@ class Admin::AssetsController < OrbitBackendController
|
||||
before_filter :setup_vars
|
||||
|
||||
def index
|
||||
@assets = (params[:sort] || @filter) ? get_sorted_and_filtered("asset") : Asset.all.page(params[:page]).per(10)
|
||||
@assets = (params[:sort] || @filter) ? get_sorted_and_filtered("asset") : Asset.all.desc(:created_at).page(params[:page]).per(10)
|
||||
if params[:type] == "images"
|
||||
@assets = @assets.where(:content_type => /^image/)
|
||||
end
|
||||
@tag = ModuleTag.new
|
||||
|
||||
@module_app = ModuleApp.find(params[:module_app_id]) rescue nil
|
||||
raise ModuleAppError, 'Can not find ModuleApp' if @module_app.nil?
|
||||
@module_app_id = @module_app.id rescue nil
|
||||
|
||||
render :layout => "assets"
|
||||
end
|
||||
|
||||
def show
|
||||
@@ -22,12 +32,8 @@ class Admin::AssetsController < OrbitBackendController
|
||||
|
||||
def edit
|
||||
@asset = Asset.find(params[:id])
|
||||
@asset_categories = AssetCategory.all
|
||||
@tags = get_tags
|
||||
respond_to do |format|
|
||||
format.html {}
|
||||
format.js { render 'js/show_pop_up', :locals => {:partial => 'admin/assets/edit'} }
|
||||
end
|
||||
render layout: false
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -64,10 +70,7 @@ class Admin::AssetsController < OrbitBackendController
|
||||
def update
|
||||
@asset = Asset.find(params[:id])
|
||||
if @asset.update_attributes(params[:asset])
|
||||
respond_to do |format|
|
||||
format.html { redirect_to admin_assets_url }
|
||||
format.js { render 'js/remove_pop_up_and_reload_content', :locals => {:function => 'replaceWith', :id => "asset_#{@asset.id}", :value => @asset, :values => nil, :partial => 'admin/assets/asset', :locals => nil} }
|
||||
end
|
||||
render layout: false
|
||||
else
|
||||
flash[:error] = t('update.fail')
|
||||
@asset_categories = AssetCategory.all
|
||||
@@ -95,11 +98,31 @@ class Admin::AssetsController < OrbitBackendController
|
||||
redirect_to assets_url(:filter => params[:filter], :direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
||||
def delete_files
|
||||
@files = params[:files]
|
||||
@files.each do |file|
|
||||
asset = Asset.find(file)
|
||||
asset.destroy
|
||||
end
|
||||
@assets = (params[:sort] || @filter) ? get_sorted_and_filtered("asset") : Asset.all.desc(:created_at).page(params[:page]).per(10)
|
||||
if params[:type] == "images"
|
||||
@assets = @assets.where(:content_type => /^image/)
|
||||
end
|
||||
# render :json =>{"success"=>true}.to_json
|
||||
end
|
||||
|
||||
def file_upload
|
||||
@asset = Asset.new
|
||||
@asset_categories = AssetCategory.all
|
||||
@tags = get_tags
|
||||
render :layout => false
|
||||
@files = params['files']
|
||||
a = Array.new
|
||||
@files.each do |file|
|
||||
@asset = current_user.assets.new
|
||||
@asset.data = file
|
||||
@asset.title_translations = {:en => file.original_filename, :zh_tw => file.original_filename}
|
||||
# @asset.title_translations[:zh_tw] = file.original_filename
|
||||
@asset.save!
|
||||
a << {"url"=>@asset.data.url}
|
||||
end
|
||||
render :json=>{"files"=>a}.to_json
|
||||
end
|
||||
|
||||
def file_select
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
class Admin::AuthorizationsController < OrbitBackendController
|
||||
|
||||
before_filter :admin_or_manager
|
||||
prepend_before_filter :admin_or_manager
|
||||
|
||||
def index
|
||||
@module_apps ||= ModuleApp.where(is_authorizable: true).order_by([:title, :asc])
|
||||
@module_apps ||= ModuleApp.any_of({is_authorizable: true}, {is_approvable: true}).order_by([:title, :asc])
|
||||
if @module_apps && @module_apps.include?(@module_app)
|
||||
if @type
|
||||
case @type
|
||||
when 'category', 'approval'
|
||||
when 'category_authorization', 'category_approval'
|
||||
if @module_app.has_category
|
||||
@objects = @module_app.categories
|
||||
else
|
||||
@@ -18,12 +18,12 @@ class Admin::AuthorizationsController < OrbitBackendController
|
||||
end
|
||||
unless @objects.blank?
|
||||
@object ||= @objects.first
|
||||
@users = @object.get_object_auth_by_title("#{@type}_#{@module_app.key}").auth_users
|
||||
@users = @object.get_authorization_by_title("#{@type}_#{@module_app.key}").authorized_users rescue nil
|
||||
else
|
||||
@error = t(:no_data)
|
||||
end
|
||||
else
|
||||
@users = @module_app.managing_users
|
||||
@users = @module_app.managers
|
||||
end
|
||||
elsif @module_apps
|
||||
@module_app = @module_apps.first
|
||||
@@ -33,35 +33,42 @@ class Admin::AuthorizationsController < OrbitBackendController
|
||||
end
|
||||
end
|
||||
|
||||
def add(users)
|
||||
unless users.blank?
|
||||
if @type
|
||||
if @object
|
||||
object_auth = @object.get_object_auth_by_title("#{@type}_#{@module_app.key}")
|
||||
add_users_to_object_auth(object_auth, users)
|
||||
else
|
||||
@error = t(:no_data)
|
||||
end
|
||||
else
|
||||
add_managers(users) unless users.blank?
|
||||
end
|
||||
def add_roles
|
||||
roles = Role.find(params[:role_ids]) rescue []
|
||||
users = []
|
||||
roles.each do |role|
|
||||
users += role.users.all.entries
|
||||
end
|
||||
@users = users
|
||||
render 'admin/authorizations/insert_users'
|
||||
unless roles.blank?
|
||||
authorization = get_or_create_authorization
|
||||
add_roles_to_auth(authorization, roles) unless @error
|
||||
end
|
||||
@users = authorization.authorized_users
|
||||
render 'admin/authorizations/reload_users'
|
||||
end
|
||||
|
||||
def add_sub_roles
|
||||
sub_roles = SubRole.find(params[:sub_role_ids]) rescue []
|
||||
users = []
|
||||
sub_roles.each do |sub_role|
|
||||
users += sub_role.users.all.entries
|
||||
end
|
||||
unless sub_roles.blank?
|
||||
authorization = get_or_create_authorization
|
||||
add_sub_roles_to_auth(authorization, sub_roles) unless @error
|
||||
end
|
||||
@users = authorization.authorized_users
|
||||
render 'admin/authorizations/reload_users'
|
||||
end
|
||||
|
||||
def add_users
|
||||
users = User.find(params[:user_ids]) rescue []
|
||||
add(users)
|
||||
end
|
||||
|
||||
def add_roles
|
||||
roles = Role.find(params[:role_ids]) rescue []
|
||||
users = roles.inject([]) do |users, role|
|
||||
users += role.users.all.entries
|
||||
users
|
||||
unless users.blank?
|
||||
authorization = get_or_create_authorization
|
||||
add_users_to_auth(authorization, users) unless @error
|
||||
end
|
||||
add(users)
|
||||
@users = authorization.authorized_users
|
||||
render 'admin/authorizations/reload_users'
|
||||
end
|
||||
|
||||
def modal_select
|
||||
@@ -70,63 +77,111 @@ class Admin::AuthorizationsController < OrbitBackendController
|
||||
if @type
|
||||
@object_id = @object.id if @object
|
||||
@sorted_users = roles.inject({}) do |users, role|
|
||||
users[role] = role.users.where(admin: false).not_guest_user - existing_users - @module_app.managing_users
|
||||
users[role] = role.users.where(admin: false) - existing_users - @module_app.managers
|
||||
users
|
||||
end
|
||||
else
|
||||
@sorted_users = roles.inject({}) do |users, role|
|
||||
users[role] = role.users.where(admin: false).not_guest_user - existing_users
|
||||
users[role] = role.users.where(admin: false) - existing_users
|
||||
users
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def remove_roles
|
||||
roles = Role.find(params[:role_ids]) rescue []
|
||||
unless roles.blank?
|
||||
authorization = get_or_create_authorization
|
||||
remove_roles_form_auth(authorization, roles)
|
||||
end
|
||||
@users = authorization.authorized_users
|
||||
render 'admin/authorizations/reload_users'
|
||||
end
|
||||
|
||||
def remove_sub_roles
|
||||
sub_roles = SubRole.find(params[:sub_role_ids]) rescue []
|
||||
unless sub_roles.blank?
|
||||
authorization = get_or_create_authorization
|
||||
remove_sub_roles_from_auth(authorization, sub_roles)
|
||||
end
|
||||
@users = authorization.authorized_users
|
||||
render 'admin/authorizations/reload_users'
|
||||
end
|
||||
|
||||
def remove_users
|
||||
@users = User.find(params[:ids]) rescue []
|
||||
unless @users.blank?
|
||||
if @type
|
||||
if @object
|
||||
object_auth = @object.get_object_auth_by_title("#{@type}_#{@module_app.key}")
|
||||
remove_users_form_object_auth(object_auth, @users)
|
||||
else
|
||||
@error = t(:no_data)
|
||||
end
|
||||
else
|
||||
remove_managers(@users)
|
||||
end
|
||||
authorization = get_or_create_authorization
|
||||
remove_users_from_auth(authorization, @users)
|
||||
end
|
||||
render 'admin/authorizations/remove_users'
|
||||
@users = authorization.authorized_users
|
||||
render 'admin/authorizations/reload_users'
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def add_managers(users)
|
||||
users.each do |user|
|
||||
@module_app.assign_manager(user, current_user)
|
||||
def add_managers_to_auth(users)
|
||||
@module_app.add_managers(users)
|
||||
end
|
||||
|
||||
def add_roles_to_auth(authorization, roles)
|
||||
authorization.add_roles(roles)
|
||||
end
|
||||
|
||||
def add_sub_roles_to_auth(authorization, sub_roles)
|
||||
authorization.add_sub_roles(sub_roles)
|
||||
end
|
||||
|
||||
def add_users_to_auth(authorization, users)
|
||||
authorization.add_users(users)
|
||||
end
|
||||
|
||||
def get_or_create_authorization
|
||||
case @type
|
||||
when 'category_approval'
|
||||
if @object
|
||||
@object.auth_approval || @object.create_auth_approval(module_app_id: @module_app.id, title: "#{@type}_#{@module_app.key}")
|
||||
else
|
||||
@error = t(:no_data)
|
||||
end
|
||||
when 'category_authorization'
|
||||
if @object
|
||||
@object.auth_sub_manager || @object.create_auth_sub_manager(module_app_id: @module_app.id, title: "#{@type}_#{@module_app.key}")
|
||||
else
|
||||
@error = t(:no_data)
|
||||
end
|
||||
when nil
|
||||
@module_app.auth_manager || @module_app.create_auth_manager(module_app_id: @module_app.id, title: "#{@type}_#{@module_app.key}")
|
||||
else
|
||||
auth = @object.get_authorization_by_title("#{@type}_#{@module_app.key}")
|
||||
unless auth
|
||||
auth = @object.create_auth_approval(module_app_id: @module_app.id, title: "#{@type}_#{@module_app.key}") if @type.include?('approval')
|
||||
auth = @object.create_auth_sub_manager(module_app_id: @module_app.id, title: "#{@type}_#{@module_app.key}") if @type.include?('authorization')
|
||||
end
|
||||
auth
|
||||
end
|
||||
end
|
||||
|
||||
def add_users_to_object_auth(object_auth, users)
|
||||
users.each do |user|
|
||||
object_auth.add_user_to_privilege_list(user)
|
||||
end
|
||||
def remove_managers_from_auth(users)
|
||||
@module_app.remove_manager(users)
|
||||
end
|
||||
|
||||
def remove_managers(users)
|
||||
users.each do |user|
|
||||
@module_app.remove_manager(user)
|
||||
end
|
||||
def remove_roles_form_auth(authorization, roles)
|
||||
authorization.remove_roles(roles)
|
||||
end
|
||||
|
||||
def remove_users_form_object_auth(object_auth, users)
|
||||
users.each do |user|
|
||||
object_auth.remove_user_from_privilege_list(user)
|
||||
end
|
||||
def remove_sub_roles_from_auth(authorization, sub_roles)
|
||||
authorization.remove_sub_roles(sub_roles)
|
||||
end
|
||||
|
||||
def remove_users_from_auth(authorization, users)
|
||||
authorization.remove_users(users)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def admin_or_manager
|
||||
@override_can_use = true
|
||||
setup_vars
|
||||
authenticate_user!
|
||||
user_is_manager?
|
||||
@@ -136,7 +191,7 @@ class Admin::AuthorizationsController < OrbitBackendController
|
||||
@module_app = ModuleApp.first(conditions: {:key => params[:module]} ) if params[:module]
|
||||
@type = params[:type].underscore if params[:type]
|
||||
if @type
|
||||
@klass = @type.classify.constantize rescue nil
|
||||
@klass = @type.gsub('_authorization', '').gsub('_approval', '').classify.constantize rescue nil
|
||||
@object = @klass.find(params[:id]) rescue nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
class Admin::DashboardsController < OrbitBackendController
|
||||
|
||||
#before_filter :set_current_user
|
||||
#before_filter :authenticate_user!, :except => [:index]
|
||||
# before_filter :is_admin?
|
||||
open_for_visitor
|
||||
|
||||
layout "basic_back_end"
|
||||
|
||||
|
||||
@@ -0,0 +1,579 @@
|
||||
# encoding: utf-8
|
||||
|
||||
require 'net/http'
|
||||
require 'open-uri'
|
||||
|
||||
class Admin::ImportDataController < OrbitBackendController
|
||||
helper Admin::PagePartsHelper
|
||||
include Admin::FrontendWidgetInterface
|
||||
|
||||
def get_teacher_data
|
||||
uri = URI("https://localhost:8000/teachers.xml")
|
||||
|
||||
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||
#uri.query = URI.encode_www_form(params)
|
||||
res = Net::HTTP.get_response(uri)
|
||||
|
||||
@teacher_data = Hash.from_xml(res.body)
|
||||
@teachers = @teacher_data["objects"]
|
||||
@i = 5000
|
||||
@teachers.each do |hash|
|
||||
# @roles = Role.skip(1).first
|
||||
@roles = Role.all
|
||||
@teacher = User.new
|
||||
I18n.locale = :zh_tw
|
||||
if !hash['teacher_zh_tw'].blank?
|
||||
@teacher.first_name = hash['teacher_zh_tw']
|
||||
elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank?
|
||||
@teacher.first_name = hash['teacher_en']
|
||||
elsif hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
|
||||
@teacher.first_name = "Please Fill the Name"
|
||||
end
|
||||
|
||||
I18n.locale = :en
|
||||
if !hash['teacher_en'].blank?
|
||||
@teacher.first_name = hash['teacher_en']
|
||||
elsif hash['teacher_en'].blank? && !hash['teacher_zh_tw'].blank?
|
||||
@teacher.first_name = hash['teacher_zh_tw']
|
||||
elsif hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank?
|
||||
@teacher.first_name = "Please Fill the Name"
|
||||
end
|
||||
|
||||
#@teacher.first_name = hash['teacher_en']
|
||||
@teacher.ntu_seq = hash['ntu_seq']
|
||||
@teacher.sid = hash['ntu_seq']
|
||||
@teacher.role_ids = ["#{@roles.skip(1).first.id}"]
|
||||
@teacher.password = "testpass"
|
||||
@i += 10
|
||||
if !hash['email'].blank?
|
||||
@user = User.where(email: "#{hash['email']}")
|
||||
if @user.length == 0
|
||||
@teacher.email = hash['email']
|
||||
elsif @user.length > 0
|
||||
@teacher.email = "#{@i}duplicate@ntu.edu.tw"
|
||||
end
|
||||
else
|
||||
@teacher.email = "#{@i}@ntu.edu.tw"
|
||||
end
|
||||
|
||||
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
|
||||
@teacher.user_id = "defaultuser"
|
||||
elsif hash['teacher_en'].blank?
|
||||
@teacher.user_id = hash['teacher_zh_tw']
|
||||
elsif hash['teacher_zh_tw']
|
||||
@teacher.user_id = hash['teacher_en']
|
||||
end
|
||||
@teacher.save!
|
||||
end
|
||||
end
|
||||
|
||||
def get_book_data
|
||||
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
||||
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||
uri.query = URI.encode_www_form(params)
|
||||
res = Net::HTTP.get_response(uri)
|
||||
|
||||
teachers = User.all
|
||||
|
||||
teachers.each do |hash|
|
||||
if hash.ntu_seq.present?
|
||||
ntu_seq = hash.ntu_seq
|
||||
books_xml = Nokogiri::XML( \
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
||||
@books = books_xml.xpath("//Book").map do |book_node|
|
||||
{
|
||||
author: (book_node>"Authors").text,
|
||||
year: (book_node>"PublishYear").text,
|
||||
title: (book_node>"DocTitle").text,
|
||||
remarks: (book_node>"Remarks").text,
|
||||
publisher: (book_node>"Publisher").text,
|
||||
book_title: (book_node>"BookTitle").text
|
||||
}
|
||||
end
|
||||
if @books.present?
|
||||
@books.each do |b|
|
||||
@book = WritingBook.new
|
||||
I18n.locale = :zh_tw
|
||||
@book.authors = b[:author]
|
||||
@book.paper_title = b[:title]
|
||||
@book.book_title = b[:book_title]
|
||||
@book.note = b[:remarks]
|
||||
@book.publisher = b[:publisher]
|
||||
I18n.locale = :en
|
||||
@book.authors = b[:author]
|
||||
@book.paper_title = b[:title]
|
||||
@book.book_title = b[:book_title]
|
||||
@book.note = b[:remarks]
|
||||
@book.publisher = b[:publisher]
|
||||
@book.year = b[:year]
|
||||
@book.create_user_id = hash.id
|
||||
@book.save
|
||||
end
|
||||
else
|
||||
puts "No books by Teacher"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def get_conference_data
|
||||
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
||||
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||
uri.query = URI.encode_www_form(params)
|
||||
res = Net::HTTP.get_response(uri)
|
||||
|
||||
teachers = User.all
|
||||
|
||||
teachers.each do |hash|
|
||||
if hash.ntu_seq.present?
|
||||
ntu_seq = hash.ntu_seq
|
||||
conference_xml = Nokogiri::XML( \
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
||||
{
|
||||
author: (cp_node>"Authors").text,
|
||||
year: (cp_node>"PublishYear").text,
|
||||
title: (cp_node>"PaperTitle").text,
|
||||
conference: (cp_node>"PublishOn").text,
|
||||
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
|
||||
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
|
||||
conference_title: (cp_node>"PublishOn").text,
|
||||
remarks: (cp_node>"Remarks").text
|
||||
}
|
||||
end
|
||||
if @conference_papers.present?
|
||||
@conference_papers.each do |b|
|
||||
@conference_paper = WritingConference.new
|
||||
I18n.locale = :zh_tw
|
||||
@conference_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@conference_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.paper_title = b[:title]
|
||||
end
|
||||
if b[:conference_title].blank?
|
||||
@conference_paper.conference_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.conference_title = b[:conference_title]
|
||||
end
|
||||
|
||||
@conference_paper.note = b[:remarks]
|
||||
I18n.locale = :en
|
||||
@conference_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@conference_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.paper_title = b[:title]
|
||||
end
|
||||
if b[:conference_title].blank?
|
||||
@conference_paper.conference_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.conference_title = b[:conference_title]
|
||||
end
|
||||
@conference_paper.note = b[:remarks]
|
||||
|
||||
@conference_paper.location = b[:location]
|
||||
@conference_paper.year = b[:year]
|
||||
@conference_paper.create_user_id = hash.id
|
||||
|
||||
@conference_paper.save!
|
||||
end
|
||||
else
|
||||
puts "No conference by Teacher"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_journal_paper_data
|
||||
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
||||
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||
uri.query = URI.encode_www_form(params)
|
||||
res = Net::HTTP.get_response(uri)
|
||||
|
||||
teachers = User.all
|
||||
|
||||
teachers.each do |hash|
|
||||
if hash.ntu_seq.present?
|
||||
ntu_seq = hash.ntu_seq
|
||||
paper_xml = Nokogiri::XML( \
|
||||
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
||||
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
||||
{
|
||||
author: (paper_node>"Authors").text,
|
||||
year: (paper_node>"PublishYear").text,
|
||||
title: (paper_node>"PaperTitle").text,
|
||||
journal: (paper_node>"PublishOn").text,
|
||||
volume:(paper_node>"Volume").text,
|
||||
volumeno:(paper_node>"VolumeNo").text,
|
||||
beginpage:(paper_node>"BeginPage").text,
|
||||
endpage:(paper_node>"EndPage").text,
|
||||
subgroup:(paper_node>"subgroup").text,
|
||||
remarks: (paper_node>"Remarks").text,
|
||||
cate: ((paper_node>"subgroup")>"Group").text
|
||||
}
|
||||
end
|
||||
if @journal_papers.present?
|
||||
@journal_papers.each do |b|
|
||||
@journal_paper = WritingJournal.new
|
||||
I18n.locale = :zh_tw
|
||||
@journal_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@journal_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@journal_paper.paper_title = b[:title]
|
||||
end
|
||||
@journal_paper.journal_title = b[:journal]
|
||||
@journal_paper.note = b[:remarks]
|
||||
I18n.locale = :en
|
||||
@journal_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@journal_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@journal_paper.paper_title = b[:title]
|
||||
end
|
||||
@journal_paper.journal_title = b[:journal]
|
||||
@journal_paper.note = b[:remarks]
|
||||
@journal_paper.year = b[:year]
|
||||
@journal_paper.vol_no = b[:volumeno]
|
||||
@journal_paper.form_to_start = b[:beginpage]
|
||||
@journal_paper.form_to_end = b[:endpage]
|
||||
if !b[:cate].blank?
|
||||
@level_type = JournalLevelType.where(:key => b[:cate])
|
||||
if @level_type.present?
|
||||
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
|
||||
end
|
||||
end
|
||||
|
||||
@journal_paper.create_user_id = hash.id
|
||||
@journal_paper.save!
|
||||
end
|
||||
else
|
||||
puts "No journal paper by Teacher"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def sync_conference_data
|
||||
@conference_data = WritingConference.where(create_user_id: "#{params[:user_id]}")
|
||||
@conference_data.delete_all
|
||||
@user = User.find("#{params[:user_id]}")
|
||||
|
||||
# teachers.each do |hash|
|
||||
if @user.sid.present?
|
||||
ntu_seq = @user.sid
|
||||
conference_xml = Nokogiri::XML( \
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
||||
{
|
||||
author: (cp_node>"Authors").text,
|
||||
year: (cp_node>"PublishYear").text,
|
||||
title: (cp_node>"PaperTitle").text,
|
||||
conference: (cp_node>"PublishOn").text,
|
||||
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
|
||||
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
|
||||
conference_title: (cp_node>"PublishOn").text,
|
||||
remarks: (cp_node>"Remarks").text
|
||||
}
|
||||
end
|
||||
if @conference_papers.present?
|
||||
@conference_papers.each do |b|
|
||||
@conference_paper = WritingConference.new
|
||||
I18n.locale = :zh_tw
|
||||
@conference_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@conference_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.paper_title = b[:title]
|
||||
end
|
||||
if b[:conference_title].blank?
|
||||
@conference_paper.conference_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.conference_title = b[:conference_title]
|
||||
end
|
||||
|
||||
@conference_paper.note = b[:remarks]
|
||||
I18n.locale = :en
|
||||
@conference_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@conference_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.paper_title = b[:title]
|
||||
end
|
||||
if b[:conference_title].blank?
|
||||
@conference_paper.conference_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.conference_title = b[:conference_title]
|
||||
end
|
||||
@conference_paper.note = b[:remarks]
|
||||
|
||||
@conference_paper.location = b[:location]
|
||||
@conference_paper.year = b[:year]
|
||||
@conference_paper.create_user_id = @user.id
|
||||
|
||||
@conference_paper.save!
|
||||
end
|
||||
else
|
||||
puts "No conference by Teacher"
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
|
||||
format.html
|
||||
format.json { render json: {"success"=>true}.to_json}
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def sync_journal_paper_data
|
||||
@journal_data = WritingJournal.where(create_user_id: "#{params[:user_id]}")
|
||||
@journal_data.delete_all
|
||||
@user = User.find("#{params[:user_id]}")
|
||||
|
||||
# teachers.each do |hash|
|
||||
if @user.sid.present?
|
||||
ntu_seq = @user.sid
|
||||
paper_xml = Nokogiri::XML( \
|
||||
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
||||
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
||||
{
|
||||
author: (paper_node>"Authors").text,
|
||||
year: (paper_node>"PublishYear").text,
|
||||
title: (paper_node>"PaperTitle").text,
|
||||
journal: (paper_node>"PublishOn").text,
|
||||
volume:(paper_node>"Volume").text,
|
||||
volumeno:(paper_node>"VolumeNo").text,
|
||||
beginpage:(paper_node>"BeginPage").text,
|
||||
endpage:(paper_node>"EndPage").text,
|
||||
subgroup:(paper_node>"subgroup").text,
|
||||
remarks: (paper_node>"Remarks").text,
|
||||
cate: ((paper_node>"subgroup")>"Group").text
|
||||
}
|
||||
end
|
||||
if @journal_papers.present?
|
||||
@journal_papers.each do |b|
|
||||
@journal_paper = WritingJournal.new
|
||||
I18n.locale = :zh_tw
|
||||
@journal_paper.authors = b[:author]
|
||||
|
||||
if b[:title].blank?
|
||||
@journal_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@journal_paper.paper_title = b[:title]
|
||||
end
|
||||
|
||||
@journal_paper.journal_title = b[:journal]
|
||||
@journal_paper.note = b[:remarks]
|
||||
I18n.locale = :en
|
||||
@journal_paper.authors = b[:author]
|
||||
|
||||
if b[:title].blank?
|
||||
@journal_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@journal_paper.paper_title = b[:title]
|
||||
end
|
||||
|
||||
@journal_paper.journal_title = b[:journal]
|
||||
@journal_paper.note = b[:remarks]
|
||||
@journal_paper.year = b[:year]
|
||||
@journal_paper.vol_no = b[:volumeno]
|
||||
@journal_paper.form_to_start = b[:beginpage]
|
||||
@journal_paper.form_to_end = b[:endpage]
|
||||
|
||||
if !b[:cate].blank?
|
||||
@level_type = JournalLevelType.where(:key => b[:cate])
|
||||
if @level_type.present?
|
||||
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
|
||||
end
|
||||
end
|
||||
|
||||
@journal_paper.create_user_id = @user.id
|
||||
@journal_paper.save!
|
||||
respond_to do |format|
|
||||
|
||||
format.html
|
||||
format.json { render json: {"success"=>true}.to_json}
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
respond_to do |format|
|
||||
|
||||
format.html
|
||||
format.json { render json: {"success"=>true}.to_json}
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def sync_book_data
|
||||
@books_data = WritingBook.where(create_user_id: "#{params[:user_id]}")
|
||||
@books_data.delete_all
|
||||
@user = User.find("#{params[:user_id]}")
|
||||
|
||||
# teachers.each do |hash|
|
||||
if @user.sid.present?
|
||||
ntu_seq = @user.sid
|
||||
books_xml = Nokogiri::XML( \
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
||||
@books = books_xml.xpath("//Book").map do |book_node|
|
||||
{
|
||||
author: (book_node>"Authors").text,
|
||||
year: (book_node>"PublishYear").text,
|
||||
title: (book_node>"DocTitle").text,
|
||||
remarks: (book_node>"Remarks").text,
|
||||
publisher: (book_node>"Publisher").text,
|
||||
book_title: (book_node>"BookTitle").text
|
||||
}
|
||||
end
|
||||
if @books.present?
|
||||
@books.each do |b|
|
||||
@book = WritingBook.new
|
||||
I18n.locale = :zh_tw
|
||||
@book.authors = b[:author]
|
||||
@book.paper_title = b[:title]
|
||||
@book.book_title = b[:book_title]
|
||||
@book.note = b[:remarks]
|
||||
@book.publisher = b[:publisher]
|
||||
I18n.locale = :en
|
||||
@book.authors = b[:author]
|
||||
@book.paper_title = b[:title]
|
||||
@book.book_title = b[:book_title]
|
||||
@book.note = b[:remarks]
|
||||
@book.publisher = b[:publisher]
|
||||
@book.year = b[:year]
|
||||
@book.create_user_id = @user.id
|
||||
@book.save
|
||||
end
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
|
||||
format.html
|
||||
format.json { render json: {"success"=>true}.to_json}
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_announcement_data
|
||||
uri = URI("https://localhost:8000/announcements.xml")
|
||||
|
||||
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||
#uri.query = URI.encode_www_form(params)
|
||||
res = Net::HTTP.get_response(uri)
|
||||
|
||||
@announcement_data = Hash.from_xml(res.body)
|
||||
@announcements = @announcement_data["objects"]
|
||||
@announcements.each do |hash|
|
||||
@bulletin = Bulletin.new
|
||||
|
||||
I18n.locale = :zh_tw
|
||||
if hash['announcement_title_zh_tw'].blank?
|
||||
@bulletin.title = hash['announcement_title_en']
|
||||
@bulletin.text = hash['announcement_content_zh_tw']
|
||||
elsif hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
|
||||
@bulletin.title = "Please Fill the Name"
|
||||
@bulletin.text = hash['announcement_content_zh_tw']
|
||||
else
|
||||
@bulletin.title = hash['announcement_title_zh_tw']
|
||||
@bulletin.text = hash['announcement_content_zh_tw']
|
||||
end
|
||||
|
||||
I18n.locale = :en
|
||||
if hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
|
||||
@bulletin.title = "Please Fill the Name"
|
||||
@bulletin.text = hash['announcement_content_en']
|
||||
|
||||
elsif hash['announcement_title_en'].blank?
|
||||
@bulletin.title = hash['announcement_zh_tw']
|
||||
@bulletin.text = hash['announcement_content_en']
|
||||
|
||||
elsif hash['announcement_title_zh_tw'].blank?
|
||||
@bulletin.title = hash['announcement_title_en']
|
||||
@bulletin.text = hash['announcement_content_en']
|
||||
end
|
||||
@bulletin.category_id = "51d2a16438178423c2000001"
|
||||
@bulletin.is_pending = true
|
||||
|
||||
@bulletin.save!
|
||||
end
|
||||
end
|
||||
|
||||
def get_page_data
|
||||
f = File.open("/home/rwub/orbit-db/ntu_mb/pages/management_pages.xml")
|
||||
page_xml = Nokogiri::XML(f)
|
||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||
@pages = page_xml.xpath("//management-page").map do |cp_node|
|
||||
{
|
||||
menu_title: (cp_node>"menu-title").text,
|
||||
content: (cp_node>"content").text
|
||||
}
|
||||
end
|
||||
|
||||
if @pages.present?
|
||||
@i=0
|
||||
@pages.each do |b|
|
||||
|
||||
get_variables_for_new
|
||||
@page = Page.new
|
||||
|
||||
@page.parent = "4f45f3b9e9d02c5db900005d"
|
||||
@page.design = "50ac424983e75219d2000021"
|
||||
@page.theme_id = "50ac424a83e75219d2000025"
|
||||
@page.menu_enabled_for= ["en", "zh_tw", ""]
|
||||
@page.enabled_for= ["en", "zh_tw", ""]
|
||||
@page.is_published = false
|
||||
if b[:menu_title].blank?
|
||||
@page.title = 'No Title Present'
|
||||
@i += 1
|
||||
@page.name = "#{@i}Page"
|
||||
else
|
||||
@i += 1
|
||||
@page.title = b[:menu_title]
|
||||
@page.name = "#{@i}Page"
|
||||
end
|
||||
if b[:content].blank?
|
||||
@page.content = "No Content Present"
|
||||
else
|
||||
@page.content = b[:content]
|
||||
end
|
||||
@page.save!
|
||||
end
|
||||
else
|
||||
puts "No Page Data"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_variables_for_new
|
||||
@designs = Design.all.entries
|
||||
@themes = Design.first.themes
|
||||
@module_apps = ModuleApp.for_frontend_select
|
||||
@app_frontend_urls = nil
|
||||
@categories = nil
|
||||
@tags = nil
|
||||
@page_frontend_data_counts = nil
|
||||
@frontend_styles = nil
|
||||
@selected={
|
||||
:design => @designs.first,
|
||||
:theme=> @themes.first,
|
||||
:module_app=>nil,#@module_apps.first
|
||||
:app_frontend_url=> nil, #@module_apps.first
|
||||
:category=>nil,
|
||||
:tag=>nil,
|
||||
:page_frontend_data_count=>nil,
|
||||
:frontend_style => nil
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -95,7 +95,7 @@ class Admin::PagesController < Admin::ItemsController
|
||||
if @item.module_app && @item.module_app.key == 'page_content'
|
||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||
end
|
||||
|
||||
|
||||
if @item.save
|
||||
flash.now[:notice] = t('create.success.page')
|
||||
respond_to do |format|
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
class Admin::PersonalPluginIntrosController < OrbitMemberController
|
||||
|
||||
include OrbitControllerLib::DivisionForDisable
|
||||
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
|
||||
|
||||
def index
|
||||
|
||||
get_types
|
||||
@plugin_intro = @types.where(:user_id => params[:user_id]).first
|
||||
|
||||
if @plugin_intro.blank?
|
||||
|
||||
@set_type = @types.new()
|
||||
@url = eval("panel_#{@app_type_name}_back_end_#{@app_type}s_path(:user_id=>params[:user_id])")
|
||||
@verb = :post
|
||||
|
||||
else
|
||||
|
||||
@set_type = @types.find(@plugin_intro.id)
|
||||
@url = polymorphic_path(["panel_#{@app_type_name}_back_end", @plugin_intro])
|
||||
@verb = :put
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def show
|
||||
|
||||
end
|
||||
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
get_types
|
||||
|
||||
@plugin_intro = @types.new(params[:plugin_intro])
|
||||
|
||||
respond_to do |format|
|
||||
if @plugin_intro.save
|
||||
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:plugin_intro][:user_id],:show_plugin_profile=>@reback_name)) }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
|
||||
get_types
|
||||
|
||||
@plugin_intro = @types.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
|
||||
if @plugin_intro.update_attributes(params[:plugin_intro])
|
||||
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:plugin_intro][:user_id],:show_plugin_profile=>@reback_name)) }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def get_types
|
||||
@types = @app_type.classify.constantize
|
||||
end
|
||||
|
||||
end
|
||||
@@ -55,6 +55,15 @@ class Admin::SitesController < OrbitBackendController
|
||||
|
||||
end
|
||||
|
||||
def search_engine
|
||||
|
||||
end
|
||||
|
||||
def preference
|
||||
|
||||
end
|
||||
|
||||
|
||||
def ui_theme
|
||||
|
||||
end
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
class Admin::TagsController < OrbitBackendController
|
||||
include OrbitTag::Merging
|
||||
|
||||
before_filter :force_order_for_visitor, only: [:index]
|
||||
before_filter :force_order_for_user, except: [:index]
|
||||
|
||||
def index
|
||||
@tags = @module_app.module_tags
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
class Admin::UsersNewInterfaceController < OrbitMemberController
|
||||
|
||||
helper MemberHelper
|
||||
helper OrbitBackendHelper
|
||||
|
||||
# before_filter :authenticate_user!
|
||||
# before_filter :set_attribute, :only => [:index, :show, :new, :edit]
|
||||
|
||||
before_filter :force_order_for_visitor,:only=>[:index,:show]
|
||||
before_filter :force_order_for_user,:except => [:index,:show]
|
||||
before_filter :set_attribute,:except => [:index,:show]
|
||||
|
||||
def setup_vars
|
||||
# @app_title ||= controller_path.split('/')[1].singularize
|
||||
# @module_app ||= ModuleApp.first(conditions: {:key => @app_title} )
|
||||
# raise ModuleAppError, 'Can not find ModuleApp' if @module_app.nil?
|
||||
end
|
||||
open_for_visitor :only => [:index, :show]
|
||||
|
||||
def index
|
||||
get_tags
|
||||
@@ -26,50 +17,64 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
|
||||
|
||||
|
||||
@filter = params[:filter]
|
||||
new_filter = params[:new_filter]
|
||||
@mq = params[:mq]
|
||||
@new_filter = params[:new_filter]
|
||||
|
||||
if @filter && params[:clear]
|
||||
@filter.delete(params[:type])
|
||||
elsif @filter && new_filter
|
||||
if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s)
|
||||
@filter[new_filter[:type]].delete(new_filter[:id].to_s)
|
||||
elsif @filter.has_key?(new_filter[:type])
|
||||
@filter[new_filter[:type]] << new_filter[:id].to_s
|
||||
elsif @filter && @new_filter
|
||||
if @filter.has_key?(@new_filter[:type]) && @filter[@new_filter[:type]].include?(@new_filter[:id].to_s)
|
||||
@filter[@new_filter[:type]].delete(@new_filter[:id].to_s)
|
||||
elsif @filter.has_key?(@new_filter[:type])
|
||||
@filter[@new_filter[:type]] << @new_filter[:id].to_s
|
||||
else
|
||||
@filter.merge!({new_filter[:type] => [new_filter[:id].to_s]})
|
||||
@filter.merge!({@new_filter[:type] => [@new_filter[:id].to_s]})
|
||||
end
|
||||
elsif new_filter
|
||||
@filter = {new_filter[:type] => [new_filter[:id].to_s]}
|
||||
elsif @new_filter
|
||||
@filter = {@new_filter[:type] => [@new_filter[:id].to_s]}
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
if @filter.blank?
|
||||
if @filter.blank? and @mq.blank?
|
||||
|
||||
render case params[:at]
|
||||
when 'summary'
|
||||
@users=User.not_guest_user.page(page_num).per(12).asc("_id").includes('avatar')
|
||||
@users=User.not_guest_user.page(page_num).per(12).desc("_id").includes('avatar')
|
||||
"index_summary"
|
||||
when 'thumbnail'
|
||||
@users=User.not_guest_user.page(page_num).per(36).asc("_id").includes('avatar')
|
||||
@users=User.not_guest_user.page(page_num).per(36).desc("_id").includes('avatar')
|
||||
"index_thumbnail"
|
||||
else
|
||||
@users=User.not_guest_user.page(page_num).per(10).asc("_id").includes('avatar')
|
||||
@users=User.not_guest_user.page(page_num).per(10).desc("_id").includes('avatar')
|
||||
"index"
|
||||
end
|
||||
|
||||
else
|
||||
elsif @filter.blank? and !@mq.blank?
|
||||
|
||||
render case params[:at]
|
||||
when 'summary'
|
||||
@users=User.not_guest_user.any_in(:role_ids=>@filter['role']).page(page_num).per(12).asc("_id").includes('avatar')
|
||||
@users=User.not_guest_user.any_of({:user_id => /#{@mq}/i}, {:first_name => /#{@mq}/i}, {:last_name => /#{@mq}/i}, {:email => /#{@mq}/i}, {:office_tel => /#{@mq}/i}).desc("_id").includes('avatar')
|
||||
"index_summary"
|
||||
when 'thumbnail'
|
||||
@users=User.not_guest_user.any_in(:role_ids=>@filter['role']).page(page_num).per(36).asc("_id").includes('avatar')
|
||||
@users=User.not_guest_user.any_of({:user_id => /#{@mq}/i}, {:first_name => /#{@mq}/i}, {:last_name => /#{@mq}/i}, {:email => /#{@mq}/i}, {:office_tel => /#{@mq}/i}).desc("_id").includes('avatar')
|
||||
"index_thumbnail"
|
||||
else
|
||||
@users=User.not_guest_user.any_in(:role_ids=>@filter['role']).page(page_num).per(10).asc("_id").includes('avatar')
|
||||
@users=User.not_guest_user.any_of({:user_id => /#{@mq}/i}, {:first_name => /#{@mq}/i}, {:last_name => /#{@mq}/i}, {:email => /#{@mq}/i}, {:office_tel => /#{@mq}/i}).desc("_id").includes('avatar')
|
||||
"index"
|
||||
end
|
||||
|
||||
elsif !@filter.blank? and @mq.blank?
|
||||
|
||||
render case params[:at]
|
||||
when 'summary'
|
||||
@users=User.not_guest_user.any_in(:role_ids=>@filter['role']).page(page_num).per(12).desc("_id").includes('avatar')
|
||||
"index_summary"
|
||||
when 'thumbnail'
|
||||
@users=User.not_guest_user.any_in(:role_ids=>@filter['role']).page(page_num).per(36).desc("_id").includes('avatar')
|
||||
"index_thumbnail"
|
||||
else
|
||||
@users=User.not_guest_user.any_in(:role_ids=>@filter['role']).page(page_num).per(10).desc("_id").includes('avatar')
|
||||
"index"
|
||||
end
|
||||
|
||||
@@ -93,9 +98,11 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
|
||||
|
||||
|
||||
if(!params[:show_plugin_profile].nil?)
|
||||
@right_partial = OrbitApp::Plugin::Registration.find_by_key(params[:show_plugin_profile]).profile_partial_path rescue 'plugin_summary'
|
||||
@right_partial = OrbitApp::Plugin::Registration.find_by_app_name(params[:show_plugin_profile]).profile_partial_path rescue 'plugin_summary'
|
||||
@plugin_app_name = OrbitApp::Plugin::Registration.find_by_app_name(params[:show_plugin_profile]).name rescue nil
|
||||
else
|
||||
@right_partial = "plugin_summary"
|
||||
@plugin_app_name = ''
|
||||
end
|
||||
|
||||
# @user.attribute_values.each{|att_val|
|
||||
@@ -225,7 +232,39 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
|
||||
@user.destroy
|
||||
end
|
||||
|
||||
redirect_to :action => :index
|
||||
# redirect_to :action => :index
|
||||
respond_to do |format|
|
||||
format.html { redirect_to(admin_users_new_interface_index_url(:at=>params[:at])) }
|
||||
# format.xml { head :ok }
|
||||
format.js
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def edit_order
|
||||
@users = User.not_guest_user
|
||||
end
|
||||
|
||||
def update_order
|
||||
if params[:users].present?
|
||||
params[:users].values.sort.each do |pair|
|
||||
to_go = pair[0].to_i
|
||||
if to_go > 0
|
||||
user_at_position = User.where(position: to_go - 1).first
|
||||
user = User.find(pair[1])
|
||||
if user_at_position && !user_at_position == user
|
||||
if user.position > user_at_position.position
|
||||
user.move_above(user_at_position)
|
||||
else
|
||||
user.move_below(user_at_position)
|
||||
end
|
||||
elsif to_go > User.count
|
||||
user.move_to_bottom
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@users = User.not_guest_user
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
@@ -145,11 +145,14 @@ class ApplicationController < ActionController::Base
|
||||
condition = VALID_LOCALES.include?(session[:locale])
|
||||
elsif session[:locale]
|
||||
condition = @site.in_use_locales.include?(session[:locale])
|
||||
elsif @site.default_locale.present?
|
||||
default_locale = @site.default_locale
|
||||
condition = @site.valid_locales.include?(default_locale)
|
||||
else
|
||||
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
|
||||
condition = @site.in_use_locales.include?(browser_locale)
|
||||
end
|
||||
session[:locale] = condition ? (browser_locale || session[:locale]) : I18n.default_locale.to_s
|
||||
session[:locale] = condition ? (default_locale || browser_locale || session[:locale]) : I18n.default_locale.to_s
|
||||
I18n.locale = session[:locale].to_sym
|
||||
@site_in_use_locales = site_locales_default_head(@site.in_use_locales)
|
||||
@site_valid_locales = site_locales_default_head(@site.valid_locales)
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
class DesktopController< ApplicationController
|
||||
layout 'desktop'
|
||||
before_filter :authenticate_user!
|
||||
before_filter :check_desktop_open, :only => [:index,:show]
|
||||
|
||||
#to load pages...
|
||||
|
||||
|
||||
# caches_page :index
|
||||
|
||||
def index
|
||||
@desktop = current_user.desktop
|
||||
@currentusername = current_user.name
|
||||
@currentname = current_user.first_name + current_user.last_name
|
||||
@title = "Desktop - " + @currentusername
|
||||
@section = @desktop.sections.first
|
||||
end
|
||||
@@ -335,7 +339,14 @@ class DesktopController< ApplicationController
|
||||
b = {"success"=>"true"}
|
||||
render :json=>b.to_json
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def check_desktop_open
|
||||
if Me.desktop_closed && current_user.nil? #Need to be change
|
||||
redirect_to '/admin/dashboards'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
class DesktopThemesController < OrbitBackendController
|
||||
class DesktopThemesController < ApplicationController
|
||||
require "net/http"
|
||||
require "uri"
|
||||
require 'zip/zip'
|
||||
|
||||
@@ -73,7 +73,7 @@ class FrontController < ApplicationController
|
||||
res << " active" if (current_page.id.eql?(page.id) || current_page.descendant_of?(page))
|
||||
res << "'>"
|
||||
root = "/"
|
||||
res << "<a href='#{(page.class.to_s.eql?('Page') ? root + page.path : page.url)}'><span>#{page.title}</span></a>"
|
||||
res << "<a href='#{(page.class.to_s.eql?('Page') ? root + page.path : page.url)}' target=#{(page.class.to_s.eql?('Page') ? '_self' : '_blank')} ><span>#{page.title}</span></a>"
|
||||
if page.visible_children.size > 0 && current < menu.levels
|
||||
res << "<span class='dot'></span>"
|
||||
res << menu_level(page, current_page, current + 1, menu)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class OrbitBackendController < ApplicationController
|
||||
include OrbitCategory::Categorizing
|
||||
include OrbitCoreLib::AppBackendUtility
|
||||
include OrbitCoreLib::PermissionUtility
|
||||
include OrbitCoreLib::Authorization
|
||||
include OrbitTag::Tagging
|
||||
include AdminHelper
|
||||
include ApplicationHelper
|
||||
@@ -10,12 +9,6 @@ class OrbitBackendController < ApplicationController
|
||||
|
||||
layout "back_end"
|
||||
|
||||
def setup_vars
|
||||
@app_title ||= controller_path.split('/')[1].singularize
|
||||
@module_app ||= ModuleApp.first(conditions: {:key => @app_title} )
|
||||
raise ModuleAppError, 'Can not find ModuleApp' if @module_app.nil?
|
||||
end
|
||||
|
||||
def get_statuses
|
||||
status = []
|
||||
status << 'is_top'
|
||||
@@ -28,27 +21,4 @@ class OrbitBackendController < ApplicationController
|
||||
end
|
||||
status
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def force_order_for_visitor
|
||||
check_backend_openness
|
||||
setup_vars
|
||||
set_current_user
|
||||
end
|
||||
|
||||
|
||||
def force_order_for_user
|
||||
setup_vars
|
||||
set_current_user
|
||||
authenticate_user!
|
||||
check_user_can_use
|
||||
end
|
||||
|
||||
def check_user_can_use
|
||||
unless check_permission
|
||||
#redirect_to polymorphic_path(['panel',@app_title,'back_end','public'])
|
||||
redirect_to root_url
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,7 +1,6 @@
|
||||
class OrbitMemberController < ApplicationController
|
||||
include OrbitCategory::Categorizing
|
||||
include OrbitCoreLib::AppBackendUtility
|
||||
include OrbitCoreLib::PermissionUtility
|
||||
include OrbitCoreLib::Authorization
|
||||
include OrbitTag::Tagging
|
||||
include AdminHelper
|
||||
include ApplicationHelper
|
||||
@@ -10,12 +9,6 @@ class OrbitMemberController < ApplicationController
|
||||
|
||||
layout "member"
|
||||
|
||||
def setup_vars
|
||||
@app_title ||= controller_path.split('/')[1].singularize
|
||||
@module_app ||= ModuleApp.first(conditions: {:key => @app_title} )
|
||||
raise ModuleAppError, 'Can not find ModuleApp' if @module_app.nil?
|
||||
end
|
||||
|
||||
def get_statuses
|
||||
status = []
|
||||
status << 'is_top'
|
||||
@@ -28,27 +21,4 @@ class OrbitMemberController < ApplicationController
|
||||
end
|
||||
status
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def force_order_for_visitor
|
||||
check_backend_openness
|
||||
setup_vars
|
||||
set_current_user
|
||||
end
|
||||
|
||||
|
||||
def force_order_for_user
|
||||
setup_vars
|
||||
set_current_user
|
||||
authenticate_user!
|
||||
check_user_can_use
|
||||
end
|
||||
|
||||
def check_user_can_use
|
||||
unless check_permission
|
||||
#redirect_to polymorphic_path(['panel',@app_title,'back_end','public'])
|
||||
redirect_to root_url
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -4,12 +4,6 @@ class PagesController < ApplicationController
|
||||
before_filter :check_frontend_open, :only => [:index,:show]
|
||||
# caches_page :index
|
||||
|
||||
def check_frontend_open
|
||||
if Me.frontend_closed and current_user.nil? #Need to be change
|
||||
redirect_to '/admin/dashboards'
|
||||
end
|
||||
end
|
||||
|
||||
def index
|
||||
@item = Page.find_by_name('home')
|
||||
|
||||
@@ -117,6 +111,12 @@ class PagesController < ApplicationController
|
||||
end
|
||||
raise PageError,'Missing Frontend Page' if @item.nil?
|
||||
end
|
||||
|
||||
def check_frontend_open
|
||||
if Me.frontend_closed && current_user.nil? #Need to be change
|
||||
redirect_to '/admin/dashboards'
|
||||
end
|
||||
end
|
||||
|
||||
def save_from_no_lang_for_page
|
||||
if @item.nil? or !@item.enabled_for_lang(I18n.locale.to_s)
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# encoding: utf-8
|
||||
|
||||
class SessionsController < Devise::SessionsController
|
||||
prepend_before_filter :require_no_authentication, :only => [ :new, :create ]
|
||||
|
||||
|
||||
def create
|
||||
@site = Site.first
|
||||
|
||||
private_key = OpenSSL::PKey::RSA.new(@site.private_key)
|
||||
wresult = private_key.private_decrypt(request.params['wresult'])
|
||||
|
||||
@ids = wresult.split("@")
|
||||
|
||||
login_uid = @ids[0]
|
||||
|
||||
resource = User.first(conditions:{user_id: login_uid})
|
||||
|
||||
if !resource.blank?
|
||||
resource_name = resource.class.to_s.downcase
|
||||
sign_in(resource_name, resource)
|
||||
session[:user_id_type] = "myntumb"
|
||||
redirect_to after_sign_in_path_for(resource)
|
||||
else
|
||||
flash[:error] = "很抱歉,您無此權限或帳號登入本站,請洽本站管理員<br />Sorry, you don't have the account or authority to login. Please contact the website administrator."
|
||||
redirect_to :root
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@user_id_type = session[:user_id_type]
|
||||
sign_out
|
||||
if @user_id_type == "myntumb"
|
||||
redirect_to "https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignout1.0&wreply=https://management.ntu.edu.tw"
|
||||
else
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -7,5 +7,5 @@ module Admin::AssetsHelper
|
||||
end
|
||||
a.join(' - ')
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -34,7 +34,8 @@ module AttributeFieldsHelper
|
||||
value = (can_muti_lang_input? ? @prefiled_value[key] : @prefiled_value) rescue nil
|
||||
key_field = can_muti_lang_input? ? "[#{key}]" : ""
|
||||
place_holder= @panel_setting["placeholder"][key] rescue ''
|
||||
result = text_area_tag(get_field_name_base + key_field, value,@markup_options.merge({:placeholder=>place_holder,:for=>key}))
|
||||
# result = text_area_tag(get_field_name_base + key_field, value,@markup_options.merge({:placeholder=>place_holder,:for=>key}))
|
||||
result = text_field_tag(get_field_name_base + key_field, value,@markup_options.merge({:placeholder=>place_holder,:for=>key}))
|
||||
|
||||
add_ext= @attribute_value.address_ext[key] rescue {}
|
||||
|
||||
@@ -181,7 +182,7 @@ protected
|
||||
def lang_panel_tabbable_wrapper(add_more_params,&block)
|
||||
add_more_counter = ''
|
||||
|
||||
if self.markup=='text_area' or self.markup=='address'
|
||||
if self.markup=='text_area' #or self.markup=='address'
|
||||
|
||||
tmp1 = VALID_LOCALES.collect do |key|
|
||||
value = @prefiled_value[key] rescue nil
|
||||
@@ -261,7 +262,7 @@ protected
|
||||
link_to(I18nVariable.from_locale(key),link_entry,:data=>{:toggle=>"tab"},:class=>"btn #{(key == I18n.locale.to_s ? "active" : nil)}",:for=>key)
|
||||
end # of VALID_LOCALES.collect for tabs
|
||||
|
||||
buff2 << link_to((content_tag :i,'',:class=>'icon-edit'),"##{get_pairing_tab_class({})}_m_window", :role=>"button",:class=>'btn',:data=>{:toggle=>"modal"}) if self.markup == 'address'
|
||||
buff2 << link_to((content_tag :i,'',:class=>'icon-edit'),"#address-field", :role=>"button",:class=>'btn',:data=>{:toggle=>"modal"}) if self.markup == 'address'
|
||||
buff2 << link_to((content_tag :i,'',:class=>'icon-trash'),"#",:class=>"btn remove-input") if self.add_more
|
||||
buff2.join.html_safe
|
||||
end # of content ul
|
||||
@@ -357,7 +358,7 @@ protected
|
||||
|
||||
# address = content_tag :div,:class=>"multipleInput editMore" do
|
||||
address = content_tag :div,:class=>"control-group" do
|
||||
label + content_tag(:div, controls_wrapper(&block), :class=>'controls')
|
||||
label + content_tag(:div, controls_wrapper(&block), :class=>'controls add-input')
|
||||
end # of div multipleInput editMore
|
||||
|
||||
result = address
|
||||
@@ -452,7 +453,7 @@ protected
|
||||
def gen_modal_dialog
|
||||
render_anywhere("shared/attribute_field/address_modal_dialog",{
|
||||
:field_name=>title,
|
||||
:html_id=>"#{get_pairing_tab_class({})}_m_window",
|
||||
:html_id=>"address-field",
|
||||
:btn_class => "#{get_pairing_tab_class({})}",
|
||||
:field_name_basic => get_basic_field_name_base
|
||||
}
|
||||
|
||||
@@ -321,9 +321,9 @@ module OrbitBackendHelper
|
||||
def is_authorized(object)
|
||||
autorized = @module_app.authorizable_models.inject(false) do |autorized, klass|
|
||||
if object.is_a?(klass.constantize)
|
||||
autorized ||= object.cur_user_is_sub_manager_of("#{klass.underscore}_#{@module_app.key}")
|
||||
autorized ||= object.user_can_sub_manage?(current_user)
|
||||
else
|
||||
autorized ||= object.category.cur_user_is_sub_manager_of("category_#{@module_app.key}")
|
||||
autorized ||= object.category.user_can_sub_manage?(current_user)
|
||||
end
|
||||
autorized
|
||||
end
|
||||
|
||||
@@ -34,8 +34,8 @@ module OrbitFormHelper
|
||||
|
||||
def date_picker(object_name, method, options)
|
||||
custom = {}
|
||||
custom[:format] = 'yyyy-MM-dd'
|
||||
custom[:value] = display_date(options[:value]) if options[:value]
|
||||
custom[:format] = options[:format] || 'yyyy/MM'
|
||||
custom[:value] = format_value(options[:value], custom[:format]) if options[:value]
|
||||
custom[:picker_class] = 'date_picker'
|
||||
custom[:label] = options[:label] || I18n.t('datetime_picker.date.label')
|
||||
custom[:placeholder] = options[:placeholder] || I18n.t('datetime_picker.date.placeholder')
|
||||
@@ -44,8 +44,8 @@ module OrbitFormHelper
|
||||
|
||||
def default_picker(object_name, method, options)
|
||||
custom = {}
|
||||
custom[:format] = 'yyyy-MM-dd hh:mm'
|
||||
custom[:value] = display_date_time(options[:value]) if options[:value]
|
||||
custom[:format] = options[:format] || 'yyyy/MM/dd hh:mm'
|
||||
custom[:value] = format_value(options[:value], custom[:format]) if options[:value]
|
||||
custom[:picker_class] = 'default_picker'
|
||||
custom[:label] = options[:label] || I18n.t('datetime_picker.default.label')
|
||||
custom[:placeholder] = options[:placeholder] || I18n.t('datetime_picker.default.placeholder')
|
||||
@@ -54,8 +54,8 @@ module OrbitFormHelper
|
||||
|
||||
def time_picker(object_name, method, options)
|
||||
custom = {}
|
||||
custom[:format] = 'hh:mm'
|
||||
custom[:value] = display_time(options[:value]) if options[:value]
|
||||
custom[:format] = options[:format] || 'hh:mm'
|
||||
custom[:value] = format_value(options[:value], custom[:format]) if options[:value]
|
||||
custom[:picker_class] = 'time_picker'
|
||||
custom[:label] = options[:label] || I18n.t('datetime_picker.time.label')
|
||||
custom[:placeholder] = options[:placeholder] || I18n.t('datetime_picker.time.placeholder')
|
||||
@@ -93,6 +93,10 @@ module OrbitFormHelper
|
||||
end
|
||||
end
|
||||
|
||||
def format_value(value, format)
|
||||
value.strftime(format.gsub('yyyy', '%Y').gsub('MM', '%m').gsub('dd', '%d').gsub('hh', '%H').gsub('mm', '%M'))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
module Orbit::FormBuilder
|
||||
|
||||
@@ -5,13 +5,16 @@ class Asset
|
||||
include OrbitTag::Taggable
|
||||
|
||||
mount_uploader :data, FileAssetUploader
|
||||
before_save :update_asset_attributes
|
||||
|
||||
field :filename
|
||||
field :description, localize: true
|
||||
field :title, localize: true
|
||||
field :content_type
|
||||
field :file_size
|
||||
|
||||
validates :title, :at_least_one => true
|
||||
validates :description, :at_least_one => true
|
||||
|
||||
validates_presence_of :data
|
||||
|
||||
|
||||
@@ -21,6 +24,14 @@ class Asset
|
||||
before_save :clean_tags
|
||||
|
||||
protected
|
||||
|
||||
|
||||
def update_asset_attributes
|
||||
if data.present? && data_changed?
|
||||
self.content_type = data.file.content_type
|
||||
self.file_size = data.file.size
|
||||
end
|
||||
end
|
||||
|
||||
def clean_tags
|
||||
self.tagged_ids.delete('')
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class AuthApproval < Authorization
|
||||
field :title
|
||||
|
||||
belongs_to :approval_authorizable, polymorphic: true
|
||||
has_and_belongs_to_many :authorized_users, class_name: 'User', inverse_of: 'approving_apps'
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
class AuthManager < Authorization
|
||||
# belongs_to :manager_authorizable, polymorphic: true
|
||||
has_and_belongs_to_many :authorized_users, class_name: 'User', inverse_of: 'managing_apps'
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class AuthSubManager < Authorization
|
||||
field :title
|
||||
|
||||
belongs_to :sub_manager_authorizable, polymorphic: true
|
||||
has_and_belongs_to_many :authorized_users, class_name: 'User', inverse_of: 'sub_managing_apps'
|
||||
end
|
||||
@@ -0,0 +1,108 @@
|
||||
class Authorization
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :title
|
||||
|
||||
belongs_to :module_app
|
||||
|
||||
has_and_belongs_to_many :roles
|
||||
has_and_belongs_to_many :sub_roles
|
||||
|
||||
delegate :update_auth_approval_users, :update_auth_manager_users, :update_auth_sub_manager_users, to: :module_app, prefix: true, allow_nil: true
|
||||
|
||||
after_save :update_module_app
|
||||
|
||||
|
||||
def add_roles(roles)
|
||||
users = []
|
||||
roles = Array(roles)
|
||||
add_operation(:roles, roles)
|
||||
sub_roles = []
|
||||
roles.each{|role| role.sub_roles.each{|sub_role| sub_roles << sub_role.id}}
|
||||
add_operation(:sub_roles, sub_roles)
|
||||
roles.each{|role| role.users.where(admin: false).each{|user| users << user}}
|
||||
add_users(users, false)
|
||||
end
|
||||
|
||||
def add_sub_roles(sub_roles)
|
||||
users = []
|
||||
sub_roles = Array(sub_roles)
|
||||
add_operation(:sub_roles, sub_roles)
|
||||
sub_roles.each do |sub_role|
|
||||
self.roles << sub_role.role unless self.roles.include?(sub_role.role)
|
||||
sub_role.users.where(admin: false).each{|user| users << user}
|
||||
end
|
||||
add_users(users, false)
|
||||
end
|
||||
|
||||
def add_users(users, with_parents = true)
|
||||
users = Array(users)
|
||||
add_operation(:authorized_users, users)
|
||||
users.each do |user|
|
||||
user.roles.each do |role|
|
||||
self.roles << role unless self.roles.include?(role)
|
||||
end
|
||||
user.sub_roles.each do |sub_role|
|
||||
self.sub_roles << sub_role unless self.sub_roles.include?(sub_role)
|
||||
end
|
||||
end if with_parents
|
||||
self.save
|
||||
end
|
||||
|
||||
def remove_roles(roles)
|
||||
users = []
|
||||
sub_roles = []
|
||||
roles = Array(roles)
|
||||
remove_operation(:roles, roles)
|
||||
roles.each do |role|
|
||||
role.sub_roles.each{|sub_role| sub_roles << sub_role}
|
||||
role.users.where(admin: false).each{|user| users << user}
|
||||
end
|
||||
remove_operation(:sub_role_ids, sub_roles)
|
||||
remove_operation(:authorized_user_ids, users)
|
||||
add_roles(self.roles)
|
||||
end
|
||||
|
||||
def remove_sub_roles(sub_roles)
|
||||
users = []
|
||||
sub_roles = Array(sub_roles)
|
||||
remove_operation(:sub_roles, sub_roles)
|
||||
sub_roles.each do |sub_role|
|
||||
users << sub_role.users.where(admin: false)
|
||||
end
|
||||
remove_operation(:authorized_user_ids, users)
|
||||
add_roles(self.roles)
|
||||
end
|
||||
|
||||
def remove_users(users)
|
||||
users = Array(users)
|
||||
remove_operation(:authorized_user_ids, users)
|
||||
self.save
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def add_operation(db_field, objs)
|
||||
objs.each do |obj|
|
||||
self.send(db_field) << obj unless self.send(db_field).include?(obj)
|
||||
end
|
||||
end
|
||||
|
||||
def remove_operation(db_field, obj)
|
||||
self.write_attribute(db_field, self.send(db_field) - obj.map{|y| y.id})
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def update_module_app
|
||||
case self._type
|
||||
when "AuthApproval"
|
||||
self.module_app_update_auth_approval_users
|
||||
when "AuthManager"
|
||||
self.module_app_update_auth_manager_users
|
||||
when "AuthSubManager"
|
||||
self.module_app_update_auth_sub_manager_users
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,7 +1,7 @@
|
||||
class Category
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include OrbitCoreLib::ObjectAuthable
|
||||
include OrbitModel::Authorizable
|
||||
|
||||
field :disable, type: Boolean, default: false
|
||||
field :title, localize: true
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
class Ckeditor::Asset
|
||||
include Ckeditor::Orm::Mongoid::AssetBase
|
||||
|
||||
delegate :url, :current_path, :size, :content_type, :filename, :to => :data
|
||||
|
||||
validates_presence_of :data
|
||||
end
|
||||
@@ -1,7 +0,0 @@
|
||||
class Ckeditor::AttachmentFile < Ckeditor::Asset
|
||||
mount_uploader :data, CkeditorAttachmentFileUploader, :mount_on => :data_file_name
|
||||
|
||||
def url_thumb
|
||||
@url_thumb ||= Ckeditor::Utils.filethumb(filename)
|
||||
end
|
||||
end
|
||||
@@ -1,7 +0,0 @@
|
||||
class Ckeditor::Picture < Ckeditor::Asset
|
||||
mount_uploader :data, CkeditorPictureUploader, :mount_on => :data_file_name
|
||||
|
||||
def url_content
|
||||
url(:content)
|
||||
end
|
||||
end
|
||||
@@ -1,16 +1,26 @@
|
||||
class ModuleApp
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include OrbitCoreLib::ObjectTokenUtility
|
||||
include OrbitApp::ModuleAppMembershipTools
|
||||
# include OrbitCoreLib::ObjectTokenUtility
|
||||
# include OrbitApp::ModuleAppMembershipTools
|
||||
|
||||
field :auth_approval_users, type: Array, default: nil
|
||||
field :auth_manager_users, type: Array, default: nil
|
||||
field :auth_sub_manager_users, type: Array, default: nil
|
||||
field :key
|
||||
field :title
|
||||
field :sidebar_order,type: Integer,default: 0
|
||||
|
||||
has_one :auth_manager, dependent: :destroy
|
||||
has_many :auth_approvals, dependent: :destroy
|
||||
has_many :auth_sub_managers, dependent: :destroy
|
||||
has_many :categories, dependent: :destroy
|
||||
has_many :module_tags, dependent: :destroy
|
||||
|
||||
has_many :approvals #to remove
|
||||
|
||||
delegate :authorized_users, to: :auth_manager, prefix: true, allow_nil: true
|
||||
|
||||
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
|
||||
@@ -24,6 +34,7 @@ class ModuleApp
|
||||
self[:has_category] = reg.get_has_category
|
||||
self[:is_approvable] = reg.get_is_approvable
|
||||
self[:is_authorizable] = reg.get_is_authorizable
|
||||
self[:approvable_models] = reg.get_approvable_models
|
||||
self[:authorizable_models] = reg.get_authorizable_models
|
||||
end
|
||||
|
||||
@@ -168,4 +179,71 @@ class ModuleApp
|
||||
self.module_tags.map{|t| t.tag }
|
||||
end
|
||||
|
||||
|
||||
# authorization
|
||||
def update_auth_approval_users
|
||||
user_ids = self.auth_approvals.inject([]) do |users, auth|
|
||||
users += auth.authorized_users.map{|user| user.id}
|
||||
end
|
||||
update_attribute(:auth_approval_users, user_ids.uniq)
|
||||
end
|
||||
|
||||
def update_auth_manager_users
|
||||
update_attribute(:auth_manager_users, self.auth_manager_authorized_users.map{|user| user.id})
|
||||
end
|
||||
|
||||
def update_auth_sub_manager_users
|
||||
user_ids = self.auth_sub_managers.inject([]) do |users, auth|
|
||||
users += auth.authorized_users.map{|user| user.id}
|
||||
end
|
||||
update_attribute(:auth_sub_manager_users, user_ids.uniq)
|
||||
end
|
||||
|
||||
def managers
|
||||
auth_manager_authorized_users || []
|
||||
end
|
||||
|
||||
def user_can_manage?(user)
|
||||
managers.include?(user)
|
||||
end
|
||||
|
||||
def add_managers(users)
|
||||
users = Array(users)
|
||||
if auth_manager = self.auth_manager
|
||||
auth_manager.update_attribute(:authorized_users, (auth_manager.authorized_users + users).uniq)
|
||||
else
|
||||
self.create_auth_manager(authorized_users: users)
|
||||
end
|
||||
end
|
||||
|
||||
def remove_managers(users)
|
||||
users = Array(users)
|
||||
users = users.delete_if{|user| user == current_user || is_admin?}
|
||||
self.auth_manager.update_attribute(:authorized_users, auth_manager.authorized_users - users)
|
||||
end
|
||||
|
||||
def is_manager?(user)
|
||||
if user && !auth_manager_users.blank?
|
||||
auth_manager_users.include?(user.id)
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def is_sub_manager?(user)
|
||||
if user && !auth_sub_manager_users.blank?
|
||||
auth_sub_manager_users.include?(user.id)
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def can_approve?(user)
|
||||
if user && !auth_approval_users.blank?
|
||||
auth_approval_users.include?(user.id)
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -14,10 +14,12 @@ class Site
|
||||
|
||||
field :frontend_closed, :type => Boolean, :default => false
|
||||
field :backend_openness_on, :type => Boolean, :default => false
|
||||
field :desktop_closed, :type => Boolean, :default => false
|
||||
|
||||
field :title_always_on, :type => Boolean, :default => false
|
||||
field :dashbroad_allow_visitor, :type => Boolean, :default => false
|
||||
field :mail_settings, :type => Hash
|
||||
field :enabled_for, :type => Array, :default => nil
|
||||
|
||||
field :disk_space, :type => String
|
||||
field :system_package_info, :type => Hash,:default=>{}
|
||||
@@ -32,9 +34,12 @@ class Site
|
||||
field :title, localize: true
|
||||
field :footer, localize: true
|
||||
field :sub_menu, localize: true
|
||||
field :terms_of_user, localize: true
|
||||
field :google_analytics
|
||||
field :default_locale
|
||||
|
||||
field :mobile_on, :type => Boolean, :default => false
|
||||
|
||||
|
||||
belongs_to :design
|
||||
has_many :site_metas, :autosave => true, :dependent => :destroy
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
class PersonalPluginIntro
|
||||
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
# include OrbitCoreLib::ObjectAuthable
|
||||
# include OrbitCoreLib::ObjectDisable
|
||||
|
||||
# has_and_belongs_to_many :users
|
||||
belongs_to :user
|
||||
|
||||
field :text, localize: true
|
||||
field :brief_intro, :type => Boolean, :default => false
|
||||
field :complete_list, :type => Boolean, :default => true
|
||||
|
||||
|
||||
def pp_object
|
||||
brief_intro
|
||||
end
|
||||
|
||||
def self.from_id(id)
|
||||
PersonalPluginIntro.find(id) rescue nil
|
||||
end
|
||||
|
||||
def self.is_localized?(field_name)
|
||||
self.fields[field_name.to_s].localized?
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,13 +1,15 @@
|
||||
class User
|
||||
|
||||
include Mongoid::Document
|
||||
include Mongoid::Tree
|
||||
include Mongoid::Tree::Ordering # use mongoid-tree because mongoid-ordering needs mongoid(~>3.0)
|
||||
include Mongoid::Timestamps
|
||||
|
||||
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :validatable #, :timeoutable
|
||||
|
||||
mount_uploader :avatar, AvatarUploader
|
||||
|
||||
field :admin, :type => Boolean, :default => true
|
||||
field :admin, :type => Boolean, :default => false
|
||||
field :active_role
|
||||
field :user_id
|
||||
field :sid
|
||||
@@ -18,27 +20,37 @@ class User
|
||||
field :office_tel
|
||||
field :cache_dept,type: Hash
|
||||
field :status_record,type: Hash
|
||||
field :ntu_seq
|
||||
#validates :ntu_seq, :uniqueness => true
|
||||
|
||||
has_and_belongs_to_many :approving_apps, class_name: 'AuthApproval', inverse_of: 'authorized_users'
|
||||
has_and_belongs_to_many :managing_apps, class_name: 'AuthManager', inverse_of: 'authorized_users'
|
||||
has_and_belongs_to_many :sub_managing_apps, class_name: 'AuthSubManager', inverse_of: 'authorized_users'
|
||||
|
||||
has_many :attribute_values, :autosave => true, :dependent => :destroy
|
||||
has_many :app_auths,as: :privilege_apps,:inverse_of => :privilege_lists
|
||||
has_many :blocked_apps, :inverse_of => :blocked_users, :class_name => "AppAuth", :dependent => :destroy
|
||||
has_many :privilege_apps, :inverse_of => :privilege_users, :class_name => "AppAuth", :dependent => :destroy
|
||||
|
||||
has_many :managing_apps,:class_name => "AppManager", :dependent => :destroy
|
||||
# has_many :managing_apps,:class_name => "AppManager", :dependent => :destroy
|
||||
has_one :desktop, :autosave => true, :dependent => :destroy
|
||||
has_one :facebook, :autosave => true, :dependent => :destroy
|
||||
has_many :other_accounts, :autosave => true, :dependent => :destroy
|
||||
has_many :assets, as: :assetable
|
||||
# has_many :journals, :autosave => true, :dependent => :destroy
|
||||
# has_many :papers, :autosave => true, :dependent => :destroy
|
||||
has_and_belongs_to_many :sub_role_tags
|
||||
|
||||
has_many :user_actions, :dependent => :destroy
|
||||
|
||||
has_many :personal_plugin_intro
|
||||
|
||||
# has_and_belongs_to_many :statuses
|
||||
has_and_belongs_to_many :roles
|
||||
has_and_belongs_to_many :sub_roles
|
||||
has_and_belongs_to_many :role_statuses
|
||||
has_and_belongs_to_many :role_categorys
|
||||
|
||||
accepts_nested_attributes_for :attribute_values, :allow_destroy => true
|
||||
|
||||
before_create :initialize_desktop
|
||||
@@ -89,9 +101,9 @@ class User
|
||||
var[:id].each do |id,val|
|
||||
# binding.pry if id == '5052c5b22b5c49ab02000004'
|
||||
if (val=="true")
|
||||
self.roles = self.roles.reject{|t| t.id.to_s==id}
|
||||
self.role_ids.reject!{|t| t.to_s == id}
|
||||
elsif(val=="false")
|
||||
self.roles << Role.find(id)
|
||||
self.role_ids += Array(id)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -106,9 +118,9 @@ class User
|
||||
# binding.pry if id == '5052c5b22b5c49ab02000004'
|
||||
|
||||
if ( self.roles.include?(@roid) == false or val=="true")
|
||||
self.sub_roles = self.sub_roles.reject{|t| t.id.to_s==id}
|
||||
self.sub_role_ids.reject!{|t| t.to_s == id}
|
||||
elsif(val=="false")
|
||||
self.sub_roles << SubRole.find(id)
|
||||
self.sub_role_ids += Array(id)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -273,8 +285,8 @@ class User
|
||||
end
|
||||
|
||||
def managed_module_apps
|
||||
self.managing_apps.inject([]) do |managed_apps, app_manager|
|
||||
managed_apps << app_manager.managing_app unless app_manager.managing_app.blank?
|
||||
self.managing_apps.inject([]) do |managed_apps, auth_manager|
|
||||
managed_apps << auth_manager.module_app
|
||||
managed_apps
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
<tr id="asset_<%= asset.id %>" class="with_action">
|
||||
<td><%= check_box_tag 'to_delete[]', asset.id, false, :class => "checkbox_in_list" %></td>
|
||||
<td><%= asset.title rescue nil %></td>
|
||||
<td>
|
||||
<%= check_box_tag 'files[]', asset.id, false, :class => "checkbox_in_list" %>
|
||||
<input type="hidden" value="<%= asset.data.url %>" id="url_<%= asset.id %>" />
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<input type="hidden" value="<%= asset.description_translations[locale] rescue nil %>" id="<%= locale %>_desc_<%= asset.id %>" />
|
||||
<input type="hidden" value="<%= asset.title_translations[locale] rescue nil %>" id="<%= locale %>_title_<%= asset.id %>" />
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= asset.title_translations[I18n.locale.to_s] rescue nil %></td>
|
||||
<!-- <td>
|
||||
<i class="icons-pictures img-peview" rel="popover" data-content="<img src='<%= asset.data.url %>' />" data-original-title="<%= asset.data.filename %>"></i>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t(:edit), edit_admin_asset_path(asset), :remote => true, :class => 'edit' %></li>
|
||||
<li class="dropdown"><%= link_to t(:delete_), admin_asset_path(asset), :confirm => t('sure?'), :method => :delete, :class => 'delete' %></li>
|
||||
<li><%#= link_to t(:edit), edit_admin_asset_path(asset), :remote => true, :class => 'edit' %></li>
|
||||
<li class="dropdown"><%#= link_to t(:delete_), admin_asset_path(asset), :confirm => t('sure?'), :method => :delete, :class => 'delete' %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td><%= asset.data.file.content_type rescue nil %></td>
|
||||
</td> -->
|
||||
<!-- <td><%#= asset.data.file.content_type rescue nil %></td> -->
|
||||
<td><%= number_to_human_size(asset.data.file.file_length) rescue nil %></td>
|
||||
<td><%= asset.description rescue nil %></td>
|
||||
<td>
|
||||
@@ -22,10 +29,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.img-peview').popover({
|
||||
delay: { show: 100, hide: 300 }
|
||||
});
|
||||
</script>
|
||||
<td>
|
||||
<a href="<%= edit_admin_asset_path(asset) %>" class="editform">Edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1,18 +1,15 @@
|
||||
<div id='pop_up_content' class="main2">
|
||||
<h1><%= t('editing.asset') %></h1>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<%= form_for @asset, :url => admin_asset_path(@asset), :html => {:id => (is_html ? nil : 'ajaxForm'), :multipart => true } do |f| %>
|
||||
<%= flash_messages %>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3><%= t('editing.asset') %></h3>
|
||||
</div>
|
||||
<%= form_for @asset, :url => admin_asset_path(@asset), :remote => true do |f| %>
|
||||
<div class="modal-body" id="modal_body">
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
<div class="button_bar">
|
||||
<% if is_html %>
|
||||
<%= link_back %>
|
||||
<%= f.submit t(:edit) %>
|
||||
<% else %>
|
||||
<a id='ajax_form_submit' class="btn btn-primary"><%= t(:update_) %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn" data-dismiss="modal">Close</a>
|
||||
<%= f.submit t('submit'), class: 'btn btn-primary' %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1,38 +1,46 @@
|
||||
<div class="control-group">
|
||||
<label for="title" class="control-label"><%= t :title %></label>
|
||||
<div class="controls">
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<%= content_tag :label do -%>
|
||||
<div>
|
||||
<%= I18nVariable.from_locale(locale) %>
|
||||
<%= f.text_field locale, :class => "input-large", :value => (@asset.title_translations[locale] rescue nil) %>
|
||||
<ul class="nav nav-pills language-nav">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
<div class="control-group input-title">
|
||||
<%= f.label :title , t('asset.title'), :class=>"control-label muted" %>
|
||||
<div class="controls">
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<%= f.text_field locale, :class=>'post-title', :value => (@asset.title_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group input-content">
|
||||
<%= f.label :description ,t('asset.description'), :class => "control-label muted" %>
|
||||
<%= f.fields_for :description_translations do |f| %>
|
||||
<div class="controls">
|
||||
<div class="textarea">
|
||||
<%= f.text_area locale, :style=>"width:100%;height:100px", :class => '', :value => (@asset.description_translations[locale] rescue nil) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= f.label :category, t(:category) %></label>
|
||||
<div class="controls">
|
||||
<%= f.select :asset_category_id, @asset_categories.collect{|t| [ t.title, t.id ]}, {}, :class => "input-large" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t :tags %></label>
|
||||
<div class="controls">
|
||||
<label class="control-label muted">Tag</label>
|
||||
<div class="controls" data-toggle="buttons-checkbox">
|
||||
<% @tags.each do |tag| %>
|
||||
<%= content_tag :label, :class => "checkbox inline" do -%>
|
||||
<%= check_box_tag 'asset[tag_ids][]', tag.id, @asset.tag_ids.include?(tag.id) %>
|
||||
<label class="checkbox inline btn <%= 'active' if @asset.tag_ids.include?(tag.id) %>">
|
||||
<%= check_box_tag 'asset[tag_ids][]', tag.id, @asset.tag_ids.include?(tag.id)%>
|
||||
<%= tag.name %>
|
||||
<%= hidden_field_tag 'asset[tag_ids][]', '' %>
|
||||
<% end %>
|
||||
</label>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= f.label :data, t(:data) %></label>
|
||||
<label class="control-label muted"><%= f.label :data, t(:data) %></label>
|
||||
<div class="controls">
|
||||
<%= f.file_field :data, :class => 'upload' %>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<%= render_sort_bar(true, delete_admin_assets_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]),
|
||||
['title', 'title','span4', :title],
|
||||
['description', 'description', 'span1-2', :data],
|
||||
['intro', 'intro', 'span1-2', :type],
|
||||
['intro', 'intro', 'span1-2', :size],
|
||||
['intro', 'intro', 'span1-2', :description],
|
||||
['intro', 'intro', 'span1-2', :tags]).html_safe %>
|
||||
@@ -1,25 +0,0 @@
|
||||
<% if !request.xhr? %>
|
||||
<textarea>
|
||||
<% end %>
|
||||
var returnurl = "<%= @asset.data.url %>";
|
||||
var returntitle = "<%= show_all_fields(@asset, 'title') %>";
|
||||
var returndescription = "<%= show_all_fields(@asset, 'description') %>";
|
||||
var win = tinyMCEPopup.getWindowArg("window");
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = returnurl;
|
||||
if(win.document.getElementById(tinyMCEPopup.getWindowArg("alt")))
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("alt")).value = returndescription;
|
||||
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("title")).value = returntitle;
|
||||
if (typeof(win.ImageDialog) != "undefined") {
|
||||
// we are, so update image dimensions...
|
||||
if (win.ImageDialog.getImageData)
|
||||
win.ImageDialog.getImageData();
|
||||
|
||||
// ... and preview if necessary
|
||||
if (win.ImageDialog.showPreviewImage)
|
||||
win.ImageDialog.showPreviewImage(returnurl);
|
||||
}
|
||||
tinyMCEPopup.close();
|
||||
<% if !request.xhr? %>
|
||||
</textarea>
|
||||
<% end %>
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
$("#tbody_assets").html("<%= j render :partial => 'asset', :collection => @assets %>");
|
||||
$("#asset_pagination").html("<%= j paginate @assets, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");
|
||||
@@ -1,9 +1 @@
|
||||
<% content_for :secondary do %>
|
||||
<div class="assets_setup">
|
||||
<ul class="list">
|
||||
<li><%= link_to t('new.asset'), new_admin_asset_path, :remote => true, :class => 'button positive' %></li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<%= render :partial => 'edit', :locals => {:is_html => true} %>
|
||||
@@ -1,30 +1,382 @@
|
||||
<%= render 'filter' %>
|
||||
<table id="asset_sort_list" class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1"></th>
|
||||
<th class="span4"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody_assets" class="sort-holder">
|
||||
<%= render :partial => 'asset', :collection => @assets %>
|
||||
</tbody>
|
||||
</table>
|
||||
<style>
|
||||
/* File Upload */
|
||||
#upload-panel {
|
||||
clear: both;
|
||||
}
|
||||
#upload-panel iframe {
|
||||
width: 100%;
|
||||
border: none;
|
||||
}
|
||||
#fileupload {
|
||||
position: relative;
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
margin: 40px 0 15px;
|
||||
height: 254px;
|
||||
border: 1px solid #d4d4d4;
|
||||
border-radius: 4px;
|
||||
background-color: #FDFDFD;
|
||||
/*-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, .15) inset;
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, .15) inset;*/
|
||||
}
|
||||
#fileupload table {
|
||||
margin: 0;
|
||||
}
|
||||
#fileupload .fileupload-buttonbar .navbar {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
#fileupload .fileupload-buttonbar .navbar .add-photo {
|
||||
border: none;
|
||||
border-right: 1px solid #d4d4d4;
|
||||
background-color: transparent;
|
||||
padding: 10px 15px 10px;
|
||||
color: #777777;
|
||||
text-decoration: none;
|
||||
text-shadow: 0 1px 0 #ffffff;
|
||||
}
|
||||
#fileupload .fileupload-buttonbar .navbar .add-photo:hover {
|
||||
color: #333333;
|
||||
text-decoration: none;
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
#fileupload .fileupload-buttonbar .navbar .fileinput-button {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
#fileupload .fileupload-buttonbar .navbar .fileinput-button input {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
font-size: 23px;
|
||||
opacity: 0;
|
||||
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||
filter: alpha(opacity=0);
|
||||
cursor: pointer;
|
||||
-webkit-transform: translate(-300px, 0) scale(4);
|
||||
-moz-transform: translate(-300px, 0) scale(4);
|
||||
-ms-transform: translate(-300px, 0) scale(4);
|
||||
-o-transform: translate(-300px, 0) scale(4);
|
||||
transform: translate(-300px, 0) scale(4);
|
||||
direction: ltr;
|
||||
}
|
||||
#fileupload .fileupload-buttonbar .navbar-inner {
|
||||
border-width: 0 0 1px;
|
||||
border-radius: 4px 4px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:add), new_admin_asset_path, :remote => true, :class => 'btn btn-primary pull-right' %>
|
||||
<div id="asset_pagination" class="paginationFixed">
|
||||
<%= paginate @assets, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]}, :remote => true %>
|
||||
#fileupload .fileupload-progress .progress {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
left: 0;
|
||||
margin-bottom: 0;
|
||||
height: 5px;
|
||||
border-radius: 0;
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
}
|
||||
#fileupload .fileupload-progress .progress-success.progress-striped .bar {
|
||||
background-color: #0088CC;
|
||||
}
|
||||
#fileupload .fileupload-progress .progress-extended {
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
right: 0;
|
||||
padding-right: 15px;
|
||||
color: #0088CC;
|
||||
text-align: right;
|
||||
text-shadow: 0 1px 0 #ffffff;
|
||||
letter-spacing: -0.1em;
|
||||
font-size: 12px;
|
||||
font-family: 'Varela Round', sans-serif;
|
||||
line-height: 40px;
|
||||
}
|
||||
#fileupload .fileupload-buttonbar {
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
#fileupload #dropzone {
|
||||
margin: 15px 10px 10px;
|
||||
padding: 30px;
|
||||
text-align: center;
|
||||
font-size: 2em;
|
||||
font-family: 'Raleway';
|
||||
line-height: 1.2em;
|
||||
color: #e4e4e4;
|
||||
}
|
||||
#fileupload #dropzone div[data-icons] {
|
||||
font-size: 4em;
|
||||
height: 70px;
|
||||
padding-top: 30px;
|
||||
text-shadow: 0px -1px 0px #ececec;
|
||||
color: #f5f5f5;
|
||||
}
|
||||
#fileupload #dropzone.drop {
|
||||
position: absolute;
|
||||
top: 37px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border: 2px dashed #0088CC;
|
||||
border-radius: 10px;
|
||||
color: #0088CC;
|
||||
background-color: #FFFFFF;
|
||||
z-index: 0;
|
||||
}
|
||||
#fileupload #dropzone.fade {
|
||||
opacity: .3;
|
||||
}
|
||||
#fileupload #dropzone.in {
|
||||
opacity: .7;
|
||||
z-index: 2;
|
||||
border-color: #faa732;
|
||||
color: #faa732;
|
||||
}
|
||||
#fileupload #dropzone.drop div[data-icons] {
|
||||
text-shadow: 0px -1px 0px #0c5f80;
|
||||
color: #0088CC;
|
||||
}
|
||||
#fileupload #dropzone.in div[data-icons] {
|
||||
text-shadow: 0px -1px 0px #a28a10;
|
||||
color: #faa732;
|
||||
}
|
||||
#fileupload #file-list {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
height: 209px;
|
||||
margin: 2px 0;
|
||||
}
|
||||
#fileupload #file-list .pane {
|
||||
margin-right: 2px;
|
||||
}
|
||||
#fileupload #file-list .files {
|
||||
margin: 0;
|
||||
padding: 10px 14px 10px 10px;
|
||||
list-style: none;
|
||||
}
|
||||
#fileupload #file-list .files > li {
|
||||
padding: 10px;
|
||||
}
|
||||
#fileupload #file-list .files > li:nth-child(even) {
|
||||
background-color: #e9e9e9;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#fileupload #file-list .files ul {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
#fileupload #file-list .files ul li {
|
||||
float: left;
|
||||
}
|
||||
#fileupload #file-list .files ul li.action-bnt {
|
||||
float: right;
|
||||
}
|
||||
#fileupload #file-list .preview {
|
||||
width: 80px;
|
||||
min-height: 1px;
|
||||
margin-right: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
#fileupload #file-list .name {
|
||||
width: 150px;
|
||||
max-width: 250px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
#fileupload #file-list .progress {
|
||||
position: absolute;
|
||||
left: -5px;
|
||||
right: -5px;
|
||||
bottom: -5px;
|
||||
margin-bottom: 0;
|
||||
height: 5px;
|
||||
box-shadow: none;
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
}
|
||||
#fileupload #file-list .size {
|
||||
width: 80px;
|
||||
}
|
||||
#fileupload #file-list .action-bnt {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
<ul class="nav nav-tabs module-nav">
|
||||
<li class="active">
|
||||
<a href="#filemanager" data-toggle="tab">File Manager</a>
|
||||
</li>
|
||||
<li><a href="#upload" data-toggle="tab">Upload</a></li>
|
||||
</ul>
|
||||
<div class="tab-pane fade in active" id="filemanager">
|
||||
<a href="<%= admin_module_tags_path(:module_app_id => @module_app_id.to_s) %>"> Tag Management </a>
|
||||
<div id="panel_l" style="width:200px;float:left;margin:5px 5px 5px 5px;">
|
||||
preview is here
|
||||
</div>
|
||||
<div id="panel_r" class="tab-pane fade in active" style="width: 1200px;" >
|
||||
<table id="asset_sort_list" class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1"></th>
|
||||
<th class="span4">Name</th>
|
||||
<th class="span1-2">Size</th>
|
||||
<th class="span1-2">Description</th>
|
||||
<th class="span2">Tags</th>
|
||||
<th class="span1">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody_assets" class="sort-holder">
|
||||
<%= render :partial => 'asset', :collection => @assets %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<button class="btn btn-primary" id="insert_btn" style="display:none;">Insert</button>
|
||||
<button class="btn btn-primary" id="delete_btn" style="display:none;">Delete</button>
|
||||
<div id="asset_pagination" class="paginationFixed">
|
||||
<%= paginate @assets, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]}, :remote => true %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="upload">
|
||||
<form action="<%= file_upload_admin_assets_path %>", id='fileupload'>
|
||||
<!-- Redirect browsers with JavaScript disabled to the origin page -->
|
||||
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
|
||||
<div class="fileupload-buttonbar">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<ul class="nav">
|
||||
<li>
|
||||
<div class="fileinput-button add-photo">
|
||||
<i class="icon-plus icon-white"></i>
|
||||
<span>Add files...</span>
|
||||
<input type="file" name="files[]" multiple>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<button type="submit" class="start add-photo">
|
||||
<i class="icon-upload icon-white"></i>
|
||||
<span>Start upload</span>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="reset" class="cancel add-photo">
|
||||
<i class="icon-ban-circle icon-white"></i>
|
||||
<span>Cancel upload</span>
|
||||
</button>
|
||||
</li>
|
||||
<!-- <li>
|
||||
<button type="button" class="delete">
|
||||
<i class="icons-trash icon-white"></i>
|
||||
<span>Delete</span>
|
||||
</button>
|
||||
</li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- The global progress information -->
|
||||
<div class="fileupload-progress">
|
||||
<!-- The global progress bar -->
|
||||
<div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
|
||||
<div class="bar" style="width:0%;"></div>
|
||||
</div>
|
||||
<!-- The extended global progress information -->
|
||||
<div class="progress-extended"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Drop Zone -->
|
||||
<div id="dropzone" class="drop">
|
||||
<div data-icons=""></div>
|
||||
Drop files here
|
||||
</div>
|
||||
<!-- The loading indicator is shown during file processing -->
|
||||
<div class="fileupload-loading"></div>
|
||||
<!-- The table listing the files available for upload/download -->
|
||||
<div id="file-list" class="nano">
|
||||
<div class="content">
|
||||
<ul role="presentation" class="files clearfix">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="editform" class="modal hide fade">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
<%= javascript_include_tag "inc/modal-preview" %>
|
||||
<%= javascript_include_tag "file-upload/vendor/jquery.ui.widget.js" %>
|
||||
<%= javascript_include_tag "file-upload/tmpl.min.js" %>
|
||||
<%= javascript_include_tag "file-upload/load-image.min.js" %>
|
||||
<%= javascript_include_tag "file-upload/canvas-to-blob.min.js" %>
|
||||
<%= javascript_include_tag "file-upload/jquery.iframe-transport.js" %>
|
||||
<%= javascript_include_tag "file-upload/jquery.fileupload.js" %>
|
||||
<%= javascript_include_tag "file-upload/jquery.fileupload-fp.js" %>
|
||||
<%= javascript_include_tag "file-upload/jquery.fileupload-ui.js" %>
|
||||
<%= javascript_include_tag "file-upload/drop-zone.js" %>
|
||||
<%= javascript_include_tag "admin/filemanager.js" %>
|
||||
<% end %>
|
||||
|
||||
<script id="template-upload" type="text/x-tmpl">
|
||||
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
||||
<li class="template-upload fade">
|
||||
<ul class="clearfix">
|
||||
<li class="action-bnt">
|
||||
{% if (o.files.valid && !i) { %}
|
||||
<div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
|
||||
<div class="bar" style="width:0%;"></div>
|
||||
</div>
|
||||
{% if (!o.options.autoUpload) { %}
|
||||
<button class="btn btn-primary start">
|
||||
<i class="icon-upload icon-white"></i>
|
||||
</button>
|
||||
{% } %}
|
||||
{% } %}
|
||||
{% if (!i) { %}
|
||||
<button class="btn btn-warning cancel">
|
||||
<i class="icon-ban-circle icon-white"></i>
|
||||
</button>
|
||||
{% } %}
|
||||
</li>
|
||||
<li class="preview pull-left"><span class="fade"></span></li>
|
||||
<li class="name-size">
|
||||
<p>{%=file.name%}</p>
|
||||
{% if (file.error) { %}
|
||||
<p class="error"><span class="label label-important">Error</span> {%=file.error%}</p>
|
||||
{% } else if (o.files.valid && !i) { %}
|
||||
<p class="label label-info">{%=o.formatFileSize(file.size)%}</p>
|
||||
{% } %}
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
{% } %}
|
||||
</script>
|
||||
<!-- The template to display files available for download -->
|
||||
<script id="template-download" type="text/x-tmpl">
|
||||
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
||||
<li class="template-download fade">
|
||||
<ul class="clearfix">
|
||||
{% if (file.error) { %}
|
||||
<li class="name-size">
|
||||
<p>{%=file.name%}</p>
|
||||
<p class="error"><span class="label label-important">Error</span> {%=file.error%}</p>
|
||||
</li>
|
||||
{% } else { %}
|
||||
<li class="preview">
|
||||
{% if (file.thumbnail_url) { %}
|
||||
<a href="{%=file.url%}" title="{%=file.name%}" data-gallery="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
|
||||
{% } %}
|
||||
</li>
|
||||
<li class="name-size">
|
||||
<p><a href="{%=file.url%}" title="{%=file.name%}" data-gallery="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a></p>
|
||||
<p ><span class="label label-success">Success</span> File uploaded successfully!</p>
|
||||
<p class="label label-info">{%=o.formatFileSize(file.size)%}</p>
|
||||
</li>
|
||||
{% } %}
|
||||
</ul>
|
||||
</li>
|
||||
{% } %}
|
||||
</script>
|
||||
@@ -1,4 +0,0 @@
|
||||
$("#delete_all").attr("action", "<%= delete_admin_assets_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]) %>");
|
||||
$("#sort_headers").html("<%= j render 'sort_headers' %>");
|
||||
$("#tbody_assets").html("<%= j render :partial => 'asset', :collection => @assets %>");
|
||||
$("#asset_pagination").html("<%= j paginate @assets, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");
|
||||
@@ -0,0 +1 @@
|
||||
<%= render :partial => 'asset', :object => @asset %>
|
||||
@@ -1,10 +1,10 @@
|
||||
<li class="filter-item selected_user <%= 'check-item' unless user == current_user || is_admin? %>" id="<%= user.id %>">
|
||||
<li class="filter-item selected_user <%= 'check-item' unless user == current_user || user.admin %>" id="<%= user.id %>">
|
||||
<label>
|
||||
<%= image_tag (user.avatar? ? user.avatar.thumb : 'menber-pic.png'), :class => "user-pic" %>
|
||||
<span class="user-name"><%= user.name %></span>
|
||||
<span><%= get_user_module_role(user) %></span>
|
||||
</label>
|
||||
<% unless user == current_user || is_admin? %>
|
||||
<% unless user == current_user || user.admin %>
|
||||
<input type="checkbox">
|
||||
<% end %>
|
||||
</li>
|
||||
@@ -13,11 +13,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="mini-layout-body span10">
|
||||
<%= link_to t(:module_authorization), admin_authorizations_path(@module_app.key) %>
|
||||
<%= link_to t(:module_authorization), admin_authorizations_path(@module_app.key) if @module_app.is_authorizable %>
|
||||
<% @module_app.authorizable_models.each do |authorizable_model| %>
|
||||
<%= link_to (authorizable_model.eql?('Category') ? t(:category_auth) : "#{authorizable_model.underscore.humanize.capitalize} #{t(:authorization_)}"), admin_authorizations_path(@module_app.key, type: authorizable_model.underscore) %>
|
||||
<%= link_to (authorizable_model.eql?('Category') ? t(:category_auth) : "#{authorizable_model.underscore.humanize.capitalize} #{t(:authorization_)}"), admin_authorizations_path(@module_app.key, type: "#{authorizable_model.underscore}_authorization") %>
|
||||
<% end %>
|
||||
<% @module_app.approvable_models.each do |approvable_model| %>
|
||||
<%= link_to (approvable_model.eql?('Category') ? t(:approval_) : "#{approvable_model.underscore.humanize.capitalize} #{t(:approval_)}"), admin_authorizations_path(@module_app.key, type: "#{approvable_model.underscore}_approval") %>
|
||||
<% end %>
|
||||
<%= link_to t(:approval_), admin_authorizations_path(@module_app.key, type: 'approval') if @module_app.is_approvable %>
|
||||
<% if @error %>
|
||||
<%= @error %>
|
||||
<% else %>
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
$("#card-list").append("<%= j render partial: 'user', collection: @users %>");
|
||||
$("#member-filter").modal('hide');
|
||||
@@ -0,0 +1,2 @@
|
||||
$("#card-list").html("<%= j render partial: 'user', collection: @users %>");
|
||||
$("#member-filter").modal('hide');
|
||||
@@ -32,7 +32,6 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= index_table %>
|
||||
|
||||
<%= @index_footer %>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<%= render_sort_bar(true, delete_admin_designs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]),
|
||||
['title', 'title','span2', :title],
|
||||
['', '', 'span1', :default],
|
||||
['intro', 'intro', 'span7', :intro],
|
||||
['author', 'author', 'span2', :author]).html_safe %>
|
||||
@@ -0,0 +1 @@
|
||||
<p>Successfully Imported Announcement Data!</p>
|
||||