-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1861 from airqo-platform/staging
move to production
- Loading branch information
Showing
135 changed files
with
4,380 additions
and
1,335 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
33 changes: 33 additions & 0 deletions
33
website/backend/FAQ/migrations/0002_faq_answer_en_faq_answer_fr_faq_question_en_and_more.py
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,33 @@ | ||
# Generated by Django 4.2.5 on 2024-02-07 17:12 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('FAQ', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='faq', | ||
name='answer_en', | ||
field=models.TextField(null=True), | ||
), | ||
migrations.AddField( | ||
model_name='faq', | ||
name='answer_fr', | ||
field=models.TextField(null=True), | ||
), | ||
migrations.AddField( | ||
model_name='faq', | ||
name='question_en', | ||
field=models.CharField(max_length=150, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='faq', | ||
name='question_fr', | ||
field=models.CharField(max_length=150, null=True), | ||
), | ||
] |
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,7 @@ | ||
from modeltranslation.translator import register, TranslationOptions | ||
from .models import * | ||
|
||
|
||
@register(FAQ) | ||
class FAQTranslationOptions(TranslationOptions): | ||
fields = ('question', 'answer',) |
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
53 changes: 53 additions & 0 deletions
53
website/backend/africancities/migrations/0002_africancountry_country_name_en_and_more.py
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,53 @@ | ||
# Generated by Django 4.2.5 on 2024-02-07 17:32 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('africancities', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='africancountry', | ||
name='country_name_en', | ||
field=models.CharField(max_length=100, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='africancountry', | ||
name='country_name_fr', | ||
field=models.CharField(max_length=100, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='city', | ||
name='city_name_en', | ||
field=models.CharField(max_length=100, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='city', | ||
name='city_name_fr', | ||
field=models.CharField(max_length=100, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='content', | ||
name='title_en', | ||
field=models.CharField(max_length=150, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='content', | ||
name='title_fr', | ||
field=models.CharField(max_length=150, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='description', | ||
name='paragraph_en', | ||
field=models.TextField(null=True), | ||
), | ||
migrations.AddField( | ||
model_name='description', | ||
name='paragraph_fr', | ||
field=models.TextField(null=True), | ||
), | ||
] |
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,22 @@ | ||
from modeltranslation.translator import register, TranslationOptions | ||
from .models import * | ||
|
||
|
||
@register(AfricanCountry) | ||
class AfricanCountryTranslationOptions(TranslationOptions): | ||
fields = ('country_name',) | ||
|
||
|
||
@register(City) | ||
class CityTranslationOptions(TranslationOptions): | ||
fields = ('city_name',) | ||
|
||
|
||
@register(Content) | ||
class ContentTranslationOptions(TranslationOptions): | ||
fields = ('title',) | ||
|
||
|
||
@register(Description) | ||
class DescriptionTranslationOptions(TranslationOptions): | ||
fields = ('paragraph',) |
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,11 +1,21 @@ | ||
from django.utils import translation | ||
from rest_framework import viewsets | ||
from rest_framework.permissions import AllowAny | ||
from .models import AfricanCountry | ||
from .serializers import AfricanCitySerializer | ||
|
||
# Create your views here. | ||
|
||
|
||
class AfricanCityViewSet(viewsets.ReadOnlyModelViewSet): | ||
permission_classes = (AllowAny,) | ||
queryset = AfricanCountry.objects.all() | ||
serializer_class = AfricanCitySerializer | ||
serializer_class = AfricanCitySerializer | ||
permission_classes = [AllowAny] | ||
|
||
def list(self, request, *args, **kwargs): | ||
language = request.session.get('django_language') | ||
if language is None: | ||
language = request.COOKIES.get('django_language') | ||
if language is not None: | ||
translation.activate(language) | ||
return super().list(request, *args, **kwargs) |
Binary file added
BIN
+1.35 MB
website/backend/assets/cleanair/resources/Screenshot_2024-02-06_121827.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
43 changes: 43 additions & 0 deletions
43
website/backend/board/migrations/0002_boardmember_name_en_boardmember_name_fr_and_more.py
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,43 @@ | ||
# Generated by Django 4.2.5 on 2024-02-07 14:28 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('board', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='boardmember', | ||
name='name_en', | ||
field=models.CharField(max_length=100, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='boardmember', | ||
name='name_fr', | ||
field=models.CharField(max_length=100, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='boardmember', | ||
name='title_en', | ||
field=models.CharField(max_length=100, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='boardmember', | ||
name='title_fr', | ||
field=models.CharField(max_length=100, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='boardmemberbiography', | ||
name='description_en', | ||
field=models.TextField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='boardmemberbiography', | ||
name='description_fr', | ||
field=models.TextField(blank=True, null=True), | ||
), | ||
] |
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,12 @@ | ||
from modeltranslation.translator import register, TranslationOptions | ||
from .models import * | ||
|
||
|
||
@register(BoardMember) | ||
class BoardMemberTranslationOptions(TranslationOptions): | ||
fields = ('name', 'title') | ||
|
||
|
||
@register(BoardMemberBiography) | ||
class BoardMemberBiographyTranslationOptions(TranslationOptions): | ||
fields = ('description',) |
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,11 +1,19 @@ | ||
from django.utils import translation | ||
from rest_framework import viewsets | ||
from rest_framework.permissions import AllowAny | ||
from .models import BoardMember | ||
from .serializers import BoardMemberSerializer | ||
|
||
|
||
class BoardViewSet(viewsets.ReadOnlyModelViewSet): | ||
permission_classes = (AllowAny,) | ||
ordering_fields = ('order', 'name') | ||
queryset = BoardMember.objects.all() | ||
serializer_class = BoardMemberSerializer | ||
permission_classes = [AllowAny] | ||
|
||
def list(self, request, *args, **kwargs): | ||
language = request.session.get('django_language') | ||
if language is None: | ||
language = request.COOKIES.get('django_language') | ||
if language is not None: | ||
translation.activate(language) | ||
return super().list(request, *args, **kwargs) |
Oops, something went wrong.