-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
[change] Metric collection: added consent in web UI #372 #378
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e186d14
[change] Metric collection: added consent in web UI #372
pandafy 5799c8c
[req-changes] Updated README and made requested changes to the UI
pandafy 6051e0a
[req-changes] Added a submit button to openwisp-info page
pandafy 8edcbae
[change] Changed app name "openwisp_utils.measurements" to "openwisp_…
pandafy a10ce63
[chores] Misc improvements
nemesifier 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
10 changes: 10 additions & 0 deletions
10
openwisp_utils/admin_theme/static/admin/css/openwisp-info.css
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 @@ | ||
#id_user_consented { | ||
float: left; | ||
margin-right: 8px; | ||
vertical-align: top; | ||
margin-bottom: 0px; | ||
} | ||
#id_metric_collection_consent_form > span.helptext{ | ||
display: block; | ||
margin-top: 8px; | ||
} |
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,42 @@ | ||
from django import forms | ||
from django.forms.utils import ErrorList | ||
|
||
from .models import Consent | ||
|
||
|
||
class ConsentForm(forms.ModelForm): | ||
# This required to override the default label_suffix. | ||
# Otherwise, it will show a trailing colon (:) which we | ||
# don't want here due to formatting of the form. | ||
def __init__( | ||
self, | ||
data=None, | ||
files=None, | ||
auto_id="id_%s", | ||
prefix=None, | ||
initial=None, | ||
error_class=ErrorList, | ||
label_suffix='', | ||
empty_permitted=False, | ||
instance=None, | ||
use_required_attribute=None, | ||
renderer=None, | ||
): | ||
super().__init__( | ||
data, | ||
files, | ||
auto_id, | ||
prefix, | ||
initial, | ||
error_class, | ||
label_suffix, | ||
empty_permitted, | ||
instance, | ||
use_required_attribute, | ||
renderer, | ||
) | ||
|
||
class Meta: | ||
model = Consent | ||
widgets = {'user_consented': forms.CheckboxInput(attrs={'class': 'bold'})} | ||
fields = ['user_consented'] |
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.
Please rewrite this so that we can have the input first and each line wrapped on a
<p>
element, the current output is not readable.You probably need to add:
To the checkbox input to make it look decent:
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 just used some CSS to achieve the same result. Re-writing this would require copying some code from Django which we will need to maintain over time.