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", 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/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/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 diff --git a/app/views/admin/page_parts/_edit.html.erb b/app/views/admin/page_parts/_edit.html.erb index 5a27bc68..78a20b37 100644 --- a/app/views/admin/page_parts/_edit.html.erb +++ b/app/views/admin/page_parts/_edit.html.erb @@ -14,4 +14,4 @@

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

-<% end %> \ No newline at end of file +<% end %> 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 %>

-