diff --git a/beat/web/reports/templates/reports/report.html b/beat/web/reports/templates/reports/report.html index 69b8accde57208a9914d609a6e6f401bb58c95a5..2206a2548c350ff6146981436b77b718b9dac987 100644 --- a/beat/web/reports/templates/reports/report.html +++ b/beat/web/reports/templates/reports/report.html @@ -133,64 +133,62 @@ {% block content %} -{% if author %} -<div class="col-sm-12" ng-app="reportApp" ng-controller="reportController" ng-init="init('{{ author }}', '{{report_name}}', '{{ URL_PREFIX }}')"></div> -{% endif %} -{% if report_number %} -<div class="col-sm-12" ng-app="reportApp" ng-controller="reportController" ng-init="initWithReportNumber('{{report_number}}', '{{ URL_PREFIX }}')"></div> - -{% endif %} -{% csrf_token %} - -{% if report %} -<div id="title" class="row"> - <div class="{% if owner %}col-sm-9 vertical-center{% else %}col-sm-12{% endif %}"{% if owner %} onmouseover="expand_breadcrumb(this, 9, 3);" onmouseout="reset_breadcrumb(this, 9, 3);"{% endif %}> - {% report_breadcrumb report %} - <!-- Note: keep no space between divs here! --> - </div>{% if owner %}<div class="col-sm-3 vertical-center"> - {% report_actions report False %} - </div>{% endif %} +<div ng-app="reportApp" ng-controller="reportController" + {% if author and not report_number %}ng-init="init('{{ author }}', '{{report_name}}', '{{ URL_PREFIX }}')"{% endif %} + {% if report_number and not author %}ng-init="initWithReportNumber('{{report_number}}', '{{ URL_PREFIX }}')"{% endif %} + > + {% csrf_token %} + + {% if report %} + <div id="title" class="row"> + <div class="{% if owner %}col-sm-9 vertical-center{% else %}col-sm-12{% endif %}"{% if owner %} onmouseover="expand_breadcrumb(this, 9, 3);" onmouseout="reset_breadcrumb(this, 9, 3);"{% endif %}> + {% report_breadcrumb report %} + <!-- Note: keep no space between divs here! --> + </div>{% if owner %}<div class="col-sm-3 vertical-center"> + {% report_actions report False %} + </div>{% endif %} -</div> + </div> -{% with report.get_status_display as status %} -<div class="row"> - <div class="col-sm-12"> - - <p class="bs-callout bs-callout-{% if status == 'Editable' %}danger{% elif status == 'Locked' %}warning{% else %}info{% endif %}"> - - {% if report.short_description %} - <i class="fa fa-file-text"></i> {{ report.short_description }}<br/> - {% endif %} - - {% ifequal request.user.username author %} - <i class="fa fa-arrow-circle-right"></i> Unique report id: <a href="{{ report.get_absolute_url }}" title="Use this link on your report or to share access with users and reviewers" data-toggle="tooltip" data-placement="top">{{ report.number }}</a> <span class="help">(follow link to see review/publication URL.)</span><br/> - {% endifequal %} - - {% if report.publication_date %} - <i class="fa fa-calendar-o"></i> Published: <strong>{{ report.publication_date|naturaltime }}</strong><br/> - {% else %} - <i class="fa fa-calendar-o"></i> Created: <strong>{{ report.creation_date|naturaltime }}</strong><br/> - {% endif %} - {% if report.last_edited_date != None and not report.publication_date %} - <i class="fa fa-calendar-o"></i> Last Edited: <strong>{{ report.last_edited_date|naturaltime }}</strong><br/> - {% endif %} - - {% if status == 'Editable' %} - <i class="fa fa-warning"></i> This report is <strong class="text-danger">{{ status }}</strong> (it may change in time)<br/> - {% elif status == 'Locked' %} - <i class="fa fa-warning"></i> This report is <strong class="text-warning">{{ status }}</strong> (not yet published)<br/> - <i class="fa fa-calendar-o"></i> Expires in <strong>{{ report.expiration_date|naturaltime }}</strong>, on {{ report.expiration_date }} (publish it to make it permanent)<br/> - {% endif %} - - </p> + {% with report.get_status_display as status %} + <div class="row"> + <div class="col-sm-12"> + + <p class="bs-callout bs-callout-{% if status == 'Editable' %}danger{% elif status == 'Locked' %}warning{% else %}info{% endif %}"> + + {% if report.short_description %} + <i class="fa fa-file-text"></i> {{ report.short_description }}<br/> + {% endif %} + + {% ifequal request.user.username author %} + <i class="fa fa-arrow-circle-right"></i> Unique report id: <a href="{{ report.get_absolute_url }}" title="Use this link on your report or to share access with users and reviewers" data-toggle="tooltip" data-placement="top">{{ report.number }}</a> <span class="help">(follow link to see review/publication URL.)</span><br/> + {% endifequal %} + + {% if report.publication_date %} + <i class="fa fa-calendar-o"></i> Published: <strong>{{ report.publication_date|naturaltime }}</strong><br/> + {% else %} + <i class="fa fa-calendar-o"></i> Created: <strong>{{ report.creation_date|naturaltime }}</strong><br/> + {% endif %} + {% if report.last_edited_date != None and not report.publication_date %} + <i class="fa fa-calendar-o"></i> Last Edited: <strong>{{ report.last_edited_date|naturaltime }}</strong><br/> + {% endif %} + + {% if status == 'Editable' %} + <i class="fa fa-warning"></i> This report is <strong class="text-danger">{{ status }}</strong> (it may change in time)<br/> + {% elif status == 'Locked' %} + <i class="fa fa-warning"></i> This report is <strong class="text-warning">{{ status }}</strong> (not yet published)<br/> + <i class="fa fa-calendar-o"></i> Expires in <strong>{{ report.expiration_date|naturaltime }}</strong>, on {{ report.expiration_date }} (publish it to make it permanent)<br/> + {% endif %} + + </p> + </div> </div> -</div> -{% endwith %} + {% endwith %} -{% report_viewer report owner report_number %} + {% report_viewer report owner report_number %} +</div> {% endif %} {% list_selector "list_selector" %}