From 13587306bc03eccaaebca1f21ab731554830f577 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Thu, 10 May 2012 00:25:30 +0800 Subject: [PATCH] Add list widgets for announcement, news and links with categories and tags --- .../admin/page_parts_controller.rb | 8 +- .../admin/page_parts/_module_widget.html.erb | 5 + .../admin/page_parts/_widget_tags.html.erb | 1 + .../admin/page_parts/reload_widgets.js.erb | 3 +- lib/parsers/parser_back_end.rb | 7 +- lib/parsers/parser_front_end.rb | 8 +- .../front_end/bulletins_controller.rb | 10 +- .../widget/bulletins_controller.rb | 21 ++-- .../widget/bulletins/index.html.erb | 43 ++++---- .../news/widget/news_bulletins_controller.rb | 30 ++++-- .../news_bulletins/home_banner.html.erb | 28 ++++++ .../news/widget/news_bulletins/index.html.erb | 54 +++++----- vendor/built_in_modules/news/config/routes.rb | 1 + vendor/built_in_modules/news/news.json | 2 +- .../widget/web_links_controller.rb | 16 +++ .../widget/web_links/home_list.html.erb | 5 + .../widget/web_links/index.html.erb | 29 +++++- .../web_resource/config/locales/en.yml | 6 ++ .../web_resource/config/locales/zh_tw.yml | 99 +------------------ .../web_resource/config/routes.rb | 1 + .../web_resource/web_resource.json | 2 +- 21 files changed, 199 insertions(+), 180 deletions(-) create mode 100644 app/views/admin/page_parts/_widget_tags.html.erb create mode 100644 vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/home_banner.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/home_list.html.erb diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index 7ebcbe44..9ef2aa1b 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -22,17 +22,20 @@ class Admin::PagePartsController < ApplicationController def edit @part = PagePart.find(params[:id]) - @module_apps = ModuleApp.all(:conditions => {:enable_frontend => true}) + @module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc) @module_app = @part.module_app ? @part.module_app : @module_apps[0] @r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag @tag_objects = @r_tag.classify.constantize.all rescue nil case @module_app.key when 'announcement' @categories = BulletinCategory.all + @tags = AnnouncementTag.all when 'news' @categories = NewsBulletinCategory.all + @tags = NewsTag.all when 'web_resource' @categories = WebLinkCategory.all + @tags = WebResourceTag.all end end @@ -69,10 +72,13 @@ class Admin::PagePartsController < ApplicationController case @module_app.key when 'announcement' @categories = BulletinCategory.all + @tags = AnnouncementTag.all when 'news' @categories = NewsBulletinCategory.all + @tags = NewsTag.all when 'web_resource' @categories = WebLinkCategory.all + @tags = WebResourceTag.all end respond_to do |format| format.js {} diff --git a/app/views/admin/page_parts/_module_widget.html.erb b/app/views/admin/page_parts/_module_widget.html.erb index 374242df..96bdb03f 100644 --- a/app/views/admin/page_parts/_module_widget.html.erb +++ b/app/views/admin/page_parts/_module_widget.html.erb @@ -6,7 +6,12 @@ <%= f.select :widget_path, @module_app.widgets.collect{|widget| [widget.humanize, widget]}, :selected => @part.widget_path %> +: <%= render 'widget_categories' %> + +or + + <%= render 'widget_tags' %> \ No newline at end of file diff --git a/app/views/admin/page_parts/_widget_tags.html.erb b/app/views/admin/page_parts/_widget_tags.html.erb new file mode 100644 index 00000000..bb78f118 --- /dev/null +++ b/app/views/admin/page_parts/_widget_tags.html.erb @@ -0,0 +1 @@ + <%= select 'page_part', 'tag', @tags.collect{|category| [category[I18n.locale], category.id]}, :selected => (@part ? @part[:tag] : nil), :include_blank => true if @tags && @tags.size > 0 %> \ No newline at end of file diff --git a/app/views/admin/page_parts/reload_widgets.js.erb b/app/views/admin/page_parts/reload_widgets.js.erb index 67e7589d..2b851ce0 100644 --- a/app/views/admin/page_parts/reload_widgets.js.erb +++ b/app/views/admin/page_parts/reload_widgets.js.erb @@ -1,2 +1,3 @@ $('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|widget| [widget.humanize, widget]}) %>") -$('#widget_category').html("<%= j render 'widget_categories' %>") \ No newline at end of file +$('#widget_category').html("<%= j render 'widget_categories' %>") +$('#widget_tag').html("<%= j render 'widget_tags' %>") \ No newline at end of file diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb index f32e8084..33b19510 100644 --- a/lib/parsers/parser_back_end.rb +++ b/lib/parsers/parser_back_end.rb @@ -46,6 +46,7 @@ module ParserBackEnd if (content["main"] == "true" && !page.module_app.nil?) ret << "
" else part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil @@ -57,8 +58,10 @@ module ParserBackEnd when 'text' ret << part.i18n_variable[I18n.locale] rescue '' when 'module_widget' - if part[:category] - ret << "
" + if !part[:category].blank? + ret << "
" + elsif !part[:tag].blank? + ret << "
" else ret << "
" end diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index 2a0f38cf..a0004f15 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -61,10 +61,10 @@ module ParserFrontEnd # else # ret << "
" # end - if !params[:category_id].blank? - ret << "
" - elsif !params[:tag_id].blank? - ret << "
" + if !part[:category].blank? + ret << "
" + elsif !part[:tag].blank? + ret << "
" else ret << "
" 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 6c1b2cc3..725ffac9 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 @@ -13,17 +13,15 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController date_now = Time.now if !params[:category_id].blank? @bulletins = Bulletin.can_display.where(:bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) + @current_category = BulletinCategory.from_id(params[:category_id]) rescue nil elsif !params[:tag_id].blank? - tmp = AnnouncementTag.find(params[:tag_id]) rescue nil - tmp = AnnouncementTag.where(key: params[:tag_id])[0] unless tmp - @bulletins = tmp.bulletins.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) + @tag = AnnouncementTag.find(params[:tag_id]) rescue nil + @tag = AnnouncementTag.where(key: params[:tag_id])[0] unless @tag + @bulletins = @tag.bulletins.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) else @bulletins = Bulletin.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) end - - get_categorys - @current_category = BulletinCategory.from_id(params[:category_id]) rescue nil end def show diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb index 6ac2ae05..57295cc7 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb @@ -9,20 +9,21 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController # GET /bulletins.xml def index - - # deadline - # @bulletin_categorys = BulletinCategory.first; - # @bulletins = Bulletin.widget_datas(@bulletin_categorys.id).limit(9) + + date_now = Time.now if !params[:category_id].blank? - @bulletins = Bulletin.can_display.where(:bulletin_category_id => params[:category_id]).widget_datas.limit(9) + @bulletins = Bulletin.can_display.where(:bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) + @current_category = BulletinCategory.from_id(params[:category_id]) rescue nil elsif !params[:tag_id].blank? - @bulletins = AnnouncementTag.find(params[:tag_id]).bulletins.can_display.widget_datas.limit(9) rescue nil + @tag = AnnouncementTag.find(params[:tag_id]) rescue nil + @tag = AnnouncementTag.where(key: params[:tag_id])[0] unless @tag + @bulletins = @tag.bulletins.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) else - @bulletins = Bulletin.can_display.widget_datas.limit(9) + @bulletins = Bulletin.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) end - - get_categorys - + + get_categorys + end def bulletins_and_web_links 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 3cf5731d..c885488f 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 @@ -1,20 +1,29 @@ -<% # encoding: utf-8 %> - -<% if @bulletins and !@bulletins.nil? %> -

<%= t('announcement.campus_news')%>

- <%= link_to t('announcement.more'),panel_announcement_front_end_bulletins_path(), :class => "topic_note" %> -
previous page
-
next page
- - +<% if @current_category %> +

<%= @current_category.i18n_variable[I18n.locale] + t('announcement.bulletin.list_lower') %>

+<% elsif @tag %> +

<%= @tag[I18n.locale] + t('announcement.bulletin.list_lower') %>

+<% else %> +

<%= t('announcement.list_announcement') %>

<% end %> + + + + + + + +<% @bulletins.each do |post| %> + + + + + + +<% end %> + +
<%= t('announcement.bulletin.category') %><%= t('announcement.bulletin.title') %><%= t('announcement.bulletin.postdate') %>
<%= post.bulletin_category.i18n_variable[I18n.locale] %><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %> + <%= post.postdate %>
+ +<%= paginate @bulletins, :params => {:inner => 'false'} %> \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/widget/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/widget/news_bulletins_controller.rb index 7d678cad..a6d20ca7 100644 --- a/vendor/built_in_modules/news/app/controllers/panel/news/widget/news_bulletins_controller.rb +++ b/vendor/built_in_modules/news/app/controllers/panel/news/widget/news_bulletins_controller.rb @@ -9,20 +9,18 @@ class Panel::News::Widget::NewsBulletinsController < OrbitWidgetController # GET /news_bulletins.xml def index - - # deadline - # @news_bulletin_categorys = NewsBulletinCategory.first; - # @news_bulletins = NewsBulletin.widget_datas(@news_bulletin_categorys.id).limit(9) + date_now = Time.now if !params[:category_id].blank? - @news_bulletins = NewsBulletin.can_display.where(:news_bulletin_category_id => params[:category_id]).widget_datas.limit(9) + @news_bulletins = NewsBulletin.can_display.where(:news_bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) + @current_category = NewsBulletinCategory.from_id(params[:category_id]) rescue nil elsif !params[:tag_id].blank? - @news_bulletins = NewsTag.find(params[:tag_id]).news_bulletins.can_display.widget_datas.limit(9) rescue nil + @tag = NewsTag.find(params[:tag_id]) rescue nil + @tag = NewsTag.where(key: params[:tag_id])[0] unless @tag + @news_bulletins = @tag.news_bulletins.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) rescue nil else - @news_bulletins = NewsBulletin.can_display.widget_datas.limit(9) + @news_bulletins = NewsBulletin.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) end - - get_categorys - + end def news_bulletins_and_web_links @@ -47,6 +45,18 @@ class Panel::News::Widget::NewsBulletinsController < OrbitWidgetController @tags = NewsTag.all get_categorys end + + def home_banner + if !params[:category_id].blank? + @news_bulletins = NewsBulletin.can_display.where(:news_bulletin_category_id => params[:category_id]).widget_datas.limit(9) + elsif !params[:tag_id].blank? + @news_bulletins = NewsTag.find(params[:tag_id]).news_bulletins.can_display.widget_datas.limit(9) rescue nil + else + @news_bulletins = NewsBulletin.can_display.widget_datas.limit(9) + end + get_categorys + + end protected diff --git a/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/home_banner.html.erb b/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/home_banner.html.erb new file mode 100644 index 00000000..fb6c0452 --- /dev/null +++ b/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/home_banner.html.erb @@ -0,0 +1,28 @@ +<% if @news_bulletins and !@news_bulletins.nil? %> +

<%= t('news.campus_news')%>

+ <%#= link_to t('news.more'),panel_news_front_end_news_bulletins_path(), :class => "topic_note" %> +
+ + <%= t('news.more') %> + + + +
+
previous page
+
next page
+ +<% end %> \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/index.html.erb b/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/index.html.erb index 2103f997..bb2ff639 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/index.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/index.html.erb @@ -1,33 +1,33 @@ <% # encoding: utf-8 %> -<% if @news_bulletins and !@news_bulletins.nil? %> -

<%= t('news.campus_news')%>

- <%#= link_to t('news.more'),panel_news_front_end_news_bulletins_path(), :class => "topic_note" %> -
- - <%= t('news.more') %> - - - -
-
previous page
-
next page
- +<%= flash_messages %> +<% if @current_category %> +

<%= @current_category.i18n_variable[I18n.locale] + t('news.news_bulletin.list_lower') %>

+<% elsif @tag %> +

<%= @tag[I18n.locale] + t('news.news_bulletin.list_lower') %>

+<% else %> +

<%= t('news.list_news') %>

<% end %> + + + + + + + + <% @news_bulletins.each do |post| %> + + + + + + <% end %> + +
<%= t('news.news_bulletin.image') %><%= t('news.news_bulletin.title') %><%= t('news.news_bulletin.postdate') %>
<%= image_tag post.image %> + <%= link_to post.title[I18n.locale], panel_news_front_end_news_bulletin_path(post), :class => 'news_title' %> + <%= post.subtitle[I18n.locale].html_safe %> + <%= post.postdate %>
+<%= paginate @news_bulletins, :params => {:inner => 'false'} %> diff --git a/vendor/built_in_modules/news/config/routes.rb b/vendor/built_in_modules/news/config/routes.rb index ccefcf38..d718e7d6 100644 --- a/vendor/built_in_modules/news/config/routes.rb +++ b/vendor/built_in_modules/news/config/routes.rb @@ -43,6 +43,7 @@ Rails.application.routes.draw do end namespace :widget do match "news_bulletins" => "news_bulletins#index" + match "home_banner" => "news_bulletins#home_banner" match "news_bulletins_and_web_links" => "news_bulletins#news_bulletins_and_web_links" match "reload_news_bulletins" => "news_bulletins#reload_news_bulletins" match "reload_web_links" => "news_bulletins#reload_web_links" diff --git a/vendor/built_in_modules/news/news.json b/vendor/built_in_modules/news/news.json index 1e7a7bae..74b2bfcc 100644 --- a/vendor/built_in_modules/news/news.json +++ b/vendor/built_in_modules/news/news.json @@ -7,6 +7,6 @@ "update_info": "Some info", "create_date": "11-11-2011", "app_pages": ["news_bulletins"], - "widgets": ["news_bulletins", "news_bulletins_and_web_links"], + "widgets": ["news_bulletins", "news_bulletins_and_web_links", "home_banner"], "enable_frontend": true } 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 8ab0eeb9..ec57451c 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 @@ -8,7 +8,23 @@ class Panel::WebResource::Widget::WebLinksController < OrbitWidgetController # GET /web_links # GET /web_links.xml + def index + if !params[:category_id].blank? + @web_links = WebLink.where(:web_link_category => params[:category_id]).desc( :is_top, :postdate).page( params[:page]).per(10) + @current_category = WebLinkCategory.from_id(params[:category_id]) rescue nil + elsif !params[:tag_id].blank? + @tag = WebResourceTag.find(params[:tag_id]) rescue nil + @tag = WebResourceTag.where(key: params[:tag_id])[0] unless @tag + @web_links = @tag.web_links.desc( :is_top, :postdate).page( params[:page]).per(10) + else + @web_links = WebLink.all.desc( :is_top, :postdate).page( params[:page]).per(10) + end + end + + + + def home_list # deadline diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/home_list.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/home_list.html.erb new file mode 100644 index 00000000..e5f2abd2 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/home_list.html.erb @@ -0,0 +1,5 @@ + + + diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/index.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/index.html.erb index e5f2abd2..8eebc6ac 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/index.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/index.html.erb @@ -1,5 +1,26 @@ - +<% if @current_category %> +

