diff --git a/rhodecode/config/routing.py b/rhodecode/config/routing.py --- a/rhodecode/config/routing.py +++ b/rhodecode/config/routing.py @@ -382,6 +382,11 @@ def make_map(config): controller='files', action='archivefile', conditions=dict(function=check_repo)) + rmap.connect('files_nodelist_home', + '/{repo_name:.*}/nodelist/{revision}/{f_path:.*}', + controller='files', action='nodelist', + conditions=dict(function=check_repo)) + rmap.connect('repo_settings_delete', '/{repo_name:.*}/settings', controller='settings', action="delete", conditions=dict(method=["DELETE"], function=check_repo)) diff --git a/rhodecode/controllers/files.py b/rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py +++ b/rhodecode/controllers/files.py @@ -25,12 +25,14 @@ import os import logging -import mimetypes import traceback +from os.path import join as jn + from pylons import request, response, session, tmpl_context as c, url from pylons.i18n.translation import _ from pylons.controllers.util import redirect +from pylons.decorators import jsonify from vcs.backends import ARCHIVE_SPECS from vcs.exceptions import RepositoryError, ChangesetDoesNotExistError, \ @@ -95,6 +97,26 @@ class FilesController(BaseRepoController return file_node + + def __get_paths(self, changeset, starting_path): + """recursive walk in root dir and return a set of all path in that dir + based on repository walk function + """ + _files = list() + _dirs = list() + + try: + tip = changeset + for topnode, dirs, files in tip.walk(starting_path): + for f in files: + _files.append(f.path) + for d in dirs: + _dirs.append(d.path) + except RepositoryError, e: + log.debug(traceback.format_exc()) + pass + return _dirs, _files + @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', 'repository.admin') def index(self, repo_name, revision, f_path): @@ -413,3 +435,13 @@ class FilesController(BaseRepoController hist_l.append(tags_group) return hist_l + + @jsonify + @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', + 'repository.admin') + def nodelist(self, repo_name, revision, f_path): + if request.environ.get('HTTP_X_PARTIAL_XHR'): + cs = self.__get_cs_or_redirect(revision, repo_name) + _d, _f = self.__get_paths(cs, f_path) + return _d + _f + diff --git a/rhodecode/public/css/style.css b/rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css +++ b/rhodecode/public/css/style.css @@ -52,7 +52,6 @@ a { color:#003367; text-decoration:none; cursor:pointer; -font-weight:700; } a:hover { @@ -1863,7 +1862,7 @@ padding:0; div.browserblock .browser-header { background:#FFF; -padding:10px 0px 25px 0px; +padding:10px 0px 15px 0px; width: 100%; } div.browserblock .browser-nav { @@ -1884,6 +1883,25 @@ margin-left:5px; font-weight:700; } +div.browserblock .browser-search{ + clear:both; + padding:8px 8px 0px 5px; +} + +div.browserblock .search_activate #filter_activate{ + vertical-align: sub; + border: 1px solid; + padding:2px; + border-radius: 4px 4px 4px 4px; + background: url("../images/button.png") repeat-x scroll 0 0 #E5E3E3; + border-color: #DDDDDD #DDDDDD #C6C6C6 #C6C6C6; + color: #515151; +} + +div.browserblock .search_activate a:hover{ + text-decoration: none !important; +} + div.browserblock .browser-body { background:#EEE; border-top:1px solid #CCC; @@ -2719,3 +2737,8 @@ margin-top:-4px; padding-left:3px; } +#node_filter{ +border:0px solid #545454; +color:#AAAAAA; +padding-left:3px; +} diff --git a/rhodecode/templates/files/files_browser.html b/rhodecode/templates/files/files_browser.html --- a/rhodecode/templates/files/files_browser.html +++ b/rhodecode/templates/files/files_browser.html @@ -12,7 +12,7 @@
${_('view')}@rev « - ${h.text('at_rev',value=c.changeset.revision,size=3)} + ${h.text('at_rev',value=c.changeset.revision,size=5)} » ## ${h.submit('view',_('view'),class_="ui-button-small")}
@@ -21,20 +21,133 @@
${h.checkbox('stay_at_branch',c.changeset.branch,c.changeset.branch==c.branch)} -
+
@@ -49,7 +162,8 @@ ${_('Last commiter')} - + + %if c.files_list.parent: @@ -97,6 +211,9 @@ %endfor + + +
\ No newline at end of file