updated readme
This commit is contained in:
36
app/views/topics/_form.html.erb
Normal file
36
app/views/topics/_form.html.erb
Normal file
@@ -0,0 +1,36 @@
|
||||
<%= form_for [@forum, @topic] do |f| %>
|
||||
<% if @topic.errors.any? %>
|
||||
<% flash.now[:error] = @topic.errors.full_messages.join(', and ') %>
|
||||
<% end %>
|
||||
<div class="module">
|
||||
<div class="module_header"><%= action_name.humanize %> Topic</div>
|
||||
<div class="module_subheader smaller"></div>
|
||||
<div class="module_body">
|
||||
<div class="fieldset">
|
||||
<span class="label indent smaller">
|
||||
<%= f.label :title %><br />
|
||||
<small>(Required)</small>
|
||||
</span>
|
||||
<span class="input indent smaller"><%= f.text_field :title, :size => 75 %></span>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<% unless @topic.id %>
|
||||
<div class="fieldset">
|
||||
<span class="label indent smaller">
|
||||
<%= f.label :body %><br />
|
||||
<small>(Required)</small>
|
||||
</span>
|
||||
<span class="input indent smaller"><%= f.text_area :body, :cols => 60, :rows => 15 %></span>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="module_footer">
|
||||
<div class="fieldset">
|
||||
<span class="input"><%= f.submit "submit" %> or <%= link_to "cancel", @topic.nil? ? @topic : @forum %></span>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
1
app/views/topics/edit.html.erb
Normal file
1
app/views/topics/edit.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= render :partial => 'form' %>
|
||||
1
app/views/topics/new.html.erb
Normal file
1
app/views/topics/new.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= render :partial => 'form' %>
|
||||
44
app/views/topics/show.html.erb
Normal file
44
app/views/topics/show.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<div class="right controls"><%= link_to "Back to Forum", forum_path(@topic.forum) %></div>
|
||||
<div class="module">
|
||||
<div class="module_header">
|
||||
<%= @topic.title %>
|
||||
<span class="right controls">
|
||||
<%= link_to "Edit", edit_topic_path(@topic) if can? :manage, @topic %>
|
||||
<%= link_to "Delete", @topic, :confirm => "Are you sure?", :method => :delete if can? :manage, @topic %>
|
||||
<%= link_to @topic.sticky ? "Unstick" : "Sticky", {:controller => 'topics', :action => 'update', :topic => {:sticky => @topic.sticky ? "false" : "true" }}, :method => :put if can? :moderate, @topic %>
|
||||
<%= link_to @topic.locked ? "Unlock" : "Lock", {:controller => 'topics', :action => 'update', :topic => {:locked => @topic.locked ? "false" : "true" }}, :method => :put if can? :moderate, @topic %>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<% @topic.posts.each do |post| %>
|
||||
<tr>
|
||||
<td class="post_author" rowspan="2">
|
||||
<span class="name"><%= post.user.username %></span>
|
||||
<span class="avatar"><%= image_tag post.user.gravatar_url %></span>
|
||||
<span class="info smaller">
|
||||
<p><strong><%= "Administrator" if post.user.admin? %></strong></p>
|
||||
Posts <%= post.user.posts.size %><br />
|
||||
Registered <%= post.user.created_at.to_s(:joined) %><br />
|
||||
</span>
|
||||
</td>
|
||||
<td class="post_header">
|
||||
<span class="left post_date smaller">Posted <%= post.created_at %></span>
|
||||
<span class="right controls">
|
||||
<%= link_to "Reply", new_topic_post_path(@topic) if can? :create, Topic %>
|
||||
<%= link_to "Quote", new_topic_post_path(@topic, :quote => post) if can? :create, Topic %>
|
||||
<%= link_to "Edit", edit_post_path(post) if can? :update, post %>
|
||||
<%= link_to "Delete", post, :confirm => "Are you sure?", :method => :delete if can? :destroy, post %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="post_body">
|
||||
<%= post.body.bbcode_to_html().html_safe %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right controls"><p><%= link_to "Back to Forum", forum_path(@topic.forum) %></p></div>
|
||||
Reference in New Issue
Block a user