rails 4 and tons of stuff
This commit is contained in:
@@ -2,7 +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, :label => false %>
|
||||
<%= f.hidden_field :content, :label => false, input_html: {class: "full-width vertical"} %>
|
||||
<%= f.submit "Update Post", class: "btn blue left" %>
|
||||
<%= f.text_area :content, :label => false, input_html: {class: "full-width vertical"} %>
|
||||
<p><%= f.submit "Update Post", class: "btn blue left" %></p>
|
||||
<% end %>
|
||||
<%= button_to "Delete post", @post, :method => "delete", :confirm => "Delete post & comments forever?", class: "btn red right" %>
|
||||
<p><%= button_to "Delete post", @post, :method => "delete", :confirm => "Delete post & comments forever?", class: "btn red right" %></p>
|
||||
@@ -11,7 +11,7 @@ atom_feed do |feed|
|
||||
end
|
||||
entry.url blogpost_url(post)
|
||||
entry.title post.title
|
||||
entry.content Sanitize.clean(GitHub::Markdown.render_gfm(post.content), Sanitize::Config::RELAXED).html_safe, :type => 'html'
|
||||
entry.content Sanitize.clean(render_md(post.content), Sanitize::Config::RELAXED).html_safe, :type => 'html'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,3 +1,4 @@
|
||||
<h1>News</h1>
|
||||
<%= link_to 'Make new Post', new_blogpost_path, class: "btn blue" if mod? %>
|
||||
<div id="posts">
|
||||
<% @posts.each do |p| %>
|
||||
@@ -12,7 +13,7 @@
|
||||
<div class="items">
|
||||
<div class="item content post">
|
||||
<h2 class="headline"><%= link_to truncate(p.title, length: 60, omission: " …"), p %></h2>
|
||||
<%= Sanitize.clean(GitHub::Markdown.render_gfm(p.content), Sanitize::Config::RELAXED).html_safe %>
|
||||
<%= Sanitize.clean(render_md(p.content), Sanitize::Config::RELAXED).html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<h1>New Post</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 @post do |f|%>
|
||||
<%= f.input :title, placeholder: "Title" %>
|
||||
<%= f.hidden_field :content, placeholder: "Text", input_html: {class: "full-width vertical"} %>
|
||||
<%= f.submit "Create Post", class: "btn blue left" %>
|
||||
<p id="markdown-note">Note: You can use <%= link_to "Markdown", "https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet", target: "_blank" %>!</p>
|
||||
<%= f.text_area :content, placeholder: "Text", input_html: {class: "full-width vertical"} %>
|
||||
<p><%= f.submit "Create Post", class: "btn blue left" %></p>
|
||||
<% end %>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<%= link_to "News", blogposts_path %> → <%= link_to @post.title %>
|
||||
<div class="item-group post with-avatar" id="post-<%= @post.id %>">
|
||||
<%= link_to(image_tag(@post.author.avatar_url(64), class: "avatar"), @post.author, title: @post.author.ign) %>
|
||||
<div class="header">
|
||||
@@ -7,14 +8,14 @@
|
||||
<div class="items">
|
||||
<div class="item content">
|
||||
<h2 class="headline"><%= link_to truncate(@post.title, length: 60, omission: " …"), p %></h2>
|
||||
<%= Sanitize.clean(GitHub::Markdown.render_gfm(@post.content), Sanitize::Config::RELAXED).html_safe %>
|
||||
<%= Sanitize.clean(render_md(@post.content), Sanitize::Config::RELAXED).html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="comments">
|
||||
<h3><%= "#{pluralize(@post.comments.length, 'comment')}." %></h3>
|
||||
<% @post.comments.each do |c| %>
|
||||
<%= render "comments/comment", :c => c %>
|
||||
<%= render "comments/comment", c: c %>
|
||||
<% end %>
|
||||
<%= render "comments/new" %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user