Skip to content

Commit

Permalink
App BEMAS: Anpassung Tooltipps; Anpassung Textdarstellung Kontakte
Browse files Browse the repository at this point in the history
  • Loading branch information
gdmhrogut committed Apr 16, 2024
1 parent f9528f8 commit 5cb014e
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 15 deletions.
13 changes: 12 additions & 1 deletion bemas/models/models_objectclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,18 @@ def __str__(self):
(' mit der Funktion ' + self.function if self.function else '')

def name_and_function(self):
return str(self.person) + (' (Funktion: ' + self.function + ')' if self.function else '')
function_str = ' (Funktion: ' + self.function + ')' if self.function else ''
if self.person.telephone_numbers or self.person.email_addresses:
contact_data_str = ' – Kontakt: '
if self.person.telephone_numbers and type(self.person.telephone_numbers) is list:
contact_data_str += ', '.join(self.person.telephone_numbers)
if self.person.email_addresses and type(self.person.email_addresses) is list:
contact_data_str += ', '
if self.person.email_addresses and type(self.person.email_addresses) is list:
contact_data_str += ', '.join(self.person.email_addresses)
else:
contact_data_str = ''
return str(self.person) + function_str + contact_data_str

def save(self, force_insert=False, force_update=False, using=None, update_fields=None):
# (1/2) store search content in designated field of object class organization:
Expand Down
2 changes: 1 addition & 1 deletion bemas/static/bemas/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function setGeoJsonFeaturePropertiesAndActions(feature, layer) {
let html = '';
html += '<div class="leaflet-popup-title">';
html += '<strong>' + feature.properties._title + '</strong>';
html += '<a class="ms-2" href="' + feature.properties._link_update + '"><i class="fas fa-pen" title="' + feature.properties._title + ' bearbeiten"></i></a>';
html += '<a class="ms-2" href="' + feature.properties._link_update + '"><i class="fas fa-pen" title="' + feature.properties._title + ' ansehen oder bearbeiten"></i></a>';
html += '<a class="ms-2" href="' + feature.properties._link_delete + '"><i class="fas fa-trash" title="' + feature.properties._title + ' löschen"></i></a>';
if (feature.properties._link_events)
html += '<a class="ms-2" href="' + feature.properties._link_events + '"><i class="fas fa-paperclip" title="Journalereignisse anzeigen"></i></a>';
Expand Down
2 changes: 1 addition & 1 deletion bemas/templates/bemas/container-contacts.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h5 class="alert-heading"><i class="fas fa-{{ 'contact'|get_icon }}"></i> Anspre
<ul>
{% for contact in contacts %}
<li>
<a href="{{ contact.link }}" title="Ansprechpartner:in bearbeiten">{{ contact.text }}</a>
<a href="{{ contact.link }}" title="Ansprechpartner:in ansehen oder bearbeiten">{{ contact.text }}</a>
</li>
{% endfor %}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion bemas/templates/bemas/container-events.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h5 class="alert-heading"><i class="fas fa-{{ 'event'|get_icon }}"></i> Journale
<ul>
{% for event in events %}
<li>
<a href="{{ event.link }}" title="Journalereignis bearbeiten">{{ event.text }}</a>
<a href="{{ event.link }}" title="Journalereignis ansehen oder bearbeiten">{{ event.text }}</a>
</li>
{% endfor %}
</ul>
Expand Down
6 changes: 3 additions & 3 deletions bemas/templates/bemas/orphaned-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h5 class="alert-heading"><i class="fas fa-{{ 'organization'|get_icon }}"></i> O
<ul class="object_list">
{% for orphaned_organization in orphaned_organizations %}
<li>
<a href="{{ orphaned_organization.link }}" title="Organisation bearbeiten">{{ orphaned_organization.text }}</a>
<a href="{{ orphaned_organization.link }}" title="Organisation ansehen oder bearbeiten">{{ orphaned_organization.text }}</a>
</li>
{% endfor %}
</ul>
Expand All @@ -31,7 +31,7 @@ <h5 class="alert-heading"><i class="fas fa-{{ 'person'|get_icon }}"></i> Persone
<ul class="object_list">
{% for orphaned_person in orphaned_persons %}
<li>
<a href="{{ orphaned_person.link }}" title="Person bearbeiten">{{ orphaned_person.text }}</a>
<a href="{{ orphaned_person.link }}" title="Person ansehen oder bearbeiten">{{ orphaned_person.text }}</a>
</li>
{% endfor %}
</ul>
Expand All @@ -48,7 +48,7 @@ <h5 class="alert-heading"><i class="fas fa-{{ 'originator'|get_icon }}"></i> Ver
<ul class="object_list">
{% for orphaned_originator in orphaned_originators %}
<li>
<a href="{{ orphaned_originator.link }}" title="Person bearbeiten">{{ orphaned_originator.text }}</a>
<a href="{{ orphaned_originator.link }}" title="Person ansehen oder bearbeiten">{{ orphaned_originator.text }}</a>
</li>
{% endfor %}
</ul>
Expand Down
8 changes: 4 additions & 4 deletions bemas/tests/tests_codelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_tabledata_view_standard_rights(self):
def test_tabledata_view_admin_rights(self):
self.generic_view_test(
True, True, 'codelists_status_tabledata', TABLEDATA_VIEW_PARAMS, 200,
'application/json', 'bearbeiten'
'application/json', 'ansehen oder bearbeiten'
)

def test_table_view_no_rights(self):
Expand Down Expand Up @@ -265,7 +265,7 @@ def test_tabledata_view_standard_rights(self):
def test_tabledata_view_admin_rights(self):
self.generic_view_test(
True, True, 'codelists_sector_tabledata', TABLEDATA_VIEW_PARAMS, 200,
'application/json', 'bearbeiten'
'application/json', 'ansehen oder bearbeiten'
)

def test_table_view_no_rights(self):
Expand Down Expand Up @@ -432,7 +432,7 @@ def test_tabledata_view_standard_rights(self):
def test_tabledata_view_admin_rights(self):
self.generic_view_test(
True, True, 'codelists_typeofevent_tabledata', TABLEDATA_VIEW_PARAMS, 200,
'application/json', 'bearbeiten'
'application/json', 'ansehen oder bearbeiten'
)

def test_table_view_no_rights(self):
Expand Down Expand Up @@ -599,7 +599,7 @@ def test_tabledata_view_standard_rights(self):
def test_tabledata_view_admin_rights(self):
self.generic_view_test(
True, True, 'codelists_typeofimmission_tabledata', TABLEDATA_VIEW_PARAMS, 200,
'application/json', 'bearbeiten'
'application/json', 'ansehen oder bearbeiten'
)

def test_table_view_no_rights(self):
Expand Down
4 changes: 2 additions & 2 deletions bemas/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def prepare_results(self, qs):
text = str(value)
if model.objects.filter(pk=value).exists():
text = '<a href="' + reverse('bemas:' + model_name + '_update', args=[value]) + \
'" title="Objekt bearbeiten">' + text + '</a>'
'" title="Objekt ansehen oder bearbeiten">' + text + '</a>'
item_data.append(text)
# log entry specific column "action"
elif issubclass(self.model, LogEntry) and column.name == 'action':
Expand Down Expand Up @@ -215,7 +215,7 @@ def prepare_results(self, qs):
'<a href="' +
reverse('bemas:' + view_name_prefix + '_update', args=[item_pk]) +
'"><i class="fas fa-' + get_icon_from_settings('update') +
'" title="' + title + ' bearbeiten"></i></a>' +
'" title="' + title + ' ansehen oder bearbeiten"></i></a>' +
'<a class="ms-2" href="' +
reverse('bemas:' + view_name_prefix + '_delete', args=[item_pk]) +
'"><i class="fas fa-' + get_icon_from_settings('delete') +
Expand Down
4 changes: 2 additions & 2 deletions bemas/views/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def generate_foreign_key_link_simplified(target_model, target_object, link_text=
icon = '<i class="fas fa-' + get_icon_from_settings(target_model_name) + '"></i>'
return '<a href="' + \
reverse('bemas:' + target_model_name + '_update', args=[target_object.pk]) + \
'" title="' + target_model._meta.verbose_name + ' bearbeiten">' + \
'" title="' + target_model._meta.verbose_name + ' ansehen oder bearbeiten">' + \
icon + ' ' + link_text + '</a>'


Expand Down Expand Up @@ -679,7 +679,7 @@ def transform_activity_objects(activity_objects):
'action': action,
'created_at': created_at,
'link': link,
'tooltip': model_title + ' bearbeiten' if link else ''
'tooltip': model_title + ' ansehen oder bearbeiten' if link else ''
}
activity_objects_list.append(activity_object_dict)
return activity_objects_list

0 comments on commit 5cb014e

Please sign in to comment.