Merge pull request #873 from getredash/feature/print_layout

Feature: print layout for dashboards
This commit is contained in:
Arik Fraimovich 2016-02-29 21:11:41 +02:00
commit 43ac5600e5
4 changed files with 24 additions and 5 deletions

View File

@ -132,7 +132,11 @@
</div>
{% raw %}
<div class="container-fluid footer">
<div class="visible-print">
<hr>
Source: {{location}}
</div>
<div class="container-fluid footer hidden-print">
<hr/>
<div class="container">
<div class="row">

View File

@ -163,6 +163,7 @@
}
});
$scope.location = String(document.location);
$scope.version = clientConfig.version;
$scope.newVersionAvailable = clientConfig.newVersionAvailable && currentUser.hasPermission("admin");

View File

@ -69,6 +69,12 @@ angular.module('redash.filters', []).
}
})
.filter('dateTime', function() {
return function(value) {
return moment(value).format(clientConfig.dateTimeFormat);
}
})
.filter('linkify', function () {
return function (text) {
return text.replace(urlPattern, "$1<a href='$2' target='_blank'>$2</a>");

View File

@ -6,7 +6,7 @@
<h2 id="dashboard_title">
{{dashboard.name}}
<span ng-if="!dashboard.is_archived">
<span ng-if="!dashboard.is_archived" class="hidden-print">
<button type="button" class="btn btn-default btn-xs" ng-class="{active: refreshEnabled}" tooltip="Enable/Disable Auto Refresh" ng-click="triggerRefresh()"><span class="glyphicon glyphicon-refresh"></span></button>
<button type="button" class="btn btn-default btn-xs" ng-class="{active: isFullscreen}" tooltip="Enable/Disable Fullscreen display" ng-click="toggleFullscreen()"><span class="glyphicon glyphicon-picture"></span></button>
<div class="btn-group" role="group" ng-show="dashboard.canEdit()">
@ -29,11 +29,15 @@
<div class="panel panel-default" ng-if="type=='visualization'">
<div class="panel-heading">
<h3 class="panel-title">
<p>
<p class="hidden-print">
<span ng-hide="currentUser.hasPermission('view_query')">{{query.name}}</span>
<query-link query="query" visualization="widget.visualization" ng-show="currentUser.hasPermission('view_query')"></query-link>
<visualization-name visualization="widget.visualization"/>
</p>
<p class="visible-print">
{{query.name}}
<visualization-name visualization="widget.visualization"/>
</p>
<div class="text-muted" ng-bind-html="query.description | markdown"></div>
</h3>
</div>
@ -41,11 +45,15 @@
<visualization-renderer visualization="widget.visualization" query-result="queryResult"></visualization-renderer class="panel-body">
<div class="panel-footer">
<span class="label label-default"
<span class="label label-default hidden-print"
tooltip="(query runtime: {{queryResult.getRuntime() | durationHumanize}})"
tooltip-placement="bottom">Updated: <span am-time-ago="queryResult.getUpdatedAt()"></span></span>
<span class="pull-right">
<span class="visible-print">
Updated: {{queryResult.getUpdatedAt() | dateTime}}
</span>
<span class="pull-right hidden-print">
<div class="btn-group">
<a class="btn btn-default btn-xs" ng-disabled="!queryResult.getData()" query-result-link target="_self" title="Download as CSV File">