LOTS of stuff

This commit is contained in:
jomo
2014-04-04 01:08:17 +02:00
parent 0604bbce63
commit f290258f26
62 changed files with 1457 additions and 655 deletions

View File

@@ -1,17 +1,22 @@
<%= link_to @forum.group, forumgroup_path(@forum.group) %> → <%= link_to @forum, @forum %> → New thread
<h1>New thread</h1>
<%= simple_form_for [@forum, @thread] do |f|%>
<% if mod? %>
<%= f.label :sticky %> <%= f.input :sticky %>
<%= f.label :locked %> <%= f.input :locked %>
<% end %>
<div id="form_labels">
<%= f.label :title %>
</div>
<%= form_for [@forum, @thread] do |f|%>
<table>
<% if mod? %>
<tr>
<td><%= f.label :sticky %></td>
<td><%= f.check_box :sticky %></td>
</tr>
<tr>
<td><%= f.label :locked %></td>
<td><%= f.check_box :locked %></td>
</tr>
<% end %>
</table>
<div id="form_inputs">
<%= f.input :title, placeholder: "Title" %>
<%= f.text_field :title, placeholder: "Title" %>
</div>
<%= f.hidden_field :content, id: "epic-textarea", placeholder: "Text" %>
<div id="epic"></div>
<%= f.submit "Create thread", class: "btn blue" %><br>
<p><%= f.submit "Create thread", class: "btn blue" %></p>
<% end %>

View File

@@ -1,16 +1,29 @@
<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → <%= link_to @thread %>
<div class="post">
<div class="thread-title">
<h1><%= @thread.title %></h1>
<div>
<%= params.inspect %><br>
<%= @forum.inspect %><br>
<%= @thread.forum.inspect %>
</div>
<div class="item-group thread with-avatar" id="thread-<%= @thread.id %>">
<%= link_to(image_tag(@thread.author.avatar_url(64), class: "avatar"), @thread.author, title: @thread.author.ign) %>
<div class="header">
<%= render partial: "users/username", locals: { user: @thread.author } %> <time><%= link_to @thread.created_at.strftime("%e. %b %Y, %H:%m"), p %></time>
<%= link_to "edit", edit_forumthread_path( @thread), class: "editlink" if mod? %>
</div>
<div class="thread-info"><%= link_user @thread.author %> on <%= @thread.created_at.strftime("%e. %b %Y") %>
<% if mod? %>
<%= link_to "edit", edit_forum_forumthread_path(@thread.forum, @thread), class: "thread-edit" %>
<% end %>
</div>
<div class="thread-content">
<%= Sanitize.clean(GitHub::Markdown.render_gfm(@thread.content), Sanitize::Config::RELAXED).html_safe %>
<div class="items">
<div class="item content">
<h2 class="headline"><%= link_to truncate(@thread.title, length: 60, omission: " …"), p %></h2>
<%= Sanitize.clean(GitHub::Markdown.render_gfm(@thread.content), Sanitize::Config::RELAXED).html_safe %>
</div>
</div>
</div>
<hr>
(replies go here)
<div id="replies">
<h3><%= "#{pluralize(@thread.replies.length, 'reply')}." %></h3>
<% @thread.replies.each do |c| %>
Reply<%# render "threadreplies/reply", :c => c %>
<% end %>
<% unless @thread.can_read?(current_user) %>
new
<%# render "threadreplies/new" %>
<% end %>
</div>