From 83666be910a4fe6a2da87fce16581d92240979fc Mon Sep 17 00:00:00 2001 From: James Allen Date: Wed, 2 Jul 2014 11:06:20 +0100 Subject: [PATCH] Disabled pdf download if not available --- .../app/views/project/editor/left-menu.jade | 19 +++++++++++++++++-- .../stylesheets/app/editor/left-menu.less | 9 ++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/services/web/app/views/project/editor/left-menu.jade b/services/web/app/views/project/editor/left-menu.jade index 717d6d9287..f4e9a23179 100644 --- a/services/web/app/views/project/editor/left-menu.jade +++ b/services/web/app/views/project/editor/left-menu.jade @@ -6,12 +6,27 @@ aside#left-menu.full-size( ul.unformatted-list.nav.nav-downloads li - a(ng-href="/project/{{project_id}}/download/zip") + a( + ng-href="/project/{{project_id}}/download/zip" + target="_blank" + ) i.fa.fa-file-archive-o.fa-2x br | Source li - a(ng-href="/project/{{project_id}}/output/output.pdf") + a( + ng-href="/project/{{project_id}}/{{pdf.url}}" + target="_blank" + ng-if="pdf.url" + ) + i.fa.fa-file-pdf-o.fa-2x + br + | PDF + div.pdf-disabled( + ng-if="!pdf.url" + tooltip="Please compile your project before downloading the PDF" + tooltip-placement="bottom" + ) i.fa.fa-file-pdf-o.fa-2x br | PDF diff --git a/services/web/public/stylesheets/app/editor/left-menu.less b/services/web/public/stylesheets/app/editor/left-menu.less index 7d90ebedba..41959e0cfc 100644 --- a/services/web/public/stylesheets/app/editor/left-menu.less +++ b/services/web/public/stylesheets/app/editor/left-menu.less @@ -42,9 +42,12 @@ background-color: @link-color; color: white; } - i { - margin-bottom: (@line-height-computed / 4); - } + } + .pdf-disabled { + color: @gray-light; + } + i { + margin-bottom: (@line-height-computed / 4); } } }