diff --git a/app/assets/stylesheets/style.css.scss b/app/assets/stylesheets/style.css.scss index 69406a9..a76c73e 100644 --- a/app/assets/stylesheets/style.css.scss +++ b/app/assets/stylesheets/style.css.scss @@ -690,6 +690,10 @@ tr.spacer { } overflow-x: auto; } + + .item-info { + float: right; + } } } } diff --git a/app/models/forum.rb b/app/models/forum.rb index 3d22689..310200f 100644 --- a/app/models/forum.rb +++ b/app/models/forum.rb @@ -12,6 +12,10 @@ class Forum < ActiveRecord::Base forumgroup end + def threads + forumthreads + end + def can_read?(user) group.can_read?(user) && (role_read.nil? || (!user.nil? && user.role >= role_read)) end diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 7add871..9c63242 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -10,7 +10,17 @@
<% group.forums.sort_by{ |f| f.position || 0 }.each do |f| %> <% if f.can_read?(current_user) %> - <%= link_to f.name, f, id: "forum-#{f.id}", class: "item" %> +
+ <%= link_to f.name, f, id: "forum-#{f.id}"%> +
+ <% if trd = f.threads.last %> + <%= trd.author.name %> <%= link_to "posted", forumthread_path(f) %> . + <% else %> + No replies yet. + <% end %> +
+
+
<% end %> <% end %>
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 6a3a232..75426fe 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -16,7 +16,17 @@
- <%= link_to thread.title, forumthread_path(thread), class: "item #{"locked" if thread.locked}#{"sticky" if thread.sticky}" %> +
+ <%= link_to thread.title, forumthread_path(thread), class: "#{"locked" if thread.locked}#{"sticky" if thread.sticky}" %> +
+ <% if rpl = thread.replies.last %> + <%= rpl.author.name %> <%= link_to "replied", forumthread_path(thread) + "#reply-#{rpl.id}" %> . + <% else %> + No replies yet. + <% end %> +
+
+
<% end %>