Page MenuHomec4science

notes_fragment.html
No OneTemporary

File Metadata

Created
Mon, Jul 28, 12:19

notes_fragment.html

{#
## This file is part of Invenio.
## Copyright (C) 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#}
{%- macro show_notes(current_user, recid, notes, note_is_collapsed, wash_html_id, get_note_title, get_original_comment) -%}
{%- if notes -%}
<ul class="comments list-unstyled">
{%- for key, value in notes.iteritems() recursive -%}
{%- if key == "leaf" -%}
{%- for n in value -%}
<li name="{{ n.id }}">
<h4>
<small>
<a class="pull-right" title="{{ _('Permalink to this note') }}" href="#{{ n.id }}"></a>
</small>
</h4>
<blockquote>
<p style="font-size:90%;">
{{ n["what"]|quoted_txt2html(indent_html=('<span style="border-left: 3px solid #CCC; padding-left:5px;">',
'</span>'))|safe }}
</p>
<small>
{%- set parent = get_original_comment(n) -%}
{%- if parent.user -%}
<img src="{{ parent.user.email|gravatar(size=14, default=url_for('static', filename='img/user-icon-1-16x16.gif', _external=True)) }}" alt="avatar"/>
<a href="{{ url_for('webmessage.add', sent_to_user_nicks=parent.user.nickname) }}">
{{ parent.user.nickname }}
</a>
{%- else -%}
<img src="/img/user-icon-1-16x16.gif" alt="avatar"/>
{{ _('Guest') }}
{%- endif -%}
&nbsp;
-
<i class="icon-time"></i>
{{ parent.date_creation }}
-
{%- if current_user.is_guest -%}
<a href="{{ url_for('webaccount.login', referer=url_for('comments.add_comment', recid=recid, in_reply=parent.id)) }}">
{%- else -%}
<a data-toggle="modal"
href="{{ url_for('comments.add_comment', recid=recid, in_reply=parent.id) }}"
data-filter="annoreply"
data-target="#"
onclick="PDF_NOTES_HELPER.fillCommentsTextArea();">
{%- endif -%}
{{ _(' reply to original comment') }}
</a>
</small>
</blockquote>
</li>
{%- endfor -%} {# for n in value #}
{%- else -%}
{%- if key != 'path' -%}
<a class="collapse-comment
pull-left{{ ' collapsed' if note_is_collapsed(recid, value['path']) }}"
style="margin-right: 5px;"
data-toggle="collapse"
data-target="#collapse-{{ wash_html_id(value['path']) }}">
{%- if note_is_collapsed(recid, value['path']) -%}
<i class="glyphicon glyphicon-chevron-right"></i>
{%- else -%}
<i class="glyphicon glyphicon-chevron-down"></i>
{%- endif -%}
</a>
<h4>
{{ _('Annotations on') }} {{ get_note_title(key) }}
</h4>
<div id="collapse-{{ wash_html_id(value['path']) }}"
data-action="{{ url_for('comments.notes_toggle', recid=recid, path=value['path']) }}"
class="collapse{{ ' in' if not note_is_collapsed(recid, value['path']) }}">
<ul class="list-unstyled" style="padding-left: 10px;">
{{ loop(value.items()) }}
</ul>
</div>
{%- endif -%}
{%- endif -%}
{%- endfor -%} {# for key, value in notes.iteritems() recursive #}
</ul> <!-- /comments -->
{#{ super() }#} {# bottom 'write' comment from base #}
{%- else -%}
<div class="alert alert-info">
{%- if config.ANNOTATIONS_PREVIEW_ENABLED -%}
{{ _('There are no notes on the current selection.') }}
{%- else -%}
{{ _('There are no notes. Be the first commenting this record.') }}
{%- endif -%}
</div>
{%- endif -%}
{%- endmacro -%}
{{ show_notes(current_user, recid, notes, note_is_collapsed, wash_html_id, get_note_title, get_original_comment) }}

Event Timeline