From c219792a13712aa413af8c8f44aae110269a0b25 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Fri, 28 Dec 2012 10:02:16 +0800 Subject: [PATCH 01/11] fixed delete function of archive file --- .../archive_file_categorys/_archive_file_category.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb index d8c5e8e1..f92168ad 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb @@ -6,11 +6,11 @@
<% @site_valid_locales.each do |locale| %> <%= archive_file_category.title_translations[locale] rescue nil %> <% end %> - \ No newline at end of file + From 1c07224694c29256252ecf9aa7379a56501c4e9f Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Fri, 28 Dec 2012 10:12:17 +0800 Subject: [PATCH 02/11] fixed page_parts submit button --- app/views/admin/page_parts/_edit.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/page_parts/_edit.html.erb b/app/views/admin/page_parts/_edit.html.erb index 5a27bc68..828e03a2 100644 --- a/app/views/admin/page_parts/_edit.html.erb +++ b/app/views/admin/page_parts/_edit.html.erb @@ -12,6 +12,6 @@ <% end %>

- <%= f.submit t(:update_) %> <%= link_back %> + <%= f.submit t(:update) %> <%= link_back %>

-<% end %> \ No newline at end of file +<% end %> From ec96a2e0e712b7ca4105844db6e61e01059ce931 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Dec 2012 10:36:18 +0800 Subject: [PATCH 03/11] Add page counter --- app/views/admin/page_parts/_edit.html.erb | 2 +- config/locales/zh_tw.yml | 1 + lib/parsers/parser_back_end.rb | 1 + lib/parsers/parser_common.rb | 2 +- lib/parsers/parser_front_end.rb | 33 ++++++++++++++++++++--- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/app/views/admin/page_parts/_edit.html.erb b/app/views/admin/page_parts/_edit.html.erb index 828e03a2..78a20b37 100644 --- a/app/views/admin/page_parts/_edit.html.erb +++ b/app/views/admin/page_parts/_edit.html.erb @@ -12,6 +12,6 @@ <% end %>

- <%= f.submit t(:update) %> <%= link_back %> + <%= f.submit t(:update_) %> <%= link_back %>

