Merge branch 'design_team' into ldap for NCCU 0229 demo on Redmine

Conflicts:
	app/views/devise/passwords/new.html.erb
	app/views/devise/sessions/new.html.erb
This commit is contained in:
Matt Fu 2012-02-29 13:07:21 +08:00
commit 9a40ecd1d9
186 changed files with 7748 additions and 4699 deletions

View File

@ -10,7 +10,7 @@ gem 'exception_notification' # Send error trace
gem 'execjs' gem 'execjs'
gem 'jquery-rails' gem 'jquery-rails'
gem 'kaminari' gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git'
gem 'mini_magick' gem 'mini_magick'
gem 'mongoid' gem 'mongoid'
@ -22,6 +22,7 @@ gem 'rubyzip'
gem 'sinatra' gem 'sinatra'
gem 'sprockets' gem 'sprockets'
gem 'tinymce-rails' gem 'tinymce-rails'
# gem 'therubyracer'

View File

@ -1,3 +1,12 @@
GIT
remote: git://github.com/amatsuda/kaminari.git
revision: 118927a42e57d6608c10d85b8a62acfc7c175974
specs:
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
@ -75,10 +84,6 @@ GEM
railties (~> 3.0) railties (~> 3.0)
thor (~> 0.14) thor (~> 0.14)
json (1.6.5) json (1.6.5)
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
linecache19 (0.5.12) linecache19 (0.5.12)
ruby_core_source (>= 0.1.4) ruby_core_source (>= 0.1.4)
mail (2.3.0) mail (2.3.0)
@ -216,7 +221,7 @@ DEPENDENCIES
execjs execjs
factory_girl_rails factory_girl_rails
jquery-rails jquery-rails
kaminari kaminari!
mini_magick mini_magick
mongoid mongoid
mysql2 mysql2

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -0,0 +1,7 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require new_admin

View File

@ -0,0 +1,122 @@
$(document).ready(function(){
var result = '',
title_text = '',
link_text = '',
summary_text = '',
startDate_text = '',
startMon_text = '',
startDay_text = '',
endDate_text = '',
time_text = '',
selet = 0,
xmlLength = '',
indexA = '',
indexB = '',
indexC = '',
month = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
checking = 1,
$events = $('.events'),
$mon = $('.events .mon'),
$day = $('.events .day'),
$link_text = $('.events .event_name'),
$time = $('.events .event_info'),
$next = $('.events .links_next'),
$prev = $('.events .links_prev'),
objLength = $events.find('ul > li').length;
$next.on("click", function(){
if (checking&&selet < xmlLength) {
$('.links_prev').removeClass('disabled')
selet+=objLength;
$events.find('ul').fadeOut("fast", function () {
resetText()
$events.find('ul').fadeIn("fast" ,getEvent(selet));
});
if ((xmlLength-selet) == objLength) {
$('.links_next').addClass('disabled')
checking = 0;
} else if ((xmlLength-selet) < objLength) {
$('.links_next').addClass('disabled')
checking = 0;
}
}
return false;
});
$prev.on("click", function(){
if (selet > 0) {
$('.links_next').removeClass('disabled')
checking = 1;
selet-=objLength;
$events.find('ul').fadeOut("fast", function () {
$events.find('ul').fadeIn("fast" ,getEvent(selet));
});
if ((xmlLength-selet) == xmlLength ) {
$('.links_prev').addClass('disabled')
}
}
return false;
});
getEvent(selet);
function resetText() {
$events.find('li').find($mon).html('');
$events.find('li').find($day).html('');
$events.find('li').find($link_text).html('');
$events.find('li').find($link_text).attr('href', '');
$events.find('li').find($time).html('');
}
function getEvent(selet){
$.ajax({
type: "GET",
url: "/static/Other.xml",
dataType: "xml",
timeout: 1000,
error: function(xml){
$events.find('.links_next').addClass('disabled')
$events.find('.error_mag').show();
$events.find('ul').hide();
$events.find('.error_mag').html("讀取錯誤");
},
success: function(xml) {
xmlLength = $(xml).find('entry').length;
$(xml).find('entry').slice(selet, selet+objLength).each(function(i){
title_text = $(this).find('title').text()
link_text = $(this).find('link').attr('href')
summary_text = $(this).find('summary').text()
indexA = summary_text.indexOf("-");
indexB = summary_text.indexOf(" ");
indexC = summary_text.indexOf("/");
//清除前後空白字元
summary_text = jQuery.trim(summary_text);
//篩選標題
title_text = title_text.slice(0, 16)
if (summary_text.length == 31) {
startDate_text = summary_text.slice(0, indexA);
startMon_text = startDate_text.slice((indexC+1), (indexC+3));
startDay_text = startDate_text.slice(7);
endDate_text = summary_text.slice((indexA+1), indexB);
time_text = summary_text.slice((indexB+1));
} else {
startDate_text = summary_text.slice(0, indexB);
startMon_text = startDate_text.slice((indexC+1), (indexC+3));
startDay_text = startDate_text.slice(7);
endDate_text = '';
time_text = summary_text.slice((indexB+1));
}
if(startMon_text.slice(0, 1) == '0'){
startMon_text = month[startMon_text.slice(1)-1];
} else {
startMon_text = month[startMon_text-1];
}
$events.find('li').eq(i).find($mon).html(startMon_text);
$events.find('li').eq(i).find($day).html(startDay_text);
$events.find('li').eq(i).find($link_text).html(title_text+"…");
$events.find('li').eq(i).find($link_text).attr('href', link_text);
$events.find('li').eq(i).find($time).html('時間:'+time_text);
//console.log();
/*$('<li></li>')
.html('<div class="event_date"><span class="mon">'+startMon_text+'</span><span class="day">'+startDay_text+'</div>')
.appendTo('.events ul');*/
});//close each(
}
}); //close $.ajax(
}
});

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@
//= require jquery //= require jquery
//= require jquery_ujs //= require jquery_ujs
//= require bootstrap //= require bootstrap
//= require jquery.isotope.min
//= require jquery.tinyscrollbar.min //= require jquery.tinyscrollbar.min
//= require orbit-1.0 //= require orbit-1.0
//= require tinymce-jquery //= require tinymce-jquery

View File

@ -1,5 +1,5 @@
var viewportwidth; var viewportwidth,
var viewportheight; viewportheight;
function resize() { function resize() {
viewportheight=$(window).height(); viewportheight=$(window).height();
viewportwidth=$(window).width(); viewportwidth=$(window).width();
@ -9,40 +9,69 @@ function resize(){
} }
} }
$(document).ready(function(){ $(document).ready(function(){
$(document).on('click', '.orbit-bar-member', function(){
$(this).hasClass('open') ? $(this).removeClass('open') : $(this).addClass('open');
$('.bar-login .dropdown-menu').toggle();
return false;
});
$(document).click(function() {
$('.orbit-bar-member').removeClass("open");
$('.bar-login .dropdown-menu').hide();
});
$(document).on('click', '.bar-login .dropdown-menu', function(e) {
e.stopPropagation();
$('.bar-login .dropdown-menu').show();
});
$('.tip').tooltip({ $('.tip').tooltip({
placement: "left" placement: "left"
}); });
$(function() { $(document).on('click', '.privacy', function() {
var $role = $('.select-role'); switch ($(this).val()) {
$('.privacy').each(function($i) { case 'true':
$(this).click(function() { $(this).parents('.controls').children('.select-role').slideUp(300);
switch ($i) {
case 0:
$role.slideUp(300);
break; break;
case 1: case 'false':
$role.slideDown(300); $(this).parents('.controls').children('.select-role').slideDown(300);
break; break;
} }
}); });
$(document).on('click', '.toggle-tr-edit', function() {
$(this).parents('tr').next('.qe-block').removeClass('hide');
$(this).parents('tr').next('.qe-block').find('.qe-edit-div').addClass('hide');
$(this).parents('tr').next('.qe-block').find('#qe-' + $(this).attr('rel')).toggleClass('hide');
}); });
$(document).on('click', '.sort-header > .sort', function() {
$.getScript($(this).attr('rel'));
}); });
/*tinyscrollbar&windows-Size*/ /*tinyscrollbar&windows-Size*/
resize(); resize();
$('#main-sidebar').css("height", viewportheight-40); $('#main-sidebar').css("height", viewportheight-40);
//$('#content-wrap .viewport').css("height", viewportheight-44);
//$('#content-wrap').css("width", viewportwidth-186);
$('#main-sidebar .viewport').css("height", viewportheight-40); $('#main-sidebar .viewport').css("height", viewportheight-40);
$('.post-title').css("width", viewportwidth-495);
$('#main-sidebar').tinyscrollbar(); $('#main-sidebar').tinyscrollbar();
$('.detal-list').tinyscrollbar();
$('#main-sidebar').tinyscrollbar({size:(viewportheight-44)}); $('#main-sidebar').tinyscrollbar({size:(viewportheight-44)});
/*isotope*/
var $container = $('#isotope');
$container.isotope({
itemSelector : '.item',
layoutMode : 'masonry',
});
}); });
$(window).resize(function(){ $(window).resize(function(){
resize(); resize();
$('#main-sidebar').css("height", viewportheight-40); $('#main-sidebar').css("height", viewportheight-40);
$('#main-sidebar .viewport').css("height", viewportheight-40); $('#main-sidebar .viewport').css("height", viewportheight-40);
$('.post-title').css("width", viewportwidth-495);
$('#main-sidebar').tinyscrollbar({ size:(viewportheight-44)}); $('#main-sidebar').tinyscrollbar({ size:(viewportheight-44)});
}); });

View File

@ -1,4 +1,7 @@
$(document).ready(function() { $(document).ready(function() {
$('body').prepend("<div id='orbit_bar'/>"); $('body').prepend("<div id='orbit_bar_temp'/>");
ajax_load_proc($('#orbit_bar'), '/load_orbit_bar'); $("#orbit_bar_temp").load('/load_orbit_bar',function(){
$('body').prepend($(this).html());
$(this).remove();
});
}); });

View File

@ -2,7 +2,7 @@ $("div.editable").live("mouseenter mouseleave", function (event) {
$(this).children('.edit_link').toggle(); $(this).children('.edit_link').toggle();
}); });
$("#page_design_id").live('change', function() { $("#page_design").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes'); $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
}); });

View File

@ -8,4 +8,3 @@
//= require jquery_ujs //= require jquery_ujs
//= require page_edit //= require page_edit
//= require side_bar_history //= require side_bar_history
//= require rc

View File

@ -16,8 +16,8 @@ h1, h2, h3, h4, h5, h6 {
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5) inset; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5) inset;
padding:9px; padding:9px;
} }
hr { .qe-block hr {
margin: 5px 0; margin: 5px 10px 5px 0;
} }
.label-tags { .label-tags {
background-color: #FF5B00; background-color: #FF5B00;
@ -31,10 +31,6 @@ hr {
.dropdown-menu { .dropdown-menu {
min-width: 90px; min-width: 90px;
} }
.form-horizontal .form-actions {
text-align:right;
}
.subhead { .subhead {
padding-bottom: 0; padding-bottom: 0;
margin-bottom: 9px; margin-bottom: 9px;
@ -106,3 +102,6 @@ table .span1-2 {
float: none; float: none;
margin-left: 0; margin-left: 0;
} }
.qe-block .form-horizontal .form-actions {
text-align:right;
}

View File

@ -96,7 +96,7 @@ textarea {
} }
body { body {
margin: 0; margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: /*"Helvetica Neue", */Helvetica, Arial, sans-serif;
font-size: 13px; font-size: 13px;
line-height: 18px; line-height: 18px;
color: #333333; color: #333333;
@ -275,7 +275,7 @@ a:hover {
} }
p { p {
margin: 0 0 9px; margin: 0 0 9px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: Helvetica, Arial, sans-serif;
font-size: 13px; font-size: 13px;
line-height: 18px; line-height: 18px;
} }
@ -520,7 +520,7 @@ input,
button, button,
select, select,
textarea { textarea {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: Helvetica, Arial, sans-serif;
font-size: 13px; font-size: 13px;
font-weight: normal; font-weight: normal;
line-height: 18px; line-height: 18px;
@ -1119,7 +1119,7 @@ table .span12 {
width: 14px; width: 14px;
height: 14px; height: 14px;
vertical-align: text-top; vertical-align: text-top;
background-image: url(<%= asset_path "glyphicons-halflings.png" %>); background-image: url(<%= asset_path 'glyphicons-halflings.png' %>);
background-position: 14px 14px; background-position: 14px 14px;
background-repeat: no-repeat; background-repeat: no-repeat;
*margin-right: .3em; *margin-right: .3em;
@ -1128,7 +1128,7 @@ table .span12 {
*margin-left: 0; *margin-left: 0;
} }
.icon-white { .icon-white {
background-image: url(<%= asset_path "glyphicons-halflings-white.png" %>); background-image: url(<%= asset_path 'glyphicons-halflings-white.png' %>);
} }
.icon-glass { .icon-glass {
background-position: 0 0; background-position: 0 0;
@ -2459,7 +2459,7 @@ button.btn.small, input[type="submit"].btn.small {
} }
.navbar-search .search-query { .navbar-search .search-query {
padding: 4px 9px; padding: 4px 9px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: Helvetica, Arial, sans-serif;
font-size: 13px; font-size: 13px;
font-weight: normal; font-weight: normal;
line-height: 1; line-height: 1;

View File

@ -1,10 +0,0 @@
ul.hmenu {
list-style: none;
margin: 0 0 2em;
padding: 0;
text-align: right;
}
ul.hmenu li {
display: inline;
}

View File

@ -0,0 +1,6 @@
/*
*This is a manifest file that'll automatically include all the stylesheets available in this directory
*and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
*the top of the compiled file, but it's generally better to create a new file per style scope.
*= require new_admin
*/

View File

@ -0,0 +1,109 @@
#isotope {
margin-top: 2px;
background-color:#f4f4f4;
}
.isotope-item {
z-index: 2;
}
.isotope-hidden.isotope-item {
pointer-events: none;
z-index: 1;
}
/**** Isotope CSS3 transitions ****/
.isotope,
.isotope .isotope-item {
-webkit-transition-duration: 0.8s;
-moz-transition-duration: 0.8s;
-o-transition-duration: 0.8s;
transition-duration: 0.8s;
}
.isotope {
-webkit-transition-property: height, width;
-moz-transition-property: height, width;
-o-transition-property: height, width;
transition-property: height, width;
}
.isotope .isotope-item {
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform, opacity;
-o-transition-property: top, left, opacity;
transition-property: transform, opacity;
}
/**** disabling Isotope CSS3 transitions ****/
.isotope.no-transition,
.isotope.no-transition .isotope-item,
.isotope .isotope-item.no-transition {
-webkit-transition-duration: 0s;
-moz-transition-duration: 0s;
-o-transition-duration: 0s;
transition-duration: 0s;
}
.w-a {
width: 388px;
}
.w-b {
width: 802px;
}
.h-a {
height: 315px;
}
.h-b {
height: 699px;
}
.item {
margin: 5px 0 15px 15px;
}
.item h3 {
margin: 5px 0;
}
.item h3 [class^="icons-"] {
margin: 3px 5px 0 3px;
}
.item .detail {
padding: 5px;
border: 1px solid rgba(0, 0, 0, 0.1);
background-color: #FFFFFF;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
}
.item .detail .totle {
font-size: 50px;
padding:10px 5px 20px 0;
margin: 0px;
text-align: right;
border-bottom:1px solid #d9d9d9;
}
.item .detail .totle span {
display: block;
font-size:18px;
color: #333;
padding-left: 5px;
text-align:left;
}
.item .detail .table th, .item .detail .table td {
border-top: none;
border-bottom: 1px solid #DDDDDD;
}
.item .detail .table tr td:first-child {
color: #666;;
}
.item .detail .table tr td:last-child {
text-align:right;
}
.item .h-a .my_scroll .viewport {
height: 248px;
}
.item .h-b .my_scroll .viewport {
height: 632px;
}

View File

@ -11,6 +11,10 @@
} }
.main-list thead th { .main-list thead th {
background-color: rgba(0,0,0,0.05); background-color: rgba(0,0,0,0.05);
border-right: 1px solid #ddd;
}
.main-list thead th:last-child {
border-right: none;
} }
.main-list .span1 { .main-list .span1 {
min-width: 32px; min-width: 32px;
@ -28,9 +32,9 @@
height:40px; height:40px;
} }
.main-list tbody .quick-edit .nav { .main-list tbody .quick-edit .nav {
left: -55px; /*left: -55px;*/
position: absolute; position: absolute;
top: -3px; /*top: -3px;*/
width: 350px; width: 350px;
} }
.main-list td { .main-list td {
@ -40,11 +44,55 @@
margin-top: 15px; margin-top: 15px;
margin-bottom: 3px; margin-bottom: 3px;
} }
.main-list tr:hover .hide { .main-list tr.with_action:hover .hide {
display:block !important; display:block !important;
} }
.main-list .label-group {
position: relative;
height: 40px;
}
.main-list .label-td {
background-color: rgba(255, 255, 255, 1);
height: 60px;
overflow: hidden;
position: absolute;
width: 100%;
left: 0;
z-index: 1;
}
.main-list .label-td:hover {
height: auto;
text-align: center;
padding: 5px 5px 8px;
left: -6px;
top: -6px;
border: 1px solid rgba(0, 0, 0, 0.2);
box-shadow: 0px 5px 10px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 5px 10px rgba(0,0,0,0.2);
-webkit-box-shadow: 0px 5px 10px rgba(0,0,0,0.2);
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
z-index: 5;
}
.route-group .route {
padding: 0;
}
.route-group .route .breadcrumb {
border-width: 0!important;
}
.qe-block td { .qe-block td {
height:auto; height:auto;
padding: 0;
}
.qe-block .table td, .qe-block .table th {
padding: 8px;
}
.qe-block .form-horizontal {
margin-bottom: 0;
}
.qe-block .form-actions {
margin-bottom: 0;
} }
legend { legend {
font-size: 15px; font-size: 15px;

View File

@ -11,4 +11,5 @@
*= require widget *= require widget
*= require style *= require style
*= require scroll_style *= require scroll_style
*= require isotope
*/ */

View File

@ -1,15 +0,0 @@
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
-webkit-text-size-adjust:none;
}
/*自定*/
input:focus, select:focus, textarea:focus {
outline:none;
-moz-outline-radius: 0;
}
.clear:after {
content:".";
clear:both;
display:block;
height:0;
visibility:hidden;
}

View File

@ -1,34 +1,9 @@
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0; -webkit-text-size-adjust:none;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
} }
/* HTML5 display-role reset for older browsers */ html, body{
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { background: url(<%= asset_path 'background.jpg' %>) repeat left top;
display: block; height: 100%;
}
a {
text-decoration:none;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
} }
/*自定*/ /*自定*/
input:focus, select:focus, textarea:focus { input:focus, select:focus, textarea:focus {
@ -42,3 +17,7 @@ input:focus, select:focus, textarea:focus {
height:0; height:0;
visibility:hidden; visibility:hidden;
} }
a:link, a:hover, a:visited, a:active {
outline: none; /* for Firefox */
hlbr:expression(this.onFocus=this.blur()); /* for IE */
}

View File

@ -1,513 +0,0 @@
//Created by Harry Bomrah on Sep 21 2011
$rss = jQuery.noConflict();
var rcom={
//Pass dom and will return binded dom with starting year till current
insertDatePanel : function(dom,year){
if(!year)year=1901;
if(dom=="")return false;
domid=dom.attr("id");
var dt = new Date();
current_year=dt.getFullYear();
var dthtml="Year: <select name='"+domid+"_year'>";
for(i=current_year;i>=year;i--){
dthtml+="<option value='"+i+"'>"+i+"</option>";
}
dthtml+="</select> Date: <select name='"+domid+"_date'>";
for(i=1;i<=31;i++){
if(i<10)
dthtml+="<option value='0"+i+"'>"+i+"</option>";
else
dthtml+="<option value='"+i+"'>"+i+"</option>";
}
dthtml+="</select> Month: <select name='"+domid+"_month'>";
var months= Array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
for(i=1;i<12;i++){
if(i<10)
dthtml+="<option value='0"+i+"'>"+months[i]+"</option>";
else
dthtml+="<option value='"+i+"'>"+months[i]+"</option>";
}
dthtml+="</select>";
dom.html(dthtml);
},
//loading overlay around a dom...
loadingWrapper : function(dom, display){
if(display){
dom.prepend("<div id='loading_wrapper' class='loading'></div>");
$rss("#loading_wrapper").height(dom.height());
$rss("#loading_wrapper").width(dom.width());
}else{
domId=dom.attr("id");
$rss("#"+domId+" #loading_wrapper").remove();
}
},
//validating a dom....
validate : function(dom, validation, errormsg){
var domValue = dom.val();
var error = false;
var regex="";
var msg = "";
switch(validation){
case "required":
if(domValue=="")error=true;
msg="Cannot be empty.";
break;
case "email":
regex=/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
msg="Invalid Email Address.";
break;
case "number":
regex=/^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/;
msg = "Only numbers are accepted.";
break;
case "alphanumeric":
regex=/^\s*[a-zA-Z0-9,\s]+\s*$/;
msg="Only numbers, alphabets and spaces are allowed.";
break;
}
domId=dom.attr("name");
if(errormsg=="")errormsg=msg;
if(regex!="")if(!regex.test(domValue))error=true;
if(error){$rss("#"+domId+"_error").remove();dom.after("<span id='"+domId+"_error' class='error'>"+errormsg+"</span>");return false;} else{ $rss("#"+domId+"_error").remove();return true;}
},
bindToSpinner : function(dom,data,callbackFn){
var domId = dom.attr("id");
var dhtml="";
var spinnerValue=Array();
var spinnerDisplay=Array();
$rss.each(data,function(i,it){
$rss.each(data[i],function(key,it){
spinnerValue.push(it);
});
});
dhtml="<select name='"+domId+"'>";
for(i=0,y=1,z=0;i<spinnerValue.length/2;i++,y+=2,z+=2){
dhtml+="<option value='"+spinnerValue[z]+"'>"+spinnerValue[y]+"</option>";
}
dhtml+="</select>";
dom.html(dhtml);
if(typeof callbackFn=="function")
callbackFn.call(this, dhtml);
},
//binds the recieved json to a table
bindToTable : function(dom,data,headers,actions,css_class,callbackFn){
if(!css_class)css_class="";
var dhtml="<table width='100%' cellpadding='5' cellspacing='5' class='"+css_class+"' ><thead><tr>";
var domId = dom.attr("id");
if(actions){
var btnTitles=Array();
var btnFunctions=Array();
$rss.each(actions,function(title,func){
btnTitles.push(title);
btnFunctions.push(func);
});
rcom.translate(btnTitles,function(convertedData){
btnTitles=convertedData.slice();
rcom.translate(headers,function(convertedData){
headers=convertedData;
if(!data)return;
$rss.each(headers,function(i,head){
dhtml+="<th>"+head+"</th>";
});
dhtml+="</thead></tr>";
if(data.length==0)dhtml+="<tr><td colspan='"+headers.length+"' align='center'>No Data</td></tr>";
$rss.each(data,function(i,item){
var cl="";
if(i%2!=0)cl="even";
dhtml+="<tr id='"+domId+"_"+item.id+"' class='"+cl+"'>";
$rss.each(item,function(i,it){
if(i!="id"){
if(it==null)it="Not Set";
dhtml+="<td align='center'>"+it+"</td>";
}
})
dhtml+="<td align='center'>";
for(x=0;x<btnTitles.length;x++){
dhtml+="<button onclick='"+btnFunctions[x]+"("+item.id+")'>"+btnTitles[x]+"</button>";
}
dhtml+="</td>";
dhtml+="</tr>";
});
dhtml+="</table>";
dom.html(dhtml);
});
});
}else{
rcom.translate(headers,function(convertedData){
headers=convertedData;
if(!data)return;
if(headers.length>0){
$rss.each(headers,function(i,head){
dhtml+="<th>"+head+"</th>";
});
}
dhtml+="</thead></tr>";
if(data.length==0)dhtml+="<tr><td colspan='"+headers.length+"' align='center'>No Data</td></tr>";
$rss.each(data,function(i,item){
var cl="";
if(i%2!=0)cl="even";
dhtml+="<tr id='"+domId+"_"+item.id+"' class='"+cl+"'>";
$rss.each(item,function(i,it){
if(i!="id"){
if(it==null)it="Not Set";
dhtml+="<td align='center'>"+it+"</td>";
}
})
dhtml+="</tr>";
});
dhtml+="</table>";
dom.html(dhtml);
});
}
if(typeof callbackFn=="function")
callbackFn.call(this, dhtml);
},
//convert to date string which can be directly inserted in database or according to any format.
convertToInsertableDate : function(y,m,d,format){
var dt="";
if(m<10)m="0"+m;
if(d<10)d="0"+d;
switch(format){
case "yyyy-mm-dd":
dt= y+"-"+m+"-"+d;
break;
case "dd-mm-yyyy":
dt= d+"-"+m+"-"+y;
break;
case "mm-dd-yyyy":
dt= m+"-"+d+"-"+y;
break;
default:
dt= y+"-"+m+"-"+d;
break;
}
return dt;
},
//a fucntion to show specific divs and hide all other
showDoms : function(doms){
$rss("body").find("div").each(function(){$rss(this).hide();});
$rss.each(doms,function(i,dom){
dom.show();
});
},
//a function to translate the word or array..
translate : function(data,callbackFn){
var cdata="";
var status =true;
if(!data){
if(typeof callbackFn=="function")
callbackFn.call(this,cdata);
status=false;
}
if(data==""){
if(typeof callbackFn=="function")
callbackFn.call(this,cdata);
status=false;
}
if(status){
$rss.getJSON("../../classes/translate.php", {fn:"translateThis",tData:data},function(convertedData){
if(typeof callbackFn=="function")
callbackFn.call(this, convertedData);
});
}
},
// a function to bind JSON to list
bindToList : function(dom,data,callbackFn){
var domId = dom.attr("id");
var dhtml="";
var listValue=Array();
var listDisplay=Array();
$rss.each(data,function(i,it){
$rss.each(data[i],function(key,it){
listValue.push(it);
});
});
dhtml="<ul id='"+domId+"_list'>";
for(i=0,y=1,z=0;i<listValue.length/2;i++,y+=2,z+=2){
dhtml+="<li id='li_"+listValue[z]+"'>"+listValue[y]+"</li>";
}
dhtml+="</ul>";
dom.html(dhtml);
if(typeof callbackFn=="function")
callbackFn.call(this,dhtml);
},
makeDraggable : function(handler,dom){
handler.css("position","absolute");
dom.css("position","absolute");
var puranix=0;
var nayeex=0;
var puraniy=0;
var nayeey=0;
var offset="";
var zIndex=dom.css("z-index");
handler.mousedown(function(e){
puranix=e.clientX;
puraniy=e.clientY;
offset=dom.offset();
$rss(this).mousemove(function(e){
nayeex=e.clientX-puranix;
nayeex+=offset.left;
nayeey=e.clientY-puraniy;
nayeey+=offset.top;
dom.css({"left":nayeex+"px","top":nayeey+"px","z-index":"9999"});
})
}).mouseup(function(){
$rss(this).unbind("mousemove");
dom.css("z-index",zIndex);
})
},
//automatically scrolls to the bottom of the div
scrollToBottom : function(dom){
var domId = dom.attr("id");
// var domScrollHeight = document.getElementById(domId).scrollHeight;
var obj = document.getElementById(domId);
if((obj.scrollTop+100) >= (obj.scrollHeight - obj.offsetHeight))
dom.scrollTop(obj.scrollHeight);
},
/*ajax loading of images... needs following settings
dom:in which images ve to be loaded
url:the server url for making ajax calls
limit:how many images to load
divClass:the class of div surrounding each image
nameClass:class for span showing name
fn:function to be called in on the server
imageSrc:the image source of all the images.
bindTo:to bind images to a onclick function or else will be binded to normal a tag.
urlKey:to specify the key of the value.. if bindTo is used, this will be neglected..
returns json;
*/
loadImages : function(settings,callbackFn){
var dom = settings.dom;
var domid= dom.attr("id");
var temp_array=Array();
var starting = $rss("#"+domid+" img:last").attr("id");
if(typeof starting != 'undefined'){
starting = starting.substr(4,starting.length-1);
}else{starting = 0};
var temp_var="";
var json = "";
var dhtml="";
var extraparam="";
if(typeof settings.extraParam != "undefined"){
extraparam = settings.extraParam;
}
$rss.getJSON(settings.url,{fn:settings.fn,id:settings.whereId,limit:settings.limit,start:starting,extra:extraparam},function(images){
json = eval(images);
$rss.each(images,function(i,pic){
var temp_array=Array();
var a_var=Array();
var name_var="";
var title="";
$rss.each(pic,function(i,value){
temp_array.push(value);
})
if(temp_array.length>=4){
name_var="<span class='"+settings.nameClass+"'>"+temp_array[3]+"</span></div>"
}
if(temp_array[2]==null)
title = "";
else
title = temp_array[2];
if(typeof settings.bindTo!="undefined"){
a_var[1]="onclick='"+settings.bindTo+"("+temp_array[0]+");return false;'";
a_var[0]="";
}else{a_var[0]='?'+settings.urlKey+'='+temp_array[0];a_var[1]="";}
dhtml="<div class='"+settings.divClass+"' id='img_holder_"+temp_array[0]+"' ><a href='"+a_var[0]+"' "+a_var[1]+" title='"+title+"'><img id='pic_"+temp_array[0]+"' style='display:none' src='"+settings.imageSrc+temp_array[1]+"' /></a>"+name_var;
dom.delay(100).append(dhtml);
$rss("#pic_"+pic.id).delay(100).fadeIn(200);
})
if(typeof callbackFn=="function")
callbackFn.call(this,json);
})
},
//function to get url variables...
getUrlVars : function(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++){
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
},
/*function to open a modalwindow on a page.. self reliant no images, no css needed.
settings
width:in percentage or pixcel
height:in percentage or pixcel
closeBtn:true or false
envClose:closing through background click, true or flase
loadDiv:load html from a div
loadPage:load a page
loadHtml: load html
*/
modalWindow : function(settings,callbackFn){
var envClose = settings.envClose;
var dhtml="";
if(typeof envClose == "undefined")
envClose = true;
var closeBtn = settings.closeBtn;
if(typeof closeBtn == "undefined")
closeBtn = true;
var rgmaskHeight = $rss(window).height();
var rgmaskWidth = $rss(window).width();
var tempheight = settings.height;
var tempwidth = settings.width;
if(typeof tempheight!="undefined"){
if(tempheight.charAt(tempheight.length-1)=='%')
tempheight=(rgmaskHeight*parseInt(tempheight.substr(0,tempheight.length)))/100;
}else{tempheight="auto";}
if(typeof tempwidth!="undefined"){
if(tempwidth.charAt(tempwidth.length-1)=='%')
tempwidth=(rgmaskWidth*parseInt(tempwidth.substr(0,tempwidth.length)))/100;
}else{tempwidth="auto";}
$rss("body").append('<div class="rgmask" id="rgsheath" style="height:'+rgmaskHeight+'px"></div>');
$rss("#rgsheath").css({background: "#000", width: "100%", position: "fixed", top: 0, left: 0,opacity:0.9,'z-index':199});
$rss("body").append('<div id="rgWindow"></div>');
$rss("#rgWindow").css({"position": "fixed", "z-index": "999", "background": "#fff", "border": "solid 3px #ccc", "padding": "20px", "overflow": "hidden", "border-radius": "12px", "-webkit-border-radius": "12px", "-moz-border-radius": "12px", "-ms-border-radius": "12px", "box-shadow": "0 0 20px rgba(0,0,0,0.9)","-webkit-box-shadow": "0 0 20px rgba(0,0,0,0.9)","-moz-box-shadow": "0 0 20px rgba(0,0,0,0.9)","-ms-box-shadow": "0 0 20px rgba(0,0,0,0.9)"});
var rgWTop = (rgmaskHeight-20)/2;
var rgWLeft = (rgmaskWidth-20)/2;
$rss("#rgWindow").css({top:rgWTop+"px", left:rgWLeft+"px"});
if(typeof settings.loadDiv!="undefined"){
dhtml = $rss("#"+settings.loadDiv).html();
$rss("#rgWindow").html(dhtml).hide();
prepareWindow();
}
if(typeof settings.loadHtml!="undefined"){
dhtml = settings.loadHtml;
$rss("#rgWindow").html(dhtml).hide();
prepareWindow();
}
if(typeof settings.loadPage!="undefined"){
$rss("#rgWindow").load(settings.loadPage,function(){$rss(this).hide();dhtml=$rss(this).html();prepareWindow();});
}
function prepareWindow(){
if(tempheight!="auto")
rgWTop = (rgmaskHeight-tempheight)/2;
else{
tempheight=$rss("#rgWindow").height();
rgWTop=(rgmaskHeight-tempheight)/2;
}
if(tempwidth!="auto")
rgWLeft = (rgmaskWidth-tempwidth)/2;
else{
tempwidth=$rss("#rgWindow").width();
rgWLeft=(rgmaskWidth-tempwidth)/2;
}
$rss("#rgWindow").empty().show();
var closebtn = "";
if(closeBtn)
closebtn='<a href="" style="display:block; width:28px; height:28px; line-height:28px; text-align:center; position:absolute; right:6px; top: 6px; font-family:Tahoma; font-weight:bold; border:solid 1px #ccc; border-radius: 15px;text-shadow:1px 1px 0 #fff; background:#f6f6f6; font-size:14px; text-decoration:none; color:#666" id="close_modal">X</a>';
$rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgWindow").html(closebtn+"<div id='rgContent' style='overflow:auto; overflow-x:none; height:"+tempheight+"px;'>"+dhtml+"</div>");
$rss("#close_modal").mouseover(function(){$rss(this).css("color","#999");}).mouseout(function(){$rss(this).css("color","#666");})
$rss("#close_modal").click(function(){
$rss("#rgWindow").empty();
var x = (rgmaskHeight-20)/2;
var y = (rgmaskWidth-20)/2;
$rss("#rgWindow").animate({top:x+"px", left:y+"px","width":"50px","height":"50px"},300,function(){$rss(this).fadeOut(100).remove();$rss("#rgsheath").fadeOut(500).remove();});
return false;
})
if(envClose)
$rss("#rgsheath").click(function(){
$rss("#rgWindow").empty();
var x = (rgmaskHeight-20)/2;
var y = (rgmaskWidth-20)/2;
$rss("#rgWindow").animate({top:x+"px", left:y+"px","width":"50px","height":"50px"},300,function(){$rss(this).fadeOut(100).remove();$rss("#rgsheath").fadeOut(500).remove();});})
if(typeof callbackFn=="function")
callbackFn.call(this,dhtml);
});
}
},
modalWindowClose : function(callbackFn){
if($rss("#rgWindow").length>0){
$rss("#rgWindow").empty();
var rgmaskHeight = $rss(window).height();
var rgmaskWidth = $rss(window).width();
var x = (rgmaskHeight-20)/2;
var y = (rgmaskWidth-20)/2
$rss("#rgWindow").animate({top:x+"px", left:y+"px","width":"50px","height":"50px"},300,function(){$rss(this).fadeOut(100).remove();$rss("#rgsheath").fadeOut(500).remove();})
}
if(typeof callbackFn=="function")
callbackFn.call(this,"harry");
},
bindDomToHead : function(dom){
var gc = dom.css("background");
var t = dom.offset();
var gw = dom.width();
$rss(window).scroll(function(){
var wt = $rss(window).scrollTop();
if ( wt > t.top ) {
var cssObj = {
'position':'fixed',
'top':0,
'width':gw,
'background':gc,
'box-shadow':'0 1px 0 rgba(0,0,0,0.2)',
'z-index':99
}
dom.css(cssObj);
} else {
dom.attr('style',"");
}
});
},
progressBar : function(dom,settings){
var domid = dom.prop("id");
if($rss("#rss_progressbar_div_"+domid).length==0){
if(typeof settings.top == "undefined")
settings.value = 1;
if(typeof settings.top == "undefined")
settings.top = (dom.height()-12)/2;
dom.append("<div id='rss_progressbar_div_"+domid+"' style='display:none;padding: 2px;background: #333;background: -webkit-linear-gradient(#111, #333);background: -moz-linear-gradient(#111, #333);background: -ms-linear-gradient(#111, #333);position: absolute;top: "+settings.top+"px;left: 50%;margin-left: -45%;width: 84%;box-shadow: inset 0 0 2px #000;border-radius: 4px;'><div id='rss_progressbar_"+domid+"' style='height: 8px; background: #36c;background: -webkit-linear-gradient(#7A98E7, #36c);background: -moz-linear-gradient(#7A98E7, #36c);background: -ms-linear-gradient(#7A98E7, #36c);border-radius: 2px; width: "+settings.value+"%;'></div></div>");
$rss("#rss_progressbar_div_"+domid).fadeIn(500);
}
},
progressBarValue : function(dom,value){
var domid = dom.prop("id");
if($rss("#rss_progressbar_div_"+domid).length==1){
$rss("#rss_progressbar_"+domid).animate({"width":value+"%"},100);
}
},
progressBarClose : function(dom){
var domid = dom.prop("id");
$rss("#rss_progressbar_div_"+domid).fadeOut(500,function(){$(this).remove();});
},
getInternetExplorerVersion: function(){
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
}
return rv;
}
}
$ = jQuery.noConflict();

View File

@ -24,14 +24,17 @@
text-shadow: 0 -1px 0 #000000; text-shadow: 0 -1px 0 #000000;
} }
#back_sidebar .list { #back_sidebar .list {
background:url(<%= asset_path "line.png" %>) repeat-x left bottom;
color:#fff; color:#fff;
font-size:12px; font-size:12px;
background:url(<%= asset_path "line.png" %>) repeat-x left bottom; margin:0;
padding:0;
} }
#back_sidebar .list li { #back_sidebar .list li {
background:url(<%= asset_path "sidebar_li.jpg" %>) repeat-x left top; background:url(<%= asset_path "sidebar_li.jpg" %>) repeat-x left top;
border-top:1px solid #424344; border-top:1px solid #424344;
border-bottom:1px solid #000000; border-bottom:1px solid #000000;
list-style:none;
} }
#back_sidebar .list li:hover { #back_sidebar .list li:hover {
background-position:left bottom; background-position:left bottom;
@ -53,6 +56,12 @@
background-position:left bottom; background-position:left bottom;
color:#eeeeee; color:#eeeeee;
} }
#back_sidebar .list li ul{
padding:0 0 0 15px;
}
#back_sidebar .list li ul ul{
padding:0;
}
#back_sidebar .users .list .set_1 { #back_sidebar .users .list .set_1 {
background-position:left bottom; background-position:left bottom;
border-top:1px solid #406cc3; border-top:1px solid #406cc3;

