-
Notifications
You must be signed in to change notification settings - Fork 97
Collections - Featured sounds finish #2075
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
5aola
wants to merge
23
commits into
MTG:master
Choose a base branch
from
5aola:featured-sounds
base: master
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 21 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
9f48ec7
collection urls are meaningful, relevant sounds marked dirty when col…
0107989
Collections updated, added sort, search, for featured sounds added: e…
80fa349
edit collections page finish
9fc7994
Merge remote-tracking branch 'upstream/master' into featured-sounds
1db53c8
updated the collection display to handle everything in the front-end
c3de724
fix linting
d8a8437
Fixed tests
7d3aa2a
fix tests
00d3c7c
linting error fix
01a4ed8
formatting fixes
5005d71
removed unnecessary formatting changes
a5aa7cd
revert index.js and data.js to master
424b5ee
Improved soundCard rendering
9fec01a
removed redundant code
4e1adc8
fixed add sounds modal bug
5ce93bd
linting fixes
105a936
Merge branch 'MTG:master' into featured-sounds
5aola 904bc3c
final linting issues
1cd090b
Final formatting and small fixes
a0d9050
fixed collection display arrows
18df663
Merge branch 'master' into featured-sounds
ffont 3dd46c8
Collection edit: refactor frontend to use htmx
5aola e613914
settings and formatting fixes
5aola 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1448,8 +1448,16 @@ | |
|
|
||
| # ------------------------------------------------------------------------------- | ||
| # Collections | ||
| ENABLE_COLLECTIONS = False | ||
| ENABLE_COLLECTIONS = True | ||
| MAX_SOUNDS_PER_COLLECTION = 250 | ||
| MAX_FEATURED_SOUNDS_PER_COLLECTION = 250 | ||
|
Member
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. Should we set a lower limit here? Say 10?
Contributor
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. I like the 6 because its 2 full rows on desktop and 3 on mobile but 12 is also good for this manner |
||
| COLLECTION_SORT_OPTIONS = { | ||
| "featured": ("Featured first", "featured_order"), | ||
| "created_desc": ("Date added (newest first)", "-collectionsound__created"), | ||
| "created_asc": ("Date added (oldest first)", "collectionsound__created"), | ||
| "name": ("Name", "original_filename"), | ||
| } | ||
| COLLECTION_SORT_DEFAULT = "featured" | ||
|
|
||
| # ------------------------------------------------------------------------------- | ||
| # Import local settings | ||
|
|
||
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 |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { SoundStateStore } from '../utils/soundStateStore'; | ||
| import { SoundGridEditor } from '../utils/soundGridEditor'; | ||
|
|
||
| // ─── Data ──────────────────────────────────────────────────── | ||
|
|
||
| const soundsData = JSON.parse( | ||
| document.getElementById('sounds-data').textContent | ||
| ); | ||
| const initialFeaturedIds = JSON.parse( | ||
| document.getElementById('featured-data').textContent | ||
| ); | ||
|
|
||
| // ─── State & grid ──────────────────────────────────────────── | ||
|
|
||
| const store = new SoundStateStore(['featured']).load(soundsData, { | ||
| featured: initialFeaturedIds, | ||
| }); | ||
|
|
||
| const editor = new SoundGridEditor({ | ||
| store, | ||
| searchInput: document.getElementById('collection-search'), | ||
| syncUrl: true, | ||
| renderCard(sound, clone) { | ||
| if (store.hasFlag(sound.id, store.FLAG.FEATURED)) { | ||
| const col = clone.querySelector('.col-md-4'); | ||
| if (col) col.classList.add('featured-highlight'); | ||
| } | ||
| return clone; | ||
| }, | ||
| }); | ||
|
|
||
| editor.renderPage(); |
Oops, something went wrong.
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.
This should still be False, you can overwrite in your local_settings.py fie