Permalink
Browse files

added draft indications to dashboard.

  • Loading branch information...
1 parent 3c0d636 commit 5c79cc3d338c4e68c63f3dac2f96a0a9d67c70e3 @rishighan committed Apr 19, 2012
@@ -91,7 +91,8 @@ def update
format.html { redirect_to admin_posts_url, :notice => 'Draft was successfully updated.' }
format.json { head :ok }
when 'Update Post'
- @post.replace_with_draft!
+ #@post.replace_with_draft!
+ @post.update_attributes(params[:post])
@post.destroy_draft!
format.html { redirect_to admin_posts_url, :notice => 'Post was successfully published.' }
format.json { head :ok }
@@ -3,10 +3,13 @@
<hr>
<div class="row">
-<span class="span6">
+<span class="span7">
<h3>Recent Activity</h3>
<% unless @posts.empty? %>
<% @posts.each do |post| %>
+ <% if post.has_draft? %>
+ <span class="label label-warning">DRAFT</span>
+ <%end%>
<%= post.title %> published at <%= post.created_at.to_s(:short) %><br/>
<%end%>
<% @orders.each do |order| %>
@@ -19,15 +19,18 @@
<h2><%= post.title %></h2>
<% if post.has_draft? %>
- <span class="label label-warning"> DRAFT</span>
+ <p><span class="label label-warning"> DRAFT</span></p>
<%end %>
+ <p>
filed under:
<% post.categories.each do |cat| %>
- <%= cat.category_name %><br>
+ <%= post.categories.map{|cat| cat.category_name}.to_sentence(:last_word_connector=>", and ") %><br>
<% end -%>
- <p>
- <%= post.content %>
+ </p>
+
+ <p>
+ <%= post.content %>
</p>
<%unless post.attachments.empty? %>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5c79cc3

Please sign in to comment.