igs-slm 0.1.4b0__py3-none-any.whl → 0.1.5b0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- igs_slm-0.1.5b0.dist-info/METADATA +115 -0
- {igs_slm-0.1.4b0.dist-info → igs_slm-0.1.5b0.dist-info}/RECORD +192 -172
- {igs_slm-0.1.4b0.dist-info → igs_slm-0.1.5b0.dist-info}/WHEEL +1 -1
- igs_slm-0.1.5b0.dist-info/entry_points.txt +3 -0
- {igs_slm-0.1.4b0.dist-info → igs_slm-0.1.5b0.dist-info/licenses}/LICENSE +1 -1
- slm/__init__.py +17 -14
- slm/admin.py +32 -5
- slm/api/edit/views.py +22 -9
- slm/api/public/views.py +9 -7
- slm/api/views.py +45 -6
- slm/apps.py +28 -6
- slm/authentication.py +3 -2
- slm/bin/startproject.py +102 -31
- slm/bin/templates/{{ project_dir }}/pyproject.toml +30 -21
- slm/bin/templates/{{ project_dir }}/{sites → src/sites}/{{ site }}/base.py +12 -1
- slm/bin/templates/{{ project_dir }}/{sites → src/sites}/{{ site }}/develop/__init__.py +5 -27
- slm/bin/templates/{{ project_dir }}/{sites → src/sites}/{{ site }}/production/__init__.py +6 -27
- slm/bin/templates/{{ project_dir }}/src/sites/{{ site }}/validation.py +29 -0
- slm/context.py +5 -0
- slm/defines/AlertLevel.py +10 -2
- slm/defines/AntennaCalibration.py +6 -4
- slm/defines/AntennaFeatures.py +12 -9
- slm/defines/AntennaReferencePoint.py +12 -10
- slm/defines/Aspiration.py +4 -2
- slm/defines/CardinalDirection.py +6 -4
- slm/defines/CollocationStatus.py +3 -1
- slm/defines/EquipmentState.py +6 -12
- slm/defines/FlagSeverity.py +4 -2
- slm/defines/FractureSpacing.py +7 -5
- slm/defines/FrequencyStandardType.py +6 -4
- slm/defines/GeodesyMLVersion.py +2 -0
- slm/defines/Instrumentation.py +9 -7
- slm/defines/LogEntryType.py +17 -15
- slm/defines/SLMFileType.py +4 -2
- slm/defines/SiteFileUploadStatus.py +7 -24
- slm/defines/SiteLogFormat.py +8 -32
- slm/defines/SiteLogStatus.py +9 -28
- slm/defines/TectonicPlates.py +18 -16
- slm/manage.py +24 -0
- slm/management/commands/check_upgrade.py +142 -0
- slm/management/commands/generate_sinex.py +110 -92
- slm/management/commands/head_from_index.py +11 -8
- slm/management/commands/import_archive.py +27 -18
- slm/management/commands/import_equipment.py +1 -1
- slm/management/commands/sitelog.py +1 -3
- slm/management/commands/synchronize.py +1 -1
- slm/management/commands/validate_db.py +6 -4
- slm/map/defines.py +18 -14
- slm/map/templates/slm/map.html +4 -6
- slm/migrations/0001_remove_archiveindex_no_overlapping_ranges_per_site_and_more.py +26 -0
- slm/migrations/0002_alter_archivedsitelog_file_and_more.py +44 -0
- slm/migrations/0003_alter_archivedsitelog_name_and_more.py +35 -0
- slm/migrations/0004_alter_site_name.py +24 -0
- slm/migrations/0005_slmversion.py +30 -0
- slm/migrations/0017_alter_logentry_unique_together_and_more.py +3 -1
- slm/migrations/0018_afix_deleted.py +3 -1
- slm/migrations/0018_alter_siteantenna_options_and_more.py +87 -56
- slm/migrations/0019_remove_siteantenna_marker_enu_siteantenna_marker_une_and_more.py +1 -1
- slm/migrations/0023_archivedsitelog_gml_version_and_more.py +1 -1
- slm/migrations/0031_alter_antenna_features.py +44 -0
- slm/migrations/0032_archiveindex_valid_range_and_more.py +84 -0
- slm/migrations/add_index_order_index.py +54 -0
- slm/migrations/normalize_index.py +147 -0
- slm/migrations/simplify_index.py +48 -0
- slm/migrations/verify_index.py +67 -0
- slm/models/__init__.py +2 -0
- slm/models/alerts.py +7 -10
- slm/models/data.py +1 -2
- slm/models/equipment.py +1 -1
- slm/models/fields.py +41 -0
- slm/models/index.py +183 -53
- slm/models/sitelog.py +35 -38
- slm/models/system.py +72 -31
- slm/models/user.py +1 -1
- slm/parsing/__init__.py +33 -16
- slm/parsing/legacy/binding.py +65 -34
- slm/parsing/legacy/parser.py +2 -2
- slm/parsing/xsd/binding.py +1 -1
- slm/parsing/xsd/parser.py +1 -2
- slm/receivers/__init__.py +2 -2
- slm/receivers/index.py +2 -1
- slm/receivers/migration.py +21 -0
- slm/settings/__init__.py +192 -4
- slm/settings/assets.py +26 -0
- slm/settings/auth.py +18 -14
- slm/settings/ckeditor.py +12 -6
- slm/settings/debug.py +2 -2
- slm/settings/emails.py +50 -0
- slm/settings/internationalization.py +8 -6
- slm/settings/logging.py +100 -88
- slm/settings/platform/darwin.py +16 -6
- slm/settings/rest.py +20 -15
- slm/settings/root.py +192 -98
- slm/settings/routines.py +5 -1
- slm/settings/secrets.py +20 -31
- slm/settings/security.py +7 -5
- slm/settings/slm.py +35 -16
- slm/settings/static_templates.py +12 -9
- slm/settings/templates.py +31 -25
- slm/settings/uploads.py +33 -5
- slm/settings/urls.py +1 -1
- slm/settings/validation.py +165 -165
- slm/signals.py +3 -2
- slm/static/slm/css/style.css +37 -36
- slm/static/slm/js/autocomplete.js +6 -4
- slm/static/slm/js/file_modal.js +62 -0
- slm/static/slm/js/form.js +3 -3
- slm/static/slm/js/formWidget.js +3 -3
- slm/static/slm/js/persistable.js +5 -1
- slm/templates/admin/base.html +1 -0
- slm/templates/rest_framework/base.html +23 -11
- slm/templates/slm/base.html +27 -22
- slm/templates/slm/forms/widgets/auto_complete.html +12 -11
- slm/templates/slm/forms/widgets/auto_complete_multiple.html +8 -7
- slm/templates/slm/station/download.html +6 -6
- slm/templates/slm/station/edit.html +9 -17
- slm/templates/slm/station/review.html +5 -3
- slm/templates/slm/station/upload.html +4 -1
- slm/templates/slm/station/uploads/legacy.html +1 -1
- slm/templates/slm/widgets/alert_scroll.html +4 -8
- slm/templates/slm/widgets/filelist.html +0 -5
- slm/templates/slm/widgets/log_scroll.html +2 -13
- slm/templates/slm/widgets/stationlist.html +2 -8
- slm/templatetags/slm.py +70 -9
- slm/utils.py +13 -4
- slm/validators.py +14 -14
- slm/views.py +6 -6
- slm/wsgi.py +16 -0
- igs_slm-0.1.4b0.dist-info/METADATA +0 -154
- igs_slm-0.1.4b0.dist-info/entry_points.txt +0 -3
- slm/bin/templates/{{ project_dir }}/sites/{{ site }}/validation.py +0 -11
- /slm/bin/templates/{{ project_dir }}/{sites → src/sites}/__init__.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{sites → src/sites}/{{ site }}/__init__.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{sites → src/sites}/{{ site }}/develop/local.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{sites → src/sites}/{{ site }}/develop/wsgi.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{sites → src/sites}/{{ site }}/manage.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{sites → src/sites}/{{ site }}/production/wsgi.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{sites → src/sites}/{{ site }}/urls.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/__init__.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/admin.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/apps.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/management/__init__.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/management/commands/__init__.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/management/commands/import_archive.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/migrations/__init__.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/models.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/templates/slm/base.html +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/urls.py +0 -0
- /slm/bin/templates/{{ project_dir }}/{{{ extension_app }} → src/{{ extension_app }}}/views.py +0 -0
slm/settings/uploads.py
CHANGED
|
@@ -1,8 +1,36 @@
|
|
|
1
|
-
from slm.settings import
|
|
1
|
+
from slm.settings import env as settings_environment
|
|
2
|
+
from slm.settings import get_setting, set_default, slm_path_mk_dirs_must_exist
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
env = settings_environment()
|
|
5
|
+
|
|
6
|
+
set_default("MEDIA_URL", "/media/")
|
|
7
|
+
|
|
8
|
+
DEBUG = get_setting("DEBUG", False)
|
|
9
|
+
|
|
10
|
+
MEDIA_ROOT = env(
|
|
11
|
+
"MEDIA_ROOT",
|
|
12
|
+
slm_path_mk_dirs_must_exist,
|
|
13
|
+
default=get_setting("MEDIA_ROOT", get_setting("BASE_DIR") / "media"),
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
FILE_UPLOAD_MAX_MEMORY_SIZE = env(
|
|
17
|
+
"FILE_UPLOAD_MAX_MEMORY_SIZE",
|
|
18
|
+
int,
|
|
19
|
+
default=get_setting("FILE_UPLOAD_MAX_MEMORY_SIZE", 2621440),
|
|
20
|
+
)
|
|
5
21
|
|
|
6
22
|
# set RWX for Owner and Group for any uploaded files
|
|
7
|
-
FILE_UPLOAD_PERMISSIONS =
|
|
8
|
-
|
|
23
|
+
FILE_UPLOAD_PERMISSIONS = env(
|
|
24
|
+
"FILE_UPLOAD_PERMISSIONS",
|
|
25
|
+
int,
|
|
26
|
+
default=get_setting("FILE_UPLOAD_PERMISSIONS", 0o664 if DEBUG else 0o660),
|
|
27
|
+
)
|
|
28
|
+
FILE_UPLOAD_DIRECTORY_PERMISSIONS = env(
|
|
29
|
+
"FILE_UPLOAD_DIRECTORY_PERMISSIONS",
|
|
30
|
+
int,
|
|
31
|
+
default=get_setting("FILE_UPLOAD_DIRECTORY_PERMISSIONS", 0o775 if DEBUG else 0o770),
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
FILE_UPLOAD_TEMP_DIR = env(
|
|
35
|
+
"FILE_UPLOAD_TEMP_DIR", str, default=get_setting("FILE_UPLOAD_TEMP_DIR", None)
|
|
36
|
+
)
|
slm/settings/urls.py
CHANGED
|
@@ -117,7 +117,7 @@ urlpatterns = [
|
|
|
117
117
|
path("", include("slm.urls")),
|
|
118
118
|
]
|
|
119
119
|
|
|
120
|
-
if getattr(settings, "
|
|
120
|
+
if getattr(settings, "SLM_DEBUG_TOOLBAR", False):
|
|
121
121
|
urlpatterns.append(path("__debug__/", include("debug_toolbar.urls")))
|
|
122
122
|
|
|
123
123
|
# allows us to use static files like images
|
slm/settings/validation.py
CHANGED
|
@@ -11,6 +11,7 @@ The format of SLM_DATA_VALIDATORS is
|
|
|
11
11
|
}
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
+
from slm.settings import set_default
|
|
14
15
|
from slm.validators import (
|
|
15
16
|
ActiveEquipmentValidator,
|
|
16
17
|
ARPValidator,
|
|
@@ -24,173 +25,172 @@ from slm.validators import (
|
|
|
24
25
|
|
|
25
26
|
# toggling this off will prevent any validation configured to block edit saves
|
|
26
27
|
# from doing so - instead flags will be issued.
|
|
27
|
-
SLM_VALIDATION_BYPASS_BLOCK
|
|
28
|
+
set_default("SLM_VALIDATION_BYPASS_BLOCK", False)
|
|
28
29
|
|
|
29
30
|
# do not allow a log to be published without these sections
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
31
|
+
set_default(
|
|
32
|
+
"SLM_REQUIRED_SECTIONS_TO_PUBLISH",
|
|
33
|
+
[
|
|
34
|
+
"siteform",
|
|
35
|
+
"siteidentification",
|
|
36
|
+
"sitelocation",
|
|
37
|
+
"sitereceiver",
|
|
38
|
+
"siteantenna",
|
|
39
|
+
# 'sitesurveyedlocalties',
|
|
40
|
+
# 'sitefrequencystandard',
|
|
41
|
+
# 'sitecollocation',
|
|
42
|
+
# 'sitehumiditysensor',
|
|
43
|
+
# 'sitepressuresensor',
|
|
44
|
+
# 'sitetemperaturesensor',
|
|
45
|
+
# 'sitewatervaporradiometer',
|
|
46
|
+
# 'siteotherinstrumentation',
|
|
47
|
+
# 'siteradiointerferences',
|
|
48
|
+
# 'sitemultipathsources',
|
|
49
|
+
# 'sitesignalobstructions',
|
|
50
|
+
# 'sitelocalepisodiceffects',
|
|
51
|
+
"siteoperationalcontact",
|
|
52
|
+
# 'siteresponsibleagency',
|
|
53
|
+
# 'sitemoreinformation'
|
|
54
|
+
],
|
|
55
|
+
)
|
|
52
56
|
|
|
53
57
|
# the model field to validator map
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
TimeRangeValidator(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
TimeRangeValidator(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
FieldRequired(),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
FieldRequired(),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
58
|
+
set_default(
|
|
59
|
+
"SLM_DATA_VALIDATORS",
|
|
60
|
+
{
|
|
61
|
+
"slm.SiteIdentification": {
|
|
62
|
+
"site_name": [FieldRequired()],
|
|
63
|
+
"fracture_spacing": [FieldRequired(desired=True), EnumValidator()],
|
|
64
|
+
"iers_domes_number": [FieldRequired()],
|
|
65
|
+
"date_installed": [FieldRequired()],
|
|
66
|
+
},
|
|
67
|
+
"slm.SiteLocation": {
|
|
68
|
+
"city": [FieldRequired()],
|
|
69
|
+
"country": [FieldRequired(), EnumValidator()],
|
|
70
|
+
"tectonic": [EnumValidator()],
|
|
71
|
+
"xyz": [FieldRequired()],
|
|
72
|
+
"llh": [FieldRequired()],
|
|
73
|
+
},
|
|
74
|
+
"slm.SiteReceiver": {
|
|
75
|
+
"receiver_type": [VerifiedEquipmentValidator(), ActiveEquipmentValidator()],
|
|
76
|
+
"satellite_system": [NonEmptyValidator()],
|
|
77
|
+
"serial_number": [FieldRequired()],
|
|
78
|
+
"firmware": [FieldRequired()],
|
|
79
|
+
"installed": [FieldRequired(), TimeRangeValidator(end_field="removed")],
|
|
80
|
+
"removed": [
|
|
81
|
+
TimeRangeValidator(start_field="installed"),
|
|
82
|
+
TimeRangeBookendValidator(),
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
"slm.SiteAntenna": {
|
|
86
|
+
"antenna_type": [VerifiedEquipmentValidator(), ActiveEquipmentValidator()],
|
|
87
|
+
"radome_type": [VerifiedEquipmentValidator(), ActiveEquipmentValidator()],
|
|
88
|
+
"serial_number": [FieldRequired()],
|
|
89
|
+
"reference_point": [FieldRequired(), ARPValidator(), EnumValidator()],
|
|
90
|
+
"installed": [FieldRequired(), TimeRangeValidator(end_field="removed")],
|
|
91
|
+
"removed": [
|
|
92
|
+
TimeRangeValidator(start_field="installed"),
|
|
93
|
+
TimeRangeBookendValidator(),
|
|
94
|
+
],
|
|
95
|
+
"marker_une": [FieldRequired(allow_legacy_nulls=True)],
|
|
96
|
+
"alignment": [FieldRequired(allow_legacy_nulls=True)],
|
|
97
|
+
},
|
|
98
|
+
"slm.SiteSurveyedLocalTies": {
|
|
99
|
+
"name": [FieldRequired()],
|
|
100
|
+
"measured": [FieldRequired(allow_legacy_nulls=True)],
|
|
101
|
+
"diff_xyz": [FieldRequired(allow_legacy_nulls=True)],
|
|
102
|
+
},
|
|
103
|
+
"slm.SiteFrequencyStandard": {
|
|
104
|
+
"standard_type": [FieldRequired(), EnumValidator()],
|
|
105
|
+
"effective_start": [
|
|
106
|
+
FieldRequired(),
|
|
107
|
+
TimeRangeValidator(end_field="effective_end"),
|
|
108
|
+
],
|
|
109
|
+
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
110
|
+
},
|
|
111
|
+
"slm.SiteCollocation": {
|
|
112
|
+
"instrument_type": [FieldRequired()],
|
|
113
|
+
"status": [FieldRequired(allow_legacy_nulls=True), EnumValidator()],
|
|
114
|
+
"effective_start": [
|
|
115
|
+
FieldRequired(),
|
|
116
|
+
TimeRangeValidator(end_field="effective_end"),
|
|
117
|
+
],
|
|
118
|
+
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
119
|
+
},
|
|
120
|
+
"slm.SiteHumiditySensor": {
|
|
121
|
+
"model": [FieldRequired()],
|
|
122
|
+
"manufacturer": [FieldRequired()],
|
|
123
|
+
"height_diff": [FieldRequired(allow_legacy_nulls=True)],
|
|
124
|
+
"effective_start": [TimeRangeValidator(end_field="effective_end")],
|
|
125
|
+
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
126
|
+
"aspiration": [FieldRequired(allow_legacy_nulls=True), EnumValidator()],
|
|
127
|
+
},
|
|
128
|
+
"slm.SitePressureSensor": {
|
|
129
|
+
"model": [FieldRequired()],
|
|
130
|
+
"manufacturer": [FieldRequired()],
|
|
131
|
+
"height_diff": [FieldRequired(allow_legacy_nulls=True)],
|
|
132
|
+
"effective_start": [TimeRangeValidator(end_field="effective_end")],
|
|
133
|
+
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
134
|
+
},
|
|
135
|
+
"slm.SiteTemperatureSensor": {
|
|
136
|
+
"model": [FieldRequired()],
|
|
137
|
+
"manufacturer": [FieldRequired()],
|
|
138
|
+
"height_diff": [FieldRequired(allow_legacy_nulls=True)],
|
|
139
|
+
"effective_start": [TimeRangeValidator(end_field="effective_end")],
|
|
140
|
+
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
141
|
+
"aspiration": [FieldRequired(allow_legacy_nulls=True), EnumValidator()],
|
|
142
|
+
},
|
|
143
|
+
"slm.SiteWaterVaporRadiometer": {
|
|
144
|
+
"model": [FieldRequired()],
|
|
145
|
+
"manufacturer": [FieldRequired()],
|
|
146
|
+
"distance_to_antenna": [FieldRequired(allow_legacy_nulls=True)],
|
|
147
|
+
"height_diff": [FieldRequired(allow_legacy_nulls=True)],
|
|
148
|
+
"effective_start": [TimeRangeValidator(end_field="effective_end")],
|
|
149
|
+
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
150
|
+
},
|
|
151
|
+
"slm.SiteOtherInstrumentation": {"instrumentation": [FieldRequired()]},
|
|
152
|
+
"slm.SiteRadioInterferences": {
|
|
153
|
+
"interferences": [FieldRequired(allow_legacy_nulls=True)],
|
|
154
|
+
"effective_start": [
|
|
155
|
+
FieldRequired(),
|
|
156
|
+
TimeRangeValidator(end_field="effective_end"),
|
|
157
|
+
],
|
|
158
|
+
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
159
|
+
},
|
|
160
|
+
"slm.SiteMultiPathSources": {
|
|
161
|
+
"sources": [FieldRequired(allow_legacy_nulls=True)],
|
|
162
|
+
"effective_start": [
|
|
163
|
+
FieldRequired(),
|
|
164
|
+
TimeRangeValidator(end_field="effective_end"),
|
|
165
|
+
],
|
|
166
|
+
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
167
|
+
},
|
|
168
|
+
"slm.SiteSignalObstructions": {
|
|
169
|
+
"obstructions": [FieldRequired(allow_legacy_nulls=True)],
|
|
170
|
+
"effective_start": [
|
|
171
|
+
FieldRequired(),
|
|
172
|
+
TimeRangeValidator(end_field="effective_end"),
|
|
173
|
+
],
|
|
174
|
+
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
175
|
+
},
|
|
176
|
+
"slm.SiteLocalEpisodicEffects": {
|
|
177
|
+
"event": [FieldRequired(allow_legacy_nulls=True)],
|
|
178
|
+
"effective_start": [
|
|
179
|
+
FieldRequired(),
|
|
180
|
+
TimeRangeValidator(end_field="effective_end"),
|
|
181
|
+
],
|
|
182
|
+
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
183
|
+
},
|
|
184
|
+
"slm.SiteOperationalContact": {
|
|
185
|
+
"agency": [FieldRequired()],
|
|
186
|
+
"preferred_abbreviation": [FieldRequired()],
|
|
187
|
+
"primary_name": [FieldRequired()],
|
|
188
|
+
"primary_phone1": [FieldRequired(desired=True)],
|
|
189
|
+
"primary_email": [FieldRequired(allow_legacy_nulls=True)],
|
|
190
|
+
},
|
|
191
|
+
"slm.SiteMoreInformation": {
|
|
192
|
+
"primary": [FieldRequired()],
|
|
193
|
+
"secondary": [FieldRequired()],
|
|
194
|
+
},
|
|
136
195
|
},
|
|
137
|
-
|
|
138
|
-
"model": [FieldRequired()],
|
|
139
|
-
"manufacturer": [FieldRequired()],
|
|
140
|
-
"distance_to_antenna": [FieldRequired(allow_legacy_nulls=True)],
|
|
141
|
-
"height_diff": [FieldRequired(allow_legacy_nulls=True)],
|
|
142
|
-
"effective_start": [TimeRangeValidator(end_field="effective_end")],
|
|
143
|
-
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
144
|
-
},
|
|
145
|
-
"slm.SiteOtherInstrumentation": {"instrumentation": [FieldRequired()]},
|
|
146
|
-
"slm.SiteRadioInterferences": {
|
|
147
|
-
"interferences": [FieldRequired(allow_legacy_nulls=True)],
|
|
148
|
-
"effective_start": [
|
|
149
|
-
FieldRequired(),
|
|
150
|
-
TimeRangeValidator(end_field="effective_end"),
|
|
151
|
-
],
|
|
152
|
-
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
153
|
-
},
|
|
154
|
-
"slm.SiteMultiPathSources": {
|
|
155
|
-
"sources": [FieldRequired(allow_legacy_nulls=True)],
|
|
156
|
-
"effective_start": [
|
|
157
|
-
FieldRequired(),
|
|
158
|
-
TimeRangeValidator(end_field="effective_end"),
|
|
159
|
-
],
|
|
160
|
-
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
161
|
-
},
|
|
162
|
-
"slm.SiteSignalObstructions": {
|
|
163
|
-
"obstructions": [FieldRequired(allow_legacy_nulls=True)],
|
|
164
|
-
"effective_start": [
|
|
165
|
-
FieldRequired(),
|
|
166
|
-
TimeRangeValidator(end_field="effective_end"),
|
|
167
|
-
],
|
|
168
|
-
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
169
|
-
},
|
|
170
|
-
"slm.SiteLocalEpisodicEffects": {
|
|
171
|
-
"event": [FieldRequired(allow_legacy_nulls=True)],
|
|
172
|
-
"effective_start": [
|
|
173
|
-
FieldRequired(),
|
|
174
|
-
TimeRangeValidator(end_field="effective_end"),
|
|
175
|
-
],
|
|
176
|
-
"effective_end": [TimeRangeValidator(start_field="effective_start")],
|
|
177
|
-
},
|
|
178
|
-
"slm.SiteOperationalContact": {
|
|
179
|
-
"agency": [FieldRequired()],
|
|
180
|
-
"preferred_abbreviation": [FieldRequired()],
|
|
181
|
-
"primary_name": [FieldRequired()],
|
|
182
|
-
"primary_phone1": [FieldRequired(desired=True)],
|
|
183
|
-
"primary_email": [FieldRequired(allow_legacy_nulls=True)],
|
|
184
|
-
},
|
|
185
|
-
"slm.SiteResponsibleAgency": {
|
|
186
|
-
"agency": [FieldRequired()],
|
|
187
|
-
"preferred_abbreviation": [FieldRequired()],
|
|
188
|
-
"primary_name": [FieldRequired()],
|
|
189
|
-
"primary_phone1": [FieldRequired(desired=True)],
|
|
190
|
-
"primary_email": [FieldRequired(allow_legacy_nulls=True)],
|
|
191
|
-
},
|
|
192
|
-
"slm.SiteMoreInformation": {
|
|
193
|
-
"primary": [FieldRequired()],
|
|
194
|
-
"secondary": [FieldRequired()],
|
|
195
|
-
},
|
|
196
|
-
}
|
|
196
|
+
)
|
slm/signals.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
All SLM specific signals sent by the system are defined here. These signals
|
|
3
|
-
mostly include events relating to the site log edit/moderate/publish
|
|
3
|
+
mostly include events relating to the site log edit/moderate/publish life cycle.
|
|
4
4
|
|
|
5
5
|
All signals contain a request object that holds the request that initiated the
|
|
6
6
|
event. This object is provided mostly for logging purposes and is not
|
|
@@ -51,6 +51,7 @@ The published timestamp will have increased.
|
|
|
51
51
|
:param site: The Site object.
|
|
52
52
|
:param previous_status: The previous status
|
|
53
53
|
:param new_status: The new status
|
|
54
|
+
:param reverted: If true this status change was the result of a reversion
|
|
54
55
|
:param kwargs: Misc other key word arguments
|
|
55
56
|
"""
|
|
56
57
|
site_status_changed = Signal()
|
|
@@ -156,7 +157,7 @@ site_file_published = Signal()
|
|
|
156
157
|
|
|
157
158
|
|
|
158
159
|
"""
|
|
159
|
-
Sent when a moderator
|
|
160
|
+
Sent when a moderator retracts a site file upload - could be an attachment
|
|
160
161
|
or an image.
|
|
161
162
|
|
|
162
163
|
:param sender: The sending object (unreliable).
|
slm/static/slm/css/style.css
CHANGED
|
@@ -666,9 +666,9 @@ button.slm-subsection {
|
|
|
666
666
|
/* Button Status CSS */
|
|
667
667
|
button.slm-status-updated,
|
|
668
668
|
button.nav-link.slm-status-updated {
|
|
669
|
-
border-left: 10px solid #0079AD;
|
|
670
|
-
border-bottom-left-radius: 10px;
|
|
671
|
-
border-top-left-radius: 10px;
|
|
669
|
+
border-left: 10px solid #0079AD !important;
|
|
670
|
+
border-bottom-left-radius: 10px !important;
|
|
671
|
+
border-top-left-radius: 10px !important;
|
|
672
672
|
}
|
|
673
673
|
button.slm-status-updated.slm-section-deleted {
|
|
674
674
|
border-left: 10px solid #d3d3d3;
|
|
@@ -682,19 +682,20 @@ button.slm-status-updated span.section-number {
|
|
|
682
682
|
}
|
|
683
683
|
button.slm-status-published,
|
|
684
684
|
button.nav-link.slm-status-published {
|
|
685
|
-
border-left: 10px solid #0D820D;
|
|
686
|
-
border-bottom-left-radius: 10px;
|
|
687
|
-
border-top-left-radius: 10px;
|
|
685
|
+
border-left: 10px solid #0D820D !important;
|
|
686
|
+
border-bottom-left-radius: 10px !important;
|
|
687
|
+
border-top-left-radius: 10px !important;
|
|
688
688
|
}
|
|
689
689
|
button.slm-status-published span.section-number {
|
|
690
690
|
background-color: #0D820D;
|
|
691
691
|
color: whitesmoke;
|
|
692
692
|
}
|
|
693
|
+
|
|
693
694
|
button.slm-status-in-review,
|
|
694
695
|
button.nav-link.slm-status-in-review {
|
|
695
|
-
border-left: 10px solid #0079AD;
|
|
696
|
-
border-bottom-left-radius: 10px;
|
|
697
|
-
border-top-left-radius: 10px;
|
|
696
|
+
border-left: 10px solid #0079AD !important;
|
|
697
|
+
border-bottom-left-radius: 10px !important;
|
|
698
|
+
border-top-left-radius: 10px !important;
|
|
698
699
|
}
|
|
699
700
|
button.slm-status-in-review span.section-number {
|
|
700
701
|
background-color: #0079AD;
|
|
@@ -702,9 +703,9 @@ button.slm-status-in-review span.section-number {
|
|
|
702
703
|
}
|
|
703
704
|
button.slm-status-proposed,
|
|
704
705
|
button.nav-link.slm-status-proposed {
|
|
705
|
-
border-left: 10px solid #913D88;
|
|
706
|
-
border-bottom-left-radius: 10px;
|
|
707
|
-
border-top-left-radius: 10px;
|
|
706
|
+
border-left: 10px solid #913D88 !important;
|
|
707
|
+
border-bottom-left-radius: 10px !important;
|
|
708
|
+
border-top-left-radius: 10px !important;
|
|
708
709
|
}
|
|
709
710
|
button.slm-status-proposed span.section-number {
|
|
710
711
|
background-color: #913D88;
|
|
@@ -712,9 +713,9 @@ button.slm-status-proposed span.section-number {
|
|
|
712
713
|
}
|
|
713
714
|
button.slm-status-former,
|
|
714
715
|
button.nav-link.slm-status-former {
|
|
715
|
-
border-left: 10px solid #3D4543;
|
|
716
|
-
border-bottom-left-radius: 10px;
|
|
717
|
-
border-top-left-radius: 10px;
|
|
716
|
+
border-left: 10px solid #3D4543 !important;
|
|
717
|
+
border-bottom-left-radius: 10px !important;
|
|
718
|
+
border-top-left-radius: 10px !important;
|
|
718
719
|
}
|
|
719
720
|
button.slm-status-former span.section-number {
|
|
720
721
|
background-color: #3D4543;
|
|
@@ -722,9 +723,9 @@ button.slm-status-former span.section-number {
|
|
|
722
723
|
}
|
|
723
724
|
button.slm-status-suspended,
|
|
724
725
|
button.nav-link.slm-status-suspended {
|
|
725
|
-
border-left: 10px solid #E0041A;
|
|
726
|
-
border-bottom-left-radius: 10px;
|
|
727
|
-
border-top-left-radius: 10px;
|
|
726
|
+
border-left: 10px solid #E0041A !important;
|
|
727
|
+
border-bottom-left-radius: 10px !important;
|
|
728
|
+
border-top-left-radius: 10px !important;
|
|
728
729
|
}
|
|
729
730
|
button.slm-status-suspended span.section-number {
|
|
730
731
|
background-color: #E0041A;
|
|
@@ -732,9 +733,9 @@ button.slm-status-suspended span.section-number {
|
|
|
732
733
|
}
|
|
733
734
|
button.slm-status-empty,
|
|
734
735
|
button.nav-link.slm-status-empty {
|
|
735
|
-
border-left: 10px solid #d3d3d3;
|
|
736
|
-
border-bottom-left-radius: 10px;
|
|
737
|
-
border-top-left-radius: 10px;
|
|
736
|
+
border-left: 10px solid #d3d3d3 !important;
|
|
737
|
+
border-bottom-left-radius: 10px !important;
|
|
738
|
+
border-top-left-radius: 10px !important;
|
|
738
739
|
}
|
|
739
740
|
button.slm-status-empty span.section-number {
|
|
740
741
|
background-color: #d3d3d3;
|
|
@@ -743,33 +744,33 @@ button.slm-status-empty span.section-number {
|
|
|
743
744
|
/* Upload Buttons CSS */
|
|
744
745
|
button.slm-upload-unpublished,
|
|
745
746
|
button.nav-link.slm-upload-unpublished {
|
|
746
|
-
border-left: 10px solid #0079AD;
|
|
747
|
-
border-bottom-left-radius: 10px;
|
|
748
|
-
border-top-left-radius: 10px;
|
|
747
|
+
border-left: 10px solid #0079AD !important;
|
|
748
|
+
border-bottom-left-radius: 10px !important;
|
|
749
|
+
border-top-left-radius: 10px !important;
|
|
749
750
|
}
|
|
750
751
|
button.slm-upload-published,
|
|
751
752
|
button.nav-link.slm-upload-published {
|
|
752
|
-
border-left: 10px solid #0D820D;
|
|
753
|
-
border-bottom-left-radius: 10px;
|
|
754
|
-
border-top-left-radius: 10px;
|
|
753
|
+
border-left: 10px solid #0D820D !important;
|
|
754
|
+
border-bottom-left-radius: 10px !important;
|
|
755
|
+
border-top-left-radius: 10px !important;
|
|
755
756
|
}
|
|
756
757
|
button.slm-upload-invalid,
|
|
757
758
|
button.nav-link.slm-upload-invalid {
|
|
758
|
-
border-left: 10px solid #8b0000;
|
|
759
|
-
border-bottom-left-radius: 10px;
|
|
760
|
-
border-top-left-radius: 10px;
|
|
759
|
+
border-left: 10px solid #8b0000 !important;
|
|
760
|
+
border-bottom-left-radius: 10px !important;
|
|
761
|
+
border-top-left-radius: 10px !important;
|
|
761
762
|
}
|
|
762
763
|
button.slm-upload-warnings,
|
|
763
764
|
button.nav-link.slm-upload-warnings {
|
|
764
|
-
border-left: 10px solid darkorange;
|
|
765
|
-
border-bottom-left-radius: 10px;
|
|
766
|
-
border-top-left-radius: 10px;
|
|
765
|
+
border-left: 10px solid darkorange !important;
|
|
766
|
+
border-bottom-left-radius: 10px !important;
|
|
767
|
+
border-top-left-radius: 10px !important;
|
|
767
768
|
}
|
|
768
769
|
button.slm-upload-valid,
|
|
769
770
|
button.nav-link.slm-upload-valid {
|
|
770
|
-
border-left: 10px solid #0D820D;
|
|
771
|
-
border-bottom-left-radius: 10px;
|
|
772
|
-
border-top-left-radius: 10px;
|
|
771
|
+
border-left: 10px solid #0D820D !important;
|
|
772
|
+
border-bottom-left-radius: 10px !important;
|
|
773
|
+
border-top-left-radius: 10px !important;
|
|
773
774
|
}
|
|
774
775
|
/* Accordion CSS */
|
|
775
776
|
.accordion,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export class AutoComplete extends FormWidget {
|
|
1
|
+
class AutoComplete extends slm.FormWidget {
|
|
4
2
|
/**
|
|
5
3
|
* https://api.jqueryui.com/autocomplete/
|
|
6
4
|
*
|
|
@@ -264,7 +262,7 @@ export class AutoComplete extends FormWidget {
|
|
|
264
262
|
changed() {}
|
|
265
263
|
}
|
|
266
264
|
|
|
267
|
-
|
|
265
|
+
class AutoCompleteMultiple extends AutoComplete {
|
|
268
266
|
/**
|
|
269
267
|
* https://github.com/devbridge/jQuery-Autocomplete
|
|
270
268
|
*
|
|
@@ -339,3 +337,7 @@ export class AutoCompleteMultiple extends AutoComplete {
|
|
|
339
337
|
*/
|
|
340
338
|
}
|
|
341
339
|
}
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
slm.AutoComplete = AutoComplete;
|
|
343
|
+
slm.AutoCompleteMultiple = AutoCompleteMultiple;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
(function($) {
|
|
2
|
+
$(document).ready(function() {
|
|
3
|
+
$('.view-file').on('click', function(e) {
|
|
4
|
+
e.preventDefault();
|
|
5
|
+
const url = $(this).data('url');
|
|
6
|
+
const modal = $('<div class="modal"/>').css({
|
|
7
|
+
position: 'fixed',
|
|
8
|
+
top: '10%',
|
|
9
|
+
left: '10%',
|
|
10
|
+
width: '80%',
|
|
11
|
+
height: '80%',
|
|
12
|
+
background: '#fff',
|
|
13
|
+
border: '1px solid #ccc',
|
|
14
|
+
padding: '20px',
|
|
15
|
+
overflow: 'auto',
|
|
16
|
+
zIndex: 10000
|
|
17
|
+
}).appendTo('body');
|
|
18
|
+
|
|
19
|
+
const overlay = $('<div class="modal-overlay"/>').css({
|
|
20
|
+
position: 'fixed',
|
|
21
|
+
top: 0, left: 0, right: 0, bottom: 0,
|
|
22
|
+
background: 'rgba(0, 0, 0, 0.5)',
|
|
23
|
+
zIndex: 9999
|
|
24
|
+
}).appendTo('body');
|
|
25
|
+
|
|
26
|
+
modal.append(
|
|
27
|
+
$('<span class="close-modal">×</span>').css({
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
top: '10px',
|
|
30
|
+
right: '15px',
|
|
31
|
+
fontSize: '24px',
|
|
32
|
+
fontWeight: 'bold',
|
|
33
|
+
cursor: 'pointer',
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
modal.append('<div class="modal-content"></div>');
|
|
37
|
+
|
|
38
|
+
$.get(url, function(data) {
|
|
39
|
+
let content;
|
|
40
|
+
|
|
41
|
+
// Check if response is an XML Document
|
|
42
|
+
const isXml = data instanceof XMLDocument && data.documentElement;
|
|
43
|
+
|
|
44
|
+
if (isXml) {
|
|
45
|
+
const xmlString = new XMLSerializer().serializeToString(data.documentElement);
|
|
46
|
+
const escaped = $('<div/>').text(xmlString).html(); // escape XML
|
|
47
|
+
content = `<pre style="white-space: pre-wrap; word-break: break-word;">${escaped}</pre>`;
|
|
48
|
+
} else {
|
|
49
|
+
// Fallback for plain text or JSON
|
|
50
|
+
const escaped = $('<div/>').text(data).html(); // escape if string
|
|
51
|
+
content = `<pre style="white-space: pre-wrap; word-break: break-word;">${escaped}</pre>`;
|
|
52
|
+
}
|
|
53
|
+
modal.find('.modal-content').html(content);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
modal.on('click', '.close-modal', function() {
|
|
57
|
+
modal.remove();
|
|
58
|
+
overlay.remove();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
})(django.jQuery);
|