homeland 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Changelogs.md ADDED
@@ -0,0 +1,29 @@
1
+ 0.0.8 / 2012-07-02
2
+
3
+ * Mongoid 3.0.0.rc support;
4
+ * Fix body text font size to 14px;
5
+
6
+ 0.0.7 / 2012-06-28
7
+
8
+ * Add Early loading for queries;
9
+
10
+ 0.0.6 / 2012-05-28
11
+
12
+ * Remove hits field from Topic model.
13
+
14
+ 0.0.5 / 2012-05-08
15
+
16
+ * Add test app.
17
+ * Add markdown like image syntax.
18
+ * Bug fix in using.
19
+
20
+ 0.0.4 / 2012-04-19
21
+ ==================
22
+
23
+ * Add chosen; Add @ reply feature.
24
+ * More style improve.
25
+
26
+ 0.0.3 / 2012-04-17
27
+ ==================
28
+
29
+ * 实现基础功能
@@ -3,7 +3,7 @@ A new style forum for tiny community as Rails Engine. You can mount this in you
3
3
  ## Requrements
4
4
 
5
5
  * Rails 3.1
6
- * Mongoid
6
+ * Mongoid 2.4.x or 3.0.0.rc
7
7
  * rails_autolink
8
8
 
9
9
  ## Install
@@ -14,21 +14,21 @@ A new style forum for tiny community as Rails Engine. You can mount this in you
14
14
  gem "homeland"
15
15
  ```
16
16
 
17
- 2. Install thought this commands:
17
+ 2. Install thought this commands:
18
18
 
19
19
  ```bash
20
20
  rails g homeland:install
21
21
  ```
22
-
22
+
23
23
  3. change you application.html.erb
24
24
 
25
25
  before:
26
-
27
- ```erb
28
- <%= link_to "Home", root_path %>
29
- <%= link_to "Posts", posts_path %>
30
- ```
31
-
26
+
27
+ ```erb
28
+ <%= link_to "Home", root_path %>
29
+ <%= link_to "Posts", posts_path %>
30
+ ```
31
+
32
32
  after:
33
33
 
34
34
  ```erb
@@ -45,10 +45,21 @@ A new style forum for tiny community as Rails Engine. You can mount this in you
45
45
 
46
46
  ## Generate views to custom
47
47
 
48
- ```bash
49
- rails g homeland:views
50
- ```
51
-
48
+ ```bash
49
+ rails g homeland:views
50
+ ```
51
+
52
+ ## How to test Homeland
53
+
54
+ ```bash
55
+ $ bundle install
56
+ $ cd spec/dummy
57
+ $ rails s
58
+ INFO WEBrick 1.3.1
59
+ INFO ruby 1.9.3 (2012-04-20) [x86_64-darwin11.4.0]
60
+ INFO WEBrick::HTTPServer#start: pid=9720 port=3000
61
+ ```
62
+
52
63
  ## Demo App
53
64
 