View File

@ -1,29 +1,73 @@
@font-face{ @font-face{
font-family: 'WebSymbolsRegular'; font-family: 'WebSymbolsRegular';
src: url(<%= asset_path "websymbols-regular-webfont.eot" %>); src: url(<%= asset_path 'fonts/websymbols-regular-webfont.eot' %>);
src: url(<%= asset_path "websymbols-regular-webfont.eot?#iefix" %>) format('embedded-opentype'), src: url(<%= asset_path 'fonts/websymbols-regular-webfont.eot?#iefix' %>) format('embedded-opentype'),
url(<%= asset_path "websymbols-regular-webfont.woff" %>) format('woff'), url(<%= asset_path 'fonts/websymbols-regular-webfont.woff' %>) format('woff'),
url(<%= asset_path "websymbols-regular-webfont.ttf" %>) format('truetype'), url(<%= asset_path 'fonts/websymbols-regular-webfont.ttf' %>) format('truetype'),
url(<%= asset_path "websymbols-regular-webfont.svg#WebSymbolsRegular" %>) format('svg'); url(<%= asset_path 'fonts/websymbols-regular-webfont.svg#WebSymbolsRegular' %>) format('svg');
}
.login-logo {
text-indent: -9999px;
background: url(<%= asset_path 'sign-in-logo.png' %>) no-repeat center 40px;
padding-top: 40px;
height: 160px;
} }
#orbit-bar { #orbit-bar {
margin-bottom: 0; margin-bottom: 0;
position:fixed; position:fixed;
width:100%; width:100%;
z-index: 99; z-index: 99;
top: 0;
left: 0;
} }
#orbit-bar .navbar-inner { #orbit-bar .navbar-inner {
height: 28px;
-moz-border-radius: 0px; -moz-border-radius: 0px;
-webkit-border-radius: 0px; -webkit-border-radius: 0px;
border-radius: 0px; border-radius: 0px;
padding-top: 2px;
padding-bottom: 1px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset;
background-image: -moz-linear-gradient(top, #545b60, #191a1c);
background-image: -ms-linear-gradient(top, #545b60, #191a1c);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#545b60), to(#191a1c));
background-image: -webkit-linear-gradient(top, #545b60, #191a1c);
background-image: -o-linear-gradient(top, #545b60, #191a1c);
background-image: linear-gradient(top, #545b60, #191a1c);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#545b60', endColorstr='#191a1c', GradientType=0);
}
#orbit-bar .navbar-search {
float: none;
margin: 0 auto;
text-align: center;
}
#orbit-bar .nav.pull-right {
margin-right: -20px;
}
#orbit-bar .search-query {
background-image: url(<%= asset_path 'main-search.png' %>);
background-repeat: no-repeat;
background-position: 5px 6px;
padding-left: 25px;
/*background-color: rgba(255, 255, 255, 0.8);
color: #333;
text-shadow: 0px 1px 0px #FFF;*/
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3) inset, 0 1px 0 rgba(255, 255, 255, 0.15);
}
#orbit-bar .search-query:focus {
/*background-color: rgba(255, 255, 255, 0.9);
text-shadow: 0px 1px 0px #FFF;*/
background-position: 6px 7px;
} }
#orbit-bar .container { #orbit-bar .container {
width:100%; width:100%;
} }
#orbit-bar .orbit-logo .brand { #orbit-bar .orbit-logo .brand {
background: url(<%= asset_path "orbit-bar.png" %>) no-repeat -162px top; background: url(<%= asset_path 'orbit-bar.png' %>) no-repeat -162px -5px;
text-indent:-9999px; text-indent:-9999px;
padding: 5px 20px 4px;
} }
#orbit-bar .orbit-logo .brand:hover { #orbit-bar .orbit-logo .brand:hover {
background-color: rgba(0,157,220,1); background-color: rgba(0,157,220,1);
@ -38,59 +82,270 @@
background-color: rgba(0,157,220,1); background-color: rgba(0,157,220,1);
} }
#orbit-bar .nav > li > a { #orbit-bar .nav > li > a {
background-image: url(<%= asset_path "orbit-bar.png" %>); background-image: url(<%= asset_path 'orbit-bar.png' %>);
background-repeat:no-repeat; background-repeat:no-repeat;
display: inline-block; display: inline-block;
width: 16px; width: 16px;
height: 16px; height: 16px;
text-indent: -9999px; text-indent: -9999px;
padding:12px; padding:6px;
} }
#orbit-bar .nav > li > a.orbit-bar-home { #orbit-bar .nav > li > a.orbit-bar-home {
background-position: -4px -4px; background-position: -10px -10px;
} }
#orbit-bar .nav > li > a.orbit-bar-desktop { #orbit-bar .nav > li > a.orbit-bar-desktop {
background-position: -100px -4px; background-position: -100px -4px;
} }
#orbit-bar .nav > li > a.orbit-bar-logout { #orbit-bar .nav > li > a.orbit-bar-member {
background-position: -38px -4px; background-position: -4px -37px;
margin: 0 10px 0 0;
} }
#orbit-bar .nav > li > a.orbit-bar-search { #orbit-bar .nav > li > a.orbit-bar-member {
background-position: -68px -4px; background-position: -10px -43px;
} }
#orbit-bar .log { #orbit-bar .nav > li > a.orbit-bar-language {
margin: 0 10px 0 0; background-position: -42px -42px;
} }
#orbit-bar .log input { .language-menu .active {
margin: 5px 0 0; color: #ffffff;
text-decoration: none;
background-color: #0088cc;
} }
#orbit-bar .nav > li > a.orbit-bar-account {
background-image: none;
height: 22px;
padding: 3px;
text-indent: inherit;
min-width: 110px;
width: auto !important;
text-align: left;
}
#orbit-bar .nav span.member-name {
display: inline-block;
float: right;
line-height: 22px;
padding: 0 10px;
}
#orbit-bar .nav img.member-img {
display: inline-block;
float: left;
max-width: 22px;
}
#orbit-bar .account-menu {
right: 5px;
}
#orbit-bar .bar-login {
#main-sidebar {
background-color: #FFFFFF;
width: 155px;
padding-right: 4px;
border-right: 1px solid rgba(0,0,0,.3);
position:fixed;
top:40px;
z-index: 88;
} }
#orbit-bar .bar-login .open, #orbit-bar .open .orbit-bar-account {
#main-wrap { background-color: #009DDC;
margin-left:160px;
padding-top: 40px;
position: relative;
} }
#main-wrap > .form-actions { #orbit-bar .bar-login .dropdown-menu {
text-align: center; padding: 0 0 10px;
padding: 17px 20px 27px; max-width: 260px;
}
#orbit-bar .bar-login .dropdown-menu .log {
margin: 10px 15px 0;
list-style: none outside none;
}
#orbit-bar .bar-login .dropdown-menu .log .title {
background: url(<%= asset_path 'sign-in-logo2.png' %>) no-repeat center center;
height: 70px;
}
#orbit-bar .bar-login .dropdown-menu .log form {
margin: 0 0 8px;
}
#orbit-bar .bar-login .dropdown-menu .log input {
display: inline-block;
margin: 0; margin: 0;
} }
#orbit-bar .bar-login .dropdown-menu .log .span2 {
width: 183px;
}
#orbit-bar .bar-login .dropdown-menu .log .forgot {
margin-bottom: 20px;
padding: 3px 0 0;
float: right;
display: inline-block;
color: #0088CC;
}
#orbit-bar .bar-login .dropdown-menu .log .input-prepend {
margin-top: 20px;
}
#orbit-bar .bar-login .dropdown-menu .log .remember {
margin-top: 5px;
}
#orbit-bar .bar-login .dropdown-menu .log .forgot:hover {
padding: 3px 0 0;
float: right;
display: inline-block;
color: #005580;
text-decoration: underline;
background-color: transparent;
}
#orbit-bar .bar-login .dropdown-menu .log .btn {
width: 220px;
}
#orbit-bar .bar-login .dropdown-menu .log .divider {
position:relative;
overflow: inherit;
margin: 20px 0;
}
#orbit-bar .bar-login .dropdown-menu .log .divider span {
position: absolute;
width: 20px;
height: 20px;
background-color: #FFF;
color: #666;
top: -9px;
left: 100px;
font-size:16px;
text-align: center;
}
#orbit-bar .bar-login .dropdown-menu .register {
color: #FFFFFF;
margin: 0 15px;
width: 188px;
}
#main-sidebar {
background: url(<%= asset_path 'background.jpg' %>) repeat left top;
width: 155px;
padding-right: 4px;
border-right: 1px solid rgba(0,0,0,.2);
position:fixed;
top: 42px;
z-index: 88;
}
#main-sidebar .nav {
padding-top: 5px;
}
#main-sidebar .nav > li.active > a [class^="icons-"] {
background-image: url(<%= asset_path 'icons_pack_white.png' %>);
}
#main-sidebar .nav > li > .nav {
margin-left: -14px;
margin-bottom: 5px;
width: 155px;
padding: 0;
background-color: #FFF;
/*border-radius: 0px 0px 8px 0px;
-webkit-border-radius: 0px 0px 8px 0px;
-moz-border-radius: 0px 0px 8px 0px;*/
box-shadow: 0px 2px 1px rgba(0,0,0,0.1);
-moz-box-shadow: 0px 2px 1px rgba(0,0,0,0.1);
-webkit-box-shadow: 0px 2px 1px rgba(0,0,0,0.1);
}
#main-sidebar .nav > li > .nav > li > a {
margin-left: 0;
padding-left: 19px;
color: #999;
}
#main-sidebar .nav > li > .nav > li > a:hover {
color: #000;
background-color: #d7eeff;
}
#main-sidebar .nav > li > .nav > li.active > a {
background-color: #b7b7b7;
color: #fff;
}
#main-wrap {
background-color: #FFF;
margin-left:160px;
padding-top: 42px;
padding-bottom: 18px;
position: relative;
min-height: 100%;
}
#main-wrap > .form-actions {
background-color: #FFF;
text-align: center;
padding: 17px 20px 0;
margin: 0;
border-top: none;
}
#main-wrap .subnav { #main-wrap .subnav {
height: auto; height: auto;
min-height: 36px; min-height: 36px;
} }
#main-wrap .pagination {
margin: 18px 0 0;
text-align: center;
}
.main-list .route-group td {
border: none;
}
#main-wrap .route-group .breadcrumb {
background-image: none;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-width: 0 0 1px 0;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
margin-bottom: 0px;
padding: 7px 8px 5px;
}
#main-wrap .breadcrumb li {
font-size: 12px;
color: #999;
}
#sub-wiget {
clear: right;
float: right;
padding-right: 10px;
padding-top: 8px;
position: relative;
margin-bottom: 13px;
width: 304px;
}
.main-wiget .widget-box {
margin: 5px 0;
width: 100%;
}
#poststuff .form-actions {
background-color: transparent;
text-align: right;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0;
clear: both;
}
#poststuff form {
margin-bottom: 0;
}
#post-body {
float: left;
clear: left;
width: 100%;
margin-right: -340px;
}
#post-body .title input[type=text] {
margin-bottom: 0;
width: 100%;
height: 30px;
}
#post-body .btn-group {
margin-left: 5px;
}
#post-body .well {
margin: 0;
border-radius: 0px;
-moz-border-radius: 0px;
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
border-top: none;
}
#post-body .editor {
background-color: #333333;
height: 20px;
margin: 8px 0;
width: 100%;
}
#post-body-content {
margin-right: 320px;
padding: 8px 0 8px 6px;
}
.filter .accordion-heading > a:hover { .filter .accordion-heading > a:hover {
text-decoration: none; text-decoration: none;
} }
@ -117,27 +372,21 @@
border-top-color: #0088CC; border-top-color: #0088CC;
margin-top: 6px; margin-top: 6px;
} }
.accordion-group .web-symbol:after {
font-family: 'WebSymbolsRegular';
content: "{";
margin-left: 2px;
margin-top: 8px;
}
.filter .active { .filter .active {
background-color: #0088CC; background-color: #0088CC;
} }
.filter .active a { .filter .active a {
color: #FFF; color: #FFF;
} }
.filter .active .web-symbol:after {
content: "}";
}
.filters { .filters {
background-color: rgba(0,0,0,0.025); background-color: rgba(0,0,0,0.075);
-webkit-box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2); -webkit-box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2);
} }
.filters > div {
background-color: #dadada;
}
.filters .btn { .filters .btn {
margin-bottom: 5px; margin-bottom: 5px;
} }
@ -148,11 +397,106 @@
.filters .filter-clear { .filters .filter-clear {
padding: 5px 5px 0; padding: 5px 5px 0;
border-top: 1px solid rgba(0,0,0,0.1); border-top: 1px solid rgba(0,0,0,0.1);
background-color: rgba(0,0,0,0.025);
text-align: right; text-align: right;
margin: 0 5px;
-webkit-box-shadow: inset 0 1px 0px rgba(255, 255, 255, 0.5);
-moz-box-shadow: inset 0 1px 0px rgba(255, 255, 255, 0.5);
box-shadow: inset 0 1px 0px rgba(255, 255, 255, 0.5);
} }
.filters .in { .filters .in {
border-bottom: 1px solid rgba(0,0,0,0.07) /*border-bottom: 1px solid rgba(0,0,0,0.07)*/
}
.sign-in {
width: 360px;
margin: 0 auto 70px;
background-color: #FFF;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
-moz-box-shadow: 0 2px 2px rgba(143, 143, 143, 0.38);
-webkit-box-shadow: 0 2px 2px rgba(143, 143, 143, 0.38);
box-shadow: 0 2px 2px rgba(143, 143, 143, 0.38);
border-width: 0px 1px 1px 1px;
border-style: none solid solid solid;
border-color: transparent #c6c6c6 #c6c6c6 #c6c6c6;
}
#signin-header {
width: 340px;
margin: 30px auto 0;
line-height: 25px;
padding: 5px 10px;
border-width: 1px 1px 0px 1px;
border-style: solid solid none solid;
border-color: #c6c6c6 #c6c6c6 transparent #c6c6c6;
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #dadada, #c0c0c0);
background-image: -ms-linear-gradient(top, #dadada, #c0c0c0);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#dadada), to(#c0c0c0));
background-image: -webkit-linear-gradient(top, #dadada, #c0c0c0);
background-image: -o-linear-gradient(top, #dadada, #c0c0c0);
background-image: linear-gradient(top, #dadada, #c0c0c0);
-moz-border-radius: 5px 5px 0px 0px ;
-webkit-border-radius: 5px 5px 0px 0px;
border-radius: 5px 5px 0px 0px;
-moz-box-shadow: 0 1px 0px rgba(20, 20, 20, 0.3);
-webkit-box-shadow: 0 1px 0px rgba(20, 20, 20, 0.3);
box-shadow: 0 1px 0px rgba(20, 20, 20, 0.3);
}
#signin-header h3 {
color: #848484;
text-shadow: 0 1px 0 #e9e9e9;
}
#sign-footer {
width: 100%;
position:fixed;
bottom: 0;
height: 40px;
background-color: #dadada;
color: #7a7a7a;
box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.3);
}
#sign-footer p {
line-height: 40px;
padding: 0 10px;
text-align: right;
}
.sign-in .control-group label {
text-align: left;
width: auto;
font-size: 15px;
}
.sign-in .forgot {
padding-top: 5px;
}
.sign-in .content {
padding: 10px;
}
.sign-in .form-actions {
padding: 17px 10px 18px;
margin: 0;
-moz-border-radius: 0px 0px 5px 5px;
-webkit-border-radius: 0px 0px 5px 5px;
border-radius: 0px 0px 5px 5px;
}
.sign-in form {
margin: 0;
}
.sign-in .control-group .help-inline {
display:none;
}
.sign-in .error .help-inline {
display:inline-block;
}
.web-symbol:after {
font-family: 'WebSymbolsRegular';
content: "{";
margin-left: 2px;
margin-top: 8px;
}
.active .web-symbol:after {
content: "}";
} }
/*icons*/ /*icons*/
.the-icons i:after { .the-icons i:after {
@ -166,12 +510,36 @@
display: block; display: block;
margin-bottom: 5px; margin-bottom: 5px;
} }
[class^="text-"] {
font-size: 15px !important;
}
.text-blue {
color: #0088CC !important;
}
.text-red {
color: #CC3300 !important;
}
.text-yellow {
color: #ffcc00 !important;
}
.text-orange {
color: #f7941d !important;
}
.text-purple {
color: #a864a8 !important;
}
.text-palm {
color: #a67c52 !important;
}
.text-green {
color: #39b54a !important;
}
[class^="icons-"] { [class^="icons-"] {
display: inline-block; display: inline-block;
width: 16px; width: 16px;
height: 16px; height: 16px;
vertical-align: text-top; vertical-align: text-top;
background-image: url(<%= asset_path "icons_pack.png" %>); background-image: url(<%= asset_path 'icons_pack.png' %>);
background-position: 16px 16px; background-position: 16px 16px;
background-repeat: no-repeat; background-repeat: no-repeat;
*margin-right: .3em; *margin-right: .3em;
@ -181,7 +549,7 @@
*margin-left: 0; *margin-left: 0;
} }
.icons-white { .icons-white {
background-image: url(<%= asset_path "icons_pack_white.png" %>); background-image: url(<%= asset_path 'icons_pack_white.png' %>);
} }
/*1*/ /*1*/
.icons-pencil { .icons-pencil {
@ -295,6 +663,12 @@
.icons-calendars { .icons-calendars {
background-position: -384px -96px; background-position: -384px -96px;
} }
.icons-out {
background-position: -416px -96px;
}
.icons-desktop {
background-position: -448px -96px;
}
/*5*/ /*5*/
.icons-page-blank { .icons-page-blank {
background-position: 0px -128px; background-position: 0px -128px;
@ -309,6 +683,9 @@
background-position: -0px -128px; background-position: -0px -128px;
} }
/*6*/ /*6*/
.icons-globe {
background-position: -96px -160px;
}
.icons-structure { .icons-structure {
background-position: -352px -160px; background-position: -352px -160px;
} }
@ -414,6 +791,9 @@
background-position: -0px -512px; background-position: -0px -512px;
} }
/*18*/ /*18*/
.icons-help {
background-position: -160px -544px;
}
.icons- { .icons- {
background-position: -0px -544px; background-position: -0px -544px;
} }
@ -424,6 +804,9 @@
.icons-plus { .icons-plus {
background-position: -288px -576px; background-position: -288px -576px;
} }
.icons-power {
background-position: -0px -608px;
}
/*20*/ /*20*/
.icons- { .icons- {
background-position: -0px -608px; background-position: -0px -608px;

View File

@ -5,26 +5,34 @@
background-color: #FFF; background-color: #FFF;
overflow: hidden; overflow: hidden;
min-width: 300px; min-width: 300px;
border: 1px solid #DDD;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
margin: 0 0 5px 5px; margin: 0 0 5px 5px;
position:relative; position:relative;
} }
.widget-box .widget-title { .widget-box .widget-title {
background: #999;
color: #FFF; color: #FFF;
padding-left: 5px; padding-left: 5px;
border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0; -moz-border-radius: 5px 5px 0 0;
-webkit-border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0;
background-image: -moz-linear-gradient(top, #B7B7B7, #9d9d9d);
background-image: -ms-linear-gradient(top, #B7B7B7, #9d9d9d);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#B7B7B7), to(#9d9d9d));
background-image: -webkit-linear-gradient(top, #B7B7B7, #9d9d9d);
background-image: -o-linear-gradient(top, #B7B7B7, #9d9d9d);
background-image: linear-gradient(top, #B7B7B7, #9d9d9d);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#B7B7B7', endColorstr='#9d9d9d', GradientType=0);
} }
.widget-box .widget-title [class^="icons-"] { .widget-box .widget-title [class^="icons-"] {
margin: 3px 5px 0 2px; margin: 3px 5px 0 2px;
} }
.widget-box .widget-content { .widget-box .widget-content {
padding: 10px; padding: 10px;
border-width: 0 1px 1px;
border-style: solid;
border-color: #CCCCCC;
border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-radius: 0 0 5px 5px;
} }
.widget-box .form-horizontal .control-group > label { .widget-box .form-horizontal .control-group > label {
width: 50px; width: 50px;

View File

@ -16,21 +16,6 @@ class Admin::ItemsController < ApplicationController
end end
end end
#TODO
# Allow to move items down and up different parents
# def up
# @item = Item.find(params[:id])
# @item.move_higher
# redirect_to admin_items_url( :parent_name => @item.parent_name )
# end
#
# def down
# @item = Item.find(params[:id])
# @item.move_lower
# redirect_to admin_items_url( :parent_name => @item.parent_name )
# end
protected protected
def find_snippets def find_snippets

View File

@ -12,13 +12,11 @@ class Admin::LinksController < ApplicationController
def new def new
@item = Link.new @item = Link.new
@item.is_published = true @item.parent = Page.find(params[:parent_id]) rescue nil
@item.parent_id = Page.find(params[:parent_id]).id rescue nil
end end
def edit def edit
@item = Link.find(params[:id]) @item = Link.find(params[:id])
@i18n_variable = @item.i18n_variable
end end
def create def create
@ -34,7 +32,6 @@ class Admin::LinksController < ApplicationController
end end
else else
flash.now[:error] = t('admin.create_error_link') flash.now[:error] = t('admin.create_error_link')
@i18n_variable = @item.i18n_variable
render :action => "new" render :action => "new"
end end
end end
@ -52,7 +49,6 @@ class Admin::LinksController < ApplicationController
end end
else else
flash.now[:error] = t('admin.update_error_link') flash.now[:error] = t('admin.update_error_link')
@i18n_variable = @item.i18n_variable
render :action => "edit" render :action => "edit"
end end
end end
@ -60,7 +56,6 @@ class Admin::LinksController < ApplicationController
def destroy def destroy
@item = Link.find(params[:id]) @item = Link.find(params[:id])
@item.destroy @item.destroy
@item.destroy_i18n_variable
respond_to do |format| respond_to do |format|
format.html { format.html {
redirect_to admin_items_url redirect_to admin_items_url

View File

@ -11,6 +11,7 @@ class Admin::ModuleAppsController < ApplicationController
def reload_frontend_pages def reload_frontend_pages
@module_app = ModuleApp.find(params[:id]) @module_app = ModuleApp.find(params[:id])
@categories = @module_app.key.eql?('announcement') ? BulletinCategory.all : nil
respond_to do |format| respond_to do |format|
format.js {} format.js {}
end end

View File

@ -26,6 +26,12 @@ class Admin::PagePartsController < ApplicationController
@module_app = @part.module_app ? @part.module_app : @module_apps[0] @module_app = @part.module_app ? @part.module_app : @module_apps[0]
@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 @tag_objects = @r_tag.classify.constantize.all
case @module_app.key
when 'bulletin'
@categories = BulletinCategory.all
when 'web_resource'
@categories = WebLinkCategory.all
end
end end
def create def create
@ -58,6 +64,12 @@ class Admin::PagePartsController < ApplicationController
def reload_widgets def reload_widgets
@module_app = ModuleApp.find(params[:id]) @module_app = ModuleApp.find(params[:id])
case @module_app.key
when 'announcement'
@categories = BulletinCategory.all
when 'web_resource'
@categories = WebLinkCategory.all
end
respond_to do |format| respond_to do |format|
format.js {} format.js {}
end end

View File

@ -19,24 +19,28 @@ class Admin::PagesController < ApplicationController
def new def new
@item = Page.new @item = Page.new
@item.parent = Item.find(params[:parent_id]) rescue nil
@apps = ModuleApp.all @apps = ModuleApp.all
@item.is_published = true
@item.parent_id = @parent_item.id rescue nil
@designs = Design.all.entries @designs = Design.all.entries
@default_design = Design.first @design = Design.first
end end
def edit def edit
@item = Page.find(params[:id]) @item = Page.find(params[:id])
@apps = ModuleApp.all @apps = ModuleApp.all
@i18n_variable = @item.i18n_variable
@designs = Design.all.entries @designs = Design.all.entries
@design = @item.design @design = @item.design ? @item.design : @designs.first
@app_frontend_urls = @item.module_app.app_pages if @item.module_app @app_frontend_urls = @item.module_app.app_pages if @item.module_app
@categories = BulletinCategory.all if @item.module_app && @item.module_app.key.eql?('announcement')
end end
def create def create
@item = Page.new(params[:page]) @item = Page.new(params[:page])
if @item.module_app.key == 'page_content'
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
end
if @item.save if @item.save
flash.now[:notice] = t('admin.create_success_page') flash.now[:notice] = t('admin.create_success_page')
respond_to do |format| respond_to do |format|
@ -47,13 +51,20 @@ class Admin::PagesController < ApplicationController
end end
else else
flash.now[:error] = t('admin.create_error_page') flash.now[:error] = t('admin.create_error_page')
@i18n_variable = @item.i18n_variable @apps = ModuleApp.all
@designs = Design.all.entries
@design = Design.first
render :action => "new" render :action => "new"
end end
end end
def update def update
@item = Page.find(params[:id]) @item = Page.find(params[:id])
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
end
if @item.update_attributes(params[:page]) if @item.update_attributes(params[:page])
flash[:notice] = t('admin.update_success_page') flash[:notice] = t('admin.update_success_page')
respond_to do |format| respond_to do |format|
@ -70,8 +81,6 @@ class Admin::PagesController < ApplicationController
def destroy def destroy
@item = Page.find(params[:id]) @item = Page.find(params[:id])
@item.destroy @item.destroy
@item.destroy_page_parts
@item.destroy_i18n_variable
respond_to do |format| respond_to do |format|
format.html { format.html {
redirect_to admin_items_url( :parent_id => @item.parent_id ) redirect_to admin_items_url( :parent_id => @item.parent_id )

View File

@ -3,6 +3,8 @@ class ApplicationController < ActionController::Base
include ParserFrontEnd, ParserBackEnd include ParserFrontEnd, ParserBackEnd
layout :layout_by_resource
helper :all helper :all
before_filter :set_locale, :set_site before_filter :set_locale, :set_site
@ -104,6 +106,12 @@ class ApplicationController < ActionController::Base
Item.first(:conditions => {:parent_id => nil}) Item.first(:conditions => {:parent_id => nil})
end end
def layout_by_resource
if devise_controller?
"devise"
else
"application"
end
end
end end

View File

@ -1,7 +1,7 @@
class ObitFrontendComponentController< ApplicationController class ObitFrontendComponentController< ApplicationController
before_filter :setup_vars before_filter :setup_vars
before_filter {|c| c.front_end_available(@app_title)} before_filter {|c| c.front_end_available(@app_title)}
layout 'production' layout 'module_widget'
def setup_vars def setup_vars
@app_title = request.fullpath.split('/')[2] @app_title = request.fullpath.split('/')[2]

View File

@ -13,13 +13,16 @@ class PagesController < ApplicationController
def show def show
#begin #begin
item = Item.first(:conditions => {:full_name => params[:page_name]}) @item = Item.first(:conditions => {:full_name => params[:page_name]})
case item._type if @item && @item.is_published
case @item._type
when 'Page' when 'Page'
@item = item
render_page(params[:id]) render_page(params[:id])
when 'Link' when 'Link'
redirect_to "http://#{item[:url]}" redirect_to "http://#{@item[:url]}"
end
else
render :file => "#{Rails.root}/public/404.html", :status => :not_found
end end
#rescue #rescue
# render :file => "#{Rails.root}/public/404.html", :status => :not_found # render :file => "#{Rails.root}/public/404.html", :status => :not_found
@ -35,14 +38,18 @@ class PagesController < ApplicationController
end end
def load_orbit_bar def load_orbit_bar
render :partial => 'layouts/orbit_bar' render :partial => 'layouts/orbit_bar', :locals => {:referer => request.referer}
end end
protected protected
def get_item def get_item
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]}) module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
if params[:category_id]
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id]})
else
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]}) @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]})
end end
end
end end

