-
Notifications
You must be signed in to change notification settings - Fork 384
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
58 changed files
with
715 additions
and
787 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,4 +1,4 @@ | ||
<h1>Editing Comment</h1> | ||
<h2>Editing Comment</h2> | ||
|
||
<%= render 'form', comment: @comment %> | ||
|
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,36 +1,37 @@ | ||
<h1>Using Classic Rails 4.2 "generate scaffold"</h1> | ||
<hr/> | ||
<h2> | ||
Using Classic Rails 4.2 "generate scaffold" | ||
</h2> | ||
|
||
<p id="notice"><%= notice %></p> | ||
<div class="prose max-w-full prose-a:text-sky-700 prose-li:my-0 prose-code:text-rose-600 prose-code:bg-yellow-100 prose-headings:text-gray-700"> | ||
<% if notice %> | ||
<p id="notice" class="bg-success bg-green-100 px-6 py-4"><%= notice %></p> | ||
<% end %> | ||
|
||
<h2>Listing Comments</h2> | ||
<h2>Listing Comments</h2> | ||
|
||
<table data-turbo="true"> | ||
<thead> | ||
<tr> | ||
<th>Author</th> | ||
<th>Text</th> | ||
<th colspan="3"></th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<% @comments.each do |comment| %> | ||
<tr> | ||
<td><%= comment.author %></td> | ||
<td><%= comment.text %></td> | ||
</tr> | ||
<tr> | ||
<td><%= link_to 'Show', comment %></td> | ||
<td><%= link_to 'Edit', edit_comment_path(comment) %></td> | ||
</tr> | ||
<table data-turbo="true"> | ||
<thead> | ||
<tr> | ||
<td><%= button_to 'Destroy', comment, method: :delete, data: { turbo_confirm: 'Are you sure?' } %></td> | ||
<th>Author</th> | ||
<th>Text</th> | ||
<th></th> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</thead> | ||
|
||
<br> | ||
<tbody> | ||
<% @comments.each do |comment| %> | ||
<tr> | ||
<td><%= comment.author %></td> | ||
<td><%= markdown_to_html(comment.text) %></td> | ||
<td class="flex flex-col lg:flex-row gap-2"> | ||
<%= link_to 'Show', comment %> | ||
<%= link_to 'Edit', edit_comment_path(comment) %> | ||
<%= button_to 'Destroy', comment, method: :delete, data: { turbo_confirm: 'Are you sure?' }, class: "text-red-500 cursor-pointer" %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
|
||
<%= link_to 'New Comment', new_comment_path %> | ||
<%= link_to 'New Comment', new_comment_path, class: "not-prose px-3 py-1 font-semibold border-0 rounded text-sky-50 bg-sky-600 hover:bg-sky-800" %> | ||
</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,4 +1,4 @@ | ||
<h1>New Comment</h1> | ||
<h2>New Comment</h2> | ||
|
||
<%= render 'form', comment: @comment %> | ||
|
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,28 +1,23 @@ | ||
<%= turbo_frame_tag "form_tabs", data: { turbo: true } do %> | ||
<%= render "comments/turbo/error_notice" %> | ||
<%= render "comments/turbo/tabs" %> | ||
|
||
<hr /> | ||
<%= form_with(model: @comment, data: { action: "turbo:submit-end->comments#resetText" }, class: "form-horizontal") do |f| %> | ||
<div class="form-group"> | ||
<div class="col-sm-2"> | ||
<%= f.label "Name", class: "form-label pull-right" %> | ||
</div> | ||
<div class="col-sm-10"> | ||
<%= f.text_field :author, data: { comments_target: "commentAuthor" }, class: "form-control", placeholder: "Your Name" %> | ||
</div> | ||
|
||
<%= form_with(model: @comment, data: { action: "turbo:submit-end->comments#resetText" }, class: "form-horizontal flex flex-col gap-4") do |f| %> | ||
<div class="form-group flex flex-col gap-0 items-center lg:gap-4 lg:flex-row"> | ||
<%= f.label "Name", class: "w-full lg:w-2/12 lg:text-end shrink-0" %> | ||
<%= f.text_field :author, data: { comments_target: "commentAuthor" }, class: "px-3 py-1 leading-4 border border-gray-300 rounded w-full", placeholder: "Your Name" %> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-sm-2"> | ||
<%= f.label :text, class: "form-label pull-right" %> | ||
</div> | ||
<div class="col-sm-10"> | ||
<%= f.text_field :text, data: { comments_target: "commentText" }, class: "form-control", placeholder: "Say something using markdown..." %> | ||
</div> | ||
|
||
<div class="form-group flex flex-col gap-0 items-center lg:gap-4 lg:flex-row"> | ||
<%= f.label :text, class: "w-full lg:w-2/12 lg:text-end shrink-0" %> | ||
<%= f.text_field :text, data: { comments_target: "commentText" }, class: "px-3 py-1 leading-4 border border-gray-300 rounded w-full", placeholder: "Say something using markdown..." %> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-sm-10 col-sm-offset-2"> | ||
<%= f.submit "Post", class: "btn btn-primary" %> | ||
</div> | ||
|
||
<div class="form-group flex flex-col gap-0 lg:gap-4 lg:flex-row"> | ||
<div class="hidden lg:block lg:w-2/12 grow-0"></div> | ||
<%= f.submit "Post", class: "self-start px-3 py-1 font-semibold border-0 rounded text-sky-50 bg-sky-600 hover:bg-sky-800" %> | ||
</div> | ||
<% end %> | ||
<% end %> |
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,18 +1,22 @@ | ||
<%= turbo_frame_tag "form_tabs", data: { turbo: true } do %> | ||
<%= render "comments/turbo/error_notice" %> | ||
<%= render "comments/turbo/tabs" %> | ||
|
||
<hr /> | ||
<%= form_with(model: @comment, data: { action: "turbo:submit-end->comments#resetText" }, class: "form-inline") do |f| %> | ||
<div class="form-group"> | ||
|
||
<%= form_with(model: @comment, data: { action: "turbo:submit-end->comments#resetText" }, class: "form-inline flex flex-col lg:flex-row flex-wrap gap-4") do |f| %> | ||
<div class="flex gap-2 items-center"> | ||
<%= f.label "Name", class: "form-label mr-15" %> | ||
<%= f.text_field :author, data: { comments_target: "commentAuthor" }, class: "form-control", placeholder: "Your Name" %> | ||
<%= f.text_field :author, data: { comments_target: "commentAuthor" }, class: "px-3 py-1 leading-4 border border-gray-300 rounded", placeholder: "Your Name" %> | ||
</div> | ||
<div class="form-group ml-15 mr-15"> | ||
|
||
<div class="flex gap-2 items-center"> | ||
<%= f.label :text, class: "form-label mr-15" %> | ||
<%= f.text_field :text, data: { comments_target: "commentText" }, class: "form-control w-50", placeholder: "Say something using markdown..." %> | ||
<%= f.text_field :text, data: { comments_target: "commentText" }, class: "px-3 py-1 leading-4 border border-gray-300 rounded", placeholder: "Say something using markdown..." %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.submit "Post", class: "btn btn-primary" %> | ||
|
||
<div class="flex gap-2"> | ||
<%= f.submit "Post", class: "self-start px-3 py-1 font-semibold border-0 rounded text-sky-50 bg-sky-600 hover:bg-sky-800" %> | ||
</div> | ||
<% end %> | ||
<% end %> |
Oops, something went wrong.