-
Notifications
You must be signed in to change notification settings - Fork 22
Make workshops commentable #1340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maebeale
wants to merge
4
commits into
main
Choose a base branch
from
maebeale/workshop-comments
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
11b63ed
Make workshops commentable with admin-only UI and fix comment field bugs
maebeale 0080cfd
Fix comment updated_by overwrite and ensure hidden id on nested fields
maebeale 98a8237
Fix race condition in event registration Turbo test
maebeale 09f8e94
Fix workshop RecordNotUnique test to stub save instead of update
maebeale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -425,9 +425,71 @@ | |
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="images-section" data-controller="dropdown"> | ||
| <button | ||
| type="button" | ||
| id="images_button" | ||
| class=" | ||
| flex items-center justify-between cursor-pointer w-full | ||
| bg-gray-500 text-white hover:bg-gray-300 px-3 py-2 rounded-t-md | ||
| " | ||
| data-action="dropdown#toggle" | ||
| data-dropdown-payload-param='[{"images":"hidden"}, {"images_arrow":"rotate-180"}, {"images_button":"rounded-md rounded-t-md"}]' | ||
| > | ||
| Images/attachments | ||
| <svg | ||
| id="images_arrow" | ||
| class="w-6 h-6 shrink-0 rotate-180" | ||
| fill="currentColor" | ||
| viewBox="0 0 20 20" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| > | ||
| <path | ||
| fill-rule="evenodd" | ||
| d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" | ||
| clip-rule="evenodd" | ||
| ></path> | ||
| </svg> | ||
| </button> | ||
|
|
||
| <div id="images" class="border border-gray-300 p-4 rounded-b-md"> | ||
| <%= render "shared/form_image_fields", f: f, include_primary_asset: true %> | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved images into a toggle |
||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <%= render "shared/form_image_fields", f: f, include_primary_asset: true %> | ||
| <% if f.object.persisted? %> | ||
| <% if allowed_to?(:manage?, Comment) %> | ||
| <div class="admin-only bg-blue-100 form-group p-3 space-y-4 mt-6 rounded-md" id="comments-section"> | ||
| <div class="font-semibold text-gray-700 mb-2">Comments</div> | ||
|
|
||
| <div class="admin-only bg-blue-100 rounded-lg border border-gray-200 p-4 mb-4 shadow-sm" | ||
| data-controller="paginated-fields comment-edit-toggle" | ||
| data-paginated-fields-per-page-value="5"> | ||
| <%= f.simple_fields_for :comments do |cf| %> | ||
| <%= render "comments/comment_fields", f: cf %> | ||
| <% end %> | ||
|
|
||
| <div data-paginated-fields-target="nav"></div> | ||
|
|
||
| <button type="button" | ||
| class="text-sm text-gray-400 hover:text-blue-600 underline cursor-pointer whitespace-nowrap" | ||
| style="float:right" | ||
| data-action="click->comment-edit-toggle#toggle"> | ||
| <span data-comment-edit-toggle-target="editLabel">Edit Comments</span> | ||
| <span data-comment-edit-toggle-target="viewLabel" style="display:none">Done Editing</span> | ||
| </button> | ||
| <%= link_to_add_association "➕ Add Comment", | ||
| f, | ||
| :comments, | ||
| partial: "comments/comment_fields", | ||
| class: "btn btn-secondary-outline" %> | ||
| </div> | ||
| </div> | ||
| <% end %> | ||
| <% end %> | ||
|
|
||
| <div class="action-buttons mt-8 flex justify-center gap-3"> | ||
| <% if allowed_to?(:destroy?, f.object) %> | ||
| <%= link_to "Delete", @workshop, class: "btn btn-danger-outline", | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only want to update updated_by when content of comment changes