ソースを参照

HUE-167. File Browser: Change "My Home" button to be disabled rather than hidden if the user does not have a home directory.

Implementation uses new "disabled" css style.
Philip Zeyliger 15 年 前
コミット
e6833b51f2

+ 4 - 1
apps/filebrowser/src/filebrowser/templates/fb_components.mako

@@ -31,8 +31,11 @@ from django.template.defaultfilters import urlencode, escape
         % if current_request_path:
           <div class="fb-actions" data-filters="ArtButtonBar">
             % if home_directory:
-              <a class="fb-home" data-filters="ArtButton" data-icon-styles="{'width' : 16, 'height': 16}" href="${url('filebrowser.views.view', path=home_directory)}">My Home</a>
+              <% my_home_disabled = "" %>
+            % else:
+              <% my_home_disabled = "disabled" %>
             % endif
+            <a class="fb-home ${my_home_disabled}" data-filters="ArtButton" data-icon-styles="{'width' : 16, 'height': 16}" href="${url('filebrowser.views.view', path=(home_directory or "/"))}">My Home</a>
             % if cwd_set:
               % if show_upload:
                 <a class="fb-upload" data-filters="ArtButton" data-icon-styles="{'width' : 16, 'height': 16}" href="${url('filebrowser.views.upload')}?dest=${path|urlencode}&next=${current_request_path|urlencode}">Upload a File</a>