Merge branch 'design_team' into ldap

Conflicts:
	config/environments/development.rb
This commit is contained in:
Christophe Vilayphiou 2012-05-09 13:51:00 +08:00
commit d88d4e58dc
48 changed files with 916 additions and 246 deletions

BIN
app/assets/images/Thumbs.db Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -66,7 +66,7 @@ $(document).ready(function(){
function getEvent(selet){
$.ajax({
type: "GET",
url: "/static/Other.xml",
url: "/static/nccu_calendar.xml",
dataType: "xml",
timeout: 1000,
error: function(xml){

View File

@ -0,0 +1,34 @@
#banner_nav {
position: absolute;
z-index: 10;
bottom: 0;
margin-right: 5px;
right: 0;
}
#banner_nav>li {
float: left;
display: inline-block;
*display: inline;
}
#banner_nav>li>a {
width: 10px;
height: 10px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
background-color: #FFFFFF;
opacity: .5;
filter: alpha(opacity = 50);
margin: 0 4px 10px;
text-indent: -9999px;
box-shadow: 0 0 5px rgba(0,0,0,.7);
}
#banner_nav>li>a:hover {
opacity: 1;
filter: alpha(opacity = 100);
}
#banner_nav>li.activeSlide>a {
opacity: 1;
filter: alpha(opacity = 100);
}

View File

@ -10,7 +10,7 @@
}
.checkbox{
padding: 5px;
margin: 0;
margin: 10px;
display: inline-block;
color:#777777;
text-shadow: 0 1px 0px rgba(255,255,255,.4);
@ -20,7 +20,7 @@
border-style: solid;
border-width: 0px 1px 1px 0;
border-color: #dfdfdf;
/*background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
@ -28,7 +28,7 @@
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;*/
-webkit-border-radius: 3px;
}
.checkbox .check-icon {
display: none;
@ -79,4 +79,7 @@ img.member-img {
}
.popover-content p {
font-size: 12px;
}
.preview_trigger {
margin: 5px 10px 0 0;
}

View File

@ -113,6 +113,7 @@
background-image: none;
overflow: hidden;
width: 28px;
margin-bottom: 0;
position: relative;
}
#orbit-bar .nav > li > a.orbit-bar-home {
@ -579,6 +580,35 @@
.popover-title {
display: none;
}
/*show link and file*/
.linkAndFile {
clear: both;
}
.linkAndFile>div {
margin-top: 20px;
}
.linkAndFile [class^="icons-"] {
float: left;
margin-top: 10px;
}
.linkAndFile .showLink, .linkAndFile .showFile {
background-color: #ededed;
padding: 5px;
border-radius: 5px;
margin-left: 25px;
}
.linkAndFile .showLink a, .linkAndFile .showFile a {
display: inline-block;
margin: 5px 10px;
}
.linkAndFile>div>a:last-child {
margin-right: 5px
}
.news_paragraph p {
line-height: 20px;
}
/*icons*/
.the-icons i:after {
content: attr(class);
@ -734,15 +764,99 @@
.icons-unlock {
background-position: -192px -32px;
}
.icons-thumbtack {
background-position: -224px -32px;
}
.icons-pin {
background-position: -257px -32px;
}
.icons-shield {
background-position: -288px -32px;
}
.icons-key {
background-position: -320px -32px;
}
.icons-fire {
background-position: -352px -32px;
}
.icons-bulls-eye {
background-position: -384px -32px;
}
.icons-flash {
background-position: -416px -32px;
}
.icons-time {
background-position: -448px -32px;
}
.icons-halo {
background-position: -480px -32px;
}
.icons-hourglass {
background-position: -513px -32px;
}
.icons-alarm-clock {
background-position: -545px -32px;
}
.icons-paper {
background-position: -577px -32px;
}
.icons-banner {
background-position: -608px -32px;
}
/*3*/
.icons-phone {
background-position: 0px -64px;
}
.icons-mobile {
background-position: -32px -64px;
}
.icons-mail {
background-position: -64px -64px;
}
.icons-mail-open {
background-position: -96px -64px;
}
.icons-mail-read {
background-position: -128px -64px;
}
.icons-content {
background-position: -160px -66px;
background-position: -160px -64px;
}
.icons-content-out {
background-position: -192px -64px;
}
.icons-content-in {
background-position: -224px -64px;
}
.icons-projector {
background-position: -256px -64px;
}
.icons-tape {
background-position: -288px -64px;
}
.icons-chat-a {
background-position: -320px -64px;
}
.icons-chat-b {
background-position: -352px -64px;
}
.icons-chat-c {
background-position: -384px -64px;
}
.icons-comment {
background-position: -416px -64px;
}
.icons-rss {
background-position: -448px -64px;
}
.icons-ship {
background-position: -480px -64px;
}
.icons-send {
background-position: -512px -64px;
}
.icons-bell {
background-position: -544px -64px;
}
.icons-announcement {
background-position: -576px -64px;
@ -803,20 +917,110 @@
.icons-page-copy {
background-position: -64px -128px;
}
.icons- {
background-position: -0px -128px;
.icons-folder {
background-position: -96px -128px;
}
.icons-folder-open {
background-position: -128px -128px;
}
.icons-folder-lock {
background-position: -160px -128px;
}
.icons-folder-plus {
background-position: -192px -128px;
}
.icons-folder-minus {
background-position: -224px -128px;
}
.icons-page-plus {
background-position: -256px -128px;
}
.icons-page-minus {
background-position: -288px -128px;
}
.icons-page-edit {
background-position: -320px -128px;
}
.icons-page-download {
background-position: -352px -128px;
}
/*6*/
.icons-house-w {
background-position: 0px -160px;
}
.icons-house-b {
background-position: -32px -160px;
}
.icons-signs {
background-position: -64px -160px;
}
.icons-globe {
background-position: -96px -160px;
}
.icons-map {
background-position: -128px -160px;
}
.icons-markers {
background-position: -160px -160px;
}
.icons-barrier {
background-position: -192px -160px;
}
.icons-assist {
background-position: -224px -160px;
}
.icons-cones {
background-position: -256px -160px;
}
.icons-group {
background-position: -288px -160px;
}
.icons-cuble {
background-position: -320px -160px;
}
.icons-structure {
background-position: -352px -160px;
}
.icons-layer {
background-position: -384px -160px;
}
/*7*/
.icons-shopcar-a {
background-position: 0px -192px;
}
.icons-shopcar-b {
background-position: -34px -192px;
}
.icons-purchase {
background-position: -64px -192px;
}
.icons-shopcart {
background-position: -96px -192px;
}
.icons-van {
background-position: -128px -192px;
}
.icons-form {
background-position: -160px -192px;
}
.icons-gift {
background-position: -192px -192px;
}
.icons-credit-card {
background-position: -224px -192px;
}
.icons-cash {
background-position: -256px -192px;
}
.icons-assets {
background-position: -288px -192px;
}
.icons-computer {
background-position: -320px -192px;
}
.icons-library {
background-position: -352px -192px;
}
/*8*/
.icons-dashboard {
background-position: 0 -224px;
@ -846,21 +1050,90 @@
background-position: -256px -224px;
}
/*9*/
.icons-book-cover {
background-position: 0px -256px;
}
.icons-book-make {
background-position: -32px -256px;
}
.icons-binder {
background-position: -64px -256px;
}
.icons-album {
background-position: -96px -256px;
}
.icons-camera {
background-position: -128px -256px;
}
.icons-video-camera {
background-position: -160px -256px;
}
.icons-pillar {
background-position: -192px -256px;
}
.icons-chart {
background-position: -224px -256px;
}
.icons-picture {
background-position: -256px -256px;
}
.icons-pictures {
background-position: -288px -256px;
}
.icons-brief {
background-position: -320px -256px;
}
.icons-film {
background-position: -352px -256px;
}
.icons-asset {
background-position: -384px -256px;
}
.icons-asset-upload {
background-position: -448px -256px;
}
.icons-asset-download {
background-position: -416px -256px;
}
.icons-asset-upload {
background-position: -448px -256px;
}
.icons-music {
background-position: -480px -256px;
}
.icons-book-open-w {
background-position: -512px -256px;
}
.icons-book-open-b {
background-position: -544px -256px;
}
.icons-clapper-board {
background-position: -576px -256px;
}
/*10*/
.icons- {
background-position: -0px -288px;
.icons-date {
background-position: 0px -288px;
}
.icons-screen {
background-position: -32px -288px;
}
.icons-iphone {
background-position: -64px -288px;
}
.icons-ipad {
background-position: -96px -288px;
}
.icons-ipod {
background-position: -128px -288px;
}
.icons-battery-low {
background-position: -160px -288px;
}
.icons-battery-mid {
background-position: -192px -288px;
}
.icons-battery-full {
background-position: -224px -288px;
}
.icons-battery-charge {
background-position: -256px -288px;
}
/*11*/
.icons-pie {
@ -888,14 +1161,50 @@
background-position: -224px -320px;
}
/*12*/
.icons-heart-w {
background-position: 0px -352px;
}
.icons-heart-b {
background-position: -32px -352px;
}
.icons-like {
background-position: -64px -352px;
}
.icons-hate {
background-position: -96px -352px;
}
.icons-medal {
background-position: -128px -352px;
}
.icons-warning {
background-position: -160px -352px;
}
.icons-check {
background-position: -192px -352px;
}
.icons-check-box-solid {
background-position: -224px -352px;
}
.icons-check-box-dot {
background-position: -256px -352px;
}
.icons-check-2 {
background-position: -288px -352px;
}
.icons-check-circle-solid {
background-position: -320px -352px;
}
.icons-check-circle-dot {
background-position: -352px -352px;
}
.icons-check-circle-b {
background-position: -384px -352px;
}
.icons-star-thin {
background-position: -416px -352px;
}
.icons- {
background-position: -0px -352px;
.icons-star {
background-position: -448px -352px;
}
/*13*/
.icons- {
@ -940,5 +1249,5 @@
}
/*21*/
.icons- {
background-position: -0px -640px
}
background-position: -0px -640px;
}

View File

@ -5,6 +5,35 @@ class Admin::DashboardsController < ApplicationController
# before_filter :is_admin?
def index
@module_app_contents, @module_app_contents_total = get_module_app_count('bulletin', 'news_bulletin', 'page_context', 'web_link')
@recent_updated = get_recently_updated('bulletin', 'news_bulletin', 'page_context', 'web_link')
end
protected
def get_module_app_count(*args)
a = {}
total = 0
args.each do |module_app|
module_app_class = module_app.classify.constantize
count = module_app_class.count
a.merge!(module_app => count)
total += count
end
[a.sort {|a,b| b[1]<=>a[1]}, total]
end
def get_recently_updated(*args)
a = {}
args.each do |module_app|
module_app_class = module_app.classify.constantize
objects = module_app_class.order_by(:updated_at, :desc).limit(10)
objects.each do |object|
a.merge!(object => object.updated_at)
end
end
sorted_objects = a.sort {|a,b| b[1]<=>a[1]}
sorted_objects[0..9]
end
end

View File

@ -43,8 +43,8 @@ class Admin::PagePartsController < ApplicationController
def update
@part = PagePart.find(params[:id])
if @part.update_attributes(params[:page_part])
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
flash.now[:notice] = t('admin.update_success_content')
@part.save
respond_to do |format|
format.html {
redirect_to admin_page_url( @part.page )
@ -89,5 +89,14 @@ class Admin::PagePartsController < ApplicationController
format.js {}
end
end
protected
def set_children_sub_menu(part)
part.page.children.each do |child|
child_part = child.page_parts.detect{ |x| x.name.eql?(part.name) } rescue nil
child_part.update_attributes(:kind => part.kind, :public_r_tag => part.public_r_tag, :public_r_tag_object_id => part.public_r_tag_object_id) rescue nil
end
end
end

View File

@ -0,0 +1,29 @@
module Admin::DashboardHelper
def get_link(title)
case title
when 'bulletin'
panel_announcement_back_end_bulletins_path
when 'news_bulletin'
panel_news_back_end_news_bulletins_path
when'page_context'
panel_page_content_back_end_page_contexts_path
when'web_link'
panel_web_resource_back_end_web_links_path
end
end
def get_link_to_object(object)
case object._type.underscore
when 'bulletin'
panel_announcement_back_end_bulletin_path(object)
when 'news_bulletin'
panel_news_back_end_news_bulletin_path(object)
when'page_context'
panel_page_content_back_end_page_context_path(object)
when'web_link'
panel_web_resource_back_end_web_link_path(object)
end
end
end

View File

@ -132,7 +132,7 @@ module ApplicationHelper
stylesheets << "<link href='/assets/style.css' rel='stylesheet' type='text/css' />\n"
end
stylesheets << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.reset_css
# stylesheets << "<link href='/assets/menu.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='#{asset_path 'banner_nav.css'}' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='#{page.design.default_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.default_css
theme = page.design.themes.detect{ |d| d.id == page.theme_id }
stylesheets << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' />\n" if theme

View File

@ -1,8 +1,33 @@
class CronMail < ActionMailer::Base
default :from => "orbit_test@rulingcom.com"
def get_settings
# @@smtp_settings = {
# :address => "smtp.gmail.com",
# :port => '587',
# :domain => "smtp.gmail.com",
# :authentication => "plain",
# :user_name => "redmine@rulingcom.com",
# :password => "rulingredmine",
# :tls => true,
# :enable_starttls_auto => true
# }
@@smtp_settings = {
:address => @site['mail_settings']['address'],
:port => @site['mail_settings']['port'],
:domain => @site['mail_settings']['domain'],
:authentication => @site['mail_settings']['authentication'],
:user_name => @site['mail_settings']['user_name'],
:password => @site['mail_settings']['password'],
:tls => @site['mail_settings']['tls'],
:enable_starttls_auto => @site['mail_settings']['enable_starttls_auto']
}
end
def time_check(msg)
get_settings
#attachments["rails.png"] = File.read("#{Rails.root}/public/images/rails.png")
mail(:to => "Matt <matt@rulingcom.com>", :subject => msg)
mail(:to => "Chris <chris@rulingcom.com>", :subject => msg)
end
end

View File

@ -31,6 +31,17 @@ class Item
nodes << node = node.parent while !node.parent.blank? rescue nil
nodes.reverse
end
# Get an array of ancestor's id
def ancestor_ids
node, nodes = self, []
while !node.parent.blank? do
node = node.parent rescue nil
nodes << node.id if node
end
# nodes << node = node.parent while !node.parent.blank? rescue nil
nodes.reverse
end
# Build the url from the array of ancestors
def url

View File

@ -28,8 +28,20 @@ class Page < Item
def create_parts
page_design = self.design
parent = self.parent
menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent
page_design.layout.layout_parts.each do |layout_part|
self.page_parts.new(:name => layout_part.name) unless self.page_parts.detect{|page_part| page_part.name.eql?(layout_part.name)}
current_part = self.page_parts.detect{|page_part| page_part.name.eql?(layout_part.name)}
current_part = self.page_parts.build(:name => layout_part.name) unless current_part
if menu_part && current_part.name.eql?(menu_part.name)
if current_part.new_record?
current_part.kind = menu_part.kind
current_part.public_r_tag = menu_part.public_r_tag
current_part.public_r_tag_object_id = menu_part.public_r_tag_object_id
else
current_part.update_attributes(:kind => menu_part.kind, :public_r_tag => menu_part.public_r_tag, :public_r_tag_object_id => menu_part.public_r_tag_object_id)
end
end
end
end

View File

@ -8,6 +8,7 @@ class PagePart
field :kind
field :public_r_tag
field :public_r_tag_object_id, :default => nil
field :public_r_tag_option, :default => nil
field :widget_path
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy

View File

@ -12,12 +12,15 @@ class Site
field :private_key, :type => Binary
field :public_key, :type => Binary
field :title_always_on, :type => Boolean, :default => false
field :mail_settings, :type => Hash
field :school
field :department
has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
has_one :footer, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
has_one :sub_menu, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
has_many :site_metas, :autosave => true, :dependent => :destroy
before_save :set_key
@ -33,7 +36,6 @@ class Site
end
def up_to_date?
p res = %x(git remote show origin)
res = res.split('rails_3_1').pop.gsub('(', '').gsub(')','').strip rescue nil
res.eql?('local out of date') ? false : true
end
@ -46,6 +48,10 @@ class Site
@footer ||= I18nVariable.first(:conditions => {:key => 'footer', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
end
def sub_menu
@sub_menu ||= I18nVariable.first(:conditions => {:key => 'sub_menu', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
end
METAS.each do |meta|
define_method meta do
fetch_meta = self.site_metas.where(key: meta).limit(1)
@ -66,6 +72,7 @@ class Site
def set_key
title.key = 'title' if title && (title.key.blank? rescue true)
footer.key = 'footer' if footer && (footer.key.blank? rescue true)
sub_menu.key = 'sub_menu' if sub_menu && (sub_menu.key.blank? rescue true)
end
end

View File

@ -3,6 +3,8 @@ class Tag
include Mongoid::Document
include Mongoid::Timestamps
field :key
belongs_to :module_app
end

View File

@ -1,8 +1,8 @@
<div id="isotope">
<div class="item element">
<h3><i class="icons-content"></i><a href=""><%= t(:content) %></a></h3>
<div class="detail w-a h-b">
<p class="totle"><span><%= t(:all_content) %></span>9,517</p>
<h3><i class="icons-content"></i><%= t(:content) %></h3>
<div class="detail w-a h-a">
<p class="totle"><span><%= t(:all_content) %></span><%= @module_app_contents_total %></p>
<table class="table table-striped">
<thead>
<tr>
@ -23,46 +23,12 @@
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>公告</td>
<td class="span2">2,304</td>
</tr>
<tr>
<td>新聞</td>
<td class="span2">783</td>
</tr>
<tr>
<td>連結</td>
<td class="span2">45</td>
</tr>
<tr>
<td>連結</td>
<td class="span2">62</td>
</tr>
<tr>
<td>連結</td>
<td class="span2">52</td>
</tr>
<tr>
<td>新聞</td>
<td class="span2">20</td>
</tr>
<tr>
<td>公告</td>
<td class="span2">41</td>
</tr>
<tr>
<td>公告</td>
<td class="span2">37</td>
</tr>
<tr>
<td>公告</td>
<td class="span2">41</td>
</tr>
<tr>
<td>公告</td>
<td class="span2">20</td>
</tr>
<% @module_app_contents.each do |module_app_content| %>
<tr>
<td><%= link_to t("dashboard.#{module_app_content[0]}"), get_link(module_app_content[0]) %></td>
<td class="span2"><%= module_app_content[1] %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
@ -70,7 +36,7 @@
</div>
</div>
</div>
<div class="item element">
<!-- <div class="item element">
<h3><i class="icons-member"></i><a href=""><%= t(:member) %></a></h3>
<div class="detail w-a h-a">
<p class="totle"><span><%= t(:all_member) %></span>2,217</p>
@ -211,8 +177,8 @@
</div>
</div>
</div>
</div>
<div class="item element">
</div> -->
<!-- <div class="item element">
<h3><i class="icons-"></i><a href=""><%= t(:referral_in_links) %></a></h3>
<div class="detail w-a h-a">
<p class="totle"><span><%= t(:statistics) %></span>517</p>
@ -282,8 +248,8 @@
</div>
</div>
</div>
</div>
<div class="item element">
</div> -->
<!-- <div class="item element">
<h3><i class="icons-"></i><a href=""><%= t(:most_visited_page) %></a></h3>
<div class="detail noStatistics w-b h-a">
<table class="table table-striped">
@ -460,7 +426,6 @@
<div class="item element">
<h3><i class="icons-"></i><a href=""><%= t(:site_info) %></a></h3>
<div class="detail noStatistics w-b h-a">
<!--<p class="totle"><span><%= t(:statistics) %></span>9,517</p>-->
<table class="table table-striped">
<thead>
<tr>
@ -515,11 +480,10 @@
</div>
</div>
</div>
</div>
</div> -->
<div class="item element">
<h3><i class="icons-"></i><a href=""><%= t(:recent_update) %></a></h3>
<div class="detail noStatistics w-a h-a">
<!--<p class="totle"><span><%= t(:statistics) %></span>9,517</p>-->
<h3><i class="icons-"></i><%= t(:recent_update) %></h3>
<div class="detail noStatistics w-b h-a">
<table class="table table-striped">
<thead>
<tr>
@ -540,46 +504,12 @@
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>Title1</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title2</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title3</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title4</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title5</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title6</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title7</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title8</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title9</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title10</td>
<td class="span2">公告</td>
</tr>
<% @recent_updated.each do |object| %>
<tr>
<td><%= link_to ((object[0].title[I18n.locale] rescue nil) || (object[0].page.i18n_variable[I18n.locale] rescue nil)), get_link_to_object(object[0]) %></td>
<td class="span2"><%= link_to t("dashboard.#{object[0]._type.underscore}"), get_link(object[0]._type.underscore) %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@ -4,7 +4,8 @@
<span id='name_list'>
<% if @r_tag.eql?('sub_menu') %>
<%= f.select :public_r_tag_object_id, options_for_select([t(:horizontal), t(:vertical)], t(:horizontal)) %>
<%= f.hidden_field :public_r_tag_object_id, :value => @part.page.id %>
<%#= f.select :public_r_tag_object_id, options_for_select([t(:horizontal), t(:vertical)], t(:horizontal)) %>
<% else %>
<%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, :selected => @part.public_r_tag_object_id) %>
<% end %>

View File

@ -1,5 +1,5 @@
<% if @r_tag.eql?('sub_menu') %>
$('#name_list select').html("<%= j options_for_select(t(:horizontal) => :horizontal, t(:vertical) => :vertical) %>")
// $('#name_list select').html("<%= j options_for_select(t(:horizontal) => :horizontal, t(:vertical) => :vertical) %>")
<% else %>
$('#name_list select').html("<%= j options_from_collection_for_select(@tag_objects, :id, :title) %>")
<% end %>

View File

@ -0,0 +1,12 @@
<%= content_tag :li, :class => active_for_controllers('sites') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), admin_site_site_info_path(@site) %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('sites')) do -%>
<%= content_tag :li, link_to(t('admin.site_info'), admin_site_site_info_path(@site)), :class => active_for_action('sites', 'site_info') %>
<%#= content_tag :li, link_to(t('admin.system_info'), admin_site_system_info_path(@site)), :class => active_for_action('sites', 'system_info') %>
<%#= content_tag :li, link_to(t('admin.site_language'), admin_site_language_path(@site)), :class => active_for_action('sites', 'language') %>
<%= content_tag :li, link_to(t('admin.mail_setting'), admin_site_mail_setting_path(@site)), :class => active_for_action('sites', 'mail_setting') %>
<%#= content_tag :li, link_to(t('admin.ui_theme'), admin_site_ui_theme_path(@site)), :class => active_for_action('sites', 'ui_theme') %>
<% end -%>
<% end -%>

View File

@ -1 +1,5 @@
<% content_for :side_bar do %>
<%= render 'side_bar' %>
<% end %>
language.html.erb

View File

@ -1 +1,76 @@
mail_setting.html.erb
<% content_for :side_bar do %>
<%= render 'side_bar' %>
<% end %>
<div id="poststuff">
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "clear"} do |f| %>
<div id="post-body">
<div id="post-body-content" class="clear">
<%= f.fields_for :site_settings, @site['site_settings'] do |f| %>
<div class="form-horizontal">
<div class="control-group">
<label class="control-label"><%= t 'admin.mail_address' %></label>
<div class="controls">
<%= f.text_field :address, :value => (@site['site_settings']['address'] rescue nil) %>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'admin.mail_port' %></label>
<div class="controls">
<%= f.text_field :port, :value => (@site['site_settings']['port'] rescue nil) %>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'admin.mail_domain' %></label>
<div class="controls">
<%= f.text_field :domain, :value => (@site['site_settings']['domain'] rescue nil) %>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'admin.mail_authentication' %></label>
<div class="controls">
<%= f.text_field :authentication, :value => (@site['site_settings']['authentication'] rescue nil) %>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'admin.mail_user_name' %></label>
<div class="controls">
<%= f.text_field :user_name, :value => (@site['site_settings']['user_name'] rescue nil) %>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'admin.mail_password' %></label>
<div class="controls">
<%= f.text_field :password, :value => (@site['site_settings']['password'] rescue nil) %>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'admin.mail_tls' %></label>
<div class="controls">
<%= f.check_box :tls, :checked => (@site['site_settings']['tls'].eql?('1') rescue false) %>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'admin.mail_enable_starttls_auto' %></label>
<div class="controls">
<%= f.check_box 'enable_starttls_auto', :checked => (@site['site_settings']['enable_starttls_auto'].eql?('1') rescue false) %>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
</div>
<% end %>
</div>
</div>
<div class="form-actions">
<%= f.submit t("submit"), :class => "btn btn-primary" %>
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
</div>
<% end %>
</div>

View File

@ -1,3 +1,7 @@
<% content_for :side_bar do %>
<%= render 'side_bar' %>
<% end %>
<div id="poststuff">
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "clear"} do |f| %>
<div id="post-body">
@ -9,20 +13,22 @@
<% end %>
</ul>
<div class="tab-content form-horizontal">
<div class="control-group">
<label class="control-label"><%= t 'admin.site_title' %></label>
<div class="control-group" style="margin-bottom: 0;">
<div class="controls">
<%= f.check_box :title_always_on %> <%= t 'admin.always_display_title' %>
<label class="checkbox">
<%= f.check_box :title_always_on %> <%= t 'admin.always_display_title' %>
</label>
</div>
</div>
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group">
<label class="control-label"><%= t 'admin.site_title' %></label>
<div class="controls">
<%= f.fields_for :title, @site.title do |f| %>
<%= f.text_field locale, :class => "input-xxlarge" %>
<% end %>
<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
<p class="help-block"><%= (t 'admin.site_title_help').html_safe %></p>
</div>
</div>
<% end %>
@ -30,12 +36,12 @@
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group">
<label class="control-label"><%= t 'admin.keywords' %></label>
<label class="control-label"><%= t 'admin.site_keywords' %></label>
<div class="controls">
<%= f.fields_for :keywords, @site.keywords do |f| %>
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %>
<% end %>
<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
<p class="help-block"><%= (t 'admin.site_keywords_help').html_safe %></p>
</div>
</div>
<div class="control-group">
@ -44,7 +50,7 @@
<%= f.fields_for :description, @site.description do |f| %>
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %>
<% end %>
<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
<p class="help-block"><%= (t 'admin.site_description_help').html_safe %></p>
</div>
</div>
<div class="control-group">
@ -53,6 +59,15 @@
<%= f.fields_for :footer, @site.footer do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge" %>
<% end %>
<p class="help-block"><%= (t 'admin.site_footer_help').html_safe %></p>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'admin.site_sub_menu' %></label>
<div class="controls">
<%= f.fields_for :sub_menu, @site.sub_menu do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge" %>
<% end %>
</div>
</div>
<% end %>

View File

@ -1 +1,5 @@
<% content_for :side_bar do %>
<%= render 'side_bar' %>
<% end %>
system_info.html.erb

View File

@ -1 +1,5 @@
<% content_for :side_bar do %>
<%= render 'side_bar' %>
<% end %>
ui_theme.html.erb

View File

@ -10,6 +10,7 @@
<li><%#= link_to content_tag(:i, nil, :class => 'icons-asset') + t('admin.asset'), admin_assets_path %></li>
<li class="divider"></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-structure') + t('admin.structure'), admin_items_path %></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), admin_site_site_info_path(@site) %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-plus-cube') + t('admin.add_item') %></li>
</ul>
</div>

View File

@ -67,14 +67,3 @@
<%= content_tag :li, link_to(t('announcement.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('/panel/web_resource/back_end/tags', 'index') %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('sites') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), admin_site_site_info_path(@site) %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('sites')) do -%>
<%= content_tag :li, link_to(t('admin.site_info'), admin_site_site_info_path(@site)), :class => active_for_action('sites', 'site_info') %>
<%= content_tag :li, link_to(t('admin.system_info'), admin_site_system_info_path(@site)), :class => active_for_action('sites', 'system_info') %>
<%= content_tag :li, link_to(t('admin.language'), admin_site_language_path(@site)), :class => active_for_action('sites', 'language') %>
<%= content_tag :li, link_to(t('admin.mail_setting'), admin_site_mail_setting_path(@site)), :class => active_for_action('sites', 'mail_setting') %>
<%= content_tag :li, link_to(t('admin.ui_theme'), admin_site_ui_theme_path(@site)), :class => active_for_action('sites', 'ui_theme') %>
<% end -%>
<% end -%>

View File

@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title><%= @title || APP_CONFIG['orbit'] %></title>
<link rel="shortcut icon" href="<%= asset_path "ncculogo.ico" %>">
<!--[if lt IE 9]>
<%= javascript_include_tag "html5" %>
<![endif]-->
@ -25,7 +26,11 @@
<div class="viewport">
<div class="overview">
<ul class="nav nav-list">
<%= render 'layouts/side_bar' %>
<% if !(yield :side_bar).blank? %>
<%= yield :side_bar %>
<% else %>
<%= render 'layouts/side_bar' %>
<% end %>
</ul>
</div>
</div>

View File

@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<%= page_title(@item).html_safe %>
<link rel="shortcut icon" href="<%= asset_path "ncculogo.ico" %>">
<%= page_metas(@item).html_safe %>
<!--[if lt IE 9]>
<%= javascript_include_tag "html5" %>

View File

@ -29,15 +29,16 @@ Orbit::Application.configure do
# :sender_address => %{"notifier" <redmine@rulingcom.com>},
# :exception_recipients => %w{chris@rulingcom.com}
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:tls => true,
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => '587',
:domain => "smtp.gmail.com",
:authentication => "plain",
:user_name => "redmine@rulingcom.com",
:password => "rulingredmine" }
# config.action_mailer.delivery_method = :smtp
# config.action_mailer.smtp_settings = {
# :tls => true,
# :enable_starttls_auto => true,
# :address => "smtp.gmail.com",
# :port => '587',
# :domain => "smtp.gmail.com",
# :authentication => "plain",
# :user_name => "redmine@rulingcom.com",
# :password => "rulingredmine" }
end

View File

@ -17,4 +17,4 @@ Dir["#{Rails.root}/app/jobs/*.rb"].each { |file| require file }
# The schedule doesn't need to be stored in a YAML, it just needs to
# be a hash. YAML is usually the easiest.
Resque.schedule = YAML.load_file(Rails.root.join('config', 'resque_schedule.yml'))
Resque.schedule = YAML.load_file(Rails.root.join('config', 'resque_schedule.yml'))

View File

@ -162,6 +162,14 @@ en:
list_users: Users list
list_infos: User information list
list_roles: User roles list
mail_address: Address
mail_port: Port
mail_domain: Domain
mail_authentication: Authentication
mail_user_name: User Name
mail_password: Password
mail_tls: TLS
mail_enable_starttls_auto: Enable Start TLS Auto
member: Member
menu_enabled_for: Menu enabled for
module:
@ -205,6 +213,7 @@ en:
site_description: Site description
site_footer: Site footer
site_settings: Site Setting
site_sub_menu: Site sub-menu
site_title: Site title
super_pages: Super pages
structure: Structure
@ -241,7 +250,13 @@ en:
info: User information
panel: User panel
role: User role
dashboard:
bulletin: Announcement
news_bulletin: News
page_context: Page
web_link: Link
panel:
modal:

View File

@ -163,6 +163,14 @@ zh_tw:
list_users: 使用列表
list_infos: 用戶資料列表
list_roles: 用戶身份列表
mail_address: 郵件地址
mail_port: 傳輸埠
mail_domain: 網域名稱
mail_authentication: 認證
mail_user_name: 帳號
mail_password: 密碼
mail_tls: TLS
mail_enable_starttls_auto: Enable Start TLS Auto
member: 會員
menu_enabled_for: 選單啟用
module:
@ -201,6 +209,7 @@ zh_tw:
site_description: 網站描述
site_footer: 網站頁尾
site_settings: 基本設定
site_sub_menu: 網站次選單
site_title: 網站標題
setup_member: 成員設置
setup_translations: 語系設定
@ -243,6 +252,12 @@ zh_tw:
panel: 用戶面板
role: 用戶身份
dashboard:
bulletin: 公告
news_bulletin: 新聞
page_context: 頁面
web_link: 鏈接
panel:

View File

@ -29,9 +29,10 @@ module ParserBackEnd
public_r_tags = parse_content_edits(body, page, id)
parse_images(body, page)
parse_footer(body, page, true)
parse_sub_menu(body, page, true)
public_r_tags.each do |tag|
send("parse_#{tag}s", body, page,id)
send("parse_#{tag}s", body, page, id, true)
end
body.to_html

View File

@ -1,7 +1,7 @@
module ParserCommon
include ActionView::Helpers::TagHelper
def menu_level(page, current, menu, edit = false)
def menu_level(page, current_page, current, menu, edit = false)
res = ''
if page.ordered_and_visible_children.size > 0
res << "<ul class='"
@ -10,10 +10,10 @@ module ParserCommon
i = nil
i = 1 if menu.values["li_incremental_#{current}"]
if menu.values['home'] && current == 1
res << menu_li(page, current, menu, i, edit)
res << menu_li(page, current_page, current, menu, i, edit)
end
page.ordered_and_visible_children.each do |child|
res << menu_li(child, current, menu, i, edit)
res << menu_li(child, current_page, current, menu, i, edit)
i += 1 if i
end
res << "</ul>"
@ -21,28 +21,40 @@ module ParserCommon
res
end
def menu_li(page, current, menu, i, edit)
res = "<li class="
def menu_li(page, current_page, current, menu, i, edit)
res = "<li class='"
res << menu.values["li_class_#{current}"] rescue nil
res << "_#{i}" if i
res << ">"
res << "<a href='#{edit ? admin_page_path(page.id) : page.full_name}'><span>#{page.i18n_variable[I18n.locale]}</span></a>"
res << " active" if (current_page.id.eql?(page.id) || current_page.ancestor_ids.include?(page.id))
res << "'>"
res << "<a href='/#{edit ? admin_page_path(page.id) : page.full_name}'><span>#{page.i18n_variable[I18n.locale]}</span></a>"
if page.ordered_and_visible_children.size > 0 && current <= menu.levels
res << "<span class='dot'></span>"
res << menu_level(page, current + 1, menu, edit)
res << menu_level(page, current_page, current + 1, menu, edit)
end unless (page.is_home? rescue nil)
res << "</li>"
end
# ad_banners
def parse_ad_banners(body = nil, page = nil, id = nil)
def parse_ad_banners(body = nil, page = nil, id = nil, edit=nil)
body.css('ad_banner').each do |banner|
res = ''
ad_banner = AdBanner.find(banner["id"]) rescue nil
if ad_banner
res << "<script type='text/javascript'>
$(document).ready(function(){ $('#slideshow-#{ad_banner.title.dehumanize}').cycle({delay: -1000, fx: '#{ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx}', timeoutFn: getTimeout }); });
$(document).ready(function(){
$('#slideshow-#{ad_banner.title.dehumanize}').cycle({
delay: -1000,
fx: '#{ad_banner.ad_fx.nil? ? 'fade': ad_banner.ad_fx}',
timeoutFn: getTimeout,
pager: '#banner_nav',
pagerAnchorBuilder: function(idx, slide) {
return \"<li><a href='#'>sfdsfsf</a></li>\";
}
});
});
</script>"
res << "<ul id='banner_nav' class='clear'></ul>"
res << "<div id='slideshow-#{ad_banner.title.dehumanize}'>"
printable_ad_images = []
ad_banner.ad_images.each do |ad_image|
@ -55,7 +67,7 @@ module ParserCommon
printable_ad_images.shuffle!
printable_ad_images.each do |ad_image| #TODO Need Reflact
res << "<img src='#{ad_image.file}' "
res << "alt='#{ad_image.title || ' '}' "
res << "alt='#{ad_image.title[I18n.locale] || ' '}' "
res << "time_to_next='#{ad_banner.transition_msec}' "
res << "link_open='#{ad_image.link_open}' "
# res << "link_url='#{(ad_image.direct_to_after_click?? ad_image.out_link : ad_banner.context) || ' '}' "
@ -70,7 +82,7 @@ module ParserCommon
end
# page_images
def parse_images(body, page)
def parse_images(body, page, id = nil, edit=nil)
body.css('.page_image').each do |page_image|
# image = page.custom_images.detect{|image| image.name.eql?(tag.attr['name']) }
# image = page.design.custom_images.detect{|image| image.name.eql?(tag.attr['name']) } unless image
@ -92,38 +104,59 @@ module ParserCommon
page_menu = body.css('.page_menu').first
home = get_homepage
menu = page.design.layout.menu
fragment = Nokogiri::HTML::DocumentFragment.new(body, menu_level(home, 1, menu, edit))
fragment = Nokogiri::HTML::DocumentFragment.new(body, menu_level(home, page, 1, menu, edit))
page_menu.swap(fragment)
end
# sub_menus
def parse_sub_menus(body = nil, page = nil, id = nil)
def parse_sub_menus(body = nil, page = nil, id = nil, edit=nil)
body.css('sub_menu').each do |sub_menu|
menu_page = Page.find(sub_menu['id']) rescue nil
res = ''
res << "<div class='category_list'>"
res << "<h3 class='h3'>#{page.i18n_variable[I18n.locale]}</h3>"
res << "<ul class='list'>"
page.ordered_and_visible_children.each do |child|
res << "<li>"
res << "<a href='#{child.full_name}'>#{child.i18n_variable[I18n.locale]}</a>"
res << "</li>"
if menu_page && menu_page.ordered_and_visible_children.size > 0
res << "<div class='category_list'>"
res << "<h3 class='h3'>#{menu_page.i18n_variable[I18n.locale]}</h3>"
res << "<ul class='list'>"
menu_page.ordered_and_visible_children.each do |child|
res << "<li class='#{page.id.eql?(child.id) ? 'active' : nil}'>"
res << "<a href='/#{edit ? admin_page_path(child.id) : child.full_name}'>#{child.i18n_variable[I18n.locale]}</a>"
res << "</li>"
end
res << "</ul>"
res << "</h3>"
res << "</div>"
end
res << "</ul>"
res << "</h3>"
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
sub_menu.swap(fragment)
end
end
# page_menu
# page_footer
def parse_footer(body, page, edit=nil)
page_footer = body.css('.page_footer').first
res = "<div, id='footer', class='footer'>"
res << @site.footer[I18n.locale]
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
page_footer.swap(fragment) rescue nil
if page_footer
res = "<div id='#{page_footer['id']}', class='#{page_footer['class']}'>"
res << @site.footer[I18n.locale] rescue nil
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
page_footer.swap(fragment) rescue nil
else
''
end
end
# page_sub_menu
def parse_sub_menu(body, page, edit=nil)
page_sub_menu = body.css('.page_sub_menu').first
if page_sub_menu
res = "<div id='#{page_sub_menu['id']}', class='#{page_sub_menu['class']}'>"
res << @site.sub_menu[I18n.locale] rescue nil
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
page_sub_menu.swap(fragment) rescue nil
else
''
end
end
end

View File

@ -26,7 +26,8 @@ module ParserFrontEnd
parse_menu(body, page)
public_r_tags = parse_contents(body, page, id,params[:preview])
parse_images(body, page)
parse_footer(body, page, true)
parse_footer(body, page)
parse_sub_menu(body, page)
public_r_tags.each do |tag|
send("parse_#{tag}s", body, page,id)

View File

@ -0,0 +1,64 @@
<?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>2012年世界狂歡節-「框」住瞬間「框」住世界</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2901&amp;key2=20120508" />
<author>
<name />
</author>
<summary type="text">101/05/01-101/05/08 00:00-23:59</summary>
</entry>
<entry>
<title>2012年世界狂歡節-環友世界</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2902&amp;key2=20120508" />
<author>
<name />
</author>
<summary type="text">101/05/01-101/05/10 00:00-23:59</summary>
</entry>
<entry>
<title>2012年世界狂歡節-從政大看台灣</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2903&amp;key2=20120508" />
<author>
<name />
</author>
<summary type="text">101/05/01-101/05/10 08:00-22:00</summary>
</entry>
<entry>
<title>2012年世界狂歡節-美食嘉年華</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2905&amp;key2=20120508" />
<author>
<name />
</author>
<summary type="text">101/05/08-101/05/10 12:00-14:00</summary>
</entry>
<entry>
<title>2012年世界狂歡節-「原,夜」晚會</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2906&amp;key2=20120508" />
<author>
<name />
</author>
<summary type="text">101/05/08 19:00-21:00</summary>
</entry>
<entry>
<title>2012年世界狂歡節-開幕式</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2907&amp;key2=20120508" />
<author>
<name />
</author>
<summary type="text">101/05/08 12:10-13:30</summary>
</entry>
<entry>
<title>職場講座「數位文本實務課程」</title>
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2874&amp;key2=20120508" />
<author>
<name />
</author>
<summary type="text">101/04/24-101/05/15 12:20-13:50</summary>
</entry>
</feed>

View File

@ -14,7 +14,9 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
if !params[:category_id].blank?
@bulletins = Bulletin.can_display.where(:bulletin_category_id => params[: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)
elsif !params[:tag_id].blank?
@bulletins = AnnouncementTag.find(params[:tag_id]).bulletins.can_display.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)
tmp = AnnouncementTag.find(params[:tag_id]) rescue nil
tmp = AnnouncementTag.where(key: params[:tag_id])[0] unless tmp
@bulletins = tmp.bulletins.can_display.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.can_display.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

View File

@ -26,7 +26,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
end
def bulletins_and_web_links
@tags = AnnouncementTag.all
@tags = AnnouncementTag.any_in(key: ['students', 'alumni', 'employee', 'guest'])
@selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0]
@bulletins = @selected_tag.get_visible_bulletins.can_display.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

View File

@ -7,7 +7,7 @@
<% sys_user.sub_roles.each do |sr| %>
<div class="for_unit" style="display:none;"> <%= sr.key %></div>
<% end %>
<%= content_tag :div,:data=>{'original-title'=>t('announcement.bulletin.approval_setting_window_title'),:content => "#{sys_user.sub_roles.collect{|sr| sr.key}.join(',')}"},:class=>"checkbox clear" do %>
<%= content_tag :div,:data=>{'original-title'=>t('announcement.bulletin.approval_setting_window_title'),:content => "#{sys_user.sub_roles.collect{|sr| sr.i18n_variable[I18n.locale]}.join(',')}"},:class=>"checkbox clear" do %>
<div class="check-icon">
</div>
<div class='member-avatar'>

View File

@ -91,12 +91,20 @@
</div>
<h3 class="widget-title"><i class="icons-tag icons-white"></i>Tags</h3>
<div class="widget-content clear form-horizontal">
<% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'bulletin[tag_ids][]', tag.id, @bulletin.tag_ids.include?(tag.id)%>
<%= tag[I18n.locale] %>
<p>
<% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'bulletin[tag_ids][]', tag.id, @bulletin.tag_ids.include?(tag.id)%>
<%= tag[I18n.locale] %>
<% end %>
<% end %>
<% end %>
</p>
<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>
<hr>
<input type="text" class="input-xlarge">
</div>
</div>
<% if params[:action] != 'new' %>

View File

@ -14,18 +14,28 @@
<div class="news_paragraph">
<%= @bulletin.text[I18n.locale].html_safe %>
</div>
<b><%= t('announcement.link') %></b>
<% @bulletin.bulletin_links.each do | blink | %>
<%= link_to blink.i18n_variable[I18n.locale], blink.url, :target => '_blank' %>
<% end %>
</li>
<li>
<b><%= t('announcement.file') %></b>
<% @bulletin.bulletin_files.each do | bfile | %>
<%= link_to bfile.filetitle[I18n.locale], bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
<% end %>
<div class="linkAndFile">
<% if @bulletin.bulletin_links.size > 0 %>
<div>
<i class="icons-link"></i>
<div class="showLink">
<% @bulletin.bulletin_links.each do | blink | %>
<%= link_to blink.i18n_variable[I18n.locale], blink.url, :target => '_blank' %>
<% end %>
</div>
</div>
<% end %>
<% if @bulletin.bulletin_files.size > 0 %>
<div>
<i class="icons-paperclip"></i>
<div class="showFile">
<% @bulletin.bulletin_files.each do | bfile | %>
<%= link_to bfile.filetitle[I18n.locale], bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
<% end %>
</div>
</div>
<% end %>
</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>

View File

@ -3,7 +3,7 @@
<h3 class="h3"><%= t('announcement.categories') %></h3>
<ul class="list">
<% @bulletin_categorys.each do |category| %>
<li>
<li class="<%= category.id.to_s.eql?(params[:category_id]) ? 'active' : nil %>">
<%= link_to category.i18n_variable[I18n.locale], panel_announcement_front_end_bulletins_path(:category_id => category.id) %>
</li>
<% end %>
@ -11,13 +11,11 @@
</div>
<div class="tag_cloud">
<h3 class="h3"><%= t('announcement.tag_cloud') %></h3>
<ul class="cloud">
<div class="cloud">
<% @tags.each do |tag| %>
<li class="hot<%#=rand(4) + 1%>">
<%= link_to tag[I18n.locale], panel_announcement_front_end_bulletins_path(:tag_id => tag.id) %>
</li>
<%= link_to tag[I18n.locale], panel_announcement_front_end_bulletins_path(:tag_id => tag.id), :class => "hot#{rand(4) + 1} #{tag.id.to_s.eql?(params[:tag_id]) ? 'active' : nil}" %>
<% end %>
</ul>
</div>
</div>
<!-- <div class="clear"></div> -->
<!-- <div class="rss_feed">

View File

@ -13,7 +13,9 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController
if !params[:category_id].blank?
@news_bulletins = NewsBulletin.can_display.where(:news_bulletin_category_id => params[: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)
elsif !params[:tag_id].blank?
@news_bulletins = NewsTag.find(params[:tag_id]).news_bulletins.can_display.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)
tmp = NewsTag.find(params[:tag_id]) rescue nil
tmp = NewsTag.where(key: params[:tag_id])[0] unless tmp
@news_bulletins = tmp.news_bulletins.can_display.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) rescue nil
else
@news_bulletins = NewsBulletin.can_display.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

View File

@ -8,25 +8,24 @@
<h1 class="h1"><%= t('news.list_news') %></h1>
<% end %>
<table class="table table-bordered">
<tr>
<th><%= t('news.news_bulletin.category') %></th>
<th><%= t('news.news_bulletin.title') %></th>
<th><%= t('news.news_bulletin.postdate') %></th>
</tr>
<% @news_bulletins.each do |post| %>
<tr>
<td><%= post.news_bulletin_category.i18n_variable[I18n.locale] %></td>
<td><%= link_to post.title[I18n.locale], panel_news_front_end_news_bulletin_path(post) %>
<%#= link_to post.title, panel_news_back_end_news_bulletin_path(post) %>
</td>
<td><%= post.postdate %></td>
</tr>
<% end %>
<tbody>
<tr>
<th class="span2"><%= t('news.news_bulletin.image') %></th>
<th><%= t('news.news_bulletin.title') %></th>
<th class="span2 pagination-right"><%= t('news.news_bulletin.postdate') %></th>
</tr>
<% @news_bulletins.each do |post| %>
<tr>
<td><%= image_tag post.image %></td>
<td>
<%= link_to post.title[I18n.locale], panel_news_front_end_news_bulletin_path(post), :class => 'news_title' %>
<%= post.subtitle[I18n.locale].html_safe %>
</td>
<td><%= post.postdate %></td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @news_bulletins, :params => {:inner => 'false'} %>

View File

@ -14,17 +14,28 @@
<div class="news_paragraph">
<%= @news_bulletin.text[I18n.locale].html_safe %>
</div>
<b><%= t('announcement.link') %></b>
<% @news_bulletin.bulletin_links.each do | blink | %>
<%= link_to blink.i18n_variable[I18n.locale], blink.url, :target => '_blank' %>
<% end %>
</li>
<li>
<b><%= t('announcement.file') %></b>
<% @news_bulletin.bulletin_files.each do | bfile | %>
<%= link_to bfile.filetitle[I18n.locale], bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
<% end %>
<div class="linkAndFile">
<% if @news_bulletin.news_bulletin_links.size > 0 %>
<div>
<i class="icons-link"></i>
<div class="showLink">
<% @news_bulletin.news_bulletin_links.each do | blink | %>
<%= link_to blink.i18n_variable[I18n.locale], blink.url, :target => '_blank' %>
<% end %>
</div>
</div>
<% end %>
<% if @news_bulletin.news_bulletin_files.size > 0 %>
<div>
<i class="icons-paperclip"></i>
<div class="showFile">
<% @news_bulletin.news_bulletin_files.each do | bfile | %>
<%= link_to bfile.filetitle[I18n.locale], bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
<% end %>
</div>
</div>
<% end %>
</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>

View File

@ -3,7 +3,7 @@
<h3 class="h3"><%= t('announcement.categories') %></h3>
<ul class="list">
<% @news_bulletin_categorys.each do |category| %>
<li>
<li class="<%= category.id.to_s.eql?(params[:category_id]) ? 'active' : nil %>">
<%= link_to category.i18n_variable[I18n.locale], panel_news_front_end_news_bulletins_path(:category_id => category.id) %>
</li>
<% end %>
@ -11,13 +11,11 @@
</div>
<div class="tag_cloud">
<h3 class="h3"><%= t('announcement.tag_cloud') %></h3>
<ul class="cloud">
<div class="cloud">
<% @tags.each do |tag| %>
<li class="hot<%#=rand(4) + 1%>">
<%= link_to tag[I18n.locale], panel_news_front_end_news_bulletins_path(:tag_id => tag.id) %>
</li>
<%= link_to tag[I18n.locale], panel_news_front_end_news_bulletins_path(:tag_id => tag.id), :class => "hot#{rand(4) + 1} #{tag.id.to_s.eql?(params[:tag_id]) ? 'active' : nil}" %>
<% end %>
</ul>
</div>
</div>
<!-- <div class="clear"></div> -->
<!-- <div class="rss_feed">

View File

@ -16,9 +16,9 @@
</table>
<% end %>
<div id="web_link_pagination" class="paginationFixed">
<%= paginate @web_links, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_web_resource_back_end_web_link_path, :class => 'btn btn-primary' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_web_resource_back_end_web_link_path, :class => 'btn btn-primary pull-right' %>
<div id="web_link_pagination" class="paginationFixed">
<%= paginate @web_links, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div>
</div>