View File

@ -11,7 +11,7 @@ module Admin::ItemHelper
end end
ret << "<ul class='list'>" ret << "<ul class='list'>"
ret << "<li>" ret << "<li>"
ret << (link_to node.name, dest) ret << (link_to node.i18n_variable[I18n.locale], dest)
ret << ' | ' << (link_to t('admin.edit'), eval("edit_admin_#{node._type.downcase}_path(node)")) if node._type.eql?('Page') ret << ' | ' << (link_to t('admin.edit'), eval("edit_admin_#{node._type.downcase}_path(node)")) if node._type.eql?('Page')
ret << ' | ' << (link_to t('admin.new_page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page') if node._type.eql?('Page') ret << ' | ' << (link_to t('admin.new_page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page') if node._type.eql?('Page')
ret << ' | ' << (link_to t('admin.new_link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link') if node._type.eql?('Page') ret << ' | ' << (link_to t('admin.new_link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link') if node._type.eql?('Page')

View File

@ -21,23 +21,35 @@ module ApplicationHelper
end end
# Clean the link back # Clean the link back
# Remove the locale but keep all the other params
def get_go_back def get_go_back
begin begin
if request.url.include?('locale=') if request.url.include?('locale=')
session[:last_page] session[:last_page]
else else
target = request.referer.split('?') session[:last_page] = remove_locale(request.referer)
end
rescue
eval(params[:controller].split('/').join('_') << '_url')
end
end
# Remove the locale but keep all the other params
def remove_locale(url)
target = url.split('?')
vars = target[1].split('&') rescue [] vars = target[1].split('&') rescue []
vars.delete_if {|var| var.include? 'locale=' } vars.delete_if {|var| var.include? 'locale=' }
session[:last_page] = if vars.size > 0 if vars.size > 0
target[0].to_s + '?' + vars.join('&') target[0].to_s + '?' + vars.join('&')
else else
target[0].to_s target[0].to_s
end end
end end
rescue
eval(params[:controller].split('/').join('_') << '_url') def add_locale(url, locale)
if url.include?('?')
url + "&locale=#{locale}"
else
url + "?locale=#{locale}"
end end
end end
@ -56,4 +68,43 @@ module ApplicationHelper
end end
end end
def active_for_controllers(*controller_names)
controller_names.include?(controller.controller_name) ? 'active' : nil
end
def visible_for_controllers(*controller_names)
controller_names.include?(controller.controller_name) ? '' : 'hide'
end
def active_for_action(controller_name, action_name)
(controller.controller_name.eql?(controller_name) && controller.action_name.eql?(action_name)) ? 'active' : nil
end
def sortable(column)
direction = (column == params[:sort] && params[:direction] == "asc") ? "desc" : "asc"
{:sort => column, :direction => direction}
end
def is_sort_active?(name)
res = ''
res << ' select' if params[:sort].eql?(name)
res << ' active' if params[:sort].eql?(name) && params[:direction].eql?('asc')
res
end
def is_sort?(name)
' web-symbol' if params[:sort].eql?(name)
end
def add_filter(param_name, value)
filter = params[:filter] rescue nil
if filter && filter.has_key(param_name)
filter[param_name] << value
elsif filter
filter.merge({param_name => [value]})
else
{param_name => [value]}
end
end
end end

View File

@ -20,7 +20,7 @@ class Design
validates_presence_of :title validates_presence_of :title
validates_presence_of :author validates_presence_of :author
# after_save :parse_css_for_images after_save :parse_css_for_images
def new_files=(*attrs) def new_files=(*attrs)
attrs[0].map do |key,items_ary| #Loop by JSs,Themes,Imgs attrs[0].map do |key,items_ary| #Loop by JSs,Themes,Imgs

View File

@ -5,15 +5,13 @@ class Item
field :name, :index => true field :name, :index => true
field :full_name, :index => true field :full_name, :index => true
field :parent_id, :index => true
field :parent_name
field :position, :type => Integer field :position, :type => Integer
field :is_published, :type => Boolean, :default => true, :index => true field :is_published, :type => Boolean, :default => false, :index => true
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, :full_name, :position, :is_published validates_presence_of :name, :full_name, :position
belongs_to :parent, :class_name => "Item" belongs_to :parent, :class_name => "Item"
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
@ -47,9 +45,6 @@ class Item
self.position = (max_page)? max_page + 1 : 1 self.position = (max_page)? max_page + 1 : 1
end end
# Set the parent value
self.parent_name = Item.first(:conditions => {:id => self.parent_id} ).name rescue nil
# Build the full_name from the ancestors array # Build the full_name from the ancestors array
full_node = self.ancestors.map{ |a| a.name }.push( self.name ) full_node = self.ancestors.map{ |a| a.name }.push( self.name )
# Remove root node if not root # Remove root node if not root

View File

@ -7,6 +7,7 @@ class Page < Item
belongs_to :design belongs_to :design
belongs_to :module_app belongs_to :module_app
has_many :page_parts, :autosave => true, :dependent => :destroy has_many :page_parts, :autosave => true, :dependent => :destroy
has_many :page_contexts, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :page_parts, :allow_destroy => true accepts_nested_attributes_for :page_parts, :allow_destroy => true
before_save :create_parts before_save :create_parts

View File

@ -53,4 +53,8 @@ class User
value ? value : self.attribute_values.build value ? value : self.attribute_values.build
end end
def self.from_id(id)
User.find(id) rescue nil
end
end end

View File

@ -1 +1,464 @@
Dashboard <div id="isotope">
<div class="item element">
<h3><i class="icons-member"></i><a href="">Member</a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-content"></i><a href="">Content</a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-asset"></i><a href="">Asset</a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href="">Traffic</a></h3>
<div class="detail w-a h-b">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href="">Site info</a></h3>
<div class="detail w-b h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href="">Connection</a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -18,7 +18,7 @@
<td> <td>
<%= design.title %> <%= design.title %>
<div class="quick-edit"> <div class="quick-edit">
<ul class="nav nav-pills hide"> <ul class="nav nav-pills">
<li><%= link_to t(:edit), edit_admin_design_path(design), :class => 'edit' %></li> <li><%= link_to t(:edit), edit_admin_design_path(design), :class => 'edit' %></li>
<li class="dropdown"><%= link_to t(:delete), admin_design_path(design), :confirm => t('sure?'), :method => :delete, :class => 'delete' %></li> <li class="dropdown"><%= link_to t(:delete), admin_design_path(design), :confirm => t('sure?'), :method => :delete, :class => 'delete' %></li>
</ul> </ul>

View File

@ -1,17 +1,19 @@
<%= f.error_messages %> <%= f.error_messages %>
<%= f.hidden_field :parent_id %> <%= f.hidden_field :parent, :value => @item.parent.id %>
<p> <p>
<%= f.label :name, "Name" %> <%= f.label :name, "Name" %>
<%= f.text_field :name, :class => 'text' %> <%= f.text_field :name, :class => 'text' %>
</p> </p>
<%= f.fields_for :i18n_variable, (@item.new_record? ? @item.build_i18n_variable : @item.i18n_variable) do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<p> <p>
<%= label_tag "link[title]", "#{t('admin.title')} #{locale}" %> <%= f.label :locale, "#{t('admin.title')} #{I18nVariable.from_locale(locale)}" %>
<%= text_field_tag "link[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :class => 'text' %> <%= f.text_field locale %>
</p> </p>
<% end %> <% end %>
<% end %>
<p> <p>
<%= f.label :is_published, t('admin.is_published') %> <%= f.label :is_published, t('admin.is_published') %>

View File

@ -1 +1,2 @@
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', @module_app.app_pages) %>"); $('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', @module_app.app_pages) %>");
$('#app_page_category').html("<%= escape_javascript(select 'page', 'category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}) if @categories %>");

View File

@ -1,5 +1,3 @@
<%= @part.inspect %><br/><br/>
<%= form_for @part, :url => admin_page_part_path(@part) do |f| %> <%= form_for @part, :url => admin_page_part_path(@part) do |f| %>
<% LIST[:page_part_kinds].each do |kind| %> <% LIST[:page_part_kinds].each do |kind| %>

View File

@ -5,3 +5,8 @@
<span id='widget_list'> <span id='widget_list'>
<%= f.select :widget_path, @module_app.widgets.collect{|widget| [widget.humanize, widget]}, :selected => @part.widget_path %> <%= f.select :widget_path, @module_app.widgets.collect{|widget| [widget.humanize, widget]}, :selected => @part.widget_path %>
</span> </span>
<span id="widget_category">
<%= render 'widget_categories' %>
</span>

View File

@ -2,7 +2,7 @@
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<div> <div>
<%= I18nVariable.from_locale(locale) %> <%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale %> <%= f.text_area locale %>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -0,0 +1 @@
<%= select 'page_part', 'category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => (@part ? @part[:category] : nil) if @categories && @categories.size > 0 %>

View File

@ -1 +1,2 @@
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|widget| [widget.humanize, widget]}) %>") $('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|widget| [widget.humanize, widget]}) %>")
$('#widget_category').html("<%= j render 'widget_categories' %>")

View File

@ -1,39 +1,33 @@
<%= f.error_messages %> <%= f.error_messages %>
<%= f.hidden_field :parent_id %> <%= f.hidden_field :parent, :value => (@item.parent.id rescue nil) %>
<p> <p>
<%= f.label :name, t('admin.name') %> <%= f.label :name, t('admin.name') %>
<%= f.text_field :name, :class => 'text' %> <%= f.text_field :name, :class => 'text' %>
</p> </p>
<%= f.fields_for :i18n_variable, (@item.new_record? ? @item.build_i18n_variable : @item.i18n_variable) do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<p> <p>
<%= label_tag "page[title]", "#{t('admin.title')} #{locale}" %> <%= f.label :locale, "#{t('admin.title')} #{I18nVariable.from_locale(locale)}" %>
<%= text_field_tag "page[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :class => 'text' %> <%= f.text_field locale %>
</p> </p>
<% end %> <% end %>
<% end %>
<p> <p>
<%= t('admin.design_name') %> <%= t('admin.design_name') %>
<% if @design %> <%= f.collection_select :design, @designs, :id, :title, {:selected => @design.id}, {:rel => admin_pages_path} %>
<%= f.collection_select :design_id, @designs, :id, :title, {}, :rel => admin_pages_path %>
<% else %>
<%= f.select :design_id, @designs.collect { |d| [d.title, d.id] }, {:selected => @default_design.id}, {:rel => admin_pages_path} %>
<% end %>
</p> </p>
<p> <p>
<%= t('admin.theme') %> <%= t('admin.theme') %>
<% if @design %>
<%= f.select :theme_id, @design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %> <%= f.select :theme_id, @design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %>
<% else %>
<%= f.select :theme_id, @default_design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %>
<% end %>
</p> </p>
<p> <p>
<%= t('admin.module_app') %> <%= t('admin.module_app') %>
<%= render :partial => "admin/module_apps/app_selector", :locals => { :f => f } %> <%= render :partial => "admin/module_apps/app_selector", :locals => { :f => f } %>
<span id="app_page_url"><%= select('page','app_frontend_url', @app_frontend_urls ) rescue ''%> </span> <span id="app_page_url"><%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%> </span>
<span id="app_page_category"><%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category] ) rescue ''%> </span>
</p> </p>
<p> <p>
<%= f.label :is_published, "#{t('admin.is_published')} ?" %> <%= f.label :is_published, "#{t('admin.is_published')} ?" %>

