From 5a77a3a681d0b9de93e20236dd6d816363fffcce Mon Sep 17 00:00:00 2001 From: Mike Kelley Date: Sat, 27 Aug 2011 12:56:36 -0600 Subject: [PATCH] fixed date formatting --- Gemfile.lock | 7 +++++-- app/models/ability.rb | 6 +++--- app/views/categories/index.html.erb | 2 +- app/views/forums/show.html.erb | 6 +++--- app/views/topics/show.html.erb | 8 ++++---- config/locales/en.yml | 3 ++- public/images/black_stripe.png | Bin 0 -> 122 bytes public/images/white_stripe.png | Bin 0 -> 122 bytes public/stylesheets/application.css | 4 ++-- 9 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 public/images/black_stripe.png create mode 100644 public/images/white_stripe.png diff --git a/Gemfile.lock b/Gemfile.lock index ccd9b22..1ef06c3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,13 +43,13 @@ GEM gravtastic (3.2.0) hirb (0.5.0) i18n (0.5.0) + kgio (2.4.1) mail (2.2.19) activesupport (>= 2.3.6) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.16) - nifty-generators (0.4.6) orm_adapter (0.0.5) polyglot (0.3.2) rack (1.2.3) @@ -79,6 +79,9 @@ GEM polyglot polyglot (>= 0.3.1) tzinfo (0.3.29) + unicorn (3.6.2) + kgio (~> 2.3) + rack warden (1.0.5) rack (>= 1.0) @@ -92,6 +95,6 @@ DEPENDENCIES forum_monster (~> 1.1) gravtastic hirb - nifty-generators rails (= 3.0.9) sqlite3 + unicorn diff --git a/app/models/ability.rb b/app/models/ability.rb index 6964aaa..f46c382 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -11,10 +11,10 @@ class Ability can :read, Topic, :forum => { :state => true, :category => { :state => true } } can :read, Post, :topic => { :forum => { :state => true, :category => { :state => true } } } - can :update, Post, :user_id => user.id - can :destroy, [Topic,Post], :user_id => user.id + can :update, Post, :user_id => user.id, :topic => { :locked => false } + can :destroy, [Topic,Post], :user_id => user.id, :topic => { :locked => false } - can :create, Post unless user.new_record? + can :create, Post, :topic => { :locked => false } unless user.new_record? can :create, Topic unless user.new_record? end end diff --git a/app/views/categories/index.html.erb b/app/views/categories/index.html.erb index 53467cc..fdad186 100644 --- a/app/views/categories/index.html.erb +++ b/app/views/categories/index.html.erb @@ -30,7 +30,7 @@ <%= forum.posts.size - forum.topics.size %> <% if forum.posts.size > 0 %> - <%= forum.posts.last.created_at %>
+ <%=l forum.posts.last.created_at %>
<%= forum.posts.last.user.username %> <% else %> No Topics / Posts diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index ff4ea60..273de77 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -1,4 +1,4 @@ -
<%= link_to "Back to Forum List", forums_path if can? :create, Forum %>
+
<%= link_to "Back to Forum List", forums_path %>
<%= @forum.title %> @@ -37,7 +37,7 @@ <%= topic.posts.size - 1 %> <%= topic.hits %> - <%= topic.posts.last.created_at %>
+ <%=l topic.posts.last.created_at %>
by <%= topic.posts.last.user.username %> @@ -45,4 +45,4 @@
-

<%= link_to "Back to Forum List", forums_path if can? :create, Forum %>

+

<%= link_to "Back to Forum List", forums_path %>

diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index 9be3891..d83612d 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -19,14 +19,14 @@

<%= "Administrator" if post.user.admin? %>

Posts <%= post.user.posts.size %>
- Registered <%= post.user.created_at.to_s(:joined) %>
+ Registered <%=l post.user.created_at, :format => :joined %>
- Posted <%= post.created_at %> + Posted <%=l post.created_at %> - <%= 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 "Reply", new_topic_post_path(@topic) if can? :create, @topic.posts.new %> + <%= link_to "Quote", new_topic_post_path(@topic, :quote => post) if can? :create, @topic.posts.new %> <%= 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 %> diff --git a/config/locales/en.yml b/config/locales/en.yml index abde557..c22af57 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -4,4 +4,5 @@ en: time: formats: - default: "%B %d, %Y" \ No newline at end of file + default: "%B %d, %Y @ %I:%M %p" + joined: "%B %d, %Y" \ No newline at end of file diff --git a/public/images/black_stripe.png b/public/images/black_stripe.png new file mode 100644 index 0000000000000000000000000000000000000000..bd766717ed41699138afbd42aadfd9202d683e2b GIT binary patch literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^tRT$73?%Cvt*-$o=>VS)S0*MVDJiMD@8sYJ$d!|m zQ&v{?75(r5s7%V!#W93qX0k_qLc)p!kA#c_?Suq|q8nNg3_6x9((jKLfNWv#boFyt I=akR{0HSXnWB>pF literal 0 HcmV?d00001 diff --git a/public/images/white_stripe.png b/public/images/white_stripe.png new file mode 100644 index 0000000000000000000000000000000000000000..bd766717ed41699138afbd42aadfd9202d683e2b GIT binary patch literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^tRT$73?%Cvt*-$o=>VS)S0*MVDJiMD@8sYJ$d!|m zQ&v{?75(r5s7%V!#W93qX0k_qLc)p!kA#c_?Suq|q8nNg3_6x9((jKLfNWv#boFyt I=akR{0HSXnWB>pF literal 0 HcmV?d00001 diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 92eac54..d399afd 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -39,7 +39,7 @@ table a { font-weight:bold; } #header #menu_wrapper { width:100%; - background:url('http://www.stripemania.com/cache/3-2-45-1-020202-1-1A1A1A-DDEE1E-DDEE1E-DDEE1E-DDEE1E-272727-78D316-78D316-78D316-78D316-yes-yes-yes-yes-yes-.png'); + background:url('/images/black_stripe.png'); } #header #menu_wrapper ul { @@ -66,7 +66,7 @@ table a { font-weight:bold; } } .module_header { - background:url('http://www.stripemania.com/cache/3-2-45-1-020202-1-1A1A1A-DDEE1E-DDEE1E-DDEE1E-DDEE1E-272727-78D316-78D316-78D316-78D316-yes-yes-yes-yes-yes-.png') !important; + background:url('/images/white_stripe.png') !important; } #info_box {