Skip to content
Snippets Groups Projects

Routing overhaul

Merged gitlab-qa-bot requested to merge github/fork/rspeicher/routing_overhaul into master

Created by: rspeicher

Closes #1507 (closed) and #1452 (closed)

New Routes

Redesigns all routes that work with branch/tag names and file paths:

# /:project_id/blame/*path
#   /gitlabhq/blame/master/app/contexts/base_context.rb
#   /gitlabhq/blame/test/branch/name/app/contexts/base_context.rb
#
# /:project_id/blob/*path
#   /gitlabhq/blob/master/app/contexts/base_context.rb
#   /gitlabhq/blob/test/branch/name/app/contexts/base_context.rb
#
# /:project_id/commit/:id
#   /gitlabhq/commit/caef9ed1121a16ca0cc78715695daaa974271bfd
#
# /:project_id/commits
#
# /:project_id/commits/*path
#   /gitlabhq/commits/master/app/contexts/base_context.rb
#   /gitlabhq/commits/test/branch/name/app/contexts/base_context.rb
#
# /:project_id/tree/*path
#   /gitlabhq/tree/master/app
#   /gitlabhq/tree/test/branch/name/app
#
# /:project_id/compare
#
# /:project_id/compare/:from...:to
#   /gitlabhq/compare/master...stable

It does this by basically allowing anything for the :id parameter on these routes, and uses a special module called ExtractsPaths to separate the branch/tag from the file path.

As a consequence of this, I had to do some hack-ish stuff to still allow the Atom feeds to work. See 33126227, 6b90f36f and 1799cf3b.

"Active Tab" cleanup

Adds a new nav_link helper to the TabHelper module. It's well documented, so have a look. I also added comprehensive Spinach features to ensure that the correct main and sub tabs are marked as active across the various pages (see cada511f).

Misc. Cleanup

  • I replaced all instances of File.join(Rails.root, ...) with Rails.root.join(...).
  • I removed a before_filter called render_full_content that didn't seem to be doing anything.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: dzaporozhets

    I review it now

    By Administrator on 2012-09-27T06:55:02 (imported from GitLab project)

    By Administrator on 2012-09-27T06:55:02 (imported from GitLab)

  • Created by: dzaporozhets

    @tsigo Thank you! I like it!

    I've also made few fixes. I recommend to test application manually after big changes. Tests does not handle all cases. :)

    By Administrator on 2012-09-27T07:02:08 (imported from GitLab project)

    By Administrator on 2012-09-27T07:02:08 (imported from GitLab)

  • Created by: vsizov

    so many commits....

    By Administrator on 2012-10-04T17:13:45 (imported from GitLab project)

    By Administrator on 2012-10-04T17:13:45 (imported from GitLab)

  • Created by: riyad

    +1

    By Administrator on 2012-10-04T19:06:57 (imported from GitLab project)

    By Administrator on 2012-10-04T19:06:57 (imported from GitLab)

Please register or sign in to reply
Loading