Compare commits

..
Author SHA1 Message Date
harrybomrah 4eefca8531 rake task added 2013-04-09 01:05:54 +08:00
harrybomrah 96b6f7e3fd Merge branch 'desktop_design_devin' into desktop_work1
Conflicts:
	app/assets/javascripts/orbitdesktop.js
	vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb
	vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb
2013-04-08 17:30:13 +08:00
devin chen 3d7b54df1c minor update 2013-04-03 15:38:59 +08:00
harrybomrah e8a6c2cc3c stupid commit 2013-04-03 15:27:24 +08:00
harrybomrah ecf0aa7d2e small fix in select2.js 2013-04-03 15:24:30 +08:00
devin chen 2f0533db2d minor update 2013-04-03 15:03:05 +08:00
devin chen 350c68611c starting new branch ( add rules in .gitignore for SASS cache folder ) 2013-04-02 12:02:19 +08:00
harrybomrah 8b44f930f3 widget and gridster fixes 2013-04-01 18:00:47 +08:00
devin d2330d6e3e devin's new branch 2013-04-01 11:45:12 +08:00
chris bd3e9fe4f6 Fix js bug and asset url after merge 2013-03-29 17:50:21 +08:00
devin 4bb5e18f44 recover .gitignore file
Conflicts:
	.gitignore
2013-03-29 12:33:35 +08:00
harrybomrah 78205d8b00 features and widgets added
Conflicts:
	app/assets/javascripts/orbitdesktop.js
2013-03-29 12:04:21 +08:00
devin a62ff9308f Lots of Update
1. CSS to SCSS
2. Journal Paper update

Conflicts:
	Gemfile.lock
	app/assets/javascripts/orbitdesktop.js
	app/assets/stylesheets/desktop/desktop-main.css
	vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/index.html.erb
	vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_authors/index.html.erb
	vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb
	vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/journal_type.html.erb
2013-03-29 12:03:15 +08:00
Matt K. Fu 474e8b9b57 fix for both part and page part settings
Conflicts:
	app/helpers/admin/page_parts_helper.rb
	app/views/admin/pages/reload_front_end_setting.js.erb
	app/views/admin/pages/reload_frontend_pages.js.erb
2013-03-29 11:12:52 +08:00
Spen a8f7422c25 faq app 2013-03-29 11:09:56 +08:00
Fu Matthew 9e02011956 deliver API 2013-03-29 11:08:22 +08:00
chris 3f0addf04d Fix bug in setup_app_frontend_and_style 2013-03-26 16:29:35 +08:00
chris 0a01faedc9 Fix merge error 2013-03-26 16:16:19 +08:00
chris 8e0331449f Merge branch 'patrial_Select_for_default_widget_style' of github.com:Rulingcom/orbit into patrial_Select_for_default_widget_style
Conflicts:
	app/controllers/admin/pages_controller.rb
	app/helpers/admin/page_parts_helper.rb
2013-03-21 18:51:16 +08:00
Fu Matthew 635d3f1690 add conditions for making multi cates and tags more stable 2013-03-21 18:49:53 +08:00
Fu Matthew 9e33bdadc3 now default options can be chosen by developer at init 2013-03-21 18:46:57 +08:00
Fu Matthew 54acaebc98 style for front end 2013-03-21 18:46:56 +08:00
Fu Matthew 7f7e21b4f2 1.make module app forbid unearthed access except from admin
2.override sidebar link when it's object_auth or app_auth.
2013-03-21 18:45:28 +08:00
Fu Matthew 8609c8dec0 put add admin pages using orbit back end controller 2013-03-21 18:45:27 +08:00
chris f3e40c1405 Merge branch 'desktop' of github.com:Rulingcom/orbit into desktop
Conflicts:
	Gemfile.lock
	vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/_form.html.erb
	vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb
2013-03-21 18:39:09 +08:00
Rueshyna 42aca64dc3 correct model method 2013-03-21 18:29:25 +08:00
harrybomrah 6ba840de4a app manager changed plus some changes 2013-03-21 18:29:22 +08:00
harrybomrah 53953e57db section page fixed.. 2013-03-21 18:27:23 +08:00
Rueshyna ddf61e5606 fixed co author relation save button 2013-03-21 18:25:37 +08:00
harrybomrah 5685e11511 app manager changed plus some changes 2013-03-21 18:25:37 +08:00
harrybomrah 0e39de56e2 section page fixed.. 2013-03-21 18:25:36 +08:00
devin 677faf1811 add browser compatibility page 2013-03-21 18:25:36 +08:00
Rueshyna f0fbd50261 fixed checkout and start in personal plugin 2013-03-21 18:25:36 +08:00
Rueshyna 573270c98c correct factoried girl for journal 2013-03-21 18:25:36 +08:00
Rueshyna f61b786e90 one abstract one column for personal plugin 2013-03-21 18:25:36 +08:00
Rueshyna d085197635 add pagination for every controller and view in personal plugin 2013-03-21 18:25:36 +08:00
harrybomrah 6c58a0f773 compatibility page added and tinyscrollbar drag event fixed.. 2013-03-21 18:25:33 +08:00
harrybomrah 478b54da26 tinyscrollbar pagination fixed 2013-03-21 18:25:05 +08:00
harrybomrah e799ac4395 insert and remove columns 2013-03-21 18:25:05 +08:00
harrybomrah c101413d32 Major tinyscrollbar update 2013-03-21 18:25:02 +08:00
Rueshyna 50a09763ec modify translation for journal_co_author_relation button 2013-03-21 18:24:20 +08:00
Rueshyna 811b30791b modify nil of email string and sort 2013-03-21 18:24:20 +08:00
Rueshyna 4b8c68500a remove redundant space of co_author sample data 2013-03-21 18:24:20 +08:00
Rueshyna e5e45f3ada make index of list can be hightline list when click cancel button 2013-03-21 18:24:20 +08:00
Rueshyna f619c5e389 fixed author sample data generation and model method 2013-03-21 18:24:20 +08:00
Rueshyna 3c6ca3c254 add author filter for journal and fix some bug 2013-03-21 18:24:20 +08:00
Rueshyna 12fdb5a0ca have done conference author filter, journal haven't been done, yet 2013-03-21 18:24:16 +08:00
harrybomrah 7df0be3826 tinyscrollbar pagination fixed 2013-03-21 18:22:28 +08:00
harrybomrah 80be9e63ef insert and remove columns 2013-03-21 18:22:28 +08:00
harrybomrah 0444b1f5e5 Major tinyscrollbar update 2013-03-21 18:22:06 +08:00
Rueshyna 91d3e1d92c add pagination for personal plugin 2013-03-21 18:16:08 +08:00
Rueshyna fb8407dbe3 fixed bug 2013-03-21 18:10:55 +08:00
harrybomrah 9963c9fb68 insert and remove columns 2013-03-21 18:09:39 +08:00
devin 80a2f67dda tinyscrollbar css minor update 2013-03-21 18:09:39 +08:00
harrybomrah 7b2e7f5297 Major tinyscrollbar update 2013-03-21 18:09:39 +08:00
harrybomrah 38a695d8a9 all none for conf done 2013-03-21 18:09:38 +08:00
harrybomrah df83c6fff7 all none fixed 2013-03-21 18:09:38 +08:00
Rueshyna adec8c8938 correct model method 2013-03-15 15:10:14 +08:00
Rueshyna 2746616610 Merge branch 'desktop_work' into desktop
* desktop_work:
  app manager changed plus some changes
  section page fixed..
  section page fixed..
  add browser compatibility page

Conflicts:
	vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb
2013-03-14 19:00:06 +08:00
Rueshyna 61cc8f0f54 fixed co author relation save button 2013-03-14 18:29:24 +08:00
harrybomrah 31476bb813 app manager changed plus some changes 2013-03-14 17:55:33 +08:00
harrybomrah d2c1abeb95 section page fixed.. 2013-03-14 17:54:38 +08:00
devin f0c19cfdf9 add browser compatibility page 2013-03-14 17:54:38 +08:00
harrybomrah 8ab4e90a06 app manager changed plus some changes 2013-03-14 17:48:45 +08:00
Rueshyna 7a78594594 fixed checkout and start in personal plugin 2013-03-14 17:43:29 +08:00
Rueshyna b50548c538 correct factoried girl for journal 2013-03-14 17:43:01 +08:00
harrybomrah 84f255173c Merge branch 'desktop_work_devin' into desktop_work 2013-03-14 14:17:13 +08:00
harrybomrah b4ba4149d4 section page fixed.. 2013-03-14 14:16:38 +08:00
harrybomrah 3830fddfe0 section page fixed.. 2013-03-14 14:00:04 +08:00
Fu Matthew 66633443de add conditions for making multi cates and tags more stable 2013-03-13 17:53:11 +08:00
devin 3d7fbd9711 add browser compatibility page 2013-03-13 15:49:20 +08:00
Fu Matthew aa851cad76 now default options can be chosen by developer at init 2013-03-13 14:09:10 +08:00
Rueshyna 4a2c994401 one abstract one column for personal plugin 2013-03-13 14:05:06 +08:00
Rueshyna af6813480a add pagination for every controller and view in personal plugin 2013-03-12 17:00:42 +08:00
harrybomrah 4a83521b84 compatibility page added and tinyscrollbar drag event fixed.. 2013-03-12 15:23:38 +08:00
Rueshyna 470dbea22d Merge branch 'desktop' into desktop_work
* desktop:
  tinyscrollbar pagination fixed
  insert and remove columns
  Major tinyscrollbar update
  modify translation for journal_co_author_relation button
  modify nil of email string and sort
  remove redundant space of co_author sample data
  make index of list can be hightline list when click cancel button
  fixed author sample data generation and model method
  add author filter for journal and fix some bug
  have done conference author filter, journal haven't been done, yet
