localcosmos-app-kit 0.9.10__py3-none-any.whl → 0.9.12__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.
Files changed (35) hide show
  1. app_kit/appbuilder/JSONBuilders/TaxonProfilesJSONBuilder.py +2 -3
  2. app_kit/appbuilder/JSONBuilders/__pycache__/TaxonProfilesJSONBuilder.cpython-313.pyc +0 -0
  3. app_kit/appbuilder/TaxonBuilder.py +24 -13
  4. app_kit/appbuilder/__pycache__/TaxonBuilder.cpython-313.pyc +0 -0
  5. app_kit/context_processors.py +13 -6
  6. app_kit/features/backbonetaxonomy/forms.py +7 -0
  7. app_kit/features/backbonetaxonomy/templates/backbonetaxonomy/ajax/swap_taxon_form.html +146 -0
  8. app_kit/features/backbonetaxonomy/templates/backbonetaxonomy/ajax/taxon_references_changes.html +153 -0
  9. app_kit/features/backbonetaxonomy/templates/backbonetaxonomy/manage_backbonetaxonomy.html +1 -1
  10. app_kit/features/backbonetaxonomy/templates/backbonetaxonomy/update_taxon_references.html +24 -33
  11. app_kit/features/backbonetaxonomy/tests/__pycache__/test_views.cpython-313.pyc +0 -0
  12. app_kit/features/backbonetaxonomy/tests/test_views.py +98 -53
  13. app_kit/features/backbonetaxonomy/urls.py +6 -0
  14. app_kit/features/backbonetaxonomy/utils.py +99 -1
  15. app_kit/features/backbonetaxonomy/views.py +99 -20
  16. app_kit/features/taxon_profiles/forms.py +24 -1
  17. app_kit/features/taxon_profiles/templates/taxon_profiles/ajax/collected_taxon_images.html +14 -0
  18. app_kit/features/taxon_profiles/templates/taxon_profiles/ajax/manage_taxon_profile_form.html +1 -2
  19. app_kit/features/taxon_profiles/templates/taxon_profiles/ajax/move_image_to_section.html +28 -0
  20. app_kit/features/taxon_profiles/urls.py +4 -1
  21. app_kit/features/taxon_profiles/views.py +65 -2
  22. app_kit/management/commands/export_all_nature_guides.py +40 -6
  23. app_kit/management/commands/import_all_nature_guides.py +94 -0
  24. app_kit/taxonomy/fields.py +6 -0
  25. app_kit/taxonomy/lazy.py +68 -38
  26. app_kit/taxonomy/sources/TaxonSourceManager.py +14 -6
  27. app_kit/taxonomy/sources/algaebase/AlgaebaseManager.py +765 -448
  28. app_kit/templates/app_kit/ajax/content_images_list.html +11 -0
  29. app_kit/templates/app_kit/base.html +5 -0
  30. app_kit/utils.py +7 -0
  31. {localcosmos_app_kit-0.9.10.dist-info → localcosmos_app_kit-0.9.12.dist-info}/METADATA +2 -2
  32. {localcosmos_app_kit-0.9.10.dist-info → localcosmos_app_kit-0.9.12.dist-info}/RECORD +35 -30
  33. {localcosmos_app_kit-0.9.10.dist-info → localcosmos_app_kit-0.9.12.dist-info}/WHEEL +0 -0
  34. {localcosmos_app_kit-0.9.10.dist-info → localcosmos_app_kit-0.9.12.dist-info}/licenses/LICENCE +0 -0
  35. {localcosmos_app_kit-0.9.10.dist-info → localcosmos_app_kit-0.9.12.dist-info}/top_level.txt +0 -0
@@ -99,7 +99,7 @@ class TaxonProfilesJSONBuilder(JSONBuilder):
99
99
 
100
100
  def get_vernacular_name_from_nature_guides(self, lazy_taxon):
101
101
  if lazy_taxon.name_uuid in self.vernacular_names_from_nature_guide_cache:
