Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #692 from City-of-Helsinki/release/v0.10.0
Browse files Browse the repository at this point in the history
Release/v0.10.0
  • Loading branch information
tommimanbytes authored Mar 3, 2020
2 parents 1be1dc8 + a994b66 commit ff2be26
Show file tree
Hide file tree
Showing 52 changed files with 831 additions and 6,510 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DEBUG=1
INTERNAL_IPS='127.0.0.1'
DATABASE_URL='postgis://respa:password@localhost:5432/respa'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ perf*csv
/src
.env
/.vscode
.pytest_cache
1 change: 1 addition & 0 deletions .sanitizerconfig
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ strategy:
description_fi: null
description_sv: null
generic_terms_id: null
payment_terms_id: null
id: null
location: null
max_period: null
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Who is using Respa
- [City of Helsinki](https://api.hel.fi/respa/v1/) - for [Varaamo UI](https://varaamo.hel.fi/) & [Huvaja UI](https://huonevaraus.hel.fi/)
- [City of Tampere](https://respa.tampere.fi/v1/) - for [Varaamo UI](https://varaamo.tampere.fi/) - [GitHub repo](https://github.com/Tampere/respa)
- [City of Lappeenranta](https://varaamo.lappeenranta.fi/respa/v1/) - for [Varaamo UI](https://varaamo.lappeenranta.fi/) - [GitHub repo](https://github.com/City-of-Lappeenranta/Respa)
- City of Turku - for [Varaamo UI](https://varaamo.turku.fi/) - [GitHub repo](https://github.com/digipointtku/respaTku)
- [City of Turku](https://respa.turku.fi/v1/) - for [Varaamo UI](https://varaamo.turku.fi/) - [GitHub repo](https://github.com/codepointtku/respa)
- [City of Hämeenlinna](https://varaukset.hameenlinna.fi/v1) - for [Varaamo UI](https://varaukset.hameenlinna.fi/varaamo/) and [Berth Reservation UI](https://varaukset.hameenlinna.fi/) - [GitHub repo](https://github.com/CityOfHameenlinna/respa)
- [City of Espoo](https://api.hel.fi/respa/v1/) - for [Varaamo UI](https://varaamo.espoo.fi/)
- [City of Vantaa](https://api.hel.fi/respa/v1/) - for [Varaamo UI](https://varaamo.vantaa.fi/)
Expand Down Expand Up @@ -81,20 +81,18 @@ sudo -u postgres psql respa -c "CREATE EXTENSION postgis;"

### Build Respa Admin static resources

Make sure you have Node 8 or LTS and yarn installed.
Make sure you have Node 8 or LTS and npm installed.

```shell
./build-resources
```

### Dev environment configuration

Create a file `respa/.env` to configure the dev environment e.g.:
Copy `.env.example` to `respa/.env`. Make sure the config matches your database setup.

```
DEBUG=1
INTERNAL_IPS='127.0.0.1'
DATABASE_URL='postgis://respa:password@localhost:5432/respa'
cp .env.example respa/.env
```

### Run Django migrations and import data
Expand Down Expand Up @@ -270,6 +268,13 @@ cd $HOME/respa
./manage.py respa_exchange_listen_notifications --log-file=$HOME/logs/exchange_sync.log --pid-file=$HOME/exchange_sync.pid --daemonize
```

### Theme customization

Theme customization, such as changing the main colors, can be done in `respa_admin/static_src/styles/application-variables.scss`.

By default, color theme is imported in this file. If you want to override certain colors, take a copy of the contents of the file
specified in the import, and customize. Remember to remove or uncomment the original import.

Requirements
------------

Expand Down
4 changes: 2 additions & 2 deletions build-resources
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
set -e
rootdir=$(dirname "$0")
cd "$rootdir/respa_admin"
yarn
yarn run build
npm install
npm run build
20 changes: 20 additions & 0 deletions comments/migrations/0003_refactor_content_type_choices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 2.2.9 on 2020-01-27 06:54

import comments.models
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('comments', '0002_support_for_django_2'),
]

operations = [
migrations.AlterField(
model_name='comment',
name='content_type',
field=models.ForeignKey(limit_choices_to=comments.models.get_content_type_choices, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType'),
),
]
7 changes: 6 additions & 1 deletion comments/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def get_commentable_content_types():
return ContentType.objects.get_for_models(*COMMENTABLE_MODELS.values()).values()


def get_content_type_choices():
return {'id__in': (ct.id for ct in get_commentable_content_types())}


class CommentQuerySet(models.QuerySet):
def can_view(self, user):
if not user.is_authenticated:
Expand Down Expand Up @@ -64,7 +68,7 @@ class Comment(models.Model):
content_type = models.ForeignKey(
ContentType,
on_delete=models.CASCADE,
limit_choices_to=lambda: {'id__in': (ct.id for ct in get_commentable_content_types())}
limit_choices_to=get_content_type_choices
)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')
Expand Down Expand Up @@ -171,3 +175,4 @@ def _send_notification(self, request=None):

def send_created_notification(self, request=None):
self._send_notification(request)

96 changes: 60 additions & 36 deletions locale/fi/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,22 @@ msgid "Comments"
msgstr "Kommentit"

msgid "installed"
msgstr ""
msgstr "asennettu"

msgid "removed"
msgstr ""
msgstr "poistettu"

msgid "State of the user"
msgstr ""
msgstr "Käyttäjän tila"

msgid "identifier"
msgstr ""
msgstr "tunniste"

msgid "Identifier of user in the access control system (if any)"
msgstr ""
msgstr "Käyttäjän tunniste kulunvalvontajärjestelmässä (jos olemassa)"

msgid "[No identifier]"
msgstr ""
msgstr "[Ei tunnistetta]"

#, python-brace-format
msgid "{uuid}: {name}"
Expand All @@ -153,48 +153,50 @@ msgid "cancelled"
msgstr "peruttu"

msgid "removing"
msgstr ""
msgstr "poistetaan"

msgid "access code"
msgstr ""
msgstr "pääsykoodi"

msgid "State of the grant"
msgstr ""
msgstr "Luvan tila"

msgid "Identifier of grant in the access control system (if any)"
msgstr ""
msgstr "Luvan tunniste kulunvalvontajärjestelmässä (jos olemassa)"

msgid "How many times the system has tried to install this grant and failed"
msgstr ""
"Kuinka monta kertaa järjestelmä on yrittänyt asentaa luvan ja epäonnistunut"

msgid "How many times the system has tried to remove this grant (and failed)"
msgstr ""
"Kuinka monta kertaa järjestelmä on yrittänyt poistaa luvan ja epäonnistunut"

#, python-brace-format
msgid "{user} {reservation} ({state})"
msgstr ""

msgid "system"
msgstr ""
msgstr "järjestelmä"

msgid "resource"
msgstr "resurssi"

msgid "Identifier of resource in the access control system (if any)"
msgstr ""
msgstr "Resurssin tunniste kulunvalvontajärjestelmässä (jos olemassa)"

msgid "Driver-specific configuration"
msgstr ""
msgstr "Ajurikohtainen konfiguraatio"

msgid "Internal driver data"
msgstr ""
msgstr "Sisäinen ajuridata"

msgid "reservation leeway"
msgstr ""

msgid ""
"How many minutes before and after the reservation the access will be allowed"
msgstr ""
msgstr "Kuinka monta minuuttia ennen ja jälkeen varauksen pääsy on sallittu"

msgid "Notifications"
msgstr "Herätteet"
Expand All @@ -221,7 +223,7 @@ msgid "Reservation created with access code"
msgstr "Varaus pääsykoodin kanssa tehty"

msgid "Access code was created for a reservation"
msgstr ""
msgstr "Pääsykoodi luotiin varaukselle"

msgid "Catering order created"
msgstr "Tarjoilutilaus luotu"
Expand Down Expand Up @@ -435,7 +437,7 @@ msgstr "Ei varauksia"

#, python-brace-format
msgid "Unit \"{pk_value}\" does not exist."
msgstr ""
msgstr "Toimipaikkaa \"{pk_value}\" ei ole olemassa."

msgid "Either unit or a valid resource id is required."
msgstr "Joko unit tai resource on pakollinen."
Expand Down Expand Up @@ -502,7 +504,7 @@ msgid "The resource is reservable only after %(datetime)s"
msgstr "Tila on varattavissa vain %(datetime)s jälkeen"

msgid "Only allowed to be set by resource managers"
msgstr ""
msgstr "Ainoastaan hoitajat saavat asettaa"

msgid "You are not allowed to make a reservation of this type"
msgstr "Et voi tehdä tämän tyyppistä varausta"
Expand All @@ -518,7 +520,7 @@ msgstr "Tätä arvoa ei voi muuttaa"

#, python-brace-format
msgid "Invalid pk \"{pk_value}\" - object does not exist."
msgstr ""
msgstr "Virheellinen pk \"{pk_value}\" - kohdetta ei ole olemassa."

#, python-format
msgid "Invalid value in filter %(filter)s"
Expand Down Expand Up @@ -546,43 +548,43 @@ msgid "Time of modification"
msgstr "Muokkausaika"

msgid "accessibility viewpoint"
msgstr ""
msgstr "saavutettavuusnäkökulma"

msgid "accessibility viewpoints"
msgstr ""
msgstr "saavutettavuusnäkökulmat"

msgid "Accessibility summary value"
msgstr ""
msgstr "Saavutettavuusyhteenvedon arvo"

msgid "Ordering priority"
msgstr ""
msgstr "Järjestysprioriteetti"

msgid "accessibility value"
msgstr ""
msgstr "saavutettavuusarvo"

msgid "accessibility values"
msgstr ""
msgstr "saavutettavuusarvot"

msgid "Resource Accessibility"
msgstr ""
msgstr "Resurssin saavutettavuus"

msgid "Resource"
msgstr "Resurssi"

msgid "Resource ordering priority"
msgstr ""
msgstr "Resurssin järjestysprioriteetti"

msgid "resource accessibility summary"
msgstr ""
msgstr "resurssin saavutettavuuden yhteenveto"

msgid "resource accessibility summaries"
msgstr ""
msgstr "resurssin saavutettavuuden yhteenvedot"

msgid "unit accessibility summary"
msgstr ""
msgstr "toimipisteen saavutettavuuden yhteenveto"

msgid "unit accessibility summaries"
msgstr ""
msgstr "toimipisteen saavutettavuuden yhteenvedot"

msgid "open"
msgstr "auki"
Expand Down Expand Up @@ -618,7 +620,7 @@ msgid "You must set either 'resource' or 'unit', but not both"
msgstr "Aseta 'resource' tai 'unit', älä molempia"

msgid "You must set 'start' and 'end' fields."
msgstr "Aseta 'resource' tai 'unit'"
msgstr "Aseta 'start' ja 'end'"

msgid "Monday"
msgstr "maanantai"
Expand Down Expand Up @@ -730,6 +732,18 @@ msgstr "Voi muokata maksettuja varauksia"
msgid "Can bypass payment for paid reservations"
msgstr "Voi ohittaa varauksen maksamisen"

msgid "Can create a reservation that is a staff event"
msgstr "Voi luoda henkilökuntavarauksen"

msgid "Can create reservations of a non-normal type"
msgstr "Voi tehdä erikoistyyppisiä varauksia"

msgid "Can bypass manual confirmation requirement for resources"
msgstr "Voi ohittaa manuaalisen vahvistuksen"

msgid "Can create reservations for other registered users"
msgstr "Voi tehdä varauksia muille käyttäjille"

msgid "created"
msgstr "luoja"

Expand Down Expand Up @@ -848,6 +862,10 @@ msgstr "Tila on jo varattu ainakin osan ajanjaksosta"
msgid "The minimum reservation length is %(min_period)s"
msgstr "Varauksen minimikesto on %(min_period)s"

#, python-format
msgid "The minimum reservation length is %(slot_size)s"
msgstr "Varauksen minimikesto on %(slot_size)s"

msgid "Field name"
msgstr "Kentän nimi"

Expand Down Expand Up @@ -902,6 +920,15 @@ msgstr "käyttötarkoitus"
msgid "purposes"
msgstr "käyttötarkoitukset"

msgid "Payment terms"
msgstr "Maksuehdot"

msgid "Generic terms"
msgstr "Yleiset ehdot"

msgid "Terms type"
msgstr "Ehtojen tyyppi"

msgctxt "singular"
msgid "terms of use"
msgstr "käyttöehdot"
Expand Down Expand Up @@ -970,9 +997,6 @@ msgstr "Varausinfo"
msgid "Responsible contact info"
msgstr "Vastuuhenkilön yhteystiedot"

msgid "Generic terms"
msgstr "Yleiset ehdot"

msgid "Specific terms"
msgstr "Resurssikohtaiset ehdot"

Expand Down Expand Up @@ -1178,7 +1202,7 @@ msgstr[0] "%(count)d minuutti"
msgstr[1] "%(count)d minuuttia"

msgid "Home"
msgstr ""
msgstr "Koti"

msgid "Add Another"
msgstr "Lisää toinen"
Expand Down
Loading

0 comments on commit ff2be26

Please sign in to comment.