diff options
| author | Magnus Hagander | 2023-04-11 15:30:29 +0000 |
|---|---|---|
| committer | Magnus Hagander | 2023-04-11 15:31:50 +0000 |
| commit | 19682de806b9a340b864d1b0738d4f23f6bd2a24 (patch) | |
| tree | 13d806f6180757c6e5e1158b2c92bca7d78250c3 | |
| parent | 8c289fe90db108b089aa70b5ff834c67648d87e3 (diff) | |
Make names in community auth unique
Technically not needed for the system, but confusion is ensured if you
have two different sites with the same name...
| -rw-r--r-- | pgweb/account/migrations/0009_cauth_unique_names.py | 23 | ||||
| -rw-r--r-- | pgweb/account/models.py | 4 | ||||
| -rw-r--r-- | templates/docs/release_notes_list.html | 40 |
3 files changed, 65 insertions, 2 deletions
diff --git a/pgweb/account/migrations/0009_cauth_unique_names.py b/pgweb/account/migrations/0009_cauth_unique_names.py new file mode 100644 index 00000000..9c77bc20 --- /dev/null +++ b/pgweb/account/migrations/0009_cauth_unique_names.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.14 on 2023-04-11 15:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0008_cooloff_message'), + ] + + operations = [ + migrations.AlterField( + model_name='communityauthorg', + name='orgname', + field=models.CharField(help_text='Name of the organisation', max_length=100, unique=True), + ), + migrations.AlterField( + model_name='communityauthsite', + name='name', + field=models.CharField(help_text="Note that the value in this field is shown on the login page, so make sure it's user-friendly!", max_length=100, unique=True), + ), + ] diff --git a/pgweb/account/models.py b/pgweb/account/models.py index 0244a27e..e3fa5fec 100644 --- a/pgweb/account/models.py +++ b/pgweb/account/models.py @@ -3,7 +3,7 @@ from django.contrib.auth.models import User class CommunityAuthOrg(models.Model): - orgname = models.CharField(max_length=100, null=False, blank=False, + orgname = models.CharField(max_length=100, null=False, blank=False, unique=True, help_text="Name of the organisation") require_consent = models.BooleanField(null=False, blank=False, default=True) @@ -12,7 +12,7 @@ class CommunityAuthOrg(models.Model): class CommunityAuthSite(models.Model): - name = models.CharField(max_length=100, null=False, blank=False, + name = models.CharField(max_length=100, null=False, blank=False, unique=True, help_text="Note that the value in this field is shown on the login page, so make sure it's user-friendly!") redirecturl = models.URLField(max_length=200, null=False, blank=False) apiurl = models.URLField(max_length=200, null=False, blank=True) diff --git a/templates/docs/release_notes_list.html b/templates/docs/release_notes_list.html new file mode 100644 index 00000000..6cdb98c5 --- /dev/null +++ b/templates/docs/release_notes_list.html @@ -0,0 +1,40 @@ +{% extends "base/page.html" %} +{% load pgfilters %} + +{%block title%}Release Notes{%endblock%} + +{% block contents %} +{% regroup releases by major as release_groups %} + +<div id="release-notes" class="row"> + <div class="col-md-9"> + <section> + <h1>Release Notes <i class="far fa-file-alt"></i></h1> + </section> + <p>Below is the complete archive of release notes for every version of PostgreSQL.</p> + <ul class="release-notes-list fa-ul"> + {% for release_group in release_groups %} + {% with major_version=release_group.grouper %} + <li> + <a class="collapsed" href="#release{{ major_version|cut:"." }}" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="release{{ major_version|cut:"." }}"> + <span class="fa-li right"><i class="fas fa-angle-right"></i></span> + <span class="fa-li down"><i class="fas fa-angle-down"></i></span> + {% if major_version == 0 %}Postgres95{% else %}PostgreSQL {{ major_version | pg_major_version }}{% endif %} + </a> + <ul class="collapse release-notes-list" id="release{{ major_version|cut:"." }}"> + {% for release in release_group.list %} + <li> + <a href="/docs/release/{{ major_version | pg_major_version }}.{{ release.minor | release_notes_pg_minor_version:major_version }}/"> + {{ major_version | pg_major_version }}.{{ release.minor | release_notes_pg_minor_version:major_version }} + </a> + </li> + {% endfor %} + </ul> + </li> + {% endwith %} + {% endfor %} + </ul> + </div> +</div> + +{% endblock %} |
