Commit d39475f4 authored by simon's avatar simon
Browse files

add action

parent 4d103e34
......@@ -38,7 +38,6 @@
.owned {
background-color: $highlight;
transition: none;
pointer-events: none;
&:hover {
border: solid 2px $background-sexy;
background-color: $highlight;
......
......@@ -33,6 +33,8 @@ class UsersController < ApplicationController
redirect_back(fallback_location: '/') if current_user.save
end
def search_tag; end
private
def set_user
......
<!DOCTYPE html>
<html>
<head>
<title>CodeBunker</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
<title>CodeBunker</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<meta name="viewport" content="width=device-width, initial-scale=1">
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
<body id="normal-body">
<header id="normal-header">
<div class="container">
<form action="#">
<label for="search-form-big"></label>
<input type="text" class="search-form-big" name="search-form-big">
</form>
</div>
<div class="add-post-container">
<%= link_to image_tag('sign-out-alt-solid.svg'), destroy_user_session_path, method: :delete, :class => ['logout'] %>
</div>
</header>
<body id="normal-body">
<header id="normal-header">
<div class="container">
<form action="#">
<label for="search-form-big"></label>
<input type="text" class="search-form-big" name="search-form-big">
</form>
</div>
<div class="add-post-container">
<%= link_to image_tag('sign-out-alt-solid.svg'), destroy_user_session_path, method: :delete, :class => ['logout'] %>
</div>
</header>
<nav>
<h1><%= link_to "CodeBunker", posts_path, :class => "no-link-styles" %></h1>
<div class="profile">
<hr class="line">
<%= 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>
</div>
<nav>
<h1><%= link_to "CodeBunker", posts_path, :class => "no-link-styles" %></h1>
<div class="profile">
<hr class="line">
<%= 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>
</div>
<div class="menu-points">
<hr class="line">
<ul>
<%= link_to image_tag("envelope-open-regular.svg"), posts_path , :alt => "Feed", :class => "menu-img"%>
<li><%= link_to "Feed", root_path, :class => "#{'is-current-page' if current_page?(root_path)} no-link-styles"%></li>
<%= link_to image_tag("users-solid.svg"), posts_path, :alt => "Alert", :class => "menu-img" %>
<li><%= link_to "Users", users_path, :class => "#{'is-current-page' if current_page?(users_path)} no-link-styles"%></li>
<%= link_to image_tag("envelope-regular.svg"), conversations_path, :alt => "Messages", :class => "menu-img" %>
<li><%= link_to "Messages", conversations_path, :class => "#{'is-current-page' if current_page?(conversations_path)} no-link-styles"%></li>
<%= link_to image_tag("user-circle-regular.svg"), posts_path, :alt => "Profile", :class => "menu-img" %>
<li><%= link_to "Profile", user_path(current_user), :class => "#{'is-current-page' if current_page?(user_path(current_user))} no-link-styles"%></li>
</ul>
</div>
<div class="menu-search">
<hr class="line">
<h2 class="search">TAGS</h2>
<form action="#">
<label for="search-form-small"></label>
<input type="text" class="search-form-small" name="search-form-small">
</form>
<!-- TODO Formular -->
</div>
<div class="menu-tags"> <!-- TODO Get Tags -->
<% most_used_tags_sorted.each do |tag| %>
<% if current_user.user_tag_list.include? tag.to_s %>
<%= link_to tag, remove_tag_user_path(:tagname => tag.to_s, id: current_user), class: 'tag owned', remote: true, method: :put %>
<% else %>
<%= link_to tag, add_tag_user_path(:tagname => tag.to_s, id: current_user), class: 'tag', remote: true, method: :put %>
<% end %>
<% end %>
</div>
</nav>
<main>
<%= link_to image_tag(image_url("plus-circle-solid.svg"), :class => "fab submit"), new_post_path%>
<%= yield %>
</main>
</body>
<div class="menu-points">
<hr class="line">
<ul>
<%= link_to image_tag("envelope-open-regular.svg"), posts_path , :alt => "Feed", :class => "menu-img"%>
<li><%= link_to "Feed", root_path, :class => "#{'is-current-page' if current_page?(root_path)} no-link-styles"%></li>
<%= link_to image_tag("users-solid.svg"), posts_path, :alt => "Alert", :class => "menu-img" %>
<li><%= link_to "Users", users_path, :class => "#{'is-current-page' if current_page?(users_path)} no-link-styles"%></li>
<%= link_to image_tag("envelope-regular.svg"), conversations_path, :alt => "Messages", :class => "menu-img" %>
<li><%= link_to "Messages", conversations_path, :class => "#{'is-current-page' if current_page?(conversations_path)} no-link-styles"%></li>
<%= link_to image_tag("user-circle-regular.svg"), posts_path, :alt => "Profile", :class => "menu-img" %>
<li><%= link_to "Profile", user_path(current_user), :class => "#{'is-current-page' if current_page?(user_path(current_user))} no-link-styles"%></li>
</ul>
</div>
<div class="menu-search">
<hr class="line">
<h2 class="search">TAGS</h2>
<%= form_tag search_tag_user_path(current_user), remote: :true do |f| %>
<%= text_field :query, class: "search-form-small", remote: true %>
<% end %>
<!-- TODO Formular -->
</div>
<div class="menu-tags"> <!-- TODO Get Tags -->
<% most_used_tags_sorted.each do |tag| %>
<% if current_user.user_tag_list.include? tag.to_s %>
<%= link_to tag, remove_tag_user_path(:tagname => tag.to_s, id: current_user), class: 'tag owned', remote: true, method: :put %>
<% else %>
<%= link_to tag, add_tag_user_path(:tagname => tag.to_s, id: current_user), class: 'tag', remote: true, method: :put %>
<% end %>
<% end %>
</div>
</nav>
<main>
<%= link_to image_tag(image_url("plus-circle-solid.svg"), :class => "fab submit"), new_post_path%>
<%= yield %>
</main>
</body>
</html>
......@@ -10,7 +10,7 @@ Rails.application.routes.draw do
put 'dislike', to: 'posts#dislike'
end
end
resources :conversations, only: %i[index show]
resources :conversation_messages, only: %i[new create]
resources :comments
......@@ -22,6 +22,7 @@ Rails.application.routes.draw do
member do
put 'add_tag', to: 'users#add_tag'
put 'remove_tag', to: 'users#remove_tag'
put 'search_tag', to: 'users#search_tag'
end
end
# post 'users/avatar', to: 'users#avatar', as: 'avatar_user'
......
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