tamed_beast 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/Gemfile +4 -0
  2. data/README +12 -0
  3. data/Rakefile +2 -0
  4. data/app/controllers/forums_controller.rb +60 -0
  5. data/app/controllers/posts_controller.rb +98 -0
  6. data/app/controllers/topics_controller.rb +94 -0
  7. data/app/models/forum.rb +23 -0
  8. data/app/models/post.rb +26 -0
  9. data/app/models/topic.rb +97 -0
  10. data/app/views/forums/_form.html.erb +21 -0
  11. data/app/views/forums/edit.html.erb +12 -0
  12. data/app/views/forums/index.html.erb +63 -0
  13. data/app/views/forums/new.html.erb +10 -0
  14. data/app/views/forums/show.html.erb +81 -0
  15. data/app/views/posts/_edit.html.erb +38 -0
  16. data/app/views/posts/edit.html.erb +14 -0
  17. data/app/views/posts/index.html.erb +1 -0
  18. data/app/views/topics/_form.html.erb +17 -0
  19. data/app/views/topics/edit.html.erb +10 -0
  20. data/app/views/topics/index.html.erb +2 -0
  21. data/app/views/topics/new.html.erb +18 -0
  22. data/app/views/topics/show.html.erb +175 -0
  23. data/config/conf.rb +0 -0
  24. data/lib/generators/tamed_beast/install_generator.rb +56 -0
  25. data/lib/generators/tamed_beast/migration_generator.rb +26 -0
  26. data/lib/generators/tamed_beast/templates/migration.rb +57 -0
  27. data/lib/generators/tamed_beast/templates/routes.rb +9 -0
  28. data/lib/tamed_beast.rb +7 -0
  29. data/lib/tamed_beast/application_helper.rb +18 -0
  30. data/lib/tamed_beast/auth.rb +24 -0
  31. data/lib/tamed_beast/engine.rb +7 -0
  32. data/lib/tamed_beast/version.rb +3 -0
  33. data/tamed_beast.gemspec +23 -0
  34. data/test/fixtures/forums.yml +19 -0
  35. data/test/fixtures/posts.yml +34 -0
  36. data/test/fixtures/topics.yml +29 -0
  37. data/test/fixtures/users.yml +9 -0
  38. data/test/functional/forums_controller_test.rb +51 -0
  39. data/test/functional/posts_controller_test.rb +54 -0
  40. data/test/functional/topics_controller_test.rb +55 -0
  41. data/test/unit/forum_test.rb +10 -0
  42. data/test/unit/post_test.rb +32 -0
  43. data/test/unit/topic_test.rb +33 -0
  44. data/vendor/plugins/white_list/README +29 -0
  45. data/vendor/plugins/white_list/Rakefile +22 -0
  46. data/vendor/plugins/white_list/init.rb +2 -0
  47. data/vendor/plugins/white_list/lib/white_list_helper.rb +97 -0
  48. data/vendor/plugins/white_list/test/white_list_test.rb +132 -0
  49. data/vendor/plugins/white_list_formatted_content/init.rb +27 -0
  50. metadata +161 -0
@@ -0,0 +1,12 @@
1
+ <div class="crumbs">
2
+ <%= link_to 'Forums'[:forums_title], forums_path %> <span class="arrow">&rarr;</span>
3
+ </div>
4
+
5
+ <h1><%= 'Edit Forum'[:edit_forum] %></h1>
6
+
7
+ <% form_for :forum,
8
+ :url => forum_path(@forum),
9
+ :html => { :method => :put } do |f| -%>
10
+ <%= render :partial => "form", :object => f %>
11
+ <%= submit_tag 'Save Forum'[:save_forum] -%> or <%= link_to('Cancel'[:cancel], forums_path) %>
12
+ <% end -%>
@@ -0,0 +1,63 @@
1
+ <h1 style="margin-top:0;"><%= 'Forums'[:forums_title] %></h1>
2
+ <p class="subtitle">
3
+ <%= feed_icon_tag "Recent Posts"[:recent_posts], all_posts_path(:format => 'rss') %>
4
+ <%= '{count} topic(s)'[(count=Topic.count)==1 ? :topic_count : :topics_count, number_with_delimiter(count)] %>,
5
+ <%= '{count} post(s)'[(count=Post.count)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %>, <%= '{count} voice(s)'[(count=User.count(:conditions => "posts_count > 0"))==1 ? :voice_count : :voices_count, number_with_delimiter(count)] %>
6
+
7
+ </p>
8
+
9
+ <table border="0" cellspacing="0" cellpadding="0" class="wide forums">
10
+ <tr>
11
+ <th class="la" width="70%" colspan="3"><%= 'Forum'[:forum_title] %></th>
12
+ <!--
13
+ <th width="5%">Topics</th>
14
+ <th width="5%">Posts</th>
15
+ -->
16
+ <th class="la" width="30%" colspan="1"><%= 'Last Post'[:last_post] %></th>
17
+ </tr>
18
+ <% for forum in @forums do %>
19
+ <tr>
20
+ <td class="vat c1">
21
+
22
+ <% if recent_forum_activity(forum) %>
23
+ <%= image_tag "savage_beast/clearbits/comment.gif", :class => "icon green", :title => 'Recent activity'[:recent_activity] %>
24
+ <% else %>
25
+ <%= image_tag "savage_beast/clearbits/comment.gif", :class => "icon grey", :title => 'No recent activity'[:no_recent_activity] %>
26
+ <% end %>
27
+ </td>
28
+ <td class="c2 vat">
29
+ <%= link_to h(forum.name), forum_path(forum), :class => "title" %>
30
+ <div class="posts">
31
+ <%= '{count} topics'[(count=forum.topics.size)==1 ? :topic_count : :topics_count, number_with_delimiter(count)] %>,
32
+ <%= '{count} posts'[(count=forum.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %>
33
+ </div>
34
+ <p class="desc"><%= forum.description_html %>
35
+ </p>
36
+ </td>
37
+
38
+ <td class="inv lp">
39
+ <% if forum.recent_post %>
40
+ <%= time_ago_in_words(forum.recent_post.created_at) %><br />
41
+ <%= 'by {user}'[:by_user,"<strong>#{h(forum.recent_post.user.display_name)}</strong>"] %>
42
+ <span>(<%= link_to 'view'[], forum_topic_path(:forum_id => forum, :id => forum.recent_post.topic_id, :page => forum.recent_post.topic.last_page, :anchor => forum.recent_post.dom_id) %>)</span>
43
+ <% end %>
44
+ </td>
45
+ </tr>
46
+ <% end %>
47
+ </table>
48
+
49
+ <p>
50
+ <%= link_to 'Recent posts'[:recent_posts], all_posts_path %>
51
+ </p>
52
+
53
+ <% online_users = User.currently_online -%>
54
+ <% unless !online_users || online_users.empty? %>
55
+ <div class="stats">
56
+ <div class="users">
57
+ <% unless !online_users || online_users.empty? %>
58
+ <%= 'Users online:'[:users_online] %> <%= online_users.map { |u| link_to "<strong>#{h u.display_name}</strong>", user_path(u) } * ", " %><br />
59
+ <% end %>
60
+ </div>
61
+ </div>
62
+ <% end %>
63
+
@@ -0,0 +1,10 @@
1
+ <div class="crumbs">
2
+ <%= link_to "Forums"[:forums_title], forums_path %> <span class="arrow">&rarr;</span>
3
+ </div>
4
+
5
+ <h1><%= 'New Forum'[:new_forum] %></h1>
6
+
7
+ <% form_for :forum, :url => forums_path do |f| -%>
8
+ <%= render :partial => "form", :object => f %>
9
+ <%= submit_tag 'Create'[:Create] -%> or <%= link_to('Cancel'[:cancel], forums_path) -%>
10
+ <% end -%>
@@ -0,0 +1,81 @@
1
+ <% content_for :right do %>
2
+
3
+ <% unless @forum.description.blank? %>
4
+ <%= @forum.description_html %>
5
+ <hr />
6
+ <% end %>
7
+
8
+ <% end %>
9
+
10
+ <% @page_title = @forum.name %>
11
+
12
+ <div class="crumbs">
13
+ <%= link_to 'Forums'[:forums_title], forums_path %> <span class="arrow">&rarr;</span>
14
+ </div>
15
+ <h1 style="margin-top:0.5em">
16
+ <%= h @forum.name %>
17
+ </h1>
18
+
19
+ <p class="subtitle">
20
+ <%= feed_icon_tag @forum.name, forum_posts_path(@forum, :format => :rss) %>
21
+ <%= '{count} topic(s)'[(count=@forum.topics.size)==1 ? :topic_count : :topics_count, number_with_delimiter(count)] %>,
22
+ <%= '{count} post(s)'[(count=@forum.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %>
23
+ </p>
24
+
25
+ <% if @topics.total_pages > 1 -%>
26
+ <% if !current_user.nil? %>
27
+ <p style="float:right; margin-top:0;"><%= link_to 'New topic'[], new_forum_topic_path(@forum), :class => "utility" %></p>
28
+ <% end %>
29
+ <%= will_paginate @topics %>
30
+ <% end -%>
31
+
32
+ <table border="0" cellspacing="0" cellpadding="0" class="wide topics">
33
+ <tr>
34
+ <th class="la" colspan="2"><%= 'Topic'[:topic_title] %></th>
35
+ <th width="1%"><%= 'Posts'[:posts_title] %></th>
36
+ <th width="1%"><%= 'Views'[:views_title] %></th>
37
+ <th class="la"><%= 'Last post'[:last_post] %></th>
38
+ </tr>
39
+ <% for topic in @topics %>
40
+ <tr class="hentry">
41
+ <td style="padding:5px; width:16px;" class="c1">
42
+ <%
43
+ icon = "comment"
44
+ color = ""
45
+ if topic.locked?
46
+ icon = "lock"
47
+ post = ", this topic is locked."[:comma_locked_topic]
48
+ color = "darkgrey"
49
+ end
50
+ %>
51
+ <% if recent_topic_activity(topic) %>
52
+ <%= image_tag "savage_beast/clearbits/#{icon}.gif", :class => "icon green", :title => "Recent activity"[]+"#{post}" %>
53
+ <% else %>
54
+ <%= image_tag "savage_beast/clearbits/#{icon}.gif", :class => "icon grey #{color}", :title => "No recent activity"[]+"#{post}" %>
55
+ <% end %>
56
+ </td>
57
+ <td class="c2">
58
+ <%= "Sticky"[:sticky_title]+": <strong>" if topic.sticky? %>
59
+ <%= topic_title_link (topic), :class => "entry-title", :rel => "bookmark" %>
60
+ <%#= link_to h(topic.title), topic_path(@forum, topic), :class => "entry-title", :rel => "bookmark" %>
61
+ <%= "</strong>" if topic.sticky? %>
62
+ <% if topic.paged? -%>
63
+ <small><%= link_to 'last'[], forum_topic_path(:forum_id => @forum, :id => topic, :page => topic.last_page) %></small>
64
+ <% end -%>
65
+ </td>
66
+ <td class="ca inv stat"><%= topic.posts.size %></td>
67
+ <td class="ca inv stat"><%= number_with_delimiter(topic.views) %></td>
68
+ <td class="lp">
69
+ <abbr class="updated" title="<%= topic.replied_at.xmlschema %>"><%= time_ago_in_words(topic.replied_at) %></abbr>
70
+ <%= 'by {user}'[:by_user, "<span class=\"author\"><strong class=\"fn\">#{h(topic.replied_by_user.display_name)}</strong></span>"] %>
71
+ <span><%= link_to 'view'[], forum_topic_path(:forum_id => @forum, :id => topic, :page => topic.last_page, :anchor => "posts-#{topic.last_post_id}") %></span>
72
+ </td>
73
+ </tr>
74
+ <% end %>
75
+ </table>
76
+
77
+ <%= will_paginate @topics %>
78
+
79
+ <% if !current_user.nil? %>
80
+ <p><%= link_to 'New topic'[:new_topic], new_forum_topic_path(@forum), :class => "utility" %></p>
81
+ <% end%>
@@ -0,0 +1,38 @@
1
+ <div id="edit" class="editbox">
2
+ <div class="container">
3
+ <% remote_form_for :post, :url => post_path(:forum_id => @post.forum_id, :topic_id => @post.topic_id, :id => @post),
4
+ :html => { :method => :put }, :before => "$('editbox_spinner').show();" do |f| -%>
5
+
6
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
7
+ <tr>
8
+ <td rowspan="2" width="70%">
9
+ <%= f.text_area :body, :rows => 10, :id => "edit_post_body", :tabindex => 1 %>
10
+ </td>
11
+ <td valign="top">
12
+
13
+ <%= link_to('delete post'[], post_path(:forum_id => @post.topic.forum, :topic_id => @post.topic, :id => @post, :page => params[:page]),
14
+ :class => "utility", :method => :delete, :confirm => "Delete this post? Are you sure?"[:delete_post_conf]) %>
15
+
16
+
17
+ <h5><%= 'Formatting Help'[] %></h5>
18
+
19
+ <ul class="help">
20
+ <li><%= '*bold*'[:formatting_bold] %></li>
21
+ <li><%= '_italics_'[:formatting_italics] %></li>
22
+ <li><%= 'bq. <span>(quotes)</span>'[:formatting_blockquote] %></li>
23
+ <li>"IBM":http://www.ibm.com</li>
24
+ <li><%= '* or # <span>(lists)</span>'[:formatting_list] %></li>
25
+ </ul>
26
+
27
+ </td>
28
+ </tr>
29
+ <tr>
30
+ <td valign="bottom" style="padding-bottom:15px;">
31
+ <%= ajax_spinner_for "editbox", "spinner_black.gif" %>
32
+ <%= submit_tag 'Save Changes'[], :or => link_to_function('cancel'[], "EditForm.cancel()"), :tabindex => 2 %>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ <% end -%>
37
+ </div>
38
+ </div>
@@ -0,0 +1,14 @@
1
+ <h1><%= 'Edit Post' %></h1>
2
+
3
+ <h2><%= link_to h(@post.topic.title), forum_topic_path(@post.forum_id, @post.topic) %></h2>
4
+
5
+ <%= link_to('Delete post', post_path(:forum_id => @post.forum_id, :topic_id => @post.topic, :id => @post, :page => params[:page]),
6
+ :class => "utility", :method => :delete, :confirm => 'Delete this post forever?'[:delete_post_conf]) %>
7
+
8
+ <%= error_messages_for :topic %>
9
+ <% form_for :post, :html => { :method => :put },
10
+ :url => post_path(:forum_id => params[:forum_id], :topic_id => params[:topic_id], :id => @post, :page => params[:page]) do |f| -%>
11
+ <p id="post_body"><%= f.text_area :body %></p>
12
+
13
+ <%= submit_tag 'Save'[:save_title] %> or <%= link_to 'cancel', forum_topic_path(:forum_id => params[:forum_id], :topic_id => params[:topic_id], :page => params[:page]) %>
14
+ <% end -%>
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,17 @@
1
+ <p>
2
+ <label for="topic_title"><%= 'Title'[:title_title] %></label><br />
3
+ <%= form.text_field :title, :onchange => "/*TopicForm.editNewTitle(this);*/", :class => "primary", :tabindex => 10 %>
4
+
5
+ </p>
6
+ <% if @topic.new_record? %>
7
+ <p>
8
+ <label for="topic_body"><%= 'Body'[:body_title] %></label><br />
9
+ <%= form.text_area :body, :rows => 12, :tabindex => 20 %></p>
10
+ <% end %>
11
+
12
+ <% if !@topic.new_record? %>
13
+ <p id="topic_forum_id">
14
+ <label for="topic_forum_id"><%= 'Forum'[:forum_title] %></label><br />
15
+ <%= form.select :forum_id, Forum.find(:all, :order => "position").map {|x| [x.name, x.id] } %></p>
16
+ </p>
17
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <h1><%= 'Edit Topic'[] %></h1>
2
+
3
+ <%= error_messages_for :topic %>
4
+ <% form_for :topic,
5
+ :url => forum_topic_path(@forum, @topic),
6
+ :html => { :method => :put } do |f| -%>
7
+ <%= render :partial => "form", :object => f %>
8
+ <br />
9
+ <%= submit_tag 'Save Changes'[], :or => link_to('Cancel'[], forum_topic_path(@forum, @topic)) %>
10
+ <% end -%>
@@ -0,0 +1,2 @@
1
+ <h1>Post#index</h1>
2
+ <p>Find me in app/views/posts/index.rhtml</p>
@@ -0,0 +1,18 @@
1
+ <div class="crumbs" xstyle="margin-top:1.1em;">
2
+ <%= link_to 'Forums'[:forums_title], forums_path %> <span class="arrow">&rarr;</span>
3
+ <%= link_to h(@forum.name), forum_path(@forum) %> <span class="arrow">&rarr;</span>
4
+ </div>
5
+
6
+
7
+ <h1 id="new_topic"><%= 'New Topic'[] %></h1>
8
+ <p class="subtitle"><%= 'by {user}'[:by_user, current_user.display_name] %></p>
9
+
10
+ <%= error_messages_for :post %>
11
+ <%= error_messages_for :topic %>
12
+ <% form_for :topic, :url => forum_topics_path(@forum) do |f| -%>
13
+ <%= render :partial => "form", :object => f %>
14
+ <%= submit_tag 'Post Topic'[], :or => link_to('Cancel'[], forum_path(@forum)) %>
15
+ <% end -%>
16
+
17
+ <%= javascript_tag "$('topic_title').focus();" %>
18
+
@@ -0,0 +1,175 @@
1
+ <% @page_title = @topic.title %>
2
+ <% @monitoring = !current_user.nil? && !Monitorship.count(:id, :conditions => ['user_id = ? and topic_id = ? and active = ?', current_user.id, @topic.id, true]).zero? %>
3
+
4
+ <% content_for :right do -%>
5
+
6
+ <h5><%= 'Voices'[:voices_title] %></h5>
7
+ <ul class="flat talking">
8
+ <% @topic.voices.each do | user | %>
9
+ <li><%= link_to h(user.display_name), user_path(user) %></li>
10
+ <% end %>
11
+ </ul>
12
+
13
+
14
+ <% end # right content -%>
15
+
16
+ <% if !current_user.nil? %>
17
+ <% form_tag forum_topic_monitorship_path(@forum, @topic), :style => 'margin-top:0em; float:right;' do -%>
18
+ <div>
19
+ <input id="monitor_checkbox" type="checkbox" <%= "checked='checked'" if @monitoring %>
20
+ onclick="if (this.checked) {<%= remote_function :url => forum_topic_monitorship_path(@forum, @topic) %>} else {<%= remote_function :url => forum_topic_monitorship_path(@forum, @topic), :method => :delete %>}" />
21
+ <label id="monitor_label" for="monitor_checkbox"><%= @monitoring ? 'Monitoring topic'[] : 'Monitor topic'[] %></label>
22
+ <%= hidden_field_tag '_method', 'delete' if @monitoring %>
23
+ <%= submit_tag :Set, :id => 'monitor_submit' %>
24
+ </div>
25
+ <% end -%>
26
+
27
+ <% end -%>
28
+
29
+
30
+ <div class="crumbs">
31
+ <%= link_to "Forums"[:forums_title], forums_path %> <span class="arrow">&rarr;</span>
32
+ <%= link_to h(@topic.forum.name), forum_path(@topic.forum) %>
33
+ <%
34
+ page=session[:forum_page] ? session[:forum_page][@topic.forum.id] : nil
35
+ if page and page!=1 %>
36
+ <small style="color:#ccc">
37
+ (<%= link_to 'page {page}'[:page, page], forum_path(:id => @topic.forum, :page => page) %>)
38
+ </small>
39
+ <% end %>
40
+ <span class="arrow">&rarr;</span>
41
+ </div>
42
+
43
+ <h1 id="topic-title" style="margin-top:0.5em;"<%= %( onmouseover="$('topic_mod').show();" onmouseout="$('topic_mod').hide();") if !current_user.nil? %>>
44
+
45
+
46
+ <%= h @topic.title %>
47
+ <% if @topic.locked? %>
48
+ <span>(<%= 'locked'[] %>)</span>
49
+ <% end %>
50
+ <% if !current_user.nil? %>
51
+ <span style="display:none;" id="topic_mod">
52
+ <% if @topic.editable_by?(current_user) -%>
53
+ <%= link_to('edit'[], edit_forum_topic_path(@forum, @topic), :class => "utility") %> |
54
+ <%= link_to('delete'[], forum_topic_path(@forum, @topic), :class => "utility", :method => :delete, :confirm => 'Delete this topic forever?'[:delete_topic_conf]) %>
55
+ <% end -%>
56
+ </span>
57
+ <% end %>
58
+ </h1>
59
+
60
+ <p class="subtitle">
61
+ <%= feed_icon_tag @topic.title, forum_topic_path(@forum, @topic, :format => :rss) %>
62
+ <%= '{count} post(s)'[(count=@topic.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %>,
63
+ <%= '{count} voice(s)'[(count=@topic.voices.size)==1 ? :voice_count : :voices_count, number_with_delimiter(count)] %>
64
+ </p>
65
+
66
+ <%= will_paginate @posts %>
67
+
68
+ <a name="<%= dom_id @posts.first %>" id="<%= dom_id @posts.first %>">&nbsp;</a>
69
+
70
+ <table border="0" cellspacing="0" cellpadding="0" class="posts wide">
71
+ <% for post in @posts do %>
72
+ <% unless post == @posts.first %>
73
+ <tr class="spacer">
74
+ <td colspan="2">
75
+ <a name="<%= dom_id post %>" id="<%= dom_id post %>">&nbsp;</a>
76
+ </td>
77
+ </tr>
78
+ <% end %>
79
+ <tr class="post hentry" id="<%= dom_id post %>-row">
80
+ <td class="author vcard">
81
+ <div class="date">
82
+ <a href="#<%= dom_id post %>" rel="bookmark">
83
+ <abbr class="updated" title="<%= post.created_at.xmlschema %>">
84
+ <%= time_ago_in_words(post.created_at) %>
85
+ </abbr>
86
+ </a>
87
+ </div>
88
+
89
+ <%= avatar_for post.user %>
90
+ <span class="fn"><%= link_to truncate(h(post.user.display_name), 15), user_path(post.user), :class => (post.user == @posts.first.user ? "threadauthor" : nil) %></span>
91
+ <span class="posts"><%= '{count} post(s)'[(count=post.user.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %></span>
92
+
93
+
94
+ <% if !current_user.nil? && post.editable_by?(current_user) -%>
95
+ <p>
96
+ <span class="edit">
97
+ <%= ajax_spinner_for "edit-post-#{post.id}", "spinner_bounce.gif" %>
98
+ <%= link_to_remote('Edit post'[],
99
+ {:url => edit_post_path(:forum_id => @forum, :topic_id => @topic, :id => post), :method => :get,
100
+ :before => "EditForm.init(#{post.id});", :condition => "!EditForm.isEditing(#{post.id})" },
101
+ {:href => edit_post_path(:forum_id => @forum, :topic_id => @topic, :id => post, :page => params[:page]), :class => "utility"}) %>
102
+ </span>
103
+ </p>
104
+ <% end -%>
105
+
106
+
107
+ </td>
108
+ <td class="body entry-content" id="post-body-<%= post.id %>">
109
+ <!--
110
+ <%= link_to_function image_tag('clearbits/comment.gif', :class => 'icon reply'), "$('reply').toggle()" if !current_user.nil? %>
111
+ -->
112
+ <%= post.body_html %>
113
+ </td>
114
+ </tr>
115
+
116
+ <% end %>
117
+ </table>
118
+
119
+ <%= will_paginate @posts %>
120
+
121
+ <% if !current_user.nil? %>
122
+ <div id="edit"></div>
123
+ <% if @topic.locked? %>
124
+ <p>
125
+ <%= image_tag "savage_beast/clearbits/lock.gif", :class => "icon grey", :title => "Topic locked"[:topic_locked_title] %>
126
+ <label>
127
+ <%= 'This topic is locked'[:locked_topic] %>.</label>
128
+ </p>
129
+ <% else %>
130
+
131
+ <p><%= link_to_function 'Reply to topic'[], "ReplyForm.init()", :class => "utility" %></p>
132
+
133
+ <div id="reply" class="editbox">
134
+ <div class="container">
135
+ <%= content_tag 'p', h(flash[:bad_reply]), :class => 'notice' if flash[:bad_reply] %>
136
+ <% form_for :post, :url => posts_path(:forum_id => @forum, :topic_id => @topic, :page => @topic.last_page) do |f| -%>
137
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
138
+ <tr>
139
+ <td rowspan="2" width="70%">
140
+ <%= f.text_area :body, :rows => 8 %>
141
+ </td>
142
+ <td valign="top">
143
+
144
+
145
+ <h5><%= 'Formatting Help'[] %></h5>
146
+
147
+ <ul class="help">
148
+ <li><%= '*bold*'[:formatting_bold] %>
149
+ &nbsp; &nbsp; &nbsp;
150
+ <%= '_italics_'[:formatting_italics] %>
151
+ &nbsp; &nbsp; &nbsp;<br />
152
+ <%= 'bq. <span>(quotes)</span>'[:formatting_blockquote] %></li>
153
+ <li>"IBM":http://www.ibm.com</li>
154
+ <li><%= '* or # <span>(lists)</span>'[:formatting_list] %></li>
155
+ </ul>
156
+
157
+ </td>
158
+ </tr>
159
+ <tr>
160
+ <td valign="bottom" style="padding-bottom:15px;">
161
+ <%= submit_tag "Save Reply"[] %><span class="button_or">or <%= link_to_function 'cancel'[], "$('reply').hide()" %></span>
162
+ </td>
163
+ </tr>
164
+ </table>
165
+ <% end -%>
166
+ </div>
167
+ </div>
168
+ <%= javascript_tag "$('reply').hide();"%>
169
+ <% end %>
170
+ <% end %>
171
+
172
+ <div class="crumbs" style="margin-top:1.1em;">
173
+ <%= link_to "Forums"[:forums_title], forums_path %> <span class="arrow">&rarr;</span>
174
+ <%= link_to h(@topic.forum.name), forum_path(@topic.forum) %> <span class="arrow">&rarr;</span>
175
+ </div>