102
- return self.vernacular_names_from_nature_guide_cache[lazy_taxon.name_uuid]
102
+ return self.vernacular_names_from_nature_guide_cache[str(lazy_taxon.name_uuid)]
103
103
 
104
104
  return lazy_taxon.get_primary_locale_vernacular_name_from_nature_guides(self.meta_app)
105
105
 
@@ -158,7 +158,6 @@ class TaxonProfilesJSONBuilder(JSONBuilder):
158
158
  'metaDescription': None,
159
159
  },
160
160
  'externalMedia': [],
161
- 'templateContents': [],
162
161
  'morphotypeProfiles': [],
163
162
  'isFeatured': is_featured,
164
163
  })
@@ -433,7 +432,7 @@ class TaxonProfilesJSONBuilder(JSONBuilder):
433
432
  if vernacular_start_letter not in start_letters['vernacular'][language_code]:
434
433
  start_letters['vernacular'][language_code].append(vernacular_start_letter)
435
434
 
436
- included_taxa.append(lazy_taxon.name_uuid)
435
+ included_taxa.append(str(lazy_taxon.name_uuid))
437
436
 
438
437
  # sort the localited registries
439
438
  for language_code, localized_registry in localized_registries.items():
@@ -111,19 +111,21 @@ class TaxonSerializer:
111
111
 
112
112
  def serialize(self):
113
113
 
114
- if self.lazy_taxon.name_uuid in self.taxa_builder.cache['simple']:
115
- taxon_json = self.taxa_builder.cache['simple'][self.lazy_taxon.name_uuid]
114
+ name_uuid_str = str(self.lazy_taxon.name_uuid)
115
+
116
+ if name_uuid_str in self.taxa_builder.cache['simple']:
117
+ taxon_json = self.taxa_builder.cache['simple'][name_uuid_str]
116
118
 
117
119
  else:
118
120
  taxon_json = {
119
121
  'taxonLatname' : self.lazy_taxon.taxon_latname,
120
122
  'taxonAuthor' : self.lazy_taxon.taxon_author,
121
123
  'taxonSource' : self.lazy_taxon.taxon_source,
122
- 'nameUuid' : self.lazy_taxon.name_uuid,
124
+ 'nameUuid' : str(self.lazy_taxon.name_uuid),
123
125
  'taxonNuid' : self.lazy_taxon.taxon_nuid,
124
126
  }
125
127
 
126
- self.taxa_builder.cache['simple'][self.lazy_taxon.name_uuid] = taxon_json
128
+ self.taxa_builder.cache['simple'][name_uuid_str] = taxon_json
127
129
 
128
130
  taxon_json_copy = copy.deepcopy(taxon_json)
129
131
 
@@ -173,8 +175,10 @@ class TaxonSerializer:
173
175
 
174
176
  def serialize_extended(self):
175
177
 
176
- if self.lazy_taxon.name_uuid in self.taxa_builder.cache['extended']:
177
- taxon_json = self.taxa_builder.cache['extended'][self.lazy_taxon.name_uuid]
178
+ name_uuid_str = str(self.lazy_taxon.name_uuid)
179
+
180
+ if name_uuid_str in self.taxa_builder.cache['extended']:
181
+ taxon_json = self.taxa_builder.cache['extended'][name_uuid_str]
178
182
 
179
183
  else:
180
184
 
@@ -201,7 +205,7 @@ class TaxonSerializer:
201
205
  taxon_json['shortProfile'] = taxon_profile.short_profile
202
206
 
203
207
 
204
- self.taxa_builder.cache['extended'][self.lazy_taxon.name_uuid] = taxon_json
208
+ self.taxa_builder.cache['extended'][name_uuid_str] = taxon_json
205
209
 
206
210
  taxon_json_copy = copy.deepcopy(taxon_json)
207
211
 
@@ -222,8 +226,10 @@ class TaxonSerializer:
222
226
 
223
227
  def serialize_images(self):
224
228
 
