Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
808 lines (776 sloc)
30.1 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% extends "base.html" %} | |
| {% from 'macros.html' import editionnum, print_story_long, print_story_type, print_article_long %} | |
| {% from 'edit_menu.tmpl' import edit_menu_content %} | |
| {% block edit_menu %} | |
| {% call edit_menu_content() %} | |
| <a class="dropdown-item" href="{{url_for('new_work_for_person', personid=person.id)}}">Lisää teos henkilölle</a> | |
| {% endcall %} | |
| {% endblock %} | |
| {% block content %} | |
| {% if current_user.is_admin %} | |
| <form method="post" id="itemForm"> | |
| {{ form.hidden_tag() }} | |
| {% endif %} | |
| </form> | |
| <div class="container"> | |
| <div class="edit-field mt-3"> | |
| <label for="name">Kirjailijanimi</label> | |
| <input type="text" class="form-control form-item" id="name" name="name" value="{{person.name}}" form="itemForm"> | |
| <label for="real_names">Oikeat henkilöt, jos alias</label> | |
| <select class="person-selector form-control" multiple="multiple" data-placeholder="Oikeasti" | |
| data-search="/select_person" data-save="/save_real_names_to_person" data-init="/real_names_for_person" | |
| data-name="real_names" data-tags="true"></select> | |
| <div> | |
| <div class="row"> | |
| <div class="col-8"> | |
| <label for="nationality">Kansallisuus</label> | |
| <select class="country-selector form-control" data-placeholder="Kansallisuus" data-search="/select_country" | |
| data-save="/save_nationality_to_person" data-init="/nationality_for_person" data-name="nationality" | |
| data-mininput="1" data-tags="true" name="nationality" id="nationality"></select> | |
| </div> | |
| <div class="col-2"> | |
| <label for="dob">Synt. vuosi</label> | |
| <input type="text" class="form-control form-item" id="dob" name="dob" | |
| value="{{person.dob if person.dob is not none}}" form="itemForm"> | |
| </div> | |
| <div class="col-2"> | |
| <label for="dod">Kuolinvuosi</label> | |
| <input type="text" class="form-control form-item" id="dod" name="dod" | |
| value="{{person.dod if person.dod is not none}}" form="itemForm"> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="view-field mb-3"> | |
| <h1 class="mt-4 mb-1" style="text-align: center;"> | |
| {% if person.alt_name %} | |
| {{person.alt_name}}</h1> | |
| {% else %} | |
| {{person.fullname}}</h1> | |
| {% endif %} | |
| {% if person.fullname %} | |
| {% if person.alt_name != person.fullname %} | |
| <h4 class="mt-0 mb-1" style="text-align: center;"> | |
| ({{ person.fullname }}) | |
| </h4> | |
| {% endif %} | |
| {% endif %} | |
| {% if person.real_names %} | |
| <h4 style="text-align: center;">(Oik. | |
| <span class="person-list">{{ person.real_names|map(attribute="name")|join(' & | |
| ')}}</span>) | |
| </h4> | |
| {% endif %} | |
| <!-- Nationality, dob, dod --> | |
| <h4 style="text-align: center;"> | |
| {% if person.nationality %} {{ person.nationality.name }} {%- endif -%} {%- | |
| if person.nationality and person.dob -%},{% endif %} {% if person.dob | |
| %} {{ person.dob }}-{{ person.dod if person.dod }} {% endif %} | |
| </h4> | |
| </div> | |
| <div class="mb-3 mt-4"> | |
| <div class="row"> | |
| <div class="col-lg-4 col-md-12"> | |
| <div class="row ml-1 mr-1 mt-2"> | |
| <div clas="col"> | |
| {% if person.image_src %} | |
| <figure class="figure"> | |
| <img src="{{person.image_src}}" class="figure-img img-fluid" id="image"> | |
| <figcaption class="figure-caption text-right">{{person.image_attr if person.image_attr is not none}} | |
| </figcaption> | |
| </figure> | |
| {% else %} | |
| <img src="/static/icons/person_256.png" class="img-fluid"> | |
| {% endif %} | |
| </div> | |
| </div> | |
| {% if current_user.is_admin %} | |
| <div class="row edit-field"> | |
| <div class="col"> | |
| <input type="file" class="form-control" name="image_upload" id="image_upload" | |
| data-save="/save_image_to_person"> | |
| </div> | |
| </div> | |
| <div class="row edit-field"> | |
| <div class="col"> | |
| <label for="image_attr">Kuvan lähde</label> | |
| <input type="text" class="form-control form-item" id="image_attr" name="image_attr" | |
| value="{{person.image_attr if person.image_attr is not none}}" form="itemForm"> | |
| </div> | |
| </div> | |
| {% if person.image_src %} | |
| <div class="row edit-field"> | |
| <div class="col"> | |
| <button class="btnRemove" data-save="/remove_image_from_person" | |
| data-replace="/static/icons/person_256.png">Poista kuva</button> | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% endif %} | |
| </div> | |
| <div class="col-lg-8 col-sm-12"> | |
| {% if current_user.is_admin %} | |
| <div class="edit-field"> | |
| <div class="row"> | |
| <div class="col"> | |
| <label for="alt_name">Vaihtoehtoinen kirjoitusasu nimelle</label> | |
| <input type="text" class="form-control form-item" id="alt_name" name="alt_name" | |
| value="{{person.alt_name if person.alt_name is not none}}" form="itemForm"> | |
| </div> | |
| </div> | |
| <div class="row"> | |
| <div class="col"> | |
| <label for="fullname">Koko nimi</label> | |
| <input type="text" class="form-control form-item" id="fullname" name="fullname" | |
| value="{{person.fullname if person.fullname is not none}}" form="itemForm"> | |
| </div> | |
| </div> | |
| <div class="row"> | |
| <div class="col"> | |
| <label for="other_names">Nimen muut kirjoitusasut</label> | |
| <input type="text" class="form-control form-item" id="other_names" name="other_names" | |
| value="{{person.other_names if person.other_names is not none}}" form="itemForm"> | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| <!-- Genre --> | |
| <div class="row"> | |
| <div class="col justify-content-left view-field"> | |
| {% include "_genre_count.html" %} | |
| </div> | |
| </div> | |
| <!-- Aliases --> | |
| <div class="row"> | |
| {% if current_user.is_admin %} | |
| <div class="col edit-field"> | |
| <label for="aliases">Pseudonyymit</label> | |
| <select class="person-selector form-control" multiple="multiple" data-placeholder="Pseudonyymit" | |
| data-search="/select_person" data-save="/save_aliases_to_person" data-init="/aliases_for_person" | |
| data-name="aliases"></select> | |
| </div> | |
| {% endif %} | |
| <div class="col view-field"> | |
| {% if person.other_names %} | |
| <br>Myös: {{ person.other_names }} | |
| {% endif %} | |
| {% if person.aliases %} | |
| <br>Pseudonyymit: <span class="person-list">{{ person.aliases|map(attribute="alt_name")|join(' & | |
| ')}}</span> | |
| {% endif %} | |
| </div> | |
| </div> | |
| <!-- Languages --> | |
| {% if current_user.is_admin %} | |
| <div class="edit-field"> | |
| <div class="row"> | |
| <div class="col"> | |
| <label for="language">Kielet</label> | |
| <select class="language-selector form-control" data-placeholder="Kielet" data-search="/select_language" | |
| data-save="/save_languages_to_person" data-init="/languages_for_person" data-name="language" | |
| id="language" data-tags="true" name="language" multiple="multiple" data-mininput="1"></select> | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| <div class="view-field"> | |
| <div class="row"> | |
| <div class="col"> | |
| {{ person.languages|map(attribute='name')|join(', ') }} | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Tags --> | |
| {% if current_user.is_admin %} | |
| <div class="edit-field"> | |
| <div class="row"> | |
| <div class="col"> | |
| <label for="tags">Asiasanat</label> | |
| <select class="tag-selector form-control" multiple="multiple" data-placeholder="Asiasanat" | |
| data-search="/select_tags" data-save="/save_tags_to_person" data-init="/tags_for_person" | |
| data-name="tags" id="tags" data-tags="true" name="tags"></select> | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% if person.tags|length %} | |
| <div class="view-field"> | |
| <div class="row"> | |
| <div class="col"> | |
| {% for tag in person.tags %} | |
| <a href="{{url_for('tag', tagid=tag.id)}}">{{tag.name}}</a> | |
| {% endfor %} | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| <div class="row"> | |
| {% if current_user.is_admin %} | |
| <div class="col edit-field m-2"> | |
| <label for="bio">Biografia</label> | |
| <textarea class="form-control form-item mb-3" id="bio" name="bio" rows="5" cols="40" | |
| form="itemForm">{{person.bio if person.bio is not none}}</textarea> | |
| </div> | |
| {% endif %} | |
| {% if person.bio %} | |
| <div class="col view-field"> | |
| <figure> | |
| <blockquote class="blockquote" style="padding: 1rem"> | |
| {{person.bio}} | |
| </blockquote> | |
| <figcaption>{{person.bio_src}}</figcaption> | |
| </figure> | |
| </div> | |
| {% endif %} | |
| </div> | |
| {% if current_user.is_admin %} | |
| <div class="row edit-field mb-1"> | |
| <div class="col"> | |
| <label for="bio_src">Lähde</label> | |
| <input type="text" class="form-control form-item" id="bio_src" name="bio_src" | |
| value="{{person.bio_src if person.bio_src is not none}}" form="itemForm"> | |
| </div> | |
| </div> | |
| {% endif %} | |
| <!-- Links --> | |
| {% if current_user.is_admin %} | |
| <div data-toggle="fieldset" id="link-fieldset" class="row edit-field mt-2"> | |
| <div class="col"> | |
| Linkit: <button type="button" data-toggle="fieldset-add-row" data-target="#link-fieldset">+</button> | |
| <table> | |
| <tr> | |
| <th>Osoite</th> | |
| <th>Kuvaus</th> | |
| </tr> | |
| {% if person.links|length %} | |
| {% for link in person.links %} | |
| <tr data-toggle="fieldset-entry"> | |
| <td><input id="links-{{loop.index0}}-link" type="text" class="form-control form-item" | |
| name="links-{{loop.index0}}-link" value="{{ link.link if link.link is not none}}" form="itemForm"> | |
| </td> | |
| <td><input id="links-{{loop.index0}}-description" type="text" class="form-control form-item" | |
| name="links-{{loop.index0}}-description" | |
| value="{{link.description if link.description is not none}}" form="itemForm"></td> | |
| <td><button type="button" data-toggle="fieldset-remove-row" id="link-{{loop.index0}}-remove">-</button> | |
| </td> | |
| </tr> | |
| {% endfor %} | |
| {% else %} | |
| <tr data-toggle="fieldset-entry"> | |
| <td><input id="links-0-link" type="text" class="form-control form-item" name="links-0-link" | |
| form="itemForm"> | |
| </td> | |
| <td><input id="links-0-description" type="text" class="form-control form-item" | |
| name="links-0-description" form="itemForm"></td> | |
| <td><button type="button" data-toggle="fieldset-remove-row" id="link-0-remove">-</button> | |
| </td> | |
| </tr> | |
| {% endif %} | |
| </table> | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% if person.links %} | |
| <div class="row view-field mb-2"> | |
| <div class="col"> | |
| {% if person.links|length > 1 %} | |
| {% for link in person.links[0:-1] %} | |
| <a href="{{link.link}}" target="_blank">{{link.description}}</a> • | |
| {% endfor %} | |
| <a href="{{person.links[-1].link}}" target="_blank">{{person.links[-1].description}}</a> | |
| {% elif person.links|length == 1 %} | |
| <a href="{{person.links[0].link}}" target="_blank">{{person.links[0].description}}</a> | |
| {% endif %} | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% if current_user.is_admin %} | |
| <!-- Awards --> | |
| <div data-toggle="fieldset" id="awards-fieldset" class="row edit-field mt-2 mb-3"> | |
| <div class="col-lg-12 align-self-start"> | |
| Palkinnot: <button type="button" data-toggle="modal" data-target="#add-award">+</button> | |
| {% if person.personal_awards|length %} | |
| <table> | |
| {% for award in person.personal_awards %} | |
| <tr data-toggle="fieldset-entry"> | |
| <td> | |
| <input id="awards-{{loop.index0}}-year" type="text" class="form-control form-item" | |
| name="awards-{{loop.index0}}-year" value="{{award.year}}" form="itemForm"> | |
| </td> | |
| <td> | |
| <input id="awards-{{loop.index0}}-name" type="text" class="form-control form-item" | |
| name="awards-{{loop.index0}}-name" value="{{award.award.name}}" form="itemForm"> | |
| </td> | |
| <td> | |
| <input id="awards-{{loop.index0}}-category" type="text" class="form-control form-item" | |
| name="awards-{{loop.index0}}-category" value="{{award.category.name}}" form="itemForm"> | |
| </td> | |
| <td> | |
| <input id="awards-{{loop.index0}}-award_id" type="text" class="form-control form-item" | |
| name="awards-{{loop.index0}}-award_id" value="{{award.award.id}}" form="itemForm"> | |
| </td> | |
| <td> | |
| <input id="awards-{{loop.index0}}-category_id" type="text" class="form-control form-item" | |
| name="awards-{{loop.index0}}-category_id" value="{{award.category.id}}" form="itemForm"> | |
| </td> | |
| <td><button type="button" data-toggle="fieldset-remove-row" | |
| id="awards-{{loop.index0}}-remove">-</button> | |
| </td> | |
| </tr> | |
| {% endfor %} | |
| </table> | |
| {% else %} | |
| <table> | |
| <tr data-toggle="fieldset-entry"> | |
| <td> | |
| <input id="awards-0-year" type="text" class="form-control form-item" name="awards-0-year" value="" | |
| form="itemForm"> | |
| </td> | |
| <td> | |
| <input id="awards-0-name" type="text" class="form-control form-item" name="awards-0-name" value="" | |
| form="itemForm"> | |
| </td> | |
| <td> | |
| <input id="awards-0-category" type="text" class="form-control form-item" name="awards-0-category" | |
| value="" form="itemForm"> | |
| </td> | |
| <td> | |
| <input id="awards-0-award_id" type="text" class="form-control form-item" name="awards-0-award_id" | |
| value="" form="itemForm"> | |
| </td> | |
| <td> | |
| <input id="awards-0-category_id" type="text" class="form-control form-item" | |
| name="awards-0-category_id" value="" form="itemForm"> | |
| </td> | |
| <td><button type="button" data-toggle="fieldset-remove-row" id="award-0-remove">-</button></td> | |
| </tr> | |
| </table> | |
| {% endif %} | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% if person.personal_awards or novel_awards %} | |
| <!-- Personal awards --> | |
| <div class="view-field"> | |
| <div class="row"> | |
| <div class="col"> | |
| <h4>Palkinnot</h4> | |
| </div> | |
| </div> | |
| <div class="row view-field"> | |
| <div class="col"> | |
| {% for award in person.personal_awards %} | |
| <b><a href="{{url_for('award', awardid=award.award.id)}}">{{award.award.name}}</a></b> | |
| ({{award.year}})<br> | |
| {% endfor %} | |
| </div> | |
| </div> | |
| <div class="row"> | |
| <div class="col"> | |
| {% for group in novel_awards|groupby(attribute='work_id') %} | |
| <a href="{{url_for('work', workid=group.list[0].work_id)}}"><b>{{ group.list[0].work.title }}</b></a>: | |
| {% for award in group.list[0:-1] %} | |
| <a href="{{url_for('award', awardid=award.award.id)}}">{{ award.award.name }}</a> ({{ award.year }}) / | |
| {%- endfor -%} | |
| {% set award = group.list[-1] %} | |
| <a href="{{url_for('award', awardid=award.award.id)}}">{{ award.award.name }}</a> ({{ award.year}}).<br> | |
| {% endfor %} | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| </div> | |
| </div> | |
| </div> | |
| {% if person.works|length or person.edits|length %} | |
| <!-- Works --> | |
| <div class="card"> | |
| <div class="card-header" id="headAuthoredBooks"> | |
| <h2 class="mb-0"> | |
| <div class="row"> | |
| <div class="col col-md-10"> | |
| <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" | |
| data-target="#authoredBooks" aria-expanded="false" aria-controls="authoredBooks"> | |
| Teokset | |
| </button> | |
| </div> | |
| <div class="col"> | |
| <button onclick="switchStyle()" id="switcher" class="btn btn-light text-right"> | |
| Kannet | |
| </button> | |
| </div> | |
| </div> | |
| </h2> | |
| </div> | |
| </div> | |
| <div id="authoredBooks" aria-labelledby="headAuthoredBooks" data-parent="#authorCard"> | |
| <div class="card-body"> | |
| <div id="textual" class="mb-2"> | |
| <div class="mb-3"> | |
| {% for work in person.works|selectattr("author_str", "equalto", person.name) %} | |
| <div class="mb-1"> | |
| {{ work|safe }} | |
| {% for edition in work.editions[1:] %} | |
| {{ edition|safe }} | |
| {% endfor %} | |
| {# | |
| {% include "_work.html" %} | |
| {% set show_first_edition = 1 %} | |
| {% for edition in work.editions[1:] %} | |
| {% include "_work_edition.html" %} | |
| {% endfor %} | |
| #} | |
| </div> | |
| {% endfor %} | |
| </div> | |
| {% for w_group in person.works|selectattr("author_str", "ne", person.name)|groupby(attribute="author_str") | |
| %} | |
| <div class="mb-3"> | |
| <h5 class="mb-0">{{w_group.grouper}}</h5> | |
| {% for work in w_group.list %} | |
| <div class="mb-1"> | |
| {{ work|safe }} | |
| {% for edition in work.editions[1:] %} | |
| {{ edition|safe}} | |
| {% endfor %} | |
| {# | |
| {% include "_work.html" %} | |
| {% set show_first_edition = 1 %} | |
| {% for edition in work.editions[1:] %} | |
| {% include "_work_edition.html" %} | |
| {% endfor %} | |
| #} | |
| </div> | |
| {% endfor %} | |
| </div> | |
| {% endfor %} | |
| {% if person.edits %} | |
| <h5 class="mb-0">Toimittanut</h5> | |
| <div class="mb-3"> | |
| {% set skip_pubseriesnum = 1 %} | |
| {% for edition in person.edits|sort(attribute='title') %} | |
| <div class="mb-2"> | |
| {% include "_edition.html" %} | |
| </div> | |
| {% endfor %} | |
| </div> | |
| {% endif %} | |
| </div> | |
| <div id="pics" style="align-items: flex-start;"> | |
| {% set showfirst = 1 %} | |
| {% for work in person.works %} | |
| {% for edition in work.editions %} | |
| {% if edition.images[0] %} | |
| <figure class="figure"> | |
| <figcaption>{{edition.pubyear}} {{editionnum(edition.version, edition.editionnum, true)}}</figcaption> | |
| <a href=" {{url_for('edition', editionid=edition.id)}}"> | |
| <img class="img-fluid" src="{{edition.images[0].image_src}}" alt="{{editionnum(edition.version, | |
| edition.editionnum, true)}}"> | |
| </a> | |
| </figure> | |
| {% endif %} | |
| {% endfor %} | |
| {% endfor %} | |
| {% if person.edits %} | |
| {% set showfirst = 1 %} | |
| {% for edition in person.edits %} | |
| {% if edition.images[0] %} | |
| <figure class="figure"> | |
| <figcaption>{{edition.pubyear}} {{editionnum(edition.version, edition.editionnum, true)}}</figcaption> | |
| <a href=" {{url_for('edition', editionid=edition.id)}}"> | |
| <img class="img-fluid" src="{{edition.images[0].image_src}}" alt="{{editionnum(edition.version, | |
| edition.editionnum, true)}}"> | |
| </a> | |
| </figure> | |
| {% endif %} | |
| {% endfor %} | |
| {% endif %} | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% if series %} | |
| <div class="card"> | |
| <div class="card-header" id="headSeries"> | |
| <h2 class="mb-0"> | |
| <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" | |
| data-target="#series" aria-expanded="false" aria-controls="series"> | |
| Sarjat | |
| </button> | |
| </h2> | |
| </div> | |
| </div> | |
| <div id="series" class="collapse" aria-labelledby="headSeries" data-parent="#authorCard"> | |
| <div class="card-body"> | |
| {% for s in series %} | |
| <div class="mt-4"> | |
| <h4 class="mb-1"> | |
| <a href="{{ url_for('bookseries', seriesid=s.id)}}"> | |
| {{s.name }}</a> | |
| </h4> | |
| <br /> | |
| {% for work in s.works %} | |
| {% if work.author_str != person.name %} | |
| {{ work.author_str }}: | |
| {% endif %} | |
| {% include "_work.html" %} | |
| {% endfor %} | |
| </div> | |
| {% endfor %} | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% if stories %} | |
| <div class="card"> | |
| <div class="card-header" id="headAuthoredStories"> | |
| <h2 class="mb-0"> | |
| <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" | |
| data-target="#authoredStories" aria-expanded="false" aria-controls="authoredStories"> | |
| Novellit, raapaleet, runot, filk-laulut ym. | |
| </button> | |
| </h2> | |
| </div> | |
| <div id="authoredStories" class="collapse" aria-labelledby="headAuthoredStories" data-parent="#authorCard"> | |
| <div class="card-body"> | |
| {% if stories %} | |
| {{ print_story_type("Novellit", 1, stories, person) }} | |
| {{ print_story_type("Pitkät novellit", 2, stories, person) }} | |
| {{ print_story_type("Pienoisromaanit", 3, stories, person) }} | |
| {{ print_story_type("Runot", 4, stories, person) }} | |
| {{ print_story_type("Raapaleet", 5, stories, person) }} | |
| {{ print_story_type("Filk-laulut", 6, stories, person) }} | |
| {{ print_story_type("Esipuheet", 8, stories, person) }} | |
| {{ print_story_type("Jälkisanat", 9, stories, person) }} | |
| {% endif %} | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% if person.translations|length or | |
| person.translated_stories|length%} | |
| <div class="card"> | |
| <div class="card-header" id="headTranslated"> | |
| <h2 class="mb-0"> | |
| <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" | |
| data-target="#translated" aria-expanded="false" aria-controls="translated"> | |
| Kääntänyt | |
| </button> | |
| </h2> | |
| </div> | |
| <div id="translated" class="collapse" aria-labelledby="headTranslated" data-parent="#authorCard"> | |
| <div class="card-body"> | |
| {% set skip_pubseriesnum = 1 %} | |
| {% if person.translations %} | |
| <h4>Romaanit</h4> | |
| {% for edition in person.translations|sort(attribute='title') %} | |
| <div class="mb-2">{% include "_edition.html" %}</div> | |
| {% endfor %} | |
| {% endif %} | |
| {% if person.translated_stories %} | |
| <h4 style="margin-top: 1rem">Novellit</h4> | |
| {% for story in person.translated_stories|sort(attribute='title') %} | |
| <div class="mb-2"> | |
| <a href="{{ url_for('story', id=story.id)}}">{{ story.title }}</a> | |
| ({{story.orig_title}}, {{story.pubyear}}) | |
| </div> | |
| {% endfor %} | |
| {% endif %} | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% if person.articles|length %} | |
| <div class="card"> | |
| <div class="card-header" id="headArticles"> | |
| <h2 class="mb-0"> | |
| <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" | |
| data-target="#articles" aria-expanded="false" aria-controls="appearsin"> | |
| Artikkelit | |
| </button> | |
| </h2> | |
| </div> | |
| <div id="articles" class="collapse" aria-labelledby="headArticles" data-parent="#authorCard"> | |
| <div class="card-body"> | |
| <ul class="list-group list-group-flush"> | |
| <div class="mt-2"> | |
| <h4 class="mb-0">Artikkelit lehdissä</h4> | |
| {% for article in person.articles|selectattr("author_str", "equalto", person.name) %} | |
| {{ print_article_long(article) }} | |
| {% endfor %} | |
| {% for a_group in person.articles|selectattr("author_str", "ne", | |
| person.name)|groupby(attribute="author_str") %} | |
| <h5 class="mb-0">Artikkelit lehdissä: {{a_group.grouper}}</h4> | |
| {% for article in a_group.list %} | |
| {{ print_article_long(article)}} | |
| {% endfor %} | |
| {% endfor %} | |
| </div> | |
| {{ print_story_type("Artikkelit kirjoissa", 7, stories, person) }} | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% if person.appears_in|length %} | |
| <div class="card"> | |
| <div class="card-header" id="headAppearsIn"> | |
| <h2 class="mb-0"> | |
| <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" | |
| data-target="#appearsin" aria-expanded="false" aria-controls="appearsin"> | |
| Esiintynyt artikkeleissa | |
| </button> | |
| </h2> | |
| </div> | |
| <div id="appearsin" class="collapse" aria-labelledby="headAppearsIn" data-parent="#authorCard"> | |
| <div class="card-body"> | |
| <ul class="list-group list-group-flush"> | |
| {% for article in person.appears_in %} | |
| <li class="list-group list-group-flush "> | |
| <span class="nowrap"> | |
| <b><a href="{{url_for('issue', id=article.issue.id)}}">{{ article.issue.magazine.name }} {% if | |
| article.issue.number -%} {{ article.issue.number }} / | |
| {{ article.issue.year }} {%- else -%} {{ article.issue.count | |
| }} {%- endif -%}</a></b> | |
| {% if article.author_str != ''%} <span class="person-list">{{ article.author_str }}</span>:{% | |
| endif %} {{ article.title }}. | |
| </span> | |
| </li> | |
| {% endfor %} | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% if person.chief_editor|length %} | |
| <div class="card"> | |
| <div class="card-header" id="headChiefEditor"> | |
| <h2 class="mb-0"> | |
| <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" | |
| data-target="#chiefeditor" aria-expanded="false" aria-controls="appearsin"> | |
| Päätoimittajana | |
| </button> | |
| </h2> | |
| </div> | |
| <div id="chiefeditor" class="collapse" aria-labelledby="headChiefEditor" data-parent="#authorCard"> | |
| <div class="card-body"> | |
| <ul class="list-group list-group-flush"> | |
| {% for issue in person.chief_editor %} | |
| <li class="list-group list-group-flush"> | |
| <a href="{{ url_for('issue', id=issue.id)}}"> | |
| {{ issue.magazine.name }} {% if issue.number %} {{ | |
| issue.number }} / {{ issue.year }} {% else %} {{ issue.count | |
| }} {% endif %}</a> | |
| </li> | |
| {% endfor %} | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| </div> | |
| </div> | |
| {% if current_user.is_admin and person.imported_string %} | |
| Lähde: {{person.imported_string }} | |
| {% endif %} | |
| {% from 'modals.html' import award_modal as awards %} | |
| {{ awards(award_list, award_categories) }} | |
| {% block script %} | |
| <script src="/static/js/personlink.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| var itemId = '{{person.id}}' | |
| </script> | |
| <script src="/static/js/forms.js" type="text/javascript"></script> | |
| <script src="/static/js/popups.js" type="text/javascript"></script> | |
| <script> | |
| var tooltipTriggerList = [].slice.call( | |
| document.querySelectorAll('[data-bs-toggle="tooltip"]') | |
| ); | |
| var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { | |
| console.log("tooltip"); | |
| return new bootstrap.Tooltip(tooltipTriggerEl); | |
| }); | |
| $(".ownerstate").click(function () { | |
| var obj = $("#SelectElementId"); | |
| var addr = $(this).attr("href"); | |
| if (addr == "#remove") { | |
| $(this).parent().attr("style", "padding-left: 25px;"); | |
| $(this).attr("href", "#add"); | |
| $(this).text(" + "); | |
| var request = $.ajax({ | |
| type: "POST", | |
| url: "/remove_from_owned/" + $(this).attr("id"), | |
| }); | |
| } else if (addr == "#add") { | |
| $(this) | |
| .parent() | |
| .attr("style", "border-left: 6px solid grey; padding-left: 23px"); | |
| $(this).attr("href", "#remove"); | |
| $(this).text(" - "); | |
| var request = $.ajax({ | |
| type: "POST", | |
| url: "/add_to_owned/" + $(this).attr("id"), | |
| }); | |
| } | |
| return false; | |
| }); | |
| </script> | |
| <script src="/static/js/ownership.js" type="text/javascript"></script> | |
| <script> | |
| $(document).ready(function () { | |
| $(".btnRemove").on("click", function (e) { | |
| e.preventDefault(); | |
| var curr = $(this); | |
| if (confirm("Oletko varma?")) { | |
| img_src = $(this).data("replace"); | |
| $.ajax({ | |
| type: "POST", | |
| dataType: "json", | |
| url: $(this).data("save"), | |
| data: { | |
| itemId: JSON.stringify(itemId), | |
| }, | |
| success: (data) => { | |
| $("#image").attr("src", img_src); | |
| }, | |
| }); | |
| } | |
| }); | |
| }); | |
| </script> | |
| <script> | |
| $('[data-toggle="popover"]').popover({ | |
| html: true, | |
| trigger: 'hover', | |
| placement: 'right', | |
| container: 'body' | |
| }); | |
| document.addEventListener("DOMContentLoaded", function () { | |
| if (!!document.getElementById("pics") === false) { | |
| return; | |
| } | |
| document.getElementById("pics").style.display = "none"; | |
| }); | |
| </script> | |
| <script> | |
| function switchStyle() { | |
| if (!!document.getElementById("pics") === false) { | |
| return; | |
| } | |
| var pics = document.getElementById("pics"); | |
| var txt = document.getElementById("textual"); | |
| if (pics.style.display == "none") { | |
| pics.style.display = "block"; | |
| txt.style.display = "none"; | |
| document.getElementById("switcher").textContent = "Lista"; | |
| } else { | |
| pics.style.display = "none"; | |
| txt.style.display = "block"; | |
| document.getElementById("switcher").textContent = "Kannet"; | |
| } | |
| } | |
| </script> | |
| <script> | |
| </script> | |
| <script src="/static/js/dynamic_fields.js" type="text/javascript"></script> | |
| {% endblock %} | |
| {% endblock %} |