<% end %> diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index c8075b24..026a43d0 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -389,6 +389,7 @@ zh_tw: paper: Paper was successfully updated. user: User was successfully updated. success_: S使用者已更新成功 + update_: 更新 update_at: 最後更新時間 url: 網址 use_status: '' diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb index c3c43fe8..d0c1eab6 100644 --- a/lib/parsers/parser_back_end.rb +++ b/lib/parsers/parser_back_end.rb @@ -30,6 +30,7 @@ module ParserBackEnd parse_images_edit(body, page) parse_footer_edit(body, page) parse_sub_menu_edit(body, page) + parse_counter_edit(body) public_r_tags.each do |tag| send("parse_#{tag}s_edit", body, page, true) end diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index 794fb4fd..acdd43b8 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -233,7 +233,7 @@ module ParserCommon end # page_counter - def parse_counter(body = nil, page = nil, edit=nil) + def parse_counter_edit(body = nil) body.css('.page_counter').each do |counter| res = '' case counter['option'] diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index 119c2706..763eeba7 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -11,6 +11,7 @@ module ParserFrontEnd parse_images(body, page) parse_menu(body, page) parse_sub_menu(body, page, site) + parse_counter(body) i18n.merge!({locale => body.to_html}) end i18n @@ -21,10 +22,14 @@ module ParserFrontEnd tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id] body = Nokogiri::HTML(page.content) body.css('orbit_front').each do |front| - ret = '' - part = PagePart.find(front['part_id']) if front['part_id'] - ret << eval("\"#{front['path']}\"") rescue '' - fragment = Nokogiri::HTML::DocumentFragment.new(body, "
") + if front['class'] && front['class'].include?('dymanic_load') + ret = '' + part = PagePart.find(front['part_id']) if front['part_id'] + ret << eval("\"#{front['path']}\"") rescue '' + fragment = Nokogiri::HTML::DocumentFragment.new(body, "
") + else + fragment = Nokogiri::HTML::DocumentFragment.new(body, eval("#{front['value']}").to_s) + end front.swap(fragment) end body.to_html @@ -131,6 +136,26 @@ module ParserFrontEnd end end + def parse_counter(body = nil) + body.css('.page_counter').each do |counter| + ret = '' + case counter['option'] + when 'all' + ret << "display_visitors" + when 'today' + ret << "display_visitors_today" + when 'this_week' + ret << "display_visitors_this_week" + when 'this_month' + ret << "display_visitors_this_month" + when 'this_year' + ret << "display_visitors_this_year" + end + fragment = Nokogiri::HTML::DocumentFragment.new(body, "") + counter.swap(fragment) + end + end + # ad_banners def generate_ad_banners(*args) "
" From bab8328029ca7fd009d952ce850dc31418415b41 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Dec 2012 10:43:48 +0800 Subject: [PATCH 04/11] Put back old tags (don't use the class ProtoTag) --- app/models/tag.rb | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/app/models/tag.rb b/app/models/tag.rb index ad63434b..758c7899 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,4 +1,45 @@ -class Tag < ProtoTag - belongs_to :module_app +# class Tag < ProtoTag +# belongs_to :module_app + +# end + +class Tag + include Mongoid::Document + include Mongoid::Timestamps + include Impressionist::Impressionable + + is_impressionable :counter_cache => { :column_name => :view_count } + + field :key + field :view_count, :type => Integer, :default => 0 + #field :cloud_amper,:type: Integer,:default=> 0 + + def self.sorted_for_cloud + tags = {} + self.all.each{ |tag| + tags.merge!({tag => self.get_impressionist(tag)}) + } + if !tags.blank? + sorted_tags = tags.sort{|a,b| a[1]<=>b[1]}.reverse + sorted_tags[0][1] = :hot1 + offset = (sorted_tags.size - 1) / 3 + i = 1 + class_i = 2 + sorted_tags[1..-1].collect!{ |x| + x[1] = "hot#{class_i}" + i == offset ? i = 1 : i += 1 if class_i < 4 + class_i += 1 if i == offset && class_i < 4 + } + sorted_tags + else + [] + end + end + + protected + + def self.get_impressionist(item_tag = self) + item_tag.impressions.where(:created_at.gte=> 14.days.ago,:created_at.lte => Time.now).count + end end From 17d93409b36dbb2fef2bf3a6b453c594bfa48c10 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Dec 2012 11:10:33 +0800 Subject: [PATCH 05/11] Remove extra double quote in sub_menu Fix web link widget pagination --- app/views/front/show_page_sub_menu.html.erb | 2 +- .../widget/web_links/_index.html.erb | 27 +++++++++++++++++ .../widget/web_links/index.html.erb | 29 ++----------------- .../widget/web_links/index.js.erb | 1 + 4 files changed, 32 insertions(+), 27 deletions(-) create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/_index.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/index.js.erb diff --git a/app/views/front/show_page_sub_menu.html.erb b/app/views/front/show_page_sub_menu.html.erb index 7dfcb0af..ebe51f73 100644 --- a/app/views/front/show_page_sub_menu.html.erb +++ b/app/views/front/show_page_sub_menu.html.erb @@ -1,7 +1,7 @@ <% if @menu_page && @menu_page.visible_children.size > 0 %>

<%= @menu_page.title %>

-
    " +
      <% @menu_page.visible_children.each do |child| %>
    • <%= child.title %> 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 new file mode 100644 index 00000000..54311370 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/_index.html.erb @@ -0,0 +1,27 @@ +<% if @current_category %> +

      <%= @current_category.title + " " + t(:list_lower) %>

      +<% elsif @tag %> +

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

      +<% else %> +

      <%= t('list.link') %>

      +<% end %> + + + + + + + + <% @web_links.each do |post| %> + + + + + <% end %> + +
      <%= t(:category) %><%= t(:name) %>
      <%= post.web_link_category.title rescue nil %> + <%= link_to post.title, post.url, {:target => '_blank', :title => post.title} %> +
      + +<%#= paginate @web_links, :params => {:inner => 'true'}, :remote => true %> +<%= paginate @web_links, :params => {:inner => 'false'}, :remote => true %> 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 3e22695d..93e31402 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,26 +1,3 @@ -<% if @current_category %> -

      <%= @current_category.title + " " + t(:list_lower) %>

      -<% elsif @tag %> -

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

      -<% else %> -

      <%= t('list.link') %>

      -<% end %> - - - - - - - - <% @web_links.each do |post| %> - - - - - <% end %> - -
      <%= t(:category) %><%= t(:name) %>
      <%= post.web_link_category.title rescue nil %> - <%= link_to post.title, post.url, {:target => '_blank', :title => post.title} %> -
      - -<%= paginate @web_links, :params => {:inner => 'false'} %> + \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/index.js.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/index.js.erb new file mode 100644 index 00000000..4ca2c879 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/index.js.erb @@ -0,0 +1 @@ +$('#web_link_widget').html("<%= j render 'index' %>") \ No newline at end of file From 37309a452dbf7db6d686fa804ca6515e4aeaaf20 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Dec 2012 11:37:37 +0800 Subject: [PATCH 06/11] Fix site map and menu order --- app/controllers/front_controller.rb | 2 +- app/models/item.rb | 2 +- lib/parsers/parser_common.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/front_controller.rb b/app/controllers/front_controller.rb index 2f58d9ed..0ef39633 100644 --- a/app/controllers/front_controller.rb +++ b/app/controllers/front_controller.rb @@ -39,7 +39,7 @@ class FrontController < ApplicationController res << "'>" i = nil i = 1 if menu.values["li_incremental_#{current}"] - children = current == 1 ? page.visible_children.reverse : page.visible_children + children = current == 1 ? page.visible_children : page.visible_children children.each do |child| res << menu_li(child, current_page, current, menu, i) i += 1 if i diff --git a/app/models/item.rb b/app/models/item.rb index 81366a21..1809e2b2 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -56,7 +56,7 @@ class Item end def show_in_sitemap_for(locale) - if !sitemap_enabled[locale].blank? + if sitemap_enabled && !sitemap_enabled[locale].blank? sitemap_enabled[locale].eql?('true') ? true : false else true diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index acdd43b8..4eb044b1 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -9,7 +9,7 @@ module ParserCommon res << "'>" i = nil i = 1 if menu.values["li_incremental_#{current}"] - children = current == 1 ? page.visible_children.reverse : page.visible_children + children = current == 1 ? page.visible_children : page.visible_children children.each do |child| res << menu_li(child, current_page, current, menu, i, edit) i += 1 if i From 0a0298aaad95a516dfedad53b3d0d669a995715d Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Dec 2012 11:44:33 +0800 Subject: [PATCH 07/11] Fix counter front-end --- lib/parsers/parser_front_end.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index 763eeba7..177143d3 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -28,7 +28,7 @@ module ParserFrontEnd ret << eval("\"#{front['path']}\"") rescue '' fragment = Nokogiri::HTML::DocumentFragment.new(body, "
      ") else - fragment = Nokogiri::HTML::DocumentFragment.new(body, eval("#{front['value']}").to_s) + fragment = Nokogiri::HTML::DocumentFragment.new(body, "
      eval('#{front['value']}'').to_s
      " ) end front.swap(fragment) end From 974a190eafefa4af1b33cd731a0e980b2dbe4b97 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Dec 2012 11:51:56 +0800 Subject: [PATCH 08/11] Fix orbit_front parser --- lib/parsers/parser_front_end.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index 177143d3..a211412b 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -22,13 +22,13 @@ module ParserFrontEnd tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id] body = Nokogiri::HTML(page.content) body.css('orbit_front').each do |front| - if front['class'] && front['class'].include?('dymanic_load') + if front['value'] + fragment = Nokogiri::HTML::DocumentFragment.new(body, "
      #{eval(front['value']).to_s}
      ") + else ret = '' part = PagePart.find(front['part_id']) if front['part_id'] ret << eval("\"#{front['path']}\"") rescue '' fragment = Nokogiri::HTML::DocumentFragment.new(body, "
      ") - else - fragment = Nokogiri::HTML::DocumentFragment.new(body, "
      eval('#{front['value']}'').to_s
      " ) end front.swap(fragment) end From 455a27437d8e517f0bb1884dadf293d2e5e75970 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Dec 2012 13:47:30 +0800 Subject: [PATCH 09/11] Changes for announcement widget style 2 --- app/assets/stylesheets/default_widget.css | 195 ++++++++++++++++++ .../widget/bulletins/_index.html.erb | 2 +- .../widget/bulletins/index.html.erb | 2 +- 3 files changed, 197 insertions(+), 2 deletions(-) create mode 100644 app/assets/stylesheets/default_widget.css diff --git a/app/assets/stylesheets/default_widget.css b/app/assets/stylesheets/default_widget.css new file mode 100644 index 00000000..96e490c4 --- /dev/null +++ b/app/assets/stylesheets/default_widget.css @@ -0,0 +1,195 @@ +body{ + margin:10px; + padding:0; +} +a{ + color:#333; + text-decoration: none; +} +a:hover{ + color:#888; + text-decoration: none; +} +h2{ + margin:0 0 10px; +} + +ul{ + margin:0; + padding:0; +} + +li{ + list-style:none; +} +.eletb{ + border-collapse:collapse; + width:600px; +} +.eletb td{ + border: 1px solid #EEEEEE; + padding: 5px; + vertical-align: middle; + text-align: center; +} +.news{ + font-size:12px; + margin:0 0 20px; + position:relative; + width:600px; +} +.news ul{ + margin:0 0 10px; +} +.news li{ + padding:5px 0; +} +.more{ + background:#eee; + border-radius: 5px; + clear:both; + display:inline; + padding:3px; + text-align: center; +} +.top{ + color:#e21f1f; +} + +.elements{ + background: none repeat scroll 0 0 #f2f2f2; + border-radius: 5px 5px 5px 5px; + display: inline-block; + height: 50px; + padding: 10px; + text-align: center; + vertical-align: top; + width: 50px; + word-wrap: break-word; +} +.elementlist{ + margin:0 0 20px; +} +/* 1 */ + +.newstb{ + border-collapse:collapse; + width:600px; +} + +.newstb th{ + background: none repeat scroll 0 0 #eee; + padding: 5px; + text-align: left; +} +.newstb td{ + border: 1px solid #EEEEEE; + padding: 5px; +} + + +/* 2 */ + +.news2{} + +.news2 li{ + border-bottom:1px solid #eee; +} + +.news2 .newsimg{ + display: inline-block; + margin: 0 10px 0 0; + vertical-align: top; +} + +.news2 .app-pic{ + height:50px; + width:50px; + display: inline-block; +} +.news2 ul{ + display: inline-block; + width:570px; +} + + +/* 3 */ + +.news3{} + +.news3 li{ + border-bottom:1px solid #eee; + overflow: hidden; +} + +.news3 .img{ + float:left; + margin:0 10px 0 0; +} + +.news3 .hot, .news3 .title, .news3 .date, .news3 .tags, .news3 .text{ + display:block; + margin:0 0 5px; + text-align: left; +} + +.news3 .wrap{ + overflow: hidden; +} + + + + +/* 4 */ + +.news4{} + +.news4 li{ + border-bottom:1px solid #eee; + overflow: hidden; +} + +.news4 .img{ + float:right; + margin:0 0 0 10px; +} + +.news4 .hot, .news4 .title, .news4 .date, .news4 .tags, .news4 .text{ + display:block; + margin:0 0 5px; + text-align: left; +} + +.news4 .wrap{ + overflow: hidden; +} + + + +/* 5 */ + +.news5{ + overflow: hidden; +} + +.news5 .img{ + float:left; + margin:0 10px 0 0; +} +.news5 ul{ + float: left; + text-align: left; + width: 540px; +} +.news5 li{ + border-bottom:1px solid #eee; +} + +.news5 .more{} +.news5 .hot, .news5 .title, .news5 .date, .news5 .tags, .news5 .text{ + +} + +.news5 .wrap{ + overflow: hidden; +} \ No newline at end of file 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 8d53872b..79e52de9 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 @@ -67,7 +67,7 @@
        <% @bulletins.each do |post| %>
      • -
        <%= image_tag(post.image.url) %>
        +
        <%= image_tag(post.image.url) %>
        <% @widget_fields.each do |wf| %> 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 81992d59..a8c8c758 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,4 +1,4 @@ - +<%= stylesheet_link_tag "default_widget" %> From e8e7c382217506929e018b8382d2b93ed0695ecf Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Dec 2012 14:01:04 +0800 Subject: [PATCH 10/11] Changes for announcement widget style 1 and categories --- .../announcement/widget/bulletins/_index.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 79e52de9..410d35e2 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 @@ -17,8 +17,8 @@ <% @bulletins.each do |post| %> - <% @widget_fields.each do |wf| %> + <% @widget_fields.each do |wf| %> <% if wf[1] == 'title' %> @@ -26,7 +26,7 @@ <% elsif wf[1] == 'date' %> <%= display_date(post.send(wf[0])) %> <% elsif wf[1] == 'category' %> - <%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").i18n_variable[I18n.locale] rescue nil %> + <%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").title rescue nil %> <% elsif wf[1] == 'img' %>
        <%= image_tag(post.send(wf[0]).url) %>
        <% elsif wf[1] == 'text' %> @@ -49,8 +49,8 @@ <% end %>
        - <% end %> + <% end %> @@ -76,7 +76,7 @@ <% elsif wf[1] == 'date' %> <%= display_date(post.send(wf[0])) %> <% elsif wf[1] == 'category' %> - <%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").i18n_variable[I18n.locale] rescue nil %> + <%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").title rescue nil %> <% elsif wf[1] == 'text' %> <%#= post.send("#{wf[0]}[#{I18n.locale}]").html_safe %> <%= post.send("#{wf[0]}").html_safe %> @@ -124,7 +124,7 @@ <% elsif wf[1] == 'date' %> <%= display_date(post.send(wf[0])) %> <% elsif wf[1] == 'category' %> - <%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").i18n_variable[I18n.locale] rescue nil %> + <%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").title rescue nil %> <% elsif wf[1] == 'text' %> <%#= post.send("#{wf[0]}[#{I18n.locale}]").html_safe %> <%= post.send("#{wf[0]}").html_safe %> @@ -174,7 +174,7 @@ <% elsif wf[1] == 'date' %> <%= display_date(post.send(wf[0])) %> <% elsif wf[1] == 'category' %> - <%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").i18n_variable[I18n.locale] rescue nil %> + <%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").title rescue nil %> <% elsif wf[1] == 'text' %> <%#= post.send("#{wf[0]}[#{I18n.locale}]").html_safe %> <%= post.send("#{wf[0]}").html_safe %> @@ -222,7 +222,7 @@ <% elsif wf[1] == 'date' %> <%= display_date(post.send(wf[0])) %> <% elsif wf[1] == 'category' %> - <%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").i18n_variable[I18n.locale] rescue nil %> + <%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").title rescue nil %> <% elsif wf[1] == 'text' %> <%#= post.send("#{wf[0]}[#{I18n.locale}]").html_safe %> <%= post.send("#{wf[0]}").html_safe %> From 4d965d754b75e3959fd4bee24bd5111877b31003 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Dec 2012 15:03:02 +0800 Subject: [PATCH 11/11] Fix urls in tinymce source editor --- app/assets/javascripts/tinymce_orbit.js.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/javascripts/tinymce_orbit.js.erb b/app/assets/javascripts/tinymce_orbit.js.erb index 975485a3..d73d7768 100644 --- a/app/assets/javascripts/tinymce_orbit.js.erb +++ b/app/assets/javascripts/tinymce_orbit.js.erb @@ -14,7 +14,6 @@ function load_tinymce() { theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, - relative_urls : false, // Skin options skin : "o2k7",