"
- ret << (link_to node.name, dest)
+ ret << (link_to node.i18n_variable[I18n.locale], dest)
ret << ' | ' << (link_to t('admin.edit'), eval("edit_admin_#{node._type.downcase}_path(node)")) if node._type.eql?('Page')
ret << ' | ' << (link_to t('admin.new_page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page') if node._type.eql?('Page')
ret << ' | ' << (link_to t('admin.new_link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link') if node._type.eql?('Page')
diff --git a/app/models/design/design.rb b/app/models/design/design.rb
index d2ad07aa..7fbacedc 100644
--- a/app/models/design/design.rb
+++ b/app/models/design/design.rb
@@ -20,7 +20,7 @@ class Design
validates_presence_of :title
validates_presence_of :author
- # after_save :parse_css_for_images
+ after_save :parse_css_for_images
def new_files=(*attrs)
attrs[0].map do |key,items_ary| #Loop by JSs,Themes,Imgs
diff --git a/app/views/admin/designs/index.html.erb b/app/views/admin/designs/index.html.erb
index fa5748ef..6195afd5 100644
--- a/app/views/admin/designs/index.html.erb
+++ b/app/views/admin/designs/index.html.erb
@@ -18,7 +18,7 @@
<%= design.title %>
-
+
<%= link_to t(:edit), edit_admin_design_path(design), :class => 'edit' %>
<%= link_to t(:delete), admin_design_path(design), :confirm => t('sure?'), :method => :delete, :class => 'delete' %>
diff --git a/app/views/layouts/_orbit_bar.html.erb b/app/views/layouts/_orbit_bar.html.erb
index f4f8feef..4cbc4b30 100644
--- a/app/views/layouts/_orbit_bar.html.erb
+++ b/app/views/layouts/_orbit_bar.html.erb
@@ -9,7 +9,7 @@
<%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %>
<%= link_to content_tag(:i, nil, :class => 'icons-asset') + t('admin.asset'), admin_assets_path %>
- Structure
+ <%= link_to content_tag(:i, nil, :class => 'icons-structure') + t('admin.structure'), admin_items_path %>
Add Item
diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb
index 9fa48784..15948578 100644
--- a/app/views/layouts/_side_bar.html.erb
+++ b/app/views/layouts/_side_bar.html.erb
@@ -4,28 +4,24 @@
<%= content_tag :li, :class => active_for_controllers('bulletins', 'tags', 'bulletin_categorys') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.announcement'), panel_announcement_back_end_bulletins_path %>
- <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', 'tags', 'bulletin_categorys')) do -%>
- <%= content_tag :li, link_to(t('admin.all_articles'), panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index') %>
- <%= content_tag :li, link_to(t('admin.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %>
- <%= content_tag :li, link_to(t('admin.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %>
- <%= content_tag :li, link_to(t('admin.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('tags', 'index') %>
+ <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', 'tags', 'bulletin_categorys')) do -%>
+ <%= content_tag :li, link_to(t('admin.all_articles'), panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index') %>
+ <%= content_tag :li, link_to(t('admin.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %>
+ <%= content_tag :li, link_to(t('admin.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %>
+ <%= content_tag :li, link_to(t('admin.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('tags', 'index') %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('users') do -%>
- <%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %>
+ <%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), panel_web_resource_back_end_web_links_path %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers(nil) do -%>
- <%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.page'), admin_pages_path %>
- <%#= content_tag :ul, :class => "nav nav-list" do -%>
- <%#= content_tag :li, link_to(t('admin.all_pages'), panel_page_content_back_end_bulletins_path), :class => active_for_action('bulletins', 'index') %>
- <%#= content_tag :li, link_to(t('admin.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %>
- <%# end -%>
+ <%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.page'), panel_page_content_back_end_page_contexts_path %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('designs') do -%>
-<%= link_to content_tag(:i, nil, :class => 'icons-window-block') + t('admin.design'), admin_designs_path %>
+ <%= link_to content_tag(:i, nil, :class => 'icons-window-block') + t('admin.design'), admin_designs_path %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers(nil) do -%>
diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb
index 10d9d4a2..df78df69 100644
--- a/lib/parsers/parser_back_end.rb
+++ b/lib/parsers/parser_back_end.rb
@@ -99,7 +99,7 @@ module ParserBackEnd
ret = ''
if (tag.attributes["main"] == "true" && !page.module_app.nil?)
ret << "
"
else
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s }
diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb
index 70006eb3..8d43c070 100644
--- a/lib/parsers/parser_common.rb
+++ b/lib/parsers/parser_common.rb
@@ -6,7 +6,7 @@ module ParserCommon
if current != 0
res << ""
item = rand(100000)
- res << "
#{page.name} "
+ res << "
#{page.i18n_variable[I18n.locale]} "
if page.children.size > 0
res << ""
else
res << '
'
- res << "" + "#{page.name} " + " "
+ res << "" + "#{page.i18n_variable[I18n.locale]} " + " "
page.children.each do |child|
res << "" + menu_level(child, current + 1, menu, edit) + " "
end
@@ -39,7 +39,7 @@ module ParserCommon
if page.children.size > 0
res << menu_level(page, current + 1, menu, edit)
else
- res << "#{page.name} "
+ res << "#{page.i18n_variable[I18n.locale]} "
end
res << ""
end
diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb
index 2ddbb84c..4b30d9c2 100644
--- a/lib/parsers/parser_front_end.rb
+++ b/lib/parsers/parser_front_end.rb
@@ -126,7 +126,7 @@ module ParserFrontEnd
ret << "
"
else
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil
diff --git a/lib/tasks/page_content.rake b/lib/tasks/page_content.rake
new file mode 100644
index 00000000..b1edeba9
--- /dev/null
+++ b/lib/tasks/page_content.rake
@@ -0,0 +1,11 @@
+# encoding: utf-8
+
+namespace :add_content do
+
+ task :build => :environment do
+
+ ModuleApp.new.from_json(File.open("#{Rails.root}/vendor/built_in_modules/page_content/page_content.json").read).save
+
+ end
+
+end
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb
index eb429e4d..cf4e1801 100644
--- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb
@@ -12,9 +12,9 @@ class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController
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(1)
+ @bulletins = Bulletin.where(:bulletin_category_id => params[:bulletin_category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
else
- @bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(1)
+ @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
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
index d3bcab8c..742fb58f 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
@@ -1,6 +1,8 @@
<% # encoding: utf-8 %>
-
-
-
-
-
-
-
-
- <%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
-
-
-
-
-
-
-
-
- <%= text_area_tag 'locale', nil, :style=>"width:100%" %>
-
-
-
-
-
-
- Preview/預覽
- Submit/送出
- Cancel/取消
-
\ No newline at end of file
+<% end %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
index 62374693..c5c9abb4 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
@@ -2,30 +2,28 @@
<%= flash_messages %>
-<%= paginate @bulletins %>
-
<%= t('bulletin.list_announcement') %>
-
-
- <%= t('bulletin.postdate') %>
- <%= t('bulletin.category') %>
- <%= t('bulletin.title') %>
-
+
+
+ <%= t('bulletin.category') %>
+ <%= t('bulletin.title') %>
+ <%= t('bulletin.postdate') %>
+
- <% @bulletins.each do |post| %>
-
- <%= post.bulletin_category.i18n_variable[I18n.locale] %>
- <%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %>
- <%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
-
- <%= post.postdate %>
-
-
- <% end %>
+<% @bulletins.each do |post| %>
+
+ <%= post.bulletin_category.i18n_variable[I18n.locale] %>
+ <%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %>
+ <%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
+
+ <%= post.postdate %>
+
+
+<% end %>
+
+
-
-
-
+<%= paginate @bulletins %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb
index 3366451d..2f37df9c 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb
@@ -1,9 +1,23 @@
<% # encoding: utf-8 %>
-
-
-
-
-
+<%= @bulletin.title[I18n.locale] %>
+
+
+ <%#= 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 %>
+
+
+ <%= @bulletin.text[I18n.locale].html_safe %>
+
+
+
+
+
<%#= link_back %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html.erb
index 84e01f2c..0d334f26 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html.erb
@@ -2,7 +2,7 @@
<% if @bulletins and !@bulletins.nil? %>
- <%= t('焦點新聞')%>
+ <%= t('校園新聞')%>
<%= link_to "more+",panel_announcement_front_end_bulletins_path(), :class => "topic_note" %>
previous page
next page
diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/front_end/page_contexts/index.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/front_end/page_contexts/index.html.erb
index 0a9e93eb..4f196d59 100644
--- a/vendor/built_in_modules/page_content/app/views/panel/page_content/front_end/page_contexts/index.html.erb
+++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/front_end/page_contexts/index.html.erb
@@ -3,6 +3,6 @@
<%= flash_messages %>
-<%= @page_context.page.i18n_variable[I18n.locale] %>
+<%= @page_context.page.i18n_variable[I18n.locale] rescue nil %>
-<%= @page_context.context[I18n.locale].html_safe %>
+<%= @page_context.context[I18n.locale].html_safe rescue nil %>
diff --git a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/widget/web_links_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/widget/web_links_controller.rb
index bbe4a8d9..66b74799 100644
--- a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/widget/web_links_controller.rb
+++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/widget/web_links_controller.rb
@@ -14,7 +14,7 @@ class Panel::WebResource::Widget::WebLinksController < ObitWidgetController
# @web_link = WebLink.where( :is_hidden => false ).desc(:is_top, :name).first
- @web_links = WebLink.widget_datas.page(params[:page]).per(5)
+ @web_links = WebLink.widget_datas.page(params[:page]).per(9)
# get_categorys
@@ -24,7 +24,7 @@ class Panel::WebResource::Widget::WebLinksController < ObitWidgetController
end
def reload_web_links
- @web_links = WebLink.widget_datas.page(params[:page]).per(5)
+ @web_links = WebLink.widget_datas.page(params[:page]).per(9)
end
diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/_web_links.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/_web_links.html.erb
new file mode 100644
index 00000000..93e65230
--- /dev/null
+++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/_web_links.html.erb
@@ -0,0 +1,10 @@
+
+ <% @web_links.each do |widget| -%>
+ <%= link_to widget.name[I18n.locale], widget.url, {:target => '_blank', :title => widget.name[I18n.locale]} %>
+ <% end -%>
+
+
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/reload_web_links.js.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/reload_web_links.js.erb
new file mode 100644
index 00000000..a4577328
--- /dev/null
+++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/reload_web_links.js.erb
@@ -0,0 +1 @@
+$('#web_links_links').html("<%= j render 'web_links' if @web_links %>")
\ No newline at end of file