app/views/rostra/questions/index.html.erb in rostra-0.0.3 vs app/views/rostra/questions/index.html.erb in rostra-0.0.4

- old
+ new

@@ -9,32 +9,42 @@ <% 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 <%= question.user.name %> + Asked by <%= question.user.rostra_user_name %> <%= link_to 'edit', edit_question_path(question) if can? :manage, question %> </cite> <div class="text"> - <% if question.details.length > 250 %> - <%= simple_format( - truncate(question.details, length: 250) + - link_to("view more", question, class: "view_more") - ) %> - + <% if question.details.length > 500 %> + <%= strip_tags(truncate(question.details, length: 500)) + link_to("view more", question, class: "view_more") %> <% else %> - <%= simple_format(question.details) %> + <%= strip_tags(question.details) %> <% end %> </div> <div class="timestamp"><%= time_ago_in_words(question.updated_at) %> ago</div> - <div class="tags"> - Tags: - <% question.tags.each do |tag| %> - <%= link_to tag, "" %> - <% end %> - </div> + <%= tag_list(question) %> </div> <% end %> <% end %> </div><!-- questions -->