View File

@ -1,12 +1,22 @@
<h2>Forgot your password?</h2>
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> <h1 class="login-logo"><%= t(:ruling_site) %></h1>
<div id="signin-header">
<h3><%= t(:forgot_password) %></h3>
</div>
<div id="container" class="sign-in">
<%= form_for :user, :url => user_password_path, :html => {:class => 'user_new form-horizontal'} do |f| %>
<%= devise_error_messages! %> <%= devise_error_messages! %>
<div class="content">
<div><%= f.label :email %><br /> <div class="main">
<%= f.email_field :email %></div> <div class="control-group clear">
<%= f.label :email %>
<div><%= f.submit "Send me reset password instructions" %></div> <%= f.email_field :email, :placeholder => t(:email), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span>
</div>
</div>
</div>
<div class="form-actions clear">
<%= content_tag :button, "Send me reset password instructions", :type => :submit, :class => 'btn btn-primary pull-right' %>
</div>
<% end %> <% end %>
</div>
<%= render :partial => "devise/shared/links" %>

View File

@ -1,17 +1,35 @@
<h2>Sign in</h2>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> <h1 class="login-logo"><%= t(:ruling_site) %></h1>
<div><%= f.label :nccu_ldap_uid %><br /> <div id="signin-header">
<%= f.text_field :nccu_ldap_uid %></div> <h3><%= t(:login) %></h3>
</div>
<div><%= f.label :password %><br /> <div id="container" class="sign-in">
<%= f.password_field :password %></div> <%= form_for :user, :url => user_session_path, :html => {:class => 'user_new form-horizontal'} do |f| %>
<div class="content">
<% if devise_mapping.rememberable? -%> <p class="notice hide">Notice</p>
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div> <p class="alert hide">You need to sign in or sign up before continuing.</p>
<% end -%> <div class="main">
<div class="control-group clear">
<div><%= f.submit "Sign in" %></div> <%= f.label :email %>
<%= f.email_field :email, :placeholder => t(:email), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span>
</div>
<div class="control-group clear">
<%= link_to t(:forgot_password), new_user_password_path, :class => 'pull-right forgot' %>
<%= f.label :password %>
<%= f.password_field :password, :placeholder => t(:dots), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span>
</div>
</div>
</div>
<div class="form-actions clear">
<div class=" pull-left">
<label for="user_remember_me">
<%= f.check_box :remember_me, :style => "display: inline-block;" %>
<span style="display: inline-block;height: 10px;"><%= t(:remember_me) %></span>
</label>
</div>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary pull-right' %>
</div>
<% end %> <% end %>
</div>
<%= render :partial => "devise/shared/links" %>

View File

@ -1,9 +1,3 @@
<% if controller.controller_name.eql?('pages') %>
<link href='/assets/bootstrap.css.erb' rel='stylesheet' type='text/css'/>
<link href='/assets/style.css.erb' rel='stylesheet' type='text/css'/>
<script type='text/javascript' src='/assets/bootstrap.js'></script>
<% end %>
<header id="orbit-bar" class="navbar"> <header id="orbit-bar" class="navbar">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="container clear"> <div class="container clear">
@ -11,36 +5,98 @@
<a class="brand dropdown-toggle" data-toggle="dropdown" href="#">Orbit</a> <a class="brand dropdown-toggle" data-toggle="dropdown" href="#">Orbit</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><%= link_to content_tag(:i, nil, :class => 'icons-dashboard') + t('admin.dashboard'), admin_dashboards_path %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-dashboard') + t('admin.dashboard'), admin_dashboards_path %></li>
<li><a href="#"><i class="icons-content"></i>Content</a></li> <li><a href="#"><i class="icons-content"></i><%= t('admin.content') %></a></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-asset') + t('admin.asset'), admin_assets_path %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-asset') + t('admin.asset'), admin_assets_path %></li>
<li class="divider"></li> <li class="divider"></li>
<li><a href="#"><i class="icons-structure"></i>Structure</a></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-structure') + t('admin.structure'), admin_items_path %></li>
<li><a href="#"><i class="icons-plus-cube"></i>Add Item</a></li> <li><a href="#"><i class="icons-plus-cube"></i><%= t('admin.add_item') %></a></li>
</ul> </ul>
</div> </div>
<ul class="nav"> <ul class="nav">
<li><%= link_to t(:homepage), root_path, :class => 'orbit-bar-home' %></li> <li><%= link_to t(:homepage), root_path, :class => 'orbit-bar-home' %></li>
<li><a class="orbit-bar-desktop" href="#">Desktop</a></li>
</ul> </ul>
<ul class="nav pull-right"> <ul class="nav pull-right">
<% if user_signed_in? %> <li class="dropdown language">
<li><%= link_to t(:logout), destroy_user_session_path, :class => 'orbit-bar-logout' %></li> <a class="dropdown-toggle orbit-bar-language" href="#" data-toggle="dropdown">language</a>
<% else %> <ul class="dropdown-menu language-menu">
<li> <% @site_in_use_locales.each do |locale| %>
<%= form_for "user", :url => user_session_path, :html => {:class => 'log'} do |f| %> <%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil) %>
<%= f.text_field :email, :class => 'input-small', :placeholder => t(:email) %>
<%= f.password_field :password, :class => 'input-small', :placeholder => t(:password) %>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn' %>
<% end %> <% end %>
</ul>
</li> </li>
<% end %> <% if user_signed_in? %>
<li class="dropdown active clear">
<a class="orbit-bar-account" href="#" data-toggle="dropdown">
<!-- <img src="images/menber-pic.png" /> -->
<%= image_tag current_user.avatar.thumb.url, :class => 'member-img' %>
<span class="member-name"><%= current_user.name %></span>
</a>
<ul class="dropdown-menu account-menu">
<li> <li>
<form class="navbar-search pull-left" action=""> <a href="#">
<input class="search-query span2" type="text" placeholder="Search"> <i class="icons-wrench"></i>
</form> <%= t(:account_settings) %>
</a>
</li>
<li>
<a class="orbit-bar-desktop" href="#">
<i class="icons-desktop"></i>
<%= t(:desktop) %>
</a>
</li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-out') + t(:logout), destroy_user_session_path %></li>
<li class="divider"></li>
<li>
<a href="#">
<i class="icons-help"></i>
<%= t(:help) %>
</a>
</li> </li>
</ul> </ul>
</li>
<% else %>
<li class="dropdown bar-login">
<a class="dropdown-toggle orbit-bar-member" href="#"><%= t(:login) %></a>
<div class="dropdown-menu">
<ul class="log">
<li class="title"></li>
<%= form_for :user, :url => user_session_path do |f| %>
<li>
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<%= f.text_field :email, :class => 'span2', :placeholder => t(:email), :size => 16 %>
</div>
</li>
<li>
<div class="input-prepend">
<span class="add-on"><i class="icon-lock"></i></span>
<%= f.password_field :password, :class => 'span2', :placeholder => t(:password), :size => 16 %>
</div>
</li>
<li class="clear">
<%= link_to t(:forgot_password), new_user_password_path, :class => 'forgot' %>
</li>
<li>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
<label class="remember" for="user_remember_me">
<%= f.check_box :remember_me %>
<span style="display: inline-block;height: 10px;"><%= t(:remember_me) %></span>
</label>
</li>
<li class="divider"><span><%= t(:or_lower) %></span></li>
<% end %>
</ul>
<%= link_to t(:register), new_user_registration_path, :class => 'btn btn-danger register' %>
</div>
</li>
<% end %>
</ul>
<form class="navbar-search span6" action="">
<input class="search-query span4" type="text" placeholder="Search NCCU">
</form>
</div> </div>
</div> </div>
</header> </header>

View File

