allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [5/5] allura git commit: [#6299] make attachments with thumbnails look better
Date Fri, 05 Oct 2018 21:26:08 GMT
[#6299] make attachments with thumbnails look better


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5ab6a82d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5ab6a82d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5ab6a82d

Branch: refs/heads/db/6299
Commit: 5ab6a82dddea9261a94a48673689839d102b2e8d
Parents: b57b458
Author: Dave Brondsema <dave@brondsema.net>
Authored: Fri Oct 5 13:47:00 2018 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Oct 5 17:25:54 2018 -0400

----------------------------------------------------------------------
 Allura/allura/nf/allura/css/site_style.css           | 7 +++----
 Allura/allura/templates/widgets/attachment_list.html | 3 ++-
 Allura/allura/templates/widgets/post_widget.html     | 2 +-
 ForgeBlog/forgeblog/model/blog.py                    | 1 +
 ForgeWiki/forgewiki/model/wiki.py                    | 1 +
 ForgeWiki/forgewiki/tests/functional/test_root.py    | 2 +-
 6 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/5ab6a82d/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index 0fb43fe..1bf5e37 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -2292,8 +2292,10 @@ div.attachment_thumb .file {
     top: 0;
     right: -40px;
 }
-div.attachment_thumb .file_type {
+div.attachment_thumb img {
   border: 1px solid #ccc;
+}
+div.attachment_thumb .file_type {
   display: block;
   height: 100px;
   width: 100px;
@@ -2303,9 +2305,6 @@ div.attachment_thumb .file_type {
   font-weight: bold;
   font-size: 1.2em;
   margin-bottom: .5em;
-  background: #ccc;
-  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, to(#cccccc), from(white));
-  background-image: -moz-linear-gradient(100% 100% 90deg, #cccccc, white 100%);
 }
 div.attachment_thumb .file_type span {
   display: block;

http://git-wip-us.apache.org/repos/asf/allura/blob/5ab6a82d/Allura/allura/templates/widgets/attachment_list.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/attachment_list.html b/Allura/allura/templates/widgets/attachment_list.html
index c553dd7..f924b42 100644
--- a/Allura/allura/templates/widgets/attachment_list.html
+++ b/Allura/allura/templates/widgets/attachment_list.html
@@ -26,8 +26,9 @@
           <div class="attachment_thumb">
             <a href="{{att.url()}}">
               <img src="{{att.url()}}/thumb" alt="Thumbnail"/>
-            </a><br/>
+            <br/>
             {{att.filename}}
+            </a>
             {% if edit_mode %}
             <form method="post" action="{{att.url()}}" onsubmit="{{onsubmit}}">
               <input type="hidden" name="delete" value="True"/>

http://git-wip-us.apache.org/repos/asf/allura/blob/5ab6a82d/Allura/allura/templates/widgets/post_widget.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/post_widget.html b/Allura/allura/templates/widgets/post_widget.html
index 657d01c..f98aafa 100644
--- a/Allura/allura/templates/widgets/post_widget.html
+++ b/Allura/allura/templates/widgets/post_widget.html
@@ -116,7 +116,7 @@
                  <div class="attachment_toolbar">
                     <form method="POST" action="{{att.url()}}">
                         {% if h.has_access(value, 'moderate')()%}
-                            <a href="javascript: void(0)"  onclick="$(this).closest('form').submit();"
title="Remove Attachment"" class="btn ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
+                            <a href="javascript: void(0)"  onclick="$(this).closest('form').submit();"
title="Remove Attachment" class="btn ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
                                 <span><i class="fa fa-trash-o" aria-hidden="true"></i></span>
                             </a>
                         {% endif %}

http://git-wip-us.apache.org/repos/asf/allura/blob/5ab6a82d/ForgeBlog/forgeblog/model/blog.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/model/blog.py b/ForgeBlog/forgeblog/model/blog.py
index baa4520..f20b228 100644
--- a/ForgeBlog/forgeblog/model/blog.py
+++ b/ForgeBlog/forgeblog/model/blog.py
@@ -328,6 +328,7 @@ class BlogPost(M.VersionedArtifact, ActivityObject):
 
 class BlogAttachment(M.BaseAttachment):
     ArtifactType = BlogPost
+    thumbnail_size = (100, 100)
 
     class __mongometa__:
         polymorphic_identity = 'BlogAttachment'

http://git-wip-us.apache.org/repos/asf/allura/blob/5ab6a82d/ForgeWiki/forgewiki/model/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/model/wiki.py b/ForgeWiki/forgewiki/model/wiki.py
index 1cf165b..bb9f452 100644
--- a/ForgeWiki/forgewiki/model/wiki.py
+++ b/ForgeWiki/forgewiki/model/wiki.py
@@ -281,6 +281,7 @@ class Page(VersionedArtifact, ActivityObject):
 
 class WikiAttachment(BaseAttachment):
     ArtifactType = Page
+    thumbnail_size = (100, 100)
 
     class __mongometa__:
         polymorphic_identity = 'WikiAttachment'

http://git-wip-us.apache.org/repos/asf/allura/blob/5ab6a82d/ForgeWiki/forgewiki/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py
index b157e30..98533eb 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -508,7 +508,7 @@ class TestRootController(TestController):
         r = self.app.get('/wiki/TEST/attachment/' + filename + '/thumb')
 
         thumbnail = PIL.Image.open(StringIO.StringIO(r.body))
-        assert thumbnail.size == (255, 255)
+        assert thumbnail.size == (100, 100)
 
         # Make sure thumbnail is absent
         r = self.app.get('/wiki/TEST/')


Mime
View raw message