Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
moogoo78 committed Oct 18, 2024
1 parent ab18db2 commit fa48fd2
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/models/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def update_from_json(self, data):
return changes

@staticmethod
def get_editable_fields(field_types=['date', 'int', 'str', 'float']):
def get_editable_fields(field_types=['date', 'int', 'str', 'float', 'decimal']):
date_fields = [
'collect_date',
]
Expand Down
4 changes: 2 additions & 2 deletions app/templates/admin/inc_record-form2.tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ $( document ).ready(function() {
.then(response => response.json())
.then(result => {
console.log(result);
UIkit.notification('已儲存', {timeout: 2000});
UIkit.notification('已儲存', {timeout: 1000});
if (next_url) {
const timeoutID = window.setTimeout(( () => {
location.replace(next_url);
}), 2000);
}), 1000);
}
})
.catch(error => {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/admin/inc_record_template-modal.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h2 class="uk-modal-title unit-modal-title">Unit</h2>
{{ widget('type_is_published', _('是否發表'), '', '1-6@s', 'select', options=[{'text':'是', 'value':'P'}, {'text':'否', 'value':'N'}], data={'unit': 'type_is_published'}) }}
{{ widget('type_reference', 'Reference', '', '1-2@s', data={'unit': 'type_reference'})}}
{{ widget('type_reference_link', 'Ref. link', '', '1-2@s', data={'unit': 'type_reference_link'})}}
{{ widget('type_note', 'Type Note', '', '1-1@s', data={'unit': 'type_note'})}}
{{ widget('type_note', 'Type Note', '', '1-1@s', 'textarea', data={'unit': 'type_note'})}}
{{ heading( _('屬性') )}}
<div id="unit-assertion-container" uk-grid class="uk-grid-small"></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/admin/print-label.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h1 class="page-title">page 1</h1>
{% set named_areas = item.record.get_named_area_list('default') %}
<div class="label-title">
<!-- LAYOUT1 span class="institution-name">中央研究院植物標本館</span><span class="institution-code">(HAST)</span-->
<span class="collection-name">{% if item.record.get_named_area('country') %}{% if item.record.get_named_area('country').id == 2 %}BOTANICAL INVENTORY OF TAIWAN{% else %}PLANTS OF {{ item.record.get_named_area('country').name_en.upper() }}{% endif %}{# item.record.get_named_area('country').source_data.countryE #}{% endif %}</span>{# TODO #}
<span class="collection-name">{% if item.record.get_named_area('COUNTRY') %}{% if item.record.get_named_area('COUNTRY').id == 1311 %}BOTANICAL INVENTORY OF TAIWAN{% else %}PLANTS OF {{ item.record.get_named_area('COUNTRY').name_en.upper() }}{% endif %}{# item.record.get_named_area('country').source_data.countryE #}{% endif %}</span>{# TODO #}
</div>
{% set first_id = item.record.get_first_id() %}
{% if first_id and first_id.taxon %}
Expand Down
62 changes: 53 additions & 9 deletions app/templates/admin/record-form2-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,60 @@
{% block main %}
<a href="#" id="hide-left-col-btn" class="uk-button uk-button-link"><span uk-icon="icon: chevron-double-left;"></span>{{ _('關閉側邊欄') }}</a>

<nav aria-label="Breadcrumb">
<div class="uk-flex uk-flex-between">
<nav aria-label="Breadcrumb">
<ul class="uk-breadcrumb">
<li><a href="/admin">Dashboard</a></li>
<li><a href="/admin/records">{{ _('採集紀錄與標本') }}</a></li>
{#<li><span aria-current="page">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</span></li>#}
<li><a href="/admin">Dashboard</a></li>
<li><a href="/admin/records">{{ _('採集紀錄與標本') }}</a></li>
{#<li><span aria-current="page">{{ _('標籤') }}</span></li>#}
</ul>
</nav>
</nav>
<button class="uk-button uk-button-default uk-button-small" type="button" uk-toggle="target: #modal-close-default">{{ _('標籤') }}</button>
</div>

{#
<div id="modal-close-default" uk-modal>
<div class="uk-modal-dialog uk-modal-body">
<button class="uk-modal-close-default" type="button" uk-close></button>
<div class="label-title">
<span class="collection-name">PLANTS OF BOLIVIA</span>
</div>
<div class="first-id">
<div class="taxon">
<span class="taxon-family"></span>
<span class="taxon-species">Escallonia paniculata (Ruiz &amp; Pav.) Roem. &amp; Schult. </span>
</div>
</div>
<div class="locality">
<span class="locality-list"></span>
<span class="box">Inca Chaca, Valley of Rio Malaga, affluent of Rio Paracti, Provincia de Chapare</span>
</div>
<div class="geographic-position">
<span class="altitude">Elev. ca. 2300-2400 m<span>
</span></span></div>
<div class="annotation-container">
<div class="annotations">Common on steep slopes of deep wooded ravine</div>
</div>
<div class="collect">
<span class="collect-num"> 28472</span>
<span class="collect-date">Aug. 24, 1947</span>
</div>
<div class=""><span class="box companion">&amp; Francis Raymond Fosberg</span>
</div>
<!-- LAYOUT1 div class="footer">HERBARIUM, ACADEMIA SINICA, TAIPEI (HAST)</div-->
<div class="institution"><span class="institution-name">中央研究院植物標本館</span><span class="institution-code">Herbarium, Academia Sinica, Taipei (HAST)</span></div>
<div class="annotations">
</div>
</div>
</div>
#}

<form>
<ul uk-tab>
<li class="uk-active"><a href="#" class="ndb-tab-nav" data-tab="occurrence">{{ _('出現紀錄') }}</a></li>
<li><a href="#" class="ndb-tab-nav" data-tab="assertion">{{ _('棲地/環境') }}</a></li>
<li><a href="#" class="ndb-tab-nav" data-tab="identifications">{{ _('鑑定紀錄') }} <span id="ndb-nav-identification-num"></span></a></li>
<li><a href="#">Images</a></li>
<li><a href="#" class="ndb-tab-nav" data-tab="identification">{{ _('鑑定紀錄') }} <span id="ndb-nav-identification-num"></span></a></li>
<li><a href="#" class="ndb-tab-nav" data-tab="multimedia">{{ _('多媒體') }}</a></li>
</ul>
{#
<div class="uk-card uk-card-default uk-card-body uk-width-1-1@s">
Expand Down Expand Up @@ -141,10 +181,14 @@
</fieldset>
</div>
</div><!-- END: assertion -->
<div class="uk-grid-small ndb-tab-view uk-hidden" data-tab="identifications" uk-grid>
<div class="uk-grid-small ndb-tab-view uk-hidden" data-tab="identification" uk-grid>
<h3 class="uk-heading-bullet">鑑定 <button class="uk-button uk-button-small" type="button" id="identification-add-button">+</button></h3>
<div id="identification-container"></div>
</div>{# end of nav identifications #}
</div>{# end of nav identification #}

<div class="uk-grid-small ndb-tab-view uk-hidden" data-tab="multimedia" uk-grid>
<h3 class="uk-heading-bullet">{{ _('多媒體') }} </h3>
</div>

<hr class="uk-divider-icon">
<div class="uk-flex uk-flex-between">
Expand Down
18 changes: 9 additions & 9 deletions app/templates/admin/record-list-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@
{% endfor %}
</ul>
</div></th>
<th class="uk-table-shrink">#</th>
<th>館號</th>
<th>物種</th>
<th>採集者</th>
<th>採集號</th>
<th>採集日期</th>
<th>採集地點</th>
<th>資料新增/最後修改時間</th>
<th style="width:100px">#</th>
<th style="width:100px">館號</th>
<th style="width:200px">物種</th>
<th style="width:200px">採集者</th>
<th style="width:100px">採集號</th>
<th style="width:100px">採集日期</th>
<th style="width:100px">採集地點</th>
<th style="width:100px">資料新增/最後修改時間</th>
</tr>
</thead>
<tbody>
Expand All @@ -112,7 +112,7 @@
</td>
<td>{{ loop.index + (pagination.current_page - 1) * 20 }}</td>
<td><img src="{{ r.image_url }}"><br>{{ r.accession_number }}</td>
<td>{{ r.scientific_name }}{%if r.common_name %} ({{ r.common_name }}){% endif %}</td>
<td style="width:20px">{{ r.scientific_name }}{%if r.common_name %} ({{ r.common_name }}){% endif %}</td>
<td>{{ r.collector }}</td>
<td>{{ r.field_number }}</td>
<td>{{ r.collect_date }}</td>
Expand Down

0 comments on commit fa48fd2

Please sign in to comment.