Просмотр исходного кода

HUE-166. Add a "Download Files" button to File Browser main window

Using the same icon as the File Viewer does, this adds a download
link for files in the right-click menu.
Philip Zeyliger 15 лет назад
Родитель
Сommit
b24dc01056

+ 4 - 0
apps/filebrowser/src/filebrowser/static/css/fb.css

@@ -107,6 +107,10 @@ div.filebrowser .fb-mkdir {
 	background: url(/static/art/icons/page_white_edit.png) no-repeat 1px 1px !important;
 	background: url(/static/art/icons/page_white_edit.png) no-repeat 1px 1px !important;
 }
 }
 
 
+.filebrowser .fb-item-actions a.fb-downloadfile {
+	background: url(/static/art/icons/page_white_put.png) no-repeat 1px 1px !important;
+}
+
 .filebrowser .context-menu {
 .filebrowser .context-menu {
 	border-radius: 2px;
 	border-radius: 2px;
 	-moz-border-radius: 2px;
 	-moz-border-radius: 2px;

+ 1 - 0
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -90,6 +90,7 @@ from django.template.defaultfilters import urlencode, stringformat, filesizeform
                   % else:
                   % else:
                     <li><a class="fb-viewfile" href="${url('filebrowser.views.view', path=path_enc)}" target="FileViewer">View File</a></li>
                     <li><a class="fb-viewfile" href="${url('filebrowser.views.view', path=path_enc)}" target="FileViewer">View File</a></li>
                     <li><a class="fb-editfile" href="${url('filebrowser.views.edit', path=path_enc)}" target="FileEditor">Edit File</a></li>
                     <li><a class="fb-editfile" href="${url('filebrowser.views.edit', path=path_enc)}" target="FileEditor">Edit File</a></li>
+                    <li><a class="fb-downloadfile" href="${url('filebrowser.views.download', path=path_enc)}" target="_blank">Download File</a></li>
                     <li class="fb-rm-container"><a class="fb-rm fb-default-rm confirm_and_post" alt="Are you sure you want to remove this file?" href="${url('filebrowser.views.remove')}?path=${path_enc}&next=${urlencode(current_request_path)}">Remove</a></li>
                     <li class="fb-rm-container"><a class="fb-rm fb-default-rm confirm_and_post" alt="Are you sure you want to remove this file?" href="${url('filebrowser.views.remove')}?path=${path_enc}&next=${urlencode(current_request_path)}">Remove</a></li>
                   % endif
                   % endif
                   <li class="fb-rename-container"><a class="fb-rename" href="${url('filebrowser.views.rename')}?src_path=${path_enc}&next=${urlencode(current_request_path)}">Rename</a></li>
                   <li class="fb-rename-container"><a class="fb-rename" href="${url('filebrowser.views.rename')}?src_path=${path_enc}&next=${urlencode(current_request_path)}">Rename</a></li>