2013-03-12 14:16:25 +08:00
harrybomrah 8e369fe819 tinyscrollbar pagination fixed 2013-03-12 11:42:17 +08:00
harrybomrah 2b4e53ed1b insert and remove columns 2013-03-12 11:42:17 +08:00
harrybomrah 6d194759fa Major tinyscrollbar update 2013-03-12 11:42:16 +08:00
Rueshyna d20081157a modify translation for journal_co_author_relation button 2013-03-12 11:22:11 +08:00
harrybomrah e88487bc9f tinyscrollbar pagination fixed 2013-03-12 11:18:32 +08:00
Fu Matthew 311d741f92 style for front end 2013-03-11 18:21:17 +08:00
Rueshyna 8e0632236b modify nil of email string and sort 2013-03-11 17:21:02 +08:00
Rueshyna 78abcac1cb remove redundant space of co_author sample data 2013-03-11 17:20:24 +08:00
Rueshyna 385e043809 make index of list can be hightline list when click cancel button 2013-03-11 17:18:58 +08:00
Rueshyna 8d5a2d71b7 fixed author sample data generation and model method 2013-03-11 14:53:21 +08:00
Rueshyna 1880ed11ca add author filter for journal and fix some bug 2013-03-11 10:41:07 +08:00
Rueshyna 96602842a3 have done conference author filter, journal haven't been done, yet 2013-03-08 19:16:01 +08:00
harrybomrah ca64cba9ad updated 2013-03-08 12:54:58 +08:00
harrybomrah 4f64ff3568 insert and remove columns 2013-03-08 12:23:15 +08:00
devin a22c0c46e0 tinyscrollbar css minor update 2013-03-08 12:23:15 +08:00
harrybomrah 196030b4b4 Major tinyscrollbar update 2013-03-08 12:23:15 +08:00
Rueshyna 75a5e74bc0 add pagination for personal plugin 2013-03-08 12:01:13 +08:00
harrybomrah 39a20f6cc9 Merge branch 'desktop_work' into desktop_work_devin 2013-03-07 19:16:41 +08:00
harrybomrah 32d56232bc insert and remove columns 2013-03-07 19:15:30 +08:00
devin b7beadfc04 tinyscrollbar css minor update 2013-03-07 17:44:02 +08:00
Fu Matthew e53ad9f5d1 1.make module app forbid unearthed access except from admin
2.override sidebar link when it's object_auth or app_auth.
2013-03-07 16:51:47 +08:00
Rueshyna b2cbcf6629 fixed bug 2013-03-07 10:50:43 +08:00
harrybomrah 906e522a6a Major tinyscrollbar update 2013-03-06 19:04:33 +08:00
Fu Matthew 4f7928ad1b Merge branch 'development' of github.com:Rulingcom/orbit into development 2013-03-06 15:17:06 +08:00
Fu Matthew 77c7053bf1 put add admin pages using orbit back end controller 2013-03-06 15:16:20 +08:00
harrybomrah 20ac4f1ac0 all none for conf done 2013-03-06 12:08:08 +08:00
harrybomrah 9931eb7f61 all none fixed 2013-03-06 11:32:53 +08:00
421 changed files with 1895 additions and 5645 deletions

No files matched your search

