Merge branch 'ntu' of github.com:Rulingcom/orbit into ntu

This commit is contained in:
Fu Matthew committed 2012-12-28 15:31:32 +08:00
commit 5587e83419
17 files changed
+317 -50

No files matched your search

@@ -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",
+195
View File
@@ -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;
}
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+43 -2
View File
@@ -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
+1 -1
View File
@@ -14,4 +14,4 @@
<p>
<%= f.submit t(:update_) %> <%= link_back %>
</p>
<% end %>
<% end %>
+1 -1
View File
@@ -1,7 +1,7 @@
<% if @menu_page && @menu_page.visible_children.size > 0 %>
<div class='category_list'>
<h3 class='h3'><%= @menu_page.title %></h3>
<ul class='list'>"
<ul class='list'>
<% @menu_page.visible_children.each do |child| %>
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>