mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 19:37:06 +00:00
Compare commits
399 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ce293d1388 | |||
| f83805af4f | |||
| 97530b2203 | |||
| 170db50a1c | |||
| 1b59bb9f99 | |||
| 2ebe7777c3 | |||
| 2f9f35c396 | |||
| aecd0ff314 | |||
| e0e9a05747 | |||
| cce0543408 | |||
| a6e36b9854 | |||
| 995a4f6cb2 | |||
| d24756ca38 | |||
| f69b7aa1f0 | |||
| 50839f3240 | |||
| 74b6b3b27d | |||
| e51c2dc76b | |||
| e7b57df077 | |||
| b0fcda5901 | |||
| 92901350a0 | |||
| 253846f877 | |||
| 4b61b26661 | |||
| 66567e5a55 | |||
| b8059175c6 | |||
| a85a07ea82 | |||
| 21088a1412 | |||
| e37d5fcb61 | |||
| f6bfcceb6c | |||
| 79bb6cc415 | |||
| 99161b269e | |||
| 365c3f04c9 | |||
| 65023cf4f9 | |||
| 85bb6ae5ba | |||
| 6eeb74fdd7 | |||
| f015929a0c | |||
| c05ef1ed10 | |||
| f8593776c0 | |||
| 284132f4cc | |||
| 858933c6bb | |||
| 0a3c85bb42 | |||
| 266bdfe628 | |||
| d19554de24 | |||
| 4e4503e097 | |||
| d65ccc807f | |||
| b94c459e56 | |||
| b6a6be99da | |||
| 83765c99ad | |||
| 11a6f8d8f1 | |||
| bcb2b1bc20 | |||
| 843bdebabf | |||
| 86e18c399d | |||
| 05ca7433f1 | |||
| 3beeeab4ae | |||
| ccea25133c | |||
| ced86f308b | |||
| 6d1e5effda | |||
| 809894a04c | |||
| 9967c081c9 | |||
| 555aae5d1c | |||
| 905613d8e9 | |||
| e3ea56ce32 | |||
| d66e0ea21a | |||
| 50f5363b69 | |||
| de11df1999 | |||
| 35d8d9423a | |||
| 347e189a96 | |||
| e15de01cfa | |||
| 0d03678674 | |||
| 08c004d42d | |||
| 5fca39f32c | |||
| 8782b879a1 | |||
| d5eef1a296 | |||
| dcf08830f4 | |||
| 361ab675d3 | |||
| e1ba0df894 | |||
| f0dee9794f | |||
| 19698270e5 | |||
| f0f03c1175 | |||
| 8427b78ba6 | |||
| 62a28c6c66 | |||
| bb7568885d | |||
| 31a2367514 | |||
| b0e51bcfd6 | |||
| a8f119a1df | |||
| 2ad21765c0 | |||
| 7289774dc7 | |||
| 107e0f317b | |||
| 2d5f3e3b2e | |||
| ba44a34946 | |||
| 0c90b72c7f | |||
| 38d6e7e9cc | |||
| a57aee1ea7 | |||
| 04f9f81408 | |||
| e75631f8a5 | |||
| c0871a7b51 | |||
| 822b6e95aa | |||
| 7e9bbd2792 | |||
| b00a4dcb8e | |||
| 7555d4bd2b | |||
| bf896d07b0 | |||
| 539fb8daa3 | |||
| 35240b25ba | |||
| 4d38b2f8f0 | |||
| df0d9aa902 | |||
| 011a01d176 | |||
| 2a08ddba45 | |||
| bcba36a421 | |||
| d6bd47b4ea | |||
| 2c1ebbc399 | |||
| 330ec1afe1 | |||
| 2096534085 | |||
| 8608a350f3 | |||
| 4e82d363bc | |||
| cbd2158307 | |||
| 0355392675 | |||
| c5dca62b0b | |||
| 050a69d5ea | |||
| 07c15281c0 | |||
| 15bbf2f7d1 | |||
| 7e2491be76 | |||
| 770b4f1114 | |||
| 4b37c202f4 | |||
| de111bea55 | |||
| 6e2267a4b6 | |||
|
|
51ac084c52 | ||
|
|
d4bb874236 | ||
|
|
3887815bbc | ||
|
|
9a90b1a432 | ||
|
|
c50bdca3eb | ||
|
|
183c8706b6 | ||
|
|
632c199ffb | ||
|
|
a4b2e085d8 | ||
|
|
93487e3541 | ||
|
|
fe5b68488f | ||
|
|
8b8a05597c | ||
|
|
055e1080dd | ||
|
|
ba6701ee67 | ||
|
|
b9b153d654 | ||
|
|
a66d7d407c | ||
|
|
a5a954ee7d | ||
|
|
40c5aed15c | ||
|
|
4a46466f1e | ||
|
|
4019749930 | ||
|
|
d2093f849a | ||
|
|
40c138de00 | ||
|
|
3ea4ea88a7 | ||
|
|
9d14cf4b38 | ||
|
|
48cce12c32 | ||
|
|
264c353b1d | ||
|
|
f37d7c77c4 | ||
|
|
479ef038d4 | ||
|
|
8f7767fa5c | ||
|
|
8ca1ba3d95 | ||
|
|
e7a113c4ee | ||
|
|
b28d714e9e | ||
|
|
1ea2c5448b | ||
|
|
c57392e83c | ||
|
|
4f1dfe16cd | ||
|
|
9ead2ab05f | ||
|
|
bc28c238ea | ||
|
|
e7542e70a5 | ||
|
|
7f01bff993 | ||
|
|
4e87176c17 | ||
|
|
6a5addc917 | ||
|
|
0e08feee01 | ||
|
|
311a90fe09 | ||
|
|
fa6a4339d8 | ||
|
|
d5f85c84c8 | ||
|
|
123a123050 | ||
|
|
adc9021002 | ||
|
|
7681e78a50 | ||
|
|
7d14fed90f | ||
|
|
bd13bb29e8 | ||
|
|
0f4e39fcaf | ||
|
|
7d1c05cfd8 | ||
|
|
cc25a154ac | ||
|
|
20812dfc40 | ||
|
|
5a2890ece1 | ||
|
|
4635e79520 | ||
|
|
78e35b70e0 | ||
|
|
9f5253834f | ||
|
|
78056c7752 | ||
|
|
2664ff6e83 | ||
|
|
9f067249de | ||
|
|
27b16c2212 | ||
|
|
81598ea624 | ||
|
|
74fffb0cac | ||
|
|
42d95beb5a | ||
|
|
8093b23870 | ||
|
|
c20b2b5a0a | ||
|
|
2c68877cc8 | ||
|
|
1de4f741b8 | ||
|
|
98e9148998 | ||
|
|
583a49fdd3 | ||
|
|
87e5e6cbf3 | ||
|
|
3ad8d4a5c9 | ||
|
|
667a51d1c7 | ||
|
|
75bc12de57 | ||
|
|
6f72244331 | ||
|
|
df13bcf46d | ||
|
|
8697d726b6 | ||
|
|
7ce47fc0ef | ||
|
|
b00ca4c1a2 | ||
|
|
af31971565 | ||
|
|
e3e8a2ada4 | ||
|
|
5d1caf98ba | ||
|
|
97473a46e2 | ||
|
|
989c8141b3 | ||
|
|
6670a87a52 | ||
|
|
e457086c50 | ||
|
|
7d74a99518 | ||
|
|
7e9a6e992a | ||
|
|
ba4f8d8ffd | ||
|
|
85c13033e8 | ||
|
|
d1dc505b37 | ||
|
|
12bc9f886f | ||
|
|
8d68e1b0c3 | ||
|
|
02b0132f9c | ||
|
|
bf2422c6dd | ||
|
|
936a375992 | ||
|
|
6d5188af72 | ||
|
|
db76d57971 | ||
|
|
b73e2dcb2d | ||
|
|
550d7cede0 | ||
|
|
71e5352b6b | ||
|
|
c8a68d542a | ||
|
|
adf12442a4 | ||
|
|
25cc33e2c1 | ||
|
|
9be49f4faf | ||
|
|
a6e8f06441 | ||
|
|
7021f05b67 | ||
|
|
0b1f303d62 | ||
|
|
8a94a46cd5 | ||
|
|
0c92554561 | ||
|
|
a24f5157cd | ||
|
|
c102cbf091 | ||
|
|
a141b93644 | ||
|
|
9164ea8a05 | ||
|
|
7783aee192 | ||
|
|
f4bd9a0cef | ||
|
|
25a28755c6 | ||
|
|
afae0fd943 | ||
|
|
4bbe4eac3a | ||
|
|
4d4d7ab70b | ||
|
|
9b98ce73f0 | ||
|
|
94b2ee9d70 | ||
|
|
6dc4bd770f | ||
|
|
3dd97b6457 | ||
|
|
f2e945c67f | ||
|
|
4cfee6362d | ||
|
|
f94627e4c8 | ||
|
|
59f717829a | ||
|
|
9db870bcb0 | ||
|
|
2d85ab4370 | ||
|
|
95fda6a3d5 | ||
|
|
90c40b2e2e | ||
|
|
20342ef671 | ||
|
|
cbc70ab85a | ||
|
|
e54c717ada | ||
|
|
efecfa8e43 | ||
|
|
2998a7e3fb | ||
|
|
b2cd5f4940 | ||
|
|
1a27774177 | ||
|
|
9e6d1a495e | ||
|
|
8e52f779ee | ||
|
|
82a235e6ff | ||
|
|
c2961b911f | ||
|
|
76fcb7ceb2 | ||
|
|
80491623de | ||
|
|
7e8dba4806 | ||
|
|
e045b084d0 | ||
|
|
6bb4f09454 | ||
|
|
2027d9d3ab | ||
|
|
0288b0320d | ||
|
|
91a47b4fdc | ||
|
|
d6e42cc18d | ||
|
|
f95e06aa18 | ||
|
|
5035b121a6 | ||
|
|
a94db2713e | ||
|
|
6435ec69a1 | ||
|
|
dde5ec9d7f | ||
|
|
a1f9510a8c | ||
|
|
8689c1a204 | ||
|
|
387cebd0d4 | ||
|
|
0e4234cb35 | ||
|
|
aafb6c0a21 | ||
|
|
b84076ec3b | ||
|
|
57349a6007 | ||
|
|
ab37139429 | ||
|
|
26bf55b4b4 | ||
|
|
9a84f77ec4 | ||
|
|
62d7a1e48c | ||
|
|
a1dc5721e6 | ||
|
|
0cceb604dd | ||
|
|
c6eda514ca | ||
|
|
8bc82b2a15 | ||
|
|
c364db4f16 | ||
|
|
82fbdd2ca1 | ||
|
|
567322c0af | ||
|
|
a39cf0e7ca | ||
|
|
b99aa77d7b | ||
|
|
efee146044 | ||
|
|
a382d93b00 | ||
|
|
aaafdef7e1 | ||
|
|
17e6255d62 | ||
|
|
1ca3c4e6c4 | ||
|
|
5dcfbb6052 | ||
|
|
d6763a760e | ||
|
|
3b3cec02be | ||
|
|
719b11e79e | ||
|
|
bf472a69fd | ||
|
|
75fc169630 | ||
|
|
19735e9771 | ||
|
|
2b0ba8d12e | ||
|
|
fa07b13fbd | ||
|
|
57c29bf01d | ||
|
|
4a1e33064c | ||
|
|
224a92f42e | ||
|
|
63e06d812d | ||
|
|
eea4342455 | ||
|
|
c7a6c72219 | ||
|
|
fef6e9d459 | ||
|
|
216e6b06fa | ||
|
|
dc69c51ac9 | ||
|
|
ada72c24f8 | ||
|
|
8f494e1be5 | ||
|
|
e5bb530214 | ||
|
|
6418c8c96a | ||
|
|
db96e65485 | ||
|
|
15aab2eb33 | ||
|
|
7d1aac2021 | ||
|
|
d02f865952 | ||
|
|
76270c4572 | ||
|
|
76ae447cc6 | ||
|
|
04ae8cb4f6 | ||
|
|
80f7fb0857 | ||
|
|
834fb3c644 | ||
|
|
1bc45b1106 | ||
|
|
74d3c1b091 | ||
|
|
da57108e3e | ||
|
|
2cdc7675c7 | ||
|
|
7c75f9d7f4 | ||
|
|
74aab162e1 | ||
|
|
af77cb39f8 | ||
|
|
416f2fbf6c | ||
|
|
9f493a53e4 | ||
|
|
d83f4bda49 | ||
|
|
8c698e821d | ||
|
|
440de19c56 | ||
|
|
09b7fc334b | ||
|
|
512590d615 | ||
|
|
6e00c42302 | ||
|
|
b2fd9eeaf9 | ||
|
|
9b3b759254 | ||
|
|
1a9ba731cf | ||
|
|
474f3a4be3 | ||
|
|
118ce6228f | ||
|
|
40afbc1908 | ||
|
|
7784ab3e09 | ||
|
|
e3ef4ed90c | ||
|
|
7ee7ed3ff0 | ||
|
|
56568093ae | ||
|
|
e410d9bcb1 | ||
|
|
097a6b0152 | ||
|
|
a7f34bbb54 | ||
|
|
0d2f1a79b2 | ||
|
|
512c02a198 | ||
|
|
507e2a43fa | ||
|
|
7891ab72da | ||
|
|
6d12202c8a | ||
|
|
e47ee453bd | ||
|
|
39127cf972 | ||
|
|
d733b6db63 | ||
|
|
224bce9853 | ||
|
|
5e6065951f | ||
|
|
9210636475 | ||
|
|
abcfd67f77 | ||
|
|
6d2737b1a6 | ||
|
|
e4a50dbfa4 | ||
|
|
5a1b043862 | ||
|
|
e1df999108 | ||
|
|
65f46a66f1 | ||
|
|
0d5d04902e | ||
|
|
db57d3c08f | ||
|
|
85a3ac082b | ||
|
|
d57c4769ae | ||
|
|
e530ddc8ec | ||
|
|
e10a6c4521 | ||
|
|
e8416bc779 | ||
|
|
4b2abd5d6c | ||
|
|
026fc10999 | ||
|
|
bc713a9fe7 | ||
|
|
3090ecda9b | ||
|
|
b7ba0d1749 | ||
|
|
701252ee4a | ||
|
|
db9859d9af | ||
|
|
6b426d2b39 | ||
|
|
1dcdd57ea1 | ||
|
|
141759479b |
21
.dockerignore
Normal file
21
.dockerignore
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
.dbbackup/
|
||||||
|
.idea/
|
||||||
|
.mypy_cache/
|
||||||
|
.vagrant/
|
||||||
|
.venv/
|
||||||
|
venv/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
Caddyfile
|
||||||
|
docker-compose.yml
|
||||||
|
.env
|
||||||
|
settings.ini
|
||||||
|
mail.log/
|
||||||
|
/roles/
|
||||||
|
/static/
|
||||||
|
*.sqlite3*
|
||||||
|
*.log*
|
||||||
|
deployment*
|
||||||
|
|
||||||
|
/docs/
|
||||||
|
.readthedocs.yaml
|
||||||
20
.gitignore
vendored
20
.gitignore
vendored
@@ -1,12 +1,30 @@
|
|||||||
# IDE files
|
# IDEs
|
||||||
.idea/
|
.idea/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
|
# Tools
|
||||||
|
.mypy_cache/
|
||||||
|
|
||||||
# Runtime
|
# Runtime
|
||||||
|
/static/
|
||||||
|
mail.log/
|
||||||
venv/
|
venv/
|
||||||
|
|
||||||
|
*.pyc
|
||||||
db.sqlite3
|
db.sqlite3
|
||||||
debug.log*
|
debug.log*
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
|
.env
|
||||||
settings.ini
|
settings.ini
|
||||||
|
deployment-key*
|
||||||
|
|
||||||
|
# Deployment
|
||||||
|
/.dbbackup/
|
||||||
|
.vagrant/
|
||||||
|
/custom
|
||||||
|
staging.yml
|
||||||
|
production.yml
|
||||||
|
|
||||||
|
# Docs local builds
|
||||||
|
/docs/build
|
||||||
25
.readthedocs.yaml
Normal file
25
.readthedocs.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# .readthedocs.yaml
|
||||||
|
# Read the Docs configuration file
|
||||||
|
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||||
|
|
||||||
|
# Required
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
# Set the version of Python and other tools you might need
|
||||||
|
build:
|
||||||
|
os: ubuntu-22.04
|
||||||
|
tools:
|
||||||
|
python: "3.11"
|
||||||
|
|
||||||
|
# Build documentation in the docs/ directory with Sphinx
|
||||||
|
sphinx:
|
||||||
|
configuration: docs/source/conf.py
|
||||||
|
|
||||||
|
# If using Sphinx, optionally build your docs in additional formats such as PDF
|
||||||
|
formats:
|
||||||
|
- pdf
|
||||||
|
|
||||||
|
# Optionally declare the Python requirements required to build your docs
|
||||||
|
python:
|
||||||
|
install:
|
||||||
|
- requirements: docs/source/requirements.txt
|
||||||
4
.style.yapf
Normal file
4
.style.yapf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[style]
|
||||||
|
allow_split_before_dict_value=false
|
||||||
|
column_limit=100
|
||||||
|
dedent_closing_brackets=true
|
||||||
16
Caddyfile
Executable file
16
Caddyfile
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
:80 :443 {
|
||||||
|
root * /srv
|
||||||
|
file_server
|
||||||
|
|
||||||
|
@proxy_paths {
|
||||||
|
not path /static/*
|
||||||
|
not path /media/*
|
||||||
|
}
|
||||||
|
|
||||||
|
reverse_proxy @proxy_paths http://server:8000
|
||||||
|
|
||||||
|
log {
|
||||||
|
output stderr
|
||||||
|
format console
|
||||||
|
}
|
||||||
|
}
|
||||||
17
Dockerfile
Executable file
17
Dockerfile
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
FROM python:3.9-slim
|
||||||
|
|
||||||
|
RUN groupadd -r mapper && useradd --no-log-init -r -g mapper mapper
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY requirements.txt ./
|
||||||
|
|
||||||
|
RUN pip install --no-cache-dir --upgrade pip \
|
||||||
|
&& pip install --no-cache-dir -r /app/requirements.txt gunicorn
|
||||||
|
|
||||||
|
COPY . ./
|
||||||
|
|
||||||
|
# USER mapper
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/app/entrypoint.sh" ]
|
||||||
|
CMD [ "gunicorn", "-w", "2", "-b", "0.0.0.0:8000", "breccia_mapper.wsgi" ]
|
||||||
674
LICENSE
Normal file
674
LICENSE
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
16
Makefile
Normal file
16
Makefile
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
.PHONY: docs
|
||||||
|
docs:
|
||||||
|
cd docs; make clean; make html; cd ..
|
||||||
|
yes 'yes' | env/bin/python manage.py collectstatic
|
||||||
|
|
||||||
|
.PHONY: lint
|
||||||
|
lint:
|
||||||
|
prospector
|
||||||
|
|
||||||
|
.PHONY: staging
|
||||||
|
staging:
|
||||||
|
env ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -v -i staging.yml playbook.yml -u jag1e17 -K
|
||||||
|
|
||||||
|
.PHONY: production
|
||||||
|
production:
|
||||||
|
env ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -v -i production.yml playbook.yml -u jag1e17 -K
|
||||||
31
README.md
Normal file
31
README.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# BRECcIA Mapper
|
||||||
|
|
||||||
|
[](https://docs.gcrf-breccia.com/en/latest/?badge=latest)
|
||||||
|
|
||||||
|
BRECcIA Mapper is a web app to collect and explore data about the relationships between researchers and their stakeholders on large-scale, multi-site research projects.
|
||||||
|
This allows researchers to visually represent the relationships between project staff and stakeholders involved in the their project at different points in time.
|
||||||
|
Through this it is possible to explore the extent of networks and change over time, and identify where new relationships can be developed or existing ones strengthened.
|
||||||
|
|
||||||
|
This work was funded through the "Building REsearch Capacity for sustainable water and food security In drylands of sub-saharan Africa" (BRECcIA) project which is supported by UK Research and Innovation as part of the Global Challenges Research Fund, grant number NE/P021093/1.
|
||||||
|
|
||||||
|
## Deployment
|
||||||
|
|
||||||
|
This project is written in Python using the popular [Django](https://www.djangoproject.com/) framework.
|
||||||
|
Deployment relies on [Docker Compose](https://docs.docker.com/compose) but is possible with various methods. See [the documentation](https://docs.gcrf-breccia.com/en/latest/1-deployment.html) for details.
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
- James Graham (@jag1g13) - developer
|
||||||
|
- Matthew Grove (@mgrove36) - developer
|
||||||
|
- Genevieve Agaba
|
||||||
|
- Sebastian Reichel
|
||||||
|
- Claire Bedelian
|
||||||
|
- Eunice Shame
|
||||||
|
- Fiona Ngarachu
|
||||||
|
- Gertrude Domfeh
|
||||||
|
- Henry Hunga
|
||||||
|
- Julie Reeves
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
GPL-3.0 © University of Southampton
|
||||||
0
activities/__init__.py
Normal file
0
activities/__init__.py
Normal file
27
activities/admin.py
Normal file
27
activities/admin.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
"""
|
||||||
|
Admin site panels for models in the Activities app.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
from . import models
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(models.ActivityType)
|
||||||
|
class ActivityTypeAdmin(admin.ModelAdmin):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(models.ActivityMedium)
|
||||||
|
class ActivityMediumAdmin(admin.ModelAdmin):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(models.ActivitySeries)
|
||||||
|
class ActivitySeriesAdmin(admin.ModelAdmin):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(models.Activity)
|
||||||
|
class ActivityAdmin(admin.ModelAdmin):
|
||||||
|
pass
|
||||||
5
activities/apps.py
Normal file
5
activities/apps.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class ActivitiesConfig(AppConfig):
|
||||||
|
name = 'activities'
|
||||||
14
activities/forms.py
Normal file
14
activities/forms.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
from django import forms
|
||||||
|
|
||||||
|
from . import models
|
||||||
|
|
||||||
|
|
||||||
|
class ActivityForm(forms.ModelForm):
|
||||||
|
class Meta:
|
||||||
|
model = models.Activity
|
||||||
|
fields = [
|
||||||
|
'name',
|
||||||
|
'series',
|
||||||
|
'type',
|
||||||
|
'medium',
|
||||||
|
]
|
||||||
36
activities/migrations/0001_initial.py
Normal file
36
activities/migrations/0001_initial.py
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# Generated by Django 2.2.9 on 2020-02-14 09:47
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='ActivitySeries',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('name', models.CharField(max_length=255)),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'verbose_name_plural': 'activity series',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Activity',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('name', models.CharField(max_length=255)),
|
||||||
|
('series', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='instances', to='activities.ActivitySeries')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'verbose_name_plural': 'activities',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
52
activities/migrations/0002_activity_type_medium.py
Normal file
52
activities/migrations/0002_activity_type_medium.py
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# Generated by Django 2.2.10 on 2020-02-19 13:01
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('activities', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='ActivityMedium',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='ActivityType',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='activity',
|
||||||
|
name='medium',
|
||||||
|
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='activities.ActivityMedium'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='activity',
|
||||||
|
name='type',
|
||||||
|
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='activities.ActivityType'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='activityseries',
|
||||||
|
name='medium',
|
||||||
|
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='activities.ActivityMedium'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='activityseries',
|
||||||
|
name='type',
|
||||||
|
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='activities.ActivityType'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
||||||
19
activities/migrations/0003_rename_activity_series_fk.py
Normal file
19
activities/migrations/0003_rename_activity_series_fk.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 2.2.10 on 2020-02-19 13:32
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('activities', '0002_activity_type_medium'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='activity',
|
||||||
|
name='series',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='activities', to='activities.ActivitySeries'),
|
||||||
|
),
|
||||||
|
]
|
||||||
19
activities/migrations/0004_activity_attendance_list.py
Normal file
19
activities/migrations/0004_activity_attendance_list.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 2.2.10 on 2020-02-19 15:20
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('people', '0005_user_one_person'),
|
||||||
|
('activities', '0003_rename_activity_series_fk'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='activity',
|
||||||
|
name='attendance_list',
|
||||||
|
field=models.ManyToManyField(related_name='activities', to='people.Person'),
|
||||||
|
),
|
||||||
|
]
|
||||||
23
activities/migrations/0005_shrink_name_fields_to_255.py
Normal file
23
activities/migrations/0005_shrink_name_fields_to_255.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 2.2.10 on 2020-02-28 15:03
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('activities', '0004_activity_attendance_list'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='activity',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(max_length=255),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='activityseries',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(max_length=255),
|
||||||
|
),
|
||||||
|
]
|
||||||
18
activities/migrations/0006_activity_attendance_optional.py
Normal file
18
activities/migrations/0006_activity_attendance_optional.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 2.2.10 on 2020-04-02 15:57
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('activities', '0005_shrink_name_fields_to_255'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='activity',
|
||||||
|
name='attendance_list',
|
||||||
|
field=models.ManyToManyField(blank=True, related_name='activities', to='people.Person'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Generated by Django 4.1.4 on 2023-01-05 16:57
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('activities', '0006_activity_attendance_optional'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='activity',
|
||||||
|
name='id',
|
||||||
|
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='activitymedium',
|
||||||
|
name='id',
|
||||||
|
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='activityseries',
|
||||||
|
name='id',
|
||||||
|
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='activitytype',
|
||||||
|
name='id',
|
||||||
|
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||||
|
),
|
||||||
|
]
|
||||||
0
activities/migrations/__init__.py
Normal file
0
activities/migrations/__init__.py
Normal file
99
activities/models.py
Normal file
99
activities/models.py
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
from django.db import models
|
||||||
|
from django.urls import reverse
|
||||||
|
|
||||||
|
|
||||||
|
from people import models as people_models
|
||||||
|
|
||||||
|
|
||||||
|
class ActivityType(models.Model):
|
||||||
|
"""
|
||||||
|
Representation of the type of activity being conducted.
|
||||||
|
|
||||||
|
Examples may include: 'research activity' or 'stakeholder engagement'.
|
||||||
|
"""
|
||||||
|
#: Name of this type of activity
|
||||||
|
name = models.CharField(max_length=255,
|
||||||
|
unique=True,
|
||||||
|
blank=False, null=False)
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
|
class ActivityMedium(models.Model):
|
||||||
|
"""
|
||||||
|
Representation of the medium via which the activity is conducted.
|
||||||
|
|
||||||
|
Examples may include: 'face to face' or 'virtual'.
|
||||||
|
"""
|
||||||
|
#: Name of this medium
|
||||||
|
name = models.CharField(max_length=255,
|
||||||
|
unique=True,
|
||||||
|
blank=False, null=False)
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
|
class ActivitySeries(models.Model):
|
||||||
|
"""
|
||||||
|
A series of related :class:`Activity`s.
|
||||||
|
"""
|
||||||
|
class Meta:
|
||||||
|
verbose_name_plural = 'activity series'
|
||||||
|
|
||||||
|
#: Name of activity series
|
||||||
|
name = models.CharField(max_length=255,
|
||||||
|
blank=False, null=False)
|
||||||
|
|
||||||
|
#: What type of activity does this series represent?
|
||||||
|
type = models.ForeignKey(ActivityType,
|
||||||
|
on_delete=models.PROTECT,
|
||||||
|
blank=False, null=False)
|
||||||
|
|
||||||
|
#: How are activities in this series typically conducted?
|
||||||
|
medium = models.ForeignKey(ActivityMedium,
|
||||||
|
on_delete=models.PROTECT,
|
||||||
|
blank=False, null=False)
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
|
class Activity(models.Model):
|
||||||
|
"""
|
||||||
|
An instance of an activity - e.g. a workshop.
|
||||||
|
"""
|
||||||
|
class Meta:
|
||||||
|
verbose_name_plural = 'activities'
|
||||||
|
|
||||||
|
#: Name of activity
|
||||||
|
name = models.CharField(max_length=255,
|
||||||
|
blank=False, null=False)
|
||||||
|
|
||||||
|
#: Optional :class:`ActivitySeries` to which this activity belongs
|
||||||
|
series = models.ForeignKey(ActivitySeries,
|
||||||
|
related_name='activities',
|
||||||
|
on_delete=models.PROTECT,
|
||||||
|
blank=True, null=True)
|
||||||
|
|
||||||
|
#: What type of activity is this?
|
||||||
|
type = models.ForeignKey(ActivityType,
|
||||||
|
on_delete=models.PROTECT,
|
||||||
|
blank=False, null=False)
|
||||||
|
|
||||||
|
#: How was this activity conducted?
|
||||||
|
medium = models.ForeignKey(ActivityMedium,
|
||||||
|
on_delete=models.PROTECT,
|
||||||
|
blank=False, null=False)
|
||||||
|
|
||||||
|
#: Who attended this activity?
|
||||||
|
attendance_list = models.ManyToManyField(people_models.Person,
|
||||||
|
related_name='activities',
|
||||||
|
blank=True)
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse('activities:activity.detail', kwargs={'pk': self.pk})
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return self.name
|
||||||
29
activities/templates/activities/activity/create.html
Normal file
29
activities/templates/activities/activity/create.html
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<nav aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
<a href="{% url 'activities:activity.list' %}">Activities</a>
|
||||||
|
</li>
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">Create</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<h1>New Activity</h1>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<form class="form"
|
||||||
|
method="POST">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
|
||||||
|
{% buttons %}
|
||||||
|
<button class="btn btn-success" type="submit">Submit</button>
|
||||||
|
{% endbuttons %}
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
131
activities/templates/activities/activity/detail.html
Normal file
131
activities/templates/activities/activity/detail.html
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<nav aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
<a href="{% url 'activities:activity.list' %}">Activities</a>
|
||||||
|
</li>
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">{{ object }}</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<h1>{{ activity.name }}</h1>
|
||||||
|
|
||||||
|
{% if user_is_attending %}
|
||||||
|
<button class="btn btn-danger"
|
||||||
|
onclick="clickCancelAttend();">
|
||||||
|
Cancel Attendance
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
<button class="btn btn-success"
|
||||||
|
onclick="clickAttend();">
|
||||||
|
Attend
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
<dt>Series</dt>
|
||||||
|
<dl>{{ activity.series|default_if_none:'Standalone Activity' }}</dl>
|
||||||
|
|
||||||
|
<dt>Type</dt>
|
||||||
|
<dd>{{ activity.type }}</dd>
|
||||||
|
|
||||||
|
<dt>Medium</dt>
|
||||||
|
<dd>{{ activity.medium }}</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h2>Attendance</h2>
|
||||||
|
|
||||||
|
<table class="table table-borderless">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{% for person in activity.attendance_list.all %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ person }}</td>
|
||||||
|
<td>
|
||||||
|
<a class="btn btn-sm btn-info"
|
||||||
|
href="{% url 'people:person.detail' pk=person.pk %}">Profile</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{% empty %}
|
||||||
|
<tr>
|
||||||
|
<td>No records</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block extra_script %}
|
||||||
|
<script type="application/javascript">
|
||||||
|
/**
|
||||||
|
* Get the value of a named cookie.
|
||||||
|
*/
|
||||||
|
function getCookie(name) {
|
||||||
|
for (const cookie of document.cookie.split(';')) {
|
||||||
|
const tokens = cookie.split('=');
|
||||||
|
if (tokens[0].trim() === name) {
|
||||||
|
return tokens[1].trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Submit that user is attending this activity.
|
||||||
|
*/
|
||||||
|
function clickAttend() {
|
||||||
|
$.ajax({
|
||||||
|
url: '{% url "activities:activity.attendance" pk=activity.pk %}',
|
||||||
|
type: 'POST',
|
||||||
|
contentType: 'application/json',
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
},
|
||||||
|
data: JSON.stringify({
|
||||||
|
pk: {{ request.user.person.pk }}
|
||||||
|
}),
|
||||||
|
success: function() {
|
||||||
|
location.reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Submit that user is not attending this activity.
|
||||||
|
*/
|
||||||
|
function clickCancelAttend() {
|
||||||
|
$.ajax({
|
||||||
|
url: '{% url "activities:activity.attendance" pk=activity.pk %}',
|
||||||
|
type: 'DELETE',
|
||||||
|
contentType: 'application/json',
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
},
|
||||||
|
data: JSON.stringify({
|
||||||
|
pk: {{ request.user.person.pk }}
|
||||||
|
}),
|
||||||
|
success: function() {
|
||||||
|
location.reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
42
activities/templates/activities/activity/list.html
Normal file
42
activities/templates/activities/activity/list.html
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<nav aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">Activities</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<h1>Activities</h1>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<a class="btn btn-success"
|
||||||
|
href="{% url 'activities:activity.create' %}">New Activity</a>
|
||||||
|
|
||||||
|
<table class="table table-borderless">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{% for activity in activity_list.all %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ activity }}</td>
|
||||||
|
<td>
|
||||||
|
<a class="btn btn-sm btn-info"
|
||||||
|
href="{% url 'activities:activity.detail' pk=activity.pk %}">Details</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{% empty %}
|
||||||
|
<tr>
|
||||||
|
<td>No records</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
52
activities/templates/activities/activity_series/detail.html
Normal file
52
activities/templates/activities/activity_series/detail.html
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<nav aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
<a href="{% url 'activities:activity-series.list' %}">Activity Series</a>
|
||||||
|
</li>
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">{{ object }}</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<h1>{{ activity_series.name }}</h1>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
<dt>Type</dt>
|
||||||
|
<dd>{{ activity_series.type }}</dd>
|
||||||
|
|
||||||
|
<dt>Medium</dt>
|
||||||
|
<dd>{{ activity_series.medium }}</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<table class="table table-borderless">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{% for activity in activity_series.activities.all %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ activity }}</td>
|
||||||
|
<td>
|
||||||
|
<a class="btn btn-sm btn-info"
|
||||||
|
href="{% url 'activities:activity.detail' pk=activity.pk %}">Details</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{% empty %}
|
||||||
|
<tr>
|
||||||
|
<td>No records</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
39
activities/templates/activities/activity_series/list.html
Normal file
39
activities/templates/activities/activity_series/list.html
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<nav aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">Activity Series</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<h1>Activity Series</h1>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<table class="table table-borderless">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{% for activity_series in activity_series_list.all %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ activity_series }}</td>
|
||||||
|
<td>
|
||||||
|
<a class="btn btn-sm btn-info"
|
||||||
|
href="{% url 'activities:activity-series.detail' pk=activity_series.pk %}">Details</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{% empty %}
|
||||||
|
<tr>
|
||||||
|
<td>No records</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
32
activities/urls.py
Normal file
32
activities/urls.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
from django.urls import path
|
||||||
|
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
|
||||||
|
app_name = 'activities'
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('activity-series',
|
||||||
|
views.ActivitySeriesListView.as_view(),
|
||||||
|
name='activity-series.list'),
|
||||||
|
|
||||||
|
path('activity-series/<int:pk>',
|
||||||
|
views.ActivitySeriesDetailView.as_view(),
|
||||||
|
name='activity-series.detail'),
|
||||||
|
|
||||||
|
path('activities/create',
|
||||||
|
views.ActivityCreateView.as_view(),
|
||||||
|
name='activity.create'),
|
||||||
|
|
||||||
|
path('activities',
|
||||||
|
views.ActivityListView.as_view(),
|
||||||
|
name='activity.list'),
|
||||||
|
|
||||||
|
path('activities/<int:pk>',
|
||||||
|
views.ActivityDetailView.as_view(),
|
||||||
|
name='activity.detail'),
|
||||||
|
|
||||||
|
path('activities/<int:pk>/attendance',
|
||||||
|
views.ActivityAttendanceView.as_view(),
|
||||||
|
name='activity.attendance'),
|
||||||
|
]
|
||||||
97
activities/views.py
Normal file
97
activities/views.py
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
"""
|
||||||
|
Views for displaying / manipulating models within the Activities app.
|
||||||
|
"""
|
||||||
|
import json
|
||||||
|
|
||||||
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||||
|
from django.http import HttpResponse
|
||||||
|
from django.views.generic import CreateView, DetailView, ListView, View
|
||||||
|
from django.views.generic.detail import SingleObjectMixin
|
||||||
|
|
||||||
|
from people import models as people_models
|
||||||
|
from people import permissions
|
||||||
|
from . import forms, models
|
||||||
|
|
||||||
|
|
||||||
|
class ActivitySeriesListView(LoginRequiredMixin, ListView):
|
||||||
|
"""
|
||||||
|
View displaying a list of :class:`ActivitySeries`.
|
||||||
|
"""
|
||||||
|
model = models.ActivitySeries
|
||||||
|
template_name = 'activities/activity_series/list.html'
|
||||||
|
context_object_name = 'activity_series_list'
|
||||||
|
|
||||||
|
|
||||||
|
class ActivitySeriesDetailView(LoginRequiredMixin, DetailView):
|
||||||
|
"""
|
||||||
|
View displaying details of a single :class:`ActivitySeries`.
|
||||||
|
"""
|
||||||
|
model = models.ActivitySeries
|
||||||
|
template_name = 'activities/activity_series/detail.html'
|
||||||
|
context_object_name = 'activity_series'
|
||||||
|
|
||||||
|
|
||||||
|
class ActivityCreateView(LoginRequiredMixin, CreateView):
|
||||||
|
"""
|
||||||
|
View to create a new instance of :class:`Activity`.
|
||||||
|
"""
|
||||||
|
model = models.Activity
|
||||||
|
template_name = 'activities/activity/create.html'
|
||||||
|
form_class = forms.ActivityForm
|
||||||
|
|
||||||
|
|
||||||
|
class ActivityListView(LoginRequiredMixin, ListView):
|
||||||
|
"""
|
||||||
|
View displaying a list of :class:`Activity`.
|
||||||
|
"""
|
||||||
|
model = models.Activity
|
||||||
|
template_name = 'activities/activity/list.html'
|
||||||
|
|
||||||
|
|
||||||
|
class ActivityDetailView(LoginRequiredMixin, DetailView):
|
||||||
|
"""
|
||||||
|
View displaying details of a single :class:`Activity`.
|
||||||
|
"""
|
||||||
|
model = models.Activity
|
||||||
|
template_name = 'activities/activity/detail.html'
|
||||||
|
|
||||||
|
def get_context_data(self, **kwargs):
|
||||||
|
context = super().get_context_data(**kwargs)
|
||||||
|
|
||||||
|
context['user_is_attending'] = self.object.attendance_list.filter(
|
||||||
|
pk=self.request.user.person.pk
|
||||||
|
).exists()
|
||||||
|
|
||||||
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
class ActivityAttendanceView(permissions.UserIsLinkedPersonMixin, SingleObjectMixin, View):
|
||||||
|
"""
|
||||||
|
View to add or delete attendance of an activity.
|
||||||
|
"""
|
||||||
|
model = models.Activity
|
||||||
|
|
||||||
|
def get_test_person(self) -> people_models.Person:
|
||||||
|
data = json.loads(self.request.body)
|
||||||
|
|
||||||
|
return people_models.Person.objects.get(pk=data['pk'])
|
||||||
|
|
||||||
|
def post(self, request, *args, **kwargs):
|
||||||
|
self.object = self.get_object()
|
||||||
|
|
||||||
|
if request.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest':
|
||||||
|
self.object.attendance_list.add(self.get_test_person())
|
||||||
|
|
||||||
|
return HttpResponse(status=204)
|
||||||
|
|
||||||
|
return HttpResponse("URL does not support non-AJAX requests", status=400)
|
||||||
|
|
||||||
|
def delete(self, request, *args, **kwargs):
|
||||||
|
self.object = self.get_object()
|
||||||
|
|
||||||
|
if request.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest':
|
||||||
|
self.object.attendance_list.remove(self.get_test_person())
|
||||||
|
|
||||||
|
return HttpResponse(status=204)
|
||||||
|
|
||||||
|
return HttpResponse("URL does not support non-AJAX requests", status=400)
|
||||||
6
backports/__init__.py
Normal file
6
backports/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
"""
|
||||||
|
These files are backported functionality from future versions of Django.
|
||||||
|
|
||||||
|
- models.db.enums - copied from Django 3.0.3
|
||||||
|
See https://github.com/django/django/blob/3.0.3/django/db/models/enums.py
|
||||||
|
"""
|
||||||
0
backports/db/__init__.py
Normal file
0
backports/db/__init__.py
Normal file
0
backports/db/models/__init__.py
Normal file
0
backports/db/models/__init__.py
Normal file
82
backports/db/models/enums.py
Normal file
82
backports/db/models/enums.py
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
import enum
|
||||||
|
|
||||||
|
from django.utils.functional import Promise
|
||||||
|
|
||||||
|
__all__ = ['Choices', 'IntegerChoices', 'TextChoices']
|
||||||
|
|
||||||
|
|
||||||
|
class ChoicesMeta(enum.EnumMeta):
|
||||||
|
"""A metaclass for creating a enum choices."""
|
||||||
|
|
||||||
|
def __new__(metacls, classname, bases, classdict):
|
||||||
|
labels = []
|
||||||
|
for key in classdict._member_names:
|
||||||
|
value = classdict[key]
|
||||||
|
if (
|
||||||
|
isinstance(value, (list, tuple)) and
|
||||||
|
len(value) > 1 and
|
||||||
|
isinstance(value[-1], (Promise, str))
|
||||||
|
):
|
||||||
|
*value, label = value
|
||||||
|
value = tuple(value)
|
||||||
|
else:
|
||||||
|
label = key.replace('_', ' ').title()
|
||||||
|
labels.append(label)
|
||||||
|
# Use dict.__setitem__() to suppress defenses against double
|
||||||
|
# assignment in enum's classdict.
|
||||||
|
dict.__setitem__(classdict, key, value)
|
||||||
|
cls = super().__new__(metacls, classname, bases, classdict)
|
||||||
|
cls._value2label_map_ = dict(zip(cls._value2member_map_, labels))
|
||||||
|
# Add a label property to instances of enum which uses the enum member
|
||||||
|
# that is passed in as "self" as the value to use when looking up the
|
||||||
|
# label in the choices.
|
||||||
|
cls.label = property(lambda self: cls._value2label_map_.get(self.value))
|
||||||
|
cls.do_not_call_in_templates = True
|
||||||
|
return enum.unique(cls)
|
||||||
|
|
||||||
|
def __contains__(cls, member):
|
||||||
|
if not isinstance(member, enum.Enum):
|
||||||
|
# Allow non-enums to match against member values.
|
||||||
|
return member in {x.value for x in cls}
|
||||||
|
return super().__contains__(member)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def names(cls):
|
||||||
|
empty = ['__empty__'] if hasattr(cls, '__empty__') else []
|
||||||
|
return empty + [member.name for member in cls]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def choices(cls):
|
||||||
|
empty = [(None, cls.__empty__)] if hasattr(cls, '__empty__') else []
|
||||||
|
return empty + [(member.value, member.label) for member in cls]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def labels(cls):
|
||||||
|
return [label for _, label in cls.choices]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def values(cls):
|
||||||
|
return [value for value, _ in cls.choices]
|
||||||
|
|
||||||
|
|
||||||
|
class Choices(enum.Enum, metaclass=ChoicesMeta):
|
||||||
|
"""Class for creating enumerated choices."""
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
"""
|
||||||
|
Use value when cast to str, so that Choices set as model instance
|
||||||
|
attributes are rendered as expected in templates and similar contexts.
|
||||||
|
"""
|
||||||
|
return str(self.value)
|
||||||
|
|
||||||
|
|
||||||
|
class IntegerChoices(int, Choices):
|
||||||
|
"""Class for creating enumerated integer choices."""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class TextChoices(str, Choices):
|
||||||
|
"""Class for creating enumerated string choices."""
|
||||||
|
|
||||||
|
def _generate_next_value_(name, start, count, last_values):
|
||||||
|
return name
|
||||||
16
breccia_mapper/account_adapter.py
Normal file
16
breccia_mapper/account_adapter.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
from allauth.account.adapter import DefaultAccountAdapter
|
||||||
|
from constance import config
|
||||||
|
|
||||||
|
|
||||||
|
class ControlSignupsAccountAdapter(DefaultAccountAdapter):
|
||||||
|
|
||||||
|
def is_open_for_signup(self, request):
|
||||||
|
"""
|
||||||
|
Checks whether or not the site is open for signups.
|
||||||
|
|
||||||
|
Next to simply returning True/False you can also intervene the
|
||||||
|
regular flow by raising an ImmediateHttpResponse
|
||||||
|
|
||||||
|
(Comment reproduced from the overridden method.)
|
||||||
|
"""
|
||||||
|
return config.ALLOW_SIGNUPS
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"model": "bootstrap_customizer.sitebootstraptheme",
|
||||||
|
"pk": 1,
|
||||||
|
"fields": { "site": 1, "bootstrap_theme": 1, "updated": "2023-02-23T14:41:48.620Z" }
|
||||||
|
}
|
||||||
|
]
|
||||||
1
breccia_mapper/fixtures/bootstrap_customizer_theme.json
Normal file
1
breccia_mapper/fixtures/bootstrap_customizer_theme.json
Normal file
File diff suppressed because one or more lines are too long
15
breccia_mapper/forms.py
Normal file
15
breccia_mapper/forms.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
from django import forms
|
||||||
|
from django.contrib.auth import get_user_model
|
||||||
|
|
||||||
|
User = get_user_model() # pylint: disable=invalid-name
|
||||||
|
|
||||||
|
|
||||||
|
class ConsentForm(forms.ModelForm):
|
||||||
|
"""Form used to collect user consent for data collection / processing."""
|
||||||
|
class Meta:
|
||||||
|
model = User
|
||||||
|
fields = ['consent_given']
|
||||||
|
labels = {
|
||||||
|
'consent_given':
|
||||||
|
'I have read and understood this information and consent to my data being used in this way',
|
||||||
|
}
|
||||||
0
breccia_mapper/management/__init__.py
Normal file
0
breccia_mapper/management/__init__.py
Normal file
0
breccia_mapper/management/commands/__init__.py
Normal file
0
breccia_mapper/management/commands/__init__.py
Normal file
44
breccia_mapper/management/commands/selectiveloaddata.py
Normal file
44
breccia_mapper/management/commands/selectiveloaddata.py
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
from django.core.management.commands import loaddata
|
||||||
|
|
||||||
|
from bootstrap_customizer.models import BootstrapTheme
|
||||||
|
|
||||||
|
|
||||||
|
def should_add_record(record):
|
||||||
|
if record['model'] != 'bootstrap_customizer.bootstraptheme':
|
||||||
|
return True
|
||||||
|
|
||||||
|
return not BootstrapTheme.objects.filter(
|
||||||
|
pk=record['pk'],
|
||||||
|
).exists()
|
||||||
|
|
||||||
|
|
||||||
|
class Command(loaddata.Command):
|
||||||
|
def handle(self, *args, **options):
|
||||||
|
args = list(args)
|
||||||
|
|
||||||
|
# Read the original JSON file
|
||||||
|
file_name = args[0]
|
||||||
|
with open(file_name) as json_file:
|
||||||
|
json_list = json.load(json_file)
|
||||||
|
|
||||||
|
# Filter out records that already exists
|
||||||
|
json_list_filtered = list(filter(should_add_record, json_list))
|
||||||
|
if not json_list_filtered:
|
||||||
|
print("All data are already previously loaded")
|
||||||
|
return
|
||||||
|
|
||||||
|
# Write the updated JSON file
|
||||||
|
file_dir_and_name, file_ext = os.path.splitext(file_name)
|
||||||
|
file_name_temp = f"{file_dir_and_name}_temp{file_ext}"
|
||||||
|
with open(file_name_temp, 'w') as json_file_temp:
|
||||||
|
json.dump(json_list_filtered, json_file_temp)
|
||||||
|
|
||||||
|
# Pass the request to the actual loaddata (parent functionality)
|
||||||
|
args[0] = file_name_temp
|
||||||
|
super().handle(*args, **options)
|
||||||
|
|
||||||
|
# You can choose to not delete the file so that you can see what was added to your records
|
||||||
|
os.remove(file_name_temp)
|
||||||
@@ -11,33 +11,139 @@ https://docs.djangoproject.com/en/2.2/ref/settings/
|
|||||||
|
|
||||||
Before production deployment, see
|
Before production deployment, see
|
||||||
https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
|
https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
|
||||||
|
|
||||||
|
|
||||||
|
Many configuration settings are input from `.env`.
|
||||||
|
The most likely required settings are: SECRET_KEY, DEBUG, ALLOWED_HOSTS, PROJECT_*_NAME, EMAIL_*
|
||||||
|
|
||||||
|
- SECRET_KEY (REQUIRED)
|
||||||
|
Used to generate CSRF tokens - must never be made public
|
||||||
|
|
||||||
|
- DEBUG
|
||||||
|
default: False
|
||||||
|
Should the server run in debug mode? Provides information to users which is unsafe in production
|
||||||
|
|
||||||
|
- SITE_URL
|
||||||
|
default: localhost
|
||||||
|
The URL the site will be deployed on. Do not include http://, https://, or a trailing slash.
|
||||||
|
|
||||||
|
- SITE_PROTOCOL
|
||||||
|
default: http
|
||||||
|
The protocol the site uses. Valid options are http or https.
|
||||||
|
|
||||||
|
- PROJECT_LONG_NAME
|
||||||
|
default: Project Network Mapper
|
||||||
|
The project's full name.
|
||||||
|
|
||||||
|
- PROJECT_SHORT_NAME
|
||||||
|
default: Network Mapper
|
||||||
|
The project's short/abbreviated name. This will also be used as the app's name when installed as PWA.
|
||||||
|
|
||||||
|
- PROJECT_DESCRIPTION
|
||||||
|
default: Application to map network relationships in the organisation.
|
||||||
|
The project's description. Used when installed as a PWA.
|
||||||
|
|
||||||
|
- THEME_COLOR
|
||||||
|
default: 212121
|
||||||
|
The project's theme color, in hex format (excluding the leading #).
|
||||||
|
|
||||||
|
- BACKGROUND_COLOR
|
||||||
|
default: ffffff
|
||||||
|
The project's background color, in hex format (excluding the leading #).
|
||||||
|
|
||||||
|
- ALLOWED_HOSTS
|
||||||
|
default: * if DEBUG else localhost
|
||||||
|
Accepted values for server header in request - protects against CSRF and CSS attacks
|
||||||
|
|
||||||
|
- DBBACKUP_STORAGE_LOCATION
|
||||||
|
default: .dbbackup
|
||||||
|
Directory where database backups should be stored
|
||||||
|
|
||||||
|
- LANGUAGE_CODE
|
||||||
|
default: en-gb
|
||||||
|
Default language - used for translation - has not been enabled
|
||||||
|
|
||||||
|
- TIME_ZONE
|
||||||
|
default: UTC
|
||||||
|
Default timezone
|
||||||
|
|
||||||
|
- LOG_LEVEL
|
||||||
|
default: INFO
|
||||||
|
Level of messages written to log file
|
||||||
|
|
||||||
|
- LOG_FILENAME
|
||||||
|
default: debug.log
|
||||||
|
Path to logfile
|
||||||
|
|
||||||
|
- LOG_DAYS
|
||||||
|
default: 14
|
||||||
|
Number of days of logs to keep - logfile is rotated out at the end of each day
|
||||||
|
|
||||||
|
- EMAIL_HOST
|
||||||
|
default: None
|
||||||
|
Hostname of SMTP server
|
||||||
|
|
||||||
|
- DEFAULT_FROM_EMAIL
|
||||||
|
default: None
|
||||||
|
Email address from which messages are sent
|
||||||
|
|
||||||
|
- EMAIL_FILE_PATH (debug only)
|
||||||
|
default: mail.log
|
||||||
|
Directory where emails will be stored if not using an SMTP server
|
||||||
|
|
||||||
|
- EMAIL_HOST_USER
|
||||||
|
default: None
|
||||||
|
Username to authenticate with SMTP server
|
||||||
|
|
||||||
|
- EMAIL_HOST_PASSWORD
|
||||||
|
default: None
|
||||||
|
Password to authenticate with SMTP server
|
||||||
|
|
||||||
|
- EMAIL_PORT
|
||||||
|
default: 25
|
||||||
|
Port to access on SMTP server
|
||||||
|
|
||||||
|
- EMAIL_USE_TLS
|
||||||
|
default: True if EMAIL_PORT == 587 else False
|
||||||
|
Use TLS to communicate with SMTP server? Usually on port 587
|
||||||
|
|
||||||
|
- EMAIL_USE_SSL
|
||||||
|
default: True if EMAIL_PORT == 465 else False
|
||||||
|
Use SSL to communicate with SMTP server? Usually on port 465
|
||||||
|
|
||||||
|
- GOOGLE_MAPS_API_KEY
|
||||||
|
default: None
|
||||||
|
Google Maps API key to display maps of people's locations
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import collections
|
import logging
|
||||||
|
import logging.config
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
|
from django.urls import reverse_lazy
|
||||||
|
|
||||||
from decouple import config, Csv
|
from decouple import config, Csv
|
||||||
import dj_database_url
|
import dj_database_url
|
||||||
|
|
||||||
|
|
||||||
# Settings exported to templates
|
# Settings exported to templates
|
||||||
# https://github.com/jakubroztocil/django-settings-export
|
# https://github.com/jakubroztocil/django-settings-export
|
||||||
|
|
||||||
SETTINGS_EXPORT = [
|
SETTINGS_EXPORT = [
|
||||||
'DEBUG',
|
'DEBUG',
|
||||||
|
'SITE_URL',
|
||||||
|
'SITE_PROTOCOL',
|
||||||
|
'GOOGLE_MAPS_API_KEY',
|
||||||
'PROJECT_LONG_NAME',
|
'PROJECT_LONG_NAME',
|
||||||
'PROJECT_SHORT_NAME',
|
'PROJECT_SHORT_NAME',
|
||||||
|
'PROJECT_DESCRIPTION',
|
||||||
|
'THEME_COLOR',
|
||||||
|
'BACKGROUND_COLOR',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
PROJECT_LONG_NAME = config('PROJECT_LONG_NAME', default='Project Long Name')
|
|
||||||
PROJECT_SHORT_NAME = config('PROJECT_SHORT_NAME', default='shortname')
|
|
||||||
|
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR.joinpath(...)
|
# Build paths inside the project like this: BASE_DIR.joinpath(...)
|
||||||
BASE_DIR = pathlib.Path(__file__).parent.parent
|
BASE_DIR = pathlib.Path(__file__).parent.parent
|
||||||
|
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = config('SECRET_KEY')
|
SECRET_KEY = config('SECRET_KEY')
|
||||||
|
|
||||||
@@ -47,9 +153,28 @@ DEBUG = config('DEBUG', default=False, cast=bool)
|
|||||||
ALLOWED_HOSTS = config(
|
ALLOWED_HOSTS = config(
|
||||||
'ALLOWED_HOSTS',
|
'ALLOWED_HOSTS',
|
||||||
default='*' if DEBUG else '127.0.0.1,localhost,localhost.localdomain',
|
default='*' if DEBUG else '127.0.0.1,localhost,localhost.localdomain',
|
||||||
cast=Csv()
|
cast=Csv())
|
||||||
)
|
|
||||||
|
|
||||||
|
# Site URL
|
||||||
|
SITE_URL = config('SITE_URL', default='localhost')
|
||||||
|
SITE_PROTOCOL = config('SITE_PROTOCOL', default='http')
|
||||||
|
|
||||||
|
# CORS settings
|
||||||
|
CORS_ALLOW_CREDENTIALS = True
|
||||||
|
CORS_ORIGIN_ALLOW_ALL = True
|
||||||
|
CORS_ALLOW_CREDENTIALS = True
|
||||||
|
CSRF_TRUSTED_ORIGINS = config(
|
||||||
|
'TRUSTED_ORIGINS',
|
||||||
|
default='*' if DEBUG else 'http://127.0.0.1,http://localhost,http://localhost.localdomain',
|
||||||
|
cast=Csv())
|
||||||
|
CORS_REPLACE_HTTPS_REFERER = True
|
||||||
|
CSRF_COOKIE_DOMAIN = config(
|
||||||
|
'SITE_URL',
|
||||||
|
default='localhost')
|
||||||
|
CORS_ORIGIN_WHITELIST = config(
|
||||||
|
'TRUSTED_ORIGINS',
|
||||||
|
default='*' if DEBUG else 'http://127.0.0.1,http://localhost,http://localhost.localdomain',
|
||||||
|
cast=Csv())
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
@@ -60,16 +185,35 @@ DJANGO_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'django.contrib.sites',
|
||||||
]
|
]
|
||||||
|
|
||||||
THIRD_PARTY_APPS = [
|
THIRD_PARTY_APPS = [
|
||||||
'bootstrap4',
|
'bootstrap4',
|
||||||
'constance',
|
'constance',
|
||||||
'constance.backends.database',
|
'constance.backends.database',
|
||||||
|
'dbbackup',
|
||||||
|
'django_countries',
|
||||||
|
'django_select2',
|
||||||
|
'rest_framework',
|
||||||
|
'post_office',
|
||||||
|
'bootstrap_datepicker_plus',
|
||||||
|
'hijack',
|
||||||
|
'pwa',
|
||||||
|
'allauth',
|
||||||
|
'allauth.account',
|
||||||
|
'allauth.socialaccount',
|
||||||
|
'allauth.socialaccount.providers.google',
|
||||||
|
'allauth.socialaccount.providers.microsoft',
|
||||||
|
'django_inlinecss',
|
||||||
|
'bootstrap_customizer',
|
||||||
]
|
]
|
||||||
|
|
||||||
FIRST_PARTY_APPS = [
|
FIRST_PARTY_APPS = [
|
||||||
|
'breccia_mapper',
|
||||||
'people',
|
'people',
|
||||||
|
'activities',
|
||||||
|
'export',
|
||||||
]
|
]
|
||||||
|
|
||||||
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + FIRST_PARTY_APPS
|
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + FIRST_PARTY_APPS
|
||||||
@@ -82,6 +226,13 @@ MIDDLEWARE = [
|
|||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
'hijack.middleware.HijackUserMiddleware',
|
||||||
|
'django.contrib.sites.middleware.CurrentSiteMiddleware',
|
||||||
|
'bootstrap_customizer.middleware.BootstrapThemeMiddleware',
|
||||||
|
]
|
||||||
|
|
||||||
|
FIXTURE_DIRS = [
|
||||||
|
BASE_DIR.joinpath('breccia_mapper', 'fixtures'),
|
||||||
]
|
]
|
||||||
|
|
||||||
ROOT_URLCONF = 'breccia_mapper.urls'
|
ROOT_URLCONF = 'breccia_mapper.urls'
|
||||||
@@ -106,16 +257,45 @@ TEMPLATES = [
|
|||||||
|
|
||||||
WSGI_APPLICATION = 'breccia_mapper.wsgi.application'
|
WSGI_APPLICATION = 'breccia_mapper.wsgi.application'
|
||||||
|
|
||||||
|
# allauth
|
||||||
|
AUTHENTICATION_BACKENDS = [
|
||||||
|
# Needed to login by username in Django admin, regardless of `allauth`
|
||||||
|
'django.contrib.auth.backends.ModelBackend',
|
||||||
|
# `allauth` specific authentication methods, such as login by email
|
||||||
|
'allauth.account.auth_backends.AuthenticationBackend',
|
||||||
|
]
|
||||||
|
SITE_ID = 1
|
||||||
|
ACCOUNT_DEFAULT_HTTP_PROTOCOL = SITE_PROTOCOL
|
||||||
|
ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 1
|
||||||
|
ACCOUNT_EMAIL_REQUIRED = True
|
||||||
|
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
|
||||||
|
ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 5
|
||||||
|
# 1 day
|
||||||
|
ACCOUNT_LOGIN_ATTEMPTS_TIMEOUT = 86400
|
||||||
|
# or any other page
|
||||||
|
ACCOUNT_LOGOUT_REDIRECT_URL = '/'
|
||||||
|
ACCOUNT_ADAPTER = 'breccia_mapper.account_adapter.ControlSignupsAccountAdapter'
|
||||||
|
|
||||||
|
|
||||||
|
PROJECT_LONG_NAME = config('PROJECT_LONG_NAME', 'Project Network Mapper')
|
||||||
|
PROJECT_SHORT_NAME = config('PROJECT_SHORT_NAME', 'Network Mapper')
|
||||||
|
PROJECT_DESCRIPTION = config('PROJECT_DESCRIPTION', 'Application to map network relationships in the organisation.')
|
||||||
|
THEME_COLOR = '#' + config('THEME_COLOR', '212121')
|
||||||
|
BACKGROUND_COLOR = '#' + config('BACKGROUND_COLOR', 'ffffff')
|
||||||
|
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
|
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': config(
|
'default' : {
|
||||||
'DATABASE_URL',
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
default='sqlite:///' + str(BASE_DIR.joinpath('db.sqlite3')),
|
'NAME': 'breccia-mapper',
|
||||||
cast=dj_database_url.parse
|
'USER': 'breccia-mapper',
|
||||||
)
|
'PASSWORD': config('DB_PASSWORD'),
|
||||||
|
'HOST': 'db',
|
||||||
|
'PORT': '5432',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Django DBBackup
|
# Django DBBackup
|
||||||
@@ -123,25 +303,44 @@ DATABASES = {
|
|||||||
|
|
||||||
DBBACKUP_STORAGE = 'django.core.files.storage.FileSystemStorage'
|
DBBACKUP_STORAGE = 'django.core.files.storage.FileSystemStorage'
|
||||||
DBBACKUP_STORAGE_OPTIONS = {
|
DBBACKUP_STORAGE_OPTIONS = {
|
||||||
'location': config('DBBACKUP_STORAGE_LOCATION', default=BASE_DIR.joinpath('.dbbackup')),
|
'location':
|
||||||
|
config('DBBACKUP_STORAGE_LOCATION',
|
||||||
|
default=BASE_DIR.joinpath('.dbbackup')),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Django REST Framework
|
||||||
|
# https://www.django-rest-framework.org/
|
||||||
|
|
||||||
|
REST_FRAMEWORK = {
|
||||||
|
'DEFAULT_PERMISSION_CLASSES': [
|
||||||
|
'rest_framework.permissions.IsAuthenticated',
|
||||||
|
],
|
||||||
|
'DEFAULT_RENDERER_CLASSES': [
|
||||||
|
'rest_framework.renderers.JSONRenderer',
|
||||||
|
'rest_framework_csv.renderers.CSVRenderer',
|
||||||
|
'rest_framework.renderers.BrowsableAPIRenderer',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
AUTH_PASSWORD_VALIDATORS = [
|
AUTH_PASSWORD_VALIDATORS = [
|
||||||
{
|
{
|
||||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
'NAME':
|
||||||
|
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
'NAME':
|
||||||
|
'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
'NAME':
|
||||||
|
'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
'NAME':
|
||||||
|
'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -150,13 +349,18 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
|
|
||||||
AUTH_USER_MODEL = 'people.User'
|
AUTH_USER_MODEL = 'people.User'
|
||||||
|
|
||||||
|
# Login flow
|
||||||
|
|
||||||
|
LOGIN_URL = reverse_lazy('account_login')
|
||||||
|
|
||||||
|
LOGIN_REDIRECT_URL = reverse_lazy('people:person.profile')
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/2.2/topics/i18n/
|
# https://docs.djangoproject.com/en/2.2/topics/i18n/
|
||||||
|
|
||||||
LANGUAGE_CODE = 'en-us'
|
LANGUAGE_CODE = config('LANGUAGE_CODE', default='en-gb')
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
TIME_ZONE = config('TIME_ZONE', default='UTC')
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
@@ -164,7 +368,6 @@ USE_L10N = True
|
|||||||
|
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/2.2/howto/static-files/
|
# https://docs.djangoproject.com/en/2.2/howto/static-files/
|
||||||
|
|
||||||
@@ -172,10 +375,11 @@ STATIC_URL = '/static/'
|
|||||||
|
|
||||||
STATIC_ROOT = BASE_DIR.joinpath('static')
|
STATIC_ROOT = BASE_DIR.joinpath('static')
|
||||||
|
|
||||||
STATICFILES_DIRS = [
|
STATICFILES_DIRS = [BASE_DIR.joinpath('breccia_mapper', 'static')]
|
||||||
BASE_DIR.joinpath('breccia_mapper', 'static')
|
|
||||||
]
|
|
||||||
|
|
||||||
|
# Media uploads
|
||||||
|
MEDIA_ROOT = BASE_DIR.joinpath('media')
|
||||||
|
MEDIA_URL = "/media/"
|
||||||
|
|
||||||
# Logging - NB the logger name is empty to capture all output
|
# Logging - NB the logger name is empty to capture all output
|
||||||
|
|
||||||
@@ -212,16 +416,253 @@ LOGGING = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Initialise logger now so we can use it in this file
|
||||||
|
|
||||||
|
LOGGING_CONFIG = None
|
||||||
|
logging.config.dictConfig(LOGGING)
|
||||||
|
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
|
||||||
|
|
||||||
# Admin panel variables
|
# Admin panel variables
|
||||||
|
|
||||||
CONSTANCE_CONFIG = collections.OrderedDict([
|
CONSTANCE_ADDITIONAL_FIELDS = {
|
||||||
('NOTICE_TEXT', ('', 'Text to be displayed in a notice banner at the top of every page.')),
|
'image_field': ['django.forms.ImageField', {}]
|
||||||
('NOTICE_CLASS', ('alert-warning', 'CSS class to use for background of notice banner.')),
|
|
||||||
])
|
|
||||||
|
|
||||||
CONSTANCE_CONFIG_FIELDSETS = {
|
|
||||||
'Notice Banner': ('NOTICE_TEXT', 'NOTICE_CLASS'),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CONSTANCE_CONFIG = {
|
||||||
|
'NOTICE_TEXT': (
|
||||||
|
'',
|
||||||
|
'Text to be displayed in a notice banner at the top of every page.'),
|
||||||
|
'NOTICE_CLASS': (
|
||||||
|
'alert-warning',
|
||||||
|
'CSS class to use for background of notice banner.'),
|
||||||
|
'CONSENT_TEXT': (
|
||||||
|
'This is template consent text and should have been replaced. Please contact an admin.',
|
||||||
|
'Text to be displayed to ask for consent for data collection.'),
|
||||||
|
'PERSON_LIST_HELP': (
|
||||||
|
'',
|
||||||
|
'Help text to display at the top of the people list.'),
|
||||||
|
'ORGANISATION_LIST_HELP': (
|
||||||
|
'',
|
||||||
|
'Help text to display at the top of the organisaton list.'),
|
||||||
|
'RELATIONSHIP_FORM_HELP': (
|
||||||
|
'',
|
||||||
|
'Help text to display at the top of relationship forms.'),
|
||||||
|
'PARENT_PROJECT_NAME': (
|
||||||
|
'',
|
||||||
|
'Parent project name'),
|
||||||
|
'PROJECT_LEAD': (
|
||||||
|
'Project Lead',
|
||||||
|
'Project lead'),
|
||||||
|
'PROJECT_TAGLINE': (
|
||||||
|
'Here is your project\'s tagline.',
|
||||||
|
'Project tagline'),
|
||||||
|
'ALLOW_SIGNUPS': (
|
||||||
|
False,
|
||||||
|
'Allow new users to sign up using the site\'s sign up form'),
|
||||||
|
'ENABLE_GOOGLE_LOGIN': (
|
||||||
|
False,
|
||||||
|
'Allow users to sign in using their Google accounts'),
|
||||||
|
'ENABLE_MICROSOFT_LOGIN': (
|
||||||
|
False,
|
||||||
|
'Allow users to sign in using their Microsoft accounts'),
|
||||||
|
'HOMEPAGE_HEADER_IMAGE': (
|
||||||
|
'800x500.png',
|
||||||
|
'Homepage header image',
|
||||||
|
'image_field'),
|
||||||
|
'HOMEPAGE_HEADER_IMAGE_SHRINK': (
|
||||||
|
False,
|
||||||
|
'Shrink the homepage header image to display the whole image at all times'),
|
||||||
|
'HOMEPAGE_CARD_1_TITLE': (
|
||||||
|
'Step 1',
|
||||||
|
'Homepage card #1 title'),
|
||||||
|
'HOMEPAGE_CARD_1_DESCRIPTION': (
|
||||||
|
'Tell us about your position within the project',
|
||||||
|
'Homepage card #1 description'),
|
||||||
|
'HOMEPAGE_CARD_1_ICON': (
|
||||||
|
'building-user',
|
||||||
|
'Homepage card #1 icon'),
|
||||||
|
'HOMEPAGE_CARD_2_TITLE': (
|
||||||
|
'Step 2',
|
||||||
|
'Homepage card #2 title'),
|
||||||
|
'HOMEPAGE_CARD_2_DESCRIPTION': (
|
||||||
|
'Describe your relationships with other stakeholders',
|
||||||
|
'Homepage card #2 description'),
|
||||||
|
'HOMEPAGE_CARD_2_ICON': (
|
||||||
|
'handshake-simple',
|
||||||
|
'Homepage card #2 icon'),
|
||||||
|
'HOMEPAGE_CARD_3_TITLE': (
|
||||||
|
'Step 3',
|
||||||
|
'Homepage card #3 title'),
|
||||||
|
'HOMEPAGE_CARD_3_DESCRIPTION': (
|
||||||
|
'Use the network view to analyse relationships',
|
||||||
|
'Homepage card #3 description'),
|
||||||
|
'HOMEPAGE_CARD_3_ICON': (
|
||||||
|
'diagram-project',
|
||||||
|
'Homepage card #3 icon'),
|
||||||
|
'HOMEPAGE_ABOUT_TITLE': (
|
||||||
|
'About Us',
|
||||||
|
'Homepage about section title'),
|
||||||
|
'HOMEPAGE_ABOUT_CONTENT': (
|
||||||
|
"""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. In massa tempor nec feugiat nisl. Eget dolor morbi non arcu risus quis varius quam quisque. Nisl pretium fusce id velit ut tortor pretium viverra suspendisse. Vitae auctor eu augue ut lectus arcu. Tellus molestie nunc non blandit massa enim nec. At consectetur lorem donec massa sapien. Placerat orci nulla pellentesque dignissim enim sit. Sit amet mauris commodo quis imperdiet. Tellus at urna condimentum mattis pellentesque.<br/>In vitae turpis massa sed. Fermentum posuere urna nec tincidunt praesent semper feugiat nibh sed. Ut consequat semper viverra nam libero justo laoreet. Velit ut tortor pretium viverra suspendisse potenti nullam ac tortor. Nunc id cursus metus aliquam eleifend mi in nulla posuere. Aliquam eleifend mi in nulla posuere sollicitudin aliquam. Est ante in nibh mauris cursus mattis molestie a iaculis. Nunc id cursus metus aliquam. Auctor urna nunc id cursus metus aliquam. Porttitor lacus luctus accumsan tortor posuere ac ut consequat semper. Volutpat consequat mauris nunc congue nisi. Leo vel fringilla est ullamcorper eget. Vitae purus faucibus ornare suspendisse sed nisi lacus sed. Massa id neque aliquam vestibulum morbi blandit. Iaculis nunc sed augue lacus viverra vitae congue. Sodales neque sodales ut etiam.""",
|
||||||
|
'Homepage about section content'),
|
||||||
|
'HOMEPAGE_ABOUT_IMAGE': (
|
||||||
|
'400x400.png',
|
||||||
|
'Homepage about section image',
|
||||||
|
'image_field'),
|
||||||
|
} # yapf: disable
|
||||||
|
|
||||||
|
CONSTANCE_CONFIG_FIELDSETS = {
|
||||||
|
'Project options': (
|
||||||
|
'PARENT_PROJECT_NAME',
|
||||||
|
'PROJECT_LEAD',
|
||||||
|
'PROJECT_TAGLINE',
|
||||||
|
'ALLOW_SIGNUPS',
|
||||||
|
'ENABLE_GOOGLE_LOGIN',
|
||||||
|
'ENABLE_MICROSOFT_LOGIN',
|
||||||
|
),
|
||||||
|
'Homepage configuration': (
|
||||||
|
'HOMEPAGE_HEADER_IMAGE_SHRINK',
|
||||||
|
'HOMEPAGE_HEADER_IMAGE',
|
||||||
|
'HOMEPAGE_CARD_1_TITLE',
|
||||||
|
'HOMEPAGE_CARD_1_DESCRIPTION',
|
||||||
|
'HOMEPAGE_CARD_1_ICON',
|
||||||
|
'HOMEPAGE_CARD_2_TITLE',
|
||||||
|
'HOMEPAGE_CARD_2_DESCRIPTION',
|
||||||
|
'HOMEPAGE_CARD_2_ICON',
|
||||||
|
'HOMEPAGE_CARD_3_TITLE',
|
||||||
|
'HOMEPAGE_CARD_3_DESCRIPTION',
|
||||||
|
'HOMEPAGE_CARD_3_ICON',
|
||||||
|
'HOMEPAGE_ABOUT_TITLE',
|
||||||
|
'HOMEPAGE_ABOUT_CONTENT',
|
||||||
|
'HOMEPAGE_ABOUT_IMAGE',
|
||||||
|
),
|
||||||
|
'Notice banner': (
|
||||||
|
'NOTICE_TEXT',
|
||||||
|
'NOTICE_CLASS',
|
||||||
|
),
|
||||||
|
'Data Collection': (
|
||||||
|
'CONSENT_TEXT',
|
||||||
|
),
|
||||||
|
'Help text': (
|
||||||
|
'PERSON_LIST_HELP',
|
||||||
|
'ORGANISATION_LIST_HELP',
|
||||||
|
'RELATIONSHIP_FORM_HELP',
|
||||||
|
),
|
||||||
|
} # yapf: disable
|
||||||
|
|
||||||
CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend'
|
CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend'
|
||||||
|
|
||||||
|
# Django Hijack settings
|
||||||
|
# See https://django-hijack.readthedocs.io/en/stable/
|
||||||
|
|
||||||
|
HIJACK_USE_BOOTSTRAP = True
|
||||||
|
|
||||||
|
# Bootstrap settings
|
||||||
|
# See https://django-bootstrap4.readthedocs.io/en/latest/settings.html
|
||||||
|
|
||||||
|
BOOTSTRAP4 = {
|
||||||
|
'include_jquery': 'full',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Email backend settings
|
||||||
|
# See https://docs.djangoproject.com/en/3.0/topics/email
|
||||||
|
|
||||||
|
EMAIL_HOST = config('EMAIL_HOST', default=None)
|
||||||
|
DEFAULT_FROM_EMAIL = config(
|
||||||
|
'DEFAULT_FROM_EMAIL',
|
||||||
|
default=f'{PROJECT_SHORT_NAME.replace(" ","")}@localhost.localdomain')
|
||||||
|
SERVER_EMAIL = DEFAULT_FROM_EMAIL
|
||||||
|
|
||||||
|
if EMAIL_HOST is None:
|
||||||
|
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
|
||||||
|
EMAIL_FILE_PATH = config('EMAIL_FILE_PATH',
|
||||||
|
default=str(BASE_DIR.joinpath('mail.log')))
|
||||||
|
|
||||||
|
else:
|
||||||
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
|
EMAIL_HOST_USER = config('EMAIL_HOST_USER', default=None)
|
||||||
|
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD', default=None)
|
||||||
|
|
||||||
|
EMAIL_PORT = config('EMAIL_PORT', default=25, cast=int)
|
||||||
|
EMAIL_USE_TLS = config('EMAIL_USE_TLS',
|
||||||
|
default=(EMAIL_PORT == 587),
|
||||||
|
cast=bool)
|
||||||
|
EMAIL_USE_SSL = config('EMAIL_USE_SSL',
|
||||||
|
default=(EMAIL_PORT == 465),
|
||||||
|
cast=bool)
|
||||||
|
|
||||||
|
# Bootstrap Datepicker Plus Settings
|
||||||
|
BOOTSTRAP_DATEPICKER_PLUS = {
|
||||||
|
"variant_options": {
|
||||||
|
"date": {
|
||||||
|
"format": "YYYY-MM-DD",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# PWA settings
|
||||||
|
|
||||||
|
PWA_SERVICE_WORKER_PATH = BASE_DIR.joinpath('static/js', 'serviceworker.js')
|
||||||
|
|
||||||
|
PWA_APP_NAME = PROJECT_SHORT_NAME
|
||||||
|
PWA_APP_DESCRIPTION = PROJECT_DESCRIPTION
|
||||||
|
PWA_APP_THEME_COLOR = THEME_COLOR
|
||||||
|
PWA_APP_BACKGROUND_COLOR = BACKGROUND_COLOR
|
||||||
|
PWA_APP_DISPLAY = 'standalone'
|
||||||
|
PWA_APP_SCOPE = '/'
|
||||||
|
PWA_APP_ORIENTATION = 'any'
|
||||||
|
PWA_APP_START_URL = '/'
|
||||||
|
PWA_APP_STATUS_BAR_COLOR = 'default'
|
||||||
|
PWA_APP_ICONS = [
|
||||||
|
{
|
||||||
|
'src': '/media/icon-192x192.png',
|
||||||
|
'sizes': '192x192'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
PWA_APP_ICONS_APPLE = [
|
||||||
|
{
|
||||||
|
'src': '/media/icon-192x192.png',
|
||||||
|
'sizes': '192x192'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
PWA_APP_SPLASH_SCREEN = [
|
||||||
|
{
|
||||||
|
'src': '/media/icon-192x192.png',
|
||||||
|
'media': '(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
PWA_APP_DIR = 'ltr'
|
||||||
|
PWA_APP_LANG = 'en-GB'
|
||||||
|
PWA_APP_DEBUG_MODE = DEBUG
|
||||||
|
|
||||||
|
# Database default automatic primary key
|
||||||
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
|
|
||||||
|
# Upstream API keys
|
||||||
|
|
||||||
|
GOOGLE_MAPS_API_KEY = config('GOOGLE_MAPS_API_KEY', default=None)
|
||||||
|
|
||||||
|
# Import customisation app settings if present
|
||||||
|
|
||||||
|
try:
|
||||||
|
from custom.settings import (
|
||||||
|
CUSTOMISATION_NAME,
|
||||||
|
TEMPLATE_NAME_INDEX,
|
||||||
|
TEMPLATE_WELCOME_EMAIL_NAME,
|
||||||
|
CONSTANCE_CONFIG as constance_config_custom,
|
||||||
|
CONSTANCE_CONFIG_FIELDSETS as constance_config_fieldsets_custom
|
||||||
|
) # yapf: disable
|
||||||
|
|
||||||
|
CONSTANCE_CONFIG.update(constance_config_custom)
|
||||||
|
CONSTANCE_CONFIG_FIELDSETS.update(constance_config_fieldsets_custom)
|
||||||
|
|
||||||
|
INSTALLED_APPS.append('custom')
|
||||||
|
logger.info("Loaded customisation app: %s", CUSTOMISATION_NAME)
|
||||||
|
|
||||||
|
except ImportError as exc:
|
||||||
|
logger.info("No customisation app loaded: %s", exc)
|
||||||
|
|
||||||
|
# Set default values if no customisations loaded
|
||||||
|
CUSTOMISATION_NAME = None
|
||||||
|
TEMPLATE_NAME_INDEX = 'index.html'
|
||||||
|
TEMPLATE_WELCOME_EMAIL_NAME = 'welcome-email'
|
||||||
|
|||||||
303
breccia_mapper/static/css/emails.css
Normal file
303
breccia_mapper/static/css/emails.css
Normal file
@@ -0,0 +1,303 @@
|
|||||||
|
/* -------------------------------------
|
||||||
|
GLOBAL
|
||||||
|
A very basic CSS reset
|
||||||
|
------------------------------------- */
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-webkit-text-size-adjust: none;
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100%;
|
||||||
|
line-height: 1.6em;
|
||||||
|
/* 1.6em * 14px = 22.4px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
|
||||||
|
/*line-height: 22px;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Let's make sure all tables have defaults */
|
||||||
|
table td {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------
|
||||||
|
BODY & CONTAINER
|
||||||
|
------------------------------------- */
|
||||||
|
body {
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body-wrap {
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
display: block !important;
|
||||||
|
max-width: 600px !important;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
/* makes it centered */
|
||||||
|
clear: both !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: block;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------
|
||||||
|
HEADER, FOOTER, MAIN
|
||||||
|
------------------------------------- */
|
||||||
|
.main {
|
||||||
|
background-color: #fff;
|
||||||
|
border: 1px solid #e9e9e9;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-wrap {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-block {
|
||||||
|
padding: 0 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
width: 100%;
|
||||||
|
clear: both;
|
||||||
|
color: #999;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer p,
|
||||||
|
.footer a,
|
||||||
|
.footer td {
|
||||||
|
color: #999;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------
|
||||||
|
TYPOGRAPHY
|
||||||
|
------------------------------------- */
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3 {
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
||||||
|
color: #000;
|
||||||
|
margin: 40px 0 0;
|
||||||
|
line-height: 1.2em;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: 500;
|
||||||
|
/* 1.2em * 32px = 38.4px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
|
||||||
|
/*line-height: 38px;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 24px;
|
||||||
|
/* 1.2em * 24px = 28.8px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
|
||||||
|
/*line-height: 29px;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: 18px;
|
||||||
|
/* 1.2em * 18px = 21.6px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
|
||||||
|
/*line-height: 22px;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
p,
|
||||||
|
ul,
|
||||||
|
ol {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
p li,
|
||||||
|
ul li,
|
||||||
|
ol li {
|
||||||
|
margin-left: 5px;
|
||||||
|
list-style-position: inside;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------
|
||||||
|
LINKS & BUTTONS
|
||||||
|
------------------------------------- */
|
||||||
|
a {
|
||||||
|
color: #348eda;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #FFF;
|
||||||
|
background-color: #348eda;
|
||||||
|
border: solid #348eda;
|
||||||
|
border-width: 10px 20px;
|
||||||
|
line-height: 2em;
|
||||||
|
/* 2em * 14px = 28px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
|
||||||
|
/*line-height: 28px;*/
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------
|
||||||
|
OTHER STYLES THAT MIGHT BE USEFUL
|
||||||
|
------------------------------------- */
|
||||||
|
.last {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.first {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.aligncenter {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alignright {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alignleft {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------
|
||||||
|
ALERTS
|
||||||
|
Change the class depending on warning email, good email or bad email
|
||||||
|
------------------------------------- */
|
||||||
|
.alert {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 3px 3px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert a {
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert.alert-warning {
|
||||||
|
background-color: #FF9F00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert.alert-bad {
|
||||||
|
background-color: #D0021B;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert.alert-good {
|
||||||
|
background-color: #68B90F;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------
|
||||||
|
INVOICE
|
||||||
|
Styles for the billing table
|
||||||
|
------------------------------------- */
|
||||||
|
.invoice {
|
||||||
|
margin: 40px auto;
|
||||||
|
text-align: left;
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice td {
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice .invoice-items {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice .invoice-items td {
|
||||||
|
border-top: #eee 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice .invoice-items .total td {
|
||||||
|
border-top: 2px solid #333;
|
||||||
|
border-bottom: 2px solid #333;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------
|
||||||
|
RESPONSIVE AND MOBILE FRIENDLY STYLES
|
||||||
|
------------------------------------- */
|
||||||
|
@media only screen and (max-width: 640px) {
|
||||||
|
body {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4 {
|
||||||
|
font-weight: 800 !important;
|
||||||
|
margin: 20px 0 5px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 22px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 18px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: 16px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding: 0 !important;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-wrap {
|
||||||
|
padding: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=styles.css.map */
|
||||||
@@ -12,10 +12,31 @@ body {
|
|||||||
flex: 1 0 auto;
|
flex: 1 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
padding-top: 12px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social_providers_list > form {
|
||||||
|
display: inline-block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
height: 60px;
|
height: 60px;
|
||||||
line-height: 60px;
|
line-height: 60px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.footer .container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
/* end of sticky footer styles */
|
/* end of sticky footer styles */
|
||||||
|
|||||||
@@ -7,11 +7,18 @@ header.masthead {
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
padding-top: 8rem;
|
padding-top: 8rem;
|
||||||
padding-bottom: 8rem;
|
padding-bottom: 8rem;
|
||||||
min-height: 200px;
|
min-height: 400px;
|
||||||
height: 60vh;
|
height: 40vh;
|
||||||
z-index: -2;
|
z-index: -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header.masthead.masthead-shrink {
|
||||||
|
-webkit-background-size: contain;
|
||||||
|
-moz-background-size: contain;
|
||||||
|
-o-background-size: contain;
|
||||||
|
background-size: contain;
|
||||||
|
}
|
||||||
|
|
||||||
header.masthead .overlay {
|
header.masthead .overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: #212529;
|
background-color: #212529;
|
||||||
@@ -27,6 +34,11 @@ header.masthead .textbox-container {
|
|||||||
background-color: rgba(30, 30, 30, 0.2);
|
background-color: rgba(30, 30, 30, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header.masthead > .row {
|
||||||
|
max-width: 1140px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
header.masthead {
|
header.masthead {
|
||||||
padding-top: 1rem;
|
padding-top: 1rem;
|
||||||
|
|||||||
48
breccia_mapper/static/js/serviceworker.js
Normal file
48
breccia_mapper/static/js/serviceworker.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
var staticCacheName = "django-pwa-v" + new Date().getTime();
|
||||||
|
var filesToCache = [
|
||||||
|
"/offline/",
|
||||||
|
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/fontawesome.min.css",
|
||||||
|
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/solid.min.css",
|
||||||
|
"/static/css/global.css",
|
||||||
|
"/static/js/serviceworker.js",
|
||||||
|
"/static/hijack/hijack.min.css",
|
||||||
|
"/media/icon-192x192.png",
|
||||||
|
];
|
||||||
|
|
||||||
|
// Cache on install
|
||||||
|
self.addEventListener("install", event => {
|
||||||
|
this.skipWaiting();
|
||||||
|
event.waitUntil(
|
||||||
|
caches.open(staticCacheName)
|
||||||
|
.then(cache => {
|
||||||
|
return cache.addAll(filesToCache);
|
||||||
|
})
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
// Clear cache on activate
|
||||||
|
self.addEventListener('activate', event => {
|
||||||
|
event.waitUntil(
|
||||||
|
caches.keys().then(cacheNames => {
|
||||||
|
return Promise.all(
|
||||||
|
cacheNames
|
||||||
|
.filter(cacheName => (cacheName.startsWith("django-pwa-")))
|
||||||
|
.filter(cacheName => (cacheName !== staticCacheName))
|
||||||
|
.map(cacheName => caches.delete(cacheName))
|
||||||
|
);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Serve from Cache
|
||||||
|
self.addEventListener("fetch", event => {
|
||||||
|
event.respondWith(
|
||||||
|
caches.match(event.request)
|
||||||
|
.then(response => {
|
||||||
|
return response || fetch(event.request);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
return caches.match('/offline/');
|
||||||
|
})
|
||||||
|
)
|
||||||
|
});
|
||||||
7
breccia_mapper/templates/403.html
Normal file
7
breccia_mapper/templates/403.html
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h2>Error 403 at {{ request.path }}</h2>
|
||||||
|
|
||||||
|
<p>{{ exception }}</p>
|
||||||
|
{% endblock content %}
|
||||||
7
breccia_mapper/templates/404.html
Normal file
7
breccia_mapper/templates/404.html
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h2>Error 404: Page not Found</h2>
|
||||||
|
|
||||||
|
<p>Sorry, we can't find that page. Click <a href="{% url 'index' %}">here</a> to go home.</p>
|
||||||
|
{% endblock content %}
|
||||||
0
breccia_mapper/templates/account/Profile.html
Executable file
0
breccia_mapper/templates/account/Profile.html
Executable file
11
breccia_mapper/templates/account/account_inactive.html
Executable file
11
breccia_mapper/templates/account/account_inactive.html
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Account Inactive" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>{% trans "Account Inactive" %}</h1>
|
||||||
|
|
||||||
|
<p>{% trans "This account is inactive." %}</p>
|
||||||
|
{% endblock %}
|
||||||
1
breccia_mapper/templates/account/base.html
Executable file
1
breccia_mapper/templates/account/base.html
Executable file
@@ -0,0 +1 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
93
breccia_mapper/templates/account/email.html
Executable file
93
breccia_mapper/templates/account/email.html
Executable file
@@ -0,0 +1,93 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Account Details" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h1 class="h1" id="head_banner">Account Details</h1>
|
||||||
|
|
||||||
|
<h2 class="h2" id="head_banner">{% trans "Email Addresses" %}</h2>
|
||||||
|
|
||||||
|
{% if user.emailaddress_set.all %}
|
||||||
|
|
||||||
|
<p class="email_settings_info">{% trans 'The following email addresses are associated with your account:' %}</p>
|
||||||
|
|
||||||
|
<form action="{% url 'account_email' %}" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% for emailaddress in user.emailaddress_set.all %}
|
||||||
|
<div class="ctrlHolder">
|
||||||
|
|
||||||
|
<label for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}">
|
||||||
|
|
||||||
|
{{ emailaddress.email }}
|
||||||
|
|
||||||
|
{% if emailaddress.primary %}
|
||||||
|
<span class="primary">(primary email)</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not emailaddress.verified %}
|
||||||
|
<span class="unverified">(not verified)</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary or user.emailaddress_set.count == 1 %}checked="checked"{%endif %} value="{{emailaddress.email}}"/>
|
||||||
|
|
||||||
|
</label>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button class="btn btn-primary" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
|
||||||
|
<button class="btn btn-info" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button>
|
||||||
|
<button class="btn btn-danger" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
<p class="email_settings_info"><strong>{% trans 'Warning:'%}</strong> {% trans "You do not have any email addresses set up. Please add an email address to receive notifications, reset your password, and perform other account-related actions." %}</p>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
<h3 class="h3" id="head_banner">{% trans "Add Email Address" %}</h3>
|
||||||
|
|
||||||
|
<form method="post" id="email_form" action="{% url 'account_email' %}">
|
||||||
|
{% csrf_token %}
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
<button class="btn btn-primary" name="action_add" type="submit">{% trans "Add Email" %}</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<h2 class="h2" id="head_banner">{% trans "Change Password" %}</h2>
|
||||||
|
|
||||||
|
<a class="btn btn-primary mb-4" href="{% url 'account_change_password' %}">{% trans "Change password" %}</a>
|
||||||
|
|
||||||
|
<h2 class="h2" id="head_banner">{% trans "Federated Login" %}</h2>
|
||||||
|
|
||||||
|
<p>You can connect third-party accounts to log into this site with them.</p>
|
||||||
|
|
||||||
|
<a class="btn btn-primary" href="{% url 'socialaccount_connections' %}">{% trans "Manage" %}</a>
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block extra_body %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function() {
|
||||||
|
var message = "{% trans 'Are you sure you want to remove the selected email address?' %}";
|
||||||
|
var actions = document.getElementsByName('action_remove');
|
||||||
|
if (actions.length) {
|
||||||
|
actions[0].addEventListener("click", function(e) {
|
||||||
|
if (! confirm(message)) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
{% load account %}
|
||||||
|
{% user_display user as user_display %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% load inlinecss %}
|
||||||
|
{% inlinecss "css/emails.css" %}
|
||||||
|
|
||||||
|
<!DOCTYPE html
|
||||||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
<title>Your New {{ settings.PROJECT_LONG_NAME }} Account</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body itemscope itemtype="http://schema.org/EmailMessage">
|
||||||
|
|
||||||
|
<table class="body-wrap">
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td class="container" width="600">
|
||||||
|
<div class="content">
|
||||||
|
<table class="main" width="100%" cellpadding="0" cellspacing="0" itemprop="action" itemscope
|
||||||
|
itemtype="http://schema.org/ConfirmAction">
|
||||||
|
<tr>
|
||||||
|
<td class="content-wrap">
|
||||||
|
<meta itemprop="name" content="Confirm Email" />
|
||||||
|
<table width="100%" cellpadding="0" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
<h2>{{ settings.PROJECT_LONG_NAME }}</h2>
|
||||||
|
</td>
|
||||||
|
</tr><tr>
|
||||||
|
<td class="content-block">
|
||||||
|
You have a new account on {{ settings.PROJECT_LONG_NAME }}. You can log in with the button below.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
Your username is <i>{{ user.username }}</i>.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block" itemprop="handler" itemscope
|
||||||
|
itemtype="http://schema.org/HttpActionHandler">
|
||||||
|
<a href="{{ settings.SITE_PROTOCOL }}://{{ settings.SITE_URL }}/accounts/login/" class="btn-primary" itemprop="url">Log in</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
The {{ settings.PROJECT_SHORT_NAME }} team
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="footer">
|
||||||
|
<table width="100%">
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
||||||
|
{% endinlinecss %}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
Dear user,
|
||||||
|
|
||||||
|
You have a new account on {{ settings.PROJECT_LONG_NAME }}. You can log in at the link below.
|
||||||
|
|
||||||
|
Your username is {{ user.username }}.
|
||||||
|
|
||||||
|
Log in: {{ settings.SITE_PROTOCOL }}://{{ settings.SITE_URL }}/accounts/login/
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
The {{ settings.PROJECT_SHORT_NAME }} team
|
||||||
71
breccia_mapper/templates/account/email/email_confirmation_message.html
Executable file
71
breccia_mapper/templates/account/email/email_confirmation_message.html
Executable file
@@ -0,0 +1,71 @@
|
|||||||
|
{% load account %}
|
||||||
|
{% user_display user as user_display %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% load inlinecss %}
|
||||||
|
{% inlinecss "css/emails.css" %}
|
||||||
|
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
<title>Registration confirmation email</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body itemscope itemtype="http://schema.org/EmailMessage">
|
||||||
|
|
||||||
|
<table class="body-wrap">
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td class="container" width="600">
|
||||||
|
<div class="content">
|
||||||
|
<table class="main" width="100%" cellpadding="0" cellspacing="0" itemprop="action" itemscope itemtype="http://schema.org/ConfirmAction">
|
||||||
|
<tr>
|
||||||
|
<td class="content-wrap">
|
||||||
|
<meta itemprop="name" content="Confirm Email"/>
|
||||||
|
<table width="100%" cellpadding="0" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
<h2>{{ settings.PROJECT_LONG_NAME }}</h2>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
Please confirm your email address by clicking the link below.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
We may need to send you critical information about our service, so it is important that we have your correct email address.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block" itemprop="handler" itemscope itemtype="http://schema.org/HttpActionHandler">
|
||||||
|
<a href="{{ activate_url }}" class="btn-primary" itemprop="url">Confirm email address</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
The {{ settings.PROJECT_SHORT_NAME }} team
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="footer">
|
||||||
|
<table width="100%">
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div></div>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
{% endinlinecss %}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{% include "account/email/email_confirmation_message.html" %}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% autoescape off %}
|
||||||
|
{% blocktrans %}Confirm Your Registration - {{ settings.PROJECT_SHORT_NAME }}{% endblocktrans %}
|
||||||
|
{% endautoescape %}
|
||||||
1
breccia_mapper/templates/account/email/email_confirmation_subject.html
Executable file
1
breccia_mapper/templates/account/email/email_confirmation_subject.html
Executable file
@@ -0,0 +1 @@
|
|||||||
|
Confirm Your Email
|
||||||
69
breccia_mapper/templates/account/email/password_reset_key_message.html
Executable file
69
breccia_mapper/templates/account/email/password_reset_key_message.html
Executable file
@@ -0,0 +1,69 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% load inlinecss %}
|
||||||
|
{% inlinecss "css/emails.css" %}
|
||||||
|
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
<title>Reset your Password</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body itemscope itemtype="http://schema.org/EmailMessage">
|
||||||
|
|
||||||
|
<table class="body-wrap">
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td class="container" width="600">
|
||||||
|
<div class="content">
|
||||||
|
<table class="main" width="100%" cellpadding="0" cellspacing="0" itemprop="action" itemscope itemtype="http://schema.org/ConfirmAction">
|
||||||
|
<tr>
|
||||||
|
<td class="content-wrap">
|
||||||
|
<meta itemprop="name" content="Confirm Email"/>
|
||||||
|
<table width="100%" cellpadding="0" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
<h2>{{ settings.PROJECT_LONG_NAME }}</h2>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
Please reset your password by clicking the link below.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
We may need to send you critical information about our service, so it is important that we have your correct email address.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block" itemprop="handler" itemscope itemtype="http://schema.org/HttpActionHandler">
|
||||||
|
<a href="{{ password_reset_url }}" class="btn-primary" itemprop="url">Reset your password</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="content-block">
|
||||||
|
The {{ settings.PROJECT_SHORT_NAME }} team
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="footer">
|
||||||
|
<table width="100%">
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div></div>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
{% endinlinecss %}
|
||||||
4
breccia_mapper/templates/account/email/password_reset_key_subject.html
Executable file
4
breccia_mapper/templates/account/email/password_reset_key_subject.html
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% autoescape off %}
|
||||||
|
{% blocktrans %}Reset Password - {{ settings.PROJECT_SHORT_NAME }}{% endblocktrans %}
|
||||||
|
{% endautoescape %}
|
||||||
32
breccia_mapper/templates/account/email_confirm.html
Executable file
32
breccia_mapper/templates/account/email_confirm.html
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
{% load account %}
|
||||||
|
{% block head_title %}{% trans "Confirm Email Address" %}{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h3 class="h3" id="head_banner">{% trans "Confirm Email Address" %}</h3>
|
||||||
|
|
||||||
|
{% if confirmation %}
|
||||||
|
|
||||||
|
<p class="verification_sent_info" >{% blocktrans with confirmation.email_address.email as email %} Please confirm ownership of <a href="mailto:{{ email }}">{{ email }}</a>.{% endblocktrans %}</p>
|
||||||
|
|
||||||
|
<form method="post"action="{% url 'account_confirm_email' confirmation.key %}">
|
||||||
|
{% csrf_token %}
|
||||||
|
<button class="btn btn-success" type="submit">{% trans 'Confirm' %}</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{% url 'account_email' as email_url %}
|
||||||
|
|
||||||
|
<p class="verification_sent_info" >{% blocktrans %}This email confirmation link expired or is invalid. Please <a href="{{ email_url }}">request a new email confirmation</a>. You will be redirected to the login page in 5 seconds.{% endblocktrans %}</p>
|
||||||
|
<script>
|
||||||
|
setTimeout("location.href = '{% url 'account_login' %}';",5000);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
62
breccia_mapper/templates/account/login.html
Executable file
62
breccia_mapper/templates/account/login.html
Executable file
@@ -0,0 +1,62 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_links %}
|
||||||
|
|
||||||
|
<title>Sign In</title>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Sign In" %} {% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h3 class="h3" id="head_banner">{% trans "Sign In" %}</h3>
|
||||||
|
|
||||||
|
<form id="login_form" method="POST" action="{% url 'account_login' %}">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
|
||||||
|
{% if redirect_field_value %}
|
||||||
|
|
||||||
|
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<button class="btn btn-primary " type="submit">{% trans "Log in" %}</button>
|
||||||
|
{% if config.ALLOW_SIGNUPS %}
|
||||||
|
<a class="btn btn-secondary" href="{% url 'account_signup' %}">Sign up</a>
|
||||||
|
{% endif %}
|
||||||
|
<a class="btn btn-outline-dark" href="{% url 'account_reset_password' %}">{% trans "Forgot password?" %}</a>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% if config.ENABLE_GOOGLE_LOGIN or config.ENABLE_MICROSOFT_LOGIN %}
|
||||||
|
|
||||||
|
{% load account socialaccount %}
|
||||||
|
|
||||||
|
{% get_providers as socialaccount_providers %}
|
||||||
|
<h5>Federated Login</h5>
|
||||||
|
<div class="social_providers_list">
|
||||||
|
|
||||||
|
{% for provider in socialaccount_providers %}
|
||||||
|
{% if provider.name == "Google" and config.ENABLE_GOOGLE_LOGIN or provider.name == "Microsoft Graph" and config.ENABLE_MICROSOFT_LOGIN %}
|
||||||
|
<form action="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
<button class="btn btn-outline-dark" type="submit">
|
||||||
|
{% if provider.name == "Microsoft Graph" %}
|
||||||
|
Microsoft
|
||||||
|
{% else %}
|
||||||
|
{{provider.name}}
|
||||||
|
{% endif %}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
26
breccia_mapper/templates/account/logout.html
Executable file
26
breccia_mapper/templates/account/logout.html
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Sign Out" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h3 class="h3" id="head_banner">{% trans "Sign Out" %}</h3>
|
||||||
|
|
||||||
|
<p class="confirm_logout_info">{% trans 'Are you sure you want to sign out?' %}</p>
|
||||||
|
|
||||||
|
<form id="logout_form" method="post" action="{% url 'account_logout' %}">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% if redirect_field_value %}
|
||||||
|
|
||||||
|
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<button class="btn btn-success" type="submit">{% trans 'Sign Out' %}</button>
|
||||||
|
<a class="btn btn-danger" id="custom_logout_no" href="/accounts/profile/">{% trans 'No' %}</a>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}You cannot remove your primary email address ({{email}}).{% endblocktrans %}
|
||||||
2
breccia_mapper/templates/account/messages/email_confirmation_sent.txt
Executable file
2
breccia_mapper/templates/account/messages/email_confirmation_sent.txt
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}Confirmation email sent to {{email}}.{% endblocktrans %}
|
||||||
2
breccia_mapper/templates/account/messages/email_confirmed.txt
Executable file
2
breccia_mapper/templates/account/messages/email_confirmed.txt
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}You have confirmed {{email}}.{% endblocktrans %}
|
||||||
2
breccia_mapper/templates/account/messages/email_deleted.txt
Executable file
2
breccia_mapper/templates/account/messages/email_deleted.txt
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}Removed email address {{email}}.{% endblocktrans %}
|
||||||
4
breccia_mapper/templates/account/messages/logged_in.txt
Executable file
4
breccia_mapper/templates/account/messages/logged_in.txt
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
{% load account %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% user_display user as name %}
|
||||||
|
{% blocktrans %}Successfully logged in as {{name}}.{% endblocktrans %}
|
||||||
2
breccia_mapper/templates/account/messages/logged_out.txt
Executable file
2
breccia_mapper/templates/account/messages/logged_out.txt
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}You have signed out.{% endblocktrans %}
|
||||||
2
breccia_mapper/templates/account/messages/password_changed.txt
Executable file
2
breccia_mapper/templates/account/messages/password_changed.txt
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}Password successfully changed.{% endblocktrans %}
|
||||||
2
breccia_mapper/templates/account/messages/password_set.txt
Executable file
2
breccia_mapper/templates/account/messages/password_set.txt
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}Password successfully set.{% endblocktrans %}
|
||||||
2
breccia_mapper/templates/account/messages/primary_email_set.txt
Executable file
2
breccia_mapper/templates/account/messages/primary_email_set.txt
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}Primary email address set.{% endblocktrans %}
|
||||||
2
breccia_mapper/templates/account/messages/unverified_primary_email.txt
Executable file
2
breccia_mapper/templates/account/messages/unverified_primary_email.txt
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}Your primary email address must be verified.{% endblocktrans %}
|
||||||
18
breccia_mapper/templates/account/password_change.html
Executable file
18
breccia_mapper/templates/account/password_change.html
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Change Password" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h3 class="h3" id="head_banner">{% trans "Change Password" %}</h3>
|
||||||
|
|
||||||
|
<form method="POST" action="{% url 'account_change_password' %}" id="change_password_form">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
<button class="btn btn-info" type="submit" name="action">{% trans "Change Password" %}</button>
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
||||||
26
breccia_mapper/templates/account/password_reset.html
Executable file
26
breccia_mapper/templates/account/password_reset.html
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% load account %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
{% include "account/snippets/already_logged_in.html" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<h3 class="h3" id="head_banner">{% trans "Password Reset" %}</h3>
|
||||||
|
<p class="forgot_password_info" >{% trans "Forgotten your password? Enter your email address below to reset it." %}</p>
|
||||||
|
|
||||||
|
<form method="POST" id="forgot_password_form" action="{% url 'account_reset_password' %}">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
<input class="btn btn-outline-primary " type="submit" value="{% trans 'Reset Password' %}" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<p class="forgot_password_info">{% blocktrans %}Please contact us if you are unable to reset your password.{% endblocktrans %}</p>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
20
breccia_mapper/templates/account/password_reset_done.html
Executable file
20
breccia_mapper/templates/account/password_reset_done.html
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
{% load account %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h3 class="h3" id="head_banner">{% trans "Password Reset Email Sent." %}</h3>
|
||||||
|
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
{% include "account/snippets/already_logged_in.html" %}
|
||||||
|
{% block content_extra %} {% endblock %}
|
||||||
|
{% else %}
|
||||||
|
<p class="forgot_password_info">A password reset link has been sent to your email address. Please contact us if you do not receive it within a few minutes. <br> You will be redirected to <a href="{% url 'account_login' %}">sign in</a> in 5 seconds.</p>
|
||||||
|
<script>
|
||||||
|
setTimeout("location.href = '{% url 'account_login' %}';",5000);
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
24
breccia_mapper/templates/account/password_reset_from_key.html
Executable file
24
breccia_mapper/templates/account/password_reset_from_key.html
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
{% block head_title %}{% trans "Change Password" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}</h1>
|
||||||
|
|
||||||
|
{% if token_fail %}
|
||||||
|
{% url 'account_reset_password' as passwd_reset_url %}
|
||||||
|
<p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
|
||||||
|
{% else %}
|
||||||
|
{% if form %}
|
||||||
|
<form method="POST" action="{{ action_url }}">
|
||||||
|
{% csrf_token %}
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
<input type="submit" name="action" value="{% trans 'change password' %}"/>
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<p>{% trans 'Your password has been changed.' %}</p>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
9
breccia_mapper/templates/account/password_reset_from_key_done.html
Executable file
9
breccia_mapper/templates/account/password_reset_from_key_done.html
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
{% block head_title %}{% trans "Change Password" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>{% trans "Change Password" %}</h1>
|
||||||
|
<p>{% trans 'Your password has been changed.' %}</p>
|
||||||
|
{% endblock %}
|
||||||
18
breccia_mapper/templates/account/password_set.html
Executable file
18
breccia_mapper/templates/account/password_set.html
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Set Password" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h3 class="h3" id="head_banner">{% trans "Set Password" %}</h3>
|
||||||
|
|
||||||
|
<form method="POST" action="{% url 'account_set_password' %}" class="password_set">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
<input class="btn btn-outline-primary btn-lg" type="submit" name="action" value="{% trans 'Set Password' %}"/>
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
||||||
33
breccia_mapper/templates/account/signup.html
Executable file
33
breccia_mapper/templates/account/signup.html
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Sign Up" %}{% endblock %}
|
||||||
|
{% block head_links %}
|
||||||
|
|
||||||
|
<title>Signup</title>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h3 class="h3" id="head_banner">{% trans "Sign Up" %}</h3>
|
||||||
|
|
||||||
|
<p class="exist_account_info">{% blocktrans %}Already have an account? Please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p>
|
||||||
|
|
||||||
|
<form id="signup_form" method="post" action="{% url 'account_signup' %}">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
|
||||||
|
{% if redirect_field_value %}
|
||||||
|
|
||||||
|
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<button class="btn btn-primary" type="submit">{% trans "Sign Up" %}</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
11
breccia_mapper/templates/account/signup_closed.html
Executable file
11
breccia_mapper/templates/account/signup_closed.html
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Sign Up Closed" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>{% trans "Sign Up Closed" %}</h1>
|
||||||
|
|
||||||
|
<p>{% blocktrans with project_long_name=settings.PROJECT_LONG_NAME %}Signing up to {{ project_long_name }} is currently not permitted.{% endblocktrans %}</p>
|
||||||
|
{% endblock %}
|
||||||
11
breccia_mapper/templates/account/snippets/already_logged_in.html
Executable file
11
breccia_mapper/templates/account/snippets/already_logged_in.html
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% load account %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% user_display user as user_display %}
|
||||||
|
|
||||||
|
<h3 class="h3" id="head_banner">Already Logged In</h3>
|
||||||
|
<p class="forgot_password_info" >You are already logged in as {{ user_display }}.</p>
|
||||||
|
<a class="btn btn-primary mb-4" id="custom_logout_no" href="{% url 'account_email' %}">Account Details</a>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
12
breccia_mapper/templates/account/verification_sent.html
Executable file
12
breccia_mapper/templates/account/verification_sent.html
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Verify Your Email Address" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h3 class="h3" id="head_banner">{% trans "Verify Your Email Address" %}</h3>
|
||||||
|
|
||||||
|
<p id="verification_sent_info">{% blocktrans %}A verification email has been sent to your email address. Follow the link provided to activate your account. Contact us if you do not receive it within a few minutes.{% endblocktrans %}</p>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
22
breccia_mapper/templates/account/verified_email_required.html
Executable file
22
breccia_mapper/templates/account/verified_email_required.html
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Verify Your Email Address" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>{% trans "Verify Your Email Address" %}</h1>
|
||||||
|
|
||||||
|
{% url 'account_email' as email_url %}
|
||||||
|
|
||||||
|
<p>{% blocktrans %}This part of the site requires us to verify that
|
||||||
|
you are who you claim to be. We therefore require you to
|
||||||
|
verify ownership of your email address. {% endblocktrans %}</p>
|
||||||
|
|
||||||
|
<p>{% blocktrans %}A verification email has been sent to your email address. Follow the link provided to activate your account. Contact us
|
||||||
|
if you do not receive it within a few minutes.{% endblocktrans %}</p>
|
||||||
|
|
||||||
|
<p>{% blocktrans %}<strong>Note:</strong> you can still <a href="{{ email_url }}">change your email address</a>.{% endblocktrans %}</p>
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
153
breccia_mapper/templates/base.html
Normal file → Executable file
153
breccia_mapper/templates/base.html
Normal file → Executable file
@@ -4,30 +4,44 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% get_current_language as LANGUAGE_CODE %}
|
{% get_current_language as LANGUAGE_CODE %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% load bootstrap_customizer %}
|
||||||
<html lang="{{ LANGUAGE_CODE|default:'en_us' }}">
|
<html lang="{{ LANGUAGE_CODE|default:'en_us' }}">
|
||||||
|
|
||||||
<head>
|
{% load pwa %}
|
||||||
|
{% load socialaccount %}
|
||||||
|
|
||||||
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
|
||||||
|
<head>
|
||||||
<!-- Required meta tags -->
|
<!-- Required meta tags -->
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<title>{{ settings.PROJECT_LONG_NAME }}</title>
|
||||||
|
|
||||||
<!-- Bootstrap CSS -->
|
<!-- Bootstrap CSS -->
|
||||||
{% bootstrap_css %}
|
{% bootstrap_css %}
|
||||||
|
<style lang="css">
|
||||||
|
{% bootstrap_theme_css_above_the_fold %}
|
||||||
|
</style>
|
||||||
|
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css"
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/fontawesome.min.css"
|
||||||
integrity="sha256-/sdxenK1NDowSNuphgwjv8wSosSNZB0t5koXqd7XqOI="
|
integrity="sha512-giQeaPns4lQTBMRpOOHsYnGw1tGVzbAIHUyHRgn7+6FmiEgGGjaG0T2LZJmAPMzRCl+Cug0ItQ2xDZpTmEc+CQ=="
|
||||||
crossorigin="anonymous" />
|
crossorigin="anonymous"
|
||||||
|
referrerpolicy="no-referrer" />
|
||||||
|
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/solid.min.css"
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/solid.min.css"
|
||||||
integrity="sha256-8DcgqUGhWHHsTLj1qcGr0OuPbKkN1RwDjIbZ6DKh/RA="
|
integrity="sha512-6mc0R607di/biCutMUtU9K7NtNewiGQzrvWX4bWTeqmljZdJrwYvKJtnhgR+Ryvj+NRJ8+NnnCM/biGqMe/iRA=="
|
||||||
crossorigin="anonymous" />
|
crossorigin="anonymous"
|
||||||
|
referrerpolicy="no-referrer" />
|
||||||
|
|
||||||
|
{% load static %}
|
||||||
|
<link rel="stylesheet" href="{% static 'css/global.css' %}">
|
||||||
|
|
||||||
{% load staticfiles %}
|
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="{% static 'css/global.css' %}">
|
type="text/css"
|
||||||
|
href="{% static 'hijack/hijack.min.css' %}" />
|
||||||
|
|
||||||
{% if 'javascript_in_head'|bootstrap_setting %}
|
{% if 'javascript_in_head'|bootstrap_setting %}
|
||||||
{% if 'include_jquery'|bootstrap_setting %}
|
{% if 'include_jquery'|bootstrap_setting %}
|
||||||
@@ -39,11 +53,19 @@
|
|||||||
{% bootstrap_javascript %}
|
{% bootstrap_javascript %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if form %}
|
||||||
|
{{ form.media.css }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- PWA metadata -->
|
||||||
|
{% progressive_web_app_meta %}
|
||||||
|
|
||||||
{% block extra_head %}{% endblock %}
|
{% block extra_head %}{% endblock %}
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% bootstrap_theme_css_below_the_fold_url %}" />
|
||||||
<div class="content" style="display: flex; flex-direction: column">
|
<div class="content" style="display: flex; flex-direction: column">
|
||||||
{% block navbar %}
|
{% block navbar %}
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||||
@@ -60,7 +82,41 @@
|
|||||||
|
|
||||||
<div class="navbar-collapse collapse" id="navbarCollapse">
|
<div class="navbar-collapse collapse" id="navbarCollapse">
|
||||||
<ul class="navbar-nav mt-2 mt-lg-0">
|
<ul class="navbar-nav mt-2 mt-lg-0">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{% if request.user.person %}{% url 'people:person.profile' %}{% else %}{% url 'people:person.create' %}{% endif %}" class="nav-link">
|
||||||
|
Profile
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{% url 'people:person.list' %}" class="nav-link">People</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{% url 'people:organisation.list' %}" class="nav-link">Organisations</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{% url 'activities:activity-series.list' %}" class="nav-link">Activity Series</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{% url 'activities:activity.list' %}" class="nav-link">Activities</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{% url 'people:map' %}" class="nav-link">Map</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{% url 'people:network' %}" class="nav-link">Network</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{% url 'export:index' %}" class="nav-link">Export</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="{% url 'admin:index' %}" class="nav-link">Admin</a>
|
<a href="{% url 'admin:index' %}" class="nav-link">Admin</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -70,31 +126,27 @@
|
|||||||
<ul class="navbar-nav mt-2 mt-lg-0 ml-auto">
|
<ul class="navbar-nav mt-2 mt-lg-0 ml-auto">
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
{% if request.user.person %}
|
<a href="{% url 'account_email' %}" class="nav-link">
|
||||||
<a href="{{ request.user.get_absolute_url }}" class="nav-link">
|
<i class="fa-solid fa-circle-user"></i>
|
||||||
<i class="fas fa-user-circle"></i>
|
{% if request.user.first_name != "" %}
|
||||||
{{ request.user }}
|
{{ request.user.first_name }}
|
||||||
</a>
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="navbar-text">
|
|
||||||
<i class="fas fa-user-circle"></i>
|
|
||||||
{{ request.user }}
|
{{ request.user }}
|
||||||
</span>
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="{% url 'logout' %}" class="nav-link">
|
<a href="{% url 'account_logout' %}" class="nav-link">
|
||||||
<i class="fas fa-sign-out-alt"></i>
|
<i class="fa-solid fa-right-from-bracket"></i>
|
||||||
Log Out
|
Log Out
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="{% url 'login' %}" class="nav-link">
|
<a href="{% url 'account_login' %}" class="nav-link">
|
||||||
<i class="fas fa-sign-in-alt"></i>
|
<i class="fa-solid fa-right-to-bracket"></i>
|
||||||
Log In
|
Log In
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -108,14 +160,60 @@
|
|||||||
|
|
||||||
{# Global banner if config.NOTICE_TEXT is set using Constance #}
|
{# Global banner if config.NOTICE_TEXT is set using Constance #}
|
||||||
{% if config.NOTICE_TEXT %}
|
{% if config.NOTICE_TEXT %}
|
||||||
<div class="alert {{ config.NOTICE_CLASS }} rounded-0 mb-0" role="alert">
|
<div class="alert {{ config.NOTICE_CLASS }} rounded-0 mb-3" role="alert">
|
||||||
<h4 class="alert-heading text-center mb-0">{{ config.NOTICE_TEXT }}</h4>
|
<h4 class="alert-heading text-center mb-0">{{ config.NOTICE_TEXT }}</h4>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% load hijack %}
|
||||||
|
|
||||||
|
{# Hijack notification if user is hijacked #}
|
||||||
|
{% if person.user == request.user and request.user.is_hijacked %}
|
||||||
|
<div class="djhj" id="djhj">
|
||||||
|
<div class="djhj-notification">
|
||||||
|
<div class="djhj-message">
|
||||||
|
{% blocktrans trimmed with user=request.user %}
|
||||||
|
You are currently working on behalf of <em>{{ user }}</em>.
|
||||||
|
{% endblocktrans %}
|
||||||
|
</div>
|
||||||
|
<form action="{% url 'hijack:release' %}" method="POST" class="djhj-actions">
|
||||||
|
{% csrf_token %}
|
||||||
|
<input type="hidden" name="next" value="{{ request.path }}">
|
||||||
|
<button class="djhj-button" onclick="document.getElementById('djhj').style.display = 'none';" type="button">
|
||||||
|
{% trans 'hide' %}
|
||||||
|
</button>
|
||||||
|
<button class="djhj-button" type="submit">
|
||||||
|
{% trans 'release' %}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if request.user.is_authenticated and not request.user.has_person %}
|
||||||
|
<div class="alert alert-info rounded-0" role="alert">
|
||||||
|
<p class="text-center mb-0">
|
||||||
|
Your profile is currently blank.
|
||||||
|
Please fill in your details so you can be part of the network.
|
||||||
|
|
||||||
|
<a class="btn btn-success"
|
||||||
|
href="{% url 'people:person.create' %}">Profile</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if request.user.is_authenticated and not request.user.consent_given %}
|
||||||
|
<div class="alert alert-warning rounded-0" role="alert">
|
||||||
|
<p class="text-center mb-0">
|
||||||
|
You have not yet given consent for your data to be collected and processed.
|
||||||
|
Please read and accept the <a href="{% url 'consent' %}">consent text</a>.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block before_content %}{% endblock %}
|
{% block before_content %}{% endblock %}
|
||||||
|
|
||||||
<main class="container">
|
<main class="{{ full_width_page|yesno:'container-fluid,container' }}">
|
||||||
{# Display Django messages as Bootstrap alerts #}
|
{# Display Django messages as Bootstrap alerts #}
|
||||||
{% bootstrap_messages %}
|
{% bootstrap_messages %}
|
||||||
|
|
||||||
@@ -130,6 +228,7 @@
|
|||||||
<footer class="footer bg-light">
|
<footer class="footer bg-light">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<span class="text-muted">{{ settings.PROJECT_LONG_NAME }}</span>
|
<span class="text-muted">{{ settings.PROJECT_LONG_NAME }}</span>
|
||||||
|
<span class="text-muted">Developed by the <a href="https://gcrf-breccia.com">BRECcIA</a> team</span>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
@@ -143,6 +242,10 @@
|
|||||||
{% bootstrap_javascript %}
|
{% bootstrap_javascript %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if form %}
|
||||||
|
{{ form.media.js }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block extra_script %}{% endblock %}
|
{% block extra_script %}{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
21
breccia_mapper/templates/consent.html
Normal file
21
breccia_mapper/templates/consent.html
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h2>Consent</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{{ config.CONSENT_TEXT|linebreaks }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<form class="form"
|
||||||
|
method="POST">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
|
||||||
|
{% buttons %}
|
||||||
|
<button class="btn btn-success" type="submit">Submit</button>
|
||||||
|
{% endbuttons %}
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
||||||
@@ -1,79 +1,107 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block extra_head %}
|
{% block extra_head %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="{% static 'css/masthead.css' %}">
|
href="{% static 'css/masthead.css' %}">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block before_content %}
|
{% block before_content %}
|
||||||
<header class="container-fluid masthead text-white text-left"
|
|
||||||
style="background-image: url('https://via.placeholder.com/800x500')">
|
{% get_media_prefix as MEDIA_URL %}
|
||||||
|
<header class="container-fluid masthead text-white text-left {% if config.HOMEPAGE_HEADER_IMAGE_SHRINK %}masthead-shrink{% endif %} py-2"
|
||||||
|
style="background-image: url('{{ MEDIA_URL }}{{ config.HOMEPAGE_HEADER_IMAGE }}')">
|
||||||
<div class="overlay"></div>
|
<div class="overlay"></div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="ml-5 px-4 mt-3 pt-3 textbox-container">
|
<div class="px-4 my-3 pt-3 pb-2 textbox-container">
|
||||||
<h1 class="display-1">{{ settings.PROJECT_LONG_NAME }}</h1>
|
<h1>{{ settings.PROJECT_LONG_NAME }}</h1>
|
||||||
<p class="lead">Snappy leader here...</p>
|
<p class="lead">{{ config.PROJECT_LEAD }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="bg-secondary py-3">
|
<div class="bg-secondary py-3">
|
||||||
<div class="container text-white">
|
<div class="container text-white">
|
||||||
<h2>Snappy tagline here...</h2>
|
<h2>{{ config.PROJECT_TAGLINE }}</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-light py-2 mb-4">
|
<div class="bg-light py-2 mb-4">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
{% if config.HOMEPAGE_CARD_1_TITLE %}
|
||||||
|
<div class="col-md-4 mx-auto">
|
||||||
<div class="card text-center">
|
<div class="card text-center">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h2 class="card-title">Do Feature 1</h2>
|
<h2 class="card-title">{{ config.HOMEPAGE_CARD_1_TITLE }}</h2>
|
||||||
|
|
||||||
<span class="fas fa-5x fa-atlas"></span>
|
{% if config.HOMEPAGE_CARD_1_DESCRIPTION %}
|
||||||
</div>
|
<p>{{ config.HOMEPAGE_CARD_1_DESCRIPTION|safe }}</p>
|
||||||
</div>
|
{% endif %}
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-4">
|
{% if config.HOMEPAGE_CARD_1_ICON %}
|
||||||
|
<span class="fa-solid fa-5x fa-{{ config.HOMEPAGE_CARD_1_ICON }}"></span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if config.HOMEPAGE_CARD_2_TITLE %}
|
||||||
|
<div class="col-md-4 mx-auto">
|
||||||
<div class="card text-center">
|
<div class="card text-center">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h2 class="card-title">Do Feature 2</h2>
|
<h2 class="card-title">{{ config.HOMEPAGE_CARD_2_TITLE }}</h2>
|
||||||
|
|
||||||
<span class="fas fa-5x fa-atlas"></span>
|
{% if config.HOMEPAGE_CARD_2_DESCRIPTION %}
|
||||||
</div>
|
<p>{{ config.HOMEPAGE_CARD_2_DESCRIPTION|safe }}</p>
|
||||||
</div>
|
{% endif %}
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-4">
|
{% if config.HOMEPAGE_CARD_2_ICON %}
|
||||||
|
<span class="fa-solid fa-5x fa-{{ config.HOMEPAGE_CARD_2_ICON }}"></span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if config.HOMEPAGE_CARD_3_TITLE %}
|
||||||
|
<div class="col-md-4 mx-auto">
|
||||||
<div class="card text-center">
|
<div class="card text-center">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h2 class="card-title">Do Feature 3</h2>
|
<h2 class="card-title">{{ config.HOMEPAGE_CARD_3_TITLE }}</h2>
|
||||||
|
|
||||||
<span class="fas fa-5x fa-atlas"></span>
|
{% if config.HOMEPAGE_CARD_3_DESCRIPTION %}
|
||||||
|
<p>{{ config.HOMEPAGE_CARD_3_DESCRIPTION|safe }}</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if config.HOMEPAGE_CARD_3_ICON %}
|
||||||
|
<span class="fa-solid fa-5x fa-{{ config.HOMEPAGE_CARD_3_ICON }}"></span>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row align-items-center">
|
<div class="row align-items-center" style="min-height: 400px;">
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<h2 class="pb-2">About {{ settings.PROJECT_LONG_NAME }}</h2>
|
<h2 class="pb-2">{{ config.HOMEPAGE_ABOUT_TITLE }}</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{{ settings.PROJECT_LONG_NAME }} is...
|
{{ config.HOMEPAGE_ABOUT_CONTENT|safe }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<img class="img-fluid py-3" src="https://via.placeholder.com/400x400">
|
{% get_media_prefix as MEDIA_URL %}
|
||||||
|
<img class="img-fluid py-3" src="{{ MEDIA_URL }}{{ config.HOMEPAGE_ABOUT_IMAGE }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
8
breccia_mapper/templates/offline.html
Normal file
8
breccia_mapper/templates/offline.html
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h2>Offline</h2>
|
||||||
|
|
||||||
|
<p>You are currently offline. Please connect to a network to use this platform.</p>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
10
breccia_mapper/templates/registration/logged_out.html
Normal file
10
breccia_mapper/templates/registration/logged_out.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>Logged Out</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
You have logged out
|
||||||
|
</p>
|
||||||
|
{% endblock %}
|
||||||
16
breccia_mapper/templates/registration/login.html
Normal file
16
breccia_mapper/templates/registration/login.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>Login</h1>
|
||||||
|
|
||||||
|
<form action="" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
{% buttons %}
|
||||||
|
<input type="hidden" name="next" value="{{ next }}">
|
||||||
|
<input type="submit" class="btn btn-primary" value="Login">
|
||||||
|
{% endbuttons %}
|
||||||
|
<p>Forgot your password? Reset it <a href="{% url 'account_reset_password' %}">here</a>.</p>
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>Password Reset Complete</h1>
|
||||||
|
|
||||||
|
<p>Your password has been successfully reset. You can now <a href="{% url 'account_login' %}">log in using it</a>.</p> If you haven't yet completed your profile, please do this now.
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% if validlink %}
|
||||||
|
|
||||||
|
<h1>Choose a New Password</h1>
|
||||||
|
|
||||||
|
<form action="" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
{% buttons %}
|
||||||
|
<input type="hidden" name="next" value="{{ next }}">
|
||||||
|
<input type="submit" class="btn btn-info" value="Change password">
|
||||||
|
{% endbuttons %}
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
<p>That link isn't valid - has it already been used? You can request a new link <a href="{% url 'account_reset_password' %}">here</a>.</p>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>Check Your Inbox</h1>
|
||||||
|
|
||||||
|
<p>We've emailed you instructions for how to reset your password.</p>
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% load bootstrap4 %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>Password Reset</h1>
|
||||||
|
|
||||||
|
<form action="" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
{% bootstrap_form form %}
|
||||||
|
{% buttons %}
|
||||||
|
<input type="hidden" name="next" value="{{ next }}">
|
||||||
|
<input type="submit" class="btn btn-info" value="Send reset link">
|
||||||
|
{% endbuttons %}
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
||||||
11
breccia_mapper/templates/socialaccount/authentication_error.html
Executable file
11
breccia_mapper/templates/socialaccount/authentication_error.html
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
{% extends "socialaccount/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Federated Login Failure" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>{% trans "Federated Login Failure" %}</h1>
|
||||||
|
|
||||||
|
<p>{% trans "An error occurred while attempting to log in via your third party account." %}</p>
|
||||||
|
{% endblock %}
|
||||||
1
breccia_mapper/templates/socialaccount/base.html
Executable file
1
breccia_mapper/templates/socialaccount/base.html
Executable file
@@ -0,0 +1 @@
|
|||||||
|
{% extends "account/base.html" %}
|
||||||
70
breccia_mapper/templates/socialaccount/connections.html
Executable file
70
breccia_mapper/templates/socialaccount/connections.html
Executable file
@@ -0,0 +1,70 @@
|
|||||||
|
{% extends "socialaccount/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Account Connections" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
<a class="btn btn-primary mb-4" href="{% url 'account_email' %}">{% trans "Account Details" %}</a>
|
||||||
|
|
||||||
|
<h2 class="h2" id="head_banner">{% trans "Account Connections" %}</h2>
|
||||||
|
|
||||||
|
{% if form.accounts %}
|
||||||
|
<p>{% blocktrans %}You can sign in to your account using any of the following third party accounts:{% endblocktrans %}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<form method="post" action="{% url 'socialaccount_connections' %}">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
{% if form.non_field_errors %}
|
||||||
|
<div id="errorMsg">{{ form.non_field_errors }}</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% for base_account in form.accounts %}
|
||||||
|
{% with base_account.get_provider_account as account %}
|
||||||
|
<div>
|
||||||
|
<label for="id_account_{{ base_account.id }}">
|
||||||
|
<input id="id_account_{{ base_account.id }}" type="radio" name="account"
|
||||||
|
value="{{ base_account.id }}" />
|
||||||
|
<span class="socialaccount_provider {{ base_account.provider }} {{ account.get_brand.id }}">
|
||||||
|
{% if account.get_brand.name == "Microsoft Graph" %}
|
||||||
|
Microsoft
|
||||||
|
{% else %}
|
||||||
|
{{ account.get_brand.name }}
|
||||||
|
{% endif %}
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
{{ account }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{% endwith %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button class="btn btn-danger" type="submit">{% trans 'Remove' %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
<p>{% trans 'You currently have no third party accounts connected to this account.' %}</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<h3 class="h3" id="head_banner">{% trans 'Add Federated Login Account' %}</h3>
|
||||||
|
|
||||||
|
<p>Adding a third party account allows you to log in to this site with it.</p>
|
||||||
|
|
||||||
|
<div class="social_providers_list">
|
||||||
|
{% include "socialaccount/snippets/provider_list.html" with process="connect" %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% include "socialaccount/snippets/login_extra.html" %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
15
breccia_mapper/templates/socialaccount/login_cancelled.html
Executable file
15
breccia_mapper/templates/socialaccount/login_cancelled.html
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
{% extends "socialaccount/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Login Cancelled" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h1>{% trans "Login Cancelled" %}</h1>
|
||||||
|
|
||||||
|
{% url 'account_login' as login_url %}
|
||||||
|
|
||||||
|
<p>{% blocktrans %}Login was cancelled. If this was a mistake, please proceed to <a href="{{login_url}}">sign in</a>.{% endblocktrans %}</p>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
2
breccia_mapper/templates/socialaccount/messages/account_connected.txt
Executable file
2
breccia_mapper/templates/socialaccount/messages/account_connected.txt
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}Your third party account has been connected.{% endblocktrans %}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}Your third party account is already connected to a different account on this site.{% endblocktrans %}
|
||||||
2
breccia_mapper/templates/socialaccount/messages/account_disconnected.txt
Executable file
2
breccia_mapper/templates/socialaccount/messages/account_disconnected.txt
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% blocktrans %}Your third party account has been disconnected.{% endblocktrans %}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user