@ -1,7 +1,33 @@
<li><%= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %></li> <%= content_tag :li, :class => active_for_controllers('purchases') do -%>
<li><%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.announcement'), panel_announcement_back_end_bulletins_path %></li> <%= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %>
<li><%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %></li> <% end -%>
<li><%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.page'), admin_items_path %></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-window-block') + t('admin.design'), admin_designs_path %></li> <%= content_tag :li, :class => active_for_controllers('bulletins', 'tags', 'bulletin_categorys') do -%>
<li><%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), nil %></li> <%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.announcement'), panel_announcement_back_end_bulletins_path %>
<li><%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), nil %></li> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', 'tags', 'bulletin_categorys')) do -%>
<%= content_tag :li, link_to(t('admin.all_articles'), panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index') %>
<%= content_tag :li, link_to(t('admin.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %>
<%= content_tag :li, link_to(t('admin.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %>
<%= content_tag :li, link_to(t('admin.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('tags', 'index') %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('users') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), panel_web_resource_back_end_web_links_path %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers(nil) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.page'), panel_page_content_back_end_page_contexts_path %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('designs') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-window-block') + t('admin.design'), admin_designs_path %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers(nil) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), nil %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers(nil) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), nil %>
<% end -%>

View File

@ -0,0 +1,20 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title><%= @title || APP_CONFIG['orbit'] %></title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<%= stylesheet_link_tag "devise" %>
<%= javascript_include_tag "devise" %>
<%= csrf_meta_tag %>
</head>
<body>
<%= render 'layouts/orbit_bar' %>
<%= yield %>
<div id="sign-footer">
<p>Rulingcom</p>
</div>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<%#= stylesheet_link_tag "module_widget" %>
<%= javascript_include_tag "module_widget" %>
<%= csrf_meta_tag %>
</head>
<body>
<%= yield %>
</body>
</html>

View File

@ -6,24 +6,32 @@ en:
_locale: English _locale: English
me: Me me: Me
account_settings: Account settings
add: Add add: Add
back: Back back: Back
cancel: Cancel cancel: Cancel
create: Create create: Create
delete: Delete delete: Delete
desktop: Desktop
disable: Disable disable: Disable
dots: ●●●●●●
downloaded: Downloaded downloaded: Downloaded
download: Download download: Download
edit: Edit edit: Edit
email: Email email: Email
enable: Enable enable: Enable
forgot_password: Forgot your password?
help: Help
hide: Hide hide: Hide
homepage: Homepage homepage: Homepage
login: Login login: Login
logout: Logout
no_: "No" no_: "No"
nothing: Nothing nothing: Nothing
or_lower: or
password: Password password: Password
register: Register
remember_me: Remember me
show: Show show: Show
submit: Submit submit: Submit
sure?: Are you sure? sure?: Are you sure?
@ -34,6 +42,7 @@ en:
action: Action action: Action
ad_banner: AD Banner ad_banner: AD Banner
add: Add add: Add
add_item: Add item
add_language: Add language add_language: Add language
add_drop_down_item: +Add Menu Item add_drop_down_item: +Add Menu Item
admin: Admin admin: Admin
@ -62,7 +71,7 @@ en:
create_success_snippet: Snippet was successfully created. create_success_snippet: Snippet was successfully created.
create_success_user: User was successfully created. create_success_user: User was successfully created.
data: Data data: Data
dashbroad: Dashbroad dashboard: Dashboard
delete_language: Delete language delete_language: Delete language
description: Description description: Description
design: Design design: Design
@ -121,6 +130,7 @@ en:
non_multilingual: Non multilingual non_multilingual: Non multilingual
options: Options options: Options
orig_upload_file: Original filename orig_upload_file: Original filename
page: Page
position: Position position: Position
published?: Published? published?: Published?
purchase: Purchase purchase: Purchase
@ -133,6 +143,7 @@ en:
site: Site site: Site
site_setting: Site Setting site_setting: Site Setting
super_pages: Super pages super_pages: Super pages
structure: Structure
title: Title title: Title
translation: Translation translation: Translation
type: Type type: Type

View File

@ -3,19 +3,34 @@ zh_tw:
_locale: 中文 _locale: 中文
me: me:
account_settings: 帳號設定
add: 新增 add: 新增
back: 回去 back: 回上一步
create: 創造 cancel: 取消
create: 創建
delete: 刪除 delete: 刪除
desktop: 桌面
disable: 禁用 disable: 禁用
dots:
downloaded: 已經下載
download: 下載
edit: 編輯 edit: 編輯
email: 電子郵件
enable: 啟用 enable: 啟用
forget_password: 忘記密碼?
help: 協助
hide: 隱藏 hide: 隱藏
homepage: 首頁 homepage: 首頁
login: 登入
logout: 登出
no_: "No" no_: "No"
nothing: nothing:
or_lower: 或者
password: 密碼
register: 註冊
remember_me: 記住我
show: 顯示 show: 顯示
submit: 送出
sure?: 您肯定嗎? sure?: 您肯定嗎?
update: 更新 update: 更新
yes_: "Yes" yes_: "Yes"
@ -23,6 +38,8 @@ zh_tw:
admin: admin:
action: 操作 action: 操作
ad_banner: 廣告輪播 ad_banner: 廣告輪播
add: 新增
add_item: 新增項目
add_language: 新增語言 add_language: 新增語言
add_drop_down_item: 增加Orbit選單 add_drop_down_item: 增加Orbit選單
admin: 管理 admin: 管理
@ -38,7 +55,7 @@ zh_tw:
calendar: 行事曆 calendar: 行事曆
cant_delete_self: 您不可以刪除自己。 cant_delete_self: 您不可以刪除自己。
cant_revoke_self_admin: 您不可以撤銷自己的管理作用。 cant_revoke_self_admin: 您不可以撤銷自己的管理作用。
choose_file: 選擇一個文件... choose_file: 選擇一個文件...
class: 階級 class: 階級
content: 內容 content: 內容
create_error_link: 創建連接時出錯。 create_error_link: 創建連接時出錯。
@ -47,10 +64,14 @@ zh_tw:
create_success_layout: 樣板已成功創建。 create_success_layout: 樣板已成功創建。
create_success_link: 連結已成功創建。 create_success_link: 連結已成功創建。
create_success_page: 頁面已成功創建。 create_success_page: 頁面已成功創建。
create_success_home: 首頁已成功創建。
create_success_layout: 佈局已成功創建。
create_success_link: 連結已成功創建。
create_success_page: 頁面已成功創建。
create_success_snippet: 片段已成功創建。 create_success_snippet: 片段已成功創建。
create_success_user: 用戶已成功創建。。 create_success_user: 用戶已成功創建。。
dashbroad: 儀表板 dashboard: 儀表板
data: 數據 data: 資料數據
delete_language: 刪除語言 delete_language: 刪除語言
description: 描述 description: 描述
design: 網站版型 design: 網站版型
@ -81,7 +102,7 @@ zh_tw:
list_assets: 資產列表 list_assets: 資產列表
list_designs: 設計列表 list_designs: 設計列表
list_items: 項目列表 list_items: 項目列表
list_layouts: 佈局列表 list_puchases: 購買清單
list_snippets: 斷片列表 list_snippets: 斷片列表
list_users: 使用列表 list_users: 使用列表
list_infos: 用戶資料列表 list_infos: 用戶資料列表
@ -109,6 +130,7 @@ zh_tw:
non_multilingual: 非多種語言 non_multilingual: 非多種語言
options: 選項 options: 選項
orig_upload_file: 原上傳檔名 orig_upload_file: 原上傳檔名
page: Page
position: 位置 position: 位置
published?: 發布? published?: 發布?
purchase: 購買 purchase: 購買
@ -120,9 +142,11 @@ zh_tw:
site: 網站 site: 網站
site_setting: 網站設定 site_setting: 網站設定
super_pages: 可編頁面 super_pages: 可編頁面
structure: 網站結構
title: 標題 title: 標題
translation: 翻譯 translation: 翻譯
type: 類型 type: 類型
up_to_date: 最新版本
update_error_link: 更新鏈接時出現錯誤。 update_error_link: 更新鏈接時出現錯誤。
update_error_page: 更新頁面時出現錯誤。 update_error_page: 更新頁面時出現錯誤。
update_success_content: 內容已成功更新。 update_success_content: 內容已成功更新。

View File

@ -64,6 +64,7 @@ module ParserBackEnd
res << "<script type='text/javascript' src='/static/jquery.js'></script>" res << "<script type='text/javascript' src='/static/jquery.js'></script>"
res << "<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>" res << "<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>"
res << "<script type='text/javascript' src='/static/kernel.js'></script>" res << "<script type='text/javascript' src='/static/kernel.js'></script>"
res << "<script type='text/javascript' src='/assets/event.js'></script>"
page.design.javascripts.each do |js| page.design.javascripts.each do |js|
res << "<script type='text/javascript' src='#{js.file.url}'></script>" res << "<script type='text/javascript' src='#{js.file.url}'></script>"
end end
@ -74,7 +75,7 @@ module ParserBackEnd
ad_banner = AdBanner.find(tag.attr["id"]) rescue nil ad_banner = AdBanner.find(tag.attr["id"]) rescue nil
if ad_banner if ad_banner
res << "<script type='text/javascript'> res << "<script type='text/javascript'>
$(document).ready(function(){ $('#slideshow-#{ad_banner.title.dehumanize}').cycle({after: onAfter,timeout:1 ,fx: '#{ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx}' }); }); $(document).ready(function(){ $('#slideshow-#{ad_banner.title.dehumanize}').cycle({delay: -1000, fx: '#{ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx}', timeoutFn: getTimeout }); });
</script>" </script>"
res << "<div id='slideshow-#{ad_banner.title.dehumanize}'>" res << "<div id='slideshow-#{ad_banner.title.dehumanize}'>"
ad_banner.ad_images.each do |ad_image| ad_banner.ad_images.each do |ad_image|
@ -98,7 +99,9 @@ module ParserBackEnd
c.define_tag 'content' do |tag| c.define_tag 'content' do |tag|
ret = '' ret = ''
if (tag.attributes["main"] == "true" && !page.module_app.nil?) if (tag.attributes["main"] == "true" && !page.module_app.nil?)
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}?inner=true'></div>" ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}?inner=true&page_id=#{page.id}"
ret << "&bulletin_category_id=#{page.category}" if page[:category]
ret << "'></div>"
else else
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s }
ret << "<div id='#{tag.attr['name']}' part_id='#{part.id}' class='editable' style='border:solid 1px; margin:5px; padding:5px;'>" ret << "<div id='#{tag.attr['name']}' part_id='#{part.id}' class='editable' style='border:solid 1px; margin:5px; padding:5px;'>"
@ -109,7 +112,11 @@ module ParserBackEnd
when 'text' when 'text'
ret << part.i18n_variable[I18n.locale] rescue '' ret << part.i18n_variable[I18n.locale] rescue ''
when 'module_widget' when 'module_widget'
if part[:category]
ret << "<div class='dymanic_load' path='/panel/#{part.module_app.key}/widget/#{part.widget_path}?category_id=#{part[:category]}'></div>"
else
ret << "<div class='dymanic_load' path='/panel/#{part.module_app.key}/widget/#{part.widget_path}'></div>" ret << "<div class='dymanic_load' path='/panel/#{part.module_app.key}/widget/#{part.widget_path}'></div>"
end
when 'public_r_tag' when 'public_r_tag'
ret << "<r:#{part.public_r_tag} id='#{part.public_r_tag_object_id}'/>" ret << "<r:#{part.public_r_tag} id='#{part.public_r_tag_object_id}'/>"
else else

View File

@ -6,7 +6,7 @@ module ParserCommon
if current != 0 if current != 0
res << "<div class='rc_dm'>" res << "<div class='rc_dm'>"
item = rand(100000) item = rand(100000)
res << "<a href='#{edit ? admin_page_path(page.id) : page.full_name}' class='dm_ctrl' rel='#{item}'>#{page.name}<span class='down'></span></a>" res << "<a href='#{edit ? admin_page_path(page.id) : page.full_name}' class='dm_ctrl' rel='#{item}'>#{page.i18n_variable[I18n.locale]}<span class='down'></span></a>"
if page.children.size > 0 if page.children.size > 0
res << "<div id='#{item}' class='dm_list #{menu.values['class_#{current}']}'>" res << "<div id='#{item}' class='dm_list #{menu.values['class_#{current}']}'>"
res << "<ul class='ini_list'>" res << "<ul class='ini_list'>"
@ -22,7 +22,7 @@ module ParserCommon
res << "</div>" res << "</div>"
else else
res << '<ul>' res << '<ul>'
res << "<li>" + "<a href='#{edit ? admin_page_path(page.id) : page.full_name}' class='dm_ctrl'>#{page.name}</a>" + "</li>" res << "<li>" + "<a href='#{edit ? admin_page_path(page.id) : page.full_name}' class='dm_ctrl'>#{page.i18n_variable[I18n.locale]}</a>" + "</li>"
page.children.each do |child| page.children.each do |child|
res << "<li>" + menu_level(child, current + 1, menu, edit) + "</li>" res << "<li>" + menu_level(child, current + 1, menu, edit) + "</li>"
end end
@ -39,7 +39,7 @@ module ParserCommon
if page.children.size > 0 if page.children.size > 0
res << menu_level(page, current + 1, menu, edit) res << menu_level(page, current + 1, menu, edit)
else else
res << "<a href='#{edit ? admin_page_path(page.id) : page.full_name}' class='nav dm_ctrl'>#{page.name}</a>" res << "<a href='#{edit ? admin_page_path(page.id) : page.full_name}' class='nav dm_ctrl'>#{page.i18n_variable[I18n.locale]}</a>"
end end
res << "</li>" res << "</li>"
end end

View File

@ -61,6 +61,8 @@ module ParserFrontEnd
end end
c.define_tag 'stylesheets' do |tag| c.define_tag 'stylesheets' do |tag|
res = '' res = ''
res << "<link href='/assets/bootstrap.css.erb' rel='stylesheet' type='text/css'/>"
res << "<link href='/assets/style.css.erb' rel='stylesheet' type='text/css'/>"
res << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />" if page.design.reset_css res << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />" if page.design.reset_css
res << "<link href='#{page.design.default_css.file.url}' rel='stylesheet' type='text/css' /> " if page.design.default_css res << "<link href='#{page.design.default_css.file.url}' rel='stylesheet' type='text/css' /> " if page.design.default_css
theme = page.design.themes.detect{ |d| d.id == page.theme_id } theme = page.design.themes.detect{ |d| d.id == page.theme_id }
@ -72,7 +74,12 @@ module ParserFrontEnd
res << "<script type='text/javascript' src='/static/jquery.js'></script>" res << "<script type='text/javascript' src='/static/jquery.js'></script>"
res << "<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>" res << "<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>"
res << "<script type='text/javascript' src='/static/kernel.js'></script>" res << "<script type='text/javascript' src='/static/kernel.js'></script>"
res << "<script type='text/javascript' src='/assets/bootstrap.js'></script>"
res << "<script type='text/javascript' src='/assets/jquery.tinyscrollbar.min.js'></script>"
res << "<script type='text/javascript' src='/assets/jquery.isotope.min.js'></script>"
res << "<script type='text/javascript' src='/assets/orbit-1.0.js'></script>"
res << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>" res << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>"
res << "<script type='text/javascript' src='/assets/event.js'></script>"
page.design.javascripts.each do |js| page.design.javascripts.each do |js|
res << "<script type='text/javascript' src='#{js.file.url}'></script>" res << "<script type='text/javascript' src='#{js.file.url}'></script>"
end end
@ -83,7 +90,7 @@ module ParserFrontEnd
ad_banner = AdBanner.find(tag.attr["id"]) rescue nil ad_banner = AdBanner.find(tag.attr["id"]) rescue nil
if ad_banner && ad_banner.display? if ad_banner && ad_banner.display?
res << "<script type='text/javascript'> res << "<script type='text/javascript'>
$(document).ready(function(){ $('#slideshow-#{ad_banner.title.dehumanize}').cycle({after: onAfter,timeout:1 ,fx: '#{ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx}' }); }); $(document).ready(function(){ $('#slideshow-#{ad_banner.title.dehumanize}').cycle({delay: -1000, fx: '#{ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx}', timeoutFn: getTimeout }); });
</script>" </script>"
res << "<div id='slideshow-#{ad_banner.title.dehumanize}'>" res << "<div id='slideshow-#{ad_banner.title.dehumanize}'>"
ad_banner.ad_images.each do |ad_image| ad_banner.ad_images.each do |ad_image|
@ -119,14 +126,20 @@ module ParserFrontEnd
if (tag.attributes["main"] == "true" && !page.module_app.nil?) if (tag.attributes["main"] == "true" && !page.module_app.nil?)
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}" ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}"
ret << "/#{id}" if id ret << "/#{id}" if id
ret << "?inner=true'></div>" ret << "?inner=true&page_id=#{page.id}"
ret << "&bulletin_category_id=#{page.category}" if page[:category]
ret << "'></div>"
else else
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil
case part.kind case part.kind
when 'text' when 'text'
ret << part.i18n_variable[I18n.locale] rescue '' ret << part.i18n_variable[I18n.locale] rescue ''
when 'module_widget' when 'module_widget'
if part[:category]
ret << "<div class='dymanic_load' path='/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true&category_id=#{part[:category]}'></div>"
else
ret << "<div class='dymanic_load' path='/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true'></div>" ret << "<div class='dymanic_load' path='/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true'></div>"
end
when 'public_r_tag' when 'public_r_tag'
ret << "<r:#{part.public_r_tag} id='#{part.public_r_tag_object_id}'/>" ret << "<r:#{part.public_r_tag} id='#{part.public_r_tag_object_id}'/>"
else else

View File

@ -0,0 +1,11 @@
# encoding: utf-8
namespace :add_content do
task :build => :environment do
ModuleApp.new.from_json(File.open("#{Rails.root}/vendor/built_in_modules/page_content/page_content.json").read).save
end
end

144
public/static/Other.xml Normal file
View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>國立政治大學校園活動行事曆</title>
<link rel="alternate" href="http://events.nccu.edu.tw/" />
<subtitle>其他類別-最新活動</subtitle>
<dc:language>zh-tw</dc:language>
<entry>
<title>國立政治大學101學年度碩士班暨碩士在職專班招生考試</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2697&amp;key2=20120225" />
<author>
<name />
</author>
<summary type="text">101/02/25-101/02/26 07:00-17:00</summary>
</entry>
<entry>
<title>國立中正大學101學年度碩士班招生考試</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2698&amp;key2=20120310" />
<author>
<name />
</author>
<summary type="text">101/03/10 07:00-17:00</summary>
</entry>
<entry>
<title>「樂活飲食•健康之鑰」系列活動--膳食纖維的功用及食物來源</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2749&amp;key2=20120229" />
<author>
<name />
</author>
<summary type="text">101/02/29 12:00-14:00</summary>
</entry>
<entry>
<title>「樂活飲食•健康之鑰」系列活動-美味的代價與健康問題之探討</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2750&amp;key2=20120308" />
<author>
<name />
</author>
<summary type="text">101/03/08 12:00-14:00</summary>
</entry>
<entry>
<title>「樂活飲食•健康之鑰」系列活動--代謝症候群與檢康飲食</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2751&amp;key2=20120322" />
<author>
<name />
</author>
<summary type="text">101/03/22 12:00-14:00</summary>
</entry>
<entry>
<title>「學生健康體位控制班」</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2766&amp;key2=20120301" />
<author>
<name />
</author>
<summary type="text">101/03/01-101/05/03 18:00-20:30</summary>
</entry>
<entry>
<title>學生大使志工團- 2012 Field Trip-Must Sea+ FUN舟趣</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2768&amp;key2=20120317" />
<author>
<name />
</author>
<summary type="text">101/03/17-101/03/18 08:00-20:00</summary>
</entry>
<entry>
<title>職場勞資關係講座-你知道自己的權益嗎?</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2776&amp;key2=20120305" />
<author>
<name />
</author>
<summary type="text">101/03/05 18:30-21:00</summary>
</entry>
<entry>
<title>職場「面面」觀 - 談職場趨勢與面試</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2791&amp;key2=20120306" />
<author>
<name />
</author>
<summary type="text">101/03/06 18:30-21:00</summary>
</entry>
<entry>
<title>「自」銷不要「滯」銷~一窺自我行銷術的秘密</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2792&amp;key2=20120307" />
<author>
<name />
</author>
<summary type="text">101/03/07 18:30-21:00</summary>
</entry>
<entry>
<title>職涯經驗談-開創職涯的一片天</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2793&amp;key2=20120308" />
<author>
<name />
</author>
<summary type="text">101/03/08 18:30-21:00</summary>
</entry>
<entry>
<title>2012徵政好企業說明會--花旗銀行</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2795&amp;key2=20120305" />
<author>
<name />
</author>
<summary type="text">101/03/05 12:15-14:00</summary>
</entry>
<entry>
<title>2012徵政好企業說明會--日商野村總合研究所</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2796&amp;key2=20120309" />
<author>
<name />
</author>
<summary type="text">101/03/09 12:15-14:00</summary>
</entry>
<entry>
<title>2012徵政好企業說明會--渣打銀行</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2797&amp;key2=20120306" />
<author>
<name />
</author>
<summary type="text">101/03/06 12:15-14:00</summary>
</entry>
<entry>
<title>2012徵政好企業說明會--台新金控</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2798&amp;key2=20120307" />
<author>
<name />
</author>
<summary type="text">101/03/07 12:15-14:00</summary>
</entry>
<entry>
<title>2012徵政好企業說明會--第一銀行</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2799&amp;key2=20120308" />
<author>
<name />
</author>
<summary type="text">101/03/08 12:15-14:00</summary>
</entry>
<entry>
<title>101年生命教育師資培訓課程研習會</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2800&amp;key2=20120324" />
<author>
<name />
</author>
<summary type="text">101/03/24-101/03/25 07:30-17:40</summary>
</entry>
</feed>

View File

@ -17,13 +17,12 @@ function ajax_load_proc(wapper,url){
wapper.html("Loading Failed"); wapper.html("Loading Failed");
}); });
} }
// Ad Banner FX code [start] // Ad Banner FX code [start]
function onAfter(e) { function getTimeout() {
var parent = $(this).parent(); return $(this).attr('time_to_next');
var time_to_next = $(this).attr('time_to_next');
parent.cycle('pause');
setTimeout(function(){parent.cycle('resume')},time_to_next);
} }
$(document).ready(function() { $(document).ready(function() {
$('.slideshow').children('img').click(function() $('.slideshow').children('img').click(function()
{ {

View File

@ -7,6 +7,6 @@
"update_info": "Some info", "update_info": "Some info",
"create_date": "11-11-2011", "create_date": "11-11-2011",
"app_pages": ["bulletins"], "app_pages": ["bulletins"],
"widgets": ["bulletins"], "widgets": ["bulletins", "bulletins_and_web_links"],
"enable_frontend": true "enable_frontend": true
} }

View File

@ -0,0 +1,45 @@
$(document).ready(function(){
var topic1="0px";
var topic2="-948px";
var topic3="-1896px";
var topic_page=1;
$(".topic_prev").addClass("topic_prev_first");
$(document).on("click", ".topic_prev", function() {
if (topic_page !=1){
topic_page-=1;
}else{
}
if (topic_page == 1){
$("#topic_list").stop().animate({"left": topic1}, "slow");
$(".topic_prev").addClass("topic_prev_first");
}
if (topic_page == 2){
$("#topic_list").stop().animate({"left": topic2}, "slow");
$(".topic_prev").removeClass("topic_prev_first");
$(".topic_next").removeClass("topic_next_last");
}
if (topic_page == 3){
$("#topic_list").stop().animate({"left": topic3}, "slow");
$(".topic_prev").removeClass("topic_next_last");
}
});
$(document).on("click", ".topic_next", function() {
if (topic_page >=1 && topic_page <=2){
topic_page+=1;
}else{
}
if (topic_page == 1){
$("#topic_list").stop().animate({"left": topic1}, "slow");
$(".topic_prev").addClass("topic_prev_first");
}
if (topic_page == 2){
$("#topic_list").stop().animate({"left": topic2}, "slow");
$(".topic_prev").removeClass("topic_prev_first");
}
if (topic_page == 3){
$("#topic_list").stop().animate({"left": topic3}, "slow");
$(".topic_next").addClass("topic_next_last");
}
});
});

View File

@ -0,0 +1,9 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require announcement_link

View File

@ -1,6 +1,6 @@
class Panel::Announcement::BackEnd::BulletinCategorysController < ApplicationController class Panel::Announcement::BackEnd::BulletinCategorysController < ApplicationController
layout 'admin' layout 'new_admin'
def index def index
@bulletin_categorys = BulletinCategory.all @bulletin_categorys = BulletinCategory.all

View File

@ -12,14 +12,17 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
# @bulletins = Bulletin.where("bulletin_category_id" => params[:bulletin_category_id]).desc("postdate") if params[:bulletin_category_id] # @bulletins = Bulletin.where("bulletin_category_id" => params[:bulletin_category_id]).desc("postdate") if params[:bulletin_category_id]
@bulletins = Bulletin.search(params[:search],params[:category_id]) # @bulletins = Bulletin.search(params[:search], params[:category_id])
# @bulletins = Bulletin.all.order_by([params[:sort], params[:direction]])
@bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.all
@bulletin_categories = BulletinCategory.all @bulletin_categories = BulletinCategory.all
module_app = ModuleApp.first(:conditions => {:key => 'announcement'}) module_app = ModuleApp.first(:conditions => {:key => 'announcement'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id}) @tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc)
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js
format.xml { render :xml => @bulletins } format.xml { render :xml => @bulletins }
end end
end end
@ -97,7 +100,6 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
# @bulletin.image.clear if params[:bulletin][:image_del] == '1' # @bulletin.image.clear if params[:bulletin][:image_del] == '1'
if params[:bulletin][:image_del] == '1' if params[:bulletin][:image_del] == '1'
@bulletin.remove_image! @bulletin.remove_image!
@bulletin.image_filename = nil
# @bulletin.image_del = nil # @bulletin.image_del = nil
params[:bulletin][:image_del] = nil params[:bulletin][:image_del] = nil
end end
@ -146,5 +148,49 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true)) @bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
end end
def get_sorted_bulletins
bulletins = Bulletin.all
case params[:sort]
when 'postdate', 'deadline'
bulletins.order_by([params[:sort], params[:direction]])
when 'category'
category_ids = bulletins.distinct(:bulletin_category_id)
categories = BulletinCategory.find(category_ids) rescue nil
if categories
h = Hash.new
categories.each { |category| h[category.i18n_variable[I18n.locale]] = category.id }
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
sorted_categorys = sorted.collect {|a| bulletins.where(:bulletin_category_id => a[1]).entries }
sorted_categorys.flatten
else
nil
end
when 'title'
h = Hash.new
bulletins.each { |bulletin| h[bulletin.title[I18n.locale]] = bulletin }
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
sorted.collect {|a| a[1] }
when 'status'
bulletins.order_by(:is_top, params[:direction]).order_by(:is_hot, params[:direction]).order_by(:is_hidden, params[:direction])
when 'update_user_id'
user_ids = bulletins.distinct(:update_user_id)
users = User.find(user_ids) rescue nil
if users
h = Hash.new
users.each { |user| h[user.name] = user.id }
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
sorted_users = sorted.collect {|a| bulletins.where(:update_user_id => a[1]).entries }
sorted_users.flatten
else
nil
end
when 'tags'
a = Array.new
AnnouncementTag.all.order_by(I18n.locale, params[:direction]).each { |tag| a << tag.bulletins }
a.flatten!
a.uniq
end
end
end end

View File

@ -11,8 +11,11 @@ class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController
def index def index
date_now = Time.now date_now = Time.now
if params[:bulletin_category_id]
@bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(1) @bulletins = Bulletin.where(:bulletin_category_id => params[:bulletin_category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
else
@bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
end
get_categorys get_categorys
end end

View File

@ -13,21 +13,31 @@ class Panel::Announcement::Widget::BulletinsController < ObitWidgetController
# deadline # deadline
# @bulletin_categorys = BulletinCategory.first; # @bulletin_categorys = BulletinCategory.first;
# @bulletins = Bulletin.widget_datas(@bulletin_categorys.id).limit(9) # @bulletins = Bulletin.widget_datas(@bulletin_categorys.id).limit(9)
if params[:category_id]
@bulletins = Bulletin.where(:bulletin_category_id => params[:category_id]).widget_datas.limit(9)
else
@bulletins = Bulletin.widget_datas.limit(9) @bulletins = Bulletin.widget_datas.limit(9)
end
get_categorys get_categorys
end end
def bulletins_list def bulletins_and_web_links
@tags = AnnouncementTag.all
@selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0]
@bulletins = @selected_tag.get_visible_bulletins.page(params[:page]).per(5) rescue nil
@web_links = WebResourceTag.first(:conditions => {:en => @selected_tag[:en]}).get_visible_links.page(params[:page]).per(5) rescue nil
end
@bulletins = Bulletin.widget_datas.limit(5) def reload_bulletins
@selected_tag = AnnouncementTag.find(params[:tag_id])
# get_categorys @bulletins = @selected_tag.get_visible_bulletins.page(params[:page]).per(5) rescue nil
end
module_app = ModuleApp.first(:conditions => {:key => 'announcement'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
def reload_web_links
@selected_tag = AnnouncementTag.find(params[:tag_id])
@web_links = WebResourceTag.first(:conditions => {:en => @selected_tag[:en]}).get_visible_links.page(params[:page]).per(5) rescue nil
end end

View File

@ -2,4 +2,10 @@ class AnnouncementTag < Tag
has_and_belongs_to_many :bulletins has_and_belongs_to_many :bulletins
def get_visible_bulletins(sort = :name)
date_now = Time.now
self.bulletins.where(:is_hidden => false).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:is_top, sort)
end
end end

View File

@ -107,6 +107,17 @@ class Bulletin
@text ||= I18nVariable.first(:conditions => {:key => 'text', :language_value_id => self.id, :language_value_type => self.class}) rescue nil @text ||= I18nVariable.first(:conditions => {:key => 'text', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
end end
def self.filter(bulletins)
bulletins.each do |bulletin|
p "#{bulletin.id}/#{bulletin.is_top}/#{bulletin.is_hot}/#{bulletin.is_hidden}"
end
return nil
end
def sorted_tags
tags.order_by(I18n.locale, :asc)
end
protected protected
def set_key def set_key

View File

@ -1,4 +1,4 @@
<tr id="<%= dom_id bulletin %>"> <tr id="<%= dom_id bulletin %>" class="with_action">
<td><input type="checkbox"></td> <td><input type="checkbox"></td>
<td> <td>
<% if bulletin.is_top? %> <% if bulletin.is_top? %>
@ -14,13 +14,13 @@
<ul class="nav nav-pills hide"> <ul class="nav nav-pills hide">
<li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li> <li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
<li class="dropdown"> <li class="dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">Quick Edit<b class="caret"></b></a> <a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
<ul class="dropdown-menu" id="menu1"> <ul class="dropdown-menu" id="menu1">
<li><a href="#">Basic</a></li> <li><a href="#" class='toggle-tr-edit' rel='basic'><%= t(:basic) %></a></li>
<li><a href="#">Picture</a></li> <li><a href="#" class='toggle-tr-edit' rel='picture'><%= t(:picture) %></a></li>
<li><a href="#">Tags</a></li> <li><a href="#" class='toggle-tr-edit' rel='tags'><%= t(:tags) %></a></li>
<li><a href="#">Link</a></li> <li><a href="#" class='toggle-tr-edit' rel='link'><%= t(:link) %></a></li>
<li><a href="#">File</a></li> <li><a href="#" class='toggle-tr-edit' rel='file'><%= t(:file) %></a></li>
</ul> </ul>
</li> </li>
<li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li> <li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
@ -32,11 +32,11 @@
<td><%= bulletin.postdate %></td> <td><%= bulletin.postdate %></td>
<td><%= (bulletin.deadline) ? bulletin.deadline : t('bulletin.no_deadline') %></td> <td><%= (bulletin.deadline) ? bulletin.deadline : t('bulletin.no_deadline') %></td>
<td> <td>
<% bulletin.tags.each do |tag| %> <% bulletin.sorted_tags.each do |tag| %>
<span class="label label-tags"><%= tag[I18n.locale] %></span> <span class="label label-tags"><%= tag[I18n.locale] %></span>
<% end %> <% end %>
</td> </td>
<td>rulingcom</td> <td><%= User.from_id(bulletin.update_user_id).name %></td>
</tr> </tr>
<%= render :partial => 'quick_edit', :locals => {:bulletin => bulletin} %> <%= render :partial => 'quick_edit', :locals => {:bulletin => bulletin} %>

View File

@ -0,0 +1,39 @@
<thead>
<tr class="sort-header">
<th class="span1 strong">
<input type="checkbox">
<a href class="list-remove"><i class="icon-trash"></i></a>
</th>
<th class="sort span1 <%= is_sort_active?('status') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('status')) %>">
<%= t('bulletin.status') %>
<%= content_tag(:b, nil, :class => is_sort?('status')) %>
</th>
<th class="sort span1-2 <%= is_sort_active?('category') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('category')) %>">
<%= t('bulletin.category') %>
<%= content_tag(:b, nil, :class => is_sort?('category')) %>
</th>
<th class="sort span7 <%= is_sort_active?('title') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('title')) %>">
<%= t('bulletin.title') %>
<%= content_tag(:b, nil, :class => is_sort?('title')) %>
</th>
<th class="sort span1-2 <%= is_sort_active?('postdate') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('postdate')) %>">
<%= t('bulletin.start_date') %>
<%= content_tag(:b, nil, :class => is_sort?('postdate')) %>
</th>
<th class="sort span1-2 <%= is_sort_active?('deadline') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('deadline')) %>">
<%= t('bulletin.end_date') %>
<%= content_tag(:b, nil, :class => is_sort?('deadline')) %>
</th>
<th class="sort span1-2 <%= is_sort_active?('tags') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('tags')) %>">
<%= t('bulletin.tags') %>
<%= content_tag(:b, nil, :class => is_sort?('tags')) %>
</th>
<th class="sort span1-2 <%= is_sort_active?('update_user_id') %>" rel="<%= panel_announcement_back_end_bulletins_path(sortable('update_user_id')) %>">
<%= t('bulletin.last_modified') %>
<%= content_tag(:b, nil, :class => is_sort?('update_user_id')) %>
</th>
</tr>
</thead>
<tbody class="sort-holder">
<%= render :partial => 'bulletin', :collection => @bulletins %>
</tbody>

View File

@ -28,8 +28,9 @@
</div> </div>
<div class="accordion-body collapse" id="collapse-category"> <div class="accordion-body collapse" id="collapse-category">
<div class="accordion-inner" data-toggle="buttons-checkbox"> <div class="accordion-inner" data-toggle="buttons-checkbox">
<a href="#" class="btn">Category1</a> <% @bulletin_categories.each do |category| -%>
<a href="#" class="btn">Category2</a> <%= link_to category.i18n_variable[I18n.locale], panel_announcement_back_end_bulletins_path(:filter => add_filter(:categories, category.id)), :class => 'btn' %>
<% end -%>
</div> </div>
<div class="filter-clear"> <div class="filter-clear">
<a href="#" class="btn"><i class="icons-brush-large"></i>Clear/重置</a> <a href="#" class="btn"><i class="icons-brush-large"></i>Clear/重置</a>

View File

@ -1,11 +1,7 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<%= f.error_messages %> <%= f.error_messages %>
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
<div class="field">
<%= f.label :category %><br />
<%= f.select :bulletin_category_id, @bulletin_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ]} %>
</div>
<div class="field"> <div class="field">
<%= f.label :image, t('announcement.image') %><br /> <%= f.label :image, t('announcement.image') %><br />
@ -146,3 +142,390 @@
</script> </script>
<% end %> <% end %>
<!--Widget start-->
<!-- <div id="sub-wiget">
<div id="widget-date" class="widget-box">
<div class="widget-action clear">
<a href="#" class="action"><i title="Set the announcement to start and end dates" class="icon-exclamation-sign icon-white tip"></i></a>
</div>
<h3 class="widget-title"><i class="icons-calendar icons-white"></i> Date</h3>
<div class="widget-content clear">
<div class="control-group">
<label class="control-label">Start</label>
<div class="controls">
<select id="start-day" class="input-small">
<option>Day</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
<select id="start-month" class="input-small">
<option>Month</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
<select id="start-year" class="input-small">
<option>Year</option>
<option>2012</option>
<option>2011</option>
<option>2010</option>
<option>2009</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label">End</label>
<div class="controls">
<select id="start-day" class="input-small">
<option>Day</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
<select id="start-month" class="input-small">
<option>Month</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
<select id="start-year" class="input-small">
<option>Year</option>
<option>2012</option>
<option>2011</option>
<option>2010</option>
<option>2009</option>
</select>
</div>
</div>
</div>
</div>
<div id="widget-status" class="widget-box">
<div class="widget-action clear">
<a class="action"><i title="Setting the announcement state" class="icon-exclamation-sign icon-white tip"></i></a>
</div>
<h3 class="widget-title"><i class="icons-star-thin icons-white"></i>Status</h3>
<div class="widget-content clear">
<div class="controls">
<label class="checkbox inline"><input type="checkbox" value="hot">Hot</label>
<label class="checkbox inline"><input type="checkbox" value="top">Top</label>
<label class="checkbox inline"><input type="checkbox" value="hide">Hide</label>
</div>
</div>
</div>
<div id="widget-role" class="widget-box">
<div class="widget-action clear">
<a class="action"><i title="Set the read role" class="icon-exclamation-sign icon-white tip"></i></a>
<a class="action"><i title="Setting" class="icon-cog icon-white tip"></i></a>
</div>
<h3 class="widget-title"><i class="icons-lock icons-white"></i>Permissions</h3>
<div class="widget-content clear">
<div class="controls">
<label class="radio inline"><input class="privacy" type="radio" value="public" name="privacy">Public</label>
<label class="radio inline"><input class="privacy" type="radio" value="private" name="privacy">Private</label>
<div class="well select-role">
<label class="checkbox inline"><input type="checkbox" value="hot">Student</label>
<label class="checkbox inline"><input type="checkbox" value="top">Teacher</label>
<label class="checkbox inline"><input type="checkbox" value="hide">Staff</label>
</div>
</div>
</div>
</div>
<div id="widget-picture" class="widget-box">
<div class="widget-action clear">
<a class="action"><i title="Upload pictures" class="icon-exclamation-sign icon-white tip"></i></a>
</div>
<h3 class="widget-title"><i class="icons-picture icons-white"></i>Picture</h3>
<div class="widget-content clear">
<div class="control-group">
<img class="pull-left upload-picture" src="images/default-img.png" />
<div class="controls file-upload">
<label class="control-label btn" for="input-upload">
Browse/選擇檔案
<input id="input-upload" class="upload" type="file" name="upload" onchange="document.getElementById('fu').innerHTML = this.form.fu.value = this.value;">
</label>
<span id='fu' class="file-name"></span>
<br>
<input name='fu' class="input-medium" type="text">
</div>
</div>
</div>
</div>
<div id="widget-tags" class="widget-box">
<div class="widget-action clear">
<a class="action"><i title="Enter post tags, Chinese and English required" class="icon-exclamation-sign icon-white tip"></i></a>
<a class="action"><i title="Setting" class="icon-cog icon-white tip"></i></a>
</div>
<h3 class="widget-title"><i class="icons-tag icons-white"></i>Tags</h3>
<div class="widget-content clear form-horizontal">
<div class="control-group error">
<label class="control-label" for="tags-zh-tw">
Chinese
</label>
<div class="controls">
<input id='tags-zh-tw' class="input-prepend" type="text">
<span class="help-inline">Please correct the error</span>
</div>
</div>
<div class="control-group">
<label class="control-label" for="tags-en">
English
</label>
<div class="controls">
<input id='tags-en' class="input-prepend" type="text">
<span class="help-inline">Please correct the error</span>
</div>
</div>
<div class="clear">
<a class="pull-right btn btn-primary" href="#">Add/新增</a>
</div>
<hr>
<span class="label label-tags">Default<a href><i class="icon-remove icon-white"></i></a></span>
<span class="label label-tags">Default<a href><i class="icon-remove icon-white"></i></a></span>
<span class="label label-tags">Default<a href><i class="icon-remove icon-white"></i></a></span>
<span class="label label-tags">Default<a href><i class="icon-remove icon-white"></i></a></span>
</div>
</div>
</div> -->
<!--Wiget End-->
<!--Post Start-->
<!-- <div id="post-body">
<div id="post-body-content" class="clear">
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %> <div class="btn-group pull-right">
<a class="btn dropdown-toggle" href="#" data-toggle="dropdown">
English
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">English</a></li>
<li><a href="#">Chinese</a></li>
<li><a href="#">Japanese</a></li>
<li><a href="#">French</a></li>
<li><a href="#">German</a></li>
<!--<li class="divider"></li>
<li><a href="#">Separated link</a></li>-->
</ul>
</div>
<div class="title">
<input class="post-title" type="text" placeholder="Enter title here">
</div>
<div class="editor">
<%= text_area_tag 'locale', nil, :style=>"width:100%" %>
</div>
<div class="main-wiget">
<div id="widget-link" class="widget-box">
<div class="widget-action clear">
<a class="action"><i title="Add a reference link" class="icon-exclamation-sign icon-white tip"></i></a>
</div>
<h3 class="widget-title"><i class="icons-link icons-white"></i>Link</h3>
<div class="widget-content">
<table class="table table-condensed">
<thead>
<tr>
<th>Chinese</th>
<th>English</th>
<th class="span1"></th>
</tr>
</thead>
<tfoot>
<tr>
<td style="text-align:center" colspan="3">
<a class="btn btn-primary btn-small" href="#modal-link" data-toggle="modal"><i class="icon-plus icon-white"></i> ADD/新增</a>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>…</td>
<td>…</td>
<td><a href="#modal-link" data-toggle="modal" class="action"><i class="icon-pencil"></i></a><a href class="action"><i class="icon-remove"></i></a></td>
</tr>
</tbody>
</table>
</div>
<div id="modal-link" class="modal hide fade">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Add Link / Edit Link</h3>
</div>
<div class="modal-body form-horizontal">
<div class="control-group">
<label for="http" class="control-label">http://</label>
<div class="controls">
<input type="text" value="" id="http" class="input-xlarge">
<span class="help-inline">Please correct the error</span>
</div>
</div>
<div class="control-group error">
<label for="link-zh-tw" class="control-label">Chinese</label>
<div class="controls">
<input type="text" value="" id="link-zh-tw" class="input-xlarge">
<span class="help-inline">Please correct the error</span>
</div>
</div>
<div class="control-group">
<label for="link-en" class="control-label">English</label>
<div class="controls">
<input type="text" value="" id="link-en" class="input-xlarge">
<span class="help-inline">Please correct the error</span>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-primary" href="#">Submit/確定</a>
<a class="btn" data-dismiss="modal" href="#">Cancel/取消</a>
</div>
</div>
</div>
<div id="widget-file" class="widget-box">
<div class="widget-action clear">
<a class="action"><i title="Added to the file" class="icon-exclamation-sign icon-white tip"></i></a>
</div>
<h3 class="widget-title"><i class="icons-paperclip icons-white"></i>File</h3>
<div class="widget-content">
<table class="table table-condensed">
<thead>
<tr>
<th>Chinese</th>
<th>English</th>
<th class="span1"></th>
</tr>
</thead>
<tfoot>
<tr>
<td style="text-align:center" colspan="3">
<a class="btn btn-primary btn-small" href="#modal-file" data-toggle="modal"><i class="icon-plus icon-white"></i> ADD/新增</a>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>…</td>
<td>…</td>
<td><a href="#modal-file" data-toggle="modal" class="action"><i class="icon-pencil"></i></a><a href class="action"><i class="icon-remove"></i></a></td>
</tr>
</tbody>
</table>
</div>
<div id="modal-file" class="modal hide fade">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Add File / Edit File</h3>
</div>
<div class="modal-body form-horizontal">
<div class="controls file-upload">
<label class="control-label btn" for="input-upload">
Browse
<input id="input-upload" class="upload" type="file" name="upload" onchange="document.getElementById('fn').innerHTML = this.value;">
</label>
<span id='fn' class="file-name"></span>
</div>
<div class="control-group">
<label for="file-zh-tw" class="control-label">Chinese</label>
<div class="controls">
<input type="text" value="" id="file-zh-tw" class="input-xlarge">
<span class="help-inline">Please correct the error</span>
</div>
</div>
<div class="control-group">
<label for="file-en" class="control-label">English</label>
<div class="controls">
<input type="text" value="" id="file-en" class="input-xlarge">
<span class="help-inline">Please correct the error</span>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-primary" href="#">Submit/確定</a>
<a class="btn" data-dismiss="modal" href="#">Cancel/取消</a>
</div>
</div>
</div>
</div>
</div>
</div> -->
<!--Post End-->
<!-- <div class="form-actions"> -->
<button class="btn btn-success" type="submit">Preview/預覽</button>
<button class="btn btn-primary" type="submit">Submit/送出</button>
<button class="btn" type="reset">Cancel/取消</button>
<!-- </div> -->

View File

@ -1,12 +1,13 @@
<!-- <tr class="qe-block hide"> --> <!-- <tr class="qe-block hide"> -->
<tr class="qe-block"> <tr class="qe-block hide">
<td colspan="8"> <td colspan="8">
<legend>Quick Edit - Basic / Picture / Tags / Link / File</legend> <legend><%= t(:quick_edit) %> - <span class='qe_title'></span>Basic / Picture / Tags / Link / File</legend>
<%= form_for bulletin, :url => panel_announcement_back_end_bulletin_path(bulletin), :html => {:class => 'form-horizontal'} do |f| %> <%= form_for bulletin, :url => panel_announcement_back_end_bulletin_path(bulletin), :html => {:class => 'form-horizontal'} do |f| %>
<%= render :partial => "quick_edit_basic", :locals => { :f => f, :bulletin => bulletin } %> <%= render :partial => "quick_edit_basic", :locals => { :f => f, :bulletin => bulletin } %>
<%= render :partial => "quick_edit_picture", :locals => { :f => f, :bulletin => bulletin } %> <%= render :partial => "quick_edit_picture", :locals => { :f => f, :bulletin => bulletin } %>
<%#= render :partial => "quick_edit_links", :locals => { :f => f, :bulletin => bulletin } %>
<%= render :partial => "quick_edit_tags", :locals => { :f => f, :bulletin => bulletin } %> <%= render :partial => "quick_edit_tags", :locals => { :f => f, :bulletin => bulletin } %>
<%= render :partial => "quick_edit_links", :locals => { :f => f, :bulletin => bulletin } %>
<%= render :partial => "quick_edit_files", :locals => { :f => f, :bulletin => bulletin } %>
<div class="form-actions"> <div class="form-actions">
<%= f.submit t(:submit), :class => 'btn btn-primary' %> <%= f.submit t(:submit), :class => 'btn btn-primary' %>
<%= f.submit t(:cancel), :class => 'btn', :type => 'reset' %> <%= f.submit t(:cancel), :class => 'btn', :type => 'reset' %>

View File

@ -1,4 +1,4 @@
<div id="qe-basic"> <div id="qe-basic" class="qe-edit-div hide">
<div id="widget-category"> <div id="widget-category">
<div class="control-group"> <div class="control-group">
<label class="control-label"><%= t(:category) %></label> <label class="control-label"><%= t(:category) %></label>

View File

@ -1,4 +1,4 @@
<div id="qe-file"> <div id="qe-file" class="qe-edit-div hide">
<div id="widget-file"> <div id="widget-file">
<div class="control-group"> <div class="control-group">
<table class="table table-condensed"> <table class="table table-condensed">

View File

@ -1,4 +1,4 @@
<div id="qe-link"> <div id="qe-link" class="qe-edit-div hide">
<div id="widget-link"> <div id="widget-link">
<div class="control-group"> <div class="control-group">
<table class="table table-condensed"> <table class="table table-condensed">

View File

@ -1,9 +1,9 @@
<div id="qe-picture"> <div id="qe-picture" class="qe-edit-div hide">
<div id="widget-picture"> <div id="widget-picture">
<div class="control-group"> <div class="control-group">
<label class="control-label">Picture</label> <label class="control-label">Picture</label>
<div class="control-group"> <div class="control-group">
<img class="pull-left upload-picture" src="img/default-img.png" /> <img class="pull-left upload-picture" src="" />
<div class="controls file-upload"> <div class="controls file-upload">
<label class="control-label btn" for="input-upload"> <label class="control-label btn" for="input-upload">
Browse/選擇檔案 Browse/選擇檔案

View File

@ -32,7 +32,7 @@
</div> </div>
</div> --> </div> -->
<div id="qe-tags"> <div id="qe-tags" class="qe-edit-div hide">
<div id="widget-tags"> <div id="widget-tags">
<div class="form-horizontal"> <div class="form-horizontal">
<% @tags.each do |tag| %> <% @tags.each do |tag| %>

View File

@ -1,16 +1,7 @@
<br />
<br />
<br />
<br />
<h1><%= t('announcement.editing_announcement') %></h1> <h1><%= t('announcement.editing_announcement') %></h1>
<%= form_for @bulletin, :url => panel_announcement_back_end_bulletin_path(@bulletin) do |f| %> <%= form_for @bulletin, :url => panel_announcement_back_end_bulletin_path(@bulletin), :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<% end %> <% end %>
<%= link_back %> <%= link_back %>
<br />
<br />
<br />
<br />

View File

@ -1,68 +1,6 @@
<!-- <% content_for :secondary do %>
<br />
<br />
<br />
<br />
<br />
<ul class="list">
<li><%= link_to t('bulletin.new_announcement'), new_panel_announcement_back_end_bulletin_path %></li>
<li><%= link_to t('bulletin.announcement_list'), panel_announcement_back_end_bulletins_path %></li>
<li><%= link_to t('bulletin.new_announcement_class'), panel_announcement_back_end_bulletin_categorys_path %></li>
</ul>
<% end -%>
<%= flash_messages %>
<br />
<br />
<br />
<br />
<br />
<fieldset><legend><%= t('bulletin.search') %></legend>
<%= form_for :bulletin, :action => 'search', :method => 'get', :url => panel_announcement_back_end_bulletins_path do |f| %>
<%#= f.select :bulletin_category_id, @bulletin_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ] },{ :include_blank => t('bulletin.select') }%>
Category <%= select_tag "category_id", options_for_select(@bulletin_categorys.collect{|t| [t.i18n_variable[I18n.locale], t.id]}), :prompt => t('bulletin.select') %>
KeyWord <%= text_field_tag :search, params[:search], :id => 'search_field' %>
<%= submit_tag "Search", :name => nil %>
<% end %>
</fieldset>
<br />
<br />
<br />
-->
<%= render 'filter' %> <%= render 'filter' %>
<table class="table main-list"> <table id="bulettin_sort_list" class="table main-list">
<thead> <%= render 'bulletins' %>
<tr>
<th class="span1 strong">
<input type="checkbox">
<a href class="list-remove"><i class="icon-trash"></i></a>
</th>
<th class="span1"><%= t('bulletin.status') %></th>
<th class="span1-2"><%= t('bulletin.category') %></th>
<th class="span7 select"><%= t('bulletin.title') %></th>
<th class="span1-2"><%= t('bulletin.start_date') %></th>
<th class="span1-2"><%= t('bulletin.end_date') %></th>
<th class="span1-2"><%= t('bulletin.tags') %></th>
<th class="span1-2"><%= t('bulletin.last_modified') %></th>
</tr>
</thead>
<tbody>
<%= render :partial => 'bulletin', :collection => @bulletins %>
</tbody>
</table> </table>
<div class="form-actions"> <div class="form-actions">

View File

@ -0,0 +1 @@
$("#bulettin_sort_list").html("<%= j render 'bulletins' %>")

View File

@ -21,7 +21,7 @@
</li> </li>
<li> <li>
<%#= image_tag(@bulletin.image.url, :size => "320x240") if @bulletin.image.file %> <%#= image_tag(@bulletin.image.url, :size => "320x240") if @bulletin.image.file %>
<%= link_to image_tag(@bulletin.image.url, :size => "320x240"), @bulletin.image.url, {:target => '_blank', :title => @bulletin.image_filename} if @bulletin.image.file %> <%= link_to image_tag(@bulletin.image.url, :size => "320x240"), @bulletin.image.url, {:target => '_blank', :title => @bulletin.image_identifier} if @bulletin.image.file %>
</li> </li>
<li> <li>
<b><%= t('announcement.subtitle') %></b> <b><%= t('announcement.subtitle') %></b>

View File

@ -2,30 +2,28 @@
<%= flash_messages %> <%= flash_messages %>
<%= paginate @bulletins %> <h1 class="h1"><%= t('announcement.list_announcement') %></h1>
<h1><%= t('bulletin.list_announcement') %></h1>
<table> <table class="table table-bordered">
<tr> <tr>
<th><%= t('bulletin.postdate') %></th> <th><%= t('announcement.bulletin.category') %></th>
<th><%= t('bulletin.category') %></th> <th><%= t('announcement.bulletin.title') %></th>
<th><%= t('bulletin.title') %></th> <th><%= t('announcement.bulletin.postdate') %></th>
</tr> </tr>
<% @bulletins.each do |post| %> <% @bulletins.each do |post| %>
<tr> <tr>
<td><%= post.postdate %></td>
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td> <td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %> <td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %> <%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
</td> </td>
<td><%= post.postdate %></td>
</tr> </tr>
<% end %> <% end %>
</table> </table>
<br /> <%= paginate @bulletins %>

View File

@ -1,9 +1,23 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<h1 class="h1"><%= @bulletin.title[I18n.locale] %></h1>
<br /> <div class="info">
<br /> <div class="info1">
<br /> <span class="date"><%= @bulletin.postdate %></span>
&nbsp;|&nbsp;
<a href="" class="unit"><%= User.find(@bulletin.create_user_id).name %></a>
</div>
</div>
<div class="news_image">
<%#= image_tag(@bulletin.image.url, :size => "320x240") if @bulletin.image.file %>
<%= link_to image_tag(@bulletin.image.url, :size => "320x240"), @bulletin.image.url, {:target => '_blank', :title => @bulletin.image_identifier} if @bulletin.image.file %>
</div>
<div class="news_paragraph">
<%= @bulletin.text[I18n.locale].html_safe %>
</div>
<div class="fb">
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.nccu.edu.tw&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=35&amp;appId=263319013700607" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
</div>
<!--
<p id="notice"><%= flash_messages %></p> <p id="notice"><%= flash_messages %></p>
<ul> <ul>
@ -25,11 +39,11 @@
</li> </li>
<li> <li>
<b><%= t('announcement.subtitle') %></b> <b><%= t('announcement.subtitle') %></b>
<%= @bulletin.subtitle[I18n.locale] %> <%= @bulletin.subtitle[I18n.locale].html_safe %>
</li> </li>
<li> <li>
<b><%= t('announcement.text') %></b> <b><%= t('announcement.text') %></b>
<%= @bulletin.text[I18n.locale] %> <%= @bulletin.text[I18n.locale].html_safe %>
</li> </li>
<li> <li>
<li> <li>
@ -52,6 +66,6 @@
<b><%= t('announcement.最後修改時間') %></b> <b><%= t('announcement.最後修改時間') %></b>
<%= @bulletin.updated_at.strftime("%Y-%m-%d %H:%I:%S") %> <%= @bulletin.updated_at.strftime("%Y-%m-%d %H:%I:%S") %>
</li> </li>
-->
<%#= link_back %> <%#= link_back %>

View File

@ -0,0 +1,10 @@
<% @bulletins.each do |bulletin| %>
<li>
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category_id) %>
</li>
<% end %>
<div class='pagination'>
<%= link_to_previous_page @bulletins, 'Previous Page', :params => {:controller => 'widget/bulletins', :action => 'reload_bulletins', :tag_id => @selected_tag.id}, :remote => true, :class => 'previous' %>
<%= link_to_next_page @bulletins, 'Next Page', :params => {:controller => 'widget/bulletins', :action => 'reload_bulletins', :tag_id => @selected_tag.id}, :remote => true, :class => 'next' %>
</div>

View File

@ -0,0 +1,3 @@
<li>
<%= link_to tag[I18n.locale], panel_announcement_widget_bulletins_and_web_links_path(:id => tag.id), :remote => true, :class => ('active' if tag.eql?(@selected_tag)) %>
</li>

View File

@ -0,0 +1,10 @@
<% @web_links.each do |web_link| %>
<li>
<a><%= web_link.name[I18n.locale] %></a>
</li>
<% end %>
<div class='pagination'>
<%= link_to_previous_page @web_links, 'Previous Page', :params => {:controller => 'widget/bulletins', :action => 'reload_web_links', :tag_id => @selected_tag.id}, :remote => true, :class => 'previous' %>
<%= link_to_next_page @web_links, 'Next Page', :params => {:controller => 'widget/bulletins', :action => 'reload_web_links', :tag_id => @selected_tag.id}, :remote => true, :class => 'next' %>
</div>

View File

@ -0,0 +1,19 @@
<div class="tag_block">
<ul id='bulletins_web_links_tags' class="tag_list">
<%= render :partial => 'tag', :collection => @tags %>
</ul>
</div>
<div class="news_block">
<h3 class="news_title2"><%= t("announcement.bulletins") %></h3>
<ul id='bulletins_web_links_bulletins' class="news_list">
<%= render 'bulletins' if @bulletins %>
</ul>
</div>
<div class="links_block">
<h3 class="links_title"><%= t("announcement.related_links") %></h3>
<ul id='bulletins_web_links_web_links' class="links_list">
<%= render 'web_links' if @web_links %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
$('#bulletins_web_links_tags').html("<%= j render :partial => 'tag', :collection => @tags %>")
$('#bulletins_web_links_bulletins').html("<%= j render 'bulletins' if @bulletins %>")
$('#bulletins_web_links_web_links').html("<%= j render 'web_links' if @web_links %>")

View File

@ -2,7 +2,6 @@
<% if @bulletins and !@bulletins.nil? %> <% if @bulletins and !@bulletins.nil? %>
<!-- tag -->
<div class="tag_block"> <div class="tag_block">
<ul class="tag_list"> <ul class="tag_list">
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
@ -11,15 +10,18 @@
</ul> </ul>
</div> </div>
<!-- news --> <% @tags.each_with_index do |tag, index| %>
<div class="news_block"> <div id="news_<%= index %>" class="news_block">
<h3 class="news_title"><%= t('公告訊息')%></h3> <h3 class="news_title2"><%= t("announcement.bulletins") %></h3>
<div class="news_prev">prev</div>
<div class="news_next">next</div>
<ul class="news_list"> <ul class="news_list">
<% @bulletins.each do |post| %> <% tag.bulletins.each do |post| %>
<li><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %></li> <li><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %>
<% end %> <% end %>

Some files were not shown because too many files have changed in this diff Show More