225
- if self.lazy_taxon.name_uuid in self.taxa_builder.cache['images']:
226
- taxon_images = self.taxa_builder.cache['images'][self.lazy_taxon.name_uuid]
229
+ name_uuid_str = str(self.lazy_taxon.name_uuid)
230
+
231
+ if name_uuid_str in self.taxa_builder.cache['images']:
232
+ taxon_images = self.taxa_builder.cache['images'][name_uuid_str]
227
233
 
228
234
  else:
229
235
 
@@ -314,7 +320,7 @@ class TaxonSerializer:
314
320
  collected_content_image_ids.add(taxon_image.id)
315
321
  collected_image_store_ids.add(taxon_image.image_store.id)
316
322
 
317
- self.taxa_builder.cache['images'][self.lazy_taxon.name_uuid] = taxon_images
323
+ self.taxa_builder.cache['images'][name_uuid_str] = taxon_images
318
324
 
319
325
  taxon_images_copy = copy.deepcopy(taxon_images)
320
326
 
@@ -334,6 +340,9 @@ class TaxonSerializer:
334
340
  if not accepted_name_uuid:
335
341
  accepted_name_uuid = self.lazy_taxon.name_uuid
336
342
 
343
+ if accepted_name_uuid:
344
+ accepted_name_uuid = str(accepted_name_uuid)
345
+
337
346
  has_taxon_profile = False
338
347
  taxon_profile = self.get_taxon_profile()
339
348
  if taxon_profile:
@@ -358,8 +367,10 @@ class TaxonSerializer:
358
367
 
359
368
  def serialize_as_registry_taxon(self, languages, name_type, name, is_preferred_name, accepted_name_uuid=None):
360
369
 
361
- if self.lazy_taxon.name_uuid in self.taxa_builder.cache['registry']:
362
- registry_taxon_json = self.taxa_builder.cache['registry']
370
+ name_uuid_str = str(self.lazy_taxon.name_uuid)
371
+
372
+ if name_uuid_str in self.taxa_builder.cache['registry']:
373
+ registry_taxon_json = self.taxa_builder.cache['registry'][name_uuid_str]
363
374
 
364
375
  else:
365
376
 
@@ -376,7 +387,7 @@ class TaxonSerializer:
376
387
  if preferred_vernacular_name:
377
388
  registry_taxon_json['vernacularNames'][language_code] = preferred_vernacular_name
378
389
 
379
- self.taxa_builder.cache['registry'][self.lazy_taxon.name_uuid] = registry_taxon_json
390
+ self.taxa_builder.cache['registry'][str(self.lazy_taxon.name_uuid)] = registry_taxon_json
380
391
 
381
392
  registry_taxon_json_copy = copy.deepcopy(registry_taxon_json)
382
393
 
@@ -1,12 +1,19 @@
1
1
  from django.conf import settings
2
+ import importlib.metadata
2
3
 
3
4
  def app_kit_context(request):
