-
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
Fix/diff and other minor issues. #711
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
8093d5e
fix: update the diff template
EdoStorm96 cd09962
fix: make sure StudyDesign also deletes study types
EdoStorm96 06a6da9
fix: small bug on task_create
EdoStorm96 f9b095b
Merge branch 'major/4' into fix/diff
EdoStorm96 82863a6
feat: dumb css implementation on compare_documents.html
EdoStorm96 690ae5a
fix: simplify diff css and put in own diff.css file
EdoStorm96 da35b00
fix: use Session.repeats too for Session.net_duration()
EdoStorm96 7d45799
fix: reinsert diff-ignore
EdoStorm96 0eed19e
style: back to black
EdoStorm96 13f4a88
fix: change default view for compare_documents to split
EdoStorm96 5bc4b70
fix: make compare_documents extend fetc_base
EdoStorm96 ab1ce42
fix: improve styling on compare_documents.html
EdoStorm96 87c1c26
style: djlint
EdoStorm96 aef04eb
fix: undo self.repeats in Session.net_duration()
EdoStorm96 54118f9
Merge branch 'major/4' into fix/diff
EdoStorm96 0d9376d
fix: typo
EdoStorm96 565bff2
fix: replace th with td on row.verbose_name in diff
EdoStorm96 aa21af3
fix: implement get property methods for study_types, to not have to d…
EdoStorm96 1a1224a
style: style
EdoStorm96 8167d23
fix: correct title variable proposal_confirmation.html
EdoStorm96 c320001
Merge branch 'major/4' into fix/diff
EdoStorm96 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,9 @@ | ||
.diff del { | ||
text-decoration: none; | ||
background-color: #ff6565; | ||
} | ||
|
||
.diff ins { | ||
text-decoration: none; | ||
background-color: #73ff73; | ||
} |
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
83 changes: 44 additions & 39 deletions
83
proposals/templates/proposals/table_with_header_diff.html
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 |
---|---|---|
@@ -1,48 +1,53 @@ | ||
{% load diff_tags %} | ||
{% load i18n %} | ||
{% load static %} | ||
|
||
{% if section_title %} | ||
<h2 class="mt-5 mb-1">{% trans section_title %}</h2> | ||
{% endif %} | ||
{% if sub_title %}<h3 class='mt-3'>{{ sub_title }}</h3>{% endif %} | ||
<table class="proposals-diff "> | ||
<tr> | ||
<th class="proposals-diff-question"></th> | ||
<th class="proposals-diff-answer">{% trans "Vorige aanvraag" %}</th> | ||
<th class="proposals-diff-answer">{% trans "Huidige aanvraag" %}</th> | ||
</tr> | ||
{% if warning %} | ||
{% for row in rows|slice:":1" %} | ||
<tr class="diff-ignore"> | ||
<th>{{ row.verbose_name }}</th> | ||
{# If the first object is missing, place a warning on the first TD #} | ||
{% if missing_object == 'old' %} | ||
<td rowspan='{{ rows|length }}'> | ||
<div class='warning'>{{ warning }}</div> | ||
</td> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th scope="col" width="30%"></th> | ||
<th scope="col" width="35%">{% trans "Vorige aanvraag" %}</th> | ||
<th scope="col" width="35%">{% trans "Huidige aanvraag" %}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% if warning %} | ||
{% for row in rows|slice:":1" %} | ||
<tr class="diff-ignore"> | ||
<td>{{ row.verbose_name }}</td> | ||
{# If the first object is missing, place a warning on the first TD #} | ||
{% if missing_object == 'old' %} | ||
<td rowspan='{{ rows|length }}' class="align-middle"> | ||
<div class='alert alert-info'>{{ warning }}</div> | ||
</td> | ||
<td>{{ row.value }}</td> | ||
{# Otherwise, we're missing the second one, thus we place the warning on the second #} | ||
{% elif missing_object == 'new' %} | ||
<td>{{ row.value }}</td> | ||
<td rowspan='{{ rows|length }}' class="align-middle"> | ||
<div class='alert alert-info'>{{ warning }}</div> | ||
</td> | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
{% for row in rows|slice:"1:" %} | ||
<tr class="diff-ignore"> | ||
<td>{{ row.verbose_name }}</td> | ||
<td>{{ row.value }}</td> | ||
{# Otherwise, we're missing the second one, thus we place the warning on the second #} | ||
{% elif missing_object == 'new' %} | ||
<td>{{ row.value }}</td> | ||
<td rowspan='{{ rows|length }}'> | ||
<div class='warning'>{{ warning }}</div> | ||
</td> | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
{% for row in rows|slice:"1:" %} | ||
<tr class="diff-ignore"> | ||
<th>{{ row.verbose_name }}</th> | ||
<td>{{ row.value }}</td> | ||
</tr> | ||
{% endfor %} | ||
{% else %} | ||
{% for row in rows %} | ||
<tr> | ||
<th>{{ row.verbose_name }}</th> | ||
<td>{{ row.old_value }}</td> | ||
<td>{{ row.new_value }}</td> | ||
</tr> | ||
{% endfor %} | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
{% else %} | ||
{% for row in rows %} | ||
<tr class="diff"> | ||
<td>{{ row.verbose_name }}</td> | ||
<td>{{ row.old_value }}</td> | ||
<td>{{ row.new_value }}</td> | ||
</tr> | ||
{% endfor %} | ||
{% endif %} | ||
</tbody> | ||
</table> |
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
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 method will either return a list of sessions, or implicitly return None. I would prefer if it returned an empty list if the proposal has no sessions.
If we do that then
for session in proposal.get_sessions():
will just do nothing, rather than produce an error. And the empty list will still be falsey for checking if a proposal has sessions.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 will actually return a QS or a list in that case, but at least they're both iterable.
An empty QS is still falsey thankfully.