Skip to content

Commit

Permalink
Merge branch 'develop' into feature_docker_k8s
Browse files Browse the repository at this point in the history
# Conflicts:
#	openatlas/display/util.py
  • Loading branch information
BernhardKoschicek committed Nov 27, 2023
2 parents c2e842e + 6df54be commit 43e29f8
Show file tree
Hide file tree
Showing 32 changed files with 295 additions and 261 deletions.
2 changes: 1 addition & 1 deletion install/upgrade/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ then run the database upgrade script, then restart Apache:
sudo python3 install/upgrade/database_upgrade.py
sudo service apache2 restart

### 7.17.x to 7.17.3
### 7.17.x to 7.17.4
A code base update (e.g. with git pull) and a webserver restart is sufficient.

### 7.16.x to 7.17.0
Expand Down
13 changes: 7 additions & 6 deletions openatlas/display/tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
_('unlinked')
_('missing files')
_('orphaned files')
_('orphaned IIIF files')
_('orphaned subunits')
_('circular dependencies')

Expand Down Expand Up @@ -119,12 +120,12 @@ def set_buttons(self, name: str, entity: Optional[Entity] = None) -> None:
g.classes[item].label,
url_for('insert', class_=item, origin_id=id_)))
elif name == 'artifact':
if entity and entity.class_.name in \
['place',
'artifact',
'human_remains',
'feature',
'stratigraphic_unit']:
if entity and entity.class_.name in [
'place',
'artifact',
'human_remains',
'feature',
'stratigraphic_unit']:
self.buttons.append(
button(_('add subunit'),
url_for('add_subunit', super_id=id_)))
Expand Down
9 changes: 4 additions & 5 deletions openatlas/display/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ def display(self, name: str = 'default') -> str:
data = {
'data': self.rows,
'stateSave': 'true',
'columns':
[{
'columns': [{
'title': uc_first(_(name)) if name else '',
'className': 'dt-body-right'
if name in ['count', 'size'] else ''}
for name in self.header] +
[{'title': '', 'className': ''}
for _item in range(len(self.rows[0]) - len(self.header))],
for name in self.header] + [
{'title': '', 'className': ''}
for _item in range(len(self.rows[0]) - len(self.header))],
'paging': self.paging,
'pageLength': current_user.settings['table_rows'],
'autoWidth': 'false'}
Expand Down
4 changes: 2 additions & 2 deletions openatlas/display/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def format_date(value: Union[datetime, numpy.datetime64]) -> str:


def convert_size(size_bytes: int) -> str:
if size_bytes >= 0:
if size_bytes <= 0:
return "0 B" # pragma: no cover
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
i = int(math.floor(math.log(size_bytes, 1024)))
Expand Down Expand Up @@ -802,4 +802,4 @@ def convert_image_to_iiif(id_: int) -> None:
if process.returncode == 0:
flash(_('IIIF converted'), 'info')
else:
flash(f"{_('failed to convert image')}", 'error')
flash(f"{_('failed to convert image')}", 'error') # pragma: no cover
8 changes: 6 additions & 2 deletions openatlas/forms/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,12 @@ def get_table_content(
entities = Entity.get_by_view('place', types=True, aliases=aliases)
elif class_name == 'event_preceding':
class_ = 'event'
entities = Entity.get_by_class(
['activity', 'acquisition', 'move', 'production'],
entities = Entity.get_by_class([
'activity',
'acquisition',
'modification',
'move',
'production'],
types=True,
aliases=aliases)
elif class_name == 'feature_super':
Expand Down
6 changes: 3 additions & 3 deletions openatlas/forms/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,16 +413,16 @@ def process_form(self) -> None:
if self.form.modified_place.data:
self.add_link('P31', self.form.modified_place.data)

class MoveManager(EventBaseManager):

class MoveManager(EventBaseManager):
def additional_fields(self) -> dict[str, Any]:
return dict(
super().additional_fields(),
**{
'place_from': TableField(_('from'), add_dynamic=['place']),
'place_to': TableField(_('to'), add_dynamic=['place']),
'artifact': TableMultiField(),
'person': TableMultiField()})
'artifact': TableMultiField('moved artifact'),
'person': TableMultiField('moved person')})

def populate_update(self) -> None:
super().populate_update()
Expand Down
2 changes: 1 addition & 1 deletion openatlas/static/js/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ $(document).ready(function () {

// Add required to reference precision if reference is set
['keyup', 'change'].forEach((listener) => {
$("[id^=reference_system_value]").on(listener, function () {
$("[id^=reference_system_id]").on(listener, function () {
const select = $(`#reference_system_precision_${this.id.split('_').pop()}`);
if (!this.value?.length)
select.removeClass('required');
Expand Down
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/event.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/environment.pickle
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/journey.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/move_event.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions openatlas/static/manual/admin/data_integrity_checks.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ <h3>Missing files<a class="headerlink" href="#missing-files" title="Permalink to
<h3>Orphaned files<a class="headerlink" href="#orphaned-files" title="Permalink to this headline"></a></h3>
<p>Files that have no corresponding entity are listed here.</p>
</div>
<div class="section" id="orphaned-iiif-files">
<h3>Orphaned IIIF files<a class="headerlink" href="#orphaned-iiif-files" title="Permalink to this headline"></a></h3>
<p>IIIF files that have no corresponding entity are listed here.</p>
</div>
<div class="section" id="orphaned-subunits">
<h3>Orphaned subunits<a class="headerlink" href="#orphaned-subunits" title="Permalink to this headline"></a></h3>
<p>Subunits that are missing a connection to the level above. E.g. a feature
Expand Down
1 change: 1 addition & 0 deletions openatlas/static/manual/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ <h1>Admin<a class="headerlink" href="#admin" title="Permalink to this headline">
<li class="toctree-l3"><a class="reference internal" href="data_integrity_checks.html#type">Type</a></li>
<li class="toctree-l3"><a class="reference internal" href="data_integrity_checks.html#missing-files">Missing files</a></li>
<li class="toctree-l3"><a class="reference internal" href="data_integrity_checks.html#orphaned-files">Orphaned files</a></li>
<li class="toctree-l3"><a class="reference internal" href="data_integrity_checks.html#orphaned-iiif-files">Orphaned IIIF files</a></li>
<li class="toctree-l3"><a class="reference internal" href="data_integrity_checks.html#orphaned-subunits">Orphaned subunits</a></li>
<li class="toctree-l3"><a class="reference internal" href="data_integrity_checks.html#circular-dependencies">Circular dependencies</a></li>
</ul>
Expand Down
9 changes: 7 additions & 2 deletions openatlas/static/manual/entity/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,14 @@ <h3>Move<a class="headerlink" href="#move" title="Permalink to this headline">¶
<ul class="simple">
<li><p><strong>From</strong> - a <a class="reference internal" href="place.html"><span class="doc">Place</span></a> as a start point</p></li>
<li><p><strong>To</strong> - a <a class="reference internal" href="place.html"><span class="doc">Place</span></a> as a destination point</p></li>
<li><p><a class="reference internal" href="artifact.html"><span class="doc">Artifact</span></a> - to select artifacts that were moved</p></li>
<li><p><a class="reference internal" href="actor.html"><span class="doc">Person</span></a> - to select persons that were moved</p></li>
<li><p>Moved <a class="reference internal" href="artifact.html"><span class="doc">Artifact</span></a> - to select moved artifacts</p></li>
<li><p>Moved <a class="reference internal" href="actor.html"><span class="doc">Person</span></a> - to select moved persons</p></li>
</ul>
<p>Unfortunately CIDOC CRM doesn’t allows a <strong>moved by</strong> relation for groups. It
is still possible to “move” groups via the actor tab which in the background
creates a more general <strong>participated at</strong> relation between actor and move
event. For more information please take a look at <a class="reference internal" href="../examples/journey.html"><span class="doc">Journey</span></a> or
<a class="reference internal" href="../examples/move_event.html"><span class="doc">Move events</span></a> tutorial.</p>
</div>
<div class="section" id="production">
<h3>Production<a class="headerlink" href="#production" title="Permalink to this headline"></a></h3>
Expand Down
44 changes: 17 additions & 27 deletions openatlas/static/manual/examples/journey.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,7 @@ <h2>Adding actors<a class="headerlink" href="#adding-actors" title="Permalink to
<p>If not all <a class="reference internal" href="../entity/actor.html"><span class="doc">actors</span></a> involved in the journey were
entered into the database already, add them via a click on the respective
tab in the <a class="reference internal" href="../ui/menu.html"><span class="doc">menu</span></a>. Here, click the <strong>+ Person</strong> button to get to
the form. As for all other forms, a name is required to save the data.
<strong>Please note</strong>, that that only individuals entered as person can be linked
to a move event later on. This is <strong>not possible</strong> for groups, as a move of
one or more groups can not be mapped with the current version of CIDOC CRM.</p>
the form. As for all other forms, a name is required to save the data.</p>
</div>
<div class="section" id="adding-locations">
<h2>Adding locations<a class="headerlink" href="#adding-locations" title="Permalink to this headline"></a></h2>
Expand All @@ -220,12 +217,9 @@ <h2>Creating the move event<a class="headerlink" href="#creating-the-move-event"
<p>The following steps will create a move event:</p>
<ul class="simple">
<li><p>Click on the <strong>Event</strong> tab in the menu then use the <strong>+ Move</strong> button</p></li>
<li><p>Fill out the form, for more information see the <a class="reference internal" href="move_event.html"><span class="doc">move event tutorial</span></a>.</p></li>
<li><p><strong>Please note</strong>: do not link a person in this form if the journey was taken
willingly.
Link here only people who have not traveled of their own free will - think,
for example, of a prisoner transport or the translation of relics. To see
how to link (voluntary) travelers correctly, see below.</p></li>
<li><p>Fill out the form, for more information see the
<a class="reference internal" href="move_event.html"><span class="doc">move event tutorial</span></a>.</p></li>
<li><p>Link persons in this form who made the journey</p></li>
<li><p><strong>Please also note</strong>: Use <strong>preceding event</strong> to document multiple
parts of a trip. Unlike <strong>sub events</strong>, these can be put in chronological
order. Sub events are there to capture events that happen at the same time
Expand All @@ -236,26 +230,22 @@ <h2>Creating the move event<a class="headerlink" href="#creating-the-move-event"
</div>
<div class="section" id="link-actors-to-the-journey">
<h2>Link actors to the journey<a class="headerlink" href="#link-actors-to-the-journey" title="Permalink to this headline"></a></h2>
<p>To link actors (who have made a journey of their own free will) to the created
entry click on the blue <strong>Actor</strong> tab on the landing page of the respective
move event.</p>
<ul>
<li><p>Here, the Link button can be used to link people already entered into the
database. The following information can be entered via the form:</p>
<blockquote>
<div><ul class="simple">
<li><p>at type you can define the role of the actor in the journey; if
<p>Already entered persons (and artifacts) can be added at the event form which
creates a <strong>moved by</strong> relation to the event. Unfortunately this is not
possible for groups in the current version of CIDOC CRM.</p>
<p>Alternatively, actors (persons and groups) can be added via the actor tab where
it is also possible to create new ones via the <strong>+ Person</strong> and <strong>+ Group</strong>
button. In this case a more general <strong>participated at</strong> relation will be used
between actors and event. It is also possible to add additional information:</p>
<ul class="simple">
<li><p>At type you can define the role of the actor in the journey; if
there is no suitable entry in the list, a new type can be created
depending on the user’s authorization, see the <a class="reference internal" href="types.html"><span class="doc">types
tutorial</span></a>.</p></li>
<li><p>the actor can be changed afterwards via the <strong>Change</strong> button</p></li>
<li><p>the form of participation can be determined</p></li>
<li><p>in addition, dates and a free text description are possible</p></li>
</ul>
</div></blockquote>
</li>
<li><p>via <strong>+person</strong> or <strong>+group</strong> new actors can be created and then linked to
the move event</p></li>
<li><p>The actor can be changed afterwards via the <strong>Change</strong> button</p></li>
<li><p>The form of participation can be determined</p></li>
<li><p>In addition, dates for the participation (in case they differ from the
event) and a free text description are possible</p></li>
</ul>
</div>
</div>
Expand Down
36 changes: 14 additions & 22 deletions openatlas/static/manual/examples/move_event.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ <h2>Create a new move event - general instruction<a class="headerlink" href="#cr
list, it might be possible for you to add new types - depending on
your <a class="reference internal" href="../admin/user.html"><span class="doc">user group</span></a> (please see this
<a class="reference internal" href="types.html"><span class="doc">tutorial</span></a> for more information)</p></li>
<li><p>you can add one or more <strong>sub events</strong>. Please keep in mind: Sub events
<li><p>You can add one or more <strong>sub events</strong>. Please keep in mind: Sub events
cannot be added in a temporal order and are used to represent events that
occur simultaneously. Examples are a music festival with parallel concerts
or a war with overlapping battles at different locations. To represent a
Expand All @@ -210,41 +210,33 @@ <h2>Create a new move event - general instruction<a class="headerlink" href="#cr
select the event from a list of already entered events. If the event you are
looking for cannot be found in this list, please add it via <strong>Event</strong> in the
menu and then link it</p></li>
<li><p>you can add a <strong>preceding event</strong>, for more information see
<li><p>You can add a <strong>preceding event</strong>, for more information see
above or the <a class="reference internal" href="journey.html"><span class="doc">Journey</span></a> tutorial</p></li>
<li><p>via <strong>from</strong> you can add a location from where the move event started,
<li><p>Via <strong>from</strong> you can add a location from where the move event started,
think of the starting point of a journey or the place a letter was sent from.
You can choose a location from a list of already added locations. If the
place you are looking for is not in this list yet, please add it via
<strong>Place</strong> menu and then link it</p></li>
<li><p>via <strong>to</strong>, you can add the end location of the move event. For more
<li><p>Via <strong>to</strong>, you can add the end location of the move event. For more
information check <strong>from</strong> (above in this tutorial)</p></li>
<li><p>if an <strong>artifact</strong> was moved by the event, e.g. a letter that was sent, you
<li><p>If an <strong>artifact</strong> was moved by the event, e.g. a letter that was sent, you
can choose the artifact from a list of already entered artifacts. If the
artifact is not entered into the database yet, use <strong>Artifact</strong> in the
menu to create an entry and link it here</p></li>
<li><p>if a <strong>person</strong> was moved by the event, choose the person from a list
<li><p>If a <strong>person</strong> was moved by the event, choose the person from a list
of already entered actors. If the actor is not entered into the database
already, use the <strong>Actor</strong> tab in the menu to create an entry and link it
here. <strong>Please note</strong>, only people who did not participate in a move event of
their own free will should be linked here. Think of an exchange or transfer
of prisoners, the expulsion of individuals, or relic translations and
the transport of dead people. Travel does not fall into this category. The
participants of a journey or another (voluntarily) undertaken move event are
linked in a different way. For more information on this, see the tutorial on
<a class="reference internal" href="journey.html"><span class="doc">Journey</span></a>. <strong>Please also note</strong> that only individuals can be
linked here, not groups. A move of a group cannot be mapped via CIDOC CRM
at the moment and is therefore not possible here.</p></li>
<li><p>it is possible to link the move event by using external references (find
here. More information about how to add actors is available at the
<a class="reference internal" href="journey.html"><span class="doc">Journey</span></a> tutorial.</p></li>
<li><p>It is possible to link the move event by using external references (find
more information <a class="reference internal" href="../entity/reference_system.html"><span class="doc">here</span></a>)</p></li>
<li><p>enter a start and end <strong>date</strong> of the move event</p></li>
<li><p>additionally you can enter a <strong>description</strong> of the event as free text</p></li>
<li><p>Enter a start and end <strong>date</strong> of the move event</p></li>
<li><p>Additionally you can enter a <strong>description</strong> of the event as free text</p></li>
</ul>
<p>By clicking the <strong>Insert</strong> or <strong>Insert and continue</strong> button you can save
the entered data.
After saving the information, you can link sources, actors (for
participants of a <strong>voluntary</strong> move event!), references, files and notes
via the respective buttons on the landing page of your new entry.</p>
the entered data. After saving the information, you can link sources, actors,
references, files and notes via the respective buttons on the landing page of
your new entry.</p>
<p>For more information on move events including an artifact, please see the
example on <a class="reference internal" href="letters.html"><span class="doc">Letters</span></a>. On how to enter a journey, please refer
to the <a class="reference internal" href="journey.html"><span class="doc">Journey</span></a> tutorial.</p>
Expand Down
2 changes: 1 addition & 1 deletion openatlas/static/manual/searchindex.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions openatlas/templates/entity/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{% block content %}
{% if entity.class_.view not in ['artifact', 'place'] %}
<div class="container">
{{ form|display_form(manual_page='entity/' + entity.class_.view)|safe }}
{{ entity.class_.view|display_citation_example|safe }}
{{ form|display_form(manual_page='entity/' + entity.class_.view)|safe }}
{{ entity.class_.view|display_citation_example|safe }}
</div>
{% else %}
<div class="row">
Expand All @@ -20,7 +20,7 @@
<div id="map" class="map"></div>
</div>
</div>
<link rel="stylesheet" href="/static/node_modules/leaflet-draw/dist/leaflet.draw.css"/>
<link rel="stylesheet" href="/static/node_modules/leaflet-draw/dist/leaflet.draw.css">
<script src="/static/node_modules/leaflet-draw/dist/leaflet.draw.js"></script>
<script src="/static/js/map/map.js"></script>
<script src="/static/js/map/draw.js"></script>
Expand Down
4 changes: 4 additions & 0 deletions openatlas/templates/forms/form_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<div style="height:31px" class="d-flex align-items-center justify-content-end text-end">
{% if label is string or label.__class__.__name__ == 'LazyString' %}
<label class="uc-first">{{ label|safe }}</label>
{% elif field.name == 'alias' %}
<label class="uc-first" for="{{ field.name }}-0">{{ field.label.text|safe }}</label>
{% elif field.__class__.__name__ in ['TableField', 'TableMultiField'] %}
<label class="uc-first" for="{{ field.name }}-button">{{ field.label.text|safe }}</label>
{% else %}
{{ field.label(class_="uc-first")|safe }}
{% endif %}
Expand Down
Loading

0 comments on commit 43e29f8

Please sign in to comment.