-
Notifications
You must be signed in to change notification settings - Fork 168
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
Update generate_template function and add UI for incomplete file #636
Closed
Closed
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
906cb47
Added Draft mode
ulyssear e89b20b
Merge branch 'main' into features/draft
ulyssear 0f0ae0b
Command generate_missing_templates to generate missing thesaurus with…
ulyssear 4457aff
Merge branch 'features/draft' of github.com:ulyssear/codethesaur.us i…
ulyssear bd6d389
Removed useless comment
ulyssear d407c76
Removed unused import
ulyssear 222518e
Removed useless parameters
ulyssear 363d069
Updated description of command generate_missing_template
ulyssear a8926eb
Fixed indentation
ulyssear dc8a402
Re-added parameters not-so-useless
ulyssear fe20260
Minor changes on the command generate_missing_templates
ulyssear 8eb81e7
Merge branch 'main' into features/draft
ulyssear d506f8b
Merge branch 'main' into features/draft
geekygirlsarah b4a0c61
Merge branch 'main' into features/draft
ulyssear 73398b8
Merge branch 'main' into features/draft
ulyssear c8440b0
Removed Draft mode
ulyssear 95d3a99
Merge branch 'features/draft' of github.com:ulyssear/codethesaur.us i…
ulyssear bf041f0
Merge branch 'main' into features/draft
geekygirlsarah 3ce9a93
Merge branch 'main' into features/draft
geekygirlsarah e5334fb
Removed draft
ulyssear 3662ad1
Merge branch 'features/draft' of github.com:ulyssear/codethesaur.us i…
ulyssear 542325d
Merge branch 'main' into features/draft
ulyssear c7d2e5e
is_incomplete checks now complete template
ulyssear 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 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,28 @@ | ||
from django.core.management.base import BaseCommand | ||
|
||
from web.models import Language, MetaInfo | ||
|
||
import os | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Generate missing language thesaurus files to be filled out' | ||
|
||
def handle(self, *args, **options): | ||
meta_info = MetaInfo() | ||
languages = meta_info.languages | ||
structures = meta_info.structures | ||
|
||
for language in languages: | ||
versions = Language(language, languages[language]).versions() | ||
for version in versions: | ||
for structure in structures: | ||
file_path = os.path.join( | ||
'web', | ||
'thesauruses', | ||
language, | ||
version, | ||
structure + '.json' | ||
) | ||
if not os.path.exists(file_path): | ||
os.system(f'python manage.py generate_template "{language}" "{structure}" --language-version="{version}"') |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
from web.models import MetaInfo | ||
|
||
|
||
def generate_language_template(language_id, structure_id, version=None): | ||
def generate_language_template(language_id, structure_id, version=None, draft=False): | ||
"""Generate a template for the given language and structure""" | ||
meta_info = MetaInfo() | ||
if structure_id not in meta_info.structures: | ||
|
@@ -20,6 +20,9 @@ def generate_language_template(language_id, structure_id, version=None): | |
|
||
if version: | ||
meta['language_version'] = version | ||
|
||
if draft: | ||
meta['draft'] = True | ||
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. Same for removing this |
||
|
||
concepts = { | ||
id: { | ||
|
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
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.
Should this get removed as I think we decided against "draft mode"?
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.
I forgot to remove it, sorry for that.