[Notice] Announcing the End of Demo Server [Read me]
my-files: Show link of attachments belongs
@6fca5f0ac5447958683fac0ce16d627f105446e2
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
... | ... | @@ -6554,7 +6554,7 @@ |
6554 | 6554 |
margin-left: auto; |
6555 | 6555 |
img { |
6556 | 6556 |
border: 1px solid #333; |
6557 |
- max-width: 140px; |
|
6557 |
+ max-width: 70px; |
|
6558 | 6558 |
box-sizing: border-box; |
6559 | 6559 |
} |
6560 | 6560 |
} |
... | ... | @@ -6576,7 +6576,10 @@ |
6576 | 6576 |
} |
6577 | 6577 |
|
6578 | 6578 |
.file-location { |
6579 |
- text-align: center; |
|
6579 |
+ text-align: left; |
|
6580 |
+ overflow: hidden; |
|
6581 |
+ text-overflow: ellipsis; |
|
6582 |
+ white-space: nowrap; |
|
6580 | 6583 |
} |
6581 | 6584 |
} |
6582 | 6585 |
.hover { |
--- app/assets/stylesheets/less/_reponsive.less
+++ app/assets/stylesheets/less/_reponsive.less
... | ... | @@ -398,6 +398,7 @@ |
398 | 398 |
|
399 | 399 |
@media all and (max-width:1199px){ |
400 | 400 |
.attachment-files { |
401 |
+ font-size: 12px; |
|
401 | 402 |
.attachment-files-header { |
402 | 403 |
.header-file-name { |
403 | 404 |
max-width: 200px; |
... | ... | @@ -414,6 +415,10 @@ |
414 | 415 |
} |
415 | 416 |
.file-size { |
416 | 417 |
max-width: 80px; |
418 |
+ font-size: 12px; |
|
419 |
+ } |
|
420 |
+ .file-location { |
|
421 |
+ font-size: 12px; |
|
417 | 422 |
} |
418 | 423 |
} |
419 | 424 |
} |
--- app/utils/RouteUtil.java
+++ app/utils/RouteUtil.java
... | ... | @@ -38,8 +38,10 @@ |
38 | 38 |
public static final DiffRenderer$ diffRenderer = new DiffRenderer$(); |
39 | 39 |
|
40 | 40 |
public static String getUrl(ResourceType resourceType, String resourceId) { |
41 |
- Long longId = Long.valueOf(resourceId); |
|
41 |
+ return getUrl(resourceType, Long.valueOf(resourceId)); |
|
42 |
+ } |
|
42 | 43 |
|
44 |
+ public static String getUrl(ResourceType resourceType, Long longId) { |
|
43 | 45 |
try { |
44 | 46 |
switch(resourceType) { |
45 | 47 |
case ISSUE_POST: |
--- app/views/user/userFiles.scala.html
+++ app/views/user/userFiles.scala.html
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 |
|
10 | 10 |
@import utils.JodaDateUtil._ |
11 | 11 |
@import utils.FileUtil._ |
12 |
+@import utils.RouteUtil._ |
|
12 | 13 |
|
13 | 14 |
@preview(attachment: Attachment) = @{ |
14 | 15 |
var previewFile = "" |
... | ... | @@ -16,6 +17,15 @@ |
16 | 17 |
previewFile = "<img src='" + routes.AttachmentApp.getFile(attachment.id).toString + "'>"; |
17 | 18 |
} |
18 | 19 |
Html(previewFile) |
20 |
+} |
|
21 |
+ |
|
22 |
+@link(attachment: Attachment) = @{ |
|
23 |
+ val url = getUrl(attachment.containerType, attachment.containerId) |
|
24 |
+ if(url != null){ |
|
25 |
+ Html("<a href='" + url + "' target='_blank'>" + url + "</a>") |
|
26 |
+ } else { |
|
27 |
+ "" |
|
28 |
+ } |
|
19 | 29 |
} |
20 | 30 |
|
21 | 31 |
@siteLayout(utils.Config.getSiteName, SITE_HOME) { |
... | ... | @@ -34,21 +44,21 @@ |
34 | 44 |
</form> |
35 | 45 |
<div class="attachment-files"> |
36 | 46 |
<div class="attachment-files-header row"> |
37 |
- <div class="span2 header-preview">Preview</div> |
|
47 |
+ <div class="span1 header-preview">Preview</div> |
|
38 | 48 |
<div class="span4 header-file-name">Filename</div> |
39 | 49 |
<div class="span2 header-size">Size</div> |
40 |
- <div class="span2">Download</div> |
|
50 |
+ <div class="span1">Download</div> |
|
41 | 51 |
<div class="span2 file-date">Date</div> |
42 |
- <div class="span1 header-location">Location</div> |
|
52 |
+ <div class="span4 header-location">Location</div> |
|
43 | 53 |
</div> |
44 | 54 |
@for(attachment <- currentPage.getList){ |
45 | 55 |
<div class="attachment-file-detail row"> |
46 |
- <div class="file-preview span2"><a href="@routes.AttachmentApp.getFile(attachment.id)" target="_blank">@preview(attachment)</a></div> |
|
56 |
+ <div class="file-preview span1"><a href="@routes.AttachmentApp.getFile(attachment.id)" target="_blank">@preview(attachment)</a></div> |
|
47 | 57 |
<div class="span4 file-name"><a href="@routes.AttachmentApp.getFile(attachment.id)" target="_blank"><i class="icon text-icon"></i>@attachment.name</a></div> |
48 | 58 |
<div class="span2 file-size">@humanReadableByteCount(attachment.size, true)</div> |
49 |
- <div class="span2 file-download"><a href="@routes.AttachmentApp.getFile(attachment.id)?action=download"><button type="button" class="ybtn"><i class="yobicon-cloud-download"></i></button> </a></div> |
|
59 |
+ <div class="span1 file-download"><a href="@routes.AttachmentApp.getFile(attachment.id)?action=download"><button type="button" class="ybtn"><i class="yobicon-cloud-download"></i></button> </a></div> |
|
50 | 60 |
<div class="span2 file-date">@socialDate(attachment.createdDate)</div> |
51 |
- <div class="span1 file-location">location</div> |
|
61 |
+ <div class="span4 file-location">@link(attachment)</div> |
|
52 | 62 |
</div> |
53 | 63 |
} |
54 | 64 |
</div> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?