homeland 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,6 +23,10 @@ after:
23
23
 
24
24
  <%= link_to "Home", main_app.root_path %>
25
25
  <%= link_to "Home", main_app.posts_path %>
26
+
27
+ 4. Change you routes.rb to add this:
28
+
29
+ mount Homeland::Engine, :at => "/bbs"
26
30
 
27
31
 
28
32
  ## Generate views to custom
@@ -62,11 +62,12 @@ module Homeland
62
62
  @topic = Topic.new
63
63
  if !params[:node].blank?
64
64
  @topic.node_id = params[:node]
65
- @node = Node.find_by_id(params[:node])
65
+ @node = Node.where(:_id => params[:node]).first
66
66
  if @node.blank?
67
- render_404
67
+ redirect_to "/404"
68
68
  end
69
69
  end
70
+ @topic.id = nil
70
71
  end
71
72
 
72
73
  def reply
@@ -2,6 +2,7 @@
2
2
  module Homeland
3
3
  module TopicsHelper
4
4
  def format_topic_body(text,title = "",allow_image = true)
5
+ text.gsub!(/\!\[(.+?|)\]\((http:\/\/.+?)\)/i,'<img src="\2" alt="\1" />')
5
6
  auto_link(simple_format(text),:all, :target => '_blank', :rel => "nofollow")
6
7
  end
7
8
 
@@ -12,7 +12,7 @@
12
12
  <%= form_for(@reply) do |f| %>
13
13
  <fieldset>
14
14
  <legend>修改回帖</legend>
15
- <%= render "shared/error_messages", :target => @reply %>
15
+ <%= render "homeland/shared/error_messages", :target => @reply %>
16
16
  <div class="clearfix">
17
17
  <%= f.label :body %>
18
18
  <div class="input">
@@ -1,7 +1,7 @@
1
1
  <%= form_for(@topic) do |f| %>
2
2
  <fieldset>
3
3
  <legend><%= @topic.id.blank? ? "新建帖子" : "修改帖子" %></legend>
4
- <%= render "shared/error_messages", :target => @topic %>
4
+ <%= render "homeland/shared/error_messages", :target => @topic %>
5
5
  <%= f.hidden_field :node_id %>
6
6
  <div class="clearfix">
7
7
  <%= f.label :title %>
@@ -7,8 +7,8 @@
7
7
  <a class="btn btn-success" href="<%= new_topic_path %>">发布新帖</a>
8
8
  </div>
9
9
  <div style="text-align:center;">
10
- <a href="<%= homeland.feed_topics_url %>" title="用RSS阅读器订阅<%= Setting.app_name %>论坛新贴">
11
- <%= image_tag('feed.png', :alt => "订阅#{Setting.app_name}论坛新贴") %></a>
10
+ <a href="<%= homeland.feed_topics_url %>" title="用RSS阅读器订阅论坛新贴">
11
+ <%= image_tag('feed.png', :alt => "订阅论坛新贴") %></a>
12
12
  </div>
13
13
  </div>
14
14
  <% end %>
@@ -18,7 +18,7 @@
18
18
  </p>
19
19
  </div>
20
20
  <% else %>
21
- <h1 class="bbs_name"><%= Setting.app_name %></h1>
21
+ <h1 class="bbs_name">论坛</h1>
22
22
  <% end %>
23
23
  <div class="topics">
24
24
  <%= render :partial => "topic", :collection => @topics %>
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.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-19 00:00:00.000000000 Z
12
+ date: 2012-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70209786130840 !ruby/object:Gem::Requirement
16
+ requirement: &70246274863400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>'
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70209786130840
24
+ version_requirements: *70246274863400
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jquery-atwho-rails
27
- requirement: &70209786120780 !ruby/object:Gem::Requirement
27
+ requirement: &70246274861920 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,18 @@ dependencies:
32
32
  version: 0.1.5
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70209786120780
35
+ version_requirements: *70246274861920
36
+ - !ruby/object:Gem::Dependency
37
+ name: rails_autolink
38
+ requirement: &70246274860800 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: 1.0.0
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70246274860800
36
47
  description: A new style forum for small communitys.
37
48
  email:
38
49
  - huacnlee@gmail.com
@@ -97,8 +108,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
108
  version: 1.3.6
98
109
  requirements: []
99
110
  rubyforge_project:
100
- rubygems_version: 1.8.11
111
+ rubygems_version: 1.8.10
101
112
  signing_key:
102
113
  specification_version: 3
103
114
  summary: A new style forum for small communitys.
104
115
  test_files: []
116
+ has_rdoc: