-
Notifications
You must be signed in to change notification settings - Fork 1
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
Base stepper PR #689
Merged
Merged
Base stepper PR #689
Changes from 38 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
9a049f5
Merge remote-tracking branch 'origin/update/django_dsc' into major/st…
miggol 4d519cd
wip: Initial stepper code
miggol 534e2ea
feat: Base template now includes stepper object
miggol be202d3
feat: Add stepper object to ProposalMixin context
miggol 66c96d4
feat: New StepperContextMixin
miggol eee57be
wip: Checker class
miggol 7641d8e
Merge remote-tracking branch 'origin/major/4' into major/stepper
miggol b93fcd5
feat: more rigourously define stepper and proposal in context
miggol 4153ce7
feat: Stepper Layout class
miggol 176b956
feat: Starting checkers, remove Pages, some renamed variables
miggol f2fbcda
fix: renamed variables in template
miggol a27ef68
fix: correctly define stepper with proposal in views
miggol 2434dbc
wip: Move checkers and helpers into separate files
miggol c8337c0
feat: Provide request object to Stepper object
miggol 5f87c14
breaking: Repurpose ProposalMixin for views with a proposal main object
miggol e99a6f9
feat: Provide Layout and PlaceholderItems access to stepper object
miggol 55fc57e
feat: Provide current checking and associated css class
miggol 842f0df
wip: Combine checkers and stepper items into one
miggol b0934c0
wip: Merging stepper items and checkers was a bad idea
miggol 6c46870
fix: Refer to self.get_proposal() instead of self.object
miggol 60cd6f7
wip: Adding more checkers up to and including WMO
miggol 46b2d0d
wip: Adding studies stepper item
miggol 9134c9e
Merge branch 'fix/small-django4-fixes' into major/stepper
miggol 03d93ba
feat: Add appropriate stepper context mixins to views
miggol 8d70e9c
feat: Recursive stepper includes
miggol 6799ed6
feat: Provide stepper bubble css classes in context
miggol a7ad91d
feat: Stepper items added until StudyDesign
miggol e95a5d0
feat: Make proposal getting consistent in various views
miggol 2390613
wip: UpdateOrCreateChecker
miggol cd9c8ed
fix: get_proposal for SessionMixin
miggol 1c2480c
feat: Study sub-objects checkers and stepper items
miggol 37b29b4
fix: Provision of default location for stepper items
miggol b1f5c71
feat: DM and Submit checkers and items
miggol 757997b
fix: Basic details placeholders and ProposalCreate success_url
miggol d21bf46
feat: StudyEndChecker
miggol 1d790d8
fix: Correct context inheritance, thanks Ty
miggol 024c81c
Merge remote-tracking branch 'origin/major/4' into major/stepper
miggol 84e6936
style: Paint everything black
miggol 12de201
pr: Remove unnecessary BaseStepperComponent
miggol ddce7ec
pr: Just return the css classes
miggol a92b2d2
pr: Tidy up proposal getting and mixins
miggol 902f9cb
pr: Remove TrajectoriesItem and just use an MFC
miggol 12aa53e
fix: Stepper in Task views and session_set fix
miggol 4ba78df
feat: Move renderable mixin to main/utils.py
miggol ed54927
feat: Make StepperItems renderable items
miggol e5cb6df
feat: Merge Layout and Stepper classes, simplify stepper building
miggol b7aae56
feat: Move some of the remaining items around
miggol 3104d3d
fix: Provide location to TrajectoriesChecker
miggol 127abe0
feat: Move all base classes to stepper_helpers.py
miggol afaa5f2
docs: Added docstrings and comments to stepper helpers
miggol 8be1a57
style: Lick of black paint
miggol a930845
fix: Imports that were left behind
miggol 123dc5c
fix: Incorrect reference to stepper
miggol 4b8b130
fix: Misbehaviour caused by mutation of RegularProposalLayout
miggol 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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<li> | ||
<a class="stepper-item {{ item.css_classes }}" href="{{ item.get_url }}"> | ||
<span class="stepper-bubble {{ bubble_size.0 }}"></span> | ||
<span>{{ item.title }}</span> | ||
</a> | ||
{% if item.children %} | ||
<ul> | ||
{% for child in item.children %} | ||
{% include "base/stepper_item.html" with item=child bubble_size=bubble_size|slice:"1:" %} | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
</li> |
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,8 +3,9 @@ | |
|
||
from main.views import CreateView, UpdateView, AllowErrorsOnBackbuttonMixin | ||
from fetc import settings | ||
from studies.models import Study | ||
from studies.utils import get_study_progress | ||
from studies.mixins import StudyFromURLMixin | ||
from proposals.mixins import StepperContextMixin | ||
|
||
from .forms import ObservationForm, ObservationUpdateAttachmentsForm | ||
from .models import Observation | ||
|
@@ -13,7 +14,7 @@ | |
############################# | ||
# CRUD actions on Observation | ||
############################# | ||
class ObservationMixin(object): | ||
class ObservationMixin(StepperContextMixin): | ||
"""Mixin for a Observation, to use in both ObservationCreate and ObservationUpdate below""" | ||
|
||
model = Observation | ||
|
@@ -53,8 +54,12 @@ def get_back_url(self): | |
return reverse(next_url, args=(pk,)) | ||
|
||
def get_study(self): | ||
# Um.... what? | ||
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. Haha Dunno. Let's get rid and have this mixin get the StudyURLMixin as well. |
||
raise NotImplementedError | ||
|
||
def get_proposal(self): | ||
return self.get_object().study.proposal | ||
|
||
|
||
class AttachmentsUpdate(UpdateView): | ||
model = Observation | ||
|
@@ -63,18 +68,19 @@ class AttachmentsUpdate(UpdateView): | |
group_required = settings.GROUP_SECRETARY | ||
|
||
|
||
class ObservationCreate(ObservationMixin, AllowErrorsOnBackbuttonMixin, CreateView): | ||
class ObservationCreate( | ||
StudyFromURLMixin, | ||
ObservationMixin, | ||
AllowErrorsOnBackbuttonMixin, | ||
CreateView, | ||
): | ||
"""Creates an Observation from a ObservationForm""" | ||
|
||
def form_valid(self, form): | ||
"""Sets the Study on the Observation before starting validation.""" | ||
form.instance.study = self.get_study() | ||
return super(ObservationCreate, self).form_valid(form) | ||
|
||
def get_study(self): | ||
"""Retrieves the Study from the pk kwarg""" | ||
return Study.objects.get(pk=self.kwargs["pk"]) | ||
|
||
|
||
class ObservationUpdate(ObservationMixin, AllowErrorsOnBackbuttonMixin, UpdateView): | ||
"""Updates a Observation from a ObservationForm""" | ||
|
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 |
---|---|---|
|
@@ -19,4 +19,4 @@ | |
|
||
{% block pre-form-text %} | ||
<h3>{% trans "Informatie over financiering" %}</h3> | ||
{% endblock %} | ||
{% endblock %} |
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 |
---|---|---|
|
@@ -9,4 +9,4 @@ | |
|
||
{% block pre-form-text %} | ||
<h3>{% trans "Informatie over eerdere toesting" %}</h3> | ||
{% endblock %} | ||
{% endblock %} |
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 |
---|---|---|
|
@@ -22,4 +22,4 @@ | |
|
||
{% block pre-form-text %} | ||
<h3>{% trans "Informatie over de onderzoeker" %}</h3> | ||
{% endblock %} | ||
{% endblock %} |
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.
I feel like this is not doing anything?
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.
It prevents a bit of ugliness caused by the empty
<ul />
.Note the inconsistent item spacing and "tail" at the end