Compare commits
103
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4eefca8531 | ||
|
|
96b6f7e3fd | ||
|
|
3d7b54df1c | ||
|
|
e8a6c2cc3c | ||
|
|
ecf0aa7d2e | ||
|
|
2f0533db2d | ||
|
|
350c68611c | ||
|
|
8b44f930f3 | ||
|
|
d2330d6e3e | ||
|
|
bd3e9fe4f6 | ||
|
|
4bb5e18f44 | ||
|
|
78205d8b00 | ||
|
|
a62ff9308f | ||
|
|
474e8b9b57 | ||
|
|
a8f7422c25 | ||
|
|
9e02011956 | ||
|
|
3f0addf04d | ||
|
|
0a01faedc9 | ||
|
|
8e0331449f | ||
|
|
635d3f1690 | ||
|
|
9e33bdadc3 | ||
|
|
54acaebc98 | ||
|
|
7f7e21b4f2 | ||
|
|
8609c8dec0 | ||
|
|
f3e40c1405 | ||
|
|
42aca64dc3 | ||
|
|
6ba840de4a | ||
|
|
53953e57db | ||
|
|
ddf61e5606 | ||
|
|
5685e11511 | ||
|
|
0e39de56e2 | ||
|
|
677faf1811 | ||
|
|
f0fbd50261 | ||
|
|
573270c98c | ||
|
|
f61b786e90 | ||
|
|
d085197635 | ||
|
|
6c58a0f773 | ||
|
|
478b54da26 | ||
|
|
e799ac4395 | ||
|
|
c101413d32 | ||
|
|
50a09763ec | ||
|
|
811b30791b | ||
|
|
4b8c68500a | ||
|
|
e5e45f3ada | ||
|
|
f619c5e389 | ||
|
|
3c6ca3c254 | ||
|
|
12fdb5a0ca | ||
|
|
7df0be3826 | ||
|
|
80be9e63ef | ||
|
|
0444b1f5e5 | ||
|
|
91d3e1d92c | ||
|
|
fb8407dbe3 | ||
|
|
9963c9fb68 | ||
|
|
80a2f67dda | ||
|
|
7b2e7f5297 | ||
|
|
38a695d8a9 | ||
|
|
df83c6fff7 | ||
|
|
adec8c8938 | ||
|
|
2746616610 | ||
|
|
61cc8f0f54 | ||
|
|
31476bb813 | ||
|
|
d2c1abeb95 | ||
|
|
f0c19cfdf9 | ||
|
|
8ab4e90a06 | ||
|
|
7a78594594 | ||
|
|
b50548c538 | ||
|
|
84f255173c | ||
|
|
b4ba4149d4 | ||
|
|
3830fddfe0 | ||
|
|
66633443de | ||
|
|
3d7fbd9711 | ||
|
|
aa851cad76 | ||
|
|
4a2c994401 | ||
|
|
af6813480a | ||
|
|
4a83521b84 | ||
|
|
470dbea22d | ||
|
|
8e369fe819 | ||
|
|
2b4e53ed1b | ||
|
|
6d194759fa | ||
|
|
d20081157a | ||
|
|
e88487bc9f | ||
|
|
311d741f92 | ||
|
|
8e0632236b | ||
|
|
78abcac1cb | ||
|
|
385e043809 | ||
|
|
8d5a2d71b7 | ||
|
|
1880ed11ca | ||
|
|
96602842a3 | ||
|
|
ca64cba9ad | ||
|
|
4f64ff3568 | ||
|
|
a22c0c46e0 | ||
|
|
196030b4b4 | ||
|
|
75a5e74bc0 | ||
|
|
39a20f6cc9 | ||
|
|
32d56232bc | ||
|
|
b7beadfc04 | ||
|
|
e53ad9f5d1 | ||
|
|
b2cbcf6629 | ||
|
|
906e522a6a | ||
|
|
4f7928ad1b | ||
|
|
77c7053bf1 | ||
|
|
20ac4f1ac0 | ||
|
|
9931eb7f61 |
No files matched your search
@@ -26,7 +26,6 @@ gem "mongo_session_store-rails3", '3.0.6'
|
||||
gem 'nokogiri'
|
||||
|
||||
gem 'fb_graph'
|
||||
gem 'rack-gridfs'
|
||||
gem 'radius'
|
||||
gem 'rake'
|
||||
# gem 'remotipart'
|
||||
|
||||
@@ -194,10 +194,6 @@ GEM
|
||||
rack (1.4.5)
|
||||
rack-cache (1.2)
|
||||
rack (>= 0.4)
|
||||
rack-gridfs (0.4.1)
|
||||
mime-types
|
||||
mongo (~> 1.2)
|
||||
rack
|
||||
rack-oauth2 (1.0.0)
|
||||
activesupport (>= 2.3)
|
||||
attr_required (>= 0.0.5)
|
||||
@@ -377,7 +373,6 @@ DEPENDENCIES
|
||||
pry-debugger
|
||||
pry-remote
|
||||
pry-stack_explorer
|
||||
rack-gridfs
|
||||
radius
|
||||
rails (~> 3.2.9)
|
||||
rake
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
function append_id(){
|
||||
if ($("#object_id").length == 1) {
|
||||
return "&id="+$("#object_id").val();
|
||||
}
|
||||
else{
|
||||
return '';
|
||||
};
|
||||
}
|
||||
|
||||
$("#page_design").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?design_id=' + $(this).val() + append_id());
|
||||
});
|
||||
|
||||
|
||||
$("#module_app_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?module_app_id='+$(this).val() + append_id());
|
||||
});
|
||||
|
||||
$("#widget_list select,#frontend_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') +'?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() + append_id() );
|
||||
});
|
||||
|
||||
$("#tag_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + append_id() );
|
||||
});
|
||||
|
||||
$("select.widget_field_select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?widget_field_value='+ $(this).val()+'&dom_id=' + $(this).attr("id") + '&field_seri=' +$(this).attr('field_seri')+ '&module_app_id=' +$("#page_module_app_id,page_part_module_app_id").val() + append_id() );
|
||||
});
|
||||
|
||||
$('.part_kind').live('click', function() {
|
||||
$('.part_kind_partial').hide();
|
||||
$('#part_' + $(this).attr('value')).show();
|
||||
});
|
||||
@@ -2,11 +2,11 @@ function update_cates_and_tags()
|
||||
{
|
||||
$('.select_option,.select_all').removeAttr('disabled');
|
||||
$(".select_all:checked").each(function( obj ) {
|
||||
// $(this).parent().siblings('label').find('.select_option').attr('disabled',"disabled");
|
||||
$(this).parent().siblings('label').find('.select_option').attr('disabled',true);
|
||||
$(this).parent().siblings('label').find('.select_option').removeAttr('checked');
|
||||
});
|
||||
$(".select_option:checked").each(function( obj ) {
|
||||
// $(this).parent().siblings('label').find('.select_all').attr('disabled',"disabled");
|
||||
$(this).parent().siblings('label').find('.select_all').attr('disabled',true);
|
||||
$(this).parent().siblings('label').find('.select_all').removeAttr('checked');
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,3 +1,50 @@
|
||||
function get_part_id(){
|
||||
return $(".edit_page_part,.edit_page").attr("action").split('/').pop();
|
||||
}
|
||||
|
||||
$("div.editable").live("mouseenter mouseleave", function (event) {
|
||||
$(this).children('.edit_link').toggle();
|
||||
});
|
||||
|
||||
$("#page_design").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
|
||||
});
|
||||
|
||||
// $("#page_module_app_id").live('change', function() {
|
||||
// var app_id = $(this).val();
|
||||
// if(app_id!=''){
|
||||
// $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_after_module_changed',function(data, textStatus){
|
||||
// if(textStatus == 'success'){
|
||||
// $(this).after(data);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// else{
|
||||
// $("#app_page_url").children().remove();
|
||||
// }
|
||||
// });
|
||||
|
||||
$("#module_app_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?module_app_id='+$(this).val()); //?part_id=' + get_part_id());
|
||||
});
|
||||
|
||||
$("#widget_list select,#frontend_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') +'?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() );//+ '&part_id=' + get_part_id());
|
||||
});
|
||||
|
||||
$("#tag_list select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?type=' + $(this).val());
|
||||
});
|
||||
|
||||
$("select.widget_field_select").live('change', function() {
|
||||
$.getScript($(this).attr('rel') + '?widget_field_value='+ $(this).val()+'&dom_id=' + $(this).attr("id") + '&field_seri=' +$(this).attr('field_seri')+ '&module_app_id=' +$("#page_module_app_id,page_part_module_app_id").val());
|
||||
});
|
||||
|
||||
$('.part_kind').live('click', function() {
|
||||
$('.part_kind_partial').hide();
|
||||
$('#part_' + $(this).attr('value')).show();
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
bindTreeDragHandle();
|
||||
});
|
||||
@@ -21,8 +68,4 @@ var bindTreeDragHandle = function(){
|
||||
$.post("<%= Rails.application.routes.url_helpers.admin_update_position_path %>", { id: ui.item.attr('id'), parent_id: ui.item.parent().closest('li').attr('id'), position: ui.item.index() } );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("div.editable").live("mouseenter mouseleave", function (event) {
|
||||
$(this).children('.edit_link').toggle();
|
||||
});
|
||||
}
|
||||
@@ -3,10 +3,12 @@ $gray: #ddd;
|
||||
@mixin font-main($font-size) {
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-size: #{$font-size}px;
|
||||
font-weight: 300;
|
||||
}
|
||||
@mixin font-sub($font-size) {
|
||||
font-family: "Source Sans Pro", Arial, sans-serif;
|
||||
font-size: #{$font-size}px;
|
||||
font-weight: 300;
|
||||
}
|
||||
@mixin transition-type($property, $sec) {
|
||||
-webkit-transition: #{$property} #{$sec}s ease;
|
||||
|
||||
@@ -93,20 +93,9 @@
|
||||
left: 0;
|
||||
top: 60px;
|
||||
font-size: 15px;
|
||||
width: 120px;
|
||||
border: solid 2px #dddddd;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
width: 120px; }
|
||||
.sdm_o li {
|
||||
border-top: solid 1px #f7f7f7; }
|
||||
border-top: solid 1px #f2f2f2; }
|
||||
.sdm_o li:first-child {
|
||||
border: none; }
|
||||
.sdm_o a {
|
||||
@@ -162,7 +151,7 @@
|
||||
font-size: 15px; }
|
||||
.s_form label {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
font-weight: normal;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 100px;
|
||||
@@ -260,7 +249,8 @@
|
||||
display: inline-block;
|
||||
vertical-align: top; }
|
||||
.toolbar .sdm_o {
|
||||
top: 36px; }
|
||||
top: 36px;
|
||||
background-color: #f0f0f0; }
|
||||
.toolbar button {
|
||||
border: none;
|
||||
outline: none;
|
||||
|
||||
@@ -59,11 +59,9 @@
|
||||
top: 60px;
|
||||
font-size: 15px;
|
||||
width: 120px;
|
||||
border: solid 2px $gray;
|
||||
@include box-sizing;
|
||||
|
||||
li {
|
||||
border-top: solid 1px lighten( $gray, 10% );
|
||||
border-top: solid 1px #f2f2f2;
|
||||
}
|
||||
li:first-child {
|
||||
border: none;
|
||||
@@ -92,7 +90,7 @@
|
||||
line-height: 36px;
|
||||
|
||||
li {
|
||||
border-top: solid 1px $gray;
|
||||
border-top: solid 1px #ddd;
|
||||
}
|
||||
li:first-child {
|
||||
border: none;
|
||||
@@ -135,7 +133,7 @@
|
||||
// basic style
|
||||
label {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
font-weight: normal;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 100px;
|
||||
@@ -241,6 +239,7 @@
|
||||
}
|
||||
.sdm_o {
|
||||
top: 36px;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
button {
|
||||
border: none;
|
||||
|
||||
@@ -54,6 +54,7 @@ table {
|
||||
body {
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-size: 12px;
|
||||
font-weight: 300;
|
||||
background-color: #000; }
|
||||
|
||||
a, a:hover {
|
||||
@@ -73,7 +74,8 @@ a:focus {
|
||||
clear: both; }
|
||||
|
||||
.o-loading {
|
||||
font-size: 13px; }
|
||||
font-size: 13px;
|
||||
font-weight: normal; }
|
||||
.fullsize .o-loading {
|
||||
padding: 12px; }
|
||||
.o-loading i {
|
||||
@@ -295,7 +297,7 @@ a:focus {
|
||||
|
||||
.fn_des.admtxt {
|
||||
line-height: 60px;
|
||||
padding: 0 12px;
|
||||
padding: 0 6px;
|
||||
font-size: 15px;
|
||||
position: absolute;
|
||||
z-index: 9;
|
||||
@@ -334,7 +336,8 @@ a:focus {
|
||||
.section_label li {
|
||||
font-size: 15px; }
|
||||
.section_label li:first-child {
|
||||
font-size: 18px; }
|
||||
font-size: 18px;
|
||||
font-weight: normal; }
|
||||
|
||||
/* panel */
|
||||
#panel_l {
|
||||
@@ -369,7 +372,8 @@ a:focus {
|
||||
#orbitnote .note_holder .note_message {
|
||||
color: #333;
|
||||
margin: 10px 0 0 48px;
|
||||
font-size: 15px; }
|
||||
font-size: 15px;
|
||||
font-weight: normal; }
|
||||
|
||||
/* Desktop Dialogue */
|
||||
#orbitdiag {
|
||||
@@ -400,6 +404,7 @@ a:focus {
|
||||
margin: 0 6px;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
line-height: 36px; }
|
||||
#orbitdiag .diag_holder .diag_holder_inner .diag_btn:hover {
|
||||
outline: solid 2px white; }
|
||||
@@ -416,12 +421,12 @@ a:focus {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 3;
|
||||
white-space: nowrap; }
|
||||
z-index: 3; }
|
||||
[data-sizex="1"] .appname, .w1.h1 .appname {
|
||||
text-align: center; }
|
||||
[data-sizey="2"] .appname {
|
||||
font-size: 21px; }
|
||||
font-size: 21px;
|
||||
font-weight: normal; }
|
||||
.hh2 .appname {
|
||||
position: relative;
|
||||
width: auto;
|
||||
@@ -464,6 +469,8 @@ a:focus {
|
||||
margin: 0 12px 0 0;
|
||||
position: relative;
|
||||
z-index: 9; }
|
||||
.dtitle .sdm_o {
|
||||
width: auto; }
|
||||
|
||||
.tile {
|
||||
display: block;
|
||||
@@ -473,12 +480,8 @@ a:focus {
|
||||
left: 0;
|
||||
top: 0; }
|
||||
|
||||
.gridster ul {
|
||||
margin: -6px 0 0 -6px; }
|
||||
|
||||
.widget.gs_w {
|
||||
cursor: move;
|
||||
overflow: hidden; }
|
||||
cursor: move; }
|
||||
|
||||
/* header drop menu */
|
||||
.sdm_mdr .sdm_o {
|
||||
@@ -530,6 +533,7 @@ a:focus {
|
||||
|
||||
.s_title {
|
||||
font-size: 21px;
|
||||
font-weight: normal;
|
||||
line-height: 60px;
|
||||
text-align: left; }
|
||||
.s_title.size_large {
|
||||
@@ -555,6 +559,7 @@ a:focus {
|
||||
display: block;
|
||||
float: right;
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
line-height: 36px;
|
||||
text-align: center;
|
||||
border: 0; }
|
||||
@@ -610,7 +615,8 @@ a:focus {
|
||||
.list_t_title {
|
||||
margin-bottom: 6px;
|
||||
color: #333;
|
||||
font-size: 15px; }
|
||||
font-size: 15px;
|
||||
font-weight: normal; }
|
||||
|
||||
.list_t_des {
|
||||
line-height: 1.5em;
|
||||
|
||||
@@ -70,7 +70,7 @@ a:focus { outline: none; }
|
||||
}
|
||||
.o-loading {
|
||||
font-size: 13px;
|
||||
// font-weight: normal;
|
||||
font-weight: normal;
|
||||
|
||||
.fullsize & {
|
||||
padding: 12px;
|
||||
@@ -231,7 +231,7 @@ a:focus { outline: none; }
|
||||
}
|
||||
.fn_des.admtxt {
|
||||
line-height: 60px;
|
||||
padding: 0 12px;
|
||||
padding: 0 6px;
|
||||
font-size: 15px;
|
||||
position: absolute;
|
||||
z-index: 9;
|
||||
@@ -277,9 +277,10 @@ a:focus { outline: none; }
|
||||
}
|
||||
li:first-child {
|
||||
font-size: 18px;
|
||||
// font-weight: normal;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
/* panel */
|
||||
#panel_l {
|
||||
background-color: #f0f0f0;
|
||||
@@ -320,7 +321,7 @@ a:focus { outline: none; }
|
||||
color: #333;
|
||||
margin: 10px 0 0 48px;
|
||||
font-size: 15px;
|
||||
// font-weight: normal;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -360,7 +361,7 @@ a:focus { outline: none; }
|
||||
margin: 0 6px;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
// font-weight: normal;
|
||||
font-weight: normal;
|
||||
line-height: 36px;
|
||||
|
||||
&:hover {
|
||||
@@ -385,7 +386,6 @@ a:focus { outline: none; }
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 3;
|
||||
white-space: nowrap;
|
||||
|
||||
[data-sizex="1"] &,
|
||||
.w1.h1 & {
|
||||
@@ -393,7 +393,7 @@ a:focus { outline: none; }
|
||||
}
|
||||
[data-sizey="2"] & {
|
||||
font-size: 21px;
|
||||
// font-weight: normal;
|
||||
font-weight: normal;
|
||||
}
|
||||
.hh2 & {
|
||||
position: relative;
|
||||
@@ -421,6 +421,8 @@ a:focus { outline: none; }
|
||||
margin-right: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.appholder {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
@@ -444,6 +446,10 @@ a:focus { outline: none; }
|
||||
margin: 0 12px 0 0;
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
|
||||
.sdm_o {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
.tile {
|
||||
display: block;
|
||||
@@ -453,18 +459,9 @@ a:focus { outline: none; }
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.gridster ul {
|
||||
margin: -6px 0 0 -6px;
|
||||
}
|
||||
.widget.gs_w {
|
||||
cursor: move;
|
||||
overflow: hidden;
|
||||
}
|
||||
// .app.gs_w:active {
|
||||
// -webkit-transform: scale(0.9);
|
||||
// -moz-transform: scale(0.9);
|
||||
// transform: scale(0.9);
|
||||
// }
|
||||
|
||||
/* header drop menu */
|
||||
.sdm_mdr .sdm_o { top: 36px; }
|
||||
@@ -523,7 +520,7 @@ a:focus { outline: none; }
|
||||
|
||||
.s_title {
|
||||
font-size: 21px;
|
||||
// font-weight: normal;
|
||||
font-weight: normal;
|
||||
line-height: 60px;
|
||||
text-align: left;
|
||||
|
||||
@@ -552,7 +549,7 @@ a:focus { outline: none; }
|
||||
display: block;
|
||||
float: right;
|
||||
font-size: 15px;
|
||||
// font-weight: normal;
|
||||
font-weight: normal;
|
||||
line-height: 36px;
|
||||
text-align: center;
|
||||
border: 0;
|
||||
@@ -601,7 +598,7 @@ a:focus { outline: none; }
|
||||
margin-bottom: 6px;
|
||||
color: #333;
|
||||
font-size: 15px;
|
||||
// font-weight: normal;
|
||||
font-weight: normal;
|
||||
}
|
||||
.list_t_des {
|
||||
line-height: 1.5em;
|
||||
|
||||
@@ -86,12 +86,15 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
top: 100%;
|
||||
background-color: #fff;
|
||||
background-color: #dddddd;
|
||||
color: #000;
|
||||
border: 2px solid #dddddd; }
|
||||
border: 1px solid #dddddd;
|
||||
border-top: 0; }
|
||||
|
||||
.select2-drop.select2-drop-above {
|
||||
margin-top: 1px; }
|
||||
margin-top: 1px;
|
||||
border-top: 1px solid #dddddd;
|
||||
border-bottom: 0; }
|
||||
|
||||
.select2-container .select2-choice div {
|
||||
display: block;
|
||||
@@ -168,6 +171,8 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||
/* results */
|
||||
.select2-results {
|
||||
max-height: 200px;
|
||||
padding: 0 0 0 4px;
|
||||
margin: 4px 4px 4px 0;
|
||||
font-size: 13px;
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
@@ -201,16 +206,13 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||
.select2-results li {
|
||||
list-style: none;
|
||||
display: list-item;
|
||||
background-image: none;
|
||||
border-top: solid 1px #f7f7f7; }
|
||||
.select2-results li :first-child {
|
||||
border-top: 0; }
|
||||
background-image: none; }
|
||||
|
||||
.select2-results li.select2-result-with-children > .select2-result-label {
|
||||
font-weight: bold; }
|
||||
|
||||
.select2-results .select2-result-label {
|
||||
padding: 6px;
|
||||
padding: 4px 6px;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
-webkit-touch-callout: none;
|
||||
|
||||
@@ -86,16 +86,16 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
top: 100%;
|
||||
background-color: #fff;
|
||||
background-color: $gray;
|
||||
color: #000;
|
||||
border: 2px solid $gray;
|
||||
// border-top: 0;
|
||||
border: 1px solid $gray;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.select2-drop.select2-drop-above {
|
||||
margin-top: 1px;
|
||||
// border-top: 1px solid $gray;
|
||||
// border-bottom: 0;
|
||||
border-top: 1px solid $gray;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.select2-container .select2-choice div {
|
||||
@@ -180,8 +180,8 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||
/* results */
|
||||
.select2-results {
|
||||
max-height: 200px;
|
||||
// padding: 0 0 0 4px;
|
||||
// margin: 4px 4px 4px 0;
|
||||
padding: 0 0 0 4px;
|
||||
margin: 4px 4px 4px 0;
|
||||
font-size: 13px;
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
@@ -205,11 +205,6 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||
list-style: none;
|
||||
display: list-item;
|
||||
background-image: none;
|
||||
border-top: solid 1px lighten($gray, 10%);
|
||||
|
||||
:first-child {
|
||||
border-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.select2-results li.select2-result-with-children > .select2-result-label {
|
||||
@@ -217,7 +212,7 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||
}
|
||||
|
||||
.select2-results .select2-result-label {
|
||||
padding: 6px;
|
||||
padding: 4px 6px;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
|
||||
|
||||
@@ -5,9 +5,8 @@ class Admin::DashboardsController < OrbitBackendController
|
||||
# before_filter :is_admin?
|
||||
|
||||
def index
|
||||
check_backend_openness
|
||||
@module_app_contents, @module_app_contents_total = get_module_app_count('bulletin', 'page_context', 'web_link')
|
||||
@recent_updated = get_recently_updated('bulletin', 'page_context', 'web_link')
|
||||
@module_app_contents, @module_app_contents_total = get_module_app_count('bulletin', 'page_context', 'web_link')
|
||||
@recent_updated = get_recently_updated('bulletin', 'page_context', 'web_link')
|
||||
@most_visited = get_most_visited('bulletin', 'page_context')
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class Admin::PagePartsController < OrbitBackendController
|
||||
include Admin::FrontendWidgetInterface
|
||||
|
||||
layout "site_editor"
|
||||
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
before_filter :set_current_item
|
||||
@@ -17,75 +18,59 @@ class Admin::PagePartsController < OrbitBackendController
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@part = PagePart.find(params[:id])
|
||||
@module_apps = ModuleApp.where(:key.in=>OrbitApp::Module::WidgetUtility.all.keys).order_by(:title, :asc)
|
||||
@module_app = @part.module_app ? @part.module_app : nil
|
||||
@user_choose = @part.widget_path
|
||||
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
|
||||
@tag_objects = @r_tag.classify.constantize.all rescue nil
|
||||
|
||||
@module_apps = ModuleApp.for_widget_select
|
||||
@categories = nil
|
||||
@tags = nil
|
||||
@page_frontend_data_counts = nil
|
||||
# @frontend_styles = nil
|
||||
if @module_app
|
||||
@widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0]
|
||||
@widget_style = @module_app.get_widget_style[@widget_path][:style] unless @widget_path.nil? or @module_app.nil?
|
||||
end
|
||||
|
||||
|
||||
@selected={
|
||||
:module_app=> @part.module_app ? @part.module_app : nil,
|
||||
:app_frontend_url=> @part.widget_path || "default_widget", #@module_apps.first
|
||||
:category=>nil, #fetch by method: get_categories_and_tags
|
||||
:tag=>nil, #fetch by method: get_categories_and_tags
|
||||
:page_frontend_data_count=>nil,
|
||||
:frontend_style => nil,
|
||||
:widget_path=> nil
|
||||
}
|
||||
unless @module_app.nil?
|
||||
@categories = @module_app.get_categories
|
||||
@tags = @module_app.get_tags
|
||||
end
|
||||
|
||||
@widget_path = @part.widget_path ? @part.widget_path : (@module_app.widgets.keys[0] rescue nil)
|
||||
|
||||
if @module_app && @module_app.widgets.any?{|b| b.class == Array}
|
||||
@widget_style = @module_app.widgets[@widget_path] if !@widget_path.blank? && !@module_app.widgets.blank?
|
||||
end
|
||||
|
||||
@selected[:widget_path] = @part.widget_path ? @part.widget_path : (@selected[:module_app].widgets.keys[0] rescue nil)
|
||||
get_categories_and_tags
|
||||
get_frontend_data_count
|
||||
@app_frontend_urls = get_app_frontend_urls
|
||||
end
|
||||
|
||||
def reload_widgets
|
||||
@part = PagePart.find params[:id]
|
||||
@selected={
|
||||
:module_app=> ModuleApp.find(params["module_app_id"])
|
||||
}
|
||||
get_categories_and_tags
|
||||
get_frontend_data_count
|
||||
@selected[:app_frontend_url] = @selected[:module_app].has_default_widget? ? 'default_widget' : @selected[:module_app].widget_options.first.name
|
||||
end
|
||||
def create
|
||||
|
||||
|
||||
def reload_widget_styles
|
||||
@part = PagePart.find(params[:id])
|
||||
@selected={
|
||||
:module_app=> ModuleApp.find(params["module_app_id"]),
|
||||
:app_frontend_url=> params["frontend"], #@module_apps.first
|
||||
:category=>nil, #fetch by method: get_categories_and_tags
|
||||
:tag=>nil, #fetch by method: get_categories_and_tags
|
||||
:page_frontend_data_count=>nil,
|
||||
:frontend_style => nil,
|
||||
:widget_path=> nil
|
||||
}
|
||||
get_categories_and_tags
|
||||
get_frontend_data_count
|
||||
end
|
||||
|
||||
def reload_widget_field
|
||||
@index = params[:field_seri].to_i
|
||||
@part = PagePart.find(params[:id])
|
||||
@selected = {
|
||||
:module_app=> ModuleApp.find(params["module_app_id"]),
|
||||
:default_widget_field=>params[:widget_field_value]
|
||||
}
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
@part = PagePart.find(params[:id])
|
||||
|
||||
# params[:page_part][:widget_field_type] = nil
|
||||
# params[:page_part][:widget_field_is_link] = nil
|
||||
|
||||
clean_tags_and_category_params
|
||||
if params[:page_part][:module_app].blank?
|
||||
params[:page_part][:module_app] = nil
|
||||
end
|
||||
|
||||
if params[:page_part][:tag].nil? || params[:page_part][:tag].include?("nil")
|
||||
params[:page_part][:tag] = []
|
||||
end
|
||||
|
||||
if params[:page_part][:category].nil? || params[:page_part][:category].include?("nil")
|
||||
params[:page_part][:category] = []
|
||||
end
|
||||
|
||||
# params[:page_part][:widget_field].each{|t| t[2] = (t[2]=="true" ? true : false )} if !params[:page_part][:widget_field].blank?
|
||||
if @part.update_attributes(params[:page_part])
|
||||
@@ -116,6 +101,41 @@ class Admin::PagePartsController < OrbitBackendController
|
||||
redirect_to admin_items_url( :parent_id => @item.parent_id )
|
||||
end
|
||||
|
||||
def reload_widget_field
|
||||
@index = params[:field_seri].to_i
|
||||
@part = PagePart.find params[:id]
|
||||
@choosen_field = params[:widget_field_value]
|
||||
@module_app = @part.module_app
|
||||
@module_app = ModuleApp.find params[:module_app_id] if @module_app.nil?
|
||||
end
|
||||
|
||||
def reload_widgets
|
||||
@part = PagePart.find params[:id]
|
||||
@module_app = ModuleApp.find(params[:module_app_id]) rescue nil
|
||||
@categories =@module_app ? @module_app.get_categories : []
|
||||
@tags =@module_app ? @module_app.get_tags : []
|
||||
@widget_path = @module_app.widgets.keys[0] if (@module_app && @module_app.widgets[0].blank? )
|
||||
@widget_style = @module_app.widgets[@widget_path] if ( !@widget_path.blank? )
|
||||
|
||||
@part.widget_path = @module_app.widgets.first if( @module_app)
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
def reload_widget_styles
|
||||
@module_app = ModuleApp.find(params[:module_app_id])
|
||||
|
||||
@part = PagePart.find params[:id]
|
||||
@user_choose =@widget_path= params[:frontend]
|
||||
@widget_style = @module_app.widgets[@widget_path]
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
def reload_r_tag_options
|
||||
@part = PagePart.find params[:id]
|
||||
@r_tag = params[:type]
|
||||
@@ -126,11 +146,6 @@ class Admin::PagePartsController < OrbitBackendController
|
||||
end
|
||||
|
||||
protected
|
||||
def get_app_frontend_urls
|
||||
@selected[:module_app] ? @selected[:module_app].widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} : []
|
||||
# has_old_value = @selected[:module_app].app_pages[@selected[:app_frontend_url]]
|
||||
# @frontend_styles = has_old_value ? has_old_value["style"] : (@selected[:module_app].app_pages.first[1]["style"] rescue nil)
|
||||
end
|
||||
|
||||
def set_children_sub_menu(part)
|
||||
part.page.children.each do |child|
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Admin::PagesController < Admin::ItemsController
|
||||
helper Admin::PagePartsHelper
|
||||
include Admin::FrontendWidgetInterface
|
||||
def show
|
||||
@item = Page.find(params[:id])
|
||||
respond_to do |format|
|
||||
@@ -14,123 +13,40 @@ include Admin::FrontendWidgetInterface
|
||||
def new
|
||||
@item = Page.new
|
||||
@item.parent = Item.find(params[:parent_id]) rescue nil
|
||||
# @apps = ModuleApp.for_frontend_select
|
||||
|
||||
@apps = ModuleApp.where(:key.in => OrbitApp::Module::FrontendUtility.all.keys)
|
||||
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
|
||||
@designs = Design.all.entries
|
||||
@themes = Design.first.themes
|
||||
@module_apps = ModuleApp.for_frontend_select
|
||||
@app_frontend_urls = nil
|
||||
@categories = nil
|
||||
@tags = nil
|
||||
@page_frontend_data_counts = nil
|
||||
@frontend_styles = nil
|
||||
@selected={
|
||||
:design => @designs.first,
|
||||
:theme=> @themes.first,
|
||||
:module_app=>nil,#@module_apps.first
|
||||
:app_frontend_url=> nil, #@module_apps.first
|
||||
:category=>nil,
|
||||
:tag=>nil,
|
||||
:page_frontend_data_count=>nil,
|
||||
:frontend_style => nil
|
||||
}
|
||||
@design = Design.first
|
||||
end
|
||||
|
||||
def edit
|
||||
@item = Page.find(params[:id])
|
||||
|
||||
@user_choose = @item.app_frontend_url
|
||||
@apps = ModuleApp.where(:key.in => OrbitApp::Module::FrontendUtility.all.keys)
|
||||
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
|
||||
|
||||
@designs = Design.all.entries
|
||||
@themes = @item.design ? @item.design.themes : @designs.first.themes
|
||||
@module_apps = ModuleApp.for_frontend_select
|
||||
@categories = nil
|
||||
@tags = nil
|
||||
@page_frontend_data_counts = nil
|
||||
@frontend_styles = nil
|
||||
@design = @item.design ? @item.design : @designs.first
|
||||
|
||||
@selected={
|
||||
:design => @item.design || @designs.first,
|
||||
:theme=> @item.theme,
|
||||
:module_app=>@item.module_app,#@module_apps.first
|
||||
:app_frontend_url=> @item.app_frontend_url, #@module_apps.first
|
||||
:category=>nil, #fetch by method: get_categories_and_tags
|
||||
:tag=>nil, #fetch by method: get_categories_and_tags
|
||||
:page_frontend_data_count=>nil,
|
||||
:frontend_style => nil
|
||||
}
|
||||
@app_frontend_urls = @item.module_app ? select_array_for_app_frontend_urls(@item.module_app.app_pages) : nil
|
||||
get_categories_and_tags
|
||||
get_frontend_data_count
|
||||
end
|
||||
if @item.module_app
|
||||
@app_frontend_urls = []
|
||||
setup_app_frontend_and_style
|
||||
@app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if @item.module_app.has_default_widget?
|
||||
|
||||
def reload_themes
|
||||
design = Design.find(params[:design_id])
|
||||
@themes = design.themes
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
@module_app = @item.module_app
|
||||
@frontend_path = @item.app_frontend_url
|
||||
|
||||
if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array}
|
||||
@frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank?
|
||||
end
|
||||
get_categories_and_tags
|
||||
|
||||
else
|
||||
@module_app = @module_apps[0]
|
||||
end
|
||||
end
|
||||
|
||||
def reload_frontend_pages
|
||||
@item = Page.find(params[:id]) rescue Page.new
|
||||
@selected={
|
||||
:design => nil,
|
||||
:theme=> nil,
|
||||
:module_app=>(ModuleApp.find(params[:module_app_id]) rescue nil),
|
||||
:app_frontend_url=> @item.app_frontend_url || 'default_widget', #@module_apps.first
|
||||
:category=>nil, #fetch by method: get_categories_and_tags
|
||||
:tag=>nil, #fetch by method: get_categories_and_tags
|
||||
:page_frontend_data_count=>nil,
|
||||
:frontend_style => nil
|
||||
}
|
||||
@app_frontend_urls = @selected[:module_app] ? select_array_for_app_frontend_urls(@selected[:module_app].app_pages) : nil
|
||||
|
||||
get_categories_and_tags
|
||||
get_frontend_data_count
|
||||
get_frontend_styles
|
||||
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def reload_front_end_setting
|
||||
@item = Page.find(params[:id]) rescue Page.new
|
||||
|
||||
@categories = nil
|
||||
@tags = nil
|
||||
@page_frontend_data_counts = nil
|
||||
|
||||
@selected={
|
||||
# :design => @item.design || @designs.first,
|
||||
# :theme=> @item.theme,
|
||||
:module_app=>ModuleApp.find(params[:module_app_id]),
|
||||
:app_frontend_url=> params[:frontend] ,
|
||||
:category=>nil, #fetch by method: get_categories_and_tags
|
||||
:tag=>nil, #fetch by method: get_categories_and_tags
|
||||
:page_frontend_data_count=>nil,
|
||||
:frontend_style => nil
|
||||
}
|
||||
@app_frontend_urls = @selected[:module_app].nil? ? nil : @selected[:module_app].app_pages.each{|name,data| [I18n.t(data["i18n"]),name]}
|
||||
@frontend_styles = @selected[:module_app].app_pages[params["frontend"]]["style"] rescue nil
|
||||
|
||||
end
|
||||
|
||||
|
||||
def reload_widget_field
|
||||
@index = params[:field_seri].to_i
|
||||
@item = Page.find(params[:id]) rescue Page.new
|
||||
@selected = {
|
||||
:module_app=> (ModuleApp.find(params[:module_app_id]) || @item.module_app ),
|
||||
:default_widget_field=>params[:widget_field_value]
|
||||
}
|
||||
# @choosen_field = params[:widget_field_value]
|
||||
# @module_app = @item.module_app
|
||||
# @module_app = ModuleApp.find params[:module_app_id] if @module_app.nil?
|
||||
end
|
||||
|
||||
def create
|
||||
clean_tags_and_category_params
|
||||
@item = Page.new(params[:page])
|
||||
|
||||
if @item.module_app && @item.module_app.key == 'page_content'
|
||||
@@ -147,34 +63,36 @@ include Admin::FrontendWidgetInterface
|
||||
end
|
||||
else
|
||||
flash.now[:error] = t('create.error.page')
|
||||
@apps = ModuleApp.where(:key.in => OrbitApp::Module::FrontendUtility.all.keys)
|
||||
@designs = Design.all.entries
|
||||
@design = Design.find(params[:page][:design]) || Design.first
|
||||
@themes = @design.themes
|
||||
@module_apps = ModuleApp.for_frontend_select
|
||||
@selected={
|
||||
:design => params[:page][:design],
|
||||
:theme=> (Theme.find(params[:page][:theme_id]) rescue nil),
|
||||
:module_app=> (ModuleApp.find(params[:page][:module_app_id]) rescue nil) ,#@module_apps.first
|
||||
:app_frontend_url=> params[:page][:app_frontend_url], #@module_apps.first
|
||||
:category=>params[:page][:category],
|
||||
:tag=>params[:page][:tag],
|
||||
:page_frontend_data_count=>params[:page][:page_frontend_data_count],
|
||||
:frontend_style => params[:page][:frontend_style]
|
||||
}
|
||||
@app_frontend_urls = @item.module_app ? select_array_for_app_frontend_urls(@item.module_app.app_pages) : nil
|
||||
get_categories_and_tags
|
||||
get_frontend_data_count
|
||||
@design = Design.first
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
clean_tags_and_category_params
|
||||
@item = Page.find(params[:id])
|
||||
|
||||
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
|
||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||
end
|
||||
|
||||
# params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type], params[:page][:frontend_field_is_link] ) if params[:page][:frontend_field]
|
||||
|
||||
# params[:page][:frontend_field_type] = nil
|
||||
# params[:page][:frontend_field_is_link] = nil
|
||||
|
||||
if params[:page][:tag].nil? || params[:page][:tag].include?("nil")
|
||||
params[:page][:tag] = []
|
||||
end
|
||||
|
||||
if params[:page][:category].nil? || params[:page][:category].include?("nil")
|
||||
params[:page][:category] = []
|
||||
end
|
||||
|
||||
# params[:page][:frontend_field].each{|t| t[2] = (t[2]=="true" ? true : false )} if !params[:page][:frontend_field].blank?
|
||||
|
||||
|
||||
if @item.update_attributes(params[:page])
|
||||
flash[:notice] = t('update.success.page')
|
||||
respond_to do |format|
|
||||
@@ -208,10 +126,65 @@ include Admin::FrontendWidgetInterface
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
def reload_front_end_setting
|
||||
@item = Page.find params[:id] rescue nil
|
||||
@module_app = ModuleApp.find params[:module_app_id]
|
||||
@user_choose = params[:frontend] #choosen frontend
|
||||
|
||||
def get_frontend_styles
|
||||
has_old_value = @selected[:module_app].app_pages[@selected[:app_frontend_url]]
|
||||
@frontend_styles = has_old_value ? has_old_value["style"] : (@selected[:module_app].app_pages.first[1]["style"] rescue nil)
|
||||
@app_frontend_urls = @module_app.nil? ? nil : @module_app.app_pages.each{|name,data| [I18n.t(data["i18n"]),name]}
|
||||
@frontend_styles = @module_app.app_pages[params["frontend"]]["style"] rescue nil
|
||||
# =======
|
||||
# @chosen_frontend = @user_choose = params[:frontend]
|
||||
# >>>>>>> Stashed changes
|
||||
end
|
||||
|
||||
def get_categories_and_tags
|
||||
unless @module_app.nil?
|
||||
@categories = @module_app.get_categories
|
||||
@tags = @module_app.get_tags
|
||||
end
|
||||
end
|
||||
|
||||
def setup_app_frontend_and_style
|
||||
if @module_app.nil?
|
||||
@item.module_app.app_pages.each{|name,data| @app_frontend_urls << [I18n.t(data["i18n"]),name]}
|
||||
@frontend_styles = @item.module_app.app_pages[@item.frontend_style]["style"] if @frontend_styles.nil? && @item && @item.module_app.app_pages[@item.frontend_style]
|
||||
@frontend_styles = @item.module_app.app_pages.first[1]["style"] if @frontend_styles.nil? && @item
|
||||
else
|
||||
@module_app.app_pages.each{|name,data| @app_frontend_urls << [I18n.t(data["i18n"]),name]}
|
||||
@frontend_styles = @module_app.app_pages[params["frontend"]]["style"] rescue nil
|
||||
@frontend_styles = @module_app.app_pages.first[1]["style"] if @frontend_styles.nil?
|
||||
end
|
||||
end
|
||||
|
||||
def reload_frontend_pages
|
||||
@item = Page.find params[:id] rescue nil
|
||||
@module_app = ModuleApp.find(params[:module_app_id]) rescue nil
|
||||
@app_frontend_urls = []
|
||||
setup_app_frontend_and_style
|
||||
@app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if(@module_app && @module_app.has_default_widget?)
|
||||
|
||||
get_categories_and_tags
|
||||
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
def reload_themes
|
||||
@design = Design.find(params[:id])
|
||||
@themes = @design.themes
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
def reload_widget_field
|
||||
@index = params[:field_seri].to_i
|
||||
@item = params.has_key?(:id) ? Page.find(params[:id] ) : Page.new
|
||||
@choosen_field = params[:widget_field_value]
|
||||
@module_app = @page.module_app
|
||||
@module_app = ModuleApp.find params[:module_app_id] if @module_app.nil?
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,9 +0,0 @@
|
||||
class Admin::RoleCategorysController < Admin::RoleFiltersController
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_type = 'role_category'
|
||||
@app_type_name = 'category'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,144 +0,0 @@
|
||||
class Admin::RoleFiltersController < OrbitBackendController
|
||||
|
||||
include OrbitControllerLib::DivisionForDisable
|
||||
|
||||
layout "new_admin"
|
||||
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
# before_filter :set_attribute, :only => [:index, :show, :new, :edit]
|
||||
helper Admin::AttributeValuesViewHelper
|
||||
|
||||
def index
|
||||
get_types
|
||||
@role = Role.find(params[:role_id])
|
||||
@role_filters = @types.where(:role_id=>params[:role_id])
|
||||
@role_filter = @types.new(:display => 'List')
|
||||
|
||||
# @url = admin_role_filter_role_filters_path
|
||||
|
||||
if @app_type == 'role_statuses'
|
||||
@url = eval("admin_#{@app_type}_path")
|
||||
else
|
||||
@url = eval("admin_#{@app_type}s_path")
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.js
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def show
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def new
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.new(:display => 'List')
|
||||
|
||||
@verb = :post
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def edit
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.find(params[:id])
|
||||
|
||||
@url = polymorphic_path([:admin, @role_filter])
|
||||
|
||||
@verb = :put
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def create
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.new(params[:role_filter])
|
||||
|
||||
respond_to do |format|
|
||||
if @role_filter.save
|
||||
format.html { redirect_to(admin_role_filter_url(params[:role_filter][:role_id])) }
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.find(params[:id])
|
||||
# debugger
|
||||
# @url = admin_role_filter_role_filter_path(@role_filter)
|
||||
# @url = eval("admin_role_filter_#{@app_type}_path(#{@role_filter})")
|
||||
@url = polymorphic_path([:admin, @role_filter])
|
||||
|
||||
respond_to do |format|
|
||||
if @role_filter.update_attributes(params[:role_filter])
|
||||
format.html { redirect_to(admin_role_filter_role_filters_url(params[:role_id]), :notice => t('role_filter.update_role_filter_success')) }
|
||||
# format.xml { head :ok }
|
||||
format.js
|
||||
else
|
||||
format.html { render :action => "edit" }
|
||||
format.js { render :action => "edit" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.find(params[:id])
|
||||
@role_filter.disable = @role_filter.disable ? false : true
|
||||
|
||||
if @role_filter.save!
|
||||
respond_to do |format|
|
||||
format.html { redirect_to(admin_role_filter_role_filters_url) }
|
||||
# format.xml { head :ok }
|
||||
format.js
|
||||
end
|
||||
else
|
||||
flash[:error] = t("role_filter.update_failed")
|
||||
format.html { render :action => "index" }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def get_types
|
||||
@types = @app_type.classify.constantize
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,9 +0,0 @@
|
||||
class Admin::RoleStatusesController < Admin::RoleFiltersController
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_type = 'role_statuses'
|
||||
@app_type_name = 'status'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -17,34 +17,35 @@ class Admin::RolesController < OrbitBackendController
|
||||
|
||||
def role_field
|
||||
|
||||
@field_name = 'role'
|
||||
@field_name = 'role'
|
||||
|
||||
@attribute = Role.find(params[:role_id])
|
||||
@attribute = Role.find(params[:role_id])
|
||||
|
||||
end
|
||||
|
||||
def sub_role
|
||||
|
||||
@attribute = Role.find(params[:role_id])
|
||||
@attribute_fields_upper_object = @attribute.sub_roles
|
||||
@attribute = Role.find(params[:role_id])
|
||||
@attribute_fields_upper_object = @attribute.sub_roles
|
||||
|
||||
|
||||
end
|
||||
|
||||
def add_sub_role
|
||||
|
||||
@attribute = Role.find(params[:role_id])
|
||||
# @sub_attribute = Role.find(params[:role_id])
|
||||
@attribute = Role.find(params[:role_id])
|
||||
# @sub_attribute = Role.find(params[:role_id])
|
||||
|
||||
@sub_attribute = SubRole.new
|
||||
@sub_attribute = SubRole.new
|
||||
@sub_attribute.role_id = params[:role_id]
|
||||
|
||||
end
|
||||
|
||||
def edit_sub_role
|
||||
|
||||
@sub_attribute = SubRole.find(params[:role_id])
|
||||
@sub_attribute = SubRole.find(params[:role_id])
|
||||
|
||||
@attribute = Role.find(@sub_attribute.role_id)
|
||||
@attribute = Role.find(@sub_attribute.role_id)
|
||||
|
||||
@sub_attribute.role_id = @sub_attribute.role_id
|
||||
|
||||
@@ -54,52 +55,53 @@ class Admin::RolesController < OrbitBackendController
|
||||
|
||||
@field_name = 'sub_role'
|
||||
|
||||
@sub_attribute = SubRole.find(params[:role_id])
|
||||
@sub_attribute = SubRole.find(params[:role_id])
|
||||
|
||||
@attribute = Role.find(@sub_attribute.role_id)
|
||||
@attribute = Role.find(@sub_attribute.role_id)
|
||||
|
||||
end
|
||||
|
||||
def add_attribute_field
|
||||
|
||||
if params[:sub_role]
|
||||
if params[:sub_role]
|
||||
|
||||
@field_name = 'sub_role'
|
||||
@field_name = 'sub_role'
|
||||
|
||||
attribute = SubRole.find(params[:sub_role][:id]) rescue nil
|
||||
@attribute_field_counter = attribute.attribute_fields.count
|
||||
@attribute_field = attribute.attribute_fields.build
|
||||
@attribute_field.save
|
||||
attribute = SubRole.find(params[:sub_role][:id]) rescue nil
|
||||
@attribute_field_counter = attribute.attribute_fields.count
|
||||
@attribute_field = attribute.attribute_fields.build
|
||||
@attribute_field.save
|
||||
|
||||
@attribute_field[:af_count] = @attribute_field_counter
|
||||
@attribute_field[:af_count] = @attribute_field_counter
|
||||
|
||||
@attribute = SubRole.find(params[:sub_role][:id])
|
||||
@attribute = SubRole.find(params[:sub_role][:id])
|
||||
|
||||
else
|
||||
else
|
||||
|
||||
@field_name = 'role'
|
||||
@field_name = 'role'
|
||||
|
||||
attribute = Role.find(params[:role_id]) rescue nil
|
||||
@attribute_field_counter = attribute.attribute_fields.count
|
||||
@attribute_field = attribute.attribute_fields.build
|
||||
@attribute_field.save
|
||||
attribute = Role.find(params[:role_id]) rescue nil
|
||||
@attribute_field_counter = attribute.attribute_fields.count
|
||||
@attribute_field = attribute.attribute_fields.build
|
||||
@attribute_field.save
|
||||
|
||||
@attribute_field[:af_count] = @attribute_field_counter
|
||||
@attribute_field[:af_count] = @attribute_field_counter
|
||||
|
||||
@attribute = Role.find(params[:role_id])
|
||||
@attribute = Role.find(params[:role_id])
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
respond_to do |format|
|
||||
format.js { render 'add_attribute_field' }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@attribute = Role.new
|
||||
|
||||
if !params[:parent_id]
|
||||
if !params[:parent_id]
|
||||
render :template => 'admin/attributes/new'
|
||||
end
|
||||
|
||||
@@ -163,17 +165,17 @@ class Admin::RolesController < OrbitBackendController
|
||||
|
||||
def destroy
|
||||
|
||||
if params[:sub_role]
|
||||
if params[:sub_role]
|
||||
|
||||
@sub_role = SubRole.find(params[:sub_role][:id])
|
||||
@sub_role = SubRole.find(params[:sub_role][:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @sub_role.destroy
|
||||
format.html { redirect_to(admin_role_sub_role_url(@sub_role.role_id)) }
|
||||
format.html { redirect_to(admin_role_sub_role_url(@sub_role.role_id)) }
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
else
|
||||
|
||||
@attribute = Role.find(params[:id])
|
||||
@attribute.destroy
|
||||
|
||||
@@ -14,16 +14,8 @@ class Admin::SitesController < OrbitBackendController
|
||||
# @site = Site.new
|
||||
# end
|
||||
|
||||
def show_system_preference
|
||||
@git_commit_list_file = File.new(OrbitSystemPreference::GitCommitListPath, "r") rescue nil
|
||||
@db_backup_list_file = File.new(OrbitSystemPreference::ArchiveDbListPath, "r") rescue nil
|
||||
@resque_logs_file = File.new(OrbitSystemPreference::ResqueLogFile, "r") rescue nil
|
||||
@site = Site.first
|
||||
end
|
||||
|
||||
def update
|
||||
@site.update_attributes(params[:site])
|
||||
site_restart
|
||||
redirect_to :back
|
||||
end
|
||||
|
||||
|
||||
@@ -2,10 +2,16 @@ class Admin::TagsController < OrbitBackendController
|
||||
before_filter :force_order_for_visitor,:only=>[:index]
|
||||
before_filter :force_order_for_user,:except => [:index]
|
||||
before_filter :for_app_sub_manager,:except => [:index]
|
||||
|
||||
|
||||
# layout 'new_admin'
|
||||
# before_filter :authenticate_user!
|
||||
# before_filter :is_admin?
|
||||
# before_filter :set_module_app
|
||||
|
||||
def index
|
||||
@tags = get_tags
|
||||
get_tags
|
||||
@module_app_id = @module_app.id rescue nil
|
||||
end
|
||||
|
||||
def new
|
||||
@@ -17,7 +23,12 @@ class Admin::TagsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def create
|
||||
@tag = @module_app ? @module_app.tags.create(params[:tag]) : Tag.create(params[:tag])
|
||||
if params[:tag][:module_app_id].blank?
|
||||
@tag = Tag.create(params[:tag])
|
||||
else
|
||||
module_app = ModuleApp.find(params[:tag][:module_app_id])
|
||||
@tag = eval("#{module_app.key.camelize}Tag").create(params[:tag])
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -36,12 +47,15 @@ class Admin::TagsController < OrbitBackendController
|
||||
protected
|
||||
|
||||
def get_tags
|
||||
@tags = @module_app.blank? ? Tag.all : @module_app.tags
|
||||
@tags = (@module_app ? @module_app.tags : Tag.all)
|
||||
end
|
||||
|
||||
def setup_vars
|
||||
@module_app = ModuleApp.find(params[:module_app_id]) if params[:module_app_id]
|
||||
@module_app_id = @module_app.id rescue nil
|
||||
@app_key = request.env['HTTP_REFERER'].split('/')[4]
|
||||
if @app_key
|
||||
@app_key.gsub!(/[?].*/, '')
|
||||
@module_app = ModuleApp.first(conditions: {:key => @app_key})
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,6 +1,4 @@
|
||||
class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
|
||||
helper MemberHelper
|
||||
|
||||
layout "new_admin"
|
||||
# before_filter :authenticate_user!
|
||||
@@ -25,13 +23,13 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
|
||||
render case params[:at]
|
||||
when 'summary'
|
||||
@users=User.not_guest_user.page(page_num).per(12).asc("_id").includes('avatar')
|
||||
@users=User.not_guest_user.page(page_num).per(12).includes('avatar')
|
||||
"index_summary"
|
||||
when 'thumbnail'
|
||||
@users=User.not_guest_user.page(page_num).per(36).asc("_id").includes('avatar')
|
||||
@users=User.not_guest_user.page(page_num).per(36).includes('avatar')
|
||||
"index_thumbnail"
|
||||
else
|
||||
@users=User.not_guest_user.page(page_num).per(10).asc("_id").includes('avatar')
|
||||
@users=User.not_guest_user.page(page_num).per(10).includes('avatar')
|
||||
"index"
|
||||
end
|
||||
end
|
||||
@@ -45,7 +43,7 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
@student_data = []
|
||||
@staff_data = []
|
||||
|
||||
attribute_values = @user.attribute_values.asc("_id")
|
||||
attribute_values = @user.attribute_values
|
||||
attribute_values.each{|att_val|
|
||||
@profile_data.push({:name => att_val.attribute_field.title,:value =>att_val.get_value_by_locale(I18n.locale.to_s)}) if att_val.attribute_field.attribute.key=="profile" rescue false
|
||||
}
|
||||
@@ -82,29 +80,21 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
end
|
||||
|
||||
def create
|
||||
# puts params.to_yaml
|
||||
puts params.to_yaml
|
||||
# attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
|
||||
# attribute_values = params[:user].delete(attribute_values_key)
|
||||
@user = User.new(params["user"])
|
||||
|
||||
@checkuser = User.where(:user_id => params[:user][:user_id]).first
|
||||
|
||||
if !@checkuser.blank?
|
||||
flash.now[:error] = t("users.user_id_error")
|
||||
end
|
||||
|
||||
# attribute_values.to_hash.each{|key,value|
|
||||
# @user.attribute_values.build(value)
|
||||
# }
|
||||
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
||||
# binding.pry
|
||||
if !flash.now[:error] && @user.save
|
||||
if @user.save
|
||||
flash[:notice] = t('create.success.user')
|
||||
redirect_to :action => :index
|
||||
else
|
||||
@user.attribute_values = nil
|
||||
@form_index = 0
|
||||
render :action => :new , :notice => flash.now[:error]
|
||||
render :action => :new
|
||||
end
|
||||
end
|
||||
|
||||
@@ -120,46 +110,16 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
@form_index = 0
|
||||
get_info_and_roles
|
||||
end
|
||||
|
||||
def edit_passwd
|
||||
# @disable_all_field = false
|
||||
@user = User.find(params[:users_new_interface_id])
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
@user = User.find(params[:id])
|
||||
|
||||
if params[:edit_type] == 'edit_passwd'
|
||||
|
||||
@checkuser = User.where(:user_id => params[:user][:user_id]).first
|
||||
|
||||
if !@checkuser.blank? && @checkuser.id != @user.id
|
||||
flash.now[:error] = t("users.user_id_error")
|
||||
elsif @user.admin && current_user.id == @user.id
|
||||
flash.now[:error] = t("users.admin_change_password")
|
||||
end
|
||||
|
||||
if !flash.now[:error] && @user.update_attributes(params[:user])
|
||||
redirect_to :action => :show
|
||||
else
|
||||
render :action => :edit_passwd, :notice => flash.now[:error]
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
@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.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
||||
@user.save
|
||||
|
||||
redirect_to :action => :show
|
||||
|
||||
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.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
||||
@user.save
|
||||
redirect_to :action => :show
|
||||
# # Update changes to the avatar
|
||||
# @user.remove_avatar! if params[:file]
|
||||
# @user.avatar = params[:file] if params[:file]
|
||||
|
||||
@@ -17,15 +17,7 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
helper_attr :site_valid_locales
|
||||
|
||||
def check_backend_openness
|
||||
if !Me.backend_openness_on
|
||||
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
|
||||
end
|
||||
end
|
||||
|
||||
def site_restart
|
||||
Resque.enqueue(RestartServer)
|
||||
end
|
||||
|
||||
def set_current_user
|
||||
User.current = current_or_guest_user
|
||||
@@ -109,10 +101,10 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
# Render the page
|
||||
def render_page(args=nil)
|
||||
def render_page
|
||||
if @item
|
||||
respond_to do |format|
|
||||
format.html { render :text => parse_page_content(@item,args), :layout => 'page_layout' }
|
||||
format.html { render :text => parse_page_content(@item), :layout => 'page_layout' }
|
||||
format.rss { render_main_rss }
|
||||
format.mobile { redirect_to mobile_path(:app => params[:app]) }
|
||||
end
|
||||
|
||||
@@ -36,31 +36,23 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
result = eval("#{ori_class_name}.where(:#{get_category_field_name(ori_class_name)}.in=>params['category_id'])")
|
||||
end
|
||||
date_now = Time.now
|
||||
result.available_for_lang(I18n.locale).can_display.desc(:is_top, :postdate)
|
||||
result.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:is_top, :postdate)
|
||||
end
|
||||
|
||||
def default_widget
|
||||
if !params[:id].blank?
|
||||
clicked_field_name = params["clicked_field_name"].to_sym
|
||||
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
||||
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[:title][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
||||
else
|
||||
@tag_class = nil
|
||||
@default_widget = @page_part.module_app.get_default_widget
|
||||
@widget_image_field = @default_widget["image"] || @default_widget[:image]
|
||||
case @page_part
|
||||
when Page
|
||||
@frontend_field_names = @page_part.frontend_field_name
|
||||
@frontend_classes = @page_part.frontend_class
|
||||
@frontend_sat_to_links = @page_part.frontend_sat_to_link
|
||||
|
||||
@fields = @page_part.frontend_field
|
||||
@data_limit = @page_part.frontend_data_count.is_a?(Fixnum) ? @page_part.frontend_data_count : (@page_part.frontend_data_count.to_i rescue 3)
|
||||
@paginate = true
|
||||
@page_id = @page_part.id
|
||||
when PagePart
|
||||
@frontend_field_names = @page_part.widget_field_name
|
||||
@frontend_classes = @page_part.widget_class
|
||||
@frontend_sat_to_links = @page_part.widget_sat_to_link
|
||||
|
||||
@fields = @page_part.widget_field
|
||||
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class OrbitBackendController < ApplicationController
|
||||
include OrbitCoreLib::AppBackendUtility
|
||||
include OrbitCoreLib::PermissionUtility
|
||||
include OrbitTag::Tagging
|
||||
include AdminHelper
|
||||
include ApplicationHelper
|
||||
|
||||
@@ -16,7 +15,6 @@ class OrbitBackendController < ApplicationController
|
||||
private
|
||||
|
||||
def force_order_for_visitor
|
||||
check_backend_openness
|
||||
setup_vars
|
||||
set_current_user
|
||||
end
|
||||
@@ -61,20 +59,6 @@ class OrbitBackendController < ApplicationController
|
||||
when :referenced_in
|
||||
objects = get_objects_from_referenced_objects(object_class.relations[option].class_name.constantize, objects, "#{option}_id")
|
||||
end
|
||||
elsif option.eql?('tags')
|
||||
tag_array = @module_app.tags.inject([]){ |result, value|
|
||||
result << [value.name, value]
|
||||
}
|
||||
params[:direction].eql?('asc') ? tag_array.sort : tag_array.sort.reverse!
|
||||
sorted_objects = Array.new
|
||||
tag_array.each do |x|
|
||||
taggings = x[1].taggings
|
||||
taggings.each {|tagging| sorted_objects << tagging.taggable }
|
||||
end
|
||||
# debugger
|
||||
sorted_objects.flatten!
|
||||
sorted_objects.uniq!
|
||||
objects = get_with_nil(objects, option, sorted_objects)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
class PagesController < ApplicationController
|
||||
include ApplicationHelper
|
||||
before_filter :get_item, :only => [:index_from_link, :show_from_link]
|
||||
before_filter :check_frontend_open, :only => [:index,:show]
|
||||
# caches_page :index
|
||||
|
||||
def check_frontend_open
|
||||
if Me.frontend_closed
|
||||
redirect_to '/admin/dashboards'
|
||||
end
|
||||
end
|
||||
|
||||
def index
|
||||
@item = Page.find_by_name('home')
|
||||
|
||||
@@ -21,18 +14,14 @@ class PagesController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
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))
|
||||
impressionist(@item)
|
||||
case @item.class.to_s
|
||||
when 'Page'
|
||||
if params[:clicked_field_name]
|
||||
render_page({"clicked_field_name"=>params["clicked_field_name"]}) unless save_from_no_lang_for_page
|
||||
else
|
||||
render_page unless save_from_no_lang_for_page
|
||||
end
|
||||
render_page unless save_from_no_lang_for_page
|
||||
when 'Link'
|
||||
redirect_to(@item[:url]) unless save_from_no_lang_for_page
|
||||
end
|
||||
@@ -65,7 +54,6 @@ class PagesController < ApplicationController
|
||||
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}clicked_field_name=#{params[:clicked_field_name]}" unless params[:clicked_field_name].blank?
|
||||
redirect_to(url + options) unless save_from_no_lang_for_page
|
||||
end
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
module Admin::FrontendWidgetInterface
|
||||
|
||||
protected
|
||||
def get_categories_and_tags
|
||||
unless @selected[:module_app].nil?
|
||||
@categories = @selected[:module_app].get_categories
|
||||
@tags = @selected[:module_app].tags
|
||||
end
|
||||
end
|
||||
|
||||
def get_frontend_data_count
|
||||
local_item = set_local_item
|
||||
@page_frontend_data_counts = @selected[:module_app].get_registration.get_data_count rescue []
|
||||
@selected[:page_frontend_data_count] = case local_item
|
||||
when PagePart
|
||||
local_item.widget_data_count
|
||||
when Page
|
||||
local_item.frontend_data_count
|
||||
end
|
||||
end
|
||||
|
||||
def clean_tags_and_category_params
|
||||
field_name = set_field_name
|
||||
if self.class==Admin::PagePartsController and params[field_name][:module_app].blank?
|
||||
params[field_name][:module_app] = nil
|
||||
end
|
||||
if params[field_name][:tag].nil? || params[field_name][:tag].include?("nil")
|
||||
params[field_name][:tag] = []
|
||||
end
|
||||
|
||||
if params[field_name][:category].nil? || params[field_name][:category].include?("nil")
|
||||
params[field_name][:category] = []
|
||||
end
|
||||
end #of clean_tags_and_category_params
|
||||
|
||||
def set_local_item
|
||||
local_item = @part
|
||||
local_item = @item if local_item.nil? && @item
|
||||
local_item
|
||||
end
|
||||
|
||||
def set_field_name
|
||||
case self.class.to_s
|
||||
when "Admin::PagesController"
|
||||
return "page"
|
||||
when "Admin::PagePartsController"
|
||||
return "page_part"
|
||||
end # of case
|
||||
end
|
||||
|
||||
def select_array_for_app_frontend_urls(hash)
|
||||
ary = hash.collect{|name,data| [I18n.t(data["i18n"]),name]}
|
||||
ary << [I18n.t('default_widget.name'),'default_widget'] if @selected[:module_app] and @selected[:module_app].has_default_widget?
|
||||
ary
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -1,8 +1,7 @@
|
||||
module Admin::PagePartsHelper
|
||||
include Admin::FrontendWidgetInterface
|
||||
|
||||
def support_link
|
||||
url_method = @selected[:module_app].get_default_widget[:url_method]
|
||||
url_method = @module_app.get_default_widget[:url_method]
|
||||
unless url_method.nil?
|
||||
res = "Link:"
|
||||
res << select_tag( "page_part[widget_field_is_link][]", options_for_select([["NotLink",false],["Link1",url_method]]))
|
||||
@@ -10,8 +9,10 @@ module Admin::PagePartsHelper
|
||||
end
|
||||
end
|
||||
|
||||
def get_widget_field_rel
|
||||
case set_local_item
|
||||
def get_widget_field_rel(local_item=nil)
|
||||
local_item = @part if local_item.nil? && @part
|
||||
local_item = @item if local_item.nil? && @item
|
||||
case local_item
|
||||
when Page
|
||||
reload_after_list_changed_admin_pages_path
|
||||
when PagePart
|
||||
@@ -33,7 +34,8 @@ module Admin::PagePartsHelper
|
||||
|
||||
unless field_is_checked.nil? and assign_field_name_value.nil?
|
||||
origin_field = nil
|
||||
origin_field = @selected[:module_app].widget_fields.select{|t| t.first.to_s==(assign_field_name_value || local_item.default_widget_field_name[i])}.first
|
||||
|
||||
origin_field = @module_app.widget_fields.select{|t| t.first.to_s==(assign_field_name_value || local_item.default_widget_field_name[i])}.first
|
||||
|
||||
if origin_field and origin_field[2]==:link #choosen_field_is_link
|
||||
|
||||
@@ -49,10 +51,11 @@ module Admin::PagePartsHelper
|
||||
end
|
||||
|
||||
def widget_field_options(i,local_item=nil)
|
||||
local_item = set_local_item
|
||||
local_item = @part if local_item.nil? && @part
|
||||
local_item = @item if local_item.nil? && @item
|
||||
|
||||
options = @selected[:module_app].widget_fields.collect do |widget_field|
|
||||
label = I18n.t("#{@selected[:module_app].key}.default_widget.#{widget_field[0]}")
|
||||
options = @module_app.widget_fields.collect do |widget_field|
|
||||
label = I18n.t("#{@module_app.key}.default_widget.#{widget_field[0]}")
|
||||
[label, widget_field[0]]
|
||||
end
|
||||
case local_item
|
||||
@@ -63,9 +66,11 @@ module Admin::PagePartsHelper
|
||||
end
|
||||
end
|
||||
|
||||
def widget_field_class_options(i,local_item=nil)
|
||||
def widget_fiield_class_options(i,local_item=nil)
|
||||
options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
|
||||
local_item = set_local_item
|
||||
local_item = @part if local_item.nil? && @part
|
||||
local_item = @item if local_item.nil? && @item
|
||||
|
||||
case local_item
|
||||
when Page
|
||||
options_for_select(options, (local_item.frontend_class[i] if (local_item) ))
|
||||
@@ -110,8 +115,12 @@ module Admin::PagePartsHelper
|
||||
end
|
||||
|
||||
def nil_checkbox_button(part,tag_or_cate)
|
||||
field_name = set_field_name
|
||||
|
||||
field_name = case part
|
||||
when PagePart
|
||||
'page_part'
|
||||
when Page
|
||||
'page'
|
||||
end
|
||||
content_tag :label,:class=>"radio inline" do
|
||||
op = check_box_tag("#{field_name}[#{tag_or_cate}][]", 'nil' , eval("#{tag_or_cate}_checked_value(part,'')"),:class=>'select_all')
|
||||
op << I18n.t("default_widget.no_value")
|
||||
@@ -119,8 +128,12 @@ module Admin::PagePartsHelper
|
||||
end
|
||||
|
||||
def nil_radio_button(part,tag_or_cate)
|
||||
field_name = set_field_name
|
||||
|
||||
field_name = case part
|
||||
when PagePart
|
||||
'page_part'
|
||||
when Page
|
||||
'page'
|
||||
end
|
||||
content_tag :label,:class=>"radio inline" do
|
||||
op = radio_button(field_name, tag_or_cate, '' , :checked => eval("#{tag_or_cate}_checked_value(part,'')"))
|
||||
op << I18n.t("default_widget.no_value")
|
||||
@@ -128,7 +141,7 @@ module Admin::PagePartsHelper
|
||||
end
|
||||
|
||||
def show_default_widget_setting_panel
|
||||
@selected[:module_app] && @selected[:module_app].has_default_widget? && (@selected[:app_frontend_url]== 'default_widget')
|
||||
@module_app && @module_app.has_default_widget? && (!@user_choose.nil? && @user_choose== 'default_widget') #&& @part.widget_path == 'default_widget'
|
||||
end
|
||||
|
||||
def show_custom_widget_setting_panel
|
||||
|
||||
@@ -6,9 +6,7 @@ module DefaultWidgetHelper
|
||||
def link_to_field(row_data,field, switch, options=nil)
|
||||
method_ary = @page_part.module_app.widget_fields_link_method
|
||||
field = field.to_sym
|
||||
options = options || {}
|
||||
options[:clicked_field_name] = field
|
||||
if(method_ary.has_key?(field) and (switch.to_s == "true"))
|
||||
if(method_ary.has_key?(field) and (switch == true))
|
||||
url = case method_ary[field][:args]
|
||||
when nil # no args
|
||||
get_data_link(method_ary[field][:method], options)
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
module MemberHelper
|
||||
def nl2br(val)
|
||||
val.gsub(/\r\n/, '<br />').html_safe
|
||||
end
|
||||
end
|
||||
@@ -5,13 +5,9 @@ class BackupServer
|
||||
#CronMail.time_check("Going to backup Orbit").deliver
|
||||
dbhost = Mongoid.config.database.connection.primary.join ':'
|
||||
dbname = Mongoid.config.database.name
|
||||
archive_db_list_path = OrbitSystemPreference::ArchiveDbListPath
|
||||
dbdirectory = "#{Rails.root}/tmp/#{dbname}-"+Time.now.strftime("%Y-%m-%d-%H-%M")
|
||||
%x[mongodump -h #{dbhost} -d #{dbname} -o #{dbdirectory} ]
|
||||
|
||||
%x[rm #{archive_db_list_path}]
|
||||
%x[ls #{Rails.root}/tmp/#{dbname}* | du -h --max-depth=1 --block-size=1M |sort -h >> #{archive_db_list_path}]
|
||||
OrbitJobLogger.info "DB backup done Path:#{dbdirectory}"
|
||||
|
||||
# %x[touch #{Rails.root}/tmp/restart]
|
||||
end
|
||||
end
|
||||
@@ -1,36 +0,0 @@
|
||||
class DashboardCounter < Resque::Plugins::RestrictionJob
|
||||
@queue = :high
|
||||
|
||||
def self.perform(*args)
|
||||
site = Site.first
|
||||
obj = new(*args)
|
||||
site.dashboard_counter[:visitors_this_week] = obj.display_visitors_this_week
|
||||
site.dashboard_counter[:visitors_this_month] = obj.display_visitors_this_month
|
||||
site.dashboard_counter[:visitors_this_year] = obj.display_visitors_this_year
|
||||
site.save
|
||||
OrbitJobLogger.info "DashboardCounter done #{site.dashboard_counter.to_s}"
|
||||
end
|
||||
|
||||
|
||||
def display_visitors(options={})
|
||||
impressions = Impression.where(options).and(:referrer.ne => nil)
|
||||
impressions.map{|i| i[:session_hash]}.uniq.count
|
||||
end
|
||||
|
||||
def display_visitors_today
|
||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_day, '$lte' => Date.today.end_of_day})
|
||||
end
|
||||
|
||||
def display_visitors_this_week
|
||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_week, '$lte' => Date.today.end_of_week})
|
||||
end
|
||||
|
||||
def display_visitors_this_month
|
||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_month, '$lte' => Date.today.end_of_month})
|
||||
end
|
||||
|
||||
def display_visitors_this_year
|
||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,46 +0,0 @@
|
||||
class GenerateSystemSummary
|
||||
@queue = :high
|
||||
|
||||
def self.perform()
|
||||
@site = Site.first
|
||||
get_disk_free
|
||||
get_git_log_list
|
||||
get_package_info
|
||||
@site.save
|
||||
end
|
||||
|
||||
def self.get_package_info
|
||||
@info = {}
|
||||
get_nginx_version
|
||||
get_MongoDB_version
|
||||
get_Linux_version
|
||||
@site.system_package_info = @info
|
||||
end
|
||||
|
||||
def self.get_git_log_list
|
||||
git_commit_list_path = OrbitSystemPreference::GitCommitListPath
|
||||
%x[rm #{git_commit_list_path}]
|
||||
%x[cd #{Rails.root};#{OrbitSystemPreference::GitLogCommend} >>#{git_commit_list_path} ]
|
||||
end
|
||||
|
||||
def self.get_disk_free
|
||||
@site.disk_space= %x[#{OrbitSystemPreference::DiskFree}]
|
||||
end
|
||||
|
||||
def self.get_nginx_version
|
||||
@info[:nginx] = %x[#{OrbitSystemPreference::SystemPackage::NginxVersion} ]
|
||||
end
|
||||
|
||||
def self.get_MongoDB_version
|
||||
@info[:mongodb] = %x[#{OrbitSystemPreference::SystemPackage::MongodbVersion} ]
|
||||
end
|
||||
|
||||
def self.get_Linux_version
|
||||
@info[:linux] = %x[#{OrbitSystemPreference::SystemPackage::SystemVersion} ]
|
||||
end
|
||||
|
||||
def self.check_system_has_enough_space( limit =OrbitSystemPreference::DefaultDiskSpaceLimit )
|
||||
binding.pry
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,21 @@
|
||||
class NccuCalendar
|
||||
require 'open-uri'
|
||||
require 'tempfile'
|
||||
|
||||
@queue = :high
|
||||
|
||||
def self.perform()
|
||||
# temp_file = Tempfile.new('new_cal')
|
||||
# open('http://events.nccu.edu.tw/Month').read{|data|
|
||||
# temp_file << data
|
||||
# }
|
||||
|
||||
open(File.join(Rails.root, 'public/static', 'nccu_calendar.xml'), 'wb') do |fo|
|
||||
fo.print open('http://events.nccu.edu.tw/Month').read
|
||||
end
|
||||
|
||||
# FileUtils.mv(temp_file, File.join(Rails.root, 'public/static', 'nccu_calendar.xml'))
|
||||
|
||||
puts "[#{ DateTime.now.strftime("%Y %D %H:%M")}]NccuCalendar Synced #{File.join(Rails.root, 'public/static', 'nccu_calendar.xml')}"
|
||||
end
|
||||
end
|
||||
@@ -1,8 +0,0 @@
|
||||
class RestartServer
|
||||
@queue = :high
|
||||
|
||||
def self.perform()
|
||||
temp_directory = "#{Rails.root}/tmp/"
|
||||
%x[touch #{temp_directory}restart.txt ]
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,25 @@
|
||||
class SyncDb
|
||||
|
||||
@queue = :high
|
||||
|
||||
def self.perform()
|
||||
puts "[ #{DateTime.now.strftime("%Y %D %H:%M") }]\t SyncDb Starting"
|
||||
self.start_sync
|
||||
self.set_admin
|
||||
end
|
||||
|
||||
def self.start_sync
|
||||
task = 'mid_site:sync'
|
||||
args = []
|
||||
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
|
||||
User.all.each{|ur| ur.create_dept_cache}
|
||||
puts "[#{ DateTime.now.strftime("%Y %D %H:%M")}]\tSyncDb Synced"
|
||||
end
|
||||
|
||||
def self.set_admin
|
||||
task = 'mid_site:install_admin'
|
||||
args = []
|
||||
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
|
||||
puts "[#{ DateTime.now.strftime("%Y %D %H:%M")}]\tAdmin done"
|
||||
end
|
||||
end
|
||||
@@ -5,6 +5,5 @@ class UpdateTagCloud
|
||||
Tag.all.each do |tag|
|
||||
tag.update_attribute(:cloud_view_count, tag.impressionist_count(:created_at.gte => 14.days.ago, :created_at.lte => Time.now))
|
||||
end
|
||||
OrbitJobLogger.info "UpdateTagCloud Done"
|
||||
end
|
||||
end
|
||||
+1
-2
@@ -21,8 +21,7 @@ class Asset
|
||||
before_save :clean_tags
|
||||
|
||||
def sorted_tags
|
||||
#tags.order_by(I18n.locale, :asc)
|
||||
tags
|
||||
tags.order_by(I18n.locale, :asc)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ class Item
|
||||
|
||||
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
|
||||
# validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
|
||||
validates_uniqueness_of :name #, :scope => :parent_id
|
||||
validates_uniqueness_of :name, :scope => :parent_id
|
||||
validates_presence_of :name
|
||||
validates_associated :parent, :children
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ class ModuleApp
|
||||
field :title
|
||||
field :sidebar_order,type: Integer,default: 0
|
||||
|
||||
has_many :tags, as: :module_tag, dependent: :destroy
|
||||
|
||||
def refetch_setting!(reg)
|
||||
# %w{module_label category base_url version organization author intro update_info create_date}.each do |field|
|
||||
# self[field.to_sym] = reg.send field
|
||||
@@ -21,17 +19,11 @@ class ModuleApp
|
||||
self[:widgets] = reg.get_widgets
|
||||
end
|
||||
|
||||
|
||||
# def app_pages
|
||||
# get_registration.get_app_pages
|
||||
# end
|
||||
|
||||
# scope :for_frontend_select,
|
||||
scope :standard_sorting ,order_by(:title, :asc)
|
||||
|
||||
def self.for_widget_select
|
||||
where(:key.in=>OrbitApp::Module::WidgetUtility.all.keys).order_by(:title, :asc)
|
||||
end
|
||||
|
||||
def self.for_frontend_select
|
||||
where(:key.in => OrbitApp::Module::FrontendUtility.all.keys).excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
|
||||
end
|
||||
|
||||
def enable_frontend?
|
||||
self[:enable_frontend]
|
||||
@@ -120,6 +112,10 @@ class ModuleApp
|
||||
|
||||
has_one :app_auth,dependent: :delete
|
||||
|
||||
def get_tags
|
||||
get_registration.get_tags
|
||||
end
|
||||
|
||||
def get_categories
|
||||
get_registration.get_categories
|
||||
end
|
||||
@@ -131,9 +127,5 @@ class ModuleApp
|
||||
def get_registration
|
||||
OrbitApp::Module::Registration.find_by_key(key)
|
||||
end
|
||||
|
||||
def self.find_by_key(key)
|
||||
self.where(key: key)[0] rescue nil
|
||||
end
|
||||
|
||||
end
|
||||
+2
-3
@@ -7,7 +7,7 @@ class Page < Item
|
||||
|
||||
field :content, localize: true
|
||||
field :app_frontend_url
|
||||
# field :theme_id, :type => BSON::ObjectId, :default => nil
|
||||
field :theme_id, :type => BSON::ObjectId, :default => nil
|
||||
field :category,type: Array, :default => []
|
||||
field :tag, type: Array,:default => []
|
||||
field :view_count, :type => Integer, :default => 0
|
||||
@@ -21,8 +21,7 @@ class Page < Item
|
||||
field :frontend_sat_to_link , :type => Array,:default => []
|
||||
|
||||
field :frontend_data_count
|
||||
|
||||
belongs_to :theme
|
||||
|
||||
belongs_to :design
|
||||
belongs_to :module_app
|
||||
has_many :page_parts, :dependent => :destroy
|
||||
|
||||
+1
-8
@@ -11,17 +11,10 @@ class Site
|
||||
field :roaming_id
|
||||
field :private_key, :type => Binary
|
||||
field :public_key, :type => Binary
|
||||
|
||||
field :frontend_closed, :type => Boolean, :default => false
|
||||
field :backend_openness_on, :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 :disk_space, :type => String
|
||||
field :system_package_info, :type => Hash,:default=>{}
|
||||
|
||||
|
||||
field :school
|
||||
field :department
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
class SubRoleTag < ProtoTag
|
||||
has_and_belongs_to_many :sub_roles
|
||||
|
||||
end
|
||||
+1
-4
@@ -10,13 +10,10 @@ class Tag
|
||||
|
||||
is_impressionable :counter_cache => { :column_name => :view_count }
|
||||
|
||||
field :name, localize: true
|
||||
field :key
|
||||
field :view_count, :type => Integer, :default => 0
|
||||
field :cloud_view_count, :type => Integer, :default => 0
|
||||
|
||||
belongs_to :module_tag, polymorphic: true
|
||||
has_many :taggings, dependent: :destroy
|
||||
|
||||
#field :cloud_amper,:type: Integer,:default=> 0
|
||||
|
||||
def self.sorted_for_cloud
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
class Tagging
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :to_destroy, default: false
|
||||
|
||||
belongs_to :tag
|
||||
belongs_to :taggable, polymorphic: true
|
||||
end
|
||||
@@ -11,14 +11,9 @@ class Role < Attribute
|
||||
|
||||
has_many :sub_roles, :autosave => true, :dependent => :destroy
|
||||
has_many :users
|
||||
# has_many :statuses, :autosave => true, :dependent => :destroy
|
||||
has_many :statuses, :autosave => true, :dependent => :destroy
|
||||
# has_many :attribute_fields, :autosave => true, :dependent => :destroy
|
||||
has_many :role_statuses, :autosave => true, :dependent => :destroy
|
||||
has_many :role_categorys, :autosave => true, :dependent => :destroy
|
||||
|
||||
accepts_nested_attributes_for :sub_roles, :allow_destroy => true
|
||||
accepts_nested_attributes_for :role_statuses, :allow_destroy => true
|
||||
accepts_nested_attributes_for :role_categorys, :allow_destroy => true
|
||||
|
||||
def is_built_in?
|
||||
self.built_in
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
class RoleCategory < RoleFilter
|
||||
|
||||
has_and_belongs_to_many :users
|
||||
belongs_to :role
|
||||
|
||||
def self.get_role_data(role_key)
|
||||
|
||||
@role = Role.where(:key =>role_key).first
|
||||
|
||||
return @role.id
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,26 +0,0 @@
|
||||
class RoleFilter
|
||||
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
# include OrbitCoreLib::ObjectAuthable
|
||||
include OrbitCoreLib::ObjectDisable
|
||||
|
||||
|
||||
field :key
|
||||
field :title, localize: true
|
||||
|
||||
# belongs_to :role
|
||||
|
||||
def pp_object
|
||||
title
|
||||
end
|
||||
|
||||
def self.from_id(id)
|
||||
RoleFilter.find(id) rescue nil
|
||||
end
|
||||
|
||||
def self.is_localized?(field_name)
|
||||
self.fields[field_name.to_s].localized?
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,16 +0,0 @@
|
||||
class RoleStatus < RoleFilter
|
||||
|
||||
has_and_belongs_to_many :users
|
||||
belongs_to :role
|
||||
|
||||
scope :can_display,where(disable: false)
|
||||
|
||||
def self.get_role_data(role_key)
|
||||
|
||||
@role = Role.where(:key =>role_key).first
|
||||
|
||||
return @role.id
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
+5
-62
@@ -9,13 +9,7 @@ class User
|
||||
|
||||
field :admin, :type => Boolean, :default => true
|
||||
field :active_role
|
||||
field :user_id
|
||||
field :sid
|
||||
field :first_name, localize: true
|
||||
field :last_name, localize: true
|
||||
field :email
|
||||
field :sex, :default => 'unknown'
|
||||
field :office_tel
|
||||
field :cache_dept,type: Hash
|
||||
field :status_record,type: Hash
|
||||
|
||||
@@ -31,11 +25,9 @@ class User
|
||||
# has_many :papers, :autosave => true, :dependent => :destroy
|
||||
has_and_belongs_to_many :sub_role_tags
|
||||
|
||||
# has_and_belongs_to_many :statuses
|
||||
has_and_belongs_to_many :statuses
|
||||
has_and_belongs_to_many :roles
|
||||
has_and_belongs_to_many :sub_roles
|
||||
has_and_belongs_to_many :role_statuses
|
||||
has_and_belongs_to_many :role_categorys
|
||||
accepts_nested_attributes_for :attribute_values, :allow_destroy => true
|
||||
|
||||
before_create :initialize_desktop
|
||||
@@ -44,9 +36,6 @@ class User
|
||||
scope :remote_account, where(:nccu_id.ne => nil)
|
||||
scope :not_guest_user, all_of(:name.ne => "guest")
|
||||
|
||||
validates :user_id,
|
||||
:presence => { :message => I18n.t("users.user_id_not_null") } ,
|
||||
:length => {:minimum => 3, :maximum => 50, :message => I18n.t("users.user_id_length") }
|
||||
# validates_uniqueness_of :email,:message=> I18n.t("devise.registrations.email_not_unique")
|
||||
|
||||
# def new_attribute_values=(vars)
|
||||
@@ -112,24 +101,6 @@ class User
|
||||
end
|
||||
end
|
||||
|
||||
def role_status=(var)
|
||||
self.role_statuses = []
|
||||
var[:id].each do |id,val|
|
||||
if (val=="true")
|
||||
self.role_statuses << RoleStatus.find(id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def role_category=(var)
|
||||
self.role_categorys = []
|
||||
var[:id].each do |id,val|
|
||||
if (val=="true")
|
||||
self.role_categorys << RoleCategory.find(id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def set_sub_role(sub_role_id,status_id)
|
||||
@@ -173,17 +144,6 @@ class User
|
||||
}.uniq!
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_field_name(role_type,field_key)
|
||||
@attribute = ::Attribute.where(:key => role_type).first
|
||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first.title
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_value(user_id,role_type,field_key)
|
||||
@attribute = ::Attribute.where(:key => role_type).first
|
||||
@AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||
return ::AttributeValue.where(attribute_field_id: @AttributeField.id, :user_id => user_id).first[I18n.locale.to_s]
|
||||
end
|
||||
|
||||
def create_dept_cache
|
||||
dept_hash = {}
|
||||
|
||||
@@ -210,30 +170,12 @@ class User
|
||||
(query1 + query2).uniq
|
||||
end
|
||||
|
||||
# def name
|
||||
# info = Class::Info.first(:conditions => {:key => 'profile'})
|
||||
# if info
|
||||
# first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
||||
# last_name = get_attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
||||
# full_name = "#{last_name} #{first_name}"
|
||||
|
||||
# if full_name.strip.empty?
|
||||
# full_name = email
|
||||
# end
|
||||
|
||||
# return full_name
|
||||
# else
|
||||
# return nil
|
||||
# end
|
||||
# end
|
||||
|
||||
def name
|
||||
info = Class::Info.first(:conditions => {:key => 'profile'})
|
||||
if info
|
||||
# first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
||||
# last_name = get_attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
||||
# full_name = (I18n.locale != 'zh_tw') ? "#{self.last_name} #{self.first_name}" : "#{self.first_name} #{self.last_name}"
|
||||
full_name = (I18n.locale.to_s == 'zh_tw') ? "#{self.last_name} #{self.first_name}" : "#{self.first_name} #{self.last_name}"
|
||||
first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
||||
last_name = get_attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
||||
full_name = "#{last_name} #{first_name}"
|
||||
|
||||
if full_name.strip.empty?
|
||||
full_name = email
|
||||
@@ -269,6 +211,7 @@ class User
|
||||
self.roles = self.roles.uniq
|
||||
end
|
||||
|
||||
|
||||
def rebuild_status_record
|
||||
self.status_record = {}
|
||||
self.attribute_values.reject{|t| t.key!='status'}.each do |status|
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
<% asset.sorted_tags.each do |tag| %>
|
||||
<span class="label label-tags"><%= tag.name %></span>
|
||||
<span class="label label-tags"><%= tag[I18n.locale] %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<% @tags.each do |tag| %>
|
||||
<%= content_tag :label, :class => "checkbox inline" do -%>
|
||||
<%= check_box_tag 'asset[tag_ids][]', tag.id, @asset.tag_ids.include?(tag.id) %>
|
||||
<%= tag.name %>
|
||||
<%= tag[I18n.locale] %>
|
||||
<%= hidden_field_tag 'asset[tag_ids][]', '' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
<% if @attribute_type == 'role' %>
|
||||
<li><%= link_to t(:role_field), eval("admin_#{@attribute_type}_role_field_path(attribute)") %></li>
|
||||
<li><%= link_to t(:sub_role), eval("admin_#{@attribute_type}_sub_role_path(attribute)") %></li>
|
||||
<li><%= link_to t(:status), eval("admin_role_statuses_path(:role_id=>attribute)") %></li>
|
||||
<li><%= link_to t(:category), eval("admin_role_categorys_path(:role_id=>attribute)") %></li>
|
||||
<% end %>
|
||||
<li><%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' %></li>
|
||||
<li><%= link_to t(:disable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' %></li>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="item element">
|
||||
<h3><i class="icons-"></i><a href=""><%= t(:member_) %></a></h3>
|
||||
<h3><i class="icons-"></i><a href=""><%= t(:member) %></a></h3>
|
||||
<div class="detail w-a h-a">
|
||||
<p class="totle"><span><%= t(:all_member) %></span>2,217</p>
|
||||
<table class="table table-striped">
|
||||
|
||||
@@ -2,14 +2,5 @@
|
||||
<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %>
|
||||
</ol>
|
||||
<script type="text/javascript">
|
||||
$.ajaxSetup({
|
||||
error: function(xhr, status, err) {
|
||||
if (xhr.status == 401){
|
||||
alert("<%= I18n.t('access.denied.ajax_401_error') %>");
|
||||
window.location.href = '/';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
bindTreeDragHandle();
|
||||
</script>
|
||||
@@ -1 +1 @@
|
||||
<%= f.select :module_app_id, @module_apps.collect { |t| [t.module_name, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
|
||||
<%= f.select :module_app_id, @apps.collect { |t| [t.module_name, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
|
||||
@@ -3,14 +3,14 @@
|
||||
<%= t("default_widget.select_widget_style") %>
|
||||
</label>
|
||||
<div class="controls well">
|
||||
<% if @selected[:module_app].nil? || @selected[:module_app].widgets.nil? || (@selected[:module_app].widgets[@selected[:app_frontend_url]].blank? rescue true) || @selected[:module_app].widgets[@selected[:app_frontend_url]]["style"].nil? %>
|
||||
<% if @module_app.nil? || @module_app.widgets.nil? || (@module_app.widgets[@widget_path].blank? rescue true) %>
|
||||
<%= t("default_widget.no_support_setting")%>
|
||||
<%else%>
|
||||
<%= select('page_part', 'widget_style', @selected[:module_app].widgets[@selected[:app_frontend_url]]["style"]) %>
|
||||
<%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]["style"]) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% if(@selected[:module_app] && @selected[:module_app].widget_options(@selected[:app_frontend_url])) %>
|
||||
<% if(@module_app && @module_app.widget_options(@widget_path)) %>
|
||||
<div class="style_switch control-group">
|
||||
<label class="control-label"><%= t("default_widget.select_widget_ext_option") %></label>
|
||||
<div class="controls well" >
|
||||
|
||||
@@ -27,14 +27,14 @@
|
||||
<span class="span5"></span>
|
||||
</div>
|
||||
|
||||
<% @selected[:module_app].widget_fields.each_with_index do |widget_field, i| %>
|
||||
<% @module_app.widget_fields.each_with_index do |widget_field, i| %>
|
||||
<div class="rows clear">
|
||||
<span class="span4">
|
||||
<%= i+1 %>
|
||||
<%= select_tag "#{object_name}[#{field_name}][][field_name]", widget_field_options(i), :include_blank => true ,:class=>'widget_field_select',:field_seri => i ,:id=>"#{object_name}_#{field_name}_#{i}",:rel=>reload_rel%>
|
||||
</span>
|
||||
<span class="span3">
|
||||
<%= select_tag "#{object_name}[#{field_name}][][class]", widget_field_class_options(i), :include_blank => true %> <br />
|
||||
<%= select_tag "#{object_name}[#{field_name}][][class]", widget_fiield_class_options(i), :include_blank => true %> <br />
|
||||
</span>
|
||||
<span class="span5 link_switch_holder">
|
||||
<%= link_to_field_switch(i,object_name,field_name) %>
|
||||
|
||||
@@ -5,13 +5,14 @@
|
||||
<% when PagePart %>
|
||||
<% field_name = "page_part[widget_style]" %>
|
||||
<% end %>
|
||||
|
||||
<div class="style_switch control-group">
|
||||
<label class="control-label">
|
||||
<%= t("default_widget.select_widget_style") %>
|
||||
</label>
|
||||
<div class="controls well">
|
||||
<ul class="clear">
|
||||
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeA") %>
|
||||
<% if @module_app.get_default_widget["enabled_styles"].include?("typeA") %>
|
||||
<li>
|
||||
<label class="radio style_radio">
|
||||
<%= radio_button_tag field_name,"typeA",style_checked_value(object,"typeA") %>
|
||||
@@ -22,7 +23,7 @@
|
||||
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeB_style2") %>
|
||||
<% if @module_app.get_default_widget["enabled_styles"].include?("typeB_style2") %>
|
||||
<li>
|
||||
<label class="radio style_radio">
|
||||
<%= radio_button_tag field_name,"typeB_style2",style_checked_value(object,"typeB_style2") %>
|
||||
@@ -32,7 +33,7 @@
|
||||
</label>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeB_style3") %>
|
||||
<% if @module_app.get_default_widget["enabled_styles"].include?("typeB_style3") %>
|
||||
<li>
|
||||
<label class="radio style_radio">
|
||||
<%= radio_button_tag field_name,"typeB_style3",style_checked_value(object,"typeB_style3") %>
|
||||
@@ -42,7 +43,7 @@
|
||||
</label>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeB_style4") %>
|
||||
<% if @module_app.get_default_widget["enabled_styles"].include?("typeB_style4") %>
|
||||
<li>
|
||||
<label class="radio style_radio">
|
||||
<%= radio_button_tag field_name,"typeB_style4",style_checked_value(object,"typeB_style4") %>
|
||||
@@ -52,7 +53,7 @@
|
||||
</label>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeC") %>
|
||||
<% if @module_app.get_default_widget["enabled_styles"].include?("typeC") %>
|
||||
<li>
|
||||
<label class="radio style_radio">
|
||||
<%= radio_button_tag field_name,"typeC",style_checked_value(object,"typeC") %>
|
||||
|
||||
@@ -19,6 +19,5 @@
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%=javascript_include_tag "inc/update_cates_and_tags.js" %>
|
||||
<%= javascript_include_tag "inc/page_widget_edit_interface.js" %>
|
||||
|
||||
<%=javascript_include_tag "inc/update_cates_and_tags.js" %>
|
||||
@@ -17,7 +17,7 @@
|
||||
<%= t "default_widget.select_module_app" %>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, :selected => (@selected[:module_app].id rescue nil)), {:include_blank => true }, {:rel => reload_after_module_changed_admin_page_part_path,:id=>"page_module_app_id"} %>
|
||||
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, :selected => (@module_app.id rescue nil)), {:include_blank => true }, {:rel => reload_after_module_changed_admin_page_part_path,:id=>"page_module_app_id"} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
<%= t "default_widget.select_widget_path" %>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<%#= @module_app ? @module_app.widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} %>
|
||||
<%= f.select :widget_path, @app_frontend_urls , {}, { :selected => @selected[:app_frontend_url], :rel => get_widget_field_rel } %>
|
||||
<%= f.select :widget_path, @module_app ? @module_app.widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} : [], {}, { :selected => @part.widget_path, :rel => get_widget_field_rel } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<%= nil_checkbox_button(object,:tag) %>
|
||||
<%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%>
|
||||
<%= check_box_tag("#{field_name}[tag][]", tag.id, tag_checked_value(object,tag.id),:class=>'select_option' ) %>
|
||||
<%= tag.name%>
|
||||
<%= tag[I18n.locale]%>
|
||||
<% end if @tags%>
|
||||
</fieldset>
|
||||
<% else %>
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
<% if (not(@selected[:module_app].widget_options(@selected[:app_frontend_url]).blank?) and @selected[:app_frontend_url]!='default_widget')%>
|
||||
|
||||
|
||||
<% @selected[:module_app].widget_options(@selected[:app_frontend_url]).get_options.each do |key,settings| %>
|
||||
<% @module_app.widget_options(@widget_path).get_options.each do |key,settings| %>
|
||||
<% options = settings[:opts] %>
|
||||
<%= label_tag(t(settings[:label_i18n]))%>
|
||||
<% case options%>
|
||||
@@ -15,4 +12,3 @@
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
@@ -2,4 +2,8 @@
|
||||
<%= render 'admin/items/site_map_left_bar' %>
|
||||
<% end -%>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%= render 'edit' %>
|
||||
@@ -1 +1 @@
|
||||
$("#<%= params[:dom_id] %>").parents(".rows").find(".link_switch_holder").html("<%= j link_to_field_switch(@index,'page_part','widget_field',nil,@selected[:default_widget_field]) %>");
|
||||
$("#<%= params[:dom_id] %>").parents(".rows").find(".link_switch_holder").html("<%= j link_to_field_switch(@index,'page_part','widget_field',nil,@choosen_field) %>");
|
||||
@@ -1,11 +1,11 @@
|
||||
<% if @selected[:module_app]%>
|
||||
$('#widget_list select').html("<%= j options_for_select(@selected[:module_app].widgets.collect{|k,v| [I18n.t(v['i18n']),k]},@selected[:app_frontend_url]) %>");
|
||||
<% if @module_app%>
|
||||
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| [I18n.t(v['i18n']),k]},@part.widget_path) %>");
|
||||
$("#widget_data_source_category").html("<%= j render :partial => 'widget_data_source_category',:locals=>{:object=>@part} %>");
|
||||
$("#widget_data_source_tag").html("<%= j render :partial => 'widget_data_source_tag',:locals=>{:object=>@part} %>");
|
||||
$("#data_count").html("<%= j render :partial => 'admin/pages/data_count_field',:locals=>{:field_name=>'page_part[widget_data_count]',:field_value=>@part.widget_data_count } %>");
|
||||
<% if @part %>
|
||||
<% if show_default_widget_setting_panel %>
|
||||
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel',:locals=>{:object=>@part} %>");
|
||||
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>");
|
||||
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting',:locals=>{:object=>@part} %>");
|
||||
<% elsif show_custom_widget_setting_panel %>
|
||||
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</label>
|
||||
<div class="controls well">
|
||||
<% if @frontend_styles%>
|
||||
<%= select('page', 'frontend_style', @frontend_styles,{:selected => @selected[:frontend_style]}) %>
|
||||
<%= select('page', 'frontend_style', @frontend_styles) %>
|
||||
<% else %>
|
||||
<%= t("default_widget.no_support_setting")%>
|
||||
<% end %>
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<%= t("default_widget.widget_data_count") %>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<%= select_tag(field_name,options_for_select(@page_frontend_data_counts||[],field_value )) %>
|
||||
<%= select_tag(field_name,options_for_select((@module_app.get_registration.get_data_count rescue []),field_value )) %>
|
||||
</div>
|
||||
@@ -1,13 +1,13 @@
|
||||
<%= f.error_messages %>
|
||||
<%= f.hidden_field :parent, :value => (@item.parent.id rescue nil) %>
|
||||
<%= f.hidden_field :id, :value => (@item.id),:id=>"object_id" %>
|
||||
|
||||
<div class="control-group">
|
||||
<%= f.label :name, '*'+t(:name), :class => 'control-label' %>
|
||||
|
||||
|
||||
<div class="controls">
|
||||
<%= f.text_field :name, :class => 'text input-xlarge' %>
|
||||
<span class="help-inline"><%= I18n.t("front_page.name_field_helper") %></span>
|
||||
<span class="help-inline">請輸入數字或英文,不可使用空白</span>
|
||||
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -27,14 +27,14 @@
|
||||
<div class="control-group">
|
||||
<%= f.label :name, t(:template_name), :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.collection_select :design, @designs, :id, :title, {:selected => (@selected[:design].id rescue nil) }, {:rel => reload_themes_admin_pages_path} %>
|
||||
<%= f.collection_select :design, @designs, :id, :title, {:selected => @design.id}, {:rel => reload_themes_admin_pages_path} %>
|
||||
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<%= f.label :name, t(:theme), :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.select :theme_id, @themes.collect { |t| [t.name.capitalize, t.id] }, {:include_blank => true, :selected=>(@selected[:theme].id rescue nil) } %>
|
||||
<%= f.select :theme_id, @design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %>
|
||||
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -42,14 +42,14 @@
|
||||
<div class="control-group" id="module_app_list">
|
||||
<%= f.label '',t("default_widget.select_module_app"), :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.select :module_app_id, options_from_collection_for_select(@module_apps, :id, :module_name, :selected =>(@selected[:module_app].id rescue nil)), {:include_blank => true }, {:rel => reload_after_module_changed_admin_pages_path,:id=>"page_module_app_id"} %>
|
||||
<%= f.select :module_app_id, options_from_collection_for_select(@module_apps, :id, :module_name, :selected => (@module_app.id rescue nil)), {:include_blank => true }, {:rel => reload_after_module_changed_admin_pages_path,:id=>"page_module_app_id"} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group" id="frontend_list">
|
||||
<%= f.label '', t("front_page.select_app_url"), :class => 'control-label' %>
|
||||
<div class="controls" id="app_page_url">
|
||||
<%= select('page','app_frontend_url', @app_frontend_urls || [], {:selected => @selected[:app_frontend_url],:rel => reload_after_list_changed_admin_pages_path}) rescue ''%>
|
||||
<%= select('page','app_frontend_url', @app_frontend_urls || [],{}, {:selected => (@item.app_frontend_url || 'default_widget'),:rel => reload_after_list_changed_admin_pages_path}) rescue ''%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
|
||||
<div class="control-group" id='data_count'>
|
||||
<%= render :partial=>'data_count_field',:locals=>{:field_name=>"page[frontend_data_count]",:field_value=>@selected[:page_frontend_data_count]} %>
|
||||
<%= render :partial=>'data_count_field',:locals=>{:field_name=>"page[frontend_data_count]",:field_value=>@item.frontend_data_count} %>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
@@ -112,5 +112,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%=javascript_include_tag "inc/update_cates_and_tags.js" %>
|
||||
<%= javascript_include_tag "inc/page_widget_edit_interface.js" %>
|
||||
<%=javascript_include_tag "inc/update_cates_and_tags.js" %>
|
||||
@@ -4,7 +4,7 @@
|
||||
<% @module_app.widget_fields.each_with_index do |frontend_field, i| %>
|
||||
<%= i+1 %>
|
||||
<%= select_tag "page[frontend_field][]",widget_field_options(i,@item) , :include_blank => true %>
|
||||
<%= select_tag "page[frontend_field_type][]", widget_field_class_options(i,@item), :include_blank => true %> <br />
|
||||
<%= select_tag "page[frontend_field_type][]", widget_fiield_class_options(i,@item), :include_blank => true %> <br />
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
<%= render 'admin/items/site_map_left_bar' %>
|
||||
<% end -%>
|
||||
|
||||
<%= render 'edit' %>
|
||||
<%= render 'edit' %>
|
||||
@@ -1,25 +1,25 @@
|
||||
<% if @selected[:module_app] %>
|
||||
<% if @module_app %>
|
||||
$('#app_page_category').html("<%= j render :partial => 'admin/page_parts/widget_data_source_category' ,:locals=>{:object=>@item}%>");
|
||||
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@item} %>");
|
||||
$("#data_count").html("<%= j render :partial => 'admin/pages/data_count_field',:locals=>{:field_name=>'page[frontend_data_count]',:field_value=>(@item.frontend_data_count rescue nil)} %>");
|
||||
|
||||
<% if !@selected[:module_app].app_pages.blank? or @selected[:module_app].has_default_widget? %>
|
||||
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', options_for_select(@app_frontend_urls, @selected[:app_frontend_url]),{},{:rel => reload_after_list_changed_admin_pages_path}) %>");
|
||||
<% if !@module_app.app_pages.blank? or @module_app.has_default_widget? %>
|
||||
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', options_for_select(@app_frontend_urls, (@item.app_frontend_url || 'default_widget')),{},{:rel => reload_after_list_changed_admin_pages_path}) %>");
|
||||
<% else %>
|
||||
$('#app_page_url').html("<div class='well'><%= t('default_widget.no_support_setting')%></div>");
|
||||
<% end %>
|
||||
|
||||
<% if @app_frontend_urls.first =='default_widget' %>
|
||||
$('#app_page_frontend_style').html("<%= escape_javascript(select 'page', 'frontend_style', @selected[:module_app].widgets[@selected[:app_frontend_url]]) %>");
|
||||
$('#app_page_frontend_style').html("<%= escape_javascript(select 'page', 'frontend_style', @module_app.widgets[@frontend_path]) if !@frontend_path.blank? %>");
|
||||
<% else %>
|
||||
$('#app_page_frontend_style').html("<%= t('default_widget.no_support_setting')%>");
|
||||
<% end %>
|
||||
|
||||
<% if show_default_widget_setting_panel %>
|
||||
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@item} %>");
|
||||
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@page} %>");
|
||||
|
||||
$('#frontend_setting').html("<%= j render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:object=>@item} %>");
|
||||
$('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@item} %>");
|
||||
$('#frontend_setting').html("<%= j render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:object=>@page} %>");
|
||||
$('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@page} %>");
|
||||
<% else %>
|
||||
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
|
||||
<% end %>
|
||||
|
||||
@@ -1 +1 @@
|
||||
$("#<%= params[:dom_id] %>").parents(".rows").find(".link_switch_holder").html("<%= j link_to_field_switch(@index,'page','frontend_field',nil,@selected[:default_widget_field]) %>");
|
||||
$("#<%= params[:dom_id] %>").parents(".rows").find(".link_switch_holder").html("<%= j link_to_field_switch(@index,'page','frontend_field',nil,@choosen_field) %>");
|
||||
@@ -1,31 +0,0 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= form_for(:role_filter, :remote => true, :url => @url, :method => @verb, :html => { :id => 'form_role_filter' } ) do |f| %>
|
||||
|
||||
<h2><%= (@role_filter.new_record? ? 'Add' : 'Edit') %></h2>
|
||||
|
||||
<div id="widget-title">
|
||||
<%= f.label :key %>
|
||||
<%= f.text_field :key %>
|
||||
</div>
|
||||
|
||||
<div id="widget-title">
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<div class="control-group">
|
||||
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, :class =>' input-xxlarge', :value => (@role_filter.title_translations[locale] rescue nil) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.hidden_field :role_id, :value => params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
<tr id="<%= dom_id role_filter %>" class="with_action">
|
||||
<td>
|
||||
<%= role_filter.key %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<% if is_admin?%>
|
||||
<li><%= link_to t('role_filter.edit'),
|
||||
polymorphic_path([:admin, role_filter], {:action => :edit}), :remote => true %></li>
|
||||
<li><%= link_to show_toggle_archive_btn(role_filter),
|
||||
polymorphic_path([:admin, role_filter]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<% if @types.is_localized?(:title) %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= role_filter.title_translations[locale] rescue nil %></td>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<td><%= role_filter.title %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
@@ -1,2 +0,0 @@
|
||||
$('<%= j render :partial => 'role_filter', :collection => [@role_filter] %>').appendTo('#role_filters').hide().fadeIn();
|
||||
$("#form_role_filter")[0].reset();
|
||||
@@ -1 +0,0 @@
|
||||
$("#<%= dom_id @role_filter %>").find(".archive_toggle").text("<%= show_toggle_archive_btn(@role_filter) %> ");
|
||||
@@ -1 +0,0 @@
|
||||
$("#form > form").replaceWith("<%= j render "form" %>");
|
||||
@@ -1,49 +0,0 @@
|
||||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% end %>
|
||||
|
||||
<div class="subnav">
|
||||
<ul class="breadcrumb">
|
||||
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
|
||||
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></li>
|
||||
</ul>
|
||||
<div id="accordion">
|
||||
<div class="accordion-group filters">
|
||||
<div class="table-label">
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr class="sort-header">
|
||||
|
||||
<th id="sort-name" class="sort span1-2 select"><span><a href="#"><%= t('role_filters.key') %><b class="web-symbol"></b></a></span></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th id="sort-name" class="sort span1-2 select"><span><a href="#"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %><b class="web-symbol"></b></a></span></th>
|
||||
<% end %>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="role_filters" class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1-2"></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th class="span1-2"></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<%= render :partial => 'role_filter', :collection => @role_filters %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="form"><%= render :partial => "form" %></div>
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
$("#form > form").replaceWith("<%= j render "form" %>");
|
||||
@@ -1,4 +0,0 @@
|
||||
$("#<%= dom_id @role_filter %>").replaceWith("<%= j render :partial => 'role_filter', :collection => [@role_filter] %>");
|
||||
<% @role_filter = @types.new(:display => 'List') # reset for new form %>
|
||||
$("#form_role_filter").replaceWith("<%= j render "form" %>")
|
||||
$("#form_role_filter")[0].reset();
|
||||
@@ -1,9 +1,3 @@
|
||||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal" do |f| %>
|
||||
<div class="site-map role-block">
|
||||
<div class="map-block back">
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
|
||||
<div class="site-map role-block">
|
||||
<div class="map-block back">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
<h1><%= I18n.t("site.system_preference") %></h1>
|
||||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li class="active"><a href="#summary" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_summary") %></a></li>
|
||||
<li><a href="#commits" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_commits") %></a></li>
|
||||
<li><a href="#backups" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_backups") %></a></li>
|
||||
<li><a href="#resque_logs" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_logs") %></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active in" id="summary">
|
||||
<h2><%= I18n.t("site.system_preference_.summary.disk_space") %>:</h2>
|
||||
<%= content_tag :p,@site.disk_space.gsub(/\n/,"<br />").html_safe if @site.disk_space %>
|
||||
<h2><%= I18n.t("site.system_preference_.summary.code_update_at") %>: </h2>
|
||||
<% @site.system_package_info.each do |index,value| %>
|
||||
<h2><%= index.titleize %> <%= I18n.t("site.system_preference_.summary.version") %>:</h2>
|
||||
<%= content_tag :p,value %>
|
||||
<% end %>
|
||||
<h2><%= I18n.t("site.system_preference_.summary.weekness_report") %>:<%= '' %></h2>
|
||||
</div>
|
||||
<div class="tab-pane" id="commits">
|
||||
<% if @git_commit_list_file %>
|
||||
<% @git_commit_list_file.lines do |line|%>
|
||||
<%= line %><br/>
|
||||
<% end%>
|
||||
<% else %>
|
||||
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="tab-pane" id="backups">
|
||||
<%if @db_backup_list_file %>
|
||||
<% @db_backup_list_file.lines do |line|%>
|
||||
<%=line %><br/>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="tab-pane" id="resque_logs">
|
||||
<%if @db_backup_list_file %>
|
||||
<% @resque_logs_file.lines do |line|%>
|
||||
<%=line %><br/>
|
||||
<% end if @resque_logs_file%>
|
||||
<%else %>
|
||||
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,14 +35,6 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t 'site.openness' %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :frontend_closed %><%= I18n.t('site.frontend_closed') %><br/>
|
||||
<%= f.check_box :backend_openness_on %><%= I18n.t('site.backend_openness_on') %>
|
||||
<p class="help-block"><%= (t 'site.search_help').html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t 'site.search' %></label>
|
||||
<div class="controls">
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
<%= form_for :tag, :url => admin_tags_path, :remote => true, :html => {:id => 'tag_form'} do |f| %>
|
||||
<%= f.fields_for :name_translations do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= hidden_field_tag :module_app_id, @module_app_id %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %>
|
||||
<% end %>
|
||||
<%= f.hidden_field :module_app_id, :value => @module_app_id %>
|
||||
<%= f.submit t(:add) %>
|
||||
<% end %>
|
||||
@@ -1,9 +1,7 @@
|
||||
<%= form_for :tag, :url => admin_tag_path(tag), :method => :put, :remote => true do |f| %>
|
||||
<%= f.fields_for :name_translations do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale, value: @tag.name_translations[locale] %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= hidden_field_tag :module_app_id, @module_app_id %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %>
|
||||
<% end %>
|
||||
<%= f.hidden_field :module_app_id, :value => tag.module_app_id %>
|
||||
<%= f.submit t(:update_) %>
|
||||
<% end %>
|
||||
@@ -3,11 +3,11 @@
|
||||
<i class="icons-tag"></i>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<%#= I18nVariable.from_locale(locale) %>
|
||||
<%= tag.name_translations[locale] %>
|
||||
<%= tag[locale] %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="action">
|
||||
<%= link_to t(:edit), edit_admin_tag_path(tag, :module_app_id => @module_app_id), :remote => true %>
|
||||
<%= link_to t(:edit), edit_admin_tag_path(tag), :remote => true %>
|
||||
<%= link_to t(:delete_), admin_tag_path(tag), :confirm => t('sure?'), :method => :delete, :remote => true %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,34 +4,12 @@
|
||||
|
||||
<div class="groups map-block back <%= role_disable ? 'disabled' : '' %>">
|
||||
<h4>
|
||||
<button for=<%=@form_index%> class="onoff pull-right"><%= role_disable ? 'OFF' : 'ON' %></button><span><%= role.title %><%= t(:role_info)%></span>
|
||||
<button for=<%=@form_index%> class="onoff pull-right"><%= role_disable ? 'OFF' : 'ON' %></button><span><%= role.title %></span>
|
||||
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,:class=>"subrole_disable_field",:value=>role_disable)%>
|
||||
</h4>
|
||||
|
||||
<div class="form-horizontal <%= role_disable ? 'hide' : '' %>">
|
||||
|
||||
<% @form_index = @form_index +1 %>
|
||||
|
||||
<div class="control-group">
|
||||
|
||||
<%= label_tag t(:status), nil, {:func=>"field_label", :for=>"1", :class=>"control-label"} %>
|
||||
<% role.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=>"control-label") %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% @form_index = @form_index +1 %>
|
||||
|
||||
<div class="control-group">
|
||||
<%= label_tag t(:category), nil, {:func=>"field_label", :for=>"1", :class=>"control-label"} %>
|
||||
<% role.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=>"control-label") %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<% role.attribute_fields.each do |rf|%>
|
||||
|
||||
<%= rf.block_helper(@user,@form_index)%>
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
<div class="roles <%= show_roles.key %>">
|
||||
<%= show_roles.title %><%= t(:role_info)%>
|
||||
<%= show_roles.title %>
|
||||
<div class="label-line">
|
||||
<hr />
|
||||
</div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="span1"><%= t('status') %></td>
|
||||
<td><%= show_attribute_value(@user.role_statuses.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="span1"><%= t('category') %></td>
|
||||
<td><%= show_attribute_value(@user.role_categorys.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
|
||||
</tr>
|
||||
<% show_roles.attribute_fields.where(:disabled=>false).each do |rf| %>
|
||||
<tr>
|
||||
<td class="span1"><%= rf.title %></td>
|
||||
<td><%= nl2br(show_attribute_value(@user.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
|
||||
<td><%= show_attribute_value(@user.get_attribute_value(rf).get_value_by_locale(I18n.locale)) rescue '' %></td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
<%= render :partial => 'show_sub_role',:collection=> @user.get_sub_roles_by_role(show_roles)%>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<% show_sub_role.attribute_fields.each do |item|%>
|
||||
<tr>
|
||||
<td class="span1"><%= item.title %></td>
|
||||
<td><%= nl2br(show_attribute_value(@user.get_attribute_value(item).get_value_by_locale(I18n.locale))) rescue '' %></td>
|
||||
<td><%= show_attribute_value(@user.get_attribute_value(item).get_value_by_locale(I18n.locale)) rescue '' %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -1,5 +1,5 @@
|
||||
<%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-user')+ content_tag(:span, t(:member_)), admin_users_new_interface_index_path %>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-user')+ content_tag(:span, t(:member)), admin_users_new_interface_index_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface')) do -%>
|
||||
<%= content_tag :li, link_to((t(:all_member) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, admin_users_new_interface_index_path), :class => active_for_action('users_new_interface', 'index') %>
|
||||
<%= content_tag :li, link_to((t(:add_member) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_admin_users_new_interface_path), :class => active_for_action('users_new_interface', 'new') if (is_admin? rescue nil) %>
|
||||
|
||||
@@ -1,120 +1,32 @@
|
||||
<%#= devise_error_messages! %>
|
||||
|
||||
<div class="map-block back">
|
||||
<h4><span><%=t(:sys_basic_form)%></span></h4>
|
||||
<h4><span><%=t(:sys_basic_form)%></span></h4>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="controls-block" >
|
||||
<div class="control-group language-swich">
|
||||
<%= f.label t("users.first_name"),{:class=>"control-label", :func=>"field_label"} %>
|
||||
<div class="controls">
|
||||
<div class="tabbable">
|
||||
<div class="tab-content">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<div class="tab-pane fade <%= locale %> user-attribute_values-first_name <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
<%= f.fields_for :first_name_translations do |f| %>
|
||||
<%= f.text_field locale, :func=>'input_unit', :value => (@user.first_name_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t(:email),:class=>"control-label" %><br />
|
||||
<div class="controls">
|
||||
<%= f.email_field :email %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t(:password),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.password_field :password %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<ul class="nav nav-pills">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? "class=active" : '' %> for="<%= locale %>">
|
||||
<a data-toggle="tab" href=".user-attribute_values-first_name.<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="controls-block" >
|
||||
<div class="control-group language-swich">
|
||||
<%= f.label t("users.last_name"),{:class=>"control-label", :func=>"field_label"} %>
|
||||
<div class="controls">
|
||||
<div class="tabbable">
|
||||
<div class="tab-content">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<div class="tab-pane fade <%= locale %> user-attribute_values-last_name <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
<%= f.fields_for :last_name_translations do |f| %>
|
||||
<%= f.text_field locale, :func=>'input_unit', :value => (@user.last_name_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<ul class="nav nav-pills">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? "class=active" : '' %> for="<%= locale %>">
|
||||
<a data-toggle="tab" href=".user-attribute_values-last_name.<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.email"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.email_field :email %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.sid"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.text_field :sid %>
|
||||
<span>( <%= t("users.sid_note")%> )</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.office_tel"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.text_field :office_tel %>
|
||||
<span>( <%= t("users.office_tel_note")%> )</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.avatar"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.file_field :avatar %>
|
||||
<% if @user.avatar.file %>
|
||||
<%= f.check_box :remove_avatar %>
|
||||
<%= t('delete.file') %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.sex"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<label func="input_unit" for="0" class=" radio inline">
|
||||
<%= f.radio_button :sex, "male" %><%= t('users.male')%>
|
||||
</label>
|
||||
<label func="input_unit" for="1" class=" radio inline">
|
||||
<%= f.radio_button :sex, "female" %><%= t('users.female')%>
|
||||
</label>
|
||||
<label func="input_unit" for="2" class=" radio inline">
|
||||
<%= f.radio_button :sex, "unknown" %><%= t('users.unknown')%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t(:password_confirmation),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.password_field :password_confirmation %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,36 +0,0 @@
|
||||
<%#= devise_error_messages! %>
|
||||
<%= flash_messages %>
|
||||
|
||||
<div class="map-block back">
|
||||
<h4><span><%=t(:sys_basic_id_form)%></span></h4>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.user_id"),:class=>"control-label" %>
|
||||
<%#= f.label t(:user_id),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.text_field :user_id %>
|
||||
<span>( <%= t("users.user_id_note")%> )</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.new_password"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.password_field :password %>
|
||||
<span>( <%= t("users.new_password_note")%> )</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.new_password_confirmation"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.password_field :password_confirmation %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -18,10 +18,7 @@
|
||||
<%= link_to user_for_summary.name,admin_users_new_interface_path(user_for_summary)%>
|
||||
</p>
|
||||
<div class="user-title">
|
||||
<% user_for_summary.roles.each do |rf| %>
|
||||
<% @roledata = Role.find(rf.id) %>
|
||||
<span><%= @roledata.title %></span>
|
||||
<% end %>
|
||||
<span>#TODO 教授兼系主任</span><span>#TODO 大學部校友</span>
|
||||
</div>
|
||||
<ul class="user-itemborder clear">
|
||||
<li class="pull-left"><span>#TODO 258</span>Publications</li>
|
||||
|
||||
Loaded 100 of 421 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user