-
Notifications
You must be signed in to change notification settings - Fork 756
refactor: Move document state help to /doc #7206
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e6b800f
Redirect /help/state/draft/* to /doc/help/state/draft-*
jimfenton 3eade71
Adjust document state index to use /doc/help/state for URLs
jimfenton 4c03e98
Move all state help to /doc. Fixes #3802
jimfenton 9c7d81d
Merge branch 'main' into helpurls
jimfenton 879d15f
Move state index redirect into urls file.
jimfenton 682695c
Merge branch 'main' into helpurls
jimfenton 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 was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -1,30 +1,17 @@ | ||
| # Copyright The IETF Trust 2007, All Rights Reserved | ||
|
|
||
| from django.shortcuts import get_object_or_404, render | ||
|
|
||
| import debug # pyflakes:ignore | ||
|
|
||
| from ietf.doc.models import State, StateType | ||
| from ietf.name.models import StreamName | ||
| from django.shortcuts import redirect | ||
|
|
||
| def state_index(request): | ||
| types = StateType.objects.all() | ||
| names = [ type.slug for type in types ] | ||
| for type in types: | ||
| if "-" in type.slug and type.slug.split('-',1)[0] in names: | ||
| type.stategroups = None | ||
| else: | ||
| groups = StateType.objects.filter(slug__startswith=type.slug) | ||
| type.stategroups = [ g.slug[len(type.slug)+1:] for g in groups if not g == type ] or "" | ||
|
|
||
| return render(request, 'help/state_index.html', {"types": types}) | ||
| # This is just a redirect to the new URL under /doc; can probably go away eventually. | ||
|
|
||
| def state(request, doc, type=None): | ||
| if type: | ||
| streams = [ s.slug for s in StreamName.objects.all() ] | ||
| if type in streams: | ||
| type = "stream-%s" % type | ||
| slug = "%s-%s" % (doc,type) if type else doc | ||
|
rjsparks marked this conversation as resolved.
|
||
| statetype = get_object_or_404(StateType, slug=slug) | ||
| states = State.objects.filter(used=True, type=statetype).order_by('order') | ||
| return render(request, 'help/states.html', {"doc": doc, "type": statetype, "states":states} ) | ||
| return redirect('/doc/help/state/%s' % slug, permanent = True) | ||
|
|
||
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 was deleted.
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.
Uh oh!
There was an error while loading. Please reload this page.