diff --git a/progit/fork.py b/progit/fork.py index a68690c..37658c8 100644 --- a/progit/fork.py +++ b/progit/fork.py @@ -148,7 +148,7 @@ def do_request_pull(repo, requestid, username=None): 'Fork is empty, there are no commits to request pulling', 'error') return flask.redirect(flask.url_for( - 'view_fork_repo', username=username, repo=repo.name)) + 'view_repo', username=username, repo=repo.name)) html_diffs = [] for diff in diffs: @@ -275,7 +275,7 @@ def fork_project(repo, username=None): flask.flash(message) return flask.redirect( flask.url_for( - 'view_fork_repo', + 'view_repo', username=flask.g.fas_user.username, repo=repo.name) ) @@ -336,7 +336,7 @@ def new_request_pull(username, repo, commitid=None): 'Fork is empty, there are no commits to request pulling', 'error') return flask.redirect(flask.url_for( - 'view_fork_repo', username=username, repo=repo.name)) + 'view_repo', username=username, repo=repo.name)) html_diffs = [] for diff in diffs: @@ -367,7 +367,7 @@ def new_request_pull(username, repo, commitid=None): SESSION.commit() flask.flash(message) return flask.redirect(flask.url_for( - 'view_fork_issues', username=username, repo=repo.name)) + 'view_issues', username=username, repo=repo.name)) except progit.exceptions.ProgitException, err: flask.flash(str(err), 'error') except SQLAlchemyError, err: # pragma: no cover diff --git a/progit/repo.py b/progit/repo.py index 6bb22eb..226acb3 100644 --- a/progit/repo.py +++ b/progit/repo.py @@ -209,8 +209,6 @@ def do_view_log(repo, branchname=None, username=None): diff_commits.append(commit.oid.hex) origin = 'view_log' - if username: - origin = 'view_fork_log' return flask.render_template( 'repo_info.html', @@ -389,6 +387,7 @@ def do_view_forks(repo, username=None): return flask.render_template( 'forks.html', select='forks', + username=username, repo=repo, ) @@ -397,42 +396,24 @@ def do_view_forks(repo, username=None): @APP.route('/') -def view_repo(repo): - """ Front page of a specific repo. - """ - return do_view_repo(repo=repo) - - @APP.route('/fork//') -def view_fork_repo(username, repo): +def view_repo(repo, username=None): """ Front page of a specific repo. """ return do_view_repo(repo=repo, username=username) @APP.route('//branch/') -def view_repo_branch(repo, branchname): - return do_view_repo_branch(repo, branchname) - - @APP.route('/fork///branch/') -def view_fork_repo_branch(username, repo, branchname): - """ Displays the information about a specific branch. - """ +def view_repo_branch(repo, branchname, username=None): return do_view_repo_branch(repo, branchname, username=username) @APP.route('//log') @APP.route('//log/') -def view_log(repo, branchname=None): - """ Displays the logs of the specified repo. - """ - return do_view_log(repo, branchname) - - @APP.route('/fork///log') @APP.route('/fork///log/') -def view_fork_log(username, repo, branchname=None): +def view_log(repo, branchname=None, username=None): """ Displays the logs of the specified repo. """ return do_view_log(repo, branchname, username=username) @@ -440,29 +421,17 @@ def view_fork_log(username, repo, branchname=None): @APP.route('//blob//') @APP.route('//blob//') -def view_file(repo, identifier, filename): - """ Displays the content of a file or a tree for the specified repo. - """ - return do_view_file(repo, identifier, filename) - - @APP.route('/fork///blob//') @APP.route('/fork///blob//') -def view_fork_file(username, repo, identifier, filename): +def view_file(repo, identifier, filename, username=None): """ Displays the content of a file or a tree for the specified repo. """ return do_view_file(repo, identifier, filename, username=username) @APP.route('//') -def view_commit(repo, commitid): - """ Render a commit in a repo - """ - return do_view_commit(repo, commitid) - - @APP.route('/fork///') -def view_fork_commit(username, repo, commitid): +def view_commit(repo, commitid, username=None): """ Render a commit in a repo """ return do_view_commit(repo, commitid, username=username) @@ -470,29 +439,17 @@ def view_fork_commit(username, repo, commitid): @APP.route('//tree/') @APP.route('//tree/') -def view_tree(repo, identifier=None): - """ Render the tree of the repo - """ - return do_view_tree(repo, identifier=identifier) - - @APP.route('/fork///tree/') @APP.route('/fork///tree/') -def view_fork_tree(username, repo, identifier=None): +def view_tree(repo, identifier=None, username=None): """ Render the tree of the repo """ return do_view_tree(repo, identifier=identifier, username=username) @APP.route('//forks') -def view_forks(repo): - """ Presents all the forks of the project. - """ - return do_view_forks(repo) - - @APP.route('/fork///forks') -def fork_view_forks(username, repo): - """ Presents all the forks of the fork. +def view_forks(repo, username=None): + """ Presents all the forks of the project. """ return do_view_forks(repo, username=username) diff --git a/progit/templates/commit.html b/progit/templates/commit.html index 9a4f5af..384498c 100644 --- a/progit/templates/commit.html +++ b/progit/templates/commit.html @@ -7,15 +7,9 @@

Commit: {{ commitid }} - {% if '/fork/' in request.url %} - (tree) - {% else %} - (tree) - {% endif %}

@@ -37,16 +31,10 @@ diff --git a/progit/templates/file.html b/progit/templates/file.html index 8bb9f75..b2548a1 100644 --- a/progit/templates/file.html +++ b/progit/templates/file.html @@ -7,34 +7,20 @@ {% block repo %}

- {% if '/fork/' in request.url %} - - {% else %} - - {% endif %} - {{ branchname }}/{% + {{ branchname }}/{% for file in filename.split('/') %} {% if loop.first %} {% set path = file %} {% else %} {% set path = path + '/' + file %} {% endif %} - {% if loop.index != loop.length %} -{% if '/fork/' in request.url - %}{{ file }}/ -{% -else %}{{ file }}/{% endif %}{% - else %} -{{ file }} - {% endif %} + >{{ file }}/{% else %}{{ file }}{% endif %} {% endfor %}

@@ -52,16 +38,9 @@ else %} - {% else %} - - {% endif %} {{ entry.name }} {{ entry.hex }} diff --git a/progit/templates/forks.html b/progit/templates/forks.html index 7b97ba5..8fdf851 100644 --- a/progit/templates/forks.html +++ b/progit/templates/forks.html @@ -13,8 +13,8 @@
Parent {% for parent in commit.parents %} - {% if '/fork/' in request.url %} - - {% else %} - - {% endif %} - - {{ parent.oid.hex }} -
+ {{ parent.oid.hex }} +
{% endfor %}
Parent {% for parent in diff_commits[loop.index - 1].parents %} - {% if '/fork/' in request.url %} - - {% else %} - - {% endif %} {{ parent.oid.hex }}
diff --git a/progit/templates/repo_info.html b/progit/templates/repo_info.html index 342576f..42c1283 100644 --- a/progit/templates/repo_info.html +++ b/progit/templates/repo_info.html @@ -35,22 +35,12 @@
{% if page > 1%} - {% if '/fork/' in request.url %} - {% else %} - - {% endif %} < Previous {% else %} @@ -78,13 +63,8 @@ {{ page }} / {{ total_page }} {% if page < total_page %} - {% if '/fork/' in request.url %} - {% else %} - - {% endif %} Next > {% else %} @@ -104,15 +84,10 @@ {% if entry.filemode == 16384 %} [ ] {% endif %} - {% if '/fork/' in request.url %} - - {% else %} - - {% endif %} - {{ entry.name }} - + {{ entry.name }} + {{ entry.hex }} {{ entry.id }} @@ -136,15 +111,9 @@