Commit f52686ad authored by simon's avatar simon
Browse files

Add some rails_best_practices suggestions

parent 936667cb
# frozen_string_literal: true
# various helper methods for comments
module CommentsHelper
end
# frozen_string_literal: true
# various helper methods for conversations
module ConversationHelper
end
# frozen_string_literal: true
# various helper methods for conversations messages
module ConversationMessagesHelper
end
......@@ -6,7 +6,7 @@
<div class="actions">
<%= form.submit 'Comment', :class => 'submit extra-small' %>
</div>
<% end %>
<% end %>
......
......@@ -10,7 +10,7 @@
<% end %>
<% @conversations.each do |c| %>
<%= link_to conversation_path(c), class: "conversations-item" do %>
<%= image_tag(c.partner(current_user).avatar.variant(resize_to_fill: [400,400]), class: "avatar conversation-partner-avatar") %>
<%= image_tag(c.partner(current_user).avatar.variant(resize_to_fill: [400,400]), class: "avatar conversation-partner-avatar") %>
<div class="conversation-right">
<h2 class="conversation-partner" >
<%= c.partner(current_user).username %>
......
<div class="conversation-messages-wrapper">
<h1>
<%= image_tag(@conversation.partner(current_user).avatar.variant(resize_to_fill: [400,400]), class: "avatar message-avatar") %>
<%= @conversation.partner(current_user).username %></h1>
<%= image_tag(@conversation.partner(current_user).avatar.variant(resize_to_fill: [400,400]), class: "avatar message-avatar") %>
<%= @conversation.partner(current_user).username %>
</h1>
<div class="messages-body-wrapper">
<div class="messages-body">
<%= render 'messages' %>
......
......@@ -33,7 +33,7 @@
</div>
<div class="field">
<%= f.label :avatar %>
<%= f.label :avatar %>
<%= f.file_field :avatar, autocomplete: "current-password" %>
</div>
......
<div class="mobile-menu">
<div class="container">
<div class="phone">
<div class="content">
<nav role="navigation">
<div id="menuToggle">
<input type="checkbox" />
<span></span>
<span></span>
<span></span>
<ul id="menu">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Info</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</nav>
</div>
</div>
</div>
</body>
</html>
......@@ -21,7 +21,7 @@
</div>
<div id="burger-nav-items" class="burger-nav-items">
<div class="profile">
<%= image_tag(current_user.avatar.variant(resize_to_fill: [400,400]), class: "avatar nav_profile_image") %>
<%= image_tag(current_user.avatar.variant(resize_to_fill: [400,400]), class: "avatar nav_profile_image") %>
<h2 class="profile_name"> <% if !current_user.nil? %> <%= current_user.username %> <% end %></h2>
<%= link_to image_tag('sign-out-alt-solid.svg'), destroy_user_session_path, method: :delete, :class => ['logout'] %>
</div>
......
......@@ -20,7 +20,6 @@
<%= form.label :content_text %>
<%= form.text_field :content_text, id: "post-textarea" %>
</div>
<div class="actions">
<%= form.submit %>
</div>
......
......@@ -15,17 +15,14 @@
<h2>Create Post</h2>
<div class=inner-container>
<%= form_with(model: post, local: true) do |form| %>
<div class="field_title">
<%= form.label :title %>
<%= form.text_field :title %>
</div>
<div class="field_content_text">
<%= form.label :content_text, "Content:" %>
<%= form.text_area :content_text, class: "post-textarea" %>
</div>
<div class="content">
<div class="field_content_image">
<%= form.label :content_image, "Image:" %>
......@@ -40,12 +37,9 @@
<%= form.label :tag_list, "Tags" %>
<%= form.text_field :tag_list %>
</div>
<div class="actions">
<%= form.submit 'Create Post', :class => 'submit' %>
</div>
<% end %>
</div>
</section>
......
......@@ -26,7 +26,7 @@
<div class="field_content_tags">
<%= form.label :tag_list, "Tags" %> <!-- TODO Find a way to .join(",") the values in here-->
<%= form.text_field :tag_list, value: @post.tag_list.join(",") %>
<%= form.text_field :tag_list, value: @post.tag_list.join(",") %>
</div>
<div class="field_content_image">
......
......@@ -5,7 +5,7 @@
<%= render 'home-container', post: post %>
<% end %>
<% else %>
<% @posts.each do |post| %>
<% @posts.each do |post| %>
<%= render 'home-container', post: post %>
<% end %>
<% end %>
......
......@@ -2,7 +2,7 @@
<div class="show-content">
<div class="heading">
<% if @post.user == current_user %>
<%= link_to image_tag("edit-solid.svg", :class => "edit"), edit_post_path %>
<%= link_to image_tag("edit-solid.svg", :class => "edit"), edit_post_path %>
<%= link_to image_tag("trash-alt-solid.svg", :class => "delete"), post_path, :method => :delete%>
<% end %>
<h2><%= @post.title %></h2>
......
<div class="users-profile-view">
<div class="profile-avatar-section">
<div class="avatar-wrapper">
<%= image_tag(@user.avatar.variant(resize_to_fill: [400,400]), class: "avatar") %>
<%= image_tag(@user.avatar.variant(resize_to_fill: [400,400]), class: "avatar") %>
</div>
<h1 class="profile-username">
<%= @user.username %>
......
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