<%= @current_category.i18n_variable[I18n.locale] + " " + t('web_resource.list_lower') %>

+<% elsif @tag %> +

<%= @tag[I18n.locale] + " " + t('web_resource.list_lower') %>

+<% else %> +

<%= t('web_resource.list_link') %>

+<% end %> - + + + + + + + <% @web_links.each do |post| %> + + + + + <% end %> + +
<%= t('web_resource.category') %><%= t('web_resource.name') %>
<%= post.web_link_category.i18n_variable[I18n.locale] %> + <%= link_to post.name[I18n.locale], post.url, {:target => '_blank', :title => post.name[I18n.locale]} %> +
+ +<%= paginate @web_links, :params => {:inner => 'false'} %> diff --git a/vendor/built_in_modules/web_resource/config/locales/en.yml b/vendor/built_in_modules/web_resource/config/locales/en.yml index 4fcaafe7..83dbd328 100644 --- a/vendor/built_in_modules/web_resource/config/locales/en.yml +++ b/vendor/built_in_modules/web_resource/config/locales/en.yml @@ -25,6 +25,12 @@ en: announcement: sure?: Sure? + + + web_resource: + list_lower: list + list_link: Links list + # admin: # action: Action diff --git a/vendor/built_in_modules/web_resource/config/locales/zh_tw.yml b/vendor/built_in_modules/web_resource/config/locales/zh_tw.yml index 4ef309e6..ace65d53 100644 --- a/vendor/built_in_modules/web_resource/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/web_resource/config/locales/zh_tw.yml @@ -18,102 +18,9 @@ zh_tw: 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: + web_resource: + list_lower: 列表 + list_link: 鏈接列表 diff --git a/vendor/built_in_modules/web_resource/config/routes.rb b/vendor/built_in_modules/web_resource/config/routes.rb index ac98d4da..fed85983 100644 --- a/vendor/built_in_modules/web_resource/config/routes.rb +++ b/vendor/built_in_modules/web_resource/config/routes.rb @@ -18,6 +18,7 @@ Rails.application.routes.draw do end namespace :widget do match "web_links" => "web_links#index" + match "home_list" => "web_links#home_list" match "reload_web_links" => "web_links#reload_web_links" end end diff --git a/vendor/built_in_modules/web_resource/web_resource.json b/vendor/built_in_modules/web_resource/web_resource.json index f159630f..c27bf731 100644 --- a/vendor/built_in_modules/web_resource/web_resource.json +++ b/vendor/built_in_modules/web_resource/web_resource.json @@ -7,6 +7,6 @@ "update_info": "Some info", "create_date": "11-11-2011", "app_pages": ["web_links"], - "widgets": ["web_links"], + "widgets": ["web_links", "home_list"], "enable_frontend": true }