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 committed 2012-02-29 13:07:21 +08:00
commit 9a40ecd1d9
186 files changed
+7748 -4699

No files matched your search

+1 -1
View File
@@ -7,6 +7,6 @@
"update_info": "Some info",
"create_date": "11-11-2011",
"app_pages": ["bulletins"],
"widgets": ["bulletins"],
"widgets": ["bulletins", "bulletins_and_web_links"],
"enable_frontend": true
}
@@ -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");
}
});
});
@@ -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
@@ -1,6 +1,6 @@
class Panel::Announcement::BackEnd::BulletinCategorysController < ApplicationController
layout 'admin'
layout 'new_admin'
def index
@bulletin_categorys = BulletinCategory.all
@@ -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.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
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|
format.html # index.html.erb
format.js
format.xml { render :xml => @bulletins }
end
end
@@ -97,7 +100,6 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
# @bulletin.image.clear if params[:bulletin][:image_del] == '1'
if params[:bulletin][:image_del] == '1'
@bulletin.remove_image!
@bulletin.image_filename = nil
# @bulletin.image_del = nil
params[:bulletin][:image_del] = nil
end
@@ -145,6 +147,50 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
def get_categorys(id = nil)
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
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
@@ -10,9 +10,12 @@ class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController
def index
date_now = Time.now
@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)
date_now = Time.now
if params[:bulletin_category_id]
@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
end
@@ -13,21 +13,31 @@ class Panel::Announcement::Widget::BulletinsController < ObitWidgetController
# deadline
# @bulletin_categorys = BulletinCategory.first;
# @bulletins = Bulletin.widget_datas(@bulletin_categorys.id).limit(9)
@bulletins = Bulletin.widget_datas.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)
end
get_categorys
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)
# get_categorys
module_app = ModuleApp.first(:conditions => {:key => 'announcement'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
def reload_bulletins
@selected_tag = AnnouncementTag.find(params[:tag_id])
@bulletins = @selected_tag.get_visible_bulletins.page(params[:page]).per(5) rescue nil
end
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
@@ -2,4 +2,10 @@ class AnnouncementTag < Tag
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
@@ -106,6 +106,17 @@ class Bulletin
def text
@text ||= I18nVariable.first(:conditions => {:key => 'text', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
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
@@ -1,4 +1,4 @@
<tr id="<%= dom_id bulletin %>">
<tr id="<%= dom_id bulletin %>" class="with_action">
<td><input type="checkbox"></td>
<td>
<% if bulletin.is_top? %>
@@ -14,13 +14,13 @@
<ul class="nav nav-pills hide">
<li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
<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">
<li><a href="#">Basic</a></li>
<li><a href="#">Picture</a></li>
<li><a href="#">Tags</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">File</a></li>
<li><a href="#" class='toggle-tr-edit' rel='basic'><%= t(:basic) %></a></li>
<li><a href="#" class='toggle-tr-edit' rel='picture'><%= t(:picture) %></a></li>
<li><a href="#" class='toggle-tr-edit' rel='tags'><%= t(:tags) %></a></li>
<li><a href="#" class='toggle-tr-edit' rel='link'><%= t(:link) %></a></li>
<li><a href="#" class='toggle-tr-edit' rel='file'><%= t(:file) %></a></li>
</ul>
</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.deadline) ? bulletin.deadline : t('bulletin.no_deadline') %></td>
<td>
<% bulletin.tags.each do |tag| %>
<% bulletin.sorted_tags.each do |tag| %>
<span class="label label-tags"><%= tag[I18n.locale] %></span>
<% end %>
</td>
<td>rulingcom</td>
<td><%= User.from_id(bulletin.update_user_id).name %></td>
</tr>
<%= render :partial => 'quick_edit', :locals => {:bulletin => bulletin} %>
@@ -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>
@@ -1,56 +1,57 @@
<div class="subnav">
<ul class="nav nav-pills filter">
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-status" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t(:status) %> <b class="web-symbol"></b></a>
</div>
</li>
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-category" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t(:category) %> <b class="web-symbol"></b></a>
</div>
</li>
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-tags" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t(:tags) %> <b class="web-symbol"></b></a>
</div>
</li>
</ul>
<div class="filters">
<div class="accordion-body collapse" id="collapse-status">
<div class="accordion-inner" data-toggle="buttons-checkbox">
<a href="#" class="btn">Category1</a>
<a href="#" class="btn">Category2</a>
</div>
<div class="filter-clear">
<a href="#" class="btn"><i class="icons-brush-large"></i>Clear/重置</a>
</div>
</div>
<div class="accordion-body collapse" id="collapse-category">
<div class="accordion-inner" data-toggle="buttons-checkbox">
<a href="#" class="btn">Category1</a>
<a href="#" class="btn">Category2</a>
</div>
<div class="filter-clear">
<a href="#" class="btn"><i class="icons-brush-large"></i>Clear/重置</a>
</div>
</div>
<div class="accordion-body collapse" id="collapse-tags">
<div class="accordion-inner" data-toggle="buttons-checkbox">
<a href="#" class="btn">Tag1</a>
<a href="#" class="btn">Tag2</a>
<a href="#" class="btn">Tag3</a>
<a href="#" class="btn">Tag4</a>
<a href="#" class="btn">Tag5</a>
<a href="#" class="btn">Tag6</a>
<a href="#" class="btn">Tag7</a>
<a href="#" class="btn">Tag8</a>
<a href="#" class="btn">Tag9</a>
<a href="#" class="btn">Tag10</a>
</div>
<div class="filter-clear">
<a href="#" class="btn"><i class="icons-brush-large"></i>Clear/重置</a>
</div>
</div>
</div>
<ul class="nav nav-pills filter">
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-status" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t(:status) %> <b class="web-symbol"></b></a>
</div>
</li>
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-category" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t(:category) %> <b class="web-symbol"></b></a>
</div>
</li>
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-tags" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t(:tags) %> <b class="web-symbol"></b></a>
</div>
</li>
</ul>
<div class="filters">
<div class="accordion-body collapse" id="collapse-status">
<div class="accordion-inner" data-toggle="buttons-checkbox">
<a href="#" class="btn">Category1</a>
<a href="#" class="btn">Category2</a>
</div>
<div class="filter-clear">
<a href="#" class="btn"><i class="icons-brush-large"></i>Clear/重置</a>
</div>
</div>
<div class="accordion-body collapse" id="collapse-category">
<div class="accordion-inner" data-toggle="buttons-checkbox">
<% @bulletin_categories.each do |category| -%>
<%= link_to category.i18n_variable[I18n.locale], panel_announcement_back_end_bulletins_path(:filter => add_filter(:categories, category.id)), :class => 'btn' %>
<% end -%>
</div>
<div class="filter-clear">
<a href="#" class="btn"><i class="icons-brush-large"></i>Clear/重置</a>
</div>
</div>
<div class="accordion-body collapse" id="collapse-tags">
<div class="accordion-inner" data-toggle="buttons-checkbox">
<a href="#" class="btn">Tag1</a>
<a href="#" class="btn">Tag2</a>
<a href="#" class="btn">Tag3</a>
<a href="#" class="btn">Tag4</a>
<a href="#" class="btn">Tag5</a>
<a href="#" class="btn">Tag6</a>
<a href="#" class="btn">Tag7</a>
<a href="#" class="btn">Tag8</a>
<a href="#" class="btn">Tag9</a>
<a href="#" class="btn">Tag10</a>
</div>
<div class="filter-clear">
<a href="#" class="btn"><i class="icons-brush-large"></i>Clear/重置</a>
</div>
</div>
</div>
</div>
@@ -1,12 +1,8 @@
<% # encoding: utf-8 %>
<%= f.error_messages %>
<div class="field">
<%= f.label :category %><br />
<%= f.select :bulletin_category_id, @bulletin_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ]} %>
</div>
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
<div class="field">
<%= f.label :image, t('announcement.image') %><br />
<%= f.file_field :image %>
@@ -145,4 +141,391 @@
});
</script>
<% 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> -->
@@ -1,12 +1,13 @@
<!-- <tr class="qe-block hide"> -->
<tr class="qe-block">
<tr class="qe-block hide">
<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| %>
<%= render :partial => "quick_edit_basic", :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_links", :locals => { :f => f, :bulletin => bulletin } %>
<%= render :partial => "quick_edit_files", :locals => { :f => f, :bulletin => bulletin } %>
<div class="form-actions">
<%= f.submit t(:submit), :class => 'btn btn-primary' %>
<%= f.submit t(:cancel), :class => 'btn', :type => 'reset' %>
@@ -1,4 +1,4 @@
<div id="qe-basic">
<div id="qe-basic" class="qe-edit-div hide">
<div id="widget-category">
<div class="control-group">
<label class="control-label"><%= t(:category) %></label>
@@ -1,4 +1,4 @@
<div id="qe-file">
<div id="qe-file" class="qe-edit-div hide">
<div id="widget-file">
<div class="control-group">
<table class="table table-condensed">
@@ -1,4 +1,4 @@
<div id="qe-link">
<div id="qe-link" class="qe-edit-div hide">
<div id="widget-link">
<div class="control-group">
<table class="table table-condensed">
@@ -1,9 +1,9 @@
<div id="qe-picture">
<div id="qe-picture" class="qe-edit-div hide">
<div id="widget-picture">
<div class="control-group">
<label class="control-label">Picture</label>
<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">
<label class="control-label btn" for="input-upload">
Browse/選擇檔案
@@ -32,7 +32,7 @@
</div>
</div> -->
<div id="qe-tags">
<div id="qe-tags" class="qe-edit-div hide">
<div id="widget-tags">
<div class="form-horizontal">
<% @tags.each do |tag| %>
@@ -1,16 +1,7 @@
<br />
<br />
<br />
<br />
<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} %>
<% end %>
<%= link_back %>
<br />
<br />
<br />
<br />
<%= link_back %>
@@ -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' %>
<table class="table main-list">
<thead>
<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 id="bulettin_sort_list" class="table main-list">
<%= render 'bulletins' %>
</table>
<div class="form-actions">
@@ -0,0 +1 @@
$("#bulettin_sort_list").html("<%= j render 'bulletins' %>")
@@ -21,7 +21,7 @@
</li>
<li>
<%#= 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>
<b><%= t('announcement.subtitle') %></b>
@@ -2,30 +2,28 @@
<%= flash_messages %>
<h1 class="h1"><%= t('announcement.list_announcement') %></h1>
<table class="table table-bordered">
<tr>
<th><%= t('announcement.bulletin.category') %></th>
<th><%= t('announcement.bulletin.title') %></th>
<th><%= t('announcement.bulletin.postdate') %></th>
</tr>
<% @bulletins.each do |post| %>
<tr>
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
<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) %>
</td>
<td><%= post.postdate %></td>
</tr>
<% end %>
</table>
<%= paginate @bulletins %>
<h1><%= t('bulletin.list_announcement') %></h1>
<table>
<tr>
<th><%= t('bulletin.postdate') %></th>
<th><%= t('bulletin.category') %></th>
<th><%= t('bulletin.title') %></th>
</tr>
<% @bulletins.each do |post| %>
<tr>
<td><%= post.postdate %></td>
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %>
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
</td>
</tr>
<% end %>
</table>
<br />
@@ -1,9 +1,23 @@
<% # encoding: utf-8 %>
<br />
<br />
<br />
<h1 class="h1"><%= @bulletin.title[I18n.locale] %></h1>
<div class="info">
<div class="info1">
<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>
<ul>
@@ -25,11 +39,11 @@
</li>
<li>
<b><%= t('announcement.subtitle') %></b>
<%= @bulletin.subtitle[I18n.locale] %>
<%= @bulletin.subtitle[I18n.locale].html_safe %>
</li>
<li>
<b><%= t('announcement.text') %></b>
<%= @bulletin.text[I18n.locale] %>
<%= @bulletin.text[I18n.locale].html_safe %>
</li>
<li>
<li>
@@ -52,6 +66,6 @@
<b><%= t('announcement.最後修改時間') %></b>
<%= @bulletin.updated_at.strftime("%Y-%m-%d %H:%I:%S") %>
</li>
-->
<%#= link_back %>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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 %>")
@@ -2,7 +2,6 @@
<% if @bulletins and !@bulletins.nil? %>
<!-- tag -->
<div class="tag_block">
<ul class="tag_list">
<% @tags.each do |tag| %>
@@ -11,15 +10,18 @@
</ul>
</div>
<!-- news -->
<div class="news_block">
<h3 class="news_title"><%= t('公告訊息')%></h3>
<% @tags.each_with_index do |tag, index| %>
<div id="news_<%= index %>" class="news_block">
<h3 class="news_title2"><%= t("announcement.bulletins") %></h3>
<div class="news_prev">prev</div>
<div class="news_next">next</div>
<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>
<% end %>
</ul>
</div>
<% end %>
<% end %>
@@ -2,21 +2,19 @@
<% if @bulletins and !@bulletins.nil? %>
<div class="topic_news">
<div class="topic_news2">
<h2 class="topic_title"><%= t('焦點新聞')%></h2>
<%= link_to "more+",panel_announcement_front_end_bulletins_path(), :class => "topic_note" %>
<ul>
<h2 class="topic_title"><%= t('announcement.campus_news')%></h2>
<%= link_to t('announcement.more'),panel_announcement_front_end_bulletins_path(), :class => "topic_note" %>
<div class="topic_prev">previous page</div>
<div class="topic_next">next page</div>
<ul id="topic_list">
<% @bulletins.each do |post| %>
<li>
<div class="news_img"><%= image_tag(post.image.url, :size => "290x130") if post.image.file %></div>
<h3 class="h3 news_title"><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %></h3>
<h3 class="h3 news_title"><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %></h3>
<p class="news_wrap"><%= post.subtitle[I18n.locale] %></p>
</li>
<% end %>
</ul>
</div>
</div>
<% end %>
@@ -0,0 +1 @@
$('#bulletins_web_links_bulletins').html("<%= j render 'bulletins' if @bulletins %>")
@@ -0,0 +1 @@
$('#bulletins_web_links_web_links').html("<%= j render 'web_links' if @web_links %>")
+10 -2
View File
@@ -24,8 +24,16 @@ en:
yes_: "Yes"
announcement:
sure?: Sure?
sure?: Sure?
campus_news: Campus News
more: more+
bulletins: Bulletins
related_links: Related Links
list_announcement: List Announcement
bulletin:
category: Category
title: Title
postdate: Postdate
# admin:
# action: Action
# add_language: Add language
+106 -95
View File
@@ -17,101 +17,112 @@ zh_tw:
sure?: 您肯定嗎?
update: 更新
yes_: "Yes"
admin:
action: 行動
add_language: 新增語言
admin: 管理
action: 行動
announcement: 公告
asset: 資產
attributes: 屬性
cant_delete_self: 您不可以刪除自己。
cant_revoke_self_admin: 您不可以撤銷自己的管理作用。
class: 階級
content: 內容
create_error_link: 創建連接時出錯。
create_error_page: 創建頁面時出錯。
create_success_home: 首頁已成功創建。
create_success_layout: 樣板已成功創建。
create_success_link: 連結已成功創建。
create_success_page: 頁面已成功創建。
create_success_snippet: 片段已成功創建
create_success_user: 用戶已成功創建。。
data: 數據
delete_language: 刪除語言
description: 描述
disable_language: 禁用語言
editing_home: 編輯首頁
editing_layout: 編輯樣板
editing_link: 編輯連結
editing_page: 編輯頁面
editing_snippet: 編輯片段
editing_user_info: 編輯用戶資料
editing_user_role: 編輯用戶角色
email: Email
enable_language: 啟用語言
file_name: 檔名
file_size: 檔案大小
format: 格式
home: 首頁
id: ID
info: 資料
is_published: 被出版
item: 項目
key: 關鍵
language: 語言
layout: 佈局
layout_name: 佈局名字
list_assets: 資產清單
list_items: 項目清單
list_layouts: 佈局清單
list_snippets: 斷片清單
list_users: 使用清單
list_user_infos: 用戶資料清單
list_user_roles: 用戶角色清單
member: 會員
move_down: 往下移
move_up: 往上移
multilingual: 多種語言
my_avatar: 我的頭像
no_home_page: 您沒有首頁
no_layout: 您沒有佈局
name: 名稱
new_asset: 新增資產
new_component: 新增元件
new_home: 新增首頁
new_layout: 新增樣板
new_link: 新增連結
new_page: 新增頁面
new_snippet: 新增片段
new_user: 新增使用
new_user_info: 新增用戶資料
new_user_role: 新增用戶角色
non_multilingual: 非多種語言
options: 選項
orig_upload_file: 原上傳檔名
position: 位置
published?: 發布?
role: 角色
roles: 角色。
title: 標題
translation: 翻譯
type: 類型
update_error_link: 更新鏈接時出現錯誤。
update_error_page: 更新頁面時出現錯誤。
update_success_content: 內容已成功更新。
update_success_home: 首頁已成功更新。
update_success_layout: 樣板已成功更新。
update_success_link: 連結已成功更新。
update_success_page: 頁面已成功更新。
update_success_snippet: 片段已成功更新。
update_success_user: 用戶已成功更新
url: URL
user: 用戶
user_info: 用戶資料
user_panel: 用戶面板
user_role: 用戶角色
announcement:
sure?: 確定嗎?
campus_news: 校園新聞
more: 更多+
bulletins: 公告訊息
related_links: 相關連結
list_announcement: 公告列表
bulletin:
category: 分類
title: 標題
postdate: 張貼日期
# admin:
# action: 行動
# add_language: 新增語言
# admin: 管理
# action: 行動
# announcement: 公告
# asset: 資產
# attributes: 屬性
# cant_delete_self: 您不可以刪除自己。
# cant_revoke_self_admin: 您不可以撤銷自己的管理作用。
# class: 階級
# content: 內容
# create_error_link: 創建連接時出錯。
# create_error_page: 創建頁面時出錯。
# create_success_home: 首頁已成功創建。
# create_success_layout: 樣板已成功創建。
# create_success_link: 連結已成功創建。
# create_success_page: 頁面已成功創建。
# create_success_snippet: 片段已成功創建
# create_success_user: 用戶已成功創建。。
# data: 數據
# delete_language: 刪除語言
# description: 描述
# disable_language: 禁用語言
# editing_home: 編輯首頁
# editing_layout: 編輯樣板
# editing_link: 編輯連結
# editing_page: 編輯頁面
# editing_snippet: 編輯片段
# editing_user_info: 編輯用戶資料
# editing_user_role: 編輯用戶角色
# email: Email
# enable_language: 啟用語言
# file_name: 檔名
# file_size: 檔案大小
# format: 格式
# home: 首頁
# id: ID
# info: 資料
# is_published: 被出版
# item: 項目
# key: 關鍵
# language: 語言
# layout: 佈局
# layout_name: 佈局名字
# list_assets: 資產清單
# list_items: 項目清單
# list_layouts: 佈局清單
# list_snippets: 斷片清單
# list_users: 使用清單
# list_user_infos: 用戶資料清單
# list_user_roles: 用戶角色清單
# member: 會員
# move_down: 往下移
# move_up: 往上移
# multilingual: 多種語言
# my_avatar: 我的頭像
# no_home_page: 您沒有首頁
# no_layout: 您沒有佈局
# name: 名稱
# new_asset: 新增資產
# new_component: 新增元件
# new_home: 新增首頁
# new_layout: 新增樣板
# new_link: 新增連結
# new_page: 新增頁面
# new_snippet: 新增片段
# new_user: 新增使用
# new_user_info: 新增用戶資料
# new_user_role: 新增用戶角色
# non_multilingual: 非多種語言
# options: 選項
# orig_upload_file: 原上傳檔名
# position: 位置
# published?: 發布?
# role: 角色
# roles: 角色。
# title: 標題
# translation: 翻譯
# type: 類型
# update_error_link: 更新鏈接時出現錯誤。
# update_error_page: 更新頁面時出現錯誤。
# update_success_content: 內容已成功更新。
# update_success_home: 首頁已成功更新。
# update_success_layout: 樣板已成功更新。
# update_success_link: 連結已成功更新。
# update_success_page: 頁面已成功更新。
# update_success_snippet: 片段已成功更新。
# update_success_user: 用戶已成功更新
# url: URL
# user: 用戶
# user_info: 用戶資料
# user_panel: 用戶面板
# user_role: 用戶角色
panel:
+3 -1
View File
@@ -15,7 +15,9 @@ Rails.application.routes.draw do
end
namespace :widget do
match "bulletins" => "bulletins#index"
match "bulletins_list" => "bulletins#bulletins_list"
match "bulletins_and_web_links" => "bulletins#bulletins_and_web_links"
match "reload_bulletins" => "bulletins#reload_bulletins"
match "reload_web_links" => "bulletins#reload_web_links"
end
end
end
@@ -1,13 +1,14 @@
<ul class="post_list">
<ul class="post_list1">
<li>
<h2 class="h2 in_heading"><%= post_frontend.title %></h2>
<div class="post_content">
<%= truncate(post_frontend.body,:length=>25) %>
<div class="post_title">
<h4 class="h4"><%=link_to post_frontend.title,panel_new_blog_front_end_post_path(post_frontend) %></h2>
</div>
<%= link_to 'Read more...',panel_new_blog_front_end_post_path(post_frontend), :class => 'btn' %>
<div class="post_content" style="margin:0 0 10px;">
<%= truncate(post_frontend.body,:length=>100) %>
</div>
</li>
</ul>
<div class="clear" style="height:20px;"></div>
<table class="table table-bordered">
@@ -20,9 +21,9 @@
</thead>
<tbody>
<tr>
<th><%= post_frontend.title %></td>
<td><%= truncate(post_frontend.body,:length=>25) %></td>
<td><%= link_to 'Read more...',panel_new_blog_front_end_post_path(post_frontend), :class => 'btn' %></td>
<td width="30%"><%= post_frontend.title %></td>
<td width="55%"><%= truncate(post_frontend.body,:length=>100) %></td>
<td width="15%"><%= link_to 'Read more...',panel_new_blog_front_end_post_path(post_frontend), :class => 'btn' %></td>
</tr>
</tbody>
</ul>
@@ -6,8 +6,9 @@
<%= flash_messages %>
<h1 class="h1 ini_heading"><%= t('blog.front_end_index') %></h1>
<%= render :partial => "post_frontend", :collection => @posts %>
<h1 class="h1"><%= t('blog.front_end_index') %></h1>
<div class="style1">
<%= render :partial => "post_frontend", :collection => @posts %>
</div>
@@ -0,0 +1,6 @@
.bundle/
log/*.log
pkg/
test/dummy/db/*.sqlite3
test/dummy/log/*.log
test/dummy/tmp/
+17
View File
@@ -0,0 +1,17 @@
source "http://rubygems.org"
# Declare your gem's dependencies in page_content.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec
# jquery-rails is used by the dummy application
gem "jquery-rails"
# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
+20
View File
@@ -0,0 +1,20 @@
Copyright 2012 YOURNAME
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+3
View File
@@ -0,0 +1,3 @@
= PageContent
This project rocks and uses MIT-LICENSE.
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env rake
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
begin
require 'rdoc/task'
rescue LoadError
require 'rdoc/rdoc'
require 'rake/rdoctask'
RDoc::Task = Rake::RDocTask
end
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'PageContent'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'
Bundler::GemHelper.install_tasks
require 'rake/testtask'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
task :default => :test
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,23 @@
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :set_locale
# Set I18n.locale
def set_locale
# update session if passed
session[:locale] = params[:locale] if params[:locale]
# set locale based on session or default
begin
# check if locale is valid for non site pages
if !VALID_LOCALES.include?(session[:locale])
I18n.locale = I18n.default_locale
else
I18n.locale = session[:locale]
end
rescue
I18n.locale = I18n.default_locale
end
end
end
@@ -0,0 +1,121 @@
class Panel::PageContent::BackEnd::PageContextsController < ApplicationController
layout 'new_admin'
before_filter :authenticate_user!
before_filter :is_admin?
def index
@page_contexts = PageContext.where(:archived => false).desc(:updated_at)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @page_contexts }
end
end
def view
@page_contexts = PageContext.where("page_id" => params[:page_id]).desc(:updated_at)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @page_contexts }
end
end
# GET /page_contexts/1
# GET /page_contexts/1.xml
def show
@page_context = PageContext.find(params[:id])
# get_categorys
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @page_context }
end
end
# GET /page_contexts/new
# GET /page_contexts/new.xml
def new
@page_context = PageContext.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @page_context }
end
end
# GET /page_contexts/1/edit
def edit
@page_context = PageContext.find(params[:id])
end
# POST /page_contexts
# POST /page_contexts.xml
def create
@page_context = PageContext.new(params[:page_context])
@page_context.create_user_id = current_user.id
@page_context.update_user_id = current_user.id
respond_to do |format|
if @page_context.save
format.html { redirect_to(panel_page_content_back_end_page_contexts_url, :notice => t('page_content.create_page_content_success')) }
format.xml { render :xml => @page_context, :status => :created, :location => @page_context }
else
format.html { render :action => "new" }
format.xml { render :xml => @page_context.errors, :status => :unprocessable_entity }
end
end
end
# PUT /page_contexts/1
# PUT /page_contexts/1.xml
def update
@page_context = PageContext.find(params[:id])
if ( @page_context.version > 0 )
@create_page_context = PageContext.new(:version => @page_context.version)
@create_page_context = @page_context.clone
@create_page_context.context = @page_context.context.clone
@create_page_context.archived = true
end
@page_context.update_user_id = current_user.id
@page_context.version = @page_context.version + 1
respond_to do |format|
if @page_context.update_attributes(params[:page_context])
if ( @page_context.version > 1 )
@create_page_context.save
end
format.html { redirect_to(panel_page_content_back_end_page_contexts_url, :notice => t('page_content.update_page_content_success')) }
format.js { render 'toggle_enable' }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @page_context.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /page_contexts/1
# DELETE /page_contexts/1.xml
def destroy
@page_context = PageContext.find(params[:id])
@page_context.destroy
respond_to do |format|
format.html { redirect_to(panel_page_content_back_end_page_contexts_url) }
# format.xml { head :ok }
format.js
end
end
end
@@ -0,0 +1,19 @@
class Panel::PageContent::FrontEnd::PageContextsController < ObitWidgetController
def initialize
super
@app_title = NewBlog::MOUDLEAPP_TITLE
end
def index
# @page_context = PageContext.where("page_id" => params[:page_id], :archived => false)
@page_context = PageContext.first(conditions: { page_id: params[:page_id], :archived => false })
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @page_contexts }
end
end
end
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,24 @@
# encoding: utf-8
class PageContext
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
has_one :context, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
field :create_user_id
field :update_user_id
field :version, :type => Integer , :default => 0
field :archived, :type => Boolean, :default => false
# field :current, :type => Boolean, :default => false
belongs_to :page
def is_top?
self.is_top
end
end
Whitespace-only changes.
@@ -0,0 +1,39 @@
<% # encoding: utf-8 %>
<%= f.error_messages %>
<%#= debugger %>
<div class="field">
<%= f.label :name %>
<%= @page_context.page.i18n_variable[I18n.locale] %>
</div>
<div class="field">
<%= f.label :context %>
<%= f.fields_for :context, (@page_context.new_record? ? @page_context.build_context : @page_context.context ) do |f| %>
<% @site_valid_locales.each do |locale| %>
<td>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_area locale, :rows => 10, :cols => 40 %>
</td>
<% end %>
<% end %>
</div>
<br />
<br />
<div class="actions">
<%= f.submit %>
</div>
<% content_for :page_specific_javascript do %>
<script type="text/javascript">
$(function() {
$('textarea').tinymce({
theme: 'advanced'
});
});
</script>
<% end %>
@@ -0,0 +1,10 @@
<tr id="<%= dom_id page_context %>">
<td><%= page_context.page.i18n_variable[I18n.locale] %></td>
<td><%= link_to page_context.version, panel_page_content_back_end_view_path(page_context.page_id) %></td>
<td><%= page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %></td>
<td><%= User.find(page_context.create_user_id).name %></td>
<td>
<%= link_to t('page_context.edit'), edit_panel_page_content_back_end_page_context_path(page_context) %>
</td>
</tr>
@@ -0,0 +1,10 @@
<tr id="<%= dom_id view_page_context %>">
<td><%= view_page_context.page.i18n_variable[I18n.locale] %></td>
<td><%= view_page_context.version %></td>
<td><%= view_page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %></td>
<td><%= User.find(view_page_context.create_user_id).name %></td>
<td>
<%= link_to t('view_page_context.show'), panel_page_content_back_end_page_context_path(view_page_context) %>
</td>
</tr>
@@ -0,0 +1,16 @@
<br />
<br />
<br />
<br />
<h1><%= t('page_content.editing_page_content') %></h1>
<%= form_for @page_context, :url => panel_page_content_back_end_page_context_path(@page_context) do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
<%= link_back %>
<br />
<br />
<br />
<br />
@@ -0,0 +1,36 @@
<% content_for :secondary do %>
<br />
<br />
<br />
<br />
<br />
<ul class="list">
<li><%= link_to t('page_context.page_content_list'), panel_page_content_back_end_page_contexts_path %></li>
</ul>
<% end -%>
<%= flash_messages %>
<br />
<br />
<br />
<br />
<br />
<h1><%= t('page_context.list_page_content') %></h1>
<table>
<tr>
<th><%= t('page_context.name') %></th>
<th><%= t('page_context.version') %></th>
<th><%= t('page_context.update_time') %></th>
<th><%= t('page_context.last_modified') %></th>
<th><%= t('page_context.action') %></th>
</tr>
<%= render :partial => 'page_context', :collection => @page_contexts %>
</table>
<br />
@@ -0,0 +1,28 @@
<% # encoding: utf-8 %>
<br />
<br />
<br />
<p id="notice"><%= flash_messages %></p>
<ul>
<li>
<b><%= t('page_content.name') %></b>
<%= @page_context.page.i18n_variable[I18n.locale] %>
</li>
<li>
<b><%= t('page_content.context') %></b>
<%= @page_context.context[I18n.locale].html_safe %>
</li>
<li>
<b><%= t('page_content.張貼者') %></b>
<%= User.find(@page_context.create_user_id).name %>
</li>
<li>
<b><%= t('page_content.最後修改時間') %></b>
<%= @page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %>
</li>
<%= link_back %>
@@ -0,0 +1,36 @@
<% content_for :secondary do %>
<br />
<br />
<br />
<br />
<br />
<ul class="list">
<li><%= link_to t('page_context.page_content_list'), panel_page_content_back_end_page_contexts_path %></li>
</ul>
<% end -%>
<%= flash_messages %>
<br />
<br />
<br />
<br />
<br />
<h1><%= t('page_context.list_page_content') %></h1>
<table>
<tr>
<th><%= t('page_context.name') %></th>
<th><%= t('page_context.version') %></th>
<th><%= t('page_context.update_time') %></th>
<th><%= t('page_context.last_modified') %></th>
<th><%= t('page_context.action') %></th>
</tr>
<%= render :partial => 'view_page_context', :collection => @page_contexts %>
</table>
<br />
@@ -0,0 +1,8 @@
<% # encoding: utf-8 %>
<p id="notice"><%= flash_messages %></p>
<h1 class="h1"><%= @page_context.page.i18n_variable[I18n.locale] rescue nil %></h1>
<div class="page_content"><%= @page_context.context[I18n.locale].html_safe rescue nil %></div>
@@ -0,0 +1,129 @@
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
_locale: English
add: Add
back: Back
create: Create
delete: Delete
disable: Disable
downloaded: Downloaded
download: Download
edit: Edit
enable: Enable
hide: Hide
homepage: Homepage
no_: "No"
nothing: Nothing
show: Show
sure?: Are you sure?
update: Update
yes_: "Yes"
announcement:
sure?: Sure?
# admin:
# action: Action
# add_language: Add language
# admin: Admin
# action: Action
# announcement: Announcement
# asset: Asset
# attributes: Attributes
# cant_delete_self: You can not delete yourself.
# cant_revoke_self_admin: You can not revoke your admin role yourself.
# class: Class
# content: Content
# create_error_link: Error when creating link.
# create_error_page: Error when creating page.
# create_success_home: Homepage was successfully created.
# create_success_layout: Layout was successfully created.
# create_success_link: Link was successfully created.
# create_success_page: Page was successfully created.
# create_success_snippet: Snippet was successfully created.
# create_success_user: User was successfully created.
# data: Data
# delete_language: Delete language
# description: Description
# design: Design
# disable_language: Disable language
# editing_home: Editing homepage
# editing_layout: Editing layout
# editing_link: Editing link
# editing_page: Editing page
# editing_snippet: Editing snippet
# editing_user_info: Editing user information
# editing_user_role: Editing user role
# email: Email
# enable_language: Enable language
# file_name: Filename
# file_size: File size
# format: Format
# home: Home
# id: ID
# info: Information
# is_published: Is published
# item: Item
# key: Key
# language: Language
# layout: Layout
# layout_name: Layout name
# list_assets: Assets list
# list_designs: Designs list
# list_items: Items list
# list_puchases: Purchases list
# list_snippets: Snippets list
# list_users: Users list
# list_user_infos: User information list
# list_user_roles: User roles list
# member: Member
# move_down: Move down
# move_up: Move up
# multilingual: Multilingual
# my_avatar: My Avatar
# no_home_page: You don't have a homepage
# no_layout: You don't have a layout
# name: Name
# new_asset: New asset
# new_component: New component
# new_home: New homepage
# new_layout: New layout
# new_link: New link
# new_page: New page
# new_snippet: New snippet
# new_user: New user
# new_user_info: New user information
# new_user_role: New user role
# non_multilingual: Non multilingual
# options: Options
# orig_upload_file: Original filename
# position: Position
# published?: Published?
# purchase: Purchase
# registered: Registered
# role: Role
# roles: Roles
# title: Title
# translation: Translation
# type: Type
# up_to_date: Up-to-date
# update_error_link: Error when updating link.
# update_error_page: Error when updating page.
# update_success_content: Content was successfully updated.
# update_success_home: Homepage was successfully updated.
# update_success_layout: Layout was successfully updated.
# update_success_link: Link was successfully updated.
# update_success_page: Page was successfully updated.
# update_success_snippet: Snippet was successfully updated.
# update_success_user: User was successfully updated.
# url: URL
# user: User
# user_info: User information
# user_panel: User panel
# user_role: User role
panel:
@@ -0,0 +1,330 @@
zh_tw:
_locale: 中文
add: 新增
back: 回去
create: 創造
delete: 刪除
disable: 禁用
edit: 編輯
enable: 啟用
hide: 隱藏
homepage: 首頁
no_: "No"
nothing: 無
show: 顯示
sure?: 您肯定嗎?
update: 更新
yes_: "Yes"
admin:
action: 行動
add_language: 新增語言
admin: 管理
action: 行動
announcement: 公告
asset: 資產
attributes: 屬性
cant_delete_self: 您不可以刪除自己。
cant_revoke_self_admin: 您不可以撤銷自己的管理作用。
class: 階級
content: 內容
create_error_link: 創建連接時出錯。
create_error_page: 創建頁面時出錯。
create_success_home: 首頁已成功創建。
create_success_layout: 樣板已成功創建。
create_success_link: 連結已成功創建。
create_success_page: 頁面已成功創建。
create_success_snippet: 片段已成功創建
create_success_user: 用戶已成功創建。。
data: 數據
delete_language: 刪除語言
description: 描述
disable_language: 禁用語言
editing_home: 編輯首頁
editing_layout: 編輯樣板
editing_link: 編輯連結
editing_page: 編輯頁面
editing_snippet: 編輯片段
editing_user_info: 編輯用戶資料
editing_user_role: 編輯用戶角色
email: Email
enable_language: 啟用語言
file_name: 檔名
file_size: 檔案大小
format: 格式
home: 首頁
id: ID
info: 資料
is_published: 被出版
item: 項目
key: 關鍵
language: 語言
layout: 佈局
layout_name: 佈局名字
list_assets: 資產清單
list_items: 項目清單
list_layouts: 佈局清單
list_snippets: 斷片清單
list_users: 使用清單
list_user_infos: 用戶資料清單
list_user_roles: 用戶角色清單
member: 會員
move_down: 往下移
move_up: 往上移
multilingual: 多種語言
my_avatar: 我的頭像
no_home_page: 您沒有首頁
no_layout: 您沒有佈局
name: 名稱
new_asset: 新增資產
new_component: 新增元件
new_home: 新增首頁
new_layout: 新增樣板
new_link: 新增連結
new_page: 新增頁面
new_snippet: 新增片段
new_user: 新增使用
new_user_info: 新增用戶資料
new_user_role: 新增用戶角色
non_multilingual: 非多種語言
options: 選項
orig_upload_file: 原上傳檔名
position: 位置
published?: 發布?
role: 角色
roles: 角色。
title: 標題
translation: 翻譯
type: 類型
update_error_link: 更新鏈接時出現錯誤。
update_error_page: 更新頁面時出現錯誤。
update_success_content: 內容已成功更新。
update_success_home: 首頁已成功更新。
update_success_layout: 樣板已成功更新。
update_success_link: 連結已成功更新。
update_success_page: 頁面已成功更新。
update_success_snippet: 片段已成功更新。
update_success_user: 用戶已成功更新
url: URL
user: 用戶
user_info: 用戶資料
user_panel: 用戶面板
user_role: 用戶角色
panel:
# Chinese (Taiwan) translations for Ruby on Rails
# by tsechingho (http://github.com/tsechingho)
date:
formats:
default: "%Y-%m-%d"
short: "%b%d日"
long: "%Y年%b%d日"
day_names: [星期日, 星期一, 星期二, 星期三, 星期四, 星期五, 星期六]
abbr_day_names: [日, 一, 二, 三, 四, 五, 六]
month_names: [~, 一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月, 十二月]
abbr_month_names: [~, 1月, 2月, 3月, 4月, 5月, 6月, 7月, 8月, 9月, 10月, 11月, 12月]
order: [ :year, :month, :day ]
time:
formats:
default: "%Y年%b%d日 %A %H:%M:%S %Z"
short: "%b%d日 %H:%M"
long: "%Y年%b%d日 %H:%M"
am: "上午"
pm: "下午"
datetime:
distance_in_words:
half_a_minute: "半分鐘"
less_than_x_seconds:
one: "不到一秒"
other: "不到 %{count} 秒"
x_seconds:
one: "一秒"
other: "%{count} 秒"
less_than_x_minutes:
one: "不到一分鐘"
other: "不到 %{count} 分鐘"
x_minutes:
one: "一分鐘"
other: "%{count} 分鐘"
about_x_hours:
one: "大約一小時"
other: "大約 %{count} 小時"
x_days:
one: "一天"
other: "%{count} 天"
about_x_months:
one: "大約一個月"
other: "大約 %{count} 個月"
x_months:
one: "一個月"
other: "%{count} 個月"
about_x_years:
one: "大約一年"
other: "大約 %{count} 年"
over_x_years:
one: "一年多"
other: "%{count} 年多"
almost_x_years:
one: "接近一年"
other: "接近 %{count} 年"
prompts:
year: "年"
month: "月"
day: "日"
hour: "時"
minute: "分"
second: "秒"
number:
format:
separator: "."
delimiter: ","
precision: 3
significant: false
strip_insignificant_zeros: false
currency:
format:
format: "%u %n"
unit: "NT$"
separator: "."
delimiter: ","
precision: 2
significant: false
strip_insignificant_zeros: false
percentage:
format:
delimiter: ""
precision:
format:
delimiter: ""
human:
format:
delimiter: ""
precision: 1
significant: false
strip_insignificant_zeros: false
storage_units:
format: "%n %u"
units:
byte:
one: "Byte"
other: "Bytes"
kb: "KB"
mb: "MB"
gb: "GB"
tb: "TB"
decimal_units:
format: "%n %u"
units:
# 10^-21 zepto, 10^-24 yocto
atto: "渺" # 10^-18
femto: "飛" # 10^-15 毫微微
pico: "漠" # 10^-12 微微
nano: "奈" # 10^-9 毫微
micro: "微" # 10^-6
mili: "毫" # 10^-3 milli
centi: "厘" # 10^-2
deci: "分" # 10^-1
unit: ""
ten:
one: "十"
other: "十" # 10^1
hundred: "百" # 10^2
thousand: "千" # 10^3 kilo
million: "百萬" # 10^6 mega
billion: "十億" # 10^9 giga
trillion: "兆" # 10^12 tera
quadrillion: "千兆" # 10^15 peta
# 10^18 exa, 10^21 zetta, 10^24 yotta
support:
array:
words_connector: ", "
two_words_connector: " 和 "
last_word_connector: ", 和 "
select:
prompt: "請選擇"
activerecord:
errors:
template: # ~ 2.3.5 backward compatible
header:
one: "有 1 個錯誤發生使得「%{model}」無法被儲存。"
other: "有 %{count} 個錯誤發生使得「%{model}」無法被儲存。"
body: "以下欄位發生問題:"
full_messages:
format: "%{attribute} %{message}"
messages:
inclusion: "沒有包含在列表中"
exclusion: "是被保留的關鍵字"
invalid: "是無效的"
confirmation: "不符合確認值"
accepted: "必須是可被接受的"
empty: "不能留空"
blank: "不能是空白字元"
too_long: "過長(最長是 %{count} 個字)"
too_short: "過短(最短是 %{count} 個字)"
wrong_length: "字數錯誤(必須是 %{count} 個字)"
not_a_number: "不是數字"
not_an_integer: "必須是整數"
greater_than: "必須大於 %{count}"
greater_than_or_equal_to: "必須大於或等於 %{count}"
equal_to: "必須等於 %{count}"
less_than: "必須小於 %{count}"
less_than_or_equal_to: "必須小於或等於 %{count}"
odd: "必須是奇數"
even: "必須是偶數"
taken: "已經被使用"
record_invalid: "校驗失敗: %{errors}"
activemodel:
errors:
template:
header:
one: "有 1 個錯誤發生使得「%{model}」無法被儲存。"
other: "有 %{count} 個錯誤發生使得「%{model}」無法被儲存。"
body: "以下欄位發生問題:"
errors:
format: "%{attribute} %{message}"
messages:
inclusion: "沒有包含在列表中"
exclusion: "是被保留的關鍵字"
invalid: "是無效的"
confirmation: "不符合確認值"
accepted: "必須是可被接受的"
empty: "不能留空"
blank: "不能是空白字元"
too_long: "過長(最長是 %{count} 個字)"
too_short: "過短(最短是 %{count} 個字)"
wrong_length: "字數錯誤(必須是 %{count} 個字)"
not_a_number: "不是數字"
not_an_integer: "必須是整數"
greater_than: "必須大於 %{count}"
greater_than_or_equal_to: "必須大於或等於 %{count}"
equal_to: "必須等於 %{count}"
less_than: "必須小於 %{count}"
less_than_or_equal_to: "必須小於或等於 %{count}"
odd: "必須是奇數"
even: "必須是偶數"
template:
header:
one: "有 1 個錯誤發生使得「%{model}」無法被儲存。"
other: "有 %{count} 個錯誤發生使得「%{model}」無法被儲存。"
body: "以下欄位發生問題:"
helpers:
select:
prompt: "請選擇"
submit:
create: "新增%{model}"
update: "更新%{model}"
submit: "儲存%{model}"
+18
View File
@@ -0,0 +1,18 @@
Rails.application.routes.draw do
namespace :panel do
namespace :page_content do
namespace :back_end do
root :to => "page_contexts#index"
resources :page_contexts
match "view/:page_id" => "page_contexts#view" ,:as => :view
end
namespace :front_end do
root :to => "page_contexts#index"
resources :page_contexts
match "page_contexts/:page_id" => "page_contexts#index"
end
end
end
match "/appfront/*path" => redirect("/panel/*path")
end
@@ -0,0 +1,4 @@
require "page_content/engine"
module PageContent
end
@@ -0,0 +1,4 @@
module PageContent
class Engine < Rails::Engine
end
end
@@ -0,0 +1,3 @@
module PageContent
VERSION = "0.0.1"
end
@@ -0,0 +1,4 @@
# desc "Explaining what the task does"
# task :page_content do
# # Task goes here
# end
@@ -0,0 +1,23 @@
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "page_content/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "page_content"
s.version = PageContent::VERSION
s.authors = ["TODO: Your name"]
s.email = ["TODO: Your email"]
s.homepage = "TODO"
s.summary = "TODO: Summary of PageContent."
s.description = "TODO: Description of PageContent."
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.test_files = Dir["test/**/*"]
s.add_dependency "rails", "~> 3.1.3"
# s.add_dependency "jquery-rails"
s.add_development_dependency "sqlite3"
end
+11
View File
@@ -0,0 +1,11 @@
{
"title": "page_content",
"version": "0.1",
"organization": "Rulingcom",
"author": "RD dep",
"intro": "A simple blog……",
"update_info": "Some info",
"create_date": "20-02-2012",
"app_pages": ["page_contexts"],
"enable_frontend": true
}
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env ruby.exe
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
ENGINE_PATH = File.expand_path('../..', __FILE__)
load File.expand_path('../../test/dummy/script/rails', __FILE__)
@@ -0,0 +1,7 @@
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Dummy::Application.load_tasks
@@ -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_tree .
@@ -0,0 +1,7 @@
/*
* 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_self
*= require_tree .
*/
@@ -0,0 +1,3 @@
class ApplicationController < ActionController::Base
protect_from_forgery
end
@@ -0,0 +1,2 @@
module ApplicationHelper
end
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Dummy</title>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
@@ -0,0 +1,4 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Dummy::Application
@@ -0,0 +1,45 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require
require "page_content"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
end
@@ -0,0 +1,10 @@
require 'rubygems'
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
end
$:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
@@ -0,0 +1,5 @@
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Dummy::Application.initialize!
@@ -0,0 +1,30 @@
Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
end
@@ -0,0 +1,60 @@
Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH
# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# See everything in the log (default is :info)
# config.log_level = :debug
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
end
@@ -0,0 +1,39 @@
Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
# Log error messages when you accidentally call methods on nil
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
end
@@ -0,0 +1,7 @@
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
@@ -0,0 +1,5 @@
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
# Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Dummy::Application.config.secret_token = 'f040f1255423ce6103eaf906fea3e3b07436575c5cf1a00972041c41999c92e3c4d19f6fad0db7aa48fbd245e61d14a8b414b2cd89691ec7637a6833ee87eaf8'
@@ -0,0 +1,8 @@
# Be sure to restart your server when you modify this file.
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
# Be sure to restart your server when you modify this file.
#
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json]
end
# Disable root element in JSON by default.
ActiveSupport.on_load(:active_record) do
self.include_root_in_json = false
end
@@ -0,0 +1,5 @@
# Sample localization file for English. Add more files in this directory for other locales.
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
hello: "Hello world"
@@ -0,0 +1,58 @@
Dummy::Application.routes.draw do
# The priority is based upon order of creation:
# first created -> highest priority.
# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# resources :products
# Sample resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end
# Sample resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end
# Sample resource route with more complex sub-resources
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', :on => :collection
# end
# end
# Sample resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => 'welcome#index'
# See how all your routes lay out with "rake routes"
# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
# match ':controller(/:action(/:id(.:format)))'
end
Whitespace-only changes.
Whitespace-only changes.
Loaded 100 of 186 files, more files were not shown because too many files have changed in this diff. Show more