Browse Source

Disabled pdf download if not available

James Allen 12 years ago
parent
commit
83666be910

+ 17 - 2
services/web/app/views/project/editor/left-menu.jade

@@ -6,12 +6,27 @@ aside#left-menu.full-size(
 
 
 	ul.unformatted-list.nav.nav-downloads
 	ul.unformatted-list.nav.nav-downloads
 		li
 		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
 				i.fa.fa-file-archive-o.fa-2x
 				br
 				br
 				| Source
 				| Source
 		li
 		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
 				i.fa.fa-file-pdf-o.fa-2x
 				br
 				br
 				| PDF
 				| PDF

+ 6 - 3
services/web/public/stylesheets/app/editor/left-menu.less

@@ -42,9 +42,12 @@
 					background-color: @link-color;
 					background-color: @link-color;
 					color: white;
 					color: white;
 				}
 				}
-				i {
-					margin-bottom: (@line-height-computed / 4);
-				}
+			}
+			.pdf-disabled {
+				color: @gray-light;
+			}
+			i {
+				margin-bottom: (@line-height-computed / 4);
 			}
 			}
 		}
 		}
 	}
 	}