-1
View File
@@ -26,7 +26,6 @@ gem "mongo_session_store-rails3", '3.0.6'
gem 'nokogiri' gem 'nokogiri'
gem 'fb_graph' gem 'fb_graph'
gem 'rack-gridfs'
gem 'radius' gem 'radius'
gem 'rake' gem 'rake'
# gem 'remotipart' # gem 'remotipart'
-5
View File
@@ -194,10 +194,6 @@ GEM
rack (1.4.5) rack (1.4.5)
rack-cache (1.2) rack-cache (1.2)
rack (>= 0.4) rack (>= 0.4)
rack-gridfs (0.4.1)
mime-types
mongo (~> 1.2)
rack
rack-oauth2 (1.0.0) rack-oauth2 (1.0.0)
activesupport (>= 2.3) activesupport (>= 2.3)
attr_required (>= 0.0.5) attr_required (>= 0.0.5)
@@ -377,7 +373,6 @@ DEPENDENCIES
pry-debugger pry-debugger
pry-remote pry-remote
pry-stack_explorer pry-stack_explorer
rack-gridfs
radius radius
rails (~> 3.2.9) rails (~> 3.2.9)
rake 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_option,.select_all').removeAttr('disabled');
$(".select_all:checked").each(function( obj ) { $(".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'); $(this).parent().siblings('label').find('.select_option').removeAttr('checked');
}); });
$(".select_option:checked").each(function( obj ) { $(".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'); $(this).parent().siblings('label').find('.select_all').removeAttr('checked');
}); });
} }
File diff suppressed because it is too large. Load diff
+48 -5
View File
@@ -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(){ $(document).ready(function(){
bindTreeDragHandle(); 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() } ); $.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) { @mixin font-main($font-size) {
font-family: "Source Sans Pro", sans-serif; font-family: "Source Sans Pro", sans-serif;
font-size: #{$font-size}px; font-size: #{$font-size}px;
font-weight: 300;
} }
@mixin font-sub($font-size) { @mixin font-sub($font-size) {
font-family: "Source Sans Pro", Arial, sans-serif; font-family: "Source Sans Pro", Arial, sans-serif;
font-size: #{$font-size}px; font-size: #{$font-size}px;
font-weight: 300;
} }
@mixin transition-type($property, $sec) { @mixin transition-type($property, $sec) {
-webkit-transition: #{$property} #{$sec}s ease; -webkit-transition: #{$property} #{$sec}s ease;
@@ -93,20 +93,9 @@
left: 0; left: 0;
top: 60px; top: 60px;
font-size: 15px; font-size: 15px;
width: 120px; 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 */ }
.sdm_o li { .sdm_o li {
border-top: solid 1px #f7f7f7; } border-top: solid 1px #f2f2f2; }
.sdm_o li:first-child { .sdm_o li:first-child {
border: none; } border: none; }
.sdm_o a { .sdm_o a {
@@ -162,7 +151,7 @@
font-size: 15px; } font-size: 15px; }
.s_form label { .s_form label {
font-size: 13px; font-size: 13px;
font-weight: bold; font-weight: normal;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
width: 100px; width: 100px;
@@ -260,7 +249,8 @@
display: inline-block; display: inline-block;
vertical-align: top; } vertical-align: top; }
.toolbar .sdm_o { .toolbar .sdm_o {
top: 36px; } top: 36px;
background-color: #f0f0f0; }
.toolbar button { .toolbar button {
border: none; border: none;
outline: none; outline: none;
@@ -59,11 +59,9 @@
top: 60px; top: 60px;
font-size: 15px; font-size: 15px;
width: 120px; width: 120px;
border: solid 2px $gray;
@include box-sizing;
li { li {
border-top: solid 1px lighten( $gray, 10% ); border-top: solid 1px #f2f2f2;
} }
li:first-child { li:first-child {
border: none; border: none;
@@ -92,7 +90,7 @@
line-height: 36px; line-height: 36px;
li { li {
border-top: solid 1px $gray; border-top: solid 1px #ddd;
} }
li:first-child { li:first-child {
border: none; border: none;
@@ -135,7 +133,7 @@
// basic style // basic style
label { label {
font-size: 13px; font-size: 13px;
font-weight: bold; font-weight: normal;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
width: 100px; width: 100px;
@@ -241,6 +239,7 @@
} }
.sdm_o { .sdm_o {
top: 36px; top: 36px;
background-color: #f0f0f0;
} }
button { button {
border: none; border: none;
+19 -13
View File
@@ -54,6 +54,7 @@ table {
body { body {
font-family: "Source Sans Pro", sans-serif; font-family: "Source Sans Pro", sans-serif;
font-size: 12px; font-size: 12px;
font-weight: 300;
background-color: #000; } background-color: #000; }
a, a:hover { a, a:hover {
@@ -73,7 +74,8 @@ a:focus {
clear: both; } clear: both; }
.o-loading { .o-loading {
font-size: 13px; } font-size: 13px;
font-weight: normal; }
.fullsize .o-loading { .fullsize .o-loading {
padding: 12px; } padding: 12px; }
.o-loading i { .o-loading i {
@@ -295,7 +297,7 @@ a:focus {
.fn_des.admtxt { .fn_des.admtxt {
line-height: 60px; line-height: 60px;
padding: 0 12px; padding: 0 6px;
font-size: 15px; font-size: 15px;
position: absolute; position: absolute;
z-index: 9; z-index: 9;
@@ -334,7 +336,8 @@ a:focus {
.section_label li { .section_label li {
font-size: 15px; } font-size: 15px; }
.section_label li:first-child { .section_label li:first-child {
font-size: 18px; } font-size: 18px;
font-weight: normal; }
/* panel */ /* panel */
#panel_l { #panel_l {
@@ -369,7 +372,8 @@ a:focus {
#orbitnote .note_holder .note_message { #orbitnote .note_holder .note_message {
color: #333; color: #333;
margin: 10px 0 0 48px; margin: 10px 0 0 48px;
font-size: 15px; } font-size: 15px;
font-weight: normal; }
/* Desktop Dialogue */ /* Desktop Dialogue */
#orbitdiag { #orbitdiag {
@@ -400,6 +404,7 @@ a:focus {
margin: 0 6px; margin: 0 6px;
text-align: center; text-align: center;
font-size: 15px; font-size: 15px;
font-weight: normal;
line-height: 36px; } line-height: 36px; }
#orbitdiag .diag_holder .diag_holder_inner .diag_btn:hover { #orbitdiag .diag_holder .diag_holder_inner .diag_btn:hover {
outline: solid 2px white; } outline: solid 2px white; }
@@ -416,12 +421,12 @@ a:focus {
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 0; bottom: 0;
z-index: 3; z-index: 3; }
white-space: nowrap; }
[data-sizex="1"] .appname, .w1.h1 .appname { [data-sizex="1"] .appname, .w1.h1 .appname {
text-align: center; } text-align: center; }
[data-sizey="2"] .appname { [data-sizey="2"] .appname {
font-size: 21px; } font-size: 21px;
font-weight: normal; }
.hh2 .appname { .hh2 .appname {
position: relative; position: relative;
width: auto; width: auto;
@@ -464,6 +469,8 @@ a:focus {
margin: 0 12px 0 0; margin: 0 12px 0 0;
position: relative; position: relative;
z-index: 9; } z-index: 9; }
.dtitle .sdm_o {
width: auto; }
.tile { .tile {
display: block; display: block;
@@ -473,12 +480,8 @@ a:focus {
left: 0; left: 0;
top: 0; } top: 0; }
.gridster ul {
margin: -6px 0 0 -6px; }
.widget.gs_w { .widget.gs_w {
cursor: move; cursor: move; }
overflow: hidden; }
/* header drop menu */ /* header drop menu */
.sdm_mdr .sdm_o { .sdm_mdr .sdm_o {
@@ -530,6 +533,7 @@ a:focus {
.s_title { .s_title {
font-size: 21px; font-size: 21px;
font-weight: normal;
line-height: 60px; line-height: 60px;
text-align: left; } text-align: left; }
.s_title.size_large { .s_title.size_large {
@@ -555,6 +559,7 @@ a:focus {
display: block; display: block;
float: right; float: right;
font-size: 15px; font-size: 15px;
font-weight: normal;
line-height: 36px; line-height: 36px;
text-align: center; text-align: center;
border: 0; } border: 0; }
@@ -610,7 +615,8 @@ a:focus {
.list_t_title { .list_t_title {
margin-bottom: 6px; margin-bottom: 6px;
color: #333; color: #333;
font-size: 15px; } font-size: 15px;
font-weight: normal; }
.list_t_des { .list_t_des {
line-height: 1.5em; line-height: 1.5em;
@@ -70,7 +70,7 @@ a:focus { outline: none; }
} }
.o-loading { .o-loading {
font-size: 13px; font-size: 13px;
// font-weight: normal; font-weight: normal;
.fullsize & { .fullsize & {
padding: 12px; padding: 12px;
@@ -231,7 +231,7 @@ a:focus { outline: none; }
} }
.fn_des.admtxt { .fn_des.admtxt {
line-height: 60px; line-height: 60px;
padding: 0 12px; padding: 0 6px;
font-size: 15px; font-size: 15px;
position: absolute; position: absolute;
z-index: 9; z-index: 9;
@@ -277,9 +277,10 @@ a:focus { outline: none; }
} }
li:first-child { li:first-child {
font-size: 18px; font-size: 18px;
// font-weight: normal; font-weight: normal;
} }
} }
/* panel */ /* panel */
#panel_l { #panel_l {
background-color: #f0f0f0; background-color: #f0f0f0;
@@ -320,7 +321,7 @@ a:focus { outline: none; }
color: #333; color: #333;
margin: 10px 0 0 48px; margin: 10px 0 0 48px;
font-size: 15px; font-size: 15px;
// font-weight: normal; font-weight: normal;
} }
} }
} }
@@ -360,7 +361,7 @@ a:focus { outline: none; }
margin: 0 6px; margin: 0 6px;
text-align: center; text-align: center;
font-size: 15px; font-size: 15px;
// font-weight: normal; font-weight: normal;
line-height: 36px; line-height: 36px;
&:hover { &:hover {
@@ -385,7 +386,6 @@ a:focus { outline: none; }
left: 0; left: 0;
bottom: 0; bottom: 0;
z-index: 3; z-index: 3;
white-space: nowrap;
[data-sizex="1"] &, [data-sizex="1"] &,
.w1.h1 & { .w1.h1 & {
@@ -393,7 +393,7 @@ a:focus { outline: none; }
} }
[data-sizey="2"] & { [data-sizey="2"] & {
font-size: 21px; font-size: 21px;
// font-weight: normal; font-weight: normal;
} }
.hh2 & { .hh2 & {
position: relative; position: relative;
@@ -421,6 +421,8 @@ a:focus { outline: none; }
margin-right: 6px; margin-right: 6px;
} }
} }
.appholder { .appholder {
position: relative; position: relative;
z-index: 2; z-index: 2;
@@ -444,6 +446,10 @@ a:focus { outline: none; }
margin: 0 12px 0 0; margin: 0 12px 0 0;
position: relative; position: relative;
z-index: 9; z-index: 9;
.sdm_o {
width: auto;
}
} }
.tile { .tile {
display: block; display: block;
@@ -453,18 +459,9 @@ a:focus { outline: none; }
left: 0; left: 0;
top: 0; top: 0;
} }
.gridster ul {
margin: -6px 0 0 -6px;
}
.widget.gs_w { .widget.gs_w {
cursor: move; 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 */ /* header drop menu */
.sdm_mdr .sdm_o { top: 36px; } .sdm_mdr .sdm_o { top: 36px; }
@@ -523,7 +520,7 @@ a:focus { outline: none; }
.s_title { .s_title {
font-size: 21px; font-size: 21px;
// font-weight: normal; font-weight: normal;
line-height: 60px; line-height: 60px;
text-align: left; text-align: left;
@@ -552,7 +549,7 @@ a:focus { outline: none; }
display: block; display: block;
float: right; float: right;
font-size: 15px; font-size: 15px;
// font-weight: normal; font-weight: normal;
line-height: 36px; line-height: 36px;
text-align: center; text-align: center;
border: 0; border: 0;
@@ -601,7 +598,7 @@ a:focus { outline: none; }
margin-bottom: 6px; margin-bottom: 6px;
color: #333; color: #333;
font-size: 15px; font-size: 15px;
// font-weight: normal; font-weight: normal;
} }
.list_t_des { .list_t_des {
line-height: 1.5em; line-height: 1.5em;
@@ -86,12 +86,15 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
top: 100%; top: 100%;
background-color: #fff; background-color: #dddddd;
color: #000; color: #000;
border: 2px solid #dddddd; } border: 1px solid #dddddd;
border-top: 0; }
.select2-drop.select2-drop-above { .select2-drop.select2-drop-above {
margin-top: 1px; } margin-top: 1px;
border-top: 1px solid #dddddd;
border-bottom: 0; }
.select2-container .select2-choice div { .select2-container .select2-choice div {
display: block; display: block;
@@ -168,6 +171,8 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
/* results */ /* results */
.select2-results { .select2-results {
max-height: 200px; max-height: 200px;
padding: 0 0 0 4px;
margin: 4px 4px 4px 0;
font-size: 13px; font-size: 13px;
position: relative; position: relative;
overflow-x: hidden; overflow-x: hidden;
@@ -201,16 +206,13 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
.select2-results li { .select2-results li {
list-style: none; list-style: none;
display: list-item; display: list-item;
background-image: none; background-image: none; }
border-top: solid 1px #f7f7f7; }
.select2-results li :first-child {
border-top: 0; }
.select2-results li.select2-result-with-children > .select2-result-label { .select2-results li.select2-result-with-children > .select2-result-label {
font-weight: bold; } font-weight: bold; }
.select2-results .select2-result-label { .select2-results .select2-result-label {
padding: 6px; padding: 4px 6px;
margin: 0; margin: 0;
cursor: pointer; cursor: pointer;
-webkit-touch-callout: none; -webkit-touch-callout: none;
@@ -86,16 +86,16 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
top: 100%; top: 100%;
background-color: #fff; background-color: $gray;
color: #000; color: #000;
border: 2px solid $gray; border: 1px solid $gray;
// border-top: 0; border-top: 0;
} }
.select2-drop.select2-drop-above { .select2-drop.select2-drop-above {
margin-top: 1px; margin-top: 1px;
// border-top: 1px solid $gray; border-top: 1px solid $gray;
// border-bottom: 0; border-bottom: 0;
} }
.select2-container .select2-choice div { .select2-container .select2-choice div {
@@ -180,8 +180,8 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
/* results */ /* results */
.select2-results { .select2-results {
max-height: 200px; max-height: 200px;
// padding: 0 0 0 4px; padding: 0 0 0 4px;
// margin: 4px 4px 4px 0; margin: 4px 4px 4px 0;
font-size: 13px; font-size: 13px;
position: relative; position: relative;
overflow-x: hidden; overflow-x: hidden;
@@ -205,11 +205,6 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
list-style: none; list-style: none;
display: list-item; display: list-item;
background-image: none; 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 { .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 { .select2-results .select2-result-label {
padding: 6px; padding: 4px 6px;
margin: 0; margin: 0;
cursor: pointer; cursor: pointer;
@@ -5,9 +5,8 @@ class Admin::DashboardsController < OrbitBackendController
# before_filter :is_admin? # before_filter :is_admin?
def index def index
check_backend_openness @module_app_contents, @module_app_contents_total = get_module_app_count('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')
@recent_updated = get_recently_updated('bulletin', 'page_context', 'web_link')
@most_visited = get_most_visited('bulletin', 'page_context') @most_visited = get_most_visited('bulletin', 'page_context')
end end
+72 -57
View File
@@ -1,6 +1,7 @@
class Admin::PagePartsController < OrbitBackendController class Admin::PagePartsController < OrbitBackendController
include Admin::FrontendWidgetInterface
layout "site_editor" layout "site_editor"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? before_filter :is_admin?
before_filter :set_current_item before_filter :set_current_item
@@ -17,75 +18,59 @@ class Admin::PagePartsController < OrbitBackendController
end end
end end
def new
end
def edit def edit
@part = PagePart.find(params[:id]) @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 @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 @tag_objects = @r_tag.classify.constantize.all rescue nil
@module_apps = ModuleApp.for_widget_select if @module_app
@categories = nil @widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0]
@tags = nil @widget_style = @module_app.get_widget_style[@widget_path][:style] unless @widget_path.nil? or @module_app.nil?
@page_frontend_data_counts = nil end
# @frontend_styles = nil
@selected={ unless @module_app.nil?
:module_app=> @part.module_app ? @part.module_app : nil, @categories = @module_app.get_categories
:app_frontend_url=> @part.widget_path || "default_widget", #@module_apps.first @tags = @module_app.get_tags
:category=>nil, #fetch by method: get_categories_and_tags end
:tag=>nil, #fetch by method: get_categories_and_tags
:page_frontend_data_count=>nil, @widget_path = @part.widget_path ? @part.widget_path : (@module_app.widgets.keys[0] rescue nil)
:frontend_style => nil,
:widget_path=> 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 end
def reload_widgets def create
@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 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 end
def update def update
@part = PagePart.find(params[:id]) @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? # 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]) 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 ) redirect_to admin_items_url( :parent_id => @item.parent_id )
end 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 def reload_r_tag_options
@part = PagePart.find params[:id] @part = PagePart.find params[:id]
@r_tag = params[:type] @r_tag = params[:type]
@@ -126,11 +146,6 @@ class Admin::PagePartsController < OrbitBackendController
end end
protected 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) def set_children_sub_menu(part)
part.page.children.each do |child| part.page.children.each do |child|
+100 -127
View File
@@ -1,6 +1,5 @@
class Admin::PagesController < Admin::ItemsController class Admin::PagesController < Admin::ItemsController
helper Admin::PagePartsHelper helper Admin::PagePartsHelper
include Admin::FrontendWidgetInterface
def show def show
@item = Page.find(params[:id]) @item = Page.find(params[:id])
respond_to do |format| respond_to do |format|
@@ -14,123 +13,40 @@ include Admin::FrontendWidgetInterface
def new def new
@item = Page.new @item = Page.new
@item.parent = Item.find(params[:parent_id]) rescue nil @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 @designs = Design.all.entries
@themes = Design.first.themes @design = Design.first
@module_apps = ModuleApp.for_frontend_select
@app_frontend_urls = nil
@categories = nil
@tags = nil
@page_frontend_data_counts = nil
@frontend_styles = nil
@selected={
:design => @designs.first,
:theme=> @themes.first,
:module_app=>nil,#@module_apps.first
:app_frontend_url=> nil, #@module_apps.first
:category=>nil,
:tag=>nil,
:page_frontend_data_count=>nil,
:frontend_style => nil
}
end end
def edit def edit
@item = Page.find(params[:id]) @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 @designs = Design.all.entries
@themes = @item.design ? @item.design.themes : @designs.first.themes @design = @item.design ? @item.design : @designs.first
@module_apps = ModuleApp.for_frontend_select
@categories = nil
@tags = nil
@page_frontend_data_counts = nil
@frontend_styles = nil
@selected={ if @item.module_app
:design => @item.design || @designs.first, @app_frontend_urls = []
:theme=> @item.theme, setup_app_frontend_and_style
:module_app=>@item.module_app,#@module_apps.first @app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if @item.module_app.has_default_widget?
: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
def reload_themes @module_app = @item.module_app
design = Design.find(params[:design_id]) @frontend_path = @item.app_frontend_url
@themes = design.themes
respond_to do |format| if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array}
format.js {} @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
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 def create
clean_tags_and_category_params
@item = Page.new(params[:page]) @item = Page.new(params[:page])
if @item.module_app && @item.module_app.key == 'page_content' if @item.module_app && @item.module_app.key == 'page_content'
@@ -147,34 +63,36 @@ include Admin::FrontendWidgetInterface
end end
else else
flash.now[:error] = t('create.error.page') flash.now[:error] = t('create.error.page')
@apps = ModuleApp.where(:key.in => OrbitApp::Module::FrontendUtility.all.keys)
@designs = Design.all.entries @designs = Design.all.entries
@design = Design.find(params[:page][:design]) || Design.first @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
render :action => "new" render :action => "new"
end end
end end
def update def update
clean_tags_and_category_params
@item = Page.find(params[:id]) @item = Page.find(params[:id])
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank? 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 ) @item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
end 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]) if @item.update_attributes(params[:page])
flash[:notice] = t('update.success.page') flash[:notice] = t('update.success.page')
respond_to do |format| respond_to do |format|
@@ -208,10 +126,65 @@ include Admin::FrontendWidgetInterface
end end
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 @app_frontend_urls = @module_app.nil? ? nil : @module_app.app_pages.each{|name,data| [I18n.t(data["i18n"]),name]}
has_old_value = @selected[:module_app].app_pages[@selected[:app_frontend_url]] @frontend_styles = @module_app.app_pages[params["frontend"]]["style"] rescue nil
@frontend_styles = has_old_value ? has_old_value["style"] : (@selected[:module_app].app_pages.first[1]["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 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 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
+37 -35
View File
@@ -17,34 +17,35 @@ class Admin::RolesController < OrbitBackendController
def role_field def role_field
@field_name = 'role' @field_name = 'role'
@attribute = Role.find(params[:role_id]) @attribute = Role.find(params[:role_id])
end end
def sub_role def sub_role
@attribute = Role.find(params[:role_id]) @attribute = Role.find(params[:role_id])
@attribute_fields_upper_object = @attribute.sub_roles @attribute_fields_upper_object = @attribute.sub_roles
end end
def add_sub_role def add_sub_role
@attribute = Role.find(params[:role_id]) @attribute = Role.find(params[:role_id])
# @sub_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] @sub_attribute.role_id = params[:role_id]
end end
def edit_sub_role 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 @sub_attribute.role_id = @sub_attribute.role_id
@@ -54,52 +55,53 @@ class Admin::RolesController < OrbitBackendController
@field_name = 'sub_role' @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 end
def add_attribute_field 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 = SubRole.find(params[:sub_role][:id]) rescue nil
@attribute_field_counter = attribute.attribute_fields.count @attribute_field_counter = attribute.attribute_fields.count
@attribute_field = attribute.attribute_fields.build @attribute_field = attribute.attribute_fields.build
@attribute_field.save @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 = Role.find(params[:role_id]) rescue nil
@attribute_field_counter = attribute.attribute_fields.count @attribute_field_counter = attribute.attribute_fields.count
@attribute_field = attribute.attribute_fields.build @attribute_field = attribute.attribute_fields.build
@attribute_field.save @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' } format.js { render 'add_attribute_field' }
end end
end end
def new def new
@attribute = Role.new @attribute = Role.new
if !params[:parent_id] if !params[:parent_id]
render :template => 'admin/attributes/new' render :template => 'admin/attributes/new'
end end
@@ -163,17 +165,17 @@ class Admin::RolesController < OrbitBackendController
def destroy 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| respond_to do |format|
if @sub_role.destroy 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
end end
else else
@attribute = Role.find(params[:id]) @attribute = Role.find(params[:id])
@attribute.destroy @attribute.destroy
@@ -14,16 +14,8 @@ class Admin::SitesController < OrbitBackendController
# @site = Site.new # @site = Site.new
# end # 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 def update
@site.update_attributes(params[:site]) @site.update_attributes(params[:site])
site_restart
redirect_to :back redirect_to :back
end end
+19 -5
View File
@@ -2,10 +2,16 @@ class Admin::TagsController < OrbitBackendController
before_filter :force_order_for_visitor,:only=>[:index] before_filter :force_order_for_visitor,:only=>[:index]
before_filter :force_order_for_user,:except => [:index] before_filter :force_order_for_user,:except => [:index]
before_filter :for_app_sub_manager,: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 # before_filter :set_module_app
def index def index
@tags = get_tags get_tags
@module_app_id = @module_app.id rescue nil
end end
def new def new
@@ -17,7 +23,12 @@ class Admin::TagsController < OrbitBackendController
end end
def create 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 end
def update def update
@@ -36,12 +47,15 @@ class Admin::TagsController < OrbitBackendController
protected protected
def get_tags def get_tags
@tags = @module_app.blank? ? Tag.all : @module_app.tags @tags = (@module_app ? @module_app.tags : Tag.all)
end end
def setup_vars def setup_vars
@module_app = ModuleApp.find(params[:module_app_id]) if params[:module_app_id] @app_key = request.env['HTTP_REFERER'].split('/')[4]
@module_app_id = @module_app.id rescue nil if @app_key
@app_key.gsub!(/[?].*/, '')
@module_app = ModuleApp.first(conditions: {:key => @app_key})
end
end end
end end
@@ -1,6 +1,4 @@
class Admin::UsersNewInterfaceController < OrbitBackendController class Admin::UsersNewInterfaceController < OrbitBackendController
helper MemberHelper
layout "new_admin" layout "new_admin"
# before_filter :authenticate_user! # before_filter :authenticate_user!
@@ -25,13 +23,13 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
render case params[:at] render case params[:at]
when 'summary' 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" "index_summary"
when 'thumbnail' 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" "index_thumbnail"
else 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" "index"
end end
end end
@@ -45,7 +43,7 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
@student_data = [] @student_data = []
@staff_data = [] @staff_data = []
attribute_values = @user.attribute_values.asc("_id") attribute_values = @user.attribute_values
attribute_values.each{|att_val| 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 @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 end
def create 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_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
# attribute_values = params[:user].delete(attribute_values_key) # attribute_values = params[:user].delete(attribute_values_key)
@user = User.new(params["user"]) @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| # attribute_values.to_hash.each{|key,value|
# @user.attribute_values.build(value) # @user.attribute_values.build(value)
# } # }
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values) # @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
# binding.pry # binding.pry
if !flash.now[:error] && @user.save if @user.save
flash[:notice] = t('create.success.user') flash[:notice] = t('create.success.user')
redirect_to :action => :index redirect_to :action => :index
else else
@user.attribute_values = nil
@form_index = 0 @form_index = 0
render :action => :new , :notice => flash.now[:error] render :action => :new
end end
end end
@@ -120,46 +110,16 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
@form_index = 0 @form_index = 0
get_info_and_roles get_info_and_roles
end end
def edit_passwd
# @disable_all_field = false
@user = User.find(params[:users_new_interface_id])
end
def update def update
@user = User.find(params[:id]) @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 # # Update changes to the avatar
# @user.remove_avatar! if params[:file] # @user.remove_avatar! if params[:file]
# @user.avatar = params[:file] if params[:file] # @user.avatar = params[:file] if params[:file]
+2 -10
View File
@@ -17,15 +17,7 @@ class ApplicationController < ActionController::Base
helper_attr :site_valid_locales 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 def set_current_user
User.current = current_or_guest_user User.current = current_or_guest_user
@@ -109,10 +101,10 @@ class ApplicationController < ActionController::Base
end end
# Render the page # Render the page
def render_page(args=nil) def render_page
if @item if @item
respond_to do |format| 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.rss { render_main_rss }
format.mobile { redirect_to mobile_path(:app => params[:app]) } format.mobile { redirect_to mobile_path(:app => params[:app]) }
end end
+3 -11
View File
@@ -36,31 +36,23 @@ class DefaultWidgetController< OrbitWidgetController
result = eval("#{ori_class_name}.where(:#{get_category_field_name(ori_class_name)}.in=>params['category_id'])") result = eval("#{ori_class_name}.where(:#{get_category_field_name(ori_class_name)}.in=>params['category_id'])")
end end
date_now = Time.now 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 end
def default_widget def default_widget
if !params[:id].blank? if !params[:id].blank?
clicked_field_name = params["clicked_field_name"].to_sym redirect_to eval("#{@page_part.module_app.widget_fields_link_method[:title][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
else else
@tag_class = nil @tag_class = nil
@default_widget = @page_part.module_app.get_default_widget @default_widget = @page_part.module_app.get_default_widget
@widget_image_field = @default_widget["image"] || @default_widget[:image] @widget_image_field = @default_widget["image"] || @default_widget[:image]
case @page_part case @page_part
when Page when Page
@frontend_field_names = @page_part.frontend_field_name @fields = @page_part.frontend_field
@frontend_classes = @page_part.frontend_class
@frontend_sat_to_links = @page_part.frontend_sat_to_link
@data_limit = @page_part.frontend_data_count.is_a?(Fixnum) ? @page_part.frontend_data_count : (@page_part.frontend_data_count.to_i rescue 3) @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 @paginate = true
@page_id = @page_part.id @page_id = @page_part.id
when PagePart 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 @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) @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 end
@@ -1,7 +1,6 @@
class OrbitBackendController < ApplicationController class OrbitBackendController < ApplicationController
include OrbitCoreLib::AppBackendUtility include OrbitCoreLib::AppBackendUtility
include OrbitCoreLib::PermissionUtility include OrbitCoreLib::PermissionUtility
include OrbitTag::Tagging
include AdminHelper include AdminHelper
include ApplicationHelper include ApplicationHelper
@@ -16,7 +15,6 @@ class OrbitBackendController < ApplicationController
private private
def force_order_for_visitor def force_order_for_visitor
check_backend_openness
setup_vars setup_vars
set_current_user set_current_user
end end
@@ -61,20 +59,6 @@ class OrbitBackendController < ApplicationController
when :referenced_in when :referenced_in
objects = get_objects_from_referenced_objects(object_class.relations[option].class_name.constantize, objects, "#{option}_id") objects = get_objects_from_referenced_objects(object_class.relations[option].class_name.constantize, objects, "#{option}_id")
end 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 end
end end
+2 -14
View File
@@ -1,15 +1,8 @@
class PagesController < ApplicationController class PagesController < ApplicationController
include ApplicationHelper include ApplicationHelper
before_filter :get_item, :only => [:index_from_link, :show_from_link] before_filter :get_item, :only => [:index_from_link, :show_from_link]
before_filter :check_frontend_open, :only => [:index,:show]
# caches_page :index # caches_page :index
def check_frontend_open
if Me.frontend_closed
redirect_to '/admin/dashboards'
end
end
def index def index
@item = Page.find_by_name('home') @item = Page.find_by_name('home')
@@ -21,18 +14,14 @@ class PagesController < ApplicationController
end end
end end
def show def show
#begin #begin
@item = Item.first(:conditions => {:path => params[:page_name]}) @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)) if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s))
impressionist(@item) impressionist(@item)
case @item.class.to_s case @item.class.to_s
when 'Page' when 'Page'
if params[:clicked_field_name] render_page unless save_from_no_lang_for_page
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
when 'Link' when 'Link'
redirect_to(@item[:url]) unless save_from_no_lang_for_page redirect_to(@item[:url]) unless save_from_no_lang_for_page
end end
@@ -65,7 +54,6 @@ class PagesController < ApplicationController
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank? 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? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].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 redirect_to(url + options) unless save_from_no_lang_for_page
end 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
+28 -15
View File
@@ -1,8 +1,7 @@
module Admin::PagePartsHelper module Admin::PagePartsHelper
include Admin::FrontendWidgetInterface
def support_link 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? unless url_method.nil?
res = "Link:" res = "Link:"
res << select_tag( "page_part[widget_field_is_link][]", options_for_select([["NotLink",false],["Link1",url_method]])) 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
end end
def get_widget_field_rel def get_widget_field_rel(local_item=nil)
case set_local_item local_item = @part if local_item.nil? && @part
local_item = @item if local_item.nil? && @item
case local_item
when Page when Page
reload_after_list_changed_admin_pages_path reload_after_list_changed_admin_pages_path
when PagePart when PagePart
@@ -33,7 +34,8 @@ module Admin::PagePartsHelper
unless field_is_checked.nil? and assign_field_name_value.nil? unless field_is_checked.nil? and assign_field_name_value.nil?
origin_field = 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 if origin_field and origin_field[2]==:link #choosen_field_is_link
@@ -49,10 +51,11 @@ module Admin::PagePartsHelper
end end
def widget_field_options(i,local_item=nil) 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| options = @module_app.widget_fields.collect do |widget_field|
label = I18n.t("#{@selected[:module_app].key}.default_widget.#{widget_field[0]}") label = I18n.t("#{@module_app.key}.default_widget.#{widget_field[0]}")
[label, widget_field[0]] [label, widget_field[0]]
end end
case local_item case local_item
@@ -63,9 +66,11 @@ module Admin::PagePartsHelper
end end
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]} 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 case local_item
when Page when Page
options_for_select(options, (local_item.frontend_class[i] if (local_item) )) options_for_select(options, (local_item.frontend_class[i] if (local_item) ))
@@ -110,8 +115,12 @@ module Admin::PagePartsHelper
end end
def nil_checkbox_button(part,tag_or_cate) 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 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 = 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") op << I18n.t("default_widget.no_value")
@@ -119,8 +128,12 @@ module Admin::PagePartsHelper
end end
def nil_radio_button(part,tag_or_cate) 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 content_tag :label,:class=>"radio inline" do
op = radio_button(field_name, tag_or_cate, '' , :checked => eval("#{tag_or_cate}_checked_value(part,'')")) op = radio_button(field_name, tag_or_cate, '' , :checked => eval("#{tag_or_cate}_checked_value(part,'')"))
op << I18n.t("default_widget.no_value") op << I18n.t("default_widget.no_value")
@@ -128,7 +141,7 @@ module Admin::PagePartsHelper
end end
def show_default_widget_setting_panel 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 end
def show_custom_widget_setting_panel def show_custom_widget_setting_panel
+1 -3
View File
@@ -6,9 +6,7 @@ module DefaultWidgetHelper
def link_to_field(row_data,field, switch, options=nil) def link_to_field(row_data,field, switch, options=nil)
method_ary = @page_part.module_app.widget_fields_link_method method_ary = @page_part.module_app.widget_fields_link_method
field = field.to_sym field = field.to_sym
options = options || {} if(method_ary.has_key?(field) and (switch == true))
options[:clicked_field_name] = field
if(method_ary.has_key?(field) and (switch.to_s == "true"))
url = case method_ary[field][:args] url = case method_ary[field][:args]
when nil # no args when nil # no args
get_data_link(method_ary[field][:method], options) get_data_link(method_ary[field][:method], options)
-5
View File
@@ -1,5 +0,0 @@
module MemberHelper
def nl2br(val)
val.gsub(/\r\n/, '<br />').html_safe
end
end
+1 -5
View File
@@ -5,13 +5,9 @@ class BackupServer
#CronMail.time_check("Going to backup Orbit").deliver #CronMail.time_check("Going to backup Orbit").deliver
dbhost = Mongoid.config.database.connection.primary.join ':' dbhost = Mongoid.config.database.connection.primary.join ':'
dbname = Mongoid.config.database.name dbname = Mongoid.config.database.name
archive_db_list_path = OrbitSystemPreference::ArchiveDbListPath
dbdirectory = "#{Rails.root}/tmp/#{dbname}-"+Time.now.strftime("%Y-%m-%d-%H-%M") dbdirectory = "#{Rails.root}/tmp/#{dbname}-"+Time.now.strftime("%Y-%m-%d-%H-%M")
%x[mongodump -h #{dbhost} -d #{dbname} -o #{dbdirectory} ] %x[mongodump -h #{dbhost} -d #{dbname} -o #{dbdirectory} ]
%x[rm #{archive_db_list_path}] # %x[touch #{Rails.root}/tmp/restart]
%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}"
end end
end end
-36
View File
@@ -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
-46
View File
@@ -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
+21
View File
@@ -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
-8
View File
@@ -1,8 +0,0 @@
class RestartServer
@queue = :high
def self.perform()
temp_directory = "#{Rails.root}/tmp/"
%x[touch #{temp_directory}restart.txt ]
end
end
+25
View File
@@ -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
-1
View File
@@ -5,6 +5,5 @@ class UpdateTagCloud
Tag.all.each do |tag| 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)) tag.update_attribute(:cloud_view_count, tag.impressionist_count(:created_at.gte => 14.days.ago, :created_at.lte => Time.now))
end end
OrbitJobLogger.info "UpdateTagCloud Done"
end end
end end
+1 -2
View File
@@ -21,8 +21,7 @@ class Asset
before_save :clean_tags before_save :clean_tags
def sorted_tags def sorted_tags
#tags.order_by(I18n.locale, :asc) tags.order_by(I18n.locale, :asc)
tags
end end
protected protected
+1 -1
View File
@@ -17,7 +17,7 @@ class Item
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/ validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
# validates :name, :exclusion => { :in => LIST[:forbidden_item_names] } # validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
validates_uniqueness_of :name #, :scope => :parent_id validates_uniqueness_of :name, :scope => :parent_id
validates_presence_of :name validates_presence_of :name
validates_associated :parent, :children validates_associated :parent, :children
+8 -16
View File
@@ -8,8 +8,6 @@ class ModuleApp
field :title field :title
field :sidebar_order,type: Integer,default: 0 field :sidebar_order,type: Integer,default: 0
has_many :tags, as: :module_tag, dependent: :destroy
def refetch_setting!(reg) def refetch_setting!(reg)
# %w{module_label category base_url version organization author intro update_info create_date}.each do |field| # %w{module_label category base_url version organization author intro update_info create_date}.each do |field|
# self[field.to_sym] = reg.send field # self[field.to_sym] = reg.send field
@@ -21,17 +19,11 @@ class ModuleApp
self[:widgets] = reg.get_widgets self[:widgets] = reg.get_widgets
end 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? def enable_frontend?
self[:enable_frontend] self[:enable_frontend]
@@ -120,6 +112,10 @@ class ModuleApp
has_one :app_auth,dependent: :delete has_one :app_auth,dependent: :delete
def get_tags
get_registration.get_tags
end
def get_categories def get_categories
get_registration.get_categories get_registration.get_categories
end end
@@ -131,9 +127,5 @@ class ModuleApp
def get_registration def get_registration
OrbitApp::Module::Registration.find_by_key(key) OrbitApp::Module::Registration.find_by_key(key)
end end
def self.find_by_key(key)
self.where(key: key)[0] rescue nil
end
end end
+2 -3
View File
@@ -7,7 +7,7 @@ class Page < Item
field :content, localize: true field :content, localize: true
field :app_frontend_url 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 :category,type: Array, :default => []
field :tag, type: Array,:default => [] field :tag, type: Array,:default => []
field :view_count, :type => Integer, :default => 0 field :view_count, :type => Integer, :default => 0
@@ -21,8 +21,7 @@ class Page < Item
field :frontend_sat_to_link , :type => Array,:default => [] field :frontend_sat_to_link , :type => Array,:default => []
field :frontend_data_count field :frontend_data_count
belongs_to :theme
belongs_to :design belongs_to :design
belongs_to :module_app belongs_to :module_app
has_many :page_parts, :dependent => :destroy has_many :page_parts, :dependent => :destroy
+1 -8
View File
@@ -11,17 +11,10 @@ class Site
field :roaming_id field :roaming_id
field :private_key, :type => Binary field :private_key, :type => Binary
field :public_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 :title_always_on, :type => Boolean, :default => false
field :dashbroad_allow_visitor, :type => Boolean, :default => false field :dashbroad_allow_visitor, :type => Boolean, :default => false
field :mail_settings, :type => Hash field :mail_settings, :type => Hash
field :disk_space, :type => String
field :system_package_info, :type => Hash,:default=>{}
field :school field :school
field :department field :department
+1
View File
@@ -1,3 +1,4 @@
class SubRoleTag < ProtoTag class SubRoleTag < ProtoTag
has_and_belongs_to_many :sub_roles has_and_belongs_to_many :sub_roles
end end
+1 -4
View File
@@ -10,13 +10,10 @@ class Tag
is_impressionable :counter_cache => { :column_name => :view_count } is_impressionable :counter_cache => { :column_name => :view_count }
field :name, localize: true field :key
field :view_count, :type => Integer, :default => 0 field :view_count, :type => Integer, :default => 0
field :cloud_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 #field :cloud_amper,:type: Integer,:default=> 0
def self.sorted_for_cloud def self.sorted_for_cloud
-9
View File
@@ -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
+1 -6
View File
@@ -11,14 +11,9 @@ class Role < Attribute
has_many :sub_roles, :autosave => true, :dependent => :destroy has_many :sub_roles, :autosave => true, :dependent => :destroy
has_many :users 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 :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 :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? def is_built_in?
self.built_in self.built_in
-14
View File
@@ -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
-26
View File
@@ -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
-16
View File
@@ -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
View File
@@ -9,13 +9,7 @@ class User
field :admin, :type => Boolean, :default => true field :admin, :type => Boolean, :default => true
field :active_role field :active_role
field :user_id
field :sid
field :first_name, localize: true
field :last_name, localize: true
field :email field :email
field :sex, :default => 'unknown'
field :office_tel
field :cache_dept,type: Hash field :cache_dept,type: Hash
field :status_record,type: Hash field :status_record,type: Hash
@@ -31,11 +25,9 @@ class User
# has_many :papers, :autosave => true, :dependent => :destroy # has_many :papers, :autosave => true, :dependent => :destroy
has_and_belongs_to_many :sub_role_tags 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 :roles
has_and_belongs_to_many :sub_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 accepts_nested_attributes_for :attribute_values, :allow_destroy => true
before_create :initialize_desktop before_create :initialize_desktop
@@ -44,9 +36,6 @@ class User
scope :remote_account, where(:nccu_id.ne => nil) scope :remote_account, where(:nccu_id.ne => nil)
scope :not_guest_user, all_of(:name.ne => "guest") 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") # validates_uniqueness_of :email,:message=> I18n.t("devise.registrations.email_not_unique")
# def new_attribute_values=(vars) # def new_attribute_values=(vars)
@@ -112,24 +101,6 @@ class User
end end
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) def set_sub_role(sub_role_id,status_id)
@@ -173,17 +144,6 @@ class User
}.uniq! }.uniq!
end 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 def create_dept_cache
dept_hash = {} dept_hash = {}
@@ -210,30 +170,12 @@ class User
(query1 + query2).uniq (query1 + query2).uniq
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 = "#{last_name} #{first_name}"
# if full_name.strip.empty?
# full_name = email
# end
# return full_name
# else
# return nil
# end
# end
def name def name
info = Class::Info.first(:conditions => {:key => 'profile'}) info = Class::Info.first(:conditions => {:key => 'profile'})
if info if info
# first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil 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 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 = "#{last_name} #{first_name}"
full_name = (I18n.locale.to_s == 'zh_tw') ? "#{self.last_name} #{self.first_name}" : "#{self.first_name} #{self.last_name}"
if full_name.strip.empty? if full_name.strip.empty?
full_name = email full_name = email
@@ -269,6 +211,7 @@ class User
self.roles = self.roles.uniq self.roles = self.roles.uniq
end end
def rebuild_status_record def rebuild_status_record
self.status_record = {} self.status_record = {}
self.attribute_values.reject{|t| t.key!='status'}.each do |status| self.attribute_values.reject{|t| t.key!='status'}.each do |status|
+1 -1
View File
@@ -17,7 +17,7 @@
<div class="label-group"> <div class="label-group">
<div class="label-td"> <div class="label-td">
<% asset.sorted_tags.each do |tag| %> <% asset.sorted_tags.each do |tag| %>
<span class="label label-tags"><%= tag.name %></span> <span class="label label-tags"><%= tag[I18n.locale] %></span>
<% end %> <% end %>
</div> </div>
</div> </div>
+1 -1
View File
@@ -25,7 +25,7 @@
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<%= content_tag :label, :class => "checkbox inline" do -%> <%= content_tag :label, :class => "checkbox inline" do -%>
<%= check_box_tag 'asset[tag_ids][]', tag.id, @asset.tag_ids.include?(tag.id) %> <%= 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][]', '' %> <%= hidden_field_tag 'asset[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <% end %>
+1 -1
View File
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% 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 %> <% end %>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %> <%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
+1 -3
View File
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% 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 %> <% end %>
@@ -37,8 +37,6 @@
<% if @attribute_type == 'role' %> <% if @attribute_type == 'role' %>
<li><%= link_to t(:role_field), eval("admin_#{@attribute_type}_role_field_path(attribute)") %></li> <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(: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 %> <% 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(: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> <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>
+1 -1
View File
@@ -40,7 +40,7 @@
</div> </div>
</div> </div>
<!-- <div class="item element"> <!-- <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"> <div class="detail w-a h-a">
<p class="totle"><span><%= t(:all_member) %></span>2,217</p> <p class="totle"><span><%= t(:all_member) %></span>2,217</p>
<table class="table table-striped"> <table class="table table-striped">
@@ -2,14 +2,5 @@
<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %> <%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %>
</ol> </ol>
<script type="text/javascript"> <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(); bindTreeDragHandle();
</script> </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") %> <%= t("default_widget.select_widget_style") %>
</label> </label>
<div class="controls well"> <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")%> <%= t("default_widget.no_support_setting")%>
<%else%> <%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 %> <% end %>
</div> </div>
</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"> <div class="style_switch control-group">
<label class="control-label"><%= t("default_widget.select_widget_ext_option") %></label> <label class="control-label"><%= t("default_widget.select_widget_ext_option") %></label>
<div class="controls well" > <div class="controls well" >
@@ -27,14 +27,14 @@
<span class="span5"></span> <span class="span5"></span>
</div> </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"> <div class="rows clear">
<span class="span4"> <span class="span4">
<%= i+1 %> <%= 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%> <%= 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>
<span class="span3"> <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>
<span class="span5 link_switch_holder"> <span class="span5 link_switch_holder">
<%= link_to_field_switch(i,object_name,field_name) %> <%= link_to_field_switch(i,object_name,field_name) %>
@@ -5,13 +5,14 @@
<% when PagePart %> <% when PagePart %>
<% field_name = "page_part[widget_style]" %> <% field_name = "page_part[widget_style]" %>
<% end %> <% end %>
<div class="style_switch control-group"> <div class="style_switch control-group">
<label class="control-label"> <label class="control-label">
<%= t("default_widget.select_widget_style") %> <%= t("default_widget.select_widget_style") %>
</label> </label>
<div class="controls well"> <div class="controls well">
<ul class="clear"> <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> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag field_name,"typeA",style_checked_value(object,"typeA") %> <%= radio_button_tag field_name,"typeA",style_checked_value(object,"typeA") %>
@@ -22,7 +23,7 @@
</li> </li>
<% end %> <% 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> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag field_name,"typeB_style2",style_checked_value(object,"typeB_style2") %> <%= radio_button_tag field_name,"typeB_style2",style_checked_value(object,"typeB_style2") %>
@@ -32,7 +33,7 @@
</label> </label>
</li> </li>
<% end %> <% 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> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag field_name,"typeB_style3",style_checked_value(object,"typeB_style3") %> <%= radio_button_tag field_name,"typeB_style3",style_checked_value(object,"typeB_style3") %>
@@ -42,7 +43,7 @@
</label> </label>
</li> </li>
<% end %> <% 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> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag field_name,"typeB_style4",style_checked_value(object,"typeB_style4") %> <%= radio_button_tag field_name,"typeB_style4",style_checked_value(object,"typeB_style4") %>
@@ -52,7 +53,7 @@
</label> </label>
</li> </li>
<% end %> <% end %>
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeC") %> <% if @module_app.get_default_widget["enabled_styles"].include?("typeC") %>
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag field_name,"typeC",style_checked_value(object,"typeC") %> <%= radio_button_tag field_name,"typeC",style_checked_value(object,"typeC") %>
+2 -3
View File
@@ -19,6 +19,5 @@
</div> </div>
<% end %> <% end %>
<%=javascript_include_tag "inc/update_cates_and_tags.js" %> <%=javascript_include_tag "inc/update_cates_and_tags.js" %>
<%= javascript_include_tag "inc/page_widget_edit_interface.js" %>
@@ -17,7 +17,7 @@
<%= t "default_widget.select_module_app" %> <%= t "default_widget.select_module_app" %>
</label> </label>
<div class="controls"> <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>
</div> </div>
@@ -26,8 +26,7 @@
<%= t "default_widget.select_widget_path" %> <%= t "default_widget.select_widget_path" %>
</label> </label>
<div class="controls"> <div class="controls">
<%#= @module_app ? @module_app.widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} %> <%= 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 } %>
<%= f.select :widget_path, @app_frontend_urls , {}, { :selected => @selected[:app_frontend_url], :rel => get_widget_field_rel } %>
</div> </div>
</div> </div>
@@ -13,7 +13,7 @@
<%= nil_checkbox_button(object,:tag) %> <%= nil_checkbox_button(object,:tag) %>
<%= content_tag_for(:label, @tags,:class=>"radio inline") do |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' ) %> <%= 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%> <% end if @tags%>
</fieldset> </fieldset>
<% else %> <% else %>
@@ -1,7 +1,4 @@
<% if (not(@selected[:module_app].widget_options(@selected[:app_frontend_url]).blank?) and @selected[:app_frontend_url]!='default_widget')%> <% @module_app.widget_options(@widget_path).get_options.each do |key,settings| %>
<% @selected[:module_app].widget_options(@selected[:app_frontend_url]).get_options.each do |key,settings| %>
<% options = settings[:opts] %> <% options = settings[:opts] %>
<%= label_tag(t(settings[:label_i18n]))%> <%= label_tag(t(settings[:label_i18n]))%>
<% case options%> <% case options%>
@@ -15,4 +12,3 @@
<% end %> <% end %>
<% end %>
+4
View File
@@ -2,4 +2,8 @@
<%= render 'admin/items/site_map_left_bar' %> <%= render 'admin/items/site_map_left_bar' %>
<% end -%> <% end -%>
<%= render 'edit' %> <%= 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]%> <% if @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]) %>"); $('#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_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} %>"); $("#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 } %>"); $("#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 @part %>
<% if show_default_widget_setting_panel %> <% 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} %>"); $('#widget_setting').append("<%= j render :partial => 'default_widget_setting',:locals=>{:object=>@part} %>");
<% elsif show_custom_widget_setting_panel %> <% elsif show_custom_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>"); $('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
@@ -4,7 +4,7 @@
</label> </label>
<div class="controls well"> <div class="controls well">
<% if @frontend_styles%> <% if @frontend_styles%>
<%= select('page', 'frontend_style', @frontend_styles,{:selected => @selected[:frontend_style]}) %> <%= select('page', 'frontend_style', @frontend_styles) %>
<% else %> <% else %>
<%= t("default_widget.no_support_setting")%> <%= t("default_widget.no_support_setting")%>
<% end %> <% end %>
@@ -2,5 +2,5 @@
<%= t("default_widget.widget_data_count") %> <%= t("default_widget.widget_data_count") %>
</label> </label>
<div class="controls"> <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> </div>
+8 -9
View File
@@ -1,13 +1,13 @@
<%= f.error_messages %> <%= f.error_messages %>
<%= f.hidden_field :parent, :value => (@item.parent.id rescue nil) %> <%= f.hidden_field :parent, :value => (@item.parent.id rescue nil) %>
<%= f.hidden_field :id, :value => (@item.id),:id=>"object_id" %>
<div class="control-group"> <div class="control-group">
<%= f.label :name, '*'+t(:name), :class => 'control-label' %> <%= f.label :name, '*'+t(:name), :class => 'control-label' %>
<div class="controls"> <div class="controls">
<%= f.text_field :name, :class => 'text input-xlarge' %> <%= 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> --> <!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div> </div>
</div> </div>
@@ -27,14 +27,14 @@
<div class="control-group"> <div class="control-group">
<%= f.label :name, t(:template_name), :class => 'control-label' %> <%= f.label :name, t(:template_name), :class => 'control-label' %>
<div class="controls"> <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> --> <!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<%= f.label :name, t(:theme), :class => 'control-label' %> <%= f.label :name, t(:theme), :class => 'control-label' %>
<div class="controls"> <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> --> <!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div> </div>
</div> </div>
@@ -42,14 +42,14 @@
<div class="control-group" id="module_app_list"> <div class="control-group" id="module_app_list">
<%= f.label '',t("default_widget.select_module_app"), :class => 'control-label' %> <%= f.label '',t("default_widget.select_module_app"), :class => 'control-label' %>
<div class="controls"> <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> </div>
<div class="control-group" id="frontend_list"> <div class="control-group" id="frontend_list">
<%= f.label '', t("front_page.select_app_url"), :class => 'control-label' %> <%= f.label '', t("front_page.select_app_url"), :class => 'control-label' %>
<div class="controls" id="app_page_url"> <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>
</div> </div>
@@ -67,7 +67,7 @@
</div> </div>
<div class="control-group" id='data_count'> <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>
<div class="control-group"> <div class="control-group">
@@ -112,5 +112,4 @@
</div> </div>
</div> </div>
<%=javascript_include_tag "inc/update_cates_and_tags.js" %> <%=javascript_include_tag "inc/update_cates_and_tags.js" %>
<%= javascript_include_tag "inc/page_widget_edit_interface.js" %>
@@ -4,7 +4,7 @@
<% @module_app.widget_fields.each_with_index do |frontend_field, i| %> <% @module_app.widget_fields.each_with_index do |frontend_field, i| %>
<%= i+1 %> <%= i+1 %>
<%= select_tag "page[frontend_field][]",widget_field_options(i,@item) , :include_blank => true %> <%= 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 %>
<% end %> <% end %>
+1 -1
View File
@@ -3,4 +3,4 @@
<%= render 'admin/items/site_map_left_bar' %> <%= render 'admin/items/site_map_left_bar' %>
<% end -%> <% 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_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} %>"); $('#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)} %>"); $("#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? %> <% 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, @selected[:app_frontend_url]),{},{:rel => reload_after_list_changed_admin_pages_path}) %>"); $('#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 %> <% else %>
$('#app_page_url').html("<div class='well'><%= t('default_widget.no_support_setting')%></div>"); $('#app_page_url').html("<div class='well'><%= t('default_widget.no_support_setting')%></div>");
<% end %> <% end %>
<% if @app_frontend_urls.first =='default_widget' %> <% 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 %> <% else %>
$('#app_page_frontend_style').html("<%= t('default_widget.no_support_setting')%>"); $('#app_page_frontend_style').html("<%= t('default_widget.no_support_setting')%>");
<% end %> <% end %>
<% if show_default_widget_setting_panel %> <% 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').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=>@item} %>"); $('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@page} %>");
<% else %> <% else %>
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>"); $('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
<% end %> <% 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
View File
@@ -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
View File
@@ -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| %> <%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal" do |f| %>
<div class="site-map role-block"> <div class="site-map role-block">
<div class="map-block back"> <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| %> <%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
<div class="site-map role-block"> <div class="site-map role-block">
<div class="map-block back"> <div class="map-block back">
+1 -1
View File
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% 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 %> <% end %>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %> <%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
+1 -1
View File
@@ -1,7 +1,7 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<% content_for :side_bar do %> <% 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 %> <% end %>
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% 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 %> <% end %>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %> <%= 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>
-8
View File
@@ -35,14 +35,6 @@
</div> </div>
<% end %> <% end %>
<% 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"> <div class="control-group">
<label class="control-label"><%= t 'site.search' %></label> <label class="control-label"><%= t 'site.search' %></label>
<div class="controls"> <div class="controls">
+4 -6
View File
@@ -1,9 +1,7 @@
<%= form_for :tag, :url => admin_tags_path, :remote => true, :html => {:id => 'tag_form'} do |f| %> <%= 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| %>
<% @site_valid_locales.each do |locale| %> <%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %>
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %> <% end %>
<% end %> <%= f.hidden_field :module_app_id, :value => @module_app_id %>
<% end %>
<%= hidden_field_tag :module_app_id, @module_app_id %>
<%= f.submit t(:add) %> <%= f.submit t(:add) %>
<% end %> <% end %>
+4 -6
View File
@@ -1,9 +1,7 @@
<%= form_for :tag, :url => admin_tag_path(tag), :method => :put, :remote => true do |f| %> <%= 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| %>
<% @site_valid_locales.each do |locale| %> <%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %>
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale, value: @tag.name_translations[locale] %> <% end %>
<% end %> <%= f.hidden_field :module_app_id, :value => tag.module_app_id %>
<% end %>
<%= hidden_field_tag :module_app_id, @module_app_id %>
<%= f.submit t(:update_) %> <%= f.submit t(:update_) %>
<% end %> <% end %>
+2 -2
View File
@@ -3,11 +3,11 @@
<i class="icons-tag"></i> <i class="icons-tag"></i>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<%#= I18nVariable.from_locale(locale) %> <%#= I18nVariable.from_locale(locale) %>
<%= tag.name_translations[locale] %> <%= tag[locale] %>
<% end %> <% end %>
</div> </div>
<div class="action"> <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 %> <%= link_to t(:delete_), admin_tag_path(tag), :confirm => t('sure?'), :method => :delete, :remote => true %>
</div> </div>
</div> </div>
@@ -4,34 +4,12 @@
<div class="groups map-block back <%= role_disable ? 'disabled' : '' %>"> <div class="groups map-block back <%= role_disable ? 'disabled' : '' %>">
<h4> <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)%> <%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,:class=>"subrole_disable_field",:value=>role_disable)%>
</h4> </h4>
<div class="form-horizontal <%= role_disable ? 'hide' : '' %>"> <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|%> <% role.attribute_fields.each do |rf|%>
<%= rf.block_helper(@user,@form_index)%> <%= rf.block_helper(@user,@form_index)%>
@@ -1,22 +1,14 @@
<div class="roles <%= show_roles.key %>"> <div class="roles <%= show_roles.key %>">
<%= show_roles.title %><%= t(:role_info)%> <%= show_roles.title %>
<div class="label-line"> <div class="label-line">
<hr /> <hr />
</div> </div>
<table class="table"> <table class="table">
<tbody> <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| %> <% show_roles.attribute_fields.where(:disabled=>false).each do |rf| %>
<tr> <tr>
<td class="span1"><%= rf.title %></td> <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> </tr>
<% end -%> <% end -%>
<%= render :partial => 'show_sub_role',:collection=> @user.get_sub_roles_by_role(show_roles)%> <%= 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|%> <% show_sub_role.attribute_fields.each do |item|%>
<tr> <tr>
<td class="span1"><%= item.title %></td> <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> </tr>
<% end %> <% end %>
@@ -1,5 +1,5 @@
<%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%> <%= 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 :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(: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) %> <%= 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! %> <%#= devise_error_messages! %>
<div class="map-block back"> <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="form-horizontal">
<div class="controls-block" > <div class="control-group">
<div class="control-group language-swich"> <%= f.label t(:email),:class=>"control-label" %><br />
<%= f.label t("users.first_name"),{:class=>"control-label", :func=>"field_label"} %> <div class="controls">
<div class="controls"> <%= f.email_field :email %>
<div class="tabbable"> </div>
<div class="tab-content"> </div>
<% @site_valid_locales.each_with_index do |locale, i| %> </div>
<div class="tab-pane fade <%= locale %> user-attribute_values-first_name <%= ( i == 0 ) ? "in active" : '' %>">
<%= f.fields_for :first_name_translations do |f| %> <div class="form-horizontal">
<%= f.text_field locale, :func=>'input_unit', :value => (@user.first_name_translations[locale] rescue nil) %> <div class="control-group">
<% end %> <%= f.label t(:password),:class=>"control-label" %>
<div class="controls">
<%= f.password_field :password %>
</div>
</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="form-horizontal">
<div class="controls-block" > <div class="control-group">
<div class="control-group language-swich"> <%= f.label t(:password_confirmation),:class=>"control-label" %>
<%= f.label t("users.last_name"),{:class=>"control-label", :func=>"field_label"} %> <div class="controls">
<div class="controls"> <%= f.password_field :password_confirmation %>
<div class="tabbable"> </div>
<div class="tab-content"> </div>
<% @site_valid_locales.each_with_index do |locale, i| %> </div>
<div class="tab-pane fade <%= locale %> user-attribute_values-last_name <%= ( i == 0 ) ? "in active" : '' %>"> </div>
<%= 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>
@@ -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)%> <%= link_to user_for_summary.name,admin_users_new_interface_path(user_for_summary)%>
</p> </p>
<div class="user-title"> <div class="user-title">
<% user_for_summary.roles.each do |rf| %> <span>#TODO 教授兼系主任</span><span>#TODO 大學部校友</span>
<% @roledata = Role.find(rf.id) %>
<span><%= @roledata.title %></span>
<% end %>
</div> </div>
<ul class="user-itemborder clear"> <ul class="user-itemborder clear">
<li class="pull-left"><span>#TODO 258</span>Publications</li> <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