-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
82 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,34 @@ | ||
<div class="row"> | ||
|
||
<div class="col s12 m4 l3"> <!-- Note that "m4 l3" was added --> | ||
|
||
<%= render "sidebar" %> | ||
|
||
</div> | ||
|
||
<div class="col s12 m8 l9"> <!-- Note that "m8 l9" was added --> | ||
<link href="https://vjs.zencdn.net/7.11.4/video-js.css" rel="stylesheet" /> | ||
|
||
|
||
<h1 class=""><%= @discussion.title %></h1> | ||
<h3 class="">by <%= @discussion&.user.first_name %> in <%= link_to @discussion.category.category_name, @discussion.category %></h3> | ||
<div class=""> | ||
<div class=""></div> | ||
<h1 class=""><%= @discussion.title %></h1> | ||
<h3 class="">by <%= @discussion&.user.first_name %> in <%= link_to @discussion.category.category_name, @discussion.category %></h3> | ||
<div class=""> | ||
<div class=""></div> | ||
<div class=""> | ||
<% if discussion_author(@discussion) %> | ||
<div class=""> | ||
<% if discussion_author(@discussion) %> | ||
<div class=""> | ||
<%= link_to "Edit Discussion", edit_discussion_path(@discussion), class: "button" %> | ||
<%= link_to "Delete", discussion_path(@discussion), method: :delete, data: { confirm: "Delete discussion?" }, class: "btn red" %> | ||
</div> | ||
<% end %> | ||
<%= link_to "Edit Discussion", edit_discussion_path(@discussion), class: "button" %> | ||
<%= link_to "Delete", discussion_path(@discussion), data: {turbo_method: :delete, turbo_confirm: "Delete discussion?" }, class: "btn red" %> | ||
</div> | ||
</div> | ||
<div class=""><%= @discussion.content %></div> | ||
<h2 class=""><%= @discussion.replies.count %> Replies</h2> | ||
<div id="discussion-replies"> | ||
<%= render @discussion.replies %> | ||
</div> | ||
<h3 class="">Leave a reply</h3> | ||
<% if user_signed_in? %> | ||
<%= render "replies/form" %> | ||
<% else %> | ||
<p>To reply you need to <%= link_to "login", new_user_session_path %>. Don't have an account? | ||
<%= link_to "Sign up", new_user_registration_path %> for one.</p> | ||
<% end %> | ||
|
||
</div> | ||
</div> | ||
<div class=""><%= @discussion.content %></div> | ||
<h2 class=""><%= @discussion.replies.count %> Replies</h2> | ||
<div id="discussion-replies"> | ||
<%= render @discussion.replies %> | ||
</div> | ||
<h3 class="">Leave a reply</h3> | ||
<% if user_signed_in? %> | ||
<%= render "replies/form" %> | ||
<% else %> | ||
<p>To reply you need to <%= link_to "login", new_user_session_path %>. Don't have an account? | ||
<%= link_to "Sign up", new_user_registration_path %> for one.</p> | ||
<% end %> | ||
<script src="https://vjs.zencdn.net/7.11.4/video.min.js"></script> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<li class=""> | ||
<%= content_tag :a, raw(t "views.pagination.truncate"), class: "block py-2 px-3 leading-tight text-gray-500 bg-white rounded-r-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white" %> | ||
<%= content_tag :a, raw(t "views.pagination.truncate"), class: "block py-2 px-3 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white" %> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
<div class=""> | ||
<div class=""> | ||
<div class=""> | ||
<p> | ||
<strong><%= reply.user&.first_name %></strong> <small><%= time_ago_in_words(reply.created_at) %></small> | ||
<br/> | ||
<%= reply.reply %> | ||
</p> | ||
</div> | ||
<% if reply_author(reply) || has_role?(:admin) %> | ||
<div class=""> | ||
<p> | ||
<strong><%= reply.user&.first_name %></strong> <small><%= time_ago_in_words(reply.created_at) %></small> | ||
<br/> | ||
<%= reply.reply %> | ||
</p> | ||
<a class=""> | ||
<%= link_to edit_discussion_reply_path(reply.discussion, reply) do %> | ||
edit comment | ||
<% end %> | ||
</a> | ||
<br> | ||
<a class=""> | ||
<%= link_to [reply.discussion, reply], | ||
data: {turbo_method: :delete, turbo_confirm: "Are you sure ?" } do %> | ||
delete comment | ||
<% end %> | ||
</a> | ||
</div> | ||
<% if reply_author(reply) || has_role?(:admin) %> | ||
<div class=""> | ||
<a class=""> | ||
<%= link_to edit_discussion_reply_path(reply.discussion, reply) do %> | ||
edit comment | ||
<% end %> | ||
</a> | ||
<br> | ||
<a class=""> | ||
<%= link_to [reply.discussion, reply], | ||
method: :delete, data: { confirm: "Are you sure ?" } do %> | ||
delete comment | ||
<% end %> | ||
</a> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,21 @@ | |
|
||
10.times do | ||
user = User.create!(first_name: FFaker::Name.first_name, | ||
last_name: FFaker::Name.last_name, | ||
email: FFaker::Internet.email, | ||
password: '123456') | ||
last_name: FFaker::Name.last_name, | ||
email: FFaker::Internet.email, | ||
password: '123456') | ||
user.save! | ||
end | ||
|
||
sample_user = User.create!(first_name: "Michael", | ||
last_name: "Basmanov", | ||
email: "[email protected]", | ||
password: '123456') | ||
sample_user = User.create!(first_name: 'Michael', | ||
last_name: 'Basmanov', | ||
email: '[email protected]', | ||
password: '123456') | ||
sample_user.save! | ||
|
||
Role.create!(name: 'admin') | ||
|
||
sample_user.add_role("admin") | ||
sample_user.add_role('admin') | ||
|
||
PublicActivity.enabled = false | ||
|
||
|
@@ -25,11 +25,9 @@ | |
title = FFaker::Lorem.sentence | ||
description = FFaker::Lorem.paragraph | ||
body = FFaker::Lorem.paragraph | ||
status = "draft" | ||
status = 'draft' | ||
users.each do |user| | ||
up = Upload.create!(title: title, description: description, body: body, status: status, user_id: user.id) | ||
up.thumbnail.attach(io: File.open(File.join(Rails.root,'public/images/rose.jpg')), filename: 'rose.jpg') | ||
up = Upload.create!(title: title, description: description, body: body, status: status, user_id: user.id) | ||
up.thumbnail.attach(io: File.open(File.join(Rails.root, 'public/images/rose.jpg')), filename: 'rose.jpg') | ||
end | ||
end | ||
|
||
|