4
- context = {
5
- 'app_kit_mode' : settings.APP_KIT_MODE,
6
- 'app_kit_sandbox_user' : settings.APP_KIT_SANDBOX_USER,
7
- 'app_kit_sandbox_password' : settings.APP_KIT_SANDBOX_PASSWORD,
8
- 'app_kit_short_name' : getattr(settings, 'APP_KIT_SHORT_NAME', 'LC APP KIT'),
9
- 'app_kit_long_name' : getattr(settings, 'APP_KIT_LONG_NAME', 'LOCAL COSMOS APP KIT'),
5
+ try:
6
+ app_kit_version = importlib.metadata.version('localcosmos_app_kit')
7
+ except importlib.metadata.PackageNotFoundError:
8
+ app_kit_version = 'unknown'
9
+
10
+ context = {
11
+ 'app_kit_mode': settings.APP_KIT_MODE,
12
+ 'app_kit_sandbox_user': settings.APP_KIT_SANDBOX_USER,
13
+ 'app_kit_sandbox_password': settings.APP_KIT_SANDBOX_PASSWORD,
14
+ 'app_kit_short_name': getattr(settings, 'APP_KIT_SHORT_NAME', 'LC APP KIT'),
15
+ 'app_kit_long_name': getattr(settings, 'APP_KIT_LONG_NAME', 'LOCAL COSMOS APP KIT'),
16
+ 'app_kit_version': app_kit_version,
10
17
  }
11
18
 
12
19
  return context
@@ -5,6 +5,7 @@ from django.db.models.fields import BLANK_CHOICE_DASH
5
5
 
6
6
 
7
7
  from taxonomy.lazy import LazyTaxon
8
+ from taxonomy.fields import HiddenTaxonField
8
9
 
9
10
  from app_kit.features.backbonetaxonomy.models import BackboneTaxonomy, BackboneTaxa
10
11
 
@@ -89,6 +90,12 @@ class SwapTaxonForm(forms.Form):
89
90
  raise forms.ValidationError(_('You cannot select the same taxon twice.'))
90
91
 
91
92
  return cleaned_data
93
+
94
+
95
+ class FixedSwapTaxonForm(forms.Form):
96
+
97
+ from_taxon = HiddenTaxonField()
98
+ to_taxon = HiddenTaxonField()
92
99
 
93
100
 
94
101
  class TaxonRelationshipTypeForm(LocalizeableModelForm):
@@ -0,0 +1,146 @@
1
+ {% extends 'localcosmos_server/modals/modal_form.html' %}
2
+ {% load i18n localcosmos_tags %}
3
+
4
+ {% block action %}
5
+ {% url 'request_swap_taxon' meta_app.id %}
6
+ {% endblock %}
7
+
8
+ {% block title %}
9
+ {% blocktrans %}Update taxon{% endblocktrans %}
10
+ {% endblock %}
11
+
12
+ {% block body %}
13
+ {% if swapped %}
14
+ <div class="alert alert-success">
15
+ {% blocktrans with to_name=to_taxon from_name=from_taxon %}{{ from_name }} has been replaced with {{ to_name }} where possible.{% endblocktrans %}
16
+ </div>
17
+ {% else %}
18
+ <p>
19
+ {% blocktrans %}You want to swap{% endblocktrans %}
20
+ </p>
21
+ <div>
22
+ <div>
23
+ <i>{{ from_taxon.taxon_latname }}</i> {{ from_taxon.taxon_author }}
24
+ </div>
25
+ </div>
26
+ <div>
27
+ <strong>{% trans 'to:' %}</strong>
28
+ <div>
29
+ <i>{{ to_taxon.taxon_latname }}</i> {{ to_taxon.taxon_author }}
30
+ </div>
31
+ </div>
32
+ <div>
33
+ {{ form }}
34
+ </div>
35
+ <div>
36
+ {% if analyzed %}
37
+ <hr>
38
+ <div>
39
+ <div class="mt-3 mb-3">
40
+ <strong>{% trans 'Analyzation Result:' %}</strong>
41
+ {% if not verbose_to_taxon_occurrences %}
42
+ <span class="text-success">
43
+ <strong>{% trans 'swappable' %}</strong>
44
+ </span>
45
+ {% else %}
46
+ <span class="text-danger">
47
+ <strong>{% trans 'not swappable' %}</strong>
48
+ </span>
49
+ {% endif %}
50
+ </div>
51
+
52
+ <div>
53
+
54
+ <i>{{ from_taxon.taxon_latname }}</i> {{ from_taxon.taxon_author }} {% trans 'occurs in' %}:
55
+
56
+ <div class="ml-4">
57
+ {% if verbose_from_taxon_occurrences %}
58
+ {% for occurrences in verbose_from_taxon_occurrences %}
59
+ <div>
60
+ <div class="my-3">
61
+ <strong>{{ occurrences.verbose_model_name }}</strong>
62
+ {% if occurrences.is_swappable %}
63
+ <span class="badge badge-success">
64
+ {% trans 'swappable' %}
65
+ </span>
66
+ {% else %}
67
+ <span class="badge badge-danger">
68
+ {% trans 'not swappable' %}
69
+ </span>
70
+ {% endif %}
71
+ </div>
72
+ <ul>
73
+ {% for verbose_occurrence in occurrences.verbose_occurrences %}
74
+ <li>
75
+ {{ verbose_occurrence }}
76
+ </li>
77
+ {% endfor %}
78
+ </ul>
79
+ </div>
80
+ {% endfor %}
81
+ {% else %}
82
+ {% if swapped %}
83
+ <div class="alert alert-success">
84
+ {% blocktrans with to_name=to_taxon from_name=from_taxon %}{{ from_name }} has been replaced with {{ to_name }} where possible.{% endblocktrans %}
85
+ </div>
86
+ {% else %}
87
+ <div class="alert alert-danger">
88
+ {% blocktrans with name=from_taxon %}{{ name }} does not occur in your app and can't be swapped.{% endblocktrans %}
89
+ </div>
90
+ {% endif %}
91
+ {% endif %}
92
+ </div>
93
+ </div>
94
+ <div class="mt-4">
95
+
96
+ <i>{{ to_taxon.taxon_latname }}</i> {{ to_taxon.taxon_author }} {% trans 'occurs in' %}:
97
+
98
+ <div class="ml-4">
99
+ {% if verbose_to_taxon_occurrences %}
100
+ {% for to_occurrences in verbose_to_taxon_occurrences %}
101
+ <div>
102
+ <div class="my-3">
103
+ <strong>{{ to_occurrences.verbose_model_name }}</strong>
104
+ </div>
105
+ <ul>
106
+ {% for to_verbose_occurrence in to_occurrences.verbose_occurrences %}
107
+ <li>
108
+ {{ to_verbose_occurrence }}
109
+ </li>
110
+ {% endfor %}
111
+ </ul>
112
+ </div>
113
+ {% endfor %}
114
+ {% else %}
115
+
116
+ <div class="text-muted">
117
+ {% blocktrans %}No occurrences found.{% endblocktrans %}
118
+ </div>
119
+ {% endif %}
120
+ </div>
121
+ </div>
122
+ </div>
123
+ {% endif %}
124
+ </div>
125
+ {% endif %}
126
+ {% endblock %}
127
+
128
+ {% block footer %}
129
+ <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">{% trans 'Close' %}</button>
130
+ {% if not verbose_to_taxon_occurrences %}
131
+ <button type="submit" class="btn btn-outline-primary">{% trans 'Swap' %}</button>
132
+ {% endif %}
133
+ {% endblock %}
134
+
135
+ {% block script %}
136
+ {% if swapped %}
137
+
138
+ <script>
139
+ let element = document.getElementById("{{ from_taxon.name_uuid }}");
140
+ if (element) {
141
+ element.remove();
142
+ }
143
+ $("#Modal").modal("hide");
144
+ </script>
145
+ {% endif %}
146
+ {% endblock %}
@@ -0,0 +1,153 @@
1
+ {% load i18n static %}
2
+
3
+ <div class="row">
4
+ <div class="col-12">
5
+ <div class="mt-5">
6
+ <h2>{% trans 'Taxa with changes only in organizational data (e.g. position in tree)' %}</h2>
7
+ </div>
8
+ <div class="card">
9
+ <div class="card-body">
10
+ {% if result.position_or_name_uuid_changed %}
11
+ <div class="row">
12
+ <div class="col-12">
13
+ <div class="alert alert-info">
14
+ {% blocktrans %}These taxa had changes only in organizational data like their position in the taxonomic tree. You can safely update these taxa without changing their scientific name or author.{% endblocktrans %}
15
+ </div>
16
+ </div>
17
+ </div>
18
+ <div class="card-text">
19
+ {% for taxon in result.position_or_name_uuid_changed %}
20
+ <div>
21
+ <i>{{ taxon.taxon_latname }}</i> {{ taxon.taxon_author }}
22
+ </div>
23
+ {% endfor %}
24
+ </div>
25
+ <div>
26
+ <form method="post" action="{% url 'update_taxon_references' meta_app.id %}">
27
+ {% csrf_token %}
28
+ <button type="submit" class="btn btn-primary mt-3">
29
+ {% trans 'Update these taxa' %}
30
+ </button>
31
+ </form>
32
+ </div>
33
+ {% else %}
34
+ <div class="text-muted">
35
+ {% trans 'No taxa with changes in organizational data found.' %}
36
+ </div>
37
+ {% endif %}
38
+
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </div>
43
+
44
+ <div class="row mt-5">
45
+ <div class="col-12">
46
+ <div>
47
+ <h2>{% trans 'Taxa with potentially new author' %}</h2>
48
+ </div>
49
+
50
+
51
+ {% if result.taxa_new_author %}
52
+
53
+ {% for entry in result.taxa_new_author %}
54
+ <div id="{{ entry.taxon.name_uuid }}" class="card">
55
+ <div class="card-body">
56
+ <h5 class="card-title">
57
+ <i>{{ entry.taxon.taxon_latname }}</i> {{ entry.taxon.taxon_author }}
58
+ </h5>
59
+ <div class="card-text">
60
+ <strong>{% trans 'New author names:' %}</strong>
61
+ <div class="my-3">
62
+ {% for similar_entry in entry.new_author_taxa %}
63
+ <div class="d-flex align-items-center">
64
+ <div class="pr-3">
65
+ <i>{{ similar_entry.similar_taxon.taxon_latname }}</i> {{ similar_entry.similar_taxon.taxon_author }}
66
+ </div>
67
+ <div>
68
+ <form action="{% url 'request_analyze_taxon' meta_app.id %}" class="xhr" ajax-target="ModalContent" method="POST">
69
+ {{ similar_entry.form }}
70
+ <button type="submit" class="btn btn-xs btn-success nodisable">{% trans 'accept' %}</button>
71
+ </form>
72
+ </div>
73
+ </div>
74
+ {% endfor %}
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ {% endfor %}
80
+
81
+ {% else %}
82
+ <div class="text-muted">
83
+ {% trans 'No taxa with new author found.' %}
84
+ </div>
85
+ {% endif %}
86
+ </div>
87
+ </div>
88
+
89
+ <div>
90
+ <div class="row mt-5">
91
+ <div class="col-12">
92
+ <div>
93
+ <h2>{% trans 'Taxa now found as a synonym' %}</h2>
94
+ </div>
95
+ {% if result.taxa_in_synonyms %}
96
+ {% for entry in result.taxa_in_synonyms %}
97
+ <div id="{{ entry.taxon.name_uuid }}" class="card">
98
+ <div class="card-body">
99
+ <h5 class="card-title">
100
+ <i>{{ entry.taxon.taxon_latname }}</i> {{ entry.taxon.taxon_author }}
101
+ </h5>
102
+
103
+ <div class="card-text">
104
+ <div class="d-flex align-items-center">
105
+ <div class="pr-2">
106
+ <strong>{% trans 'accepted name:' %}</strong>
107
+ </div>
108
+ <div class="pr-3">
109
+ <i>{{ entry.taxon.reference_accepted_name.taxon_latname }}</i> {{ entry.taxon.reference_accepted_name.taxon_author }}
110
+ </div>
111
+ <div>
112
+ <form action="{% url 'request_analyze_taxon' meta_app.id %}" class="xhr" ajax-target="ModalContent" method="POST">
113
+ {{ entry.form }}
114
+ <button type="submit" class="btn btn-xs btn-success nodisable">{% trans 'accept' %}</button>
115
+ </form>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ {% endfor %}
122
+ {% else %}
123
+ <div class="text-muted">
124
+ {% trans 'No taxa found as synonyms.' %}
125
+ </div>
126
+ {% endif %}
127
+ </div>
128
+ </div>
129
+ <div class="row my-5">
130
+ <div class="col-12">
131
+ <div>
132
+ <h2>{% trans 'Taxa not found in the taxonomic database anymore' %}</h2>
133
+ </div>
134
+ {% if result.taxa_missing %}
135
+ <div class="card">
136
+ <div class="card-body">
137
+
138
+ <div class="card-text">
139
+ {% for taxon in result.taxa_missing %}
140
+ <div>
141
+ {{ taxon }}
142
+ </div>
143
+ {% endfor %}
144
+ </div>
145
+ </div>
146
+ </div>
147
+ {% else %}
148
+ <div class="text-muted">
149
+ {% trans 'No missing taxa found.' %}
150
+ </div>
151
+ {% endif %}
152
+ </div>
153
+ </div>
@@ -10,7 +10,7 @@
10
10
  <small><span class="badge badge-info">{% trans 'Total:' %} {{ meta_app.taxon_count }}<span></small>
11
11
  </h4>
12
12
 
13
- <form class="form-inline">
13
+ <form>
14
14
  {% if generic_content.include_full_tree and alltaxa %}
15
15
  {% else %}
16
16
  <div class="form-group">
@@ -1,5 +1,5 @@
1
1
  {% extends 'app_kit/manage_generic_content.html' %}
2
- {% load i18n localcosmos_tags %}
2
+ {% load i18n static localcosmos_tags %}
3
3
 
4
4
  {% block content %}
5
5
 
@@ -13,42 +13,33 @@
13
13
  </div>
14
14
  </div>
15
15
  <div>
16
- <div class="alert alert-info">
17
- {% blocktrans %}If you updated your taxonomic database you can update your taxonomic references here. Taxonomic references can be Taxa of Taxon Profiles or linked Taxa in Nature Guides.
18
- This update does not alter the scientific names or authors. It updates other parameters like the position of a taxon in the taxonomic tree.
19
- If a taxon is not found anymore in the referenced taxonomic database, this will not be fixed by this update mechanism. You have to use the Taxon Swap feature to select a new Taxon.{% endblocktrans %}
20
- </div>
16
+ <p>
17
+ {% blocktrans %}If you updated your taxonomic database you can update your taxonomic references here.{% endblocktrans %}
18
+ </p>
21
19
  </div>
22
- <div class="row">
23
- <div class="col-12">
24
- {% for error in result %}
25
- <div>
26
- <div>
27
- <strong>
28
- {{ error.taxon }}
29
- </strong>
30
- </div>
31
- <div>
32
- <ul>
33
- {% for error_message in error.errors %}
34
- <li>
35
- {{ error_message}}
36
- </li>
37
- {% endfor %}
38
- </ul>
39
- </div>
20
+ {% if updated %}
21
+ <div class="row my-5">
22
+ <div class="col-12">
23
+ <div class="alert alert-success">
24
+ {% trans "Taxon references have been updated successfully. Some taxa might require manual review. See below." %}
40
25
  </div>
41
- {% endfor %}
42
- <div>
43
- <div class="col-12">
44
- <form id="update-taxa-form" method="POST" action="{% url 'update_taxon_references' meta_app.id %}">
45
- {% csrf_token %}
46
- <button type="submit" class="btn btn-primary">
47
- {% trans 'Perform Update' %}
48
- </button>
49
- </form>
26
+ </div>
50
27
  </div>
28
+ {% endif %}
29
+ <div class="row">
30
+ <div id="check-result" class="col-12">
31
+ <div class="text-center my-5">
32
+ <img src="{% static 'app_kit/images/spinner.gif' %}" />
33
+ </div>
34
+ <div>
51
35
  </div>
52
36
  </div>
53
37
 
38
+ <script>
39
+ $.get("{% url 'get_taxon_references_changes' meta_app.id %}", (html) => {
40
+ $("#check-result").html(html);
41
+ ajaxify('check-result')
42
+ });
43
+ </script>
44
+
54
45
  {% endblock %}