-
Notifications
You must be signed in to change notification settings - Fork 79
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
Refactoring links forms #646
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2250935
Refactoring links forms:
dismantl a27fa1d
Only show new link/video button when logged in
dismantl c8a7428
Only show Links section on officer profile if there are >= 1 links
dismantl e354f3d
Restore officer_links table
dismantl df143b3
minor fixes due to rebasing
dismantl af6ce33
Fixed issue where links added to officer profiles dont show up. Added…
dismantl 45a6340
flake8 fix
dismantl 946bae7
Merge branch 'develop' into links-refactor
dismantl 5388705
Merge branch 'develop' into links-refactor
dismantl 46bc5c6
Updates from merging in develop
dismantl b46d07a
move comment to class docstring
dismantl 0905899
Merge branch 'develop' into links-refactor
dismantl 10741fe
Merge branch 'develop' into links-refactor
dismantl 7f87290
Update advanced-csv-import field name
dismantl 91e4889
Merge branch 'develop' into links-refactor
dismantl 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
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,32 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
<div class="container theme-showcase" role="main"> | ||
|
||
<div class="page-header"> | ||
<h1> | ||
Delete Link for officer {{ obj.officer_id }} | ||
</h1> | ||
<p> | ||
<a href="{{ obj.url }}">{{ obj.title or obj.url }}</a> | ||
{% if obj.description or obj.author %} | ||
<div> | ||
{% if obj.description %} | ||
{{ obj.description }} | ||
{% endif %} | ||
{% if obj.author %} | ||
{% if obj.description %}- {% endif %}<em>{{ obj.author }}</em> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
</p> | ||
</div> | ||
<p class="lead"> | ||
Are you sure you want to delete this link? | ||
This cannot be undone. | ||
<form action="{{ url_for('main.link_api_delete', obj_id=obj.id, officer_id=officer_id) }}" method="post"> | ||
<button class='btn btn-danger' type="submit">Delete</button> | ||
</form> | ||
</p> | ||
</div> | ||
{% endblock content %} |
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,10 @@ | ||
{% extends "form.html" %} | ||
|
||
{% block page_title %} | ||
Update Link | ||
{% endblock page_title %} | ||
|
||
{% block form %} | ||
<p>For officer with OOID {{ form.officer_id.data }}.</p> | ||
{{ super() }} | ||
{% endblock form %} |
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,10 @@ | ||
{% extends 'form.html' %} | ||
|
||
{% block page_title %} | ||
New Link | ||
{% endblock page_title %} | ||
|
||
{% block form %} | ||
<p>For officer with OOID {{ form.officer_id.data }}.</p> | ||
{{ super() }} | ||
{% endblock form %} |
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.
Can you add an
else
to catch if there are errors and log them (or anything other than die silently?), in the spirit of #786 ?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.
The ModelView class it inherits from is written in the same way, so I wouldn't want to break that pattern here without doing it elsewhere, to keep things consistent. And I think it would be best to come to consensus on a solution for #786 and apply it in a separate PR.