features, bug fixes

This commit is contained in:
jomo
2014-02-03 01:47:49 +01:00
parent 0d06bc19fc
commit 0604bbce63
18 changed files with 156 additions and 71 deletions
+4 -5
View File
@@ -2,9 +2,8 @@
<p id="markdown-note">Note: You can use <%= link_to "Markdown", "https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet", target: "_blank" %>!</p>
<%= simple_form_for @post do |f|%>
<%= f.input :title, :label => false %>
<%= f.input :content, :label => false, input_html: {class: "full-width vertical"} %>
<%= f.submit "Update Post", :id => "edit_create_post", class: "btn blue" %>
<%= f.hidden_field :content, id: "epic-textarea", :label => false, input_html: {class: "full-width vertical"} %>
<div id="epic"></div>
<%= f.submit "Update Post", class: "btn blue left" %>
<% end %>
<div id="delete_post">
<%= button_to "Delete post", @post, :method => "delete", :confirm => "Delete post & comments forever?", class: "btn red right" %>
</div>
<%= button_to "Delete post", @post, :method => "delete", :confirm => "Delete post & comments forever?", class: "btn red right" %>
+3 -2
View File
@@ -2,6 +2,7 @@
<p id="markdown-note">Note: You can use <%= link_to "Markdown", "https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet", target: "_blank" %>!</p>
<%= simple_form_for @post do |f|%>
<%= f.input :title, placeholder: "Title" %>
<%= f.input :content, placeholder: "Text", input_html: {class: "full-width vertical"} %>
<%= f.submit "Create Post", id: "edit_create_post", class: "btn blue" %>
<%= f.hidden_field :content, id: "epic-textarea", placeholder: "Text", input_html: {class: "full-width vertical"} %>
<div id="epic"></div>
<%= f.submit "Create Post", class: "btn blue left" %>
<% end %>
+3 -5
View File
@@ -1,9 +1,7 @@
<h1>Edit comment</h1>
<%= simple_form_for [@comment.blogpost, @comment] do |f| %>
<%= f.input :content, :label => false, :as => "text", :placeholder => "Comment" %>
<%= f.submit "Update Comment", :id => "edit_create_comment", class: "btn blue" %>
<%= f.input :content, label: false, as: "text", placeholder: "Comment" %>
<%= f.submit "Update Comment", class: "btn blue left" %>
<% end %>
<div id="delete_comment">
<%= button_to "Delete comment", [@comment.blogpost, @comment] , :method => "delete", :confirm => "Delete comment forever?", class: "btn red right" %>
</div>
<%= button_to "Delete comment", [@comment.blogpost, @comment] , method: "delete", confirm: "Delete comment forever?", class: "btn red right" %>
+3 -3
View File
@@ -1,14 +1,14 @@
<div id="forum_groups">
<% @groups.each do |group| %>
<div class="group" id="forums-<%= group.id %>">
<div class="item_group" id="forums-<%= group.id %>">
<div class="header">
<%= group.name %>
<%= link_to "edit", edit_forumgroup_path(group), class: "editlink" if admin? %>
</div>
<div class="forums">
<div class="items">
<% group.forums.each do |f| %>
<%= link_to f.name, f, class: "forum" %>
<%= link_to f.name, f, class: "item" %>
<% end %>
</div>
+4 -7
View File
@@ -3,15 +3,12 @@
<p><%= link_to "New thread", new_forum_forumthread_path(@forum), class: "btn blue" %></p>
<div id="forum_groups">
<div id="forum-<%= @forum.id %>" class="group">
<div id="forum-<%= @forum.id %>" class="item_group">
<div class="header">
<%= @forum.name %> <%= link_to "edit", edit_forum_path(@forum), class: "editlink" %>
</div>
<div class="forums">
<% @threads.select{ |t| t.sticky }.each do |thread| %>
<%= link_to thread.title, forum_forumthread_path(@forum, thread), class: "forum sticky" %>
<% end %>
<% @threads.reject{ |t| t.sticky }.each do |thread| %>
<%= link_to thread.title, forum_forumthread_path(@forum, thread), class: "forum" %>
<div class="items">
<% @threads.each do |thread| %>
<%= link_to thread.title, forum_forumthread_path(@forum, thread), class: "item#{" locked" if thread.locked}#{" sticky" if thread.sticky}" %>
<% end %>
</div>
+9
View File
@@ -0,0 +1,9 @@
<h1>Edit thread</h1>
<p id="markdown-note">Note: You can use <%= link_to "Markdown", "https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet", target: "_blank" %>!</p>
<%= simple_form_for [@thread.forum, @thread] do |f|%>
<%= f.input :title, label: false %>
<%= f.hidden_field :content, id: "epic-textarea", label: false, input_html: {class: "full-width vertical"} %>
<div id="epic"></div>
<%= f.submit "Update thread", class: "btn blue left" %>
<% end %>
<%= button_to "Delete thread", [@thread.forum, @thread], :method => "delete", :confirm => "Delete thread & comments forever?", class: "btn red right" %>
+7 -7
View File
@@ -1,17 +1,17 @@
<%= 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 %>
<%= f.label :content, "Text" %>
</div>
<div id="form_inputs">
<%= f.input :title, placeholder: "Title" %>
<%= f.input :content, placeholder: "Text" %>
</div>
<% if mod? %>
<%= f.input :sticky %> <%= f.label :sticky %>
<%= f.input :locked %> <%= f.label :locked %>
<% end %>
<%= f.submit "Create forum", class: "btn blue" %><br>
<%= f.hidden_field :content, id: "epic-textarea", placeholder: "Text" %>
<div id="epic"></div>
<%= f.submit "Create thread", class: "btn blue" %><br>
<% end %>
+16
View File
@@ -0,0 +1,16 @@
<%= 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>
<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>
</div>
<hr>
(replies go here)