Sha256: a9ca49b95cde05d438e5c0efc0f2297b03543c0d527549d8278ef60ac247e340

Contents?: true

Size: 1.23 KB

Versions: 10

Compression:

Stored size: 1.23 KB

Contents

%h1 Listing all forums

- @categories.each do |category|
  %h2
    = category.name
    Category
  - if category.moderator?(mongoid_forums_user)
    %b You are a moderator of this category
  %table{:border => "1"}
    %tr
      %th
        Name
      %th
        Last post
      %th
        Topics
      %th
        Posts
      %th
        Unread topics
      %th
        Views

    - category.forums.asc(:position).each do |forum|
      %tr
        %td
          = link_to forum.name, forum
        %td
          - if forum.topics.select {|topic| can?(:read, topic) }.last
            - last_topic = forum.topics.select {|topic| can?(:read, topic) }.last
            - last_post = last_topic.posts.last
            = time_ago_in_words ( last_post.created_at )
            ago on
            = link_to last_post.topic.name, last_post.topic
            by
            = last_post.user.forum_display_name
          - else
            No posts yet
        %td
          = topics_count(forum) ? topics_count(forum) : "None"
        %td
          = posts_count(forum) ? posts_count(forum) : "None"
        %td
          = mongoid_forums_user ? forum.unread_topic_count(mongoid_forums_user) : ""
        %td
          = forum.views_count ? forum.views_count : "None"

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
mongoid-forums-1.0.6 app/views/mongoid_forums/forums/index.haml
ack-mongoid-forums-1.0.5 app/views/mongoid_forums/forums/index.haml
mongoid-forums-1.0.4 app/views/mongoid_forums/forums/index.haml
mongoid-forums-1.0.3 app/views/mongoid_forums/forums/index.haml
mongoid-forums-1.0.2 app/views/mongoid_forums/forums/index.haml
mongoid-forums-1.0.1 app/views/mongoid_forums/forums/index.haml
mongoid-forums-1.0.0 app/views/mongoid_forums/forums/index.haml
mongoid-forums-0.0.11 app/views/mongoid_forums/forums/index.haml
mongoid-forums-0.0.10 app/views/mongoid_forums/forums/index.haml
mongoid-forums-0.0.9 app/views/mongoid_forums/forums/index.haml