Geplantes Gitlab Update: Donnerstag, Morgens vor 9 Uhr

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 @@ ...@@ -6,7 +6,7 @@
<div class="actions"> <div class="actions">
<%= form.submit 'Comment', :class => 'submit extra-small' %> <%= form.submit 'Comment', :class => 'submit extra-small' %>
</div> </div>
<% end %> <% end %>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<% end %> <% end %>
<% @conversations.each do |c| %> <% @conversations.each do |c| %>
<%= link_to conversation_path(c), class: "conversations-item" do %> <%= 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"> <div class="conversation-right">
<h2 class="conversation-partner" > <h2 class="conversation-partner" >
<%= c.partner(current_user).username %> <%= c.partner(current_user).username %>
......
<div class="conversation-messages-wrapper"> <div class="conversation-messages-wrapper">
<h1> <h1>
<%= image_tag(@conversation.partner(current_user).avatar.variant(resize_to_fill: [400,400]), class: "avatar message-avatar") %>
<%= image_tag(@conversation.partner(current_user).avatar.variant(resize_to_fill: [400,400]), class: "avatar message-avatar") %> <%= @conversation.partner(current_user).username %>
<%= @conversation.partner(current_user).username %></h1> </h1>
<div class="messages-body-wrapper"> <div class="messages-body-wrapper">
<div class="messages-body"> <div class="messages-body">
<%= render 'messages' %> <%= render 'messages' %>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</div> </div>
<div class="field"> <div class="field">
<%= f.label :avatar %> <%= f.label :avatar %>
<%= f.file_field :avatar, autocomplete: "current-password" %> <%= f.file_field :avatar, autocomplete: "current-password" %>
</div> </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 @@ ...@@ -21,7 +21,7 @@
</div> </div>
<div id="burger-nav-items" class="burger-nav-items"> <div id="burger-nav-items" class="burger-nav-items">
<div class="profile"> <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> <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'] %> <%= link_to image_tag('sign-out-alt-solid.svg'), destroy_user_session_path, method: :delete, :class => ['logout'] %>
</div> </div>
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
<%= form.label :content_text %> <%= form.label :content_text %>
<%= form.text_field :content_text, id: "post-textarea" %> <%= form.text_field :content_text, id: "post-textarea" %>
</div> </div>
<div class="actions"> <div class="actions">
<%= form.submit %> <%= form.submit %>
</div> </div>
......
...@@ -15,17 +15,14 @@ ...@@ -15,17 +15,14 @@
<h2>Create Post</h2> <h2>Create Post</h2>
<div class=inner-container> <div class=inner-container>
<%= form_with(model: post, local: true) do |form| %> <%= form_with(model: post, local: true) do |form| %>
<div class="field_title"> <div class="field_title">
<%= form.label :title %> <%= form.label :title %>
<%= form.text_field :title %> <%= form.text_field :title %>
</div> </div>
<div class="field_content_text"> <div class="field_content_text">
<%= form.label :content_text, "Content:" %> <%= form.label :content_text, "Content:" %>
<%= form.text_area :content_text, class: "post-textarea" %> <%= form.text_area :content_text, class: "post-textarea" %>
</div> </div>
<div class="content"> <div class="content">
<div class="field_content_image"> <div class="field_content_image">
<%= form.label :content_image, "Image:" %> <%= form.label :content_image, "Image:" %>
...@@ -40,12 +37,9 @@ ...@@ -40,12 +37,9 @@
<%= form.label :tag_list, "Tags" %> <%= form.label :tag_list, "Tags" %>
<%= form.text_field :tag_list %> <%= form.text_field :tag_list %>
</div> </div>
<div class="actions"> <div class="actions">
<%= form.submit 'Create Post', :class => 'submit' %> <%= form.submit 'Create Post', :class => 'submit' %>
</div> </div>
<% end %> <% end %>
</div> </div>
</section> </section>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div class="field_content_tags"> <div class="field_content_tags">
<%= form.label :tag_list, "Tags" %> <!-- TODO Find a way to .join(",") the values in here--> <%= 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>
<div class="field_content_image"> <div class="field_content_image">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<%= render 'home-container', post: post %> <%= render 'home-container', post: post %>
<% end %> <% end %>
<% else %> <% else %>
<% @posts.each do |post| %> <% @posts.each do |post| %>
<%= render 'home-container', post: post %> <%= render 'home-container', post: post %>
<% end %> <% end %>
<% end %> <% end %>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="show-content"> <div class="show-content">
<div class="heading"> <div class="heading">
<% if @post.user == current_user %> <% 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%> <%= link_to image_tag("trash-alt-solid.svg", :class => "delete"), post_path, :method => :delete%>
<% end %> <% end %>
<h2><%= @post.title %></h2> <h2><%= @post.title %></h2>
......
<div class="users-profile-view"> <div class="users-profile-view">
<div class="profile-avatar-section"> <div class="profile-avatar-section">
<div class="avatar-wrapper"> <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> </div>
<h1 class="profile-username"> <h1 class="profile-username">
<%= @user.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