Sha256: 375623dcc5ac1a91cfb01fb22ac2c6b249b3fd3ca51c9b4cdfa5071a53466327

Contents?: true

Size: 1.89 KB

Versions: 2

Compression:

Stored size: 1.89 KB

Contents

<%= render 'rostra/shared/sidebar' %>

<div id="page_content">
    <div id="questions">
      <% if @questions.empty? %>
        <h3>No questions have been asked.</h3>

      <% else %>

        <% @questions.each do |question| %>
          <div class="question">

            <div class="stats">
              <div class="vote_count">
                <span class="count"><%= question.plusminus %></span>
                <span class="type"><%= question.plusminus.abs == 1 ? 'vote' : 'votes' %></span>
              </div>
              <div class="answer_count">
                <span class="count"><%= question.answer_count %></span>
                <span class="type"><%= question.answer_count.abs == 1 ? 'answer' : 'answers' %></span>
              </div>
              <div class="views_count">
                <span class="count"><%= question.unique_page_views %></span>
                <span class="type"><%= question.unique_page_views.abs == 1 ? 'view' : 'views' %></span>
              </div>
            </div>

            <%= image_tag avatar_url(question.user), class: 'avatar' %>

            <h3 class="title"><%= link_to question.title, question %></h3>
            <cite>
              Asked by <%= link_to_profile(question.user) %>
              <%= link_to 'edit', edit_question_path(question) if can? :manage, question %>
            </cite>
            <div class="text">
              <% if question.details.length > 500 %>
                <%= strip_tags(truncate(question.details, length: 500)) + link_to("view more", question, class: "view_more") %>
              <% else %>
                <%= strip_tags(question.details) %>
              <% end %>
            </div>
            <div class="timestamp"><%= time_ago_in_words(question.updated_at) %> ago</div>
            <%= tag_list(question) %>
          </div>
        <% end %>

      <% end %>
    </div><!-- questions -->


</div><!--page_content-->

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rostra-0.0.12 app/views/rostra/questions/index.html.erb
rostra-0.0.11 app/views/rostra/questions/index.html.erb