Compare commits

..
Author SHA1 Message Date
harrybomrah 648ecc1475 isotope fixed for all plugins for list and form. 2013-10-01 14:29:39 +08:00
131 changed files with 1068 additions and 1946 deletions

No files matched your search

+3 -6
View File
@@ -11,14 +11,13 @@ gem "net-ldap", "~> 0.3.1"
gem 'devise', '1.5.3'
gem 'exception_notification' # Send error trace
gem 'execjs'
gem 'jquery-rails', '3.0.4'
gem 'jquery-ui-rails', "4.0.5"
gem 'jquery-rails', '2.1.4'
gem 'jquery-ui-rails'
gem "select2-rails", '3.3.1'
gem 'kaminari'
gem 'time_difference'
gem "acts_as_unvlogable"
gem 'youtube_it'
gem 'gotcha'
# gem "memcached", "~> 1.4.3"
# gem "memcache-client"
@@ -39,7 +38,7 @@ gem 'resque-scheduler' # job scheduling
gem 'resque-restriction'
#gem 'rb-readline'
# gem 'ruby-debug19'
gem 'rubyzip', '< 1.0.0'
gem 'rubyzip'
gem 'sunspot_mongo'
gem 'sunspot_solr'
@@ -98,8 +97,6 @@ group :test, :development do
gem "watchr"
gem "spork"
gem "capybara"
#gem 'rack-mini-profiler'
gem "better_errors"
# gem 'yard'
# gem "bluecloth"
end
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

+1 -1
View File
@@ -6,7 +6,7 @@
//
//= require jquery
//= require jquery_ujs
//= require jquery.ui.all
//= require jquery-ui
//= require desktop/jquery.form
//= require desktop/jquery.tinyscrollbar
//= require desktop/jquery.miniColors.min
+37 -36
View File
@@ -168,7 +168,7 @@ var orbitDesktop = function(dom){
o.loadIconCache();
var custom_load = window.location.hash;
if(!custom_load){
$(o.contentHolder).empty().load("/desktop/desktop_container",function(){
$(o.contentHolder).empty().load("/desktop/desktop",function(){
o.desktopData["d_desktop"] = "";
o.initializeDesktop("d_desktop","",false);
})
@@ -605,11 +605,10 @@ var orbitDesktop = function(dom){
this.menu_item = function(dom,customload,submenuitem){
if(!customload)customload=false;
var target = dom.attr("id"),
url = dom.attr("href"),
submenu_pass = ( dom.attr("sub-menu") == "false" ? false : true);
var target = dom.attr("id");
var url = dom.attr("href");
if(!url)return false;
o.data_method = dom.attr("callback-method");
if(o.currenthtml!=target){
if(o.desktopData[o.currentface] == "undefined"){
@@ -630,37 +629,33 @@ var orbitDesktop = function(dom){
window.o[o.data_method](target,url,cache);
}
}
if( submenu_pass ){
try {
if(!customload){
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
try {
if(!customload){
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
} else {
if(submenuitem){
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"));
} else {
if(submenuitem){
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"));
} else {
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
}
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
}
} catch(EX){}
}
}
} catch(EX){}
header_ani();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
if( submenu_pass ){
try{
if(!customload){
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),o.desktopData[o.currentface]);
}else{
if(submenuitem)
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"),o.desktopData[o.currentface]);
else
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),o.desktopData[o.currentface]);
}
}catch(EX){}
}
try{
if(!customload){
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),o.desktopData[o.currentface]);
}else{
if(submenuitem)
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"),o.desktopData[o.currentface]);
else
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),o.desktopData[o.currentface]);
}
}catch(EX){}
// cache = (o.lastlink == "/desktop/app_manager" ? false : true);
cache = (o.lastlink == "/desktop/app_manager" ? false : true);
if(typeof o.data_method != "undefined"){
if(o.data_method != ""){
window.o[o.data_method](target,url,cache);
@@ -1100,7 +1095,7 @@ var orbitDesktop = function(dom){
data : options,
success : function(data){
if(data.success == "true"){
if(dom.is(":checked")){
if(dom.is(":checked")){ console.log("true");
elementSettingsData[$e.data("id")].sections.push({"id" : dom.data("section"),"name":sectionDetails.name});
o.notify("Added to " + sectionDetails.name,"success");
}else{
@@ -1124,16 +1119,20 @@ var orbitDesktop = function(dom){
var info_open = function(){
if($appinfo.is(":hidden")){
$('.overview').stop().animate({'width': '+=480'},0 , function(){
// $('.tinycanvas').tinyscrollbar_update('relative');
$('.tinycanvas').tinyscrollbar_update();
});
$appinfo
.css({
'display': 'block',
'margin-left': -480
}).fadeIn(200)
})
.delay(300)
.animate({
'margin-left': 0
}, 500, 'easeInOutQuint');
}
} else {
$('.tinycanvas').tinyscrollbar_update();
}
}
var info_close = function(){
@@ -1144,11 +1143,13 @@ var orbitDesktop = function(dom){
'margin-left': -480
},500 , 'easeInOutQuint', function(){
$('.overview').animate({'width': '-=480'}, 0, function(){
// $('.tinycanvas').tinyscrollbar_update();
$('.tinycanvas').tinyscrollbar_update();
});
$(this).fadeOut(300).attr("style","");
$(this).attr("style","");
});
}
} else {
$('.tinycanvas').tinyscrollbar_update();
}
}
$(window).on('keydown', function(){
if($('#searchbox').val() == 'Search'){
+18 -46
View File
@@ -1,58 +1,30 @@
var banners = [];
var banner_index = 0;
$(document).ready(function() {
$.each($(".dymanic_load"),function(){
if($(this).attr("path")==''){
$(this).html("App setting Failed");
}else{
// Check if this App is AD_Banner
if($(this).attr("path").indexOf("show_banner")>0){
ajax_load_proc($(this),$(this).attr("path"),"true");
}else{
ajax_load_proc($(this),$(this).attr("path"),$(this).attr("path"));
if($(this).attr("path")==''){$(this).html("App setting Failed");}
if($(this).attr("path")!=''){
ajax_load_proc($(this),$(this).attr("path"));
}
}
}
});
);
$("#main_content").addClass("module");
});
});
function ajax_load_proc(wapper,url,isBanner){
function ajax_load_proc(wapper,url){
$.get(encodeURI(url), {}, function(respText,textSta,XML){
if (textSta == 'success') {
if(isBanner=="true"){
wapper.html(respText);
var banner = banners[banner_index];
$(banner.banner_name+" > img").each(function(){
$(this).load(function(){ banner.image_loaded++; });
});
BannerCycle(banner_index);
banner_index++;
}else{
wapper.html(respText);
}
};
if(textSta == 'error')
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
if (textSta == 'success') {
wapper.html(respText);
};
if(textSta == 'error')
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
});
}
function BannerCycle(banner_index){
var banner = banners[banner_index];
// Wait untill all images are loaded
if (banner.image_loaded==$(banner.banner_name+" img").length){
$(banner.banner_name).cycle({
delay: -1000,
fx: banner.banner_fx,
timeout: banner.time_to_next,
pager: banner.banner_pager,
pagerAnchorBuilder: function(idx, slide) { return "<li><a href='#'></a></li>"; }
});
}else{
setTimeout("BannerCycle("+banner_index+")",500);
}
}
// Ad Banner FX code [start]
function getTimeout() {
return $(this).attr('time_to_next');
}
$(document).ready(function() {
$(document).on('click', '.slideshow img', function()
@@ -43,14 +43,8 @@ $(function(){
placeholder: 'placeholder',
startCollapsed: true,
disableNesting: 'no-nest',
update: function(event, ui) {
var position = null;
if($(ui.item).closest('ol').hasClass('item-groups')) {
position = $(ui.item).index() - 1;
} else {
position = $(ui.item).index();
};
$.post("<%= Rails.application.routes.url_helpers.admin_update_position_path %>", { id: ui.item.attr('id'), parent_id: (ui.item.parent().closest('li').attr('id') || ui.item.parent().closest('ol').attr('id')), position: position } );
stop: function(event, ui) {
$.post("<%= Rails.application.routes.url_helpers.admin_update_position_path %>", { id: ui.item.attr('id'), parent_id: (ui.item.parent().closest('li').attr('id') || ui.item.parent().closest('ol').attr('id')), position: ui.item.index() } );
}
});
$(".sortable").delegate(".brand, .delete", clickEvent, function(e){
@@ -55,13 +55,6 @@
} else {
$viewPage.find('.content').load(url, function(){
$viewPage.clone(true).appendTo( $pageslide.empty() ).show();
if($('#filter-default-tag').length) {
$('#filter-default-tag').fastLiveFilter('.add-default-tags-list', '.filter-item', '.tag');
addTagsTab();
$('#view-page .card').cardCheck({
item: $('#view-page input[type="checkbox"]'),
});
};
if(callback)callback.call(this,$viewPage,element);
});
}
+20 -15
View File
@@ -80,22 +80,27 @@ $(function() {
_data.actionable ? $('#dialog').modal('show') : "";
e.preventDefault();
});
$('.delete-item').on(clickEvent, function() {
var _v = [];
$("tbody .list-check").each(function() {
this.checked && _v.push("ids[]="+this.value)
$("#dialog").on(clickEvent, '.delete-item', function() {
var _v = [],
_t = $t.attr("rel");
$("tbody .list-check:checked").each(function() {
_v.push(this.value);
});
var _t = $t.attr("rel");
if(_t.indexOf("?") > -1) {
$.ajax(_t + "&" + _v.join("&")).done(function() {
actionSuccess(_data.checkAction)
});
} else {
$.ajax(_t + "?" + _v.join("&")).done(function() {
actionSuccess(_data.checkAction)
});
}
$.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,56 +0,0 @@
function dragMode() {
$('#card-list').sortable({
placeholder: "highlight",
update: function( event, ui ) {
var _userPosition = {};
_userPosition.position = $(ui.item).index();
_userPosition.id = $(ui.item).data('user-id');
$.ajax({
url: "<%= Rails.application.routes.url_helpers.update_order_card_admin_users_new_interface_index_path %>",
type: 'POST',
dataType: 'script',
data: {users: _userPosition}
});
}
});
$('#card-list').disableSelection();
}
function typeMode() {
var _userPosition = [];
$('#list-view tbody tr').each(function(i) {
$(this).data('user-index', i);
});
$('#member-list').on(clickEvent, '.edit_position', function(e){
var $input = $('<input type="text">'),
$cross = $('<a class="btn btn-mini"><i class="icons-cross"/></a>');
if($(this).siblings('input').length) {
$(this).siblings('input').attr('type', 'text').after($cross);
} else {
$(this).after($cross);
$(this).after($input);
}
$(this).hide();
$input.val($(this).text());
e.preventDefault();
$cross.click(function(event) {
$input.remove();
$(this).siblings('a').show().end().remove();
});
});
$('.bottomnav').on(clickEvent, '.btn', function(e) {
_userPosition = [];
$('#member-list tbody input').each(function(i) {
_userPosition.push([$(this).val(), $(this).siblings('a').data('user-id')]);
});
$.ajax({
url: "<%= Rails.application.routes.url_helpers.update_order_list_admin_users_new_interface_index_path %>",
type: 'POST',
dataType: 'script',
data: {users: _userPosition}
});
e.preventDefault();
});
};
+1 -1
View File
@@ -4,4 +4,4 @@
//= require basic/bootstrap
//= require kernel
//= require lib/jquery.preload-min.js
//= require lib/jquery.cycle.all.js
//= require lib/jquery.cycle.all.latest.js
+1 -1
View File
@@ -1,5 +1,5 @@
//= require basic
//= require jquery.ui.sortable
//= require lib/jquery-ui-1.10.2.custom.min.js
//= require lib/jquery.ui.touch-punch.min.js
//= require lib/jquery.mjs.nestedSortable.js
//= require lib/items/items
+29 -158
View File
@@ -83,7 +83,6 @@ 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;
@@ -92,14 +91,12 @@ legend {
}
#sidebar #sidebar-menu {
position: absolute;
top: 85px;
top: 88px;
bottom: 0;
z-index: 0;
z-index: 1;
display: block;
width: 61px;
}
#sidebar #sidebar-menu.nano {
top: 0;
/*overflow: auto;*/
}
#sidebar .scroller {
position: absolute;
@@ -123,12 +120,16 @@ 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: relative;
position: absolute;
background-color: #08c;
background-image: -moz-linear-gradient(top, #08c, #006091);
background-image: -ms-linear-gradient(top, #08c, #006091);
@@ -157,20 +158,24 @@ 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 span {
#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 {
color: #FFFFFF;
cursor: pointer;
-webkit-text-shadow: 0px -1px 0px #636363;
@@ -178,7 +183,8 @@ legend {
-o-text-shadow: 0px -1px 0px #636363;
text-shadow: 0px -1px 0px #636363;
}
#sidebar .sidebar-nav > li span {
#sidebar .sidebar-nav > li > a > span {
padding: 10px;
color: #B0B0B0;
display: block;
-webkit-text-shadow: 0px 1px 0px #000000;
@@ -186,15 +192,8 @@ legend {
-o-text-shadow: 0px 1px 0px #000000;
text-shadow: 0px 1px 0px #000000;
}
#sidebar .sidebar-nav > li a {
display: block;
}
#sidebar .sidebar-nav > li i {
font-size: 1.6em;
line-height: 45px;
}
#sidebar .sidebar-nav > li.active i {
font-size: 2.2em;
#sidebar .sidebar-nav > li > a > span > i {
font-size: 1.7em;
}
#sidebar .sub-nav-block-list {
top: 40px;
@@ -275,7 +274,7 @@ legend {
}
#sidebar .sub-nav-arrow {
left: 53px;
top: -16px;
top: -10px;
width: 0px;
height: 0px;
z-index: -1;
@@ -283,6 +282,7 @@ legend {
border-style: solid;
border-width: 8px 8px 8px 0;
border-color: transparent #0088CC transparent transparent;
display: none\9; /* 用IE的去死 */
}
@@ -300,15 +300,14 @@ legend {
position: absolute;
z-index: 100;
width: 100%;
border-radius: 50%/1px;
background-color: rgba(0, 136, 204, .6);
border-radius: 1px;
background-color: rgba(0, 136, 204, .3);
}
/* Main Wrap */
#main-wrap {
padding-top: 40px;
position: relative;
}
#main-wrap .wrap-inner {
padding: 60px 20px 20px;
@@ -420,7 +419,6 @@ legend {
/* Search Clear */
.searchClear {
position: relative;
display: inline-block;
}
.searchClear .icon-search {
position: absolute;
@@ -522,9 +520,10 @@ legend {
padding: 0px 5px;
position: absolute;
z-index: 9999;
max-width: 300px;
max-width: 500px;
border-radius: 3px;
background-color: #0088CC;
white-space: nowrap;
}
#sideset .ui-tooltip.sidebar-tooltip:after {
display: none;
@@ -534,9 +533,10 @@ legend {
padding: 0px 5px;
position: absolute;
z-index: 9999;
max-width: 300px;
max-width: 500px;
border-radius: 3px;
background-color: #000000;
white-space: nowrap;
}
.ui-tooltip:after {
content: '';
@@ -551,135 +551,6 @@ 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 {
padding: 4px 0;
display: block;
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: 37px;
}
.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;
@@ -125,14 +125,6 @@
}
#list-view .checkbox-card li {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
/* Responsive */
@media (max-width: 767px) {
@@ -1,52 +0,0 @@
/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */
/*<!--breakpoint-->*/
.breakpoints {width: .8em;}
.breakpoint { color: #822; }
/*<!--match-->*/
span.CodeMirror-matchhighlight { background: #494949 }
.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; }
/*<!--activeline-->*/
.activeline {background: #253540 !important;}
.cm-s-midnight.CodeMirror {
background: #0F192A;
color: #D1EDFF;
}
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;}
.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;}
.cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;}
.cm-s-midnight .CodeMirror-cursor {
border-left: 1px solid #F8F8F0 !important;
}
.cm-s-midnight span.cm-comment {color: #428BDD;}
.cm-s-midnight span.cm-atom {color: #AE81FF;}
.cm-s-midnight span.cm-number {color: #D1EDFF;}
.cm-s-midnight span.cm-property, .cm-s-tropicaleve span.cm-attribute {color: #A6E22E;}
.cm-s-midnight span.cm-keyword {color: #E83737;}
.cm-s-midnight span.cm-string {color: #1DC116;}
.cm-s-midnight span.cm-variable {color: #FFAA3E;}
.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;}
.cm-s-midnight span.cm-def {color: #4DD;}
.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;}
.cm-s-midnight span.cm-bracket {color: #D1EDFF;}
.cm-s-midnight span.cm-tag {color: #008;}
.cm-s-midnight span.cm-link {color: #AE81FF;}
.cm-s-midnight .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}
.typ { color: #FFAA3E; }
.atn { color: #606; }
.atv { color: #080; }
.dec { color: #606; }
+18 -20
View File
@@ -1,23 +1,21 @@
/*
*= require 'lib/codemirror/theme/ambiance-mobile'
*= require "lib/codemirror/theme/ambiance"
*= require "lib/codemirror/theme/blackboard"
*= require "lib/codemirror/theme/cobalt"
*= require "lib/codemirror/theme/eclipse"
*= require "lib/codemirror/theme/elegant"
*= require "lib/codemirror/theme/erlang-dark"
*= require "lib/codemirror/theme/midnight"
*= require "lib/codemirror/theme/monokai"
*= require "lib/codemirror/theme/neat"
*= require "lib/codemirror/theme/night"
*= require "lib/codemirror/theme/rubyblue"
*= require "lib/codemirror/theme/solarized"
*= require "lib/codemirror/theme/theme"
*= require "lib/codemirror/theme/twilight"
*= require "lib/codemirror/theme/vibrant-ink"
*= require "lib/codemirror/theme/xq-dark"
*= require "lib/codemirror/theme/xq-light"
*/
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/ambiance-mobile.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/ambiance.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/blackboard.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/cobalt.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/eclipse.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/elegant.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/erlang-dark.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/midnight.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/monokai.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/neat.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/night.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/rubyblue.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/solarized.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/theme.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/twilight.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/vibrant-ink.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/xq-dark.css);
@import url(/orbit_4.0.1/assets/stylesheets/lib/codemirror/theme/xq-light.css);
.cm-tab {
border-left: 1px solid rgba(200, 200, 200, .2);
}
+200
View File
@@ -0,0 +1,200 @@
/* Main List */
.main-list {
margin-bottom: 10px;
}
.main-list tbody {
border: 1px solid #dddddd;
}
.main-list thead {
border: 1px solid #454545;
}
.main-list thead th {
vertical-align: middle;
background-color: #454545;
white-space: nowrap;
color: #FFFFFF;
}
.main-list tbody tr.disable td {
color: #C5C5C5;
background-color: #eeeeee;
}
.main-list tbody tr.disable td .label-info {
background-color: #999999;
}
.main-list tbody tr.active td:first-child {
position: relative;
}
.main-list tbody tr.active td:first-child:before {
content: "";
width: 0px;
height: 0px;
left: -21px;
top: 50%;
margin-top: -6px;
position: absolute;
border-style: solid;
border-width: 6px 0 6px 6px;
border-color: transparent transparent transparent #333333;
}
.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;
}
.main-list td.preview img {
width: 100%;
}
.main-list td .banner-link {
width: 100px;
max-width: 120px;
display: inline-block;
text-overflow: ellipsis;
overflow: hidden;
}
.main-list td .file-list {
display: inline-block;
margin: 0 0 -6px;
}
.main-list td .file-list:after {
content: "";
clear: both;
display: block;
height: 0;
visibility: hidden;
}
.main-list td .file-type {
position: relative;
list-style: none;
float: left;
display: inline-block;
}
.main-list td .file-type a {
background-color: #A6A6A6;
color: #FFFFFF;
margin-right: 10px;
padding: 2px 5px 2px 3px;
border-radius: 3px;
text-decoration: none;
text-shadow: 0px -1px 0px rgba(100, 100, 100, .6);
}
.main-list td .file-type i,
.main-forms fieldset .input-area .controls .file-type i {
width: 16px;
height: 16px;
margin-bottom: -1px;
display: inline-block;
}
.main-list td .file-type[class^="type-"] i,
.main-list td .file-type[class*=" type-"] i,
.main-forms fieldset .input-area .controls .file-type[class*=" type-"] i,
.main-forms fieldset .input-area .controls .file-type[class^="type-"] i {
background-image: url(/orbit_4.0.1/assets/images/file_type.png);
}
.file-type.type-pdf i {background-position: 0px 0px;}
.file-type.type-psd i {background-position: -16px 0px;}
.file-type.type-ai i {background-position: -32px 0px;}
.file-type.type-fla i {background-position: -48px 0px;}
.file-type.type-in i {background-position: -64px 0px;}
.file-type.type-acc i {background-position: 0px -16px;}
.file-type.type-do i {background-position: -16px -16px;}
.file-type.type-xl i {background-position: -32px -16px;}
.file-type.type-pp i {background-position: -48px -16px;}
.file-type.type-zip i {background-position: -64px -16px;}
.file-type.type-txt i {background-position: 0px -32px;}
.file-type.type-jp i {background-position: -16px -32px;}
.file-type.type-gif i {background-position: -32px -32px;}
.file-type.type-png i {background-position: -48px -32px;}
.file-type.type-audio i {background-position: -64px -32px;}
.main-list td .quick-edit {
height: 24px;
margin-top: 5px;
}
.main-list td .quick-edit .nav {
display: none;
margin-bottom: 0;
}
.main-list tr:hover .quick-edit .nav {
display: block;
}
.main-list td .quick-edit .nav > li > a {
padding-top: 4px;
padding-bottom: 4px;
margin-top: 0px;
margin-bottom: 0px;
border: 1px dotted #d1d1d1;
}
.main-list td .quick-edit .nav > li > a:hover {
border: 1px dotted transparent;
}
.main-list thead tr.sort-header th a {
padding: 8px;
margin: -8px;
display: block;
color: #FFFFFF;
text-decoration: none;
}
.main-list thead tr.sort-header th.active a {
padding-bottom: 4px;
border-bottom: 4px solid #08c;
}
.main-list .footable-row-detail td {
padding: 0;
border-top: none;
}
.main-list .footable-row-detail td .footable-row-detail-inner {
display: none;
padding: 8px;
position: relative;
border-radius: 5px;
margin: 0 8px 8px;
background-color: #ededed;
}
.main-list .footable-row-detail td .footable-row-detail-inner:after {
display: block;
height: 0px;
width: 0px;
position: absolute;
top: -6px;
left: 50%;
margin-left: -3px;
content: "";
border-style: solid;
border-width: 0 6px 6px 6px;
border-color: transparent transparent #ededed transparent;
}
.main-list .footable-row-detail td .footable-row-detail-inner div {
margin: 10px 0;
}
#preview .preview {
margin: 0 auto;
}
/* For Retina */
@media screen and (-webkit-min-device-pixel-ratio: 2), screen and (max--moz-device-pixel-ratio: 2) {
.main-list td .file-type[class^="type-"] i,
.main-list td .file-type[class*=" type-"] i,
.main-forms fieldset .input-area .controls .file-type[class*=" type-"] i,
.main-forms fieldset .input-area .controls .file-type[class^="type-"] i {
background-image: url(/orbit_4.0.1/assets/images/file_type@2x.png);
background-size: 80px 48px;
}
}
/* Responsive */
@media (max-width: 480px) {
.main-list td .quick-edit .nav {
display: block;
}
}
@@ -39,13 +39,6 @@
.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;
-10
View File
@@ -10,12 +10,6 @@
}
/* List */
#list-view #member-list tr.highlight td {
background-color: #FFFAE5;
}
#list-view #member-list tr.highlight td:first-child {
padding: 0
}
#list-view #member-list .gender,
#list-view #member-list td[class^="gender-"] {
width: 5px;
@@ -195,10 +189,6 @@
#list-view #member-card > li:hover .member-avatar .action {
visibility: visible;
}
#list-view #member-card .highlight {
background-color: #F0F0F0;
outline: 1px dashed #9E9E9E;
}
#list-view #member-card .member-avatar {
width: 150px;
height: 150px;
-3
View File
@@ -29,9 +29,6 @@
.topnav .btn-group {
margin-left: 0;
}
.topnav .view-switch {
margin-left: 10px;
}
/* Bottom Nav */
.bottomnav {
@@ -223,7 +223,7 @@
#orbit-bar {
margin: 0;
font-family: "Chivo";
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
line-height: 20px;
color: #333333;
@@ -40,7 +40,6 @@ class Admin::AdBannersController < OrbitBackendController
def edit
@ad_banner = AdBanner.find(params[:id])
render layout: false
end
def update
@@ -22,10 +22,8 @@ class Admin::AdImagesController < Admin::AdBannersController
end
def update
@ad_banner = AdBanner.find params[:ad_banner][:id]
@ad_image = AdImage.find(params[:ad_image][:id])
@ad_image = AdImage.find(params[:id])
@ad_image.update_attributes(params[:ad_image])
@ad_banner.ad_images << @ad_image
redirect_to admin_ad_images_path
end
@@ -40,10 +38,10 @@ class Admin::AdImagesController < Admin::AdBannersController
end
def create
@ad_banner = AdBanner.find params[:ad_banner][:id]
# @ad_banner = AdBanner.find params[:ad_banner][:id]
@ad_image = AdImage.new params[:ad_image]
@ad_image.to_save = true
@ad_banner.ad_images << @ad_image
#@ad_image.to_save = true
#@ad_banner.ad_images << ad_image
if @ad_image.save
redirect_to admin_ad_images_path
@@ -34,30 +34,38 @@ class Admin::AuthorizationsController < OrbitBackendController
end
def add_roles
roles = Role.find(params[:role_ids]) rescue nil
unless roles.nil?
roles = Role.find(params[:role_ids]) rescue []
users = []
roles.each do |role|
users += role.users.all.entries
end
unless roles.blank?
authorization = get_or_create_authorization
add_roles_to_auth(authorization, roles)
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 nil
unless sub_roles.nil?
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)
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 nil
unless users.nil?
users = User.find(params[:user_ids]) rescue []
unless users.blank?
authorization = get_or_create_authorization
add_users_to_auth(authorization, users)
add_users_to_auth(authorization, users) unless @error
end
@users = authorization.authorized_users
render 'admin/authorizations/reload_users'
@@ -112,6 +120,10 @@ class Admin::AuthorizationsController < OrbitBackendController
protected
def add_managers_to_auth(users)
@module_app.add_managers(users)
end
def add_roles_to_auth(authorization, roles)
authorization.add_roles(roles)
end
@@ -139,7 +151,7 @@ class Admin::AuthorizationsController < OrbitBackendController
@error = t(:no_data)
end
when nil
@module_app.auth_manager || @module_app.create_auth_manager(module_app_id: @module_app.id, title: @module_app.key)
@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
@@ -150,6 +162,10 @@ class Admin::AuthorizationsController < OrbitBackendController
end
end
def remove_managers_from_auth(users)
@module_app.remove_manager(users)
end
def remove_roles_form_auth(authorization, roles)
authorization.remove_roles(roles)
end
+2 -2
View File
@@ -27,8 +27,8 @@ class Admin::ItemsController < OrbitBackendController
def update_position
item = Item.find(params[:id])
item.shift_to(params[:parent_id], params[:position].to_i)
render :nothing => true, status: 200
item.shift_to(params[:parent_id], params[:position])
render :nothing => true
end
end
+1 -1
View File
@@ -60,7 +60,7 @@ class Admin::SitesController < OrbitBackendController
end
def preference
end
@@ -4,7 +4,6 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
helper OrbitBackendHelper
before_filter :set_attribute,:except => [:index,:show]
open_for_user :only => [:setting_account, :edit_user_data, :update]
open_for_visitor :only => [:index, :show]
def index
@@ -183,36 +182,6 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
# @disable_all_field = false
@user = User.find(params[:users_new_interface_id])
end
def edit_user_data
if params[:users_new_interface_id].blank?
redirect_to :action => :index
else
@user = User.find(params[:users_new_interface_id])
if current_user.id != @user.id
redirect_to :action => :index
end
@form_index = 0
get_info_and_roles
end
end
def setting_account
if params[:users_new_interface_id].blank?
redirect_to :action => :index
else
@user = User.find(params[:users_new_interface_id])
if current_user.id != @user.id
redirect_to :action => :index
end
end
end
def update
@@ -234,37 +203,6 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
render :action => :edit_passwd, :notice => flash.now[:error]
end
elsif params[:edit_type] == 'edit_user_data'
if current_user.id != @user.id
redirect_to :action => :index
end
@user.update_attributes(params[:user])
attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
attribute_values = params[:user].delete(attribute_values_key)
@user.save
redirect_to :action => :show
elsif params[:edit_type] == 'setting_account'
if current_user.id != @user.id
redirect_to :action => :index
end
if !@user.valid_password?(params[:old_password])
flash.now[:error] = t("users.valid_old_password")
end
if !flash.now[:error] && @user.update_attributes(params[:user])
redirect_to :action => :show
else
render :action => :setting_account, :notice => flash.now[:error]
end
else
@user.update_attributes(params[:user])
@@ -312,37 +250,11 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
end
def edit_order_card
def edit_order
@users = User.not_guest_user
@type = 'card'
render 'edit_order'
end
def edit_order_list
@users = User.not_guest_user
@type = 'list'
render 'edit_order'
end
def update_order_card
@error = false
if params[:users].present?
to_go = params[:users][:position].to_i
user_at_position = User.where(position: to_go).first
user = User.find(params[:users][:id])
if user_at_position
if user.position > user_at_position.position
user.move_above(user_at_position)
else
user.move_below(user_at_position)
end
end
end
render nothing: true, status: 200
end
def update_order_list
@error = []
def update_order
if params[:users].present?
params[:users].values.sort.each do |pair|
to_go = pair[0].to_i
+8 -12
View File
@@ -18,7 +18,7 @@ class ApplicationController < ActionController::Base
helper_attr :site_valid_locales
def check_backend_openness
if Site.first.backend_openness_on
if !Me.backend_openness_on
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
end
end
@@ -140,21 +140,17 @@ class ApplicationController < ActionController::Base
# update session if passed
session[:locale] = params[:locale] if params[:locale]
browser_locale = condition = nil
default_locale = condition = nil
# check if locale is valid for non site pages
if LIST[:forbidden_item_names].include?(env['PATH_INFO'].split('/')[1].to_s)
condition = VALID_LOCALES.include?(session[:locale])
#check if the default locale is present or not
elsif @site.default_locale.present?
default_locale = @site.default_locale
condition = @site.in_use_locales.include?(default_locale)
elsif !@site.enable_language_detection
#check enable langauge detection
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
condition = @site.in_use_locales.include?(browser_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 ? (default_locale || browser_locale || session[:locale]) : I18n.default_locale.to_s
I18n.locale = session[:locale].to_sym
@@ -325,7 +321,7 @@ class ApplicationController < ActionController::Base
a << object if (value.include?(object.category.id.to_s) rescue nil)
end
objects = a.uniq
when 'tags'
when 'tag'
a = Array.new
objects.each do |object|
object.tags.each do |tag|
+1 -1
View File
@@ -1,4 +1,4 @@
class DesktopAppsController < ApplicationController
class DesktopAppsController < OrbitBackendController
require "net/http"
require "uri"
require 'zip/zip'
+3 -4
View File
@@ -19,7 +19,7 @@ class DesktopController< ApplicationController
render :layout => "compatibility"
end
def desktop_container
def desktop
render :layout => false
end
@@ -340,11 +340,10 @@ class DesktopController< ApplicationController
render :json=>b.to_json
end
protected
private
def check_desktop_open
@site = Site.first
if @site.desktop_closed #Need to be change
if Me.desktop_closed && current_user.nil? #Need to be change
redirect_to '/admin/dashboards'
end
end
@@ -1,4 +1,4 @@
class DesktopWidgetsController < ApplicationController
class DesktopWidgetsController < OrbitBackendController
require "net/http"
require "uri"
require 'zip/zip'
+2 -24
View File
@@ -12,16 +12,7 @@ class FrontController < ApplicationController
end
def show_footer
@page = Page.find(:all, :conditions => {:name => /terms/i})
@name = @page.first.name
@url = "/#{@name}"
if !@site.enable_terms_of_use
render :text => (@site.footer + "<a href='#{@url}'>Terms of Use</a>")
else
render :text => @site.footer
end
render :text => @site.footer
end
def show_menu
@@ -30,15 +21,7 @@ class FrontController < ApplicationController
end
def show_site_sub_menu
@page = Page.find(:all, :conditions => {:name => /sitemap/i})
@name = @page.first.name
@url = "/#{@name}"
if !@site.sitemap_menu_in_header
render :text => (@site.sub_menu + "<a href='#{@url}'>Sitemap</a>")
else
render :text => @site.sub_menu
end
render :text => @site.sub_menu
end
def show_sitemap
@@ -60,11 +43,6 @@ class FrontController < ApplicationController
@tags = module_app.sorted_tags_for_cloud
end
def show_terms_of_use
@site = Site.first rescue nil
@terms = @site.terms_of_use
end
private
def menu_level(page, current_page, current, menu)
+1 -9
View File
@@ -43,7 +43,7 @@ class MobileController < ApplicationController
def page
@page_title = t('mobile.page')
@page_contexts = get_sorted_page_from_structure
@page_contexts = PageContext.where(:archived => false).page(params[:page_main]).per(15)
end
def page_content
@@ -57,12 +57,4 @@ class MobileController < ApplicationController
@no_footer = true if request.path =~ /app/
end
def get_sorted_page_from_structure
page_contexts = Item.structure_ordered_items.inject([]){ |pages, page|
pages << page.page_contexts.where(archived: false).limit(1)[0] if page.is_a?(Page) && !page.page_contexts.blank?
pages
}
Kaminari.paginate_array(page_contexts).page(params[:page]).per(15)
end
end
+3 -4
View File
@@ -9,7 +9,7 @@ class PagesController < ApplicationController
if @item
delayed_impressionist(@item)
render_page
render_page
else
redirect_to '/admin/dashboards',:notice=>t(:need_home)
# render :text => t(:need_home)
@@ -19,7 +19,6 @@ class PagesController < ApplicationController
def show
#begin
@item = Item.first(:conditions => {:path => params[:page_name]})
if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s))
delayed_impressionist(@item)
case @item.class.to_s
@@ -27,7 +26,7 @@ class PagesController < ApplicationController
if params[:clicked_field_name]
render_page({"clicked_field_name"=>params["clicked_field_name"]}) unless save_from_no_lang_for_page
else
render_page(params.except(:controller, :action, :page_name)) unless save_from_no_lang_for_page
render_page(params) unless save_from_no_lang_for_page
end
when 'Link'
redirect_to(@item[:url]) unless save_from_no_lang_for_page
@@ -114,7 +113,7 @@ class PagesController < ApplicationController
end
def check_frontend_open
if Site.first.frontend_open && current_user.nil? #Need to be change
if Me.frontend_closed && current_user.nil? #Need to be change
redirect_to '/admin/dashboards'
end
end
+1 -1
View File
@@ -180,7 +180,7 @@ module ApplicationHelper
page_title = page.page_title ? page.page_title : page.title
if page.root? && @site.title
res << @site.title
elsif @site.title && !@site.title_always_on
elsif @site.title && @site.title_always_on
res << @site.title + ' - ' + page_title
else
res << page_title
+1 -1
View File
@@ -199,7 +199,7 @@ module OrbitBackendHelper
objects.join(' ')
else
objects = Array(objects).map do |object|
display_value(object.send(field)) rescue ''
display_value(object.send(field))
end
objects.join(', ')
end
+1 -1
View File
@@ -2,8 +2,8 @@ class AdBanner
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
include OrbitCoreLib::ObjectAuthable
include OrbitTag::Taggable
include OrbitModel::Authorizable
field :title
field :transition_msec,type: Integer
+1
View File
@@ -1,3 +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
+8 -11
View File
@@ -45,18 +45,15 @@ class Item
end
def shift_to(new_parent, position)
position = position.to_i
new_parent = Item.find(new_parent)
current_position_sibling = find_by_parent_and_position(new_parent, position)
if current_position_sibling
if self.position > current_position_sibling.position
self.move_above(current_position_sibling)
else
self.move_below(current_position_sibling)
unless self.parent_id.to_s.eql?(new_parent) && self.position.eql?(position.to_i)
new_parent = Item.find(new_parent)
current_position_sibling = find_by_parent_and_position(new_parent, position.to_i)
if current_position_sibling
move_above(current_position_sibling)
elsif self.parent != new_parent
self.parent = new_parent
save
end
elsif self.parent != new_parent
self.parent = new_parent
save
end
end
+18 -5
View File
@@ -7,7 +7,6 @@ class ModuleApp
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 :has_category, type: Boolean, default: false
field :key
field :title
field :sidebar_order,type: Integer,default: 0
@@ -186,19 +185,18 @@ class ModuleApp
user_ids = self.auth_approvals.inject([]) do |users, auth|
users += auth.authorized_users.map{|user| user.id}
end
self.update_attribute(:auth_approval_users, user_ids.uniq)
update_attribute(:auth_approval_users, user_ids.uniq)
end
def update_auth_manager_users
users = self.auth_manager_authorized_users
self.update_attribute(:auth_manager_users, users.map{|user| user.id}) if 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
self.update_attribute(:auth_sub_manager_users, user_ids.uniq)
update_attribute(:auth_sub_manager_users, user_ids.uniq)
end
def managers
@@ -209,6 +207,21 @@ class ModuleApp
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)
+2 -2
View File
@@ -30,8 +30,8 @@ class ModuleTag
if self.new_record?
self.build_tag(name_translations: self.name_translations, is_default: self.is_default)
else
self.tag.attributes = {:name_translations => self.name_translations}
self.tag.attributes = {:is_default => self.is_default}
self.tag.name_translations = self.name_translations
self.tag.is_default = self.is_default
end
end
+3 -22
View File
@@ -7,22 +7,19 @@ class Site
field :in_use_locales, :type => Array
field :valid_locales, :type => Array
field :enable_locales, :type => Array
field :roaming_id
field :private_key, :type => Binary
field :public_key, :type => Binary
field :frontend_open, :type => Boolean, :default => true
field :frontend_closed, :type => Boolean, :default => false
field :backend_openness_on, :type => Boolean, :default => false
field :desktop_closed, :type => Boolean, :default => false
field :sitemap_menu_in_header, :type => Boolean, :default => false
field :enable_terms_of_use, :type => Boolean, :default => false
field :enable_language_detection, :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=>{}
@@ -31,14 +28,13 @@ class Site
field :department
mount_uploader :default_image, ImageUploader
mount_uploader :favicon, ImageUploader
field :search,:type => Hash
field :resque_namespace,:type => String, :default=>APP_CONFIG['orbit']
field :title, localize: true
field :footer, localize: true
field :sub_menu, localize: true
field :terms_of_use, localize: true
field :terms_of_user, localize: true
field :google_analytics
field :default_locale
@@ -46,21 +42,6 @@ class Site
belongs_to :design
has_many :site_metas, :autosave => true, :dependent => :destroy
validate :in_use_locales, :minimum_enabled_locales
def minimum_enabled_locales
size = self.in_use_locales.length
if size < 1
errors.add(:size, "Needs at least one language in use")
end
end
def maximum_enabled_locales
size = self.in_use_locales.length
if size >= 2
errors.add(:size, "Max 2 ")
end
end
def generate_keys
private_key = OpenSSL::PKey::RSA.generate(2048)
+5
View File
@@ -1,3 +1,8 @@
# class Tag < ProtoTag
# belongs_to :module_app
# end
class Tag
include Mongoid::Document
include Mongoid::Timestamps
+1 -7
View File
@@ -52,7 +52,6 @@ class User
accepts_nested_attributes_for :attribute_values, :allow_destroy => true
before_create :initialize_desktop
before_save :assign_default_position, :if => :assign_default_position?
before_save :rebuild_status_record
scope :remote_account, where(:nccu_id.ne => nil)
scope :not_guest_user, all_of(:name.ne => "guest")
@@ -290,7 +289,7 @@ class User
end
end
private
protected
def rebuild_status_record
self.status_record = {}
@@ -300,9 +299,4 @@ class User
end
end
# override mongoid-tree's method
def assign_default_position?
!self['name'].eql?('guest') && (self.position.nil? || self.parent_id_changed?)
end
end
+25 -31
View File
@@ -1,31 +1,25 @@
<%= form_for @ad_banner, url: admin_ad_banner_path(@ad_banner) do |f| %>
<fieldset>
<legend><%= t("ad_banner.banner") %></legend>
<label><%= t("ad_banner.banner_name") %></label>
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
<span class="help-block"><%= t("ad_banner.banner_name_note") %></span>
<label for="timeout"><%= t("ad_banner.ste") %></label>
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
<span class="help-block"><%= t("ad_banner.ste_note") %></span>
<label><%= t("ad_banner.best_size") %></label>
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
<span class="help-block"><%= t("ad_banner.best_size") %> EX:120x30 </span>
<label><%= t("ad_banner.effect") %></label>
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
<div class="preview">
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
</div>
<span class="help-block"><%= t("ad_banner.effect") %></span>
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:update_), class: 'btn btn-primary btn-small' %>
</fieldset>
<% end %>
<script type="text/javascript">
$('select').on('change', function() {
$(".preview").cycle({
delay: -3000,
fx: $(this).val()
});
});
</script>
<div class="content">
<%= form_for(:ad_banner, :url => admin_ad_banner_path(:ad_banner), :remote => true) do |f| %>
<fieldset>
<legend>Ad Banner</legend>
<label>Banner Name</label>
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
<span class="help-block">Banner Name only english</span>
<label for="timeout">Ste</label>
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
<span class="help-block">Please enter the number of seconds</span>
<label>Best Size</label>
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
<span class="help-block">Best Size EX:120x30 </span>
<label>Effect</label>
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
<div class="preview">
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
</div>
<span class="help-block">Effect</span>
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
</fieldset>
<% end %>
</div>
+6 -4
View File
@@ -1,5 +1,3 @@
<%= javascript_include_tag "lib/jquery.cycle.all.js"%>
<table class="table main-list">
<thead>
<tr>
@@ -15,7 +13,7 @@
<div class="quick-edit">
<ul class="nav nav-pills">
<% if is_admin?%>
<li><%= link_to t(:edit), edit_admin_ad_banner_path(ad_banner), :class => "open-slide" %></li>
<li><%= link_to t(:edit), edit_admin_ad_banner_path(ad_banner)%></li>
<li><%= link_to 'Destroy', admin_ad_banner_path(ad_banner), method: :delete , :confirm => t(:sure?) %></li>
<% end %>
@@ -32,8 +30,12 @@
<!-- footer -->
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add_new), new_admin_ad_banner_path, :class => "btn btn-primary open-slide"%>
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add_new), "#add-banner", :class => "btn btn-primary open-slide"%>
</div>
</div>
<div id="add-banner" class="nano" style="display:none">
<%= render 'new' %>
</div>
<% end %>
+25 -31
View File
@@ -1,31 +1,25 @@
<%= form_for(:ad_banner, :url => admin_ad_banners_path) do |f| %>
<fieldset>
<legend><%= t("ad_banner.banner") %></legend>
<label><%= t("ad_banner.banner_name") %></label>
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
<span class="help-block"><%= t("ad_banner.banner_name_note") %></span>
<label for="timeout"><%= t("ad_banner.ste") %></label>
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
<span class="help-block"><%= t("ad_banner.ste_note") %></span>
<label><%= t("ad_banner.best_size") %></label>
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
<span class="help-block"><%= t("ad_banner.best_size") %> EX:120x30 </span>
<label><%= t("ad_banner.effect") %></label>
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
<div class="preview">
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
</div>
<span class="help-block"><%= t("ad_banner.effect") %></span>
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
</fieldset>
<% end %>
<script type="text/javascript">
$('select').on('change', function() {
$(".preview").cycle({
delay: -3000,
fx: $(this).val()
});
});
</script>
<div class="content">
<%= form_for(:ad_banner, :url => admin_ad_banners_path) do |f| %>
<fieldset>
<legend>Ad Banner</legend>
<label>Banner Name</label>
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
<span class="help-block">Banner Name only english</span>
<label for="timeout">Ste</label>
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
<span class="help-block">Please enter the number of seconds</span>
<label>Best Size</label>
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
<span class="help-block">Best Size EX:120x30 </span>
<label>Effect</label>
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
<div class="preview">
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
</div>
<span class="help-block">Effect</span>
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
</fieldset>
<% end %>
</div>
+1 -2
View File
@@ -55,7 +55,7 @@
<div class="control-group">
<label class="control-label muted">Banner</label>
<div class="controls">
<%= select_tag 'ad_banner[id]',options_from_collection_for_select(AdBanner.all, "id", "title", @ad_image.ad_banner_id) , :class=>"input-medium" %>
<%= select_tag 'ad_banner[id]',options_from_collection_for_select(AdBanner.all, "id", "title",params[:ad_banner_id]) , :class=>"input-medium" %>
</div>
</div>
@@ -244,7 +244,6 @@
</div>
<!-- Form Actions -->
<%= f.hidden_field :id, :value => @ad_image.id %>
<div class="form-actions">
<%= f.submit t("submit"),:class=>"btn btn-primary" %>
<%= f.submit t("cancel"),:class=>"btn ",:type => 'reset' %>
@@ -10,7 +10,7 @@
<li><%= link_to show_toggle_archive_btn(category) , toggle_admin_module_app_category_path(@module_app_id, category), method: :post, remote: true, class: "archive_toggle" %></li>
<% end %>
<% if is_manager? || is_admin? %>
<li><%= link_to t(:category_auth), admin_authorizations_path(@module_app.key, 'category_authorization', category.id) %></li>
<li><%= link_to t(:category_auth), admin_authorizations_path(@module_app.key, 'category', category.id) %></li>
<% end %>
</ul>
</div>
+1 -1
View File
@@ -9,7 +9,7 @@
</ul>
</div>
</td>
<td class="span1"><%= radio_button_tag 'design_default', design.id, (@site.design.id.to_s.eql?(design.id.to_s) ? true : false), :class => 'design_default', :rel => admin_sites_path %></td>
<td class="span7"><%= design.intro %></td>
<td class="span2"><%= design.author %></td>
<td class="span1 active"><%= radio_button_tag 'design_default', design.id, (@site.design.id.to_s.eql?(design.id.to_s) ? true : false), :class => 'design_default toggle-check', :rel => admin_sites_path %></td>
</tr>
+7 -8
View File
@@ -1,12 +1,11 @@
<thead>
<tr class="sort-header">
<th></th>
<th class="first span3"><a href="#">Templates Title</a></th>
<th data-hide="phone" class="active span3">Active</th>
<th data-hide="phone" class="active span3">Date of purchase</th>
<th data-hide="phone" class="active span3">Designer</th>
<th class="span1"></th>
</tr>
<tr>
<th class="span1 strong"></th>
<th class="span2"></th>
<th class="span1"></th>
<th class="span7"></th>
<th class="span2"></th>
</tr>
</thead>
<tbody>
<tbody id="tbody_designs" class="sort-holder">
+1 -1
View File
@@ -18,5 +18,5 @@
<%= f.text_field :intro %>
</div>
</div>
<%= f.submit t(:update_), :class=>"btn btn-primary" %>
<%= f.submit t(:update_) %>
<% end %>
+1 -21
View File
@@ -2,27 +2,7 @@
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :side_bar_content => 'admin/sites/side_bar'} %>
<% end %>
<head>
<%= stylesheet_link_tag "lib/wrap-nav"%>
<%= stylesheet_link_tag "lib/main-list"%>
<%= stylesheet_link_tag "lib/mt-list"%>
<%= stylesheet_link_tag "lib/filter"%>
<%= stylesheet_link_tag "lib/codemirror/theme/theme"%>
<%= javascript_include_tag 'codemirror/codemirror' %>
<%= javascript_include_tag 'codemirror/jquery.codemirror' %>
<%= javascript_include_tag 'codemirror/mode/css' %>
<%= javascript_include_tag 'codemirror/mode/xml' %>
<%= javascript_include_tag 'codemirror/mode/vbscript' %>
<%= javascript_include_tag 'codemirror/mode/javascript' %>
<%= javascript_include_tag 'codemirror/mode/htmlmixed' %>
<%= javascript_include_tag 'codemirror/addon/edit/closetag' %>
<%= javascript_include_tag 'codemirror/addon/edit/closebrackets' %>
<%= javascript_include_tag 'codemirror/util/formatting' %>
<%= javascript_include_tag 'lib/templates_code' %>
</head>
<h1><%= @design.title %></h1>
<h1><%= t('editing.design') %></h1>
<ul class="nav nav-tabs" id="myTab">
<li class="active"><a href="#info" data-toggle="tab"><%= t(:info) %></a></li>
-15
View File
@@ -2,21 +2,6 @@
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :side_bar_content => 'admin/sites/side_bar'} %>
<% end %>
<head>
<%= stylesheet_link_tag "lib/wrap-nav"%>
<%= stylesheet_link_tag "lib/main-list"%>
<%= stylesheet_link_tag "lib/mt-list"%>
<%= stylesheet_link_tag "lib/filter"%>
<%= stylesheet_link_tag "lib/togglebox"%>
<%= javascript_include_tag 'lib/footable-0.1' %>
<%= javascript_include_tag 'lib/all-list' %>
<%= javascript_include_tag 'lib/retina' %>
<%= javascript_include_tag 'lib/mudole_templates_status' %>
</head>
<%= render 'filter' %>
<table class="table main-list">
<%= render 'designs' %>
+2 -2
View File
@@ -1,9 +1,9 @@
<% node = Item.root %>
<% unless node.nil? %>
<ol id='<%= node.id %>' class="sortable item-groups">
<%= render 'node_and_children', node: node %>
</ol>
<% end %>
<%= render 'layouts/delete_modal', delete_options: {remote: true} %>
<%= javascript_include_tag "lib/jquery.pageslide.js" %>
+82 -80
View File
@@ -2,84 +2,86 @@
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
<% end %>
<head>
<%= stylesheet_link_tag "lib/wrap-nav"%>
<%= stylesheet_link_tag "lib/main-list"%>
<%= stylesheet_link_tag "lib/mt-list"%>
<%= stylesheet_link_tag "lib/filter"%>
<%= stylesheet_link_tag "lib/togglebox"%>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag 'normalize' %>
<%= stylesheet_link_tag 'bootstrap-responsive' %>
<%= stylesheet_link_tag 'rulingorbit' %>
<%= stylesheet_link_tag 'module-store' %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "jquery.cycle" %>
<%= javascript_include_tag "modules" %>
<% end %>
<%= javascript_include_tag 'lib/footable-0.1' %>
<%= javascript_include_tag 'lib/all-list' %>
<%= javascript_include_tag 'lib/retina' %>
<%= javascript_include_tag 'lib/mudole_templates_status' %>
</head>
<table id="mt-list" class="table main-list">
<thead>
<tr class="sort-header">
<th class="first"><a href="#">Module Title</a></th>
<th data-hide="phone" class="active span3">Date of purchase</th>
<th data-hide="all" class="active"><a href="#">Description</a></th>
<th class="span2">Active</th>
</tr>
</thead>
<tbody>
<tr>
<td class="detail-row">
<div class="module_icon pull-left">
<%= image_tag "module_icon.png"%>
</div>
<h5 class="mt_title"><span>Module Title</span><span class="muted">2.0.1</span></h5>
<p class="mt_dev muted">Rulingcom</p>
</td>
<td class="detail-row">2013/07/12</td>
<td>
@detail
</td>
<td class="active"><button class="act btn btn-mini" type="button">Uninstall</button></td>
</tr>
<tr class="download">
<td class="detail-row">
<div class="module_icon pull-left">
<%= image_tag "module_icon.png"%>
</div>
<h5 class="mt_title"><span>Module Title Module Title Module Title</span><span class="muted">2.0.1</span></h5>
<p class="mt_dev muted">Rulingcom</p>
</td>
<td class="detail-row">2013/07/12</td>
<td>
@detail
</td>
<td class="active"><button class="act btn btn-mini btn-success" type="button">Download</button></td>
</tr>
<tr class="install">
<td class="detail-row">
<div class="module_icon pull-left">
<%= image_tag "module_icon.png"%>
</div>
<h5 class="mt_title"><span>Module Title</span><span class="muted">2.0.1</span></h5>
<p class="mt_dev muted">Rulingcom</p>
</td>
<td class="detail-row">2013/07/12</td>
<td>
@detail
</td>
<td class="active"><button class="act btn btn-mini btn-primary" type="button">Install</button></td>
</tr>
<tr class="update">
<td class="detail-row">
<div class="module_icon pull-left">
<%= image_tag "module_icon.png"%>
</div>
<h5 class="mt_title"><span>Module Title</span><span class="muted">2.0.1</span></h5>
<p class="mt_dev muted">Rulingcom</p>
</td>
<td class="detail-row">2013/07/12</td>
<td>
@detail
</td>
<td class="active"><button class="act btn btn-mini btn-info" type="button">Update</button></td>
</tr>
</tbody>
</table>
<div class="wrapper">
<div id="toolbar">
<div class="filter fn">
<span class="label">Price</span>
<div class="drop-menu ui">
<a href="" class="controller">
<span class="option-default">All</span>
<span class="arrow down"></span>
</a>
<ul class="option-list">
<li><a class="option-item" href="">All</a></li>
<li><a class="option-item" href="">3000</a></li>
<li><a class="option-item" href="">4000</a></li>
<li><a class="option-item" href="">5000</a></li>
</ul>
</div>
</div>
<div class="filter fn">
<span class="label">Category</span>
<div class="drop-menu ui">
<a href="" class="controller">
<span class="option-default">All</span>
<span class="arrow down"></span>
</a>
<ul class="option-list">
<li><a class="option-item" href="">All</a></li>
<li><a class="option-item" href="">National Taiwan University</a></li>
<li><a class="option-item" href="">Category 1</a></li>
<li><a class="option-item" href="">Category 2</a></li>
<li><a class="option-item" href="">Category 3</a></li>
</ul>
</div>
</div>
<div class="filter fn">
<span class="label">Sort by</span>
<div class="drop-menu ui">
<a href="" class="controller">
<span class="option-default">Date</span>
<span class="arrow down"></span>
</a>
<ul class="option-list">
<li><a class="option-item" href="">Date</a></li>
<li><a class="option-item" href="">Popular</a></li>
<li><a class="option-item" href="">Recent Upload</a></li>
</ul>
</div>
</div>
</div>
<div id="feature" class="clearfix">
<div id="feature-nav">
<ul>
<li><a href=""><img class="item-thumb" src="<%= asset_path "f1.jpg"%>" alt="Thumbnail 1" width="228" height="67"></a></li>
<li><a href=""><img class="item-thumb" src="<%= asset_path "f2.jpg"%>" alt="Thumbnail 2" width="228" height="67"></a></li>
<li><a href=""><img class="item-thumb" src="<%= asset_path "f3.jpg"%>" alt="Thumbnail 3" width="228" height="67"></a></li>
</ul>
</div>
<div class="holder">
<ul>
<li><a href=""><img class="item-thumb" src="<%= asset_path "f1.jpg"%>" alt="Thumbnail 1" width="740" height="220"></a></li>
<li><a href=""><img class="item-thumb" src="<%= asset_path "f2.jpg"%>" alt="Thumbnail 2" width="740" height="220"></a></li>
<li><a href=""><img class="item-thumb" src="<%= asset_path "f3.jpg"%>" alt="Thumbnail 3" width="740" height="220"></a></li>
</ul>
</div>
</div>
<div id="item-list">
<ul class="clearfix">
<% 12.times do |i| %>
<li><a href="module_store/show?m=<%= i + 1 %>"><img src="/assets/module/thumb/mt<%= i + 1 %>.jpg" alt="" class="item-thumb"><span class="item-info"><b class="item-name">Module <%= i + 1 %></b><span class="item-price">Free</span></span></a></li>
<% end %>
</ul>
</div>
</div>
+1 -1
View File
@@ -5,6 +5,6 @@ $("#tags_index").html("<%= j render 'index' %>")
$.pageslide.close();
openSlide();
$('.card').cardCheck({
item: $('.card input[type="checkbox"]'),
check: $('.card input[type="checkbox"]'),
});
checkedLength()
@@ -7,7 +7,6 @@
<%= f.hidden_field :public_r_tag_object_id, :value => @part.page.id %>
<%#= f.select :public_r_tag_object_id, options_for_select([t(:horizontal), t(:vertical)], t(:horizontal)) %>
<% elsif @r_tag.eql?('sitemap') %>
<% elsif @r_tag.eql?('terms_of_use') %>
<% elsif @r_tag.eql?('breadcrumb') %>
<% else %>
<%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, :selected => @part.public_r_tag_object_id) %>
+2 -2
View File
@@ -91,5 +91,5 @@
</div>
</div>
<%=javascript_include_tag "lib/items/update_cates_and_tags.js" %>
<%= javascript_include_tag "lib/items/page_widget_edit_interface.js" %>
<%=javascript_include_tag "inc/update_cates_and_tags.js" %>
<%= javascript_include_tag "inc/page_widget_edit_interface.js" %>
+6 -12
View File
@@ -1,16 +1,10 @@
<li class="map-block <%= 'disabled' if !sitemap_block.show_in_sitemap_for(temp_locale) %>">
<h6>
<input type="checkbox" id="<%= sitemap_block.id %>" class="toggle-check onoff" temp_locale="<%= temp_locale %>" data-deploy="right">
<span><%= sitemap_block_counter + 1 %> <%= sitemap_block.title_translations[temp_locale] %></span>
</h6>
<ul>
<% sitemap_block.children.each_with_index do |child, i| %>
<li class="<%= 'disabled' if !child.show_in_sitemap_for(temp_locale) %>">
<% sitemap_block.children.each_with_index do |child, i| %>
<li "<%= 'disabled' if !child.show_in_sitemap_for(temp_locale) %>">
<h6>
<input type="checkbox" id="<%= child.id %>" class="toggle-check onoff" temp_locale="<%= temp_locale %>" data-deploy="right">
<%= content_tag :button, :id => child.id, :temp_locale => temp_locale, :disabled => !child.show_in_sitemap_for(temp_locale) do %>
<% end %>
<input type="checkbox" class="toggle-check" data-deploy="right">
<span><%= "#{sitemap_block_counter + 1}-#{i + 1}" %> <%= child.title_translations[temp_locale] %></span>
</h6>
</li>
</li>
<% end if sitemap_block.children %>
</ul>
</li>
+29 -52
View File
@@ -17,9 +17,11 @@
<fieldset>
<!-- Input Area -->
<div class="input-area">
<div class="nav-name"><strong>Classification</strong></div>
<div class="nav-name"><strong>Classification</strong></div>
<ul class="nav nav-pills language-nav">
<li class="active">
<a href="#sidebar-nav" data-toggle="tab">Sidebar Nav</a>
@@ -112,10 +114,10 @@
<!-- Openness -->
<div id="openness" class="tab-pane fade">
<div class="control-group">
<label class="control-label muted"><%= I18n.t('site.frontend_open')%></label>
<label class="control-label muted"><%= I18n.t('site.frontend_closed')%></label>
<div class="controls">
<%= f.check_box :frontend_open , :class=>"toggle-check"%>
<span class="help-block">If Checked, the frontend will be open for all users.</span>
<%= f.check_box :frontend_closed , :class=>"toggle-check"%>
<span class="help-block">Only can be viewed by users logged in</span>
</div>
</div>
<div class="control-group">
@@ -126,7 +128,7 @@
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= I18n.t('site.enable_personal_desktop')%></label>
<label class="control-label muted">Disable personal desktop</label>
<div class="controls">
<%= f.check_box :desktop_closed , :class=>"toggle-check" %>
</div>
@@ -142,32 +144,25 @@
<input type="checkbox" class="toggle-check" data-disabled="true">
</div>
</div> -->
<!-- Terms of Use -->
<div class="control-group">
<label class="control-label muted">Enable User Language Detection
</label>
<div class="controls">
<%= f.check_box :enable_language_detection, :class => "toggle-check" %>
</div>
</div>
<div class="control-group">
<label class="control-label muted">Enable Language</label>
<div class="controls">
<% @site_valid_locales.each do |valid_locale| %>
<%= check_box_tag "site[enable_locales][]", locale, @site.valid_locales.include?(locale), :class=>"toggle-check", :data => { :title => "#{I18nVariable.from_locale(locale)}" } %>
<% end %>
</div>
</div>
<div class="control-group">
<label class="control-label muted">Default Language</label>
<div class="controls">
<% @site_in_use_locales.each do |locale| %>
<%= check_box_tag :default_locale, locale, (@site.default_locale.nil?), :class=>"toggle-check", :data => { :title => "#{I18nVariable.from_locale(locale)}" } %>
<%= check_box_tag :default_locale, locale, (@site.enabled_for.nil?), :class=>"toggle-check" %>
<%= I18nVariable.from_locale(locale) %>
<% end %>
</div>
</div>
<div class="control-group">
<label class="control-label muted">Enable Language</label>
<div class="controls">
<% @site_valid_locales.each do |valid_locale| %>
<%= check_box_tag 'site[enabled_for][]', valid_locale, (@site.enabled_for.nil?), :class=>"toggle-check" %>
<%= I18nVariable.from_locale(valid_locale) %>
<% end %>
<%= hidden_field_tag 'site[enabled_for][]', '' %>
</div>
</div>
</div>
@@ -179,7 +174,7 @@
<!-- if this page editing please add class "fileupload-edit" -->
<div class="fileupload fileupload-new clearfix" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left">
<% if @site.default_image %>
<% if @site.default_image %>
<%= image_tag( @site.default_image, :size=>"120x120") rescue ''%>
<% else %>
<img class="pull-left upload-picture" src="/assets/default-img.png" />
@@ -194,41 +189,23 @@
<%end%>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
</div>
</div>
<div class="control-group">
<label class="control-label muted">Orbit Favicon</label>
<div class="controls">
<!-- if this page editing please add class "fileupload-edit" -->
<div class="fileupload fileupload-new clearfix" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left">
<% if @site.favicon %>
<%= image_tag( @site.favicon, :size=>"120x120") rescue ''%>
<% else %>
<img class="pull-left upload-picture" src="/assets/default-img.png" />
<% end %>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn btn-danger fileupload-remove">
<% if @site.default_image.file %>
<label class="checkbox">
<%= check_box_tag 'site[remove_default_image]' %>
<%= t(:delete_) %>
</label>
<% end %>
</label>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<span class="btn btn-file">
<% if @site.favicon.file.present?%>
<%= f.file_field :favicon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Change
<%else%>
<%= f.file_field :favicon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Select Image
<%end%>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
+42 -41
View File
@@ -43,48 +43,49 @@
<hr>
<!-- Description -->
<div class="control-group">
<label class="control-label muted">Keywords</label>
<div class="controls">
<div class="tab-content textarea-lang">
<div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#textarea_<%= locale %>_0" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group">
<label class="control-label muted">Site Keywords</label>
<div class="controls">
<div class="tab-content textarea-lang">
<div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each do |locale|%>
<%= content_tag :li, link_to(I18nVariable.from_locale(locale), ".#{locale}", :data => {:toggle => "tab"}), :class => "btn #{(active_when_current_locale_eq locale)}" %>
<% end %>
</div>
<div class="tab-pane fade active in" id="keywords_en_0">
<%= f.fields_for :keywords do |f| %>
<%= f.text_area locale, :class => "resizable",:rows=>3, :value => (@site.keywords(locale) rescue nil) %>
<% end %>
</div>
</div>
</div>
</div>
<%end%>
<%end%>
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group">
<label class="control-label muted">Site Description</label>
<div class="controls">
<div class="tab-content textarea-lang">
<div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each do |locale|%>
<%= content_tag :li, link_to(I18nVariable.from_locale(locale), ".#{locale}", :data => {:toggle => "tab"}), :class => "btn #{(active_when_current_locale_eq locale)}" %>
<% end %>
</div>
<div class="tab-pane fade active in" id="description_en_0">
<%= f.fields_for :description do |f| %>
<%= f.text_area locale, :class => "resizable",:rows=>3, :value => (@site.description(locale) rescue nil) %>
<% end %>
</div>
</div>
</div>
</div>
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade in <%= ( i == 0 ) ? "active" : '' %>" id="textarea_<%= locale %>_0">
<%= f.fields_for :keywords do |f| %>
<%= f.text_area locale, :class=>'resizable', :value => (@site.keywords(locale) rescue nil), :placeholder => I18nVariable.from_locale(locale), :rows=>"3" %>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label muted">Description</label>
<div class="controls">
<div class="tab-content textarea-lang">
<div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#textarea_<%= locale %>_0" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
</div>
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade in <%= ( i == 0 ) ? "active" : '' %>" id="textarea_<%= locale %>_0">
<%= f.fields_for :description do |f| %>
<%= f.text_area locale, :class=>'resizable', :value => (@site.description(locale) rescue nil), :placeholder => I18nVariable.from_locale(locale), :rows=>"3" %>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
<%end%>
<%end%>
</div>
<!-- Form Actions -->
<div class="form-actions">
+20 -32
View File
@@ -47,7 +47,7 @@
<!-- Always shoe in the title bar -->
<div class="control-group">
<label class="control-label muted"><%= t :always_display_title %>
<label class="control-label muted">Always show in the title bar
</label>
<div class="controls">
<%= f.check_box :title_always_on, :class => "toggle-check" %>
@@ -55,6 +55,7 @@
</div>
<hr>
<!-- CKeditor Site Header -->
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
@@ -69,30 +70,15 @@
<%end%>
<%end%>
<!-- Sitemap menu in Header -->
<div class="control-group">
<label class="control-label muted">Sitemap menu in header
</label>
<div class="controls">
<%= f.check_box :sitemap_menu_in_header, :class => "toggle-check" %>
</div>
</div>
<hr>
<!-- CKeditor Site Footer -->
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<label class="control-label muted"><%= t('site.footer')%></label>
<!-- Sitemap menu in Header -->
<div class="control-group">
<label class="control-label muted">Sitemap menu in header
</label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :footer_translations do |f| %>
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.footer_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<%end%>
<%end%>
<input type="checkbox" class="toggle-check" data-disabled="true">
</div>
</div>
<hr>
<!-- Terms of Use -->
@@ -100,25 +86,27 @@
<label class="control-label muted">Terms of Use
</label>
<div class="controls">
<%= f.check_box :enable_terms_of_use, :class => "toggle-check" %>
<input type="checkbox" class="toggle-check terms" data-disabled="true" checked="checked">
</div>
</div>
<!-- CKeditor Site Footer -->
<!-- CKeditor Default Terms of Use -->
<div class="control-group input-content hide">
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<label class="control-label muted"><%= t('site.default_terms_of_use')%></label>
<label class="control-label muted">Default Terms of Use</label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :terms_of_use_translations do |f| %>
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.terms_of_use_translations[locale] rescue nil) %>
<%= f.fields_for :terms_of_user_translations do |f| %>
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.terms_of_user_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
<%end%>
</div>
<%end%>
<%end%>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.submit t("submit"), :class => "btn btn-primary" %>
+56 -40
View File
@@ -1,4 +1,9 @@
<head>
<!-- Meta -->
<!--#include virtual="/orbit_4.0.1/include/meta.html"-->
<!-- Basic CSS -->
<!--#include virtual="/orbit_4.0.1/include/basic_css.html"-->
<%= stylesheet_link_tag "lib/wrap-nav"%>
<%= stylesheet_link_tag "lib/filter"%>
<%= stylesheet_link_tag "lib/sitemap"%>
@@ -12,43 +17,23 @@
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
<% end %>
<div id="sitemap">
<ul id="map-tree-language" class="nav nav-pills">
<% @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>
<div class="tab-content map-tree-content">
<div class="line"></div>
<% @site_valid_locales.each_with_index do |temp_locale, i| %>
<ul id="<%= temp_locale %>" class="map-tree tab-pane fade in <%= ( i == 0 ) ? "in active" : '' %>">
<%= render :partial => 'sitemap_block', :collection => @items, :locals => {:temp_locale => temp_locale} %>
</ul>
<% end %>
</div>
</div>
<% content_for :page_specific_javascript do %>
<script>
$(document).ready(function(){
$('.site-map').masonry({
itemSelector: '.map-block',
columnWidth: 260
});
$('a[data-toggle="tab"]').on('shown', function (e) {
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/jquery.masonry.min.js" %>
<script>
$(document).ready(function(){
$('.site-map').masonry({
itemSelector: '.map-block',
columnWidth: 260
});
$('a[data-toggle="tab"]').on('shown', function (e) {
$('.site-map').masonry({
itemSelector: '.map-block',
columnWidth: 260
});
})
});
$(document).on('click', 'li .onoff', function () {
});
$(document).on('click', 'li .onoff', function () {
$(this).parents("li").toggleClass("disabled");
if($(this).parents("li").attr("class").indexOf("disabled") > 0){
$(this).text("<%= t('off_upcase') %>")
@@ -57,20 +42,51 @@
}
$.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?temp_locale=' + $(this).attr('temp_locale'));
});
$(document).on('click', 'h6 .onoff', function () {
$(document).on('click', 'h4 .onoff', function () {
$(this).parents(".map-block").toggleClass("disabled");
if($(this).parents("h6").parents("li").attr("class").indexOf("disabled") > 0){
if($(this).parents("h4").parents("div").attr("class").indexOf("disabled") > 0){
$(this).text("<%= t('off_upcase') %>")
$(this).parents(".map-block").find('li').addClass('disabled')
$(this).parents(".map-block").find('checkbox').text("<%= t('off_upcase') %>")
// $(this).parents(".map-block").find('li checkbox').attr('disabled', 'disabled')
$(this).parents(".map-block").find('button').text("<%= t('off_upcase') %>")
$(this).parents(".map-block").find('li button').attr('disabled', 'disabled')
} else {
$(this).text("<%= t('on_upcase') %>")
$(this).parents(".map-block").find('li').removeClass('disabled')
$(this).parents(".map-block").find('checkbox').text("<%= t('on_upcase') %>")
// $(this).parents(".map-block").find('li checkbox').removeAttr("disabled")
}
$(this).parents(".map-block").find('button').text("<%= t('on_upcase') %>")
$(this).parents(".map-block").find('li button').removeAttr("disabled")
}
$.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?parent=true&temp_locale=' + $(this).attr('temp_locale'));
});
</script>
<% end %>
</script>
<% end %>
<section id="main-wrap">
<div class="wrap-inner">
<div id="sitemap">
<ul id="map-tree-language" class="nav nav-pills">
<% @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 |temp_locale, i| %>
<div class="tab-content map-tree-content">
<div class="line"></div>
<ul id="<%= temp_locale %>" class="map-tree tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<%= render :partial => 'sitemap_block', :collection => @items, :locals => {:temp_locale => temp_locale} %>
</ul>
<% end %>
<br/><br/><br/>
<% @site_valid_locales.each_with_index do |temp_locale, i| %>
<div class="tab-pane site-map <%= temp_locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%= render :partial => 'sitemap_block', :collection => @items, :locals => {:temp_locale => temp_locale} %>
</div>
<% end %>
</div>
</div>
</div>
</section>
+1 -1
View File
@@ -4,6 +4,6 @@ $("#tags_index").html("<%= j render 'index' %>")
$.pageslide.close();
openSlide();
$('.card').cardCheck({
item: $('.card input[type="checkbox"]'),
check: $('.card input[type="checkbox"]'),
});
checkedLength()
@@ -1,23 +0,0 @@
<div id="list-view">
<div id="member-card" class="mini-layout-body">
<ul id="card-list" class="checkbox-card clearfix">
<% @users.each do |user| %>
<li class="filter-item" data-user-id="<%= user.id %>">
<label>
<div class="user-pic">
<%= show_avatar(user) %>
</div>
<span class="user-name"><%= user.name %></span>
<span><%= user.email %></span>
</label>
</li>
<% end %>
</ul>
</div>
</div>
<script>
$(function() {
dragMode();
});
</script>
@@ -1,44 +0,0 @@
<div id="list-view">
<table id="member-list" class="table main-list">
<thead>
<tr class="sort-header">
<th class="gender"></th>
<th class="span2"><a href="#"><%= t(:position) %></a></th>
<th class="span4"><a href="#"><%= t(:name) %></a></th>
<th><a href="#"><%= t(:email) %></a></th>
</tr>
</thead>
<tbody>
<% @users.each do |user| %>
<%
case user.sex
when 'male'
user_sex = 'gender-man'
when 'female'
user_sex = 'gender-woman'
else
user_sex = 'gender-none'
end
%>
<tr id="<%= dom_id user %>">
<td class="<%= user_sex %>"></td>
<td><%= link_to user.position + 1, '#', class: 'edit_position', 'data-user-id' => user.id %></td>
<td><%= link_to user.name, admin_users_new_interface_path(user) %></td>
<td><%= user.email %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to t(:update_), '#', class: "btn btn-primary pull-right" %>
</div>
</div>
<script>
$(function() {
typeMode();
});
</script>
@@ -1,81 +0,0 @@
<%= render :partial=>"infos"%>
<div id="roles-area" class="input-area">
<%=render :partial=>"user_role_data",:collection=>Role.all.asc("_id")%>
</div>
<% content_for :page_specific_javascript do -%>
<% ( params[:users_new_interface_id].blank? ? @fname = 'new_attribute_values' : @fname = 'attribute_values' ) %>
<!-- Text -->
<script id="template-text" type="text/x-tmpl">
<div class="input-append">
<input type="text" id="${roleType+'_text_'+appendIndex}" name="${'user[<%= @fname %>]['+nameNumber+'][value][]'}" class="input-medium" placeholder="">
<a href="#" class="btn remove-input">
<i class="icon-trash"></i>
</a>
</div>
</script>
<!-- Text Language -->
<script id="template-text-language" type="text/x-tmpl">
<div class="input-append">
<div class="tab-content">
<% VALID_LOCALES.collect do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %>
<div class="tab-pane fade <%= active %> in" id="${roleType+'_text_language_<%= locale %>_'+appendIndex}">
<input type="text" name="${'user[<%= @fname %>]['+nameNumber+'][value][][<%= locale %>]'}" placeholder="<%= I18nVariable.from_locale(locale) %>" value="">
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% VALID_LOCALES.collect do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %>
<a class="btn <%= active %>" href="${'#'+roleType+'_text_language_<%= locale %>_'+appendIndex}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
<a href="#" class="btn remove-input"><i class="icon-trash"></i></a>
</div>
</div>
</script>
<!-- Address -->
<script id="template-address" type="text/x-tmpl">
<div class="input-append">
<div class="tab-content">
<div class="tab-pane fade active in" id="${roleType+'_address_en_'+appendIndex}">
<input type="text" name="${'user[new_attribute_values]['+nameNumber+'][value][en]'}" placeholder="Address" value="">
<input type="hidden" id="${roleType+'_street_address_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][street_address]'}" value="">
<input type="hidden" id="${roleType+'_cityarea_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][county]'}" value="">
<input type="hidden" id="${roleType+'_city_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][city]'}" value="">
<input type="hidden" id="${roleType+'_zip_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][zip]'}" value="">
<input type="hidden" id="${roleType+'_county_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][country]'}" value="">
<input type="hidden" id="${roleType+'_indicator_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][indicator]'}" value="">
</div>
<div class="tab-pane fade" id="${roleType+'_address_zh_tw_'+appendIndex}">
<input type="text" name="${'user[new_attribute_values]['+nameNumber+'][value][zh_tw]'}" placeholder="地址" value="">
<input type="hidden" id="${roleType+'_street_address_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][street_address]'}" value="">
<input type="hidden" id="${roleType+'_cityarea_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][county]'}" value="">
<input type="hidden" id="${roleType+'_city_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][city]'}" value="">
<input type="hidden" id="${roleType+'_zip_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][zip]'}" value="">
<input type="hidden" id="${roleType+'_county_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][country]'}" value="">
<input type="hidden" id="${roleType+'_indicator_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][indicator]'}" value="">
</div>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<a class="btn active" href="${'#'+roleType+'_address_en_'+appendIndex}" data-toggle="tab">English</a>
<a class="btn" href="${'#'+roleType+'_address_zh_tw_'+appendIndex}" data-toggle="tab">Chinese</a>
<a class="btn" href="#address-field" role="button" data-toggle="modal"><i class="icon-edit"></i></a>
<a href="#" class="btn remove-input"><i class="icon-trash"></i></a>
</div>
</div>
</script>
<% end -%>
@@ -1,7 +1,7 @@
<div class="bottomnav clearfix">
<div class="action pull-right">
<% if is_admin? %>
<%= link_to t(:edit_order), edit_order_list_admin_users_new_interface_index_path, :class => "btn btn-primary" %>
<%= link_to t(:edit_order), edit_order_admin_users_new_interface_index_path, :class => "btn btn-primary" %>
<%= link_to(new_admin_users_new_interface_path,:class=> "btn btn-primary") do %>
<i class="icon-plus"></i><%= t(:add) %>
<% end -%>
@@ -0,0 +1,15 @@
<%
if user_edit_order.sex == 'male'
@user_sex = 'gender-man'
elsif user_edit_order.sex == 'female'
@user_sex = 'gender-woman'
else
@user_sex = 'gender-none'
end
%>
<tr id="<%= dom_id user_edit_order %>">
<td class="<%= @user_sex %>"></td>
<td><%= link_to user_edit_order.position + 1, '#', class: 'edit_position', 'data-user-id' => user_edit_order.id %></td>
<td><%= link_to user_edit_order.name, admin_users_new_interface_path(user_edit_order) %></td>
<td><%= user_edit_order.email %></td>
</tr>
@@ -1,91 +0,0 @@
<% role_disable = @user.roles.include?(user_role_data) ? false : true %>
<div class="attributes <%= role_disable ? 'disabled hide' : '' %>">
<div class="attributes-header clearfix">
<%= hidden_field_tag("user[disable_role][id][#{user_role_data.id}]",role_disable,:for=>@form_index,:value=>role_disable)%>
<h4><%= user_role_data.title %><%= t(:role_info)%></h4>
</div>
<div class="attributes-body">
<% @form_index = @form_index +1 %>
<div class="control-group">
<%= label_tag t(:status), nil, {:func=>"field_label", :for=>"1", :class=>"control-label muted"} %>
<div class="controls">
<% user_role_data.role_statuses.where(:disable => false).each_with_index do |rrs, i|%>
<%= hidden_field_tag("user[role_status][id][#{rrs.id}]", false,:for=>"#{@form_index}")%>
<%= label_tag(i,check_box_tag( "user[role_status][id][#{rrs.id}]", true, @user.role_statuses.include?(rrs))+rrs.title,:class=>"checkbox inline") %>
<% end %>
</div>
</div>
<% @form_index = @form_index +1 %>
<div class="control-group">
<%= label_tag t(:category), nil, {:func=>"field_label", :for=>"1", :class=>"control-label muted"} %>
<div class="controls">
<% user_role_data.role_categorys.where(:disable => false).each_with_index do |rrcg, i|%>
<%= hidden_field_tag("user[role_category][id][#{rrcg.id}]", false,:for=>"#{@form_index}")%>
<%= label_tag(i,check_box_tag( "user[role_category][id][#{rrcg.id}]", true, @user.role_categorys.include?(rrcg))+rrcg.title,:class=>"checkbox inline") %>
<% end %>
</div>
</div>
<% user_role_data.attribute_fields.asc(:_id).each do |rf|%>
<%= rf.block_helper(@user,@form_index)%>
<% @form_index = @form_index +1 %>
<% end %>
<% @form_index = @form_index +1 %>
<div class="input-area sub-role">
<% user_role_data.sub_roles.where(:disabled=>false).asc("_id").each do |sub_role| %>
<% sub_role_disable = @user.sub_roles.include?(sub_role) ? false : true %>
<div class="attributes <%= sub_role_disable ? 'disabled hide' : '' %>">
<div class="attributes-header clearfix">
<%= hidden_field_tag("user[disable_sub_role][id][#{sub_role.id}]",sub_role_disable,:for=>@form_index,:value=>sub_role_disable)%>
<h4><%= sub_role.title %><%= t(:role_info)%></h4>
</div>
<div class="attributes-body">
<% sub_role.attribute_fields.asc(:_id).each do |af|%>
<%= af.block_helper(@user,@form_index)%>
<% @form_index = @form_index +1 %>
<% end %>
</div>
</div>
<% end %>
</div>
</div>
</div>
@@ -1,53 +0,0 @@
<%#= devise_error_messages! %>
<%= flash_messages %>
<div class="attributes">
<div class="attributes-header clearfix">
<h4><%=t("users.user_basic_id_form")%></h4>
</div>
<div class="attributes-body">
<!-- Account -->
<div class="control-group">
<label class="control-label muted" for="account">
<%= f.label t("users.user_id"),:class=>"control-label" %>
</label>
<div class="controls add-input">
<span><%= @user.user_id %></span>
</div>
</div>
<!-- Old Password -->
<div class="control-group">
<label class="control-label muted" for="password">
<%= f.label t("password_current"),:class=>"control-label" %>
</label>
<div class="controls add-input">
<%= password_field_tag "old_password",nil, :class=>"input-medium", :id=>"password" %>
</div>
</div>
<!-- Password -->
<div class="control-group">
<label class="control-label muted" for="password">
<%= f.label t("users.new_password"),:class=>"control-label" %>
</label>
<div class="controls add-input">
<%= f.password_field :password, :class=>"input-medium", :id=>"password" %>
<span class="help-block"><%= t("users.new_password_note")%></span>
</div>
</div>
<!-- Confirm Password -->
<div class="control-group">
<label class="control-label muted" for="confirm_password">
<%= f.label t("users.new_password_confirmation"),:class=>"control-label" %>
</label>
<div class="controls add-input">
<%= f.password_field :password_confirmation, :class=>"input-medium", :id=>"confirm_password" %>
</div>
</div>
</div>
</div>
@@ -1,30 +1,65 @@
<% content_for :side_bar do %>
<%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %>
<% content_for :page_specific_css do %>
<% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "lib/member" %>
<%= stylesheet_link_tag "lib/checkbox-card" %>
<% end %>
<% end -%>
<% content_for :right_nav do %>
<div class="view-switch btn-group pull-right" data-toggle="buttons-radio">
<%= link_to content_tag(:i, nil, class: 'icon-list'), edit_order_list_admin_users_new_interface_index_path, class: "btn btn-small#{' active' if @type.eql?('list')}" %>
<%= link_to content_tag(:i, nil, class: 'icon-th'), edit_order_card_admin_users_new_interface_index_path, class: "btn btn-small#{' active' if @type.eql?('card')}" %>
<div id="list-view">
<table id="member-list" class="table main-list">
<thead>
<tr class="sort-header">
<th class="gender"></th>
<th class="span2"><a href="#"><%= t(:position) %></a></th>
<th class="span4"><a href="#"><%= t(:name) %></a></th>
<th><a href="#"><%= t(:email) %></a></th>
</tr>
</thead>
<tbody>
<%= render partial: "user_edit_order", collection: @users %>
</tbody>
</table>
</div>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to t(:update_), '#', class: "btn btn-primary pull-right" %>
</div>
<% end %>
<div id="order_content">
<% case @type %>
<% when 'card' %>
<%= render 'edit_order_card' %>
<% when 'list' %>
<%= render 'edit_order_list' %>
<% end %>
</div>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "jquery.ui.sortable" %>
<%= javascript_include_tag "lib/jquery.ui.touch-punch.min.js" %>
<%= javascript_include_tag "lib/jquery.lite.image.resize.js" %>
<%= javascript_include_tag "lib/member/sort.js.erb" %>
<script>
$(function(){
var _userPosition = [];
$('#member-list').on(clickEvent, '.edit_position', function(e){
var $input = $('<input type="text">');
var $cross = $('<a class="btn btn-mini"><i class="icons-cross"/></a>');
$(this).after($cross);
$(this).after($input);
$(this).hide();
$input.val($(this).text()).attr('id', $(this).data('user-id'));
e.preventDefault();
$cross.click(function(event) {
$input.remove();
$(this).siblings('a').show().end().remove();
});
});
$('.bottomnav').on(clickEvent, '.btn', function(e) {
$('#member-list tbody input').each(function() {
_userPosition.push([$(this).val(), $(this).attr('id')])
});
e.preventDefault();
$.ajax({
url: '<%= update_order_admin_users_new_interface_index_path %>',
type: 'POST',
dataType: 'script',
data: {users: _userPosition}
}).done(function() {
_userPosition = [];
console.log(_userPosition)
});
});
});
</script>
<% end %>
@@ -1,43 +0,0 @@
<% content_for :side_bar do %>
<%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %>
<% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "lib/pageslide.css" %>
<%= stylesheet_link_tag "lib/main-forms.css" %>
<%= stylesheet_link_tag "lib/fileupload.css" %>
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%>
<% content_for :page_specific_javascript do -%>
<%= javascript_include_tag "lib/jquery-ui-1.10.3.custom.min.js" %>
<%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
<%= javascript_include_tag "lib/bootstrap-fileupload.js" %>
<%= javascript_include_tag "lib/bootstrap-datetimepicker.js" %>
<%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %>
<%= javascript_include_tag "lib/member/textarea-lang-btn.js" %>
<%= javascript_include_tag "lib/member/role-forms.js" %>
<% end -%>
<%= form_for @user, :url => admin_users_new_interface_path(@user), :html => { :multipart => true , :class=>"form-horizontal main-forms", :id=>"user-forms"} do |f| %>
<fieldset>
<div id="basic-area" class="input-area">
<%= f.error_messages %>
<%= render :partial => 'user_basic', :locals => {:f => f}%>
<%= render :partial => 'form_user_data', :locals => { :f => f } %>
</div>
<div class="form-actions">
<%= hidden_field_tag 'edit_type', 'edit_user_data' %>
<%= link_to t(:update_), "#", :class=>"btn btn-primary returnDecide", :onclick=>"$('#user-forms').submit()" %>
<%= link_back('btn') %>
</div>
</fieldset>
<% end -%>
@@ -1,39 +0,0 @@
<% content_for :side_bar do %>
<%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %>
<% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "lib/pageslide.css" %>
<%= stylesheet_link_tag "lib/main-forms.css" %>
<%= stylesheet_link_tag "lib/fileupload.css" %>
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%>
<% content_for :page_specific_javascript do -%>
<%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
<%= javascript_include_tag "lib/bootstrap-fileupload.js" %>
<%= javascript_include_tag "lib/member/role-forms.js" %>
<%= javascript_include_tag "lib/member/textarea-lang-btn.js" %>
<% end -%>
<%= form_for @user, :url => admin_users_new_interface_path(@user), :html => { :multipart => true , :class=>"form-horizontal main-forms"} do |f| %>
<fieldset>
<div id="basic-area" class="input-area">
<%= f.error_messages %>
<%= render :partial => 'user_setting_account', :locals => {:f => f}%>
</div>
<div class="form-actions">
<%= link_back('btn') %>
<%= hidden_field_tag 'edit_type', 'setting_account' %>
<%= link_to t(:update_), "#", :class=>"btn btn-primary returnDecide", :onclick=>"$('#edit_user_#{@user.id}').submit()" %>
</div>
</fieldset>
<% end -%>
@@ -20,7 +20,7 @@
<small class="muted"><%= @user.email %></small>
<div class="btn-group">
<%= link_to("<i class='icon-edit'></i> #{t(:edit)}".html_safe,edit_admin_users_new_interface_path(@user),:class=>"btn btn-mini" ) if is_admin?%>
<%= link_to("<i class='icons-cycle'></i> #{t("users.change_passwd")}".html_safe,admin_users_new_interface_edit_passwd_path(@user),:class=>"btn btn-mini" ) if is_admin? and current_user.id != @user.id %>
<%= link_to("<i class='icons-cycle'></i> #{t("users.change_passwd")}".html_safe,admin_users_new_interface_edit_passwd_path(@user),:class=>"btn btn-mini" ) if is_admin?%>
</div>
</div>
@@ -0,0 +1 @@
$('#list-view table tbody').html("<%= j render partial: 'user_edit_order', collection: @users %>")
@@ -1 +0,0 @@
$('#order_content').html("<%= j render 'edit_order_list' %>")
@@ -1,9 +1,8 @@
<% if @data.present? %>
<%= render :partial => 'shared/search_header',:locals=>{:items=>@data} %>
<%= render @partial %>
<% if @paginate %>
<%= paginate @data, :param_name => :page_main, :params => {:same_page_id => @page_id} %>
<% elsif @page_part.module_app %>
<%= @page_part.module_app.get_registration.default_widget_setting.link_to_more_tag(request,params) %>
<% end %>
<%= render :partial => 'shared/search_header',:locals=>{:items=>@data} %>
<%= render @partial %>
<% if @paginate and !@data.blank? %>
<%= paginate @data, :param_name => :page_main, :params => {:same_page_id => @page_id} %>
<% elsif @page_part.module_app %>
<%= @page_part.module_app.get_registration.default_widget_setting.link_to_more_tag(request,params) %>
<% end %>
+5 -17
View File
@@ -2,9 +2,9 @@
<div id="side">
<div id="rwidget" class="wh2 thmc4">
<ul class="docklist">
<li class="d_cate"><a callback-method='initializeDesktop' href="desktop/desktop_container" class="widget_fn wh2 hh2" id='home' onclick="return false;" sub-menu="false"><span class="widget_icon"><img src="" alt="Home" id="home_icon" width="30" height="30"/></span></a>
<li class="d_cate"><a callback-method='initializeDesktop' href="desktop/desktop" class="widget_fn wh2 hh2" id='home' onclick="return false;"><span class="widget_icon"><img src="" alt="Home" id="home_icon" width="30" height="30"/></span></a>
<ul class="dock_child hh2 thmc4" style="width: 120px;">
<li class="dock_item"><a callback-method='initializeAppManager' href="<%= desktop_app_manager_path %>" class="widget_fn wh2 hh2" id="d_app_manager" onclick="return false;" sub-menu="false"><span class="widget_icon"><img src="" alt="App Manager" id="app_manager_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeAppManager' href="<%= desktop_app_manager_path %>" class="widget_fn wh2 hh2" id="d_app_manager" onclick="return false;"><span class="widget_icon"><img src="" alt="App Manager" id="app_manager_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeSettings' href="<%= desktop_settings_path %>" custom-load="settings" class="widget_fn wh2 hh2" id="d_settings" onclick="return false;"><span class="widget_icon"><img src="" alt="Settings" id="settings_icon" width="30" height="30"/></span></a></li>
</ul>
</li>
@@ -92,22 +92,10 @@
orbitDesktop.prototype.sectionId = "<%= @section.id %>";
orbitDesktop.prototype.currentLanguage = "<%= I18n.locale %>";
orbitDesktop.prototype.currentUsername = "<%= @currentusername %>";
//uselessfunction();
var od = new orbitDesktop("#ajax_container");
var getInternetExplorerVersion = function(){
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
}
return rv;
}
var version = getInternetExplorerVersion();
if( version != -1){
if(version < 9){
if($.browser.msie){
if($.browser.version < 9){
$.fx.off = true;
o.notify("We turn off the animation (javascript) for you, but still you can turn it on",10);
}
+30 -64
View File
@@ -1,64 +1,30 @@
<!-- Orbit Bar -->
<!--#include virtual="include/orbit_bar.html"-->
<section id="main-wrap">
<div class="sign-in have-other-sign-in">
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
-->
<% flash.each do |key, msg| %>
<%= content_tag :p, msg, :class => [key, "alert alert-error in fade"] %>
<% end %>
<div class="form">
<h3 class="login-logo">Log In to Orbit</h3>
<div>
<input name="utf8" type="hidden" value="" />
<input name="authenticity_token" type="hidden" value="" />
</div>
<!-- <div class="other-sign-in">
<a class="btn btn-primary" type="submit">Other Sign In</a>
<p>or</p>
</div> -->
<div class="form-block">
<div class="form-list clearfix">
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
<%= form_for resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'content'} do |f| %>
<div class="control-group clear">
<label for="user_email">
<i class="icon-user"></i>
</label>
<%= f.text_field :user_id, :placeholder => t("users.user_id"), :id=>"user_email" %>
</div>
<div class="control-group clear">
<label for="user_password">
<i class="icon-lock"></i>
</label>
<%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %>
</div>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
</form>
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
<div class="control-group clear">
<label for="user_email">
<i class="icon-user"></i>
</label>
<input type="text" id="user_id" name="user[id]" placeholder="帳號" />
</div>
<div class="control-group clear">
<label for="user_password">
<i class="icons-mail"></i>
</label>
<input type="text" id="user_email" name="user[email]" placeholder="電子郵件" />
</div>
</form>
</div>
</div>
<!-- <div class="register">
<button class="btn btn-inverse" type="submit">Register</button>
</div> -->
<% end %>
</div>
</div>
</section>
<h1 class="login-logo"><%= t(:ruling_site) %></h1>
<div id="signin-header">
<h3><%= t(:login) %></h3>
</div>
<div id="container" class="sign-in">
<%= form_for resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'user_new form-horizontal'} do |f| %>
<div class="content">
<% flash.each do |key, msg| %>
<%= content_tag :span, msg, :class => [key, "notice label label-warning"] %>
<% end %>
<p class="alert hide">You need to sign in or sign up before continuing.</p>
<div class="main">
<div class="control-group clear">
<%= f.label :user_id ,t("users.user_id")%>
<%= f.text_field :user_id, :placeholder => t("users.user_id"), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span>
</div>
<div class="control-group clear">
<%= f.label :password,t("password") %>
<%= f.password_field :password, :placeholder => t(:dots), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span>
<%= link_to t(:forgot_password), new_user_password_path, :class => 'pull-right forgot hide' %>
</div>
</div>
</div>
<div class="form-actions clear">
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary pull-right' %>
</div>
<% end %>
</div>
+16 -9
View File
@@ -1,3 +1,4 @@
<%= javascript_include_tag "lib/jquery.cycle.all.latest.js"%>
<div style='position:relative'>
<ul id='banner_nav' class='clear banner_nav-<%= @ad_banner.title.dehumanize %>'></ul>
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>
@@ -9,12 +10,18 @@
</div>
</div>
<script type='text/javascript'>
var banner = {"banner_name":"#slideshow-<%= @ad_banner.title.dehumanize %>",
"banner_fx":"<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>",
"banner_pager":".banner_nav-<%= @ad_banner.title.dehumanize %>",
"image_count":"<%= @ad_banner.ad_images.length %>",
"image_loaded":0,
"time_to_next":<%= @ad_banner.transition_msec %>,
};
banners.push(banner);
</script>
$(document).ready(function(){
jQuery(function( $ ){
$('#slideshow-<%= @ad_banner.title.dehumanize %>').cycle({
delay: -1000,
fx: "<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>",
timeoutFn: getTimeout,
pager: '.banner_nav-<%= @ad_banner.title.dehumanize %>',
pagerAnchorBuilder: function(idx, slide) {
return "<li><a href='#'></a></li>";
}
});
});
});
</script>
@@ -1 +0,0 @@
<%= @terms.html_safe %>
+1 -18
View File
@@ -21,27 +21,10 @@
</li>
<!-- Desktop -->
<% if !@site.desktop_closed%>
<li id="orbit-desktop">
<a href="<%= desktop_path %>" role="button">
<i class="icons-screen"></i> <span class="hide"><%= t(:desktop) %></span>
</a>
</li>
<% end %>
</ul>
<% if @site.default_image.present?%>
<style>
#orbit-bar .orbitlogo {
width: 20px;
height: 20px;
background-size: 70%;
display: inline-block;
background-position: center;
background-repeat: no-repeat;
background-image: url(<%= @site.default_image %>);
/* For Suck IE */
background-image: url(<%= @site.default_image%>)\9;
}
</style>
<% end %>
</ul>
+1 -4
View File
@@ -31,11 +31,8 @@
<span><%= current_user.name %></span>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="orbit-user">
<li><%= link_to content_tag(:i, nil, class: 'icons-tools') + ' ' + t("users.change_passwd"), admin_users_new_interface_setting_account_path(current_user), tabindex: '-1' %></li>
<li><%= link_to content_tag(:i, nil, class: 'icons-vcard') + ' ' + t("users.user_basic_data"), admin_users_new_interface_edit_user_data_path(current_user), tabindex: '-1' %></li>
<% if @site.desktop_closed.blank? %>
<li><%= link_to content_tag(:i, nil, class: 'icons-tools') + ' ' + t(:account_settings), desktop_path + "#settings-account", tabindex: '-1' %></li>
<li><%= link_to content_tag(:i, nil, class: 'icons-screen') + ' ' + t(:desktop), desktop_path, tabindex: '-1' %></li>
<% end %>
<li><%= link_to content_tag(:i, nil, class: 'icons-logout') + ' ' + t(:logout), destroy_user_session_path, tabindex: '-1' %></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#"><i class="icons-lifebuoy"></i> <%= t(:help) %></a></li>
+1
View File
@@ -3,4 +3,5 @@
<%= link_to content_tag(:i, nil, :class => (local_assigns.has_key? :icon) ? icon : 'icons-gauge'), (local_assigns.has_key? :link_url) ? link_url : admin_dashboards_path %>
</h2>
<%= render ((local_assigns.has_key? :side_bar_content) ? side_bar_content : 'layouts/side_bar_content') %>
<div class="sub-nav-arrow"></div>
</nav>
@@ -6,7 +6,6 @@
<% end %>
</ul>
</div>
<div class="sub-nav-arrow"></div>
</div>
<div class="sub-nav-block-list">
+6 -14
View File
@@ -6,23 +6,15 @@
<!--[if lt IE 9]>
<%= javascript_include_tag "html5" %>
<![endif]-->
<%= render 'layouts/meta' %>
<%= render 'layouts/google_font' %>
<%= stylesheet_link_tag "basic/global" %>
<%= stylesheet_link_tag "basic" %>
<%= render 'layouts/ie_html5_fix' %>
<%= javascript_include_tag "basic" %>
<%= yield :page_specific_css %>
<%= yield :page_specific_javascript %>
<style>
</style>
<%= csrf_meta_tag %>
<%= stylesheet_link_tag "devise" %>
<%= javascript_include_tag "devise" %>
<%= csrf_meta_tag %>
</head>
<body>
<%= render 'layouts/orbit_bar' %>
<%= yield %>
<div id="sign-footer">
<p>Rulingcom</p>
</div>
</body>
</html>
+1 -1
View File
@@ -5,7 +5,7 @@
<%= javascript_include_tag "html5" %>
<![endif]-->
<%#= stylesheet_link_tag "module_widget" %>
<%#= javascript_include_tag "module" %>
<%= javascript_include_tag "module" %>
<%#= javascript_include_tag "#{@app_title}/module_widget" %>
<%= yield :page_specific_javascript %>
<%= csrf_meta_tag %>
-1
View File
@@ -44,7 +44,6 @@ public_r_tags:
- sitemap
- breadcrumb
- tag_cloud
- terms_of_use
page_part_kinds:
- text
+2 -6
View File
@@ -11,6 +11,7 @@ en:
not_sub_manager: Access Denied for you are not SubManager for this app
not_admin: Access Denied for you are not Admin
object: Access Denied for you don't have permission for this object
account_settings: Account settings
academic_info: Academic Info.
action: Action
ad:
@@ -389,8 +390,6 @@ en:
footer: Site footer
footer_help: Footer Guide
frontend_closed: Frontend Closed
frontend_open: Frontend Open
enable_personal_desktop: Enable Personal Desktop
header: Site header
info: Site information
keywords: Site keywords
@@ -486,13 +485,12 @@ en:
users:
admin_change_password: You cannot change your own password here!
avatar: Profile Picture
change_passwd: Change Password
change_passwd: Change password
email: Email
first_name: First Name
last_name: Last Name
male: Male
name: Name
valid_old_password: Current password doesn't match confirmation
new_password: New password
new_password_note: At least 6 characters
new_password_confirmation: Confirm new password
@@ -508,8 +506,6 @@ en:
user_id_not_null: User account cannot be null
user_id_length: User account should be more than 3 characters
user_id_error: Someone already use that user account
user_basic_id_form: Account Info.
user_basic_data: Personal Profile
version: Version
vertical: Vertical
view: View
+1 -3
View File
@@ -2,7 +2,6 @@ en:
add_category: Add category
add_link: Add link
add_page: Add page
add_tags: Add Tags
add_to_default: Add to default
alternative: Alternative
approval_setting: Approval Setting
@@ -71,5 +70,4 @@ en:
error:
tag: Error when updating category
tag: Error when updating tag
url_alt: Alternative text
use_default: Use Default
url_alt: Alternative text
-2
View File
@@ -2,7 +2,6 @@ zh_tw:
add_category: 新增類別
add_link: 新增連結
add_page: 新增頁面
add_tags: Add Tags
add_to_default: 加入預設
alternative: 註解
approval_setting: 審核設定
@@ -72,4 +71,3 @@ zh_tw:
tag: 更新類別時發生錯誤
tag: 更新標籤時發生錯誤
url_alt: 註解
use_default: Use Default
+1 -5
View File
@@ -11,6 +11,7 @@ zh_tw:
not_sub_manager: 拒絕存取,因你不是此應用程式次管理員
not_admin: 拒絕存取,因你不是系統管理者
object: 拒絕存取,因你沒有權限
account_settings: 帳號設定
academic_info: 學術資訊
action: 操作
ad:
@@ -384,9 +385,7 @@ zh_tw:
thumbnail: 縮圖
site:
frontend_closed: 前台關閉?
frontend_open: 開啟前台
backend_openness_on: 開啟開放式後台(訪客可遊覽)
enable_personal_desktop: 開啟個人桌面
default_image: 預設圖像
description: 網站描述
description_help: 網站描述說明
@@ -492,7 +491,6 @@ zh_tw:
first_name: 名字
male: 男性
name: 姓名
valid_old_password: 目前的密碼不符合確認值
new_password: 新密碼
new_password_note: 至少6個字元
new_password_confirmation: 確認新密碼
@@ -509,8 +507,6 @@ zh_tw:
user_id_not_null: 使用者帳號不能是空值
user_id_length: 使用者帳號至少需要3個字元
user_id_error: 該使用者帳號已被使用
user_basic_id_form: 帳號資料
user_basic_data: 個人資料
version: 版本
vertical: 垂直的
view: 檢視
+4 -8
View File
@@ -215,14 +215,10 @@ Orbit::Application.routes.draw do
get 'temp_edit'
end
collection do
get 'edit_order_card'
get 'edit_order_list'
post 'update_order_card'
post 'update_order_list'
get 'edit_order'
post 'update_order'
end
match "edit_passwd" => "users_new_interface#edit_passwd" ,:as => :edit_passwd
match "edit_user_data" => "users_new_interface#edit_user_data" ,:as => :edit_user_data
match "setting_account" => "users_new_interface#setting_account" ,:as => :setting_account
end
resources :member_selects do
@@ -275,7 +271,7 @@ Orbit::Application.routes.draw do
match "/desktop/compatibility" => "desktop#compatibility"
match "desktop" => "desktop#index"
match "/desktop/desktop_container" => "desktop#desktop_container"
match "/desktop/desktop" => "desktop#desktop"
match '/desktop/appactivation'=>'desktop#appactivation'
match '/desktop/app_manager'=>'desktop#app_manager'
match '/desktop/allsections'=>'desktop#allsections'
@@ -330,7 +326,7 @@ Orbit::Application.routes.draw do
end
end
controller_paths :front, %w[show_breadcrumb show_banner show_footer show_menu show_page_sub_menu show_site_sub_menu show_sitemap show_tag_cloud show_terms_of_use]
controller_paths :front, %w[show_breadcrumb show_banner show_footer show_menu show_page_sub_menu show_site_sub_menu show_sitemap show_tag_cloud]
# controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content]
# scope 'app' do
+1 -1
View File
@@ -112,7 +112,7 @@ module OrbitApp
current_priority = @context_links.count
if @approvable_with_link
context_link 'approval_setting',
:link_path => "admin_authorizations_path(get_module_app.key, 'category_approval')",
:link_path => "admin_authorizations_path(get_module_app.key, 'approval')",
:priority => current_priority + 1,
:available_for => [:manager]
end
+27 -52
View File
@@ -188,15 +188,6 @@ module OrbitCoreLib
end
end
def open_for_user(arg = nil)
if arg
key = arg.shift
prepend_before_filter key[0] => key[1] {|f| f.open_for :user}
else
prepend_before_filter {|f| f.open_for :user}
end
end
def open_for_visitor(arg = nil)
if arg
key = arg.shift
@@ -206,50 +197,37 @@ module OrbitCoreLib
end
end
def skip_authorization(arg = nil)
if arg
key = arg.shift
prepend_before_filter key[0] => key[1] {|f| f.no_authorization}
else
prepend_before_filter {|f| f.no_authorization}
end
end
end
module InstanceMethods
protected
def can_use
setup_vars
unless @no_authorization
if @user_type
@open = false
@visitor = false
@user_type.each do |user_type|
case user_type
when :admin
@open ||= check_admin
when :manager
@open ||= check_manager
when :sub_manager
@open ||= check_sub_manager
when :approver
@open ||= check_sub_manager
when :user
@open ||= true
when :visitor
set_current_user
@open ||= true
@visitor ||= true
end
set_current_user
if @user_type
@user_type.each do |user_type|
open = false
visitor = false
case user_type
when :admin
open ||= check_admin
when :manager
open ||= check_manager
when :sub_manager
open ||= check_sub_manager
when :approver
open ||= check_sub_manager
when :visitor
open ||= true
visitor ||= true
end
check_backend_openness if @visitor
authenticate_user! unless @visitor
redirect_to root_url unless @open
else
authenticate_user!
check_user_can_use
check_backend_openness if visitor
authenticate_user! unless visitor
redirect_to root_url unless open
end
else
authenticate_user!
check_user_can_use
end
end
@@ -270,14 +248,10 @@ module OrbitCoreLib
end
def open_for(var)
@user_type ||= []
@user_type ||= []
@user_type << var
end
def no_authorization
@no_authorization = true
end
def check_user_can_use
unless current_or_guest_user.admin? || @module_app.is_manager?(current_or_guest_user) || @module_app.is_sub_manager?(current_or_guest_user) || @module_app.can_approve?(current_or_guest_user)
redirect_to root_url
@@ -285,8 +259,9 @@ module OrbitCoreLib
end
def setup_vars
@app_title ||= controller_path.split('/')[1].singularize rescue nil
@module_app ||= ModuleApp.first(conditions: {:key => @app_title} ) rescue nil
@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
end
end
-1
View File
@@ -7,7 +7,6 @@ module OrbitModel
has_one :auth_approval, as: :approval_authorizable, dependent: :destroy
has_one :auth_sub_manager, as: :sub_manager_authorizable, dependent: :destroy
delegate :authorized_users, to: :auth_approval, prefix: true, allow_nil: true
delegate :authorized_users, to: :auth_manager, prefix: true, allow_nil: true
delegate :authorized_users, to: :auth_sub_manager, prefix: true, allow_nil: true
send :include, InstanceMethods
end
+1 -1
View File
@@ -46,7 +46,7 @@ module OrbitTag
def tags=(tag_ids)
tag_ids = [tag_ids].flatten
tag_ids.delete_if{|e| e.match(/^[0-1]$|^$/)}
tag_ids.delete('')
ids = self.taggings.blank? ? [] : self.taggings.map{|t| t.tag.id}
tag_ids.each do |tag_id|
unless ids.include? tag_id
Loaded 100 of 131 files, more files were not shown because too many files have changed in this diff. Show more