# HG changeset patch # User Marcin Kuzminski # Date 1314487062 -10800 # Node ID 8585fbf3ed061ae971963e230b33309bf35bc288 # Parent 200e6631787e8cf64ad205ca1484199aa072dff2 Implemented #111 copy github node finder solution diff -r 200e6631787e -r 8585fbf3ed06 rhodecode/config/routing.py --- a/rhodecode/config/routing.py Sat Aug 27 17:55:58 2011 +0300 +++ b/rhodecode/config/routing.py Sun Aug 28 02:17:42 2011 +0300 @@ -382,6 +382,11 @@ 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 -r 200e6631787e -r 8585fbf3ed06 rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py Sat Aug 27 17:55:58 2011 +0300 +++ b/rhodecode/controllers/files.py Sun Aug 28 02:17:42 2011 +0300 @@ -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 @@ 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 @@ 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 -r 200e6631787e -r 8585fbf3ed06 rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css Sat Aug 27 17:55:58 2011 +0300 +++ b/rhodecode/public/css/style.css Sun Aug 28 02:17:42 2011 +0300 @@ -52,7 +52,6 @@ color:#003367; text-decoration:none; cursor:pointer; -font-weight:700; } a:hover { @@ -1863,7 +1862,7 @@ 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 @@ 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 @@ padding-left:3px; } +#node_filter{ +border:0px solid #545454; +color:#AAAAAA; +padding-left:3px; +} diff -r 200e6631787e -r 8585fbf3ed06 rhodecode/templates/files/files_browser.html --- a/rhodecode/templates/files/files_browser.html Sat Aug 27 17:55:58 2011 +0300 +++ b/rhodecode/templates/files/files_browser.html Sun Aug 28 02:17:42 2011 +0300 @@ -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