Commit a759062a authored by Zack Siri's avatar Zack Siri

Clean up the ux part 1

parent 927da6c7
......@@ -54,9 +54,10 @@ GEM
bindex (0.5.0)
bootsnap (1.3.1)
msgpack (~> 1.0)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap (4.1.3)
autoprefixer-rails (>= 6.0.3)
popper_js (>= 1.12.9, < 2)
sass (>= 3.5.2)
builder (3.2.3)
byebug (10.0.2)
capybara (3.7.1)
......@@ -139,6 +140,7 @@ GEM
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
pg (0.21.0)
popper_js (1.14.3)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
......@@ -242,7 +244,7 @@ PLATFORMS
DEPENDENCIES
bcrypt (~> 3.1.7)
bootsnap (>= 1.1.0)
bootstrap-sass
bootstrap (~> 4.1.3)
byebug
capybara (>= 2.15)
chromedriver-helper
......
@import "bootstrap-sprockets"
@import "bootstrap"
@import "bootstrap-grid"
@import "admin/base"
@import "admin/posts/index"
body.admin.posts.index
div.post_card
border: none
\ No newline at end of file
@import "bootstrap-sprockets"
@import "bootstrap"
@import "bootstrap-grid"
@import "posts"
div.post
border-bottom: 1px solid #eee
\ No newline at end of file
div.post_card
border: none
\ No newline at end of file
......@@ -9,7 +9,8 @@ class CommentsController < ApplicationController
# error handling
end
end
private
private
def comment_params
params.require(:comment).permit(:body)
......
class ApplicationJob < ActiveJob::Base
end
\ No newline at end of file
end
<%= div_for post do %>
<div class='row'>
<div class='col-md-8'>
<h2><%= link_to post.title, admin_post_path(post) %></h2>
<p><%= post.body %></p>
<p>Comments(<%= post.comments_count %>)</p>
<ul>
<% post.tags.each do |tag| %>
<li><%= tag.name %></li>
<% end %>
</ul>
</div>
<div class='col-md-3'>
<%= link_to "Edit", edit_admin_post_path(post), class: 'btn btn-primary' %>
<%= link_to "Delete", admin_post_path(post), method: :delete, class: 'btn btn-danger' %>
<%= post.status %>
</div>
<%= div_for post, class: 'card post_card shadow mt-5 mb-5' do %>
<div class='card-body'>
<h2 class='card-title'>
<%= link_to post.title, admin_post_path(post) %>
<span class='badge badge-secondary'><%= post.status %></span>
</h2>
<p class='card-text'><%= post.body %></p>
<p class='card-text'>Comments(<%= post.comments_count %>)</p>
<ul>
<% post.tags.each do |tag| %>
<li><%= tag.name %></li>
<% end %>
</ul>
<%= link_to "Edit", edit_admin_post_path(post), class: 'btn btn-primary' %>
</div>
<% end %>
<nav class="navbar navbar-default navbar-static-top">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<div class='row'>
<div class='col-md-8 col-md-offset-2'>
<div class="navbar-header">
<%= link_to 'Writefully', root_path, class: 'navbar-brand' %>
</div>
<ul class='nav navbar-nav navbar-right'>
<%= render_user_auth_nav %>
</ul>
</div>
</div>
<%= link_to 'Writefully', root_path, class: 'navbar-brand' %>
<ul class='navbar-nav'>
<%= render_user_auth_nav %>
</ul>
</div>
</nav>
\ No newline at end of file
<li>
<%= link_to current_user.email, '#' %>
<li class='nav-item'>
<%= link_to current_user.email, '#', class: 'nav-link' %>
</li>
<li>
<%= link_to 'Sign out', logout_path, method: :delete %>
<li class='nav-item'>
<%= link_to 'Sign out', logout_path, method: :delete, class: 'nav-link' %>
</li>
\ No newline at end of file
<li><%= link_to 'Sign in', login_path %></li>
<li><%= link_to 'Sign up', register_path %></li>
\ No newline at end of file
<li class='nav-item'>
<%= link_to 'Sign in', login_path, class: 'nav-link' %>
</li>
<li class='nav-item'>
<%= link_to 'Sign up', register_path, class: 'nav-link' %>
</li>
\ No newline at end of file
......@@ -10,12 +10,8 @@
<%= render 'navbar' %>
<%= yield :action_bar %>
<div id='main' class='container'>
<div class='row'>
<div class='col-md-8 col-md-offset-2'>
<%= render 'flash_messages' %>
<%= yield %>
</div>
</div>
<%= render 'flash_messages' %>
<%= yield %>
</div>
</body>
</html>
......@@ -10,12 +10,8 @@
<body>
<%= render 'navbar' %>
<div id='main' class='container'>
<div class='row'>
<div class='col-md-8 col-md-offset-2'>
<%= render 'flash_messages' %>
<%= yield %>
</div>
</div>
<%= render 'flash_messages' %>
<%= yield %>
</div>
</body>
</html>
<%= div_for post do %>
<h2><%= link_to post.title, post_path(post) %></h2>
<p><%= time_ago_in_words(post.published_at) %> ago</p>
<p><%= post.body %></p>
<p>Comments(<%= post.comments_count %>)</p>
<ul>
<% post.tags.each do |tag| %>
<li><%= tag.name %></li>
<% end %>
</ul>
<%= div_for post, class: 'card post_card shadow-lg mt-5 mb-5' do %>
<div class='card-body'>
<h2 class='card-title'>
<%= link_to post.title, post_path(post) %>
</h2>
<p><%= post.body %></p>
<p>Comments(<%= post.comments_count %>)</p>
<ul>
<% post.tags.each do |tag| %>
<li><%= tag.name %></li>
<% end %>
</ul>
<p class='card-text'>
<small class='text-muted'><%= time_ago_in_words(post.published_at) %> ago</small>
</p>
</div>
<% end %>
\ No newline at end of file
<h1><%= @post.title %></h1>
<div class='mt-5 mb-5'>
<h1><%= @post.title %></h1>
<% if @post.cover_picture.attached? %>
<%= image_tag @post.cover_picture.variant(resize: '750x750') %>
<% end %>
<% if @post.cover_picture.attached? %>
<%= image_tag @post.cover_picture.variant(resize: '750x750') %>
<% end %>
<p><%= @post.body %></p>
<p><%= @post.body %></p>
<%= render 'comments/comments' %>
<%= render 'comments/comments' %>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment