399 Commits

Author SHA1 Message Date
ce293d1388 Merge pull request #129 from Southampton-RSG/dev
[DOCS] Minor formatting
2023-03-30 08:02:49 +01:00
f83805af4f [DOCS] Minor formatting 2023-03-30 08:01:45 +01:00
97530b2203 Merge pull request #128 from Southampton-RSG/dev
[DOCS] Change release version
2023-03-30 08:00:21 +01:00
170db50a1c [DOCS] Change release version 2023-03-30 07:44:06 +01:00
1b59bb9f99 Merge pull request #127 from Southampton-RSG/dev
Merge docs changes from dev
2023-03-29 12:54:23 +01:00
2ebe7777c3 [DOCS] Add badges and links to docs 2023-03-29 12:25:00 +01:00
2f9f35c396 [DOCS] Yet another attempt fix for cross-ref link 2023-03-26 18:52:17 +01:00
aecd0ff314 [DOCS] Anpther attempt fix cross-ref link 2023-03-26 18:50:18 +01:00
e0e9a05747 [DOCS] Another attempt fix for cross-ref link 2023-03-26 18:44:41 +01:00
cce0543408 [DOCS] Attempt fix cross-ref link 2023-03-26 18:42:37 +01:00
a6e36b9854 [DOCS] Fix cross-ref link 2023-03-26 18:39:39 +01:00
995a4f6cb2 [DOCS] Change callout type 2023-03-26 18:38:19 +01:00
d24756ca38 [DOCS] Attempt fix callout type name 2023-03-26 18:36:25 +01:00
f69b7aa1f0 [DOCS] Proof-reading 2023-03-26 18:33:47 +01:00
50839f3240 Merge pull request #126 from Southampton-RSG/dev
Small fixes
2023-03-25 15:42:57 +00:00
74b6b3b27d [DEPLOY] Include Caddyfile for Docker deployment 2023-03-25 15:36:16 +00:00
e51c2dc76b [DOCS] Minor improvements to deployment docs 2023-03-25 15:22:52 +00:00
e7b57df077 Merge pull request #125 from Southampton-RSG/dev
[DOCS] Use compressed archives for deployment
2023-03-25 15:04:03 +00:00
b0fcda5901 [DOCS] Use compressed archives for deployment 2023-03-25 15:02:11 +00:00
92901350a0 Merge pull request #124 from Southampton-RSG/dev
Update master to v2.0.0
2023-03-25 14:45:55 +00:00
253846f877 [DOCS] Small wording change 2023-03-25 14:44:31 +00:00
4b61b26661 [FIX] Ensure Docker only ignores root docs folder 2023-03-25 14:39:34 +00:00
66567e5a55 [FIX] Place signup button in correct template 2023-03-25 14:34:55 +00:00
b8059175c6 [FIX] Variable name to show signup button 2023-03-25 14:11:29 +00:00
a85a07ea82 [FEAT] Add signup button if signups are allowed 2023-03-25 14:07:33 +00:00
21088a1412 [FEAT] Limit Map and Network views to admins 2023-03-25 13:54:55 +00:00
e37d5fcb61 [DOCS] Add bulk of general use documentation 2023-03-25 13:45:31 +00:00
f6bfcceb6c [DOCS] Rename files for section ordering 2023-03-24 19:58:05 +00:00
79bb6cc415 [DOCS] Add basic Docker Desktop deployment info 2023-03-24 19:57:48 +00:00
99161b269e [DOCS] Rename sections for ordering 2023-03-24 19:54:14 +00:00
365c3f04c9 [DOCS] Add configuration documentation 2023-03-24 19:50:18 +00:00
65023cf4f9 [DEPLOY] Stop exposing unnecessary server port 2023-03-12 18:26:18 +00:00
85bb6ae5ba Set fixed version numbers for Python requirements 2023-03-12 17:14:11 +00:00
6eeb74fdd7 [DOCS] Small updates 2023-03-12 15:54:43 +00:00
f015929a0c Residual changes from Person-User relationship changes 2023-03-12 15:40:09 +00:00
c05ef1ed10 [DEPLOY] Update template env file to require Google Maps API key 2023-03-12 15:39:38 +00:00
f8593776c0 [FEAT] Allow admins to manage relationships for all Persons
All Persons now have associated Users, meaning Users can be hijacked by admins to manage the relationships for the associated Person.
2023-03-12 15:39:03 +00:00
284132f4cc [FIX] Formatting of data during display 2023-03-12 15:37:43 +00:00
858933c6bb [FEAT] Update database migrations to be more generic and applicable 2023-03-12 15:37:20 +00:00
0a3c85bb42 [STYLE] Padding above footer 2023-03-12 15:35:42 +00:00
266bdfe628 [FIX] Django compatibility 2023-03-12 15:35:20 +00:00
d19554de24 [DEPLOY] Add deployment resources 2023-03-12 13:00:40 +00:00
4e4503e097 [FIX] Offline PWA functionality and style offline page 2023-03-12 12:57:19 +00:00
d65ccc807f [DOCS] Update for new database 2023-02-24 19:46:37 +00:00
b94c459e56 [DOCS] [FIX] Incorrect URLs 2023-02-24 19:46:19 +00:00
b6a6be99da [DEPLOY] Update deployment files for new database 2023-02-24 19:45:56 +00:00
83765c99ad [FEAT] Styling improvements 2023-02-24 19:45:02 +00:00
11a6f8d8f1 [FEAT] Add 404 page 2023-02-24 19:44:33 +00:00
bcb2b1bc20 [FEAT] Transition to PostgreSQL database in another Docker container 2023-02-24 19:44:17 +00:00
843bdebabf [FEAT] Add Bootstrap theming through admin dashboard 2023-02-24 19:43:34 +00:00
86e18c399d [FEAT] Enable django-allauth for enhanced user management & federation 2023-02-24 19:42:07 +00:00
05ca7433f1 [FEAT] Add Django command to selectively load fixtures
Only loads data if object isn't a BootstrapTheme that already exists
2023-02-24 19:35:34 +00:00
3beeeab4ae [FIX] Remove redundant data passing 2023-02-12 15:03:11 +00:00
ccea25133c [DOCS] Add "choosing how to deploy" section
Also tidy up formatting and remove old comments
2023-02-10 16:00:21 +00:00
ced86f308b [FIX] Remove spaces from default email address 2023-02-10 15:57:21 +00:00
6d1e5effda Update Vagrant docs link 2023-02-10 15:33:41 +00:00
809894a04c [DOCS] Clearer deployment instructions 2023-02-10 15:24:27 +00:00
9967c081c9 [DEPLOY] Use Docker images from Docker Hub 2023-02-10 13:59:38 +00:00
555aae5d1c [FEAT] Isolate settings from image build and allow PWA customisation
Settings can now be changed without rebuilding the image
PWA settings can now be changed
2023-02-10 13:32:13 +00:00
905613d8e9 Update password reset completed message
Remind users to complete their profiles
2023-02-10 11:22:57 +00:00
e3ea56ce32 [FEAT] Include username in welcome email 2023-02-02 14:59:30 +00:00
d66e0ea21a [FEAT] Re-enable basic PWA support without customisation options 2023-02-01 23:29:43 +00:00
50f5363b69 [FIX] Move site URL settings out of constance to allow access for CORS
CORS options require access to these settings, so they must be set before deployment
2023-02-01 23:17:24 +00:00
de11df1999 [FIX] Creating relationships with missing Person objects
When User had no associated Person object, or chosen person_pk did not correlate to an existing Person object, error 500 was thrown
2023-02-01 23:14:25 +00:00
35d8d9423a [FIX] Home page header overlay box too wide on small screens 2023-02-01 22:18:08 +00:00
347e189a96 [FIX] Edge case bug when viewing Person before user creates their Person
Handle error thrown if user tries to view a Person object's details (/person/xx) before creating their own linked Person object
2023-02-01 18:38:28 +00:00
e15de01cfa [FEAT] Enable PWA functionality 2023-01-20 17:46:21 +00:00
0d03678674 Revert "[DOCS] Build formats settings"
This reverts commit 08c004d42d.
2023-01-20 16:57:35 +00:00
08c004d42d [DOCS] Build formats settings
Use web interface settings for additional build formats
2023-01-20 16:51:15 +00:00
5fca39f32c [DOCS] Add RTD extentions to config 2023-01-20 16:48:09 +00:00
8782b879a1 [FEAT] Add BRECcIA attribution to footer 2023-01-20 16:47:48 +00:00
d5eef1a296 [FIX] Date picker date format 2023-01-20 16:47:16 +00:00
dcf08830f4 Revert "[FEAT] Attempt to include password reset link in welcome email"
This reverts commit 361ab675d3.
2023-01-19 23:59:36 +00:00
361ab675d3 [FEAT] Attempt to include password reset link in welcome email 2023-01-19 23:49:04 +00:00
e1ba0df894 Update repo URL 2023-01-19 23:29:19 +00:00
f0dee9794f Update welcome email to link to password reset URL 2023-01-19 23:29:07 +00:00
19698270e5 [FEAT] Password resets 2023-01-19 23:28:55 +00:00
f0f03c1175 [FEAT] Allow changing header image scaling on home page 2023-01-19 23:28:36 +00:00
8427b78ba6 Merge pull request #123 from mgrove36/dev
Merge development from personal fork
2023-01-19 21:41:55 +00:00
62a28c6c66 Merge pull request #122 from Southampton-RSG/master
Ensure dev branch is up-to-date
2023-01-19 21:40:30 +00:00
bb7568885d Rename tool to network mapper 2023-01-11 13:42:45 +00:00
31a2367514 [STYLYE] Background image on home page 2023-01-11 13:41:43 +00:00
b0e51bcfd6 Change default project lead 2023-01-10 20:44:16 +00:00
a8f119a1df Change default project names 2023-01-08 18:13:17 +00:00
2ad21765c0 Change admin site headings 2023-01-08 18:13:11 +00:00
7289774dc7 [DOCS] Remove redundant extensions 2023-01-07 22:23:26 +00:00
107e0f317b [DOCS] Update table of contents 2023-01-07 22:23:16 +00:00
2d5f3e3b2e [DOCS] Remove typo 2023-01-07 22:10:16 +00:00
ba44a34946 [DOCS] Explain superuser provisioning with Ansible 2023-01-07 22:09:25 +00:00
0c90b72c7f [DEPLOY] Change default debug value 2023-01-07 22:03:12 +00:00
38d6e7e9cc Typo 2023-01-07 22:02:50 +00:00
a57aee1ea7 [REFACTOR] Remove redundant options from settings.ini 2023-01-07 22:02:21 +00:00
04f9f81408 Add deployment docs 2023-01-07 22:02:00 +00:00
e75631f8a5 Add self attribution 2023-01-07 21:12:31 +00:00
c0871a7b51 Add documentation badge to readme 2023-01-07 21:11:47 +00:00
822b6e95aa [FIX] Link not rendering 2023-01-07 21:05:38 +00:00
7e9bbd2792 [BUILD] Switch to using Markdown for docs 2023-01-07 20:59:35 +00:00
b00a4dcb8e Update copyright 2023-01-07 20:33:30 +00:00
7555d4bd2b Typo 2023-01-07 20:33:20 +00:00
bf896d07b0 [FIX] Add Python requirements file for RTD build 2023-01-07 20:30:44 +00:00
539fb8daa3 [FIX] Remove Python options from RTD config file 2023-01-07 20:28:23 +00:00
35240b25ba [BUILD] Add RTD config file 2023-01-07 20:27:22 +00:00
4d38b2f8f0 [FEAT] Add beginnings of documentation 2023-01-07 20:20:51 +00:00
df0d9aa902 Move placeholder images to correct folder 2023-01-07 19:37:15 +00:00
011a01d176 [FIX] attempting to make media folder hosting work 2023-01-07 19:31:49 +00:00
2a08ddba45 Remove redundant code left from the fix in commit d6bd47 2023-01-07 19:21:52 +00:00
bcba36a421 [FIX] Welcome email formatting 2023-01-07 19:19:52 +00:00
d6bd47b4ea Attempt fix to make constance config accessible in email template 2023-01-07 19:14:34 +00:00
2c1ebbc399 Update settings used in emails 2023-01-07 19:10:15 +00:00
330ec1afe1 [REFACTOR] Move existing images to new media folder location 2023-01-07 19:09:55 +00:00
2096534085 [FIX] move media out of static folder 2023-01-07 18:58:27 +00:00
8608a350f3 [FIX] typo 2023-01-07 18:44:37 +00:00
4e82d363bc [REFACTOR] Use constance variables in email template and add login URL 2023-01-07 18:44:30 +00:00
cbd2158307 [BUILD] Remove redundant options from settings file 2023-01-05 23:45:49 +00:00
0355392675 [FEAT] Move a lot of content/settings to Constance
They can now be changed in the Django admin interface
2023-01-05 23:43:31 +00:00
c5dca62b0b [FEAT] Automate provisioning of admin user with Ansible 2023-01-05 20:18:59 +00:00
050a69d5ea [BUILD] Update image name in Ansible playbook 2023-01-05 17:57:33 +00:00
07c15281c0 [FIX] Residual compatibility update
Font Awesome icon updated to new version
2023-01-05 17:56:39 +00:00
15bbf2f7d1 [BUILD] Change docker image & container names 2023-01-05 17:56:04 +00:00
7e2491be76 [FEAT] Update dependencies
Upgrade versions of most packages and make other required changes to ensure compatibility. Update database models and migrations to match new requirements set by Django
2023-01-05 17:49:27 +00:00
770b4f1114 Add way to change deployment configuration options 2023-01-01 16:12:45 +00:00
4b37c202f4 Add example settings file for deployment 2023-01-01 16:11:25 +00:00
de111bea55 Update Git repo references for devlopment testing 2023-01-01 16:10:49 +00:00
6e2267a4b6 Update Caddyfile for newer Caddy version
Format single_field common_log is deprecated
2023-01-01 16:09:18 +00:00
James Graham
51ac084c52 Merge pull request #121 from Southampton-RSG/dev
Dev
2022-03-31 19:51:39 +01:00
James Graham
d4bb874236 Merge pull request #120 from Southampton-RSG/feat/autofill-negative
Add button to autofill negative responses
2022-03-31 19:48:02 +01:00
James Graham
3887815bbc feat: add button to autofill negative responses 2022-03-31 19:42:39 +01:00
James Graham
9a90b1a432 refactor: split out relationship form 2022-03-31 19:01:03 +01:00
James Graham
c50bdca3eb feat: add negative response flag to question models 2022-03-31 18:48:18 +01:00
James Graham
183c8706b6 build: remove .env secrets file from Docker build 2022-03-31 18:48:01 +01:00
James Graham
632c199ffb build: remove version number from typed-ast dependency
Allows installing on current Python
2022-03-31 18:47:12 +01:00
James Graham
a4b2e085d8 docs: update README.md 2022-03-31 18:28:50 +01:00
James Graham
93487e3541 Merge pull request #118 from Southampton-RSG/docker
Switch to Docker for deployment
2022-03-31 18:13:03 +01:00
James Graham
fe5b68488f build: fully update deployment process and provide docs 2022-03-31 18:12:44 +01:00
James Graham
8b8a05597c build: fix database file in deployment 2022-03-31 15:37:07 +01:00
James Graham
055e1080dd build: update deployment for Docker 2022-03-17 13:58:07 +00:00
James Graham
ba6701ee67 build: remove old Ansible roles 2022-03-16 15:13:59 +00:00
James Graham
b9b153d654 feat: retune network diagram styling
- Node size proportional to connections
- Font size proportional to connections
- Greater default spacing
2021-09-08 15:43:19 +01:00
James Graham
a66d7d407c fix: decrease zoom sensitivity on network view 2021-09-08 14:38:55 +01:00
James Graham
a5a954ee7d build: pass tls config from environment to Caddy 2021-09-08 14:29:29 +01:00
James Graham
40c5aed15c build: use environment variables in docker-compose 2021-09-08 14:28:13 +01:00
James Graham
4a46466f1e Merge branch 'master' of github.com:Southampton-RSG/breccia-mapper 2021-07-30 18:31:18 +01:00
James Graham
4019749930 Merge branch dev 2021-07-30 18:30:13 +01:00
James Graham
d2093f849a build: add docker-compose deployment 2021-07-30 18:29:15 +01:00
James Graham
40c138de00 fix: sort relationships by names in admin panel 2021-05-20 16:43:28 +01:00
James Graham
3ea4ea88a7 refactor: reorganise network page
Backend form handling slightly simplified - date is own form now
2021-05-20 15:28:59 +01:00
James Graham
9d14cf4b38 fix: restrict csv exports to staff only 2021-05-17 19:29:53 +01:00
James Graham
48cce12c32 feat: embed extra data in person csv
Resolves #113
2021-05-17 19:29:26 +01:00
James Graham
264c353b1d feat: add export views for organisation types 2021-05-17 19:13:45 +01:00
James Graham
f37d7c77c4 fix: update exports for static answerset fields
Resolves #99
2021-05-17 18:26:52 +01:00
James Graham
479ef038d4 fix: rendering of select2 fields in network filter 2021-05-12 21:05:37 +01:00
James Graham
8f7767fa5c fix: button correctly resets filters after POST 2021-05-12 20:52:59 +01:00
James Graham
8ca1ba3d95 feat: add panzoom widget to network view 2021-05-12 20:32:18 +01:00
James Graham
e7a113c4ee feat: add buttons to anonymise nodes on graph 2021-05-12 19:56:18 +01:00
James Graham
b28d714e9e fix: add arrow to organisation relationships 2021-05-12 19:39:33 +01:00
James Graham
1ea2c5448b feat: add button to hide organisations from graph 2021-05-12 19:37:46 +01:00
James Graham
c57392e83c feat: add configurable help text for relationships
Displayed at the top of relationship forms
2021-05-10 13:21:37 +01:00
James Graham
4f1dfe16cd feat: expand node and bring to front when selected 2021-05-10 12:21:20 +01:00
James Graham
9ead2ab05f fix: fit node labels inside nodes 2021-05-10 12:14:09 +01:00
James Graham
bc28c238ea fix: use correct url in breadcrumb 2021-05-09 15:26:28 +01:00
James Graham
e7542e70a5 fix: hide free text fields by default
Script was missing from Organisation and Relationship forms

Resolves #114
2021-05-09 15:17:11 +01:00
James Graham
7f01bff993 fix: sort organisations by name within groups
Resolves #115
2021-05-09 13:53:07 +01:00
James Graham
4e87176c17 fix: restore map picker marker
Marker was broken on map picker for entities with no location set yet
2021-04-27 11:07:25 +01:00
James Graham
6a5addc917 fix: increase force between nodes in network view 2021-04-26 21:31:19 +01:00
James Graham
0e08feee01 fix: 'new relationship' -> 'add relationship' 2021-04-26 21:06:40 +01:00
James Graham
311a90fe09 fix: hide map on detail pages when no location set 2021-04-26 21:04:02 +01:00
James Graham
fa6a4339d8 fix: fix org map pin color on detail view 2021-04-26 21:03:03 +01:00
James Graham
d5f85c84c8 fix: hide relationship buttons on own profile page 2021-04-26 20:29:22 +01:00
James Graham
123a123050 fix: change default map location to Null Island
Apply sensible default zoom
Distinguish people and orgs on map
2021-04-26 20:21:46 +01:00
James Graham
adc9021002 fix: Force new user workflow through right forms
Resolves #112
Resolves #68
2021-04-25 17:13:59 +01:00
James Graham
7681e78a50 perf: prefetch for serializers on network view
Reduces request time by more than 50%
2021-04-25 15:11:21 +01:00
James Graham
7d14fed90f fix: distinguish kinds of relationship with orgs
Refactor node/edge style method to improve performance
2021-04-25 14:00:37 +01:00
James Graham
bd13bb29e8 style: add yapf style config 2021-04-25 13:58:55 +01:00
James Graham
0f4e39fcaf feat: add network filter reset button 2021-04-25 12:00:57 +01:00
James Graham
7d1c05cfd8 feat: add organisation relationships to network 2021-04-25 11:50:52 +01:00
James Graham
cc25a154ac refactor: reduce duplication in network filters 2021-04-25 11:25:15 +01:00
James Graham
20812dfc40 feat: add person and org filters to network
Resolves #54
2021-04-22 21:16:39 +01:00
James Graham
5a2890ece1 refactor: move network js to own file
Add initial styling to network - only placeholder at the moment

See #83
2021-04-19 17:14:54 +01:00
James Graham
4635e79520 Create LICENSE 2021-04-19 14:20:22 +01:00
James Graham
78e35b70e0 feat: add button to save image of network
Resolves #84
2021-04-19 12:49:27 +01:00
James Graham
9f5253834f fix: hide 'become user' button on own profile
Resolves #89
2021-04-19 12:09:38 +01:00
James Graham
78056c7752 fix: add back name to person table export 2021-04-19 09:48:39 +01:00
James Graham
2664ff6e83 refactor: allow question prefix on dynamic forms
Setup to support multiple network filters
See #54
2021-03-26 11:36:19 +00:00
James Graham
9f067249de fix: show free text for 'other' in multi-select
Resolves #104
Should resolve #101
See #75
2021-03-21 11:59:29 +00:00
James Graham
27b16c2212 feat: allow multiple nationalities
Resolves #108
2021-03-19 15:57:32 +00:00
James Graham
81598ea624 refactor: allow admin config of static questions
Text and visibility set in admin panel are now respected everywhere
2021-03-19 15:36:09 +00:00
James Graham
74fffb0cac refactor: views to handled ended relationships
Add ending of organisation relationships
2021-03-19 12:41:36 +00:00
James Graham
42d95beb5a feat: add view to end relationship 2021-03-19 12:00:32 +00:00
James Graham
8093b23870 refactor: making static qs more admin configurable 2021-03-18 18:09:02 +00:00
James Graham
c20b2b5a0a feat: add rel create / update buttons to profiles
See #109
2021-03-18 17:52:14 +00:00
James Graham
2c68877cc8 fix: make disciplinary background public
Resolves #105
2021-03-18 17:29:19 +00:00
James Graham
1de4f741b8 feat: add configurable help text to list pages
Resolves #103
2021-03-18 17:26:59 +00:00
James Graham
98e9148998 refactor: move disciplines and orgs to free text
Resolves #102
2021-03-16 11:54:34 +00:00
James Graham
583a49fdd3 fix: attr error if non-admin updates relationship 2021-03-11 12:59:57 +00:00
James Graham
87e5e6cbf3 fix: redirect to index if no profile exists
New users were sent to profile page before they had a profile
2021-03-10 15:40:10 +00:00
James Graham
3ad8d4a5c9 fix: error when viewing profile with no answerset 2021-03-10 15:03:24 +00:00
James Graham
667a51d1c7 refactor: remove duped code in relationship update 2021-03-10 12:41:07 +00:00
James Graham
75bc12de57 fix: use prev answers as initial for relationships
Resolves #65
2021-03-10 12:38:49 +00:00
James Graham
6f72244331 fix: set table column widths to 50% on profile 2021-03-10 11:48:14 +00:00
James Graham
df13bcf46d fix: exclude hardcoded qs from dynamic table 2021-03-10 11:38:52 +00:00
James Graham
8697d726b6 fix: condense multiple answers to same question
Show on same row on profile page

See #97
2021-03-10 11:20:34 +00:00
James Graham
7ce47fc0ef fix: undo previous change 2021-03-10 10:46:32 +00:00
James Graham
b00ca4c1a2 feat: add question on external organisations 2021-03-10 10:37:42 +00:00
James Graham
af31971565 feat: add configurable help text to questions 2021-03-10 09:48:44 +00:00
James Graham
e3e8a2ada4 refactor: move themes to admin question
Resolves #95
2021-03-10 09:36:21 +00:00
James Graham
5d1caf98ba fix: indentation error in last commit 2021-03-09 17:50:22 +00:00
James Graham
97473a46e2 fix: attribute error on org list page
Error for organisations with no AnswerSet
2021-03-09 17:43:46 +00:00
James Graham
989c8141b3 feat: display organisations on map
Add buttons to toggle organisations and people

Resolves #87
2021-03-09 14:55:31 +00:00
James Graham
6670a87a52 fix: add organisation relationships to profile
Resolves #92
2021-03-09 12:39:20 +00:00
James Graham
e457086c50 fix: update button text on org list
Resolves #93
2021-03-09 12:29:57 +00:00
James Graham
7d74a99518 feat: sort by country on organisation list 2021-03-09 12:24:46 +00:00
James Graham
7e9a6e992a feat: configurable order for static questions 2021-03-08 18:20:34 +00:00
James Graham
ba4f8d8ffd fix: add back buttons on org list 2021-03-08 12:00:13 +00:00
James Graham
85c13033e8 fix: account for org with no answers when get name 2021-03-08 11:56:17 +00:00
James Graham
d1dc505b37 feat: group org list by hq country
Resolves #86
2021-03-08 11:45:43 +00:00
James Graham
12bc9f886f fix: use organisation name from answer set if set
Resolves #90
2021-03-05 12:21:39 +00:00
James Graham
8d68e1b0c3 feat: add hardcoded organisation questions
Resolves #91
Resolves #88
2021-03-05 12:16:31 +00:00
James Graham
02b0132f9c style: resolve linting complaints 2021-03-05 09:24:00 +00:00
James Graham
bf2422c6dd refactor: move organisation models to own module 2021-03-04 12:42:32 +00:00
James Graham
936a375992 feat: add relationships from person to org
Resolves #77
See #78
2021-03-02 09:03:10 +00:00
James Graham
6d5188af72 feat: add project started date to person questions
Resolves #60
2021-03-01 19:26:59 +00:00
James Graham
db76d57971 feat: alternate filter text and hide private
Resolves #53
Resolves #82
2021-03-01 19:01:57 +00:00
James Graham
b73e2dcb2d feat: add organisations to network view
See #78
2021-03-01 14:43:16 +00:00
James Graham
550d7cede0 fix: hide relationship list from non-admins
Resolves #81
2021-02-26 15:57:09 +00:00
James Graham
71e5352b6b refactor: move organisation latlng to answerset 2021-02-24 15:44:34 +00:00
James Graham
c8a68d542a feat: add organisation questions to update view 2021-02-24 14:59:43 +00:00
James Graham
adf12442a4 feat: add organisation questions and admin pages
See #76
2021-02-24 12:08:52 +00:00
James Graham
25cc33e2c1 fix: correct title of organisation list page
Resolves #79
2021-02-23 11:58:12 +00:00
James Graham
9be49f4faf fix: accept any option starting with 'other'
See #75
2021-02-15 19:13:14 +00:00
James Graham
a6e8f06441 feat: hide free text field unless 'other' selected
See #75
2021-02-15 19:02:41 +00:00
James Graham
7021f05b67 refactor: move disciplines to admin-question
Resolves #59
2021-02-15 15:29:47 +00:00
James Graham
0b1f303d62 fix: populate themes with prev val on person form
Resolves #66
2021-02-15 12:00:54 +00:00
James Graham
8a94a46cd5 fix: replace 'hijack' with 'become' on button 2021-02-08 15:59:02 +00:00
James Graham
0c92554561 fix: set page title 2021-02-08 15:40:43 +00:00
James Graham
a24f5157cd feat: sort people by name
Resolves #71
2021-02-08 15:03:06 +00:00
James Graham
c102cbf091 fix: update export views to match model changes
Resolves #72
2021-02-08 14:58:32 +00:00
James Graham
a141b93644 feat: specify whether question answers are public
Resolves #62
2021-02-08 14:42:07 +00:00
James Graham
9164ea8a05 feat: use django-hijack to switch user accounts
Resolves #74
2021-02-08 14:40:37 +00:00
James Graham
7783aee192 Merge pull request #69 from Southampton-RSG/dev
State as of demo 2021-02-02
2021-02-02 09:05:27 +00:00
James Graham
f4bd9a0cef fix: move existing marker in map picker widget
Resolves #49
2021-02-02 09:00:10 +00:00
James Graham
25a28755c6 feat: use proper datepicker widgets
Resolves #58
2021-02-01 16:50:12 +00:00
James Graham
afae0fd943 feat: add relationship buttons on person list
Resolves #63
2021-02-01 15:47:51 +00:00
James Graham
4bbe4eac3a refactor: simplify relationship create workflow 2021-02-01 09:47:53 +00:00
James Graham
4d4d7ab70b feat: show basic profiles to non-admins
Resolves #61
2021-01-29 14:35:15 +00:00
James Graham
9b98ce73f0 fix: remove 'as target' relationships from profile
Resolves #64
2021-01-29 14:02:33 +00:00
James Graham
94b2ee9d70 feat: allow free form text answers
see #52
2021-01-22 17:15:18 +00:00
James Graham
6dc4bd770f feat: add consent form for data processing 2021-01-20 11:53:08 +00:00
James Graham
3dd97b6457 Merge pull request #46 from Southampton-RSG/dev
Dev
2021-01-18 14:58:33 +00:00
James Graham
f2e945c67f fix: populate foreign key fields initial value
fixes #45
2021-01-18 14:45:02 +00:00
James Graham
4cfee6362d refactor: add person update form fields to initial 2021-01-15 17:45:55 +00:00
James Graham
f94627e4c8 refactor: remove redundancy between js maps 2021-01-15 16:33:34 +00:00
James Graham
59f717829a refactor: add map marker to context on update 2021-01-15 16:32:57 +00:00
James Graham
9db870bcb0 feat: add views for Organisation model
Location picker on update view
2021-01-15 14:58:05 +00:00
James Graham
2d85ab4370 feat: add location to organisations 2021-01-15 13:44:20 +00:00
James Graham
95fda6a3d5 refactor: prep for fallback to organisation latlng 2021-01-15 12:31:49 +00:00
James Graham
90c40b2e2e fix: hide lat-long fields on person update form 2021-01-04 14:44:56 +00:00
James Graham
20342ef671 fix: restore marker on location picker map
fixes #43
2021-01-04 14:37:27 +00:00
James Graham
cbc70ab85a fix: do lookup by person in person update view
Fixes #42
2020-12-18 15:56:19 +00:00
James Graham
e54c717ada refactor: allow custom repo to extend constance 2020-12-18 15:21:07 +00:00
James Graham
efecfa8e43 Merge branch 'maps' into dev 2020-12-16 15:35:16 +00:00
James Graham
2998a7e3fb deploy: entry for google maps api key 2020-12-16 15:35:00 +00:00
James Graham
b2cd5f4940 feature: add map of all people 2020-12-16 14:54:46 +00:00
James Graham
1a27774177 feat: add location search to picker
Requires API key with Google Places API access
Currently untested
2020-12-16 12:09:10 +00:00
James Graham
9e6d1a495e feat: add initial location picker to person update 2020-12-16 11:11:48 +00:00
James Graham
8e52f779ee feat: add location fields to person answer sets 2020-12-15 14:23:51 +00:00
James Graham
82a235e6ff refactor: clean up unused bits of map.js 2020-12-15 13:35:18 +00:00
James Graham
c2961b911f feat: add initial map code from activity mapper 2020-12-15 13:21:17 +00:00
James Graham
76fcb7ceb2 fix: revert relationship link change
Fixes issue where migrations will not run on MySQL
2020-12-07 17:37:47 +00:00
James Graham
80491623de Merge remote-tracking branch 'origin/dev' 2020-12-07 17:05:15 +00:00
James Graham
7e8dba4806 feat: allow multiple choice questions in forms 2020-12-07 17:01:53 +00:00
James Graham
e045b084d0 refactor: extract code share between question sets 2020-12-07 14:19:00 +00:00
James Graham
6bb4f09454 refactor: update forms to match moved questions 2020-12-02 15:53:30 +00:00
James Graham
2027d9d3ab fix: remove refactored questions from person form 2020-12-02 14:57:27 +00:00
James Graham
0288b0320d refactor: move questions on person detail page 2020-12-02 14:57:07 +00:00
James Graham
91a47b4fdc refactor: move static person qs to answerset 2020-12-02 14:40:59 +00:00
James Graham
d6e42cc18d style: fix pyflakes warnings of unused imports 2020-12-02 14:25:49 +00:00
James Graham
f95e06aa18 refactor: move age and gender to question set 2020-11-26 14:10:38 +00:00
James Graham
5035b121a6 refactor: migrate to question sets for person qs
This means we're starting to use the same system for person questions
as for relationship questions
2020-11-26 12:59:30 +00:00
James Graham
a94db2713e fix: Only allow users to create rels as source
There is now no field for users to define the source of a relationship
The source is always the person in the URL
And only that user or staff can access the form
2020-08-14 17:38:22 +01:00
James Graham
6435ec69a1 fix: Show 'add person' button to all users
See #33
2020-07-03 15:48:53 +01:00
James Graham
dde5ec9d7f Merge pull request #37 from Southampton-RSG/dev
Merge first batch of changes from user acceptance testing
2020-06-26 12:10:39 +01:00
James Graham
a1f9510a8c style: Fix minor formatting issue in base template 2020-06-26 11:58:15 +01:00
James Graham
8689c1a204 style: Fix some autoformatting issues 2020-06-26 11:45:21 +01:00
James Graham
387cebd0d4 fix: Improve clarity of network form time filter
Resolves #34
2020-06-26 10:54:40 +01:00
James Graham
0e4234cb35 fix: Hide person details from non-admin users
See #35
2020-06-25 11:38:26 +01:00
James Graham
aafb6c0a21 fix: Remove Person.name from CSV export
See #35
2020-06-25 11:11:14 +01:00
James Graham
b84076ec3b refactor: Make Person.discipline free text
See #33
2020-06-24 16:29:50 +01:00
James Graham
57349a6007 fix: Add changes to detail page missing
See #33
2020-06-24 15:10:00 +01:00
James Graham
ab37139429 feat: Add date started at organisation
See #33
2020-06-24 15:09:23 +01:00
James Graham
26bf55b4b4 fix: Remove Person.core_member field
See #33
2020-06-24 13:47:12 +01:00
James Graham
9a84f77ec4 fix: Don't insert form CSS/JS when no form 2020-06-24 13:40:02 +01:00
James Graham
62d7a1e48c fix: Set defaults if customisation app not loaded 2020-06-24 12:01:45 +01:00
James Graham
a1dc5721e6 Merge branch 'dev' 2020-06-02 09:48:11 +01:00
James Graham
0cceb604dd fix: Fix welcome email bugs
Send only when new user is created
Require email address when user created

Resolves #32
2020-05-28 16:24:44 +01:00
James Graham
c6eda514ca fix: Fix time filtering of relationships on MySQL
Resolves #31
2020-05-28 13:51:00 +01:00
James Graham
8bc82b2a15 temp fix: Temporarily disable welcome emails 2020-05-27 14:47:10 +01:00
James Graham
c364db4f16 fix: Add DEFAULT_FROM_EMAIL 2020-05-27 14:42:28 +01:00
James Graham
82fbdd2ca1 deploy: Add allowed hosts to Ansible variables
Move DB credentials to inventory file
2020-05-27 11:26:52 +01:00
James Graham
567322c0af feat: Send welcome email from template 2020-04-28 15:17:58 +01:00
James Graham
a39cf0e7ca Merge branch 'dev' 2020-04-24 15:23:54 +01:00
James Graham
b99aa77d7b security: Remove TLSv1.3
Required version of openssl not available on RHEL
2020-04-24 15:14:31 +01:00
James Graham
efee146044 security: Disable TLS < 1.2 2020-04-24 15:01:40 +01:00
James Graham
a382d93b00 Merge branch 'dev' 2020-04-24 13:00:30 +01:00
James Graham
aaafdef7e1 deploy: Add email config to settings.ini template 2020-04-24 13:00:09 +01:00
James Graham
17e6255d62 feat: Add config for email sending 2020-04-21 15:02:13 +01:00
James Graham
1ca3c4e6c4 Merge branch 'dev' 2020-04-21 09:39:55 +01:00
James Graham
5dcfbb6052 feat!: Add answer sets to CSV export
BREAKING CHANGE: Change format of Relationship CSV export
BREAKING CHANGE: Use 'id' for id field in CSV exports
Add RelationshipAnswerSet CSV export
2020-04-20 15:12:34 +01:00
James Graham
d6763a760e fix: Separate date field from relationship questions 2020-04-20 13:56:06 +01:00
James Graham
3b3cec02be feat: Add date field to network view
Filters relationships to only those valid at date
2020-04-20 13:32:07 +01:00
James Graham
719b11e79e fix: Fix broken relationship update form
Did not get values from fields correctly
Incorrectly marked answersets as expired immediately
2020-04-20 13:30:15 +01:00
James Graham
bf472a69fd refactor: Reverse relationship query in network view 2020-04-17 16:03:11 +01:00
James Graham
75fc169630 fix: Fix filters on network view
Filters now use OR for multiple choices in the same field
2020-04-17 15:04:48 +01:00
James Graham
19735e9771 fix: Fix network JS to use new serialized relationship format 2020-04-17 11:38:59 +01:00
James Graham
2b0ba8d12e deploy: Add deployment keyfile variables to inventory 2020-04-17 11:38:10 +01:00
James Graham
fa07b13fbd fix: Minor changes to style of masthead image 2020-04-16 14:07:43 +01:00
James Graham
57c29bf01d refactor: Begin import of customisation app 2020-04-16 14:07:14 +01:00
James Graham
4a1e33064c Merge branch 'dev' 2020-04-02 19:45:33 +01:00
James Graham
224a92f42e style: Fix a few minor style issues 2020-04-02 19:09:28 +01:00
James Graham
63e06d812d refactor: Simplify User person test 2020-04-02 18:40:11 +01:00
James Graham
eea4342455 fix: Add heading to all pages 2020-04-02 18:35:24 +01:00
James Graham
c7a6c72219 fix: Fix broken activity signup 2020-04-02 17:15:27 +01:00
James Graham
fef6e9d459 feat: Users can create Activities
Resolves #22
2020-04-02 17:02:27 +01:00
James Graham
216e6b06fa fix: Make activity attendees optional 2020-04-02 16:59:54 +01:00
James Graham
dc69c51ac9 Merge branch 'dev' 2020-04-02 16:39:50 +01:00
James Graham
ada72c24f8 feat: Export activity attendance
Resolves #23
2020-04-02 16:27:29 +01:00
James Graham
8f494e1be5 fix: Use underscores in export column headers
Resolves #30
2020-04-02 15:42:48 +01:00
James Graham
e5bb530214 Merge branch 'dev' 2020-04-02 11:10:00 +01:00
James Graham
6418c8c96a fix: Fix broken Activity export
Unexpected Series field no longer added when Activity does
not belong to a series
2020-04-02 10:56:29 +01:00
James Graham
db96e65485 fix: Type annotation not available in py36 2020-04-01 17:05:04 +01:00
James Graham
15aab2eb33 feat: Add Activity export
See #27
See #29
Resolves #24
2020-04-01 16:48:23 +01:00
James Graham
7d1aac2021 refactor: Rename Person serializers 2020-04-01 16:23:16 +01:00
James Graham
d02f865952 refactor: Move export into separate app 2020-04-01 16:00:22 +01:00
James Graham
76270c4572 feat: Export relationships with answers
See #27
See #29
Resolves #25
2020-04-01 13:15:48 +01:00
James Graham
76ae447cc6 refactor: Move flattening to serializer base class 2020-04-01 09:57:28 +01:00
James Graham
04ae8cb4f6 feat: Recursively flatten serializers for CSV export 2020-03-31 15:43:33 +01:00
James Graham
80f7fb0857 deploy: Add SSH to firewall allowed services 2020-03-30 20:54:15 +01:00
James Graham
834fb3c644 fix: Add login required on all remaining views 2020-03-30 20:52:09 +01:00
James Graham
1bc45b1106 deploy: Only configure firewall if it's already running 2020-03-30 20:30:37 +01:00
James Graham
74d3c1b091 deploy: Use RedHat Software Collections
RHSCL provides patched versions of Python and Nginx
2020-03-30 17:18:19 +01:00
James Graham
da57108e3e refactor: Use custom CSV export view
Remove dependency on djangorestframework-csv
2020-03-27 17:00:37 +00:00
James Graham
2cdc7675c7 refactor: Split people.views into multiple modules 2020-03-27 15:15:18 +00:00
James Graham
7c75f9d7f4 feat: Add export page link to navbar 2020-03-27 14:33:22 +00:00
James Graham
74aab162e1 feat: Add export front page 2020-03-27 14:31:59 +00:00
James Graham
af77cb39f8 feat: Add CSV export of Relationships 2020-03-27 14:31:38 +00:00
James Graham
416f2fbf6c Merge branch 'master' into dev 2020-03-27 11:15:37 +00:00
James Graham
9f493a53e4 feat: Add initial CSV export of people 2020-03-27 11:15:26 +00:00
James Graham
d83f4bda49 fix(people): Fix redirect after new relationship 2020-03-10 13:12:20 +00:00
James Graham
8c698e821d fix(deploy): Drop uWSGI to correct gid 2020-03-10 10:55:27 +00:00
James Graham
440de19c56 feat(network): Add initial filtering to network
See #19
2020-03-10 10:52:20 +00:00
James Graham
09b7fc334b fix(network): Require login for network view 2020-03-09 12:52:29 +00:00
James Graham
512590d615 feat(network): Add style to network
Style nodes and edges of network
Fix layout of network not running

See #14
2020-03-09 12:43:57 +00:00
James Graham
6e00c42302 Merge branch 'dev' 2020-03-06 15:12:53 +00:00
James Graham
b2fd9eeaf9 feat(people): Add network view
Network view shows people and relationships between them

Resolves #21
Resolves #20
Part of #14
2020-03-06 15:09:40 +00:00
James Graham
9b3b759254 refactor(people): Move relationship answers to answer set
Answers to the relationship questions have been moved from the relationship
to another model RelationshipAnswerSet.  A new answer set is created each
time a user answers the relationship questions.

Resolves #16
Resolves #17
Resolves #18
2020-03-05 15:22:28 +00:00
James Graham
1a9ba731cf deploy: Create backup of DB before running migrations 2020-03-05 11:00:12 +00:00
James Graham
474f3a4be3 docs: Add link to (private) GitHub in README.md 2020-03-05 10:25:51 +00:00
James Graham
118ce6228f docs: Add initial README content 2020-03-05 10:12:20 +00:00
James Graham
40afbc1908 fix: Fix broken user check when anonymous 2020-03-03 13:42:46 +00:00
James Graham
7784ab3e09 fix: Fix broken user check when anonymous 2020-03-03 09:58:51 +00:00
James Graham
e3ef4ed90c feat(people): Add notice to fill in user details 2020-03-03 09:55:47 +00:00
James Graham
7ee7ed3ff0 fix: Add dbbackup to installed apps 2020-03-02 08:04:52 +00:00
James Graham
56568093ae fix: Deploy migrations as web user
Resolves issue where server cannot run due to log
file owned by root
2020-03-02 07:42:11 +00:00
James Graham
e410d9bcb1 fix: Add missing settings to template 2020-02-28 15:46:31 +00:00
James Graham
097a6b0152 deploy: Add Makefile with deploy shortcuts 2020-02-28 15:39:13 +00:00
James Graham
a7f34bbb54 deploy: Add Ansible deployment scripts 2020-02-28 15:36:14 +00:00
James Graham
0d2f1a79b2 fix: Retrofix initial migrations with 1023 col
BREAKING CHANGE: Retrospectively modifies migrations
2020-02-28 15:21:43 +00:00
James Graham
512c02a198 fix: Shrink name fields to fit in indexed column 2020-02-28 15:05:47 +00:00
James Graham
507e2a43fa deploy: Add MySQL as dependency 2020-02-28 14:47:01 +00:00
James Graham
7891ab72da feat(people): Admin can define new People
Resolves #9
2020-02-27 13:41:53 +00:00
James Graham
6d12202c8a feat: Add access controls to Person views
See #6
2020-02-27 08:16:01 +00:00
James Graham
e47ee453bd feat(people): Use Select2 fields for Relationship People 2020-02-25 12:47:03 +00:00
James Graham
39127cf972 feat(people): Add discipline and themes to Person
See #1
2020-02-25 11:19:46 +00:00
James Graham
d733b6db63 feat(people): Display activites and data on profile
See #10
2020-02-25 10:47:56 +00:00
James Graham
224bce9853 feat(people): Add job title and role
See #1
2020-02-25 09:15:25 +00:00
James Graham
5e6065951f feat(people): Add organisation field to Person
See #1
2020-02-25 08:52:11 +00:00
James Graham
9210636475 feat(people): Add nationality and residence fields
See #1
2020-02-25 08:38:30 +00:00
James Graham
abcfd67f77 style: Fix majority of Prospector complaints
Mainly whitespace fixes
2020-02-21 17:28:43 +00:00
James Graham
6d2737b1a6 feat(people): Add first user data fields
To support choices in CharFields, Django choices enums have been
backported by bringing in the source file from Django 3.0.3

See #1
2020-02-21 17:10:26 +00:00
James Graham
e4a50dbfa4 feat(people): Display relationship answers on detail page
resolve #5
2020-02-20 15:24:48 +00:00
James Graham
5a1b043862 feat(people): Allow people to describe relationships
Creating a relationship requires answering each of the
relationship questions

resolve #2
partial #5
2020-02-20 14:46:51 +00:00
James Graham
e1df999108 feat(people): Make relationship questions / choices sortable
resolve #7
2020-02-20 14:43:48 +00:00
James Graham
65f46a66f1 feat(activities,people): Allow people to attend activities
resolve #13
2020-02-20 09:38:34 +00:00
James Graham
0d5d04902e feat(activities): Add read views for ActivitySeries 2020-02-19 13:34:59 +00:00
James Graham
db57d3c08f feat(activities): Add read views for Activity 2020-02-19 13:20:59 +00:00
James Graham
85a3ac082b feat(activities): Add activity types and mediums
resolves #8 #11 #12
2020-02-19 13:15:53 +00:00
James Graham
d57c4769ae feat(people): Add view to create Person
User profile nav directs to create new Person for user
if there is not one currently associated

resolves issue #4
2020-02-19 08:17:39 +00:00
James Graham
e530ddc8ec fix(people): Fix links in breadcrumbs 2020-02-18 15:12:08 +00:00
James Graham
e10a6c4521 feat(people): Add proper breadcrumb to people templates 2020-02-18 15:06:56 +00:00
James Graham
e8416bc779 feat(people): Add people list view 2020-02-18 15:06:56 +00:00
James Graham
4b2abd5d6c feat(people): Add detail views for Person and Relationship 2020-02-18 15:06:48 +00:00
James Graham
026fc10999 vc: Add collected static files to .gitignore 2020-02-18 14:36:47 +00:00
James Graham
bc713a9fe7 fix: Add string representation to all models 2020-02-17 15:39:50 +00:00
James Graham
3090ecda9b vc: Add deployment key to .gitignore 2020-02-17 15:38:52 +00:00
James Graham
b7ba0d1749 style: Resolve all pep8/pylint complaints 2020-02-14 10:05:50 +00:00
James Graham
701252ee4a feat(admin): Add admin panel for all models 2020-02-14 10:02:10 +00:00
James Graham
db9859d9af feat(activities): Add Activity models 2020-02-14 09:55:56 +00:00
James Graham
6b426d2b39 feat(people): Add Person and Relationship models 2020-02-14 09:55:00 +00:00
James Graham
1dcdd57ea1 vc: Add .pyc files to gitignore 2020-02-14 09:41:07 +00:00
James Graham
141759479b Add auth pages 2020-01-30 14:28:58 +00:00
254 changed files with 12561 additions and 167 deletions

21
.dockerignore Normal file
View 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
View File

@@ -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
View 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
View File

@@ -0,0 +1,4 @@
[style]
allow_split_before_dict_value=false
column_limit=100
dedent_closing_brackets=true

16
Caddyfile Executable file
View 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
View 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
View 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
View 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
View File

@@ -0,0 +1,31 @@
# BRECcIA Mapper
[![Documentation Status](https://readthedocs.org/projects/breccia/badge/?version=latest)](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
View File

27
activities/admin.py Normal file
View 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
View File

@@ -0,0 +1,5 @@
from django.apps import AppConfig
class ActivitiesConfig(AppConfig):
name = 'activities'

14
activities/forms.py Normal file
View 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',
]

View 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',
},
),
]

View 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,
),
]

View 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'),
),
]

View 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'),
),
]

View 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),
),
]

View 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'),
),
]

View File

@@ -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'),
),
]

View File

99
activities/models.py Normal file
View 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

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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
View 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
View 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
View 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
View File

View File

View 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

View 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

View File

@@ -0,0 +1,7 @@
[
{
"model": "bootstrap_customizer.sitebootstraptheme",
"pk": 1,
"fields": { "site": 1, "bootstrap_theme": 1, "updated": "2023-02-23T14:41:48.620Z" }
}
]

File diff suppressed because one or more lines are too long

15
breccia_mapper/forms.py Normal file
View 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',
}

View File

View 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)

View File

@@ -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'

View 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 */

View File

@@ -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 */

View File

@@ -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;

View 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/');
})
)
});

View File

@@ -0,0 +1,7 @@
{% extends 'base.html' %}
{% block content %}
<h2>Error 403 at {{ request.path }}</h2>
<p>{{ exception }}</p>
{% endblock content %}

View 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 %}

View File

View 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 %}

View File

@@ -0,0 +1 @@
{% extends "base.html" %}

View 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 %}

View File

@@ -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 %}

View File

@@ -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

View 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 %}

View File

@@ -0,0 +1 @@
{% include "account/email/email_confirmation_message.html" %}

View File

@@ -0,0 +1,4 @@
{% load i18n %}
{% autoescape off %}
{% blocktrans %}Confirm Your Registration - {{ settings.PROJECT_SHORT_NAME }}{% endblocktrans %}
{% endautoescape %}

View File

@@ -0,0 +1 @@
Confirm Your Email

View 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 %}

View File

@@ -0,0 +1,4 @@
{% load i18n %}
{% autoescape off %}
{% blocktrans %}Reset Password - {{ settings.PROJECT_SHORT_NAME }}{% endblocktrans %}
{% endautoescape %}

View 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 %}

View 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 %}

View 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 %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}You cannot remove your primary email address ({{email}}).{% endblocktrans %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}Confirmation email sent to {{email}}.{% endblocktrans %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}You have confirmed {{email}}.{% endblocktrans %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}Removed email address {{email}}.{% endblocktrans %}

View File

@@ -0,0 +1,4 @@
{% load account %}
{% load i18n %}
{% user_display user as name %}
{% blocktrans %}Successfully logged in as {{name}}.{% endblocktrans %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}You have signed out.{% endblocktrans %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}Password successfully changed.{% endblocktrans %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}Password successfully set.{% endblocktrans %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}Primary email address set.{% endblocktrans %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}Your primary email address must be verified.{% endblocktrans %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

283
breccia_mapper/templates/base.html Normal file → Executable file
View 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,111 +53,200 @@
{% 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>
<div class="content" style="display: flex; flex-direction: column"> <link rel="stylesheet" type="text/css" href="{% bootstrap_theme_css_below_the_fold_url %}" />
{% block navbar %} <div class="content" style="display: flex; flex-direction: column">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark"> {% block navbar %}
<div class="container"> <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a href="{% url 'index' %}" class="navbar-brand"> <div class="container">
{{ settings.PROJECT_SHORT_NAME }} <a href="{% url 'index' %}" class="navbar-brand">
</a> {{ settings.PROJECT_SHORT_NAME }}
</a>
<button type="button" class="navbar-toggler" <button type="button" class="navbar-toggler"
data-toggle="collapse" data-target="#navbarCollapse" data-toggle="collapse" data-target="#navbarCollapse"
aria-controls="navbar-collapse" aria-expanded="false" aria-label="Toggle navbar"> aria-controls="navbar-collapse" aria-expanded="false" aria-label="Toggle navbar">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<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">
{% if request.user.is_superuser %}
<li class="nav-item"> <li class="nav-item">
<a href="{% url 'admin:index' %}" class="nav-link">Admin</a> <a href="{% if request.user.person %}{% url 'people:person.profile' %}{% else %}{% url 'people:person.create' %}{% endif %}" class="nav-link">
Profile
</a>
</li> </li>
{% endif %}
</ul>
<ul class="navbar-nav mt-2 mt-lg-0 ml-auto">
{% if request.user.is_authenticated %}
<li class="nav-item"> <li class="nav-item">
{% if request.user.person %} <a href="{% url 'people:person.list' %}" class="nav-link">People</a>
<a href="{{ request.user.get_absolute_url }}" class="nav-link"> </li>
<i class="fas fa-user-circle"></i>
<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 %}
<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">
<a href="{% url 'admin:index' %}" class="nav-link">Admin</a>
</li>
{% endif %}
</ul>
<ul class="navbar-nav mt-2 mt-lg-0 ml-auto">
{% if request.user.is_authenticated %}
<li class="nav-item">
<a href="{% url 'account_email' %}" class="nav-link">
<i class="fa-solid fa-circle-user"></i>
{% if request.user.first_name != "" %}
{{ request.user.first_name }}
{% else %}
{{ request.user }} {{ request.user }}
{% endif %}
</a> </a>
</li>
{% else %} <li class="nav-item">
<span class="navbar-text"> <a href="{% url 'account_logout' %}" class="nav-link">
<i class="fas fa-user-circle"></i> <i class="fa-solid fa-right-from-bracket"></i>
{{ request.user }} Log Out
</span> </a>
</li>
{% endif %} {% else %}
</li> <li class="nav-item">
<li class="nav-item"> <a href="{% url 'account_login' %}" class="nav-link">
<a href="{% url 'logout' %}" class="nav-link"> <i class="fa-solid fa-right-to-bracket"></i>
<i class="fas fa-sign-out-alt"></i> Log In
Log Out </a>
</a> </li>
</li>
{% else %} {% endif %}
<li class="nav-item"> </ul>
<a href="{% url 'login' %}" class="nav-link"> </div>
<i class="fas fa-sign-in-alt"></i>
Log In
</a>
</li>
{% endif %}
</ul>
</div> </div>
</nav>
{% endblock %}
{# Global banner if config.NOTICE_TEXT is set using Constance #}
{% if config.NOTICE_TEXT %}
<div class="alert {{ config.NOTICE_CLASS }} rounded-0 mb-3" role="alert">
<h4 class="alert-heading text-center mb-0">{{ config.NOTICE_TEXT }}</h4>
</div> </div>
</nav> {% endif %}
{% endblock %}
{# Global banner if config.NOTICE_TEXT is set using Constance #} {% load hijack %}
{% if config.NOTICE_TEXT %}
<div class="alert {{ config.NOTICE_CLASS }} rounded-0 mb-0" role="alert"> {# Hijack notification if user is hijacked #}
<h4 class="alert-heading text-center mb-0">{{ config.NOTICE_TEXT }}</h4> {% 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> </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 %}
<main class="{{ full_width_page|yesno:'container-fluid,container' }}">
{# Display Django messages as Bootstrap alerts #}
{% bootstrap_messages %}
{% block content %}{% endblock %}
</main>
<div class="container">
{% block after_content %}{% endblock %}
</div>
</div>
<footer class="footer bg-light">
<div class="container">
<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>
</footer>
{% if not 'javascript_in_head'|bootstrap_setting %}
{% if 'include_jquery'|bootstrap_setting %}
{# jQuery JavaScript if it is in body #}
{% bootstrap_jquery jquery='include_jquery'|bootstrap_setting %}
{% endif %}
{# Bootstrap JavaScript if it is in body #}
{% bootstrap_javascript %}
{% endif %} {% endif %}
{% block before_content %}{% endblock %} {% if form %}
{{ form.media.js }}
<main class="container">
{# Display Django messages as Bootstrap alerts #}
{% bootstrap_messages %}
{% block content %}{% endblock %}
</main>
<div class="container">
{% block after_content %}{% endblock %}
</div>
</div>
<footer class="footer bg-light">
<div class="container">
<span class="text-muted">{{ settings.PROJECT_LONG_NAME }}</span>
</div>
</footer>
{% if not 'javascript_in_head'|bootstrap_setting %}
{% if 'include_jquery'|bootstrap_setting %}
{# jQuery JavaScript if it is in body #}
{% bootstrap_jquery jquery='include_jquery'|bootstrap_setting %}
{% endif %} {% endif %}
{# Bootstrap JavaScript if it is in body #} {% block extra_script %}{% endblock %}
{% bootstrap_javascript %}
{% endif %}
{% block extra_script %}{% endblock %}
</body> </body>
</html> </html>

View 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 %}

View File

@@ -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 %}
<p>{{ config.HOMEPAGE_CARD_1_DESCRIPTION|safe }}</p>
{% endif %}
{% if config.HOMEPAGE_CARD_1_ICON %}
<span class="fa-solid fa-5x fa-{{ config.HOMEPAGE_CARD_1_ICON }}"></span>
{% endif %}
</div> </div>
</div> </div>
</div> </div>
{% endif %}
<div class="col-md-4"> {% 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 %}
<p>{{ config.HOMEPAGE_CARD_2_DESCRIPTION|safe }}</p>
{% endif %}
{% if config.HOMEPAGE_CARD_2_ICON %}
<span class="fa-solid fa-5x fa-{{ config.HOMEPAGE_CARD_2_ICON }}"></span>
{% endif %}
</div> </div>
</div> </div>
</div> </div>
{% endif %}
<div class="col-md-4"> {% 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 %}

View 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 %}

View File

@@ -0,0 +1,10 @@
{% extends 'base.html' %}
{% load bootstrap4 %}
{% block content %}
<h1>Logged Out</h1>
<p>
You have logged out
</p>
{% endblock %}

View 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 %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -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 %}

View 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 %}

View File

@@ -0,0 +1 @@
{% extends "account/base.html" %}

View 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 %}

View 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 %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}Your third party account has been connected.{% endblocktrans %}

View File

@@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans %}Your third party account is already connected to a different account on this site.{% endblocktrans %}

View 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