54
65
  * [http://720p.so/bbs](http://720p.so/bbs)
@@ -56,3 +67,4 @@ A new style forum for tiny community as Rails Engine. You can mount this in you
56
67
  ----
57
68
 
58
69
  Thanks [V2EX](http://www.v2ex.com/?r=huacnlee) forum idea.
70
+ A new style forum for tiny community as Rails Engine. You can mount this in you apps.
@@ -13,9 +13,9 @@
13
13
  .sidebar p { margin-bottom:8px;}
14
14
 
15
15
  #sections {
16
- ul {
17
- margin:0; list-style:none;
18
- li {
16
+ ul {
17
+ margin:0; list-style:none;
18
+ li {
19
19
  margin-bottom:10px;
20
20
  position:relative;
21
21
  min-height:20px;
@@ -23,7 +23,7 @@
23
23
  a { display:inline-block; margin-right:8px; }
24
24
  .items { padding-left:90px; }
25
25
  }
26
-
26
+
27
27
  }
28
28
  }
29
29
 
@@ -40,14 +40,14 @@
40
40
  .topics .topic .info a:link,
41
41
  .topics .topic .info a:visited { color:#999; text-decoration: underline; }
42
42
  .topics .body { line-height:160%; font-size:14px; margin-top:8px;}
43
- .topics .body p { margin-bottom:10px; }
43
+ .topics .body p { margin-bottom:10px; font-size:14px; }
44
44
  .topics .tools { text-align:right; }
45
45
  .topics .tools a {margin-left:6px;}
46
46
  .topics .topic .replies { width:70px; margin-right:10px; text-align:right; vertical-align:middle; }
47
- .topics .topic .replies a.count:link { line-height: 12px; font-weight: bold; color: white;
48
- background-color: #1c7fdb; display: inline-block;
49
- padding: 2px 10px 2px 10px;
50
- -moz-border-radius: 12px; -webkit-border-radius: 12px;
47
+ .topics .topic .replies a.count:link { line-height: 12px; font-weight: bold; color: white;
48
+ background-color: #1c7fdb; display: inline-block;
49
+ padding: 2px 10px 2px 10px;
50
+ -moz-border-radius: 12px; -webkit-border-radius: 12px;
51
51
  margin: 18px 12px 0px 0px; text-decoration: none; }
52
52
  .topics .topic .replies a.count:visited { background:#ddd; color:#aaa;}
53
53
  .topics .topic .replies a.count:hover { color:write; background-color:#1F8AEE; }
@@ -83,6 +83,7 @@
83
83
  #replies .reply .info .time { float:right; text-align:right; }
84
84
  #replies .reply .info a.reply_link img { vertical-align:middle;}
85
85
  #replies .reply .body { line-height:180%; font-size:14px; text-overflow: ellipsis;}
86
+ #replies .reply .body p { font-size:14px; }
86
87
  #replies .reply .body img { max-width:622px;}
87
88
 
88
89
  #reply.form textarea { width:578px; }
@@ -1,4 +1,4 @@
1
- # coding: utf-8
1
+ # coding: utf-8
2
2
  module Homeland
3
3
  class Node
4
4
  include Mongoid::Document
@@ -8,15 +8,15 @@ module Homeland
8
8
  field :summary
9
9
  field :sort, :type => Integer, :default => 0
10
10
  field :topics_count, :type => Integer, :default => 0
11
-
11
+
12
12
  has_many :topics, :class_name => "Homeland::Topic"
13
13
  belongs_to :section, :class_name => "Homeland::Section"
14
-
14
+
15
15
  validates_presence_of :name, :summary
16
16
  validates_uniqueness_of :name
17
-
18
- index :topics_count
19
- index :sort
17
+
18
+ index :topics_count => 1
19
+ index :sort => -1
20
20
 
21
21
  scope :hots, desc(:topics_count)
22
22
  scope :sorted, desc(:sort)
@@ -1,4 +1,4 @@
1
- # coding: utf-8
1
+ # coding: utf-8
2
2
  module Homeland
3
3
  class Reply
4
4
  include Mongoid::Document
@@ -6,18 +6,18 @@ module Homeland
6
6
  include Mongoid::Paranoia
7
7
 
8
8
  field :body
9
-
9
+
10
10
  belongs_to :user, :inverse_of => :replies, :class_name => Homeland.user_class.to_s
11
11
  belongs_to :topic, :inverse_of => :replies, :class_name => "Homeland::Topic"
12
-
12
+
13
13
  attr_protected :user_id, :topic_id
14
-
15
- index :topic_id
16
- index :user_id
14
+
15
+ index :topic_id => 1
16
+ index :user_id => 1
17
17
 
18
18
  validates_presence_of :body
19
19
  scope :recent, desc(:_id)
20
-
20
+
21
21
  after_create :update_parent_last_replied
22
22
  def update_parent_last_replied
23
23
  self.topic.replied_at = Time.now
@@ -18,9 +18,9 @@ module Homeland
18
18
  attr_protected :user_id
19
19
  validates_presence_of :user_id, :title, :body, :node_id
20
20
 
21
- index :replied_at
22
- index :user_id
23
- index :node_id
21
+ index :replied_at => -1
22
+ index :user_id => 1
23
+ index :node_id => 1
24
24
 
25
25
  # scopes
26
26
  scope :last_actived, desc(:replied_at).desc(:_id)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homeland
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-28 00:00:00.000000000 Z
12
+ date: 2012-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -102,7 +102,8 @@ files:
102
102
  - app/views/homeland/topics/new.html.erb
103
103
  - app/views/homeland/topics/show.html.erb
104
104
  - config/routes.rb
105
- - README.markdown
105
+ - README.md
106
+ - Changelogs.md
106
107
  homepage: http://github.com/huacnlee/homeland
107
108
  licenses: []
108
109
  post_install_message: