-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apps/ideas/mapideas/topics: add image checkbox, reformat idea/topic/i…
…deamap detail, change ideaimage to reflect format, add translatable helptext fixes #1859 fixes #1860 fixes #1858
- Loading branch information
Phillippa
committed
May 27, 2020
1 parent
b46270d
commit 6042495
Showing
14 changed files
with
162 additions
and
58 deletions.
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,27 @@ | ||
from django import forms | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
RIGHT_OF_USE_LABEL = _('I hereby confirm that the copyrights for this ' | ||
'photo are with me or that I have received ' | ||
'rights of use from the author. I also confirm ' | ||
'that the privacy rights of depicted third persons ' | ||
'are not violated. ') | ||
|
||
|
||
class ImageRightOfUseMixin(forms.ModelForm): | ||
right_of_use = forms.BooleanField(required=False, label=RIGHT_OF_USE_LABEL) | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
if self.instance.image: | ||
self.initial['right_of_use'] = True | ||
|
||
def clean(self): | ||
cleaned_data = super().clean() | ||
image = cleaned_data.get('image') | ||
right_of_use = cleaned_data.get('right_of_use') | ||
if image and not right_of_use: | ||
self.add_error('right_of_use', | ||
_("You want to upload an image. " | ||
"Please check that you have the " | ||
"right of use for the image.")) |
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,19 @@ | ||
# Generated by Django 2.2.12 on 2020-05-27 10:00 | ||
|
||
import adhocracy4.images.fields | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('euth_ideas', '0005_alter_idea_category'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='idea', | ||
name='image', | ||
field=adhocracy4.images.fields.ConfiguredImageField('idea_image', blank=True, help_prefix='Please make sure the image is at least 400x200 px in dimensions and at most 5 MB in file size.', upload_to='ideas/images'), | ||
), | ||
] |
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 |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
|
||
.badge-runningout { | ||
background-color: $brand-danger; | ||
color: #fff; | ||
} | ||
|
||
.badge-finished { | ||
|
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