From 2ed7cbfba4ff3c6a4cf3e72515a0375544998de0 Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Date: Sun, 23 Jun 2013 19:47:22 +0300
Subject: [PATCH] Move projects controllers/views in Projects module

---
 app/assets/javascripts/dispatcher.js.coffee   |  10 +-
 .../project_resource_controller.rb            |   4 -
 .../projects/application_controller.rb        |   1 +
 .../{ => projects}/blame_controller.rb        |   2 +-
 .../{ => projects}/blob_controller.rb         |   2 +-
 .../{ => projects}/commit_controller.rb       |   2 +-
 .../{ => projects}/commits_controller.rb      |   2 +-
 .../{ => projects}/compare_controller.rb      |   2 +-
 .../{ => projects}/deploy_keys_controller.rb  |   2 +-
 .../{ => projects}/edit_tree_controller.rb    |   2 +-
 .../{ => projects}/graphs_controller.rb       |   2 +-
 .../{ => projects}/hooks_controller.rb        |   2 +-
 .../{ => projects}/issues_controller.rb       |   2 +-
 .../{ => projects}/labels_controller.rb       |   2 +-
 .../merge_requests_controller.rb              |   2 +-
 .../{ => projects}/milestones_controller.rb   |   2 +-
 .../{ => projects}/network_controller.rb      |   2 +-
 .../{ => projects}/notes_controller.rb        |   2 +-
 .../protected_branches_controller.rb          |   2 +-
 .../{ => projects}/raw_controller.rb          |   2 +-
 .../{ => projects}/refs_controller.rb         |   2 +-
 .../{ => projects}/repositories_controller.rb |   2 +-
 .../{ => projects}/services_controller.rb     |   2 +-
 .../projects/snippets_controller.rb           |   2 +-
 .../{ => projects}/team_members_controller.rb |   2 +-
 .../{ => projects}/tree_controller.rb         |   2 +-
 .../{ => projects}/walls_controller.rb        |   2 +-
 .../{ => projects}/wikis_controller.rb        |   2 +-
 app/controllers/projects_controller.rb        |   2 +-
 app/helpers/commits_helper.rb                 |   2 +-
 app/helpers/tree_helper.rb                    |   6 +-
 app/views/dashboard/issues.html.haml          |   2 +-
 app/views/groups/issues.html.haml             |   2 +-
 ..._resource.html.haml => projects.html.haml} |   0
 .../{ => projects}/blame/_head.html.haml      |   0
 app/views/{ => projects}/blame/show.html.haml |   2 +-
 .../{ => projects}/blob/_actions.html.haml    |   0
 app/views/{ => projects}/blob/_blob.html.haml |   0
 .../{ => projects}/blob/_download.html.haml   |   0
 .../{ => projects}/blob/_image.html.haml      |   0
 app/views/{ => projects}/blob/_text.html.haml |   0
 app/views/{ => projects}/blob/show.html.haml  |   0
 .../commit/_commit_box.html.haml              |   0
 .../commit/huge_commit.html.haml              |   0
 .../{ => projects}/commit/show.html.haml      |   4 +-
 .../{ => projects}/commits/_commit.html.haml  |   0
 .../{ => projects}/commits/_commits.html.haml |   0
 .../commits/_diff_head.html.haml              |   0
 .../{ => projects}/commits/_diffs.html.haml   |   6 +-
 .../{ => projects}/commits/_head.html.haml    |   0
 .../{ => projects}/commits/_image.html.haml   |   0
 .../commits/_text_file.html.haml              |   4 +-
 .../{ => projects}/commits/show.atom.builder  |   0
 .../{ => projects}/commits/show.html.haml     |   0
 app/views/{ => projects}/commits/show.js.haml |   0
 .../{ => projects}/compare/_form.html.haml    |   0
 .../{ => projects}/compare/index.html.haml    |   2 +-
 .../{ => projects}/compare/show.html.haml     |   4 +-
 .../deploy_keys/_deploy_key.html.haml         |   0
 .../deploy_keys/_form.html.haml               |   0
 .../deploy_keys/index.html.haml               |   0
 .../{ => projects}/deploy_keys/new.html.haml  |   0
 .../{ => projects}/deploy_keys/show.html.haml |   0
 .../{ => projects}/edit_tree/show.html.haml   |   0
 .../{ => projects}/graphs/show.html.haml      |   0
 app/views/{ => projects}/graphs/show.js.haml  |   0
 .../{ => projects}/hooks/_data_ex.html.erb    |   0
 .../{ => projects}/hooks/index.html.haml      |   0
 .../{ => projects}/issues/_filter.html.haml   |   0
 .../{ => projects}/issues/_form.html.haml     |   0
 .../{ => projects}/issues/_head.html.haml     |   0
 .../{ => projects}/issues/_issue.html.haml    |   0
 .../{ => projects}/issues/_issues.html.haml   |   0
 .../{ => projects}/issues/edit.html.haml      |   0
 .../{ => projects}/issues/index.atom.builder  |   0
 .../{ => projects}/issues/index.html.haml     |   2 +-
 app/views/{ => projects}/issues/index.js.haml |   0
 app/views/{ => projects}/issues/new.html.haml |   0
 .../{ => projects}/issues/show.html.haml      |   2 +-
 .../{ => projects}/issues/update.js.haml      |   0
 .../{ => projects}/labels/_label.html.haml    |   0
 .../{ => projects}/labels/index.html.haml     |   2 +-
 .../merge_requests/_filter.html.haml          |   0
 .../merge_requests/_form.html.haml            |   0
 .../merge_requests/_head.html.haml            |   0
 .../merge_requests/_merge_request.html.haml   |   0
 .../merge_requests/_show.html.haml            |  16 +-
 .../merge_requests/automerge.js.haml          |   0
 .../merge_requests/branch_from.js.haml        |   0
 .../merge_requests/branch_to.js.haml          |   0
 .../merge_requests/commits.js.haml            |   0
 .../merge_requests/diffs.html.haml            |   0
 .../merge_requests/diffs.js.haml              |   2 +-
 .../merge_requests/edit.html.haml             |   0
 .../merge_requests/index.html.haml            |   0
 .../merge_requests/invalid.html.haml          |   4 +-
 .../merge_requests/new.html.haml              |   0
 .../merge_requests/show.html.haml             |   0
 .../merge_requests/show.js.haml               |   0
 .../merge_requests/show/_commits.html.haml    |   6 +-
 .../merge_requests/show/_diffs.html.haml      |   2 +-
 .../show/_how_to_merge.html.haml              |   0
 .../merge_requests/show/_mr_accept.html.haml  |   0
 .../merge_requests/show/_mr_box.html.haml     |   0
 .../merge_requests/show/_mr_ci.html.haml      |   0
 .../merge_requests/show/_mr_title.html.haml   |   0
 .../{ => projects}/milestones/_form.html.haml |   0
 .../milestones/_issues.html.haml              |   0
 .../milestones/_merge_request.html.haml       |   0
 .../milestones/_milestone.html.haml           |   0
 .../{ => projects}/milestones/edit.html.haml  |   0
 .../{ => projects}/milestones/index.html.haml |   2 +-
 .../{ => projects}/milestones/new.html.haml   |   0
 .../{ => projects}/milestones/show.html.haml  |   2 +-
 .../{ => projects}/milestones/update.js.haml  |   0
 .../{ => projects}/network/_head.html.haml    |   0
 .../{ => projects}/network/show.html.haml     |   0
 .../{ => projects}/network/show.json.erb      |   0
 .../notes/_diff_note_link.html.haml           |   0
 .../notes/_diff_notes_with_reply.html.haml    |   2 +-
 .../notes/_discussion.html.haml               |   4 +-
 .../notes/_discussion_diff.html.haml          |   2 +-
 .../notes/_discussion_reply_button.html.haml  |   0
 .../{ => projects}/notes/_form.html.haml      |   0
 .../notes/_form_errors.html.haml              |   0
 .../{ => projects}/notes/_note.html.haml      |   0
 .../{ => projects}/notes/_notes.html.haml     |   2 +-
 .../notes/_notes_with_form.html.haml          |   2 +-
 app/views/{ => projects}/notes/create.js.haml |   6 +-
 app/views/{ => projects}/notes/index.js.haml  |   2 +-
 .../protected_branches/index.html.haml        |   4 +-
 .../{ => projects}/refs/logs_tree.js.haml     |   2 +-
 .../repositories/_branch.html.haml            |   0
 .../repositories/_feed.html.haml              |   0
 .../repositories/_filter.html.haml            |   0
 .../repositories/branches.html.haml           |   4 +-
 .../repositories/show.html.haml               |   4 +-
 .../repositories/stats.html.haml              |   2 +-
 .../repositories/tags.html.haml               |   2 +-
 .../{ => projects}/services/_form.html.haml   |   0
 .../{ => projects}/services/edit.html.haml    |   0
 .../{ => projects}/services/index.html.haml   |   0
 app/views/projects/snippets/show.html.haml    |   2 +-
 .../team_members/_form.html.haml              |   0
 .../team_members/_group_members.html.haml     |   0
 .../team_members/_team.html.haml              |   2 +-
 .../team_members/_team_member.html.haml       |   0
 .../team_members/import.html.haml             |   0
 .../team_members/index.html.haml              |   4 +-
 app/views/projects/team_members/new.html.haml |   1 +
 .../team_members/update.js.haml               |   0
 .../{ => projects}/tree/_blob_item.html.haml  |   0
 .../{ => projects}/tree/_readme.html.haml     |   0
 .../tree/_submodule_item.html.haml            |   0
 app/views/{ => projects}/tree/_tree.html.haml |   2 +-
 .../tree/_tree_commit_column.html.haml        |   0
 .../{ => projects}/tree/_tree_item.html.haml  |   0
 app/views/{ => projects}/tree/show.html.haml  |   0
 app/views/{ => projects}/walls/show.html.haml |   0
 .../{ => projects}/wikis/_form.html.haml      |   0
 .../wikis/_main_links.html.haml               |   0
 app/views/{ => projects}/wikis/_nav.html.haml |   2 +-
 app/views/{ => projects}/wikis/_new.html.haml |   0
 app/views/{ => projects}/wikis/edit.html.haml |   2 +-
 .../{ => projects}/wikis/empty.html.haml      |   0
 .../{ => projects}/wikis/git_access.html.haml |   2 +-
 .../{ => projects}/wikis/history.html.haml    |   2 +-
 .../{ => projects}/wikis/pages.html.haml      |   2 +-
 app/views/{ => projects}/wikis/show.html.haml |   2 +-
 app/views/shared/_merge_requests.html.haml    |   2 +-
 app/views/team_members/new.html.haml          |   1 -
 config/routes.rb                              | 194 +++++++++---------
 172 files changed, 198 insertions(+), 201 deletions(-)
 delete mode 100644 app/controllers/project_resource_controller.rb
 rename app/controllers/{ => projects}/blame_controller.rb (84%)
 rename app/controllers/{ => projects}/blob_controller.rb (81%)
 rename app/controllers/{ => projects}/commit_controller.rb (94%)
 rename app/controllers/{ => projects}/commits_controller.rb (87%)
 rename app/controllers/{ => projects}/compare_controller.rb (88%)
 rename app/controllers/{ => projects}/deploy_keys_controller.rb (94%)
 rename app/controllers/{ => projects}/edit_tree_controller.rb (95%)
 rename app/controllers/{ => projects}/graphs_controller.rb (85%)
 rename app/controllers/{ => projects}/hooks_controller.rb (91%)
 rename app/controllers/{ => projects}/issues_controller.rb (97%)
 rename app/controllers/{ => projects}/labels_controller.rb (85%)
 rename app/controllers/{ => projects}/merge_requests_controller.rb (98%)
 rename app/controllers/{ => projects}/milestones_controller.rb (96%)
 rename app/controllers/{ => projects}/network_controller.rb (87%)
 rename app/controllers/{ => projects}/notes_controller.rb (96%)
 rename app/controllers/{ => projects}/protected_branches_controller.rb (89%)
 rename app/controllers/{ => projects}/raw_controller.rb (88%)
 rename app/controllers/{ => projects}/refs_controller.rb (94%)
 rename app/controllers/{ => projects}/repositories_controller.rb (91%)
 rename app/controllers/{ => projects}/services_controller.rb (91%)
 rename app/controllers/{ => projects}/team_members_controller.rb (95%)
 rename app/controllers/{ => projects}/tree_controller.rb (85%)
 rename app/controllers/{ => projects}/walls_controller.rb (79%)
 rename app/controllers/{ => projects}/wikis_controller.rb (97%)
 rename app/views/layouts/{project_resource.html.haml => projects.html.haml} (100%)
 rename app/views/{ => projects}/blame/_head.html.haml (100%)
 rename app/views/{ => projects}/blame/show.html.haml (96%)
 rename app/views/{ => projects}/blob/_actions.html.haml (100%)
 rename app/views/{ => projects}/blob/_blob.html.haml (100%)
 rename app/views/{ => projects}/blob/_download.html.haml (100%)
 rename app/views/{ => projects}/blob/_image.html.haml (100%)
 rename app/views/{ => projects}/blob/_text.html.haml (100%)
 rename app/views/{ => projects}/blob/show.html.haml (100%)
 rename app/views/{ => projects}/commit/_commit_box.html.haml (100%)
 rename app/views/{ => projects}/commit/huge_commit.html.haml (100%)
 rename app/views/{ => projects}/commit/show.html.haml (68%)
 rename app/views/{ => projects}/commits/_commit.html.haml (100%)
 rename app/views/{ => projects}/commits/_commits.html.haml (100%)
 rename app/views/{ => projects}/commits/_diff_head.html.haml (100%)
 rename app/views/{ => projects}/commits/_diffs.html.haml (89%)
 rename app/views/{ => projects}/commits/_head.html.haml (100%)
 rename app/views/{ => projects}/commits/_image.html.haml (100%)
 rename app/views/{ => projects}/commits/_text_file.html.haml (86%)
 rename app/views/{ => projects}/commits/show.atom.builder (100%)
 rename app/views/{ => projects}/commits/show.html.haml (100%)
 rename app/views/{ => projects}/commits/show.js.haml (100%)
 rename app/views/{ => projects}/compare/_form.html.haml (100%)
 rename app/views/{ => projects}/compare/index.html.haml (61%)
 rename app/views/{ => projects}/compare/show.html.haml (82%)
 rename app/views/{ => projects}/deploy_keys/_deploy_key.html.haml (100%)
 rename app/views/{ => projects}/deploy_keys/_form.html.haml (100%)
 rename app/views/{ => projects}/deploy_keys/index.html.haml (100%)
 rename app/views/{ => projects}/deploy_keys/new.html.haml (100%)
 rename app/views/{ => projects}/deploy_keys/show.html.haml (100%)
 rename app/views/{ => projects}/edit_tree/show.html.haml (100%)
 rename app/views/{ => projects}/graphs/show.html.haml (100%)
 rename app/views/{ => projects}/graphs/show.js.haml (100%)
 rename app/views/{ => projects}/hooks/_data_ex.html.erb (100%)
 rename app/views/{ => projects}/hooks/index.html.haml (100%)
 rename app/views/{ => projects}/issues/_filter.html.haml (100%)
 rename app/views/{ => projects}/issues/_form.html.haml (100%)
 rename app/views/{ => projects}/issues/_head.html.haml (100%)
 rename app/views/{ => projects}/issues/_issue.html.haml (100%)
 rename app/views/{ => projects}/issues/_issues.html.haml (100%)
 rename app/views/{ => projects}/issues/edit.html.haml (100%)
 rename app/views/{ => projects}/issues/index.atom.builder (100%)
 rename app/views/{ => projects}/issues/index.html.haml (98%)
 rename app/views/{ => projects}/issues/index.js.haml (100%)
 rename app/views/{ => projects}/issues/new.html.haml (100%)
 rename app/views/{ => projects}/issues/show.html.haml (97%)
 rename app/views/{ => projects}/issues/update.js.haml (100%)
 rename app/views/{ => projects}/labels/_label.html.haml (100%)
 rename app/views/{ => projects}/labels/index.html.haml (91%)
 rename app/views/{ => projects}/merge_requests/_filter.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/_form.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/_head.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/_merge_request.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/_show.html.haml (71%)
 rename app/views/{ => projects}/merge_requests/automerge.js.haml (100%)
 rename app/views/{ => projects}/merge_requests/branch_from.js.haml (100%)
 rename app/views/{ => projects}/merge_requests/branch_to.js.haml (100%)
 rename app/views/{ => projects}/merge_requests/commits.js.haml (100%)
 rename app/views/{ => projects}/merge_requests/diffs.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/diffs.js.haml (59%)
 rename app/views/{ => projects}/merge_requests/edit.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/index.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/invalid.html.haml (79%)
 rename app/views/{ => projects}/merge_requests/new.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/show.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/show.js.haml (100%)
 rename app/views/{ => projects}/merge_requests/show/_commits.html.haml (79%)
 rename app/views/{ => projects}/merge_requests/show/_diffs.html.haml (85%)
 rename app/views/{ => projects}/merge_requests/show/_how_to_merge.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/show/_mr_accept.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/show/_mr_box.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/show/_mr_ci.html.haml (100%)
 rename app/views/{ => projects}/merge_requests/show/_mr_title.html.haml (100%)
 rename app/views/{ => projects}/milestones/_form.html.haml (100%)
 rename app/views/{ => projects}/milestones/_issues.html.haml (100%)
 rename app/views/{ => projects}/milestones/_merge_request.html.haml (100%)
 rename app/views/{ => projects}/milestones/_milestone.html.haml (100%)
 rename app/views/{ => projects}/milestones/edit.html.haml (100%)
 rename app/views/{ => projects}/milestones/index.html.haml (96%)
 rename app/views/{ => projects}/milestones/new.html.haml (100%)
 rename app/views/{ => projects}/milestones/show.html.haml (99%)
 rename app/views/{ => projects}/milestones/update.js.haml (100%)
 rename app/views/{ => projects}/network/_head.html.haml (100%)
 rename app/views/{ => projects}/network/show.html.haml (100%)
 rename app/views/{ => projects}/network/show.json.erb (100%)
 rename app/views/{ => projects}/notes/_diff_note_link.html.haml (100%)
 rename app/views/{ => projects}/notes/_diff_notes_with_reply.html.haml (77%)
 rename app/views/{ => projects}/notes/_discussion.html.haml (91%)
 rename app/views/{ => projects}/notes/_discussion_diff.html.haml (90%)
 rename app/views/{ => projects}/notes/_discussion_reply_button.html.haml (100%)
 rename app/views/{ => projects}/notes/_form.html.haml (100%)
 rename app/views/{ => projects}/notes/_form_errors.html.haml (100%)
 rename app/views/{ => projects}/notes/_note.html.haml (100%)
 rename app/views/{ => projects}/notes/_notes.html.haml (90%)
 rename app/views/{ => projects}/notes/_notes_with_form.html.haml (86%)
 rename app/views/{ => projects}/notes/create.js.haml (71%)
 rename app/views/{ => projects}/notes/index.js.haml (60%)
 rename app/views/{ => projects}/protected_branches/index.html.haml (96%)
 rename app/views/{ => projects}/refs/logs_tree.js.haml (86%)
 rename app/views/{ => projects}/repositories/_branch.html.haml (100%)
 rename app/views/{ => projects}/repositories/_feed.html.haml (100%)
 rename app/views/{ => projects}/repositories/_filter.html.haml (100%)
 rename app/views/{ => projects}/repositories/branches.html.haml (70%)
 rename app/views/{ => projects}/repositories/show.html.haml (67%)
 rename app/views/{ => projects}/repositories/stats.html.haml (95%)
 rename app/views/{ => projects}/repositories/tags.html.haml (97%)
 rename app/views/{ => projects}/services/_form.html.haml (100%)
 rename app/views/{ => projects}/services/edit.html.haml (100%)
 rename app/views/{ => projects}/services/index.html.haml (100%)
 rename app/views/{ => projects}/team_members/_form.html.haml (100%)
 rename app/views/{ => projects}/team_members/_group_members.html.haml (100%)
 rename app/views/{ => projects}/team_members/_team.html.haml (66%)
 rename app/views/{ => projects}/team_members/_team_member.html.haml (100%)
 rename app/views/{ => projects}/team_members/import.html.haml (100%)
 rename app/views/{ => projects}/team_members/index.html.haml (85%)
 create mode 100644 app/views/projects/team_members/new.html.haml
 rename app/views/{ => projects}/team_members/update.js.haml (100%)
 rename app/views/{ => projects}/tree/_blob_item.html.haml (100%)
 rename app/views/{ => projects}/tree/_readme.html.haml (100%)
 rename app/views/{ => projects}/tree/_submodule_item.html.haml (100%)
 rename app/views/{ => projects}/tree/_tree.html.haml (95%)
 rename app/views/{ => projects}/tree/_tree_commit_column.html.haml (100%)
 rename app/views/{ => projects}/tree/_tree_item.html.haml (100%)
 rename app/views/{ => projects}/tree/show.html.haml (100%)
 rename app/views/{ => projects}/walls/show.html.haml (100%)
 rename app/views/{ => projects}/wikis/_form.html.haml (100%)
 rename app/views/{ => projects}/wikis/_main_links.html.haml (100%)
 rename app/views/{ => projects}/wikis/_nav.html.haml (95%)
 rename app/views/{ => projects}/wikis/_new.html.haml (100%)
 rename app/views/{ => projects}/wikis/edit.html.haml (94%)
 rename app/views/{ => projects}/wikis/empty.html.haml (100%)
 rename app/views/{ => projects}/wikis/git_access.html.haml (98%)
 rename app/views/{ => projects}/wikis/history.html.haml (97%)
 rename app/views/{ => projects}/wikis/pages.html.haml (96%)
 rename app/views/{ => projects}/wikis/show.html.haml (96%)
 delete mode 100644 app/views/team_members/new.html.haml

diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee
index ce53d14d671..8ce13e6851e 100644
--- a/app/assets/javascripts/dispatcher.js.coffee
+++ b/app/assets/javascripts/dispatcher.js.coffee
@@ -18,19 +18,19 @@ class Dispatcher
     path = page.split(':')
 
     switch page
-      when 'issues:index'
+      when 'projects:issues:index'
         Issues.init()
       when 'dashboard:show'
         new Dashboard()
-      when 'commit:show'
+      when 'projects:commit:show'
         new Commit()
-      when 'groups:show', 'teams:show', 'projects:show'
+      when 'groups:show', 'projects:show'
         Pager.init(20, true)
       when 'projects:new', 'projects:edit'
         new Project()
-      when 'walls:show'
+      when 'projects:walls:show'
         new Wall(project_id)
-      when 'teams:members:index'
+      when 'projects:teams:members:index'
         new TeamMembers()
       when 'groups:people'
         new GroupMembers()
diff --git a/app/controllers/project_resource_controller.rb b/app/controllers/project_resource_controller.rb
deleted file mode 100644
index ea78b3ff7c4..00000000000
--- a/app/controllers/project_resource_controller.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-class ProjectResourceController < ApplicationController
-  before_filter :project
-  before_filter :repository
-end
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb
index 86e4a7cbd6b..1f2a75175cf 100644
--- a/app/controllers/projects/application_controller.rb
+++ b/app/controllers/projects/application_controller.rb
@@ -1,4 +1,5 @@
 class Projects::ApplicationController < ApplicationController
   before_filter :project
   before_filter :repository
+  layout 'projects'
 end
diff --git a/app/controllers/blame_controller.rb b/app/controllers/projects/blame_controller.rb
similarity index 84%
rename from app/controllers/blame_controller.rb
rename to app/controllers/projects/blame_controller.rb
index c950af56e26..e58b4507202 100644
--- a/app/controllers/blame_controller.rb
+++ b/app/controllers/projects/blame_controller.rb
@@ -1,5 +1,5 @@
 # Controller for viewing a file's blame
-class BlameController < ProjectResourceController
+class Projects::BlameController < Projects::ApplicationController
   include ExtractsPath
 
   # Authorize
diff --git a/app/controllers/blob_controller.rb b/app/controllers/projects/blob_controller.rb
similarity index 81%
rename from app/controllers/blob_controller.rb
rename to app/controllers/projects/blob_controller.rb
index 3547dfe2323..b1329c01ce7 100644
--- a/app/controllers/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -1,5 +1,5 @@
 # Controller for viewing a file's blame
-class BlobController < ProjectResourceController
+class Projects::BlobController < Projects::ApplicationController
   include ExtractsPath
 
   # Authorize
diff --git a/app/controllers/commit_controller.rb b/app/controllers/projects/commit_controller.rb
similarity index 94%
rename from app/controllers/commit_controller.rb
rename to app/controllers/projects/commit_controller.rb
index a164de33107..6a2d2315c1d 100644
--- a/app/controllers/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -1,7 +1,7 @@
 # Controller for a specific Commit
 #
 # Not to be confused with CommitsController, plural.
-class CommitController < ProjectResourceController
+class Projects::CommitController < Projects::ApplicationController
   # Authorize
   before_filter :authorize_read_project!
   before_filter :authorize_code_access!
diff --git a/app/controllers/commits_controller.rb b/app/controllers/projects/commits_controller.rb
similarity index 87%
rename from app/controllers/commits_controller.rb
rename to app/controllers/projects/commits_controller.rb
index cde1f459d76..bdffc940ea5 100644
--- a/app/controllers/commits_controller.rb
+++ b/app/controllers/projects/commits_controller.rb
@@ -1,6 +1,6 @@
 require "base64"
 
-class CommitsController < ProjectResourceController
+class Projects::CommitsController < Projects::ApplicationController
   include ExtractsPath
 
   # Authorize
diff --git a/app/controllers/compare_controller.rb b/app/controllers/projects/compare_controller.rb
similarity index 88%
rename from app/controllers/compare_controller.rb
rename to app/controllers/projects/compare_controller.rb
index 750e9c2380e..126a2ea50c9 100644
--- a/app/controllers/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -1,4 +1,4 @@
-class CompareController < ProjectResourceController
+class Projects::CompareController < Projects::ApplicationController
   # Authorize
   before_filter :authorize_read_project!
   before_filter :authorize_code_access!
diff --git a/app/controllers/deploy_keys_controller.rb b/app/controllers/projects/deploy_keys_controller.rb
similarity index 94%
rename from app/controllers/deploy_keys_controller.rb
rename to app/controllers/projects/deploy_keys_controller.rb
index 4bd810f20c0..0750e0a146f 100644
--- a/app/controllers/deploy_keys_controller.rb
+++ b/app/controllers/projects/deploy_keys_controller.rb
@@ -1,4 +1,4 @@
-class DeployKeysController < ProjectResourceController
+class Projects::DeployKeysController < Projects::ApplicationController
   respond_to :html
 
   # Authorize
diff --git a/app/controllers/edit_tree_controller.rb b/app/controllers/projects/edit_tree_controller.rb
similarity index 95%
rename from app/controllers/edit_tree_controller.rb
rename to app/controllers/projects/edit_tree_controller.rb
index 9ed7a2143e4..11c97291296 100644
--- a/app/controllers/edit_tree_controller.rb
+++ b/app/controllers/projects/edit_tree_controller.rb
@@ -1,5 +1,5 @@
 # Controller for edit a repository's file
-class EditTreeController < ProjectResourceController
+class Projects::EditTreeController < Projects::ApplicationController
   include ExtractsPath
 
   # Authorize
diff --git a/app/controllers/graphs_controller.rb b/app/controllers/projects/graphs_controller.rb
similarity index 85%
rename from app/controllers/graphs_controller.rb
rename to app/controllers/projects/graphs_controller.rb
index 6c2ac5fcbf4..5ff330ba6ca 100644
--- a/app/controllers/graphs_controller.rb
+++ b/app/controllers/projects/graphs_controller.rb
@@ -1,4 +1,4 @@
-class GraphsController < ProjectResourceController
+class Projects::GraphsController < Projects::ApplicationController
   # Authorize
   before_filter :authorize_read_project!
   before_filter :authorize_code_access!
diff --git a/app/controllers/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb
similarity index 91%
rename from app/controllers/hooks_controller.rb
rename to app/controllers/projects/hooks_controller.rb
index feaa16b6875..3367ddb5d14 100644
--- a/app/controllers/hooks_controller.rb
+++ b/app/controllers/projects/hooks_controller.rb
@@ -1,4 +1,4 @@
-class HooksController < ProjectResourceController
+class Projects::HooksController < Projects::ApplicationController
   # Authorize
   before_filter :authorize_read_project!
   before_filter :authorize_admin_project!, only: [:new, :create, :destroy]
diff --git a/app/controllers/issues_controller.rb b/app/controllers/projects/issues_controller.rb
similarity index 97%
rename from app/controllers/issues_controller.rb
rename to app/controllers/projects/issues_controller.rb
index 65e72792924..06f8a1233a3 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/projects/issues_controller.rb
@@ -1,4 +1,4 @@
-class IssuesController < ProjectResourceController
+class Projects::IssuesController < Projects::ApplicationController
   before_filter :module_enabled
   before_filter :issue, only: [:edit, :update, :show]
 
diff --git a/app/controllers/labels_controller.rb b/app/controllers/projects/labels_controller.rb
similarity index 85%
rename from app/controllers/labels_controller.rb
rename to app/controllers/projects/labels_controller.rb
index 0e78cecf4d1..65f9e2b9d57 100644
--- a/app/controllers/labels_controller.rb
+++ b/app/controllers/projects/labels_controller.rb
@@ -1,4 +1,4 @@
-class LabelsController < ProjectResourceController
+class Projects::LabelsController < Projects::ApplicationController
   before_filter :module_enabled
 
   # Allow read any issue
diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
similarity index 98%
rename from app/controllers/merge_requests_controller.rb
rename to app/controllers/projects/merge_requests_controller.rb
index 8d19e1b8b0b..0aa8bc8a6df 100644
--- a/app/controllers/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -1,6 +1,6 @@
 require 'gitlab/satellite/satellite'
 
-class MergeRequestsController < ProjectResourceController
+class Projects::MergeRequestsController < Projects::ApplicationController
   before_filter :module_enabled
   before_filter :merge_request, only: [:edit, :update, :show, :commits, :diffs, :automerge, :automerge_check, :ci_status]
   before_filter :validates_merge_request, only: [:show, :diffs]
diff --git a/app/controllers/milestones_controller.rb b/app/controllers/projects/milestones_controller.rb
similarity index 96%
rename from app/controllers/milestones_controller.rb
rename to app/controllers/projects/milestones_controller.rb
index 25647f97576..f4ee7427d29 100644
--- a/app/controllers/milestones_controller.rb
+++ b/app/controllers/projects/milestones_controller.rb
@@ -1,4 +1,4 @@
-class MilestonesController < ProjectResourceController
+class Projects::MilestonesController < Projects::ApplicationController
   before_filter :module_enabled
   before_filter :milestone, only: [:edit, :update, :destroy, :show]
 
diff --git a/app/controllers/network_controller.rb b/app/controllers/projects/network_controller.rb
similarity index 87%
rename from app/controllers/network_controller.rb
rename to app/controllers/projects/network_controller.rb
index 3c8e747ba4e..e4a84f80787 100644
--- a/app/controllers/network_controller.rb
+++ b/app/controllers/projects/network_controller.rb
@@ -1,4 +1,4 @@
-class NetworkController < ProjectResourceController
+class Projects::NetworkController < Projects::ApplicationController
   include ExtractsPath
   include ApplicationHelper
 
diff --git a/app/controllers/notes_controller.rb b/app/controllers/projects/notes_controller.rb
similarity index 96%
rename from app/controllers/notes_controller.rb
rename to app/controllers/projects/notes_controller.rb
index 15ca963f281..ef15e419dbe 100644
--- a/app/controllers/notes_controller.rb
+++ b/app/controllers/projects/notes_controller.rb
@@ -1,4 +1,4 @@
-class NotesController < ProjectResourceController
+class Projects::NotesController < Projects::ApplicationController
   # Authorize
   before_filter :authorize_read_note!
   before_filter :authorize_write_note!, only: [:create]
diff --git a/app/controllers/protected_branches_controller.rb b/app/controllers/projects/protected_branches_controller.rb
similarity index 89%
rename from app/controllers/protected_branches_controller.rb
rename to app/controllers/projects/protected_branches_controller.rb
index fd2734eff84..81531bb0ac0 100644
--- a/app/controllers/protected_branches_controller.rb
+++ b/app/controllers/projects/protected_branches_controller.rb
@@ -1,4 +1,4 @@
-class ProtectedBranchesController < ProjectResourceController
+class Projects::ProtectedBranchesController < Projects::ApplicationController
   # Authorize
   before_filter :authorize_read_project!
   before_filter :require_non_empty_project
diff --git a/app/controllers/raw_controller.rb b/app/controllers/projects/raw_controller.rb
similarity index 88%
rename from app/controllers/raw_controller.rb
rename to app/controllers/projects/raw_controller.rb
index 18b401fe611..0d35f373e9c 100644
--- a/app/controllers/raw_controller.rb
+++ b/app/controllers/projects/raw_controller.rb
@@ -1,5 +1,5 @@
 # Controller for viewing a file's raw
-class RawController < ProjectResourceController
+class Projects::RawController < Projects::ApplicationController
   include ExtractsPath
 
   # Authorize
diff --git a/app/controllers/refs_controller.rb b/app/controllers/projects/refs_controller.rb
similarity index 94%
rename from app/controllers/refs_controller.rb
rename to app/controllers/projects/refs_controller.rb
index cae9193a1da..e5c090e1f4d 100644
--- a/app/controllers/refs_controller.rb
+++ b/app/controllers/projects/refs_controller.rb
@@ -1,4 +1,4 @@
-class RefsController < ProjectResourceController
+class Projects::RefsController < Projects::ApplicationController
   include ExtractsPath
 
   # Authorize
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/projects/repositories_controller.rb
similarity index 91%
rename from app/controllers/repositories_controller.rb
rename to app/controllers/projects/repositories_controller.rb
index a7d393af82b..b65af029803 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/projects/repositories_controller.rb
@@ -1,4 +1,4 @@
-class RepositoriesController < ProjectResourceController
+class Projects::RepositoriesController < Projects::ApplicationController
   # Authorize
   before_filter :authorize_read_project!
   before_filter :authorize_code_access!
diff --git a/app/controllers/services_controller.rb b/app/controllers/projects/services_controller.rb
similarity index 91%
rename from app/controllers/services_controller.rb
rename to app/controllers/projects/services_controller.rb
index 5710f553fa4..6db22186c14 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/projects/services_controller.rb
@@ -1,4 +1,4 @@
-class ServicesController < ProjectResourceController
+class Projects::ServicesController < Projects::ApplicationController
   # Authorize
   before_filter :authorize_admin_project!
   before_filter :service, only: [:edit, :update, :test]
diff --git a/app/controllers/projects/snippets_controller.rb b/app/controllers/projects/snippets_controller.rb
index 1165fa1c583..59063103ecb 100644
--- a/app/controllers/projects/snippets_controller.rb
+++ b/app/controllers/projects/snippets_controller.rb
@@ -14,7 +14,7 @@ class Projects::SnippetsController < Projects::ApplicationController
   # Allow destroy snippet
   before_filter :authorize_admin_project_snippet!, only: [:destroy]
 
-  layout 'project_resource'
+  layout 'projects'
 
   respond_to :html
 
diff --git a/app/controllers/team_members_controller.rb b/app/controllers/projects/team_members_controller.rb
similarity index 95%
rename from app/controllers/team_members_controller.rb
rename to app/controllers/projects/team_members_controller.rb
index 5f2493137c1..07ad7d86153 100644
--- a/app/controllers/team_members_controller.rb
+++ b/app/controllers/projects/team_members_controller.rb
@@ -1,4 +1,4 @@
-class TeamMembersController < ProjectResourceController
+class Projects::TeamMembersController < Projects::ApplicationController
   # Authorize
   before_filter :authorize_read_project!
   before_filter :authorize_admin_project!, except: [:index, :show]
diff --git a/app/controllers/tree_controller.rb b/app/controllers/projects/tree_controller.rb
similarity index 85%
rename from app/controllers/tree_controller.rb
rename to app/controllers/projects/tree_controller.rb
index 24e1329f926..5d543f35665 100644
--- a/app/controllers/tree_controller.rb
+++ b/app/controllers/projects/tree_controller.rb
@@ -1,5 +1,5 @@
 # Controller for viewing a repository's file structure
-class TreeController < ProjectResourceController
+class Projects::TreeController < Projects::ApplicationController
   include ExtractsPath
 
   # Authorize
diff --git a/app/controllers/walls_controller.rb b/app/controllers/projects/walls_controller.rb
similarity index 79%
rename from app/controllers/walls_controller.rb
rename to app/controllers/projects/walls_controller.rb
index 5993a5e2409..834215a1473 100644
--- a/app/controllers/walls_controller.rb
+++ b/app/controllers/projects/walls_controller.rb
@@ -1,4 +1,4 @@
-class WallsController < ProjectResourceController
+class Projects::WallsController < Projects::ApplicationController
   before_filter :module_enabled
 
   respond_to :js, :html
diff --git a/app/controllers/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb
similarity index 97%
rename from app/controllers/wikis_controller.rb
rename to app/controllers/projects/wikis_controller.rb
index be9ae4f37a4..797f3d3dd41 100644
--- a/app/controllers/wikis_controller.rb
+++ b/app/controllers/projects/wikis_controller.rb
@@ -1,4 +1,4 @@
-class WikisController < ProjectResourceController
+class Projects::WikisController < Projects::ApplicationController
   before_filter :authorize_read_wiki!
   before_filter :authorize_write_wiki!, only: [:edit, :create, :history]
   before_filter :authorize_admin_wiki!, only: :destroy
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 858a638c7be..34b1d708ba7 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -1,4 +1,4 @@
-class ProjectsController < ProjectResourceController
+class ProjectsController < Projects::ApplicationController
   skip_before_filter :project, only: [:new, :create]
   skip_before_filter :repository, only: [:new, :create]
 
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 95ca294cd2d..2bc61894193 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -109,7 +109,7 @@ module CommitsHelper
   end
 
   def commit_to_html commit
-    escape_javascript(render 'commits/commit', commit: commit)
+    escape_javascript(render 'projects/commits/commit', commit: commit)
   end
 
   def diff_line_content(line)
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb
index af633f6fd04..d41f8377559 100644
--- a/app/helpers/tree_helper.rb
+++ b/app/helpers/tree_helper.rb
@@ -10,13 +10,13 @@ module TreeHelper
     tree = ""
 
     # Render folders if we have any
-    tree += render partial: 'tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present?
+    tree += render partial: 'projects/tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present?
 
     # Render files if we have any
-    tree += render partial: 'tree/blob_item', collection: files, locals: {type: 'file'} if files.present?
+    tree += render partial: 'projects/tree/blob_item', collection: files, locals: {type: 'file'} if files.present?
 
     # Render submodules if we have any
-    tree += render partial: 'tree/submodule_item', collection: submodules if submodules.present?
+    tree += render partial: 'projects/tree/submodule_item', collection: submodules if submodules.present?
 
     tree.html_safe
   end
diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml
index b41edb9eb60..356e0847ae7 100644
--- a/app/views/dashboard/issues.html.haml
+++ b/app/views/dashboard/issues.html.haml
@@ -22,7 +22,7 @@
 
           %ul.well-list.issues-list
             - group[1].each do |issue|
-              = render issue
+              = render 'projects/issues/issue', issue: issue
       %hr
       = paginate @issues, theme: "gitlab"
     - else
diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml
index 6d642b65cbd..38dac634bf9 100644
--- a/app/views/groups/issues.html.haml
+++ b/app/views/groups/issues.html.haml
@@ -16,7 +16,7 @@
             = link_to_project project
           %ul.well-list.issues-list
             - group[1].each do |issue|
-              = render issue
+              = render 'projects/issues/issue', issue: issue
       %hr
       = paginate @issues, theme: "gitlab"
     - else
diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/projects.html.haml
similarity index 100%
rename from app/views/layouts/project_resource.html.haml
rename to app/views/layouts/projects.html.haml
diff --git a/app/views/blame/_head.html.haml b/app/views/projects/blame/_head.html.haml
similarity index 100%
rename from app/views/blame/_head.html.haml
rename to app/views/projects/blame/_head.html.haml
diff --git a/app/views/blame/show.html.haml b/app/views/projects/blame/show.html.haml
similarity index 96%
rename from app/views/blame/show.html.haml
rename to app/views/projects/blame/show.html.haml
index 297e30356a7..3f68db659fc 100644
--- a/app/views/blame/show.html.haml
+++ b/app/views/projects/blame/show.html.haml
@@ -17,7 +17,7 @@
       %span.file_name
         = @blob.name
         %small= number_to_human_size @blob.size
-      %span.options= render "blob/actions"
+      %span.options= render "projects/blob/actions"
     .file_content.blame
       %table
         - current_line = 1
diff --git a/app/views/blob/_actions.html.haml b/app/views/projects/blob/_actions.html.haml
similarity index 100%
rename from app/views/blob/_actions.html.haml
rename to app/views/projects/blob/_actions.html.haml
diff --git a/app/views/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml
similarity index 100%
rename from app/views/blob/_blob.html.haml
rename to app/views/projects/blob/_blob.html.haml
diff --git a/app/views/blob/_download.html.haml b/app/views/projects/blob/_download.html.haml
similarity index 100%
rename from app/views/blob/_download.html.haml
rename to app/views/projects/blob/_download.html.haml
diff --git a/app/views/blob/_image.html.haml b/app/views/projects/blob/_image.html.haml
similarity index 100%
rename from app/views/blob/_image.html.haml
rename to app/views/projects/blob/_image.html.haml
diff --git a/app/views/blob/_text.html.haml b/app/views/projects/blob/_text.html.haml
similarity index 100%
rename from app/views/blob/_text.html.haml
rename to app/views/projects/blob/_text.html.haml
diff --git a/app/views/blob/show.html.haml b/app/views/projects/blob/show.html.haml
similarity index 100%
rename from app/views/blob/show.html.haml
rename to app/views/projects/blob/show.html.haml
diff --git a/app/views/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml
similarity index 100%
rename from app/views/commit/_commit_box.html.haml
rename to app/views/projects/commit/_commit_box.html.haml
diff --git a/app/views/commit/huge_commit.html.haml b/app/views/projects/commit/huge_commit.html.haml
similarity index 100%
rename from app/views/commit/huge_commit.html.haml
rename to app/views/projects/commit/huge_commit.html.haml
diff --git a/app/views/commit/show.html.haml b/app/views/projects/commit/show.html.haml
similarity index 68%
rename from app/views/commit/show.html.haml
rename to app/views/projects/commit/show.html.haml
index 6cb1a6905ca..603406202ca 100644
--- a/app/views/commit/show.html.haml
+++ b/app/views/projects/commit/show.html.haml
@@ -7,5 +7,5 @@
     and
     %span.cred #{@commit.stats.deletions} deletions
 
-= render "commits/diffs", diffs: @commit.diffs
-= render "notes/notes_with_form"
+= render "projects/commits/diffs", diffs: @commit.diffs
+= render "projects/notes/notes_with_form"
diff --git a/app/views/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml
similarity index 100%
rename from app/views/commits/_commit.html.haml
rename to app/views/projects/commits/_commit.html.haml
diff --git a/app/views/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml
similarity index 100%
rename from app/views/commits/_commits.html.haml
rename to app/views/projects/commits/_commits.html.haml
diff --git a/app/views/commits/_diff_head.html.haml b/app/views/projects/commits/_diff_head.html.haml
similarity index 100%
rename from app/views/commits/_diff_head.html.haml
rename to app/views/projects/commits/_diff_head.html.haml
diff --git a/app/views/commits/_diffs.html.haml b/app/views/projects/commits/_diffs.html.haml
similarity index 89%
rename from app/views/commits/_diffs.html.haml
rename to app/views/projects/commits/_diffs.html.haml
index 3f4d51f753a..8e3cbff8f3e 100644
--- a/app/views/commits/_diffs.html.haml
+++ b/app/views/projects/commits/_diffs.html.haml
@@ -10,7 +10,7 @@
 %p.cgray
   Showing #{pluralize(diffs.count, "changed file")}
 .file-stats
-  = render "commits/diff_head", diffs: diffs
+  = render "projects/commits/diff_head", diffs: diffs
 
 .files
   - unless @suppress_diff
@@ -41,9 +41,9 @@
           -# Skipp all non non-supported blobs
           - next unless file.respond_to?('text?')
           - if file.text?
-            = render "commits/text_file", diff: diff, index: i
+            = render "projects/commits/text_file", diff: diff, index: i
           - elsif file.image?
             - old_file = Gitlab::Git::Blob.new(@repository, @commit.parent_id, @ref, diff.old_path) if @commit.parent_id
-            = render "commits/image", diff: diff, old_file: old_file, file: file, index: i
+            = render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i
           - else
             %p.nothing_here_message No preview for this file type
diff --git a/app/views/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml
similarity index 100%
rename from app/views/commits/_head.html.haml
rename to app/views/projects/commits/_head.html.haml
diff --git a/app/views/commits/_image.html.haml b/app/views/projects/commits/_image.html.haml
similarity index 100%
rename from app/views/commits/_image.html.haml
rename to app/views/projects/commits/_image.html.haml
diff --git a/app/views/commits/_text_file.html.haml b/app/views/projects/commits/_text_file.html.haml
similarity index 86%
rename from app/views/commits/_text_file.html.haml
rename to app/views/projects/commits/_text_file.html.haml
index 8f737e43887..bfc3180a84c 100644
--- a/app/views/commits/_text_file.html.haml
+++ b/app/views/projects/commits/_text_file.html.haml
@@ -13,11 +13,11 @@
         %td.old_line
           = link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", id: line_code
           - if @comments_allowed
-            = render "notes/diff_note_link", line_code: line_code
+            = render "projects/notes/diff_note_link", line_code: line_code
         %td.new_line= link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", id: line_code
         %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line)
 
     - if @reply_allowed
       - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at)
       - unless comments.empty?
-        = render "notes/diff_notes_with_reply", notes: comments
+        = render "projects/notes/diff_notes_with_reply", notes: comments
diff --git a/app/views/commits/show.atom.builder b/app/views/projects/commits/show.atom.builder
similarity index 100%
rename from app/views/commits/show.atom.builder
rename to app/views/projects/commits/show.atom.builder
diff --git a/app/views/commits/show.html.haml b/app/views/projects/commits/show.html.haml
similarity index 100%
rename from app/views/commits/show.html.haml
rename to app/views/projects/commits/show.html.haml
diff --git a/app/views/commits/show.js.haml b/app/views/projects/commits/show.js.haml
similarity index 100%
rename from app/views/commits/show.js.haml
rename to app/views/projects/commits/show.js.haml
diff --git a/app/views/compare/_form.html.haml b/app/views/projects/compare/_form.html.haml
similarity index 100%
rename from app/views/compare/_form.html.haml
rename to app/views/projects/compare/_form.html.haml
diff --git a/app/views/compare/index.html.haml b/app/views/projects/compare/index.html.haml
similarity index 61%
rename from app/views/compare/index.html.haml
rename to app/views/projects/compare/index.html.haml
index 6c9a5fd8305..95cfb60d885 100644
--- a/app/views/compare/index.html.haml
+++ b/app/views/projects/compare/index.html.haml
@@ -1,4 +1,4 @@
-= render "commits/head"
+= render "projects/commits/head"
 
 %h3.page_title
   Compare View
diff --git a/app/views/compare/show.html.haml b/app/views/projects/compare/show.html.haml
similarity index 82%
rename from app/views/compare/show.html.haml
rename to app/views/projects/compare/show.html.haml
index 56c4a113ea0..51e88d1c47d 100644
--- a/app/views/compare/show.html.haml
+++ b/app/views/projects/compare/show.html.haml
@@ -1,4 +1,4 @@
-= render "commits/head"
+= render "projects/commits/head"
 
 %h3.page_title
   Compare View
@@ -20,4 +20,4 @@
 
   - unless @diffs.empty?
     %h4 Diff
-    = render "commits/diffs", diffs: @diffs
+    = render "projects/commits/diffs", diffs: @diffs
diff --git a/app/views/deploy_keys/_deploy_key.html.haml b/app/views/projects/deploy_keys/_deploy_key.html.haml
similarity index 100%
rename from app/views/deploy_keys/_deploy_key.html.haml
rename to app/views/projects/deploy_keys/_deploy_key.html.haml
diff --git a/app/views/deploy_keys/_form.html.haml b/app/views/projects/deploy_keys/_form.html.haml
similarity index 100%
rename from app/views/deploy_keys/_form.html.haml
rename to app/views/projects/deploy_keys/_form.html.haml
diff --git a/app/views/deploy_keys/index.html.haml b/app/views/projects/deploy_keys/index.html.haml
similarity index 100%
rename from app/views/deploy_keys/index.html.haml
rename to app/views/projects/deploy_keys/index.html.haml
diff --git a/app/views/deploy_keys/new.html.haml b/app/views/projects/deploy_keys/new.html.haml
similarity index 100%
rename from app/views/deploy_keys/new.html.haml
rename to app/views/projects/deploy_keys/new.html.haml
diff --git a/app/views/deploy_keys/show.html.haml b/app/views/projects/deploy_keys/show.html.haml
similarity index 100%
rename from app/views/deploy_keys/show.html.haml
rename to app/views/projects/deploy_keys/show.html.haml
diff --git a/app/views/edit_tree/show.html.haml b/app/views/projects/edit_tree/show.html.haml
similarity index 100%
rename from app/views/edit_tree/show.html.haml
rename to app/views/projects/edit_tree/show.html.haml
diff --git a/app/views/graphs/show.html.haml b/app/views/projects/graphs/show.html.haml
similarity index 100%
rename from app/views/graphs/show.html.haml
rename to app/views/projects/graphs/show.html.haml
diff --git a/app/views/graphs/show.js.haml b/app/views/projects/graphs/show.js.haml
similarity index 100%
rename from app/views/graphs/show.js.haml
rename to app/views/projects/graphs/show.js.haml
diff --git a/app/views/hooks/_data_ex.html.erb b/app/views/projects/hooks/_data_ex.html.erb
similarity index 100%
rename from app/views/hooks/_data_ex.html.erb
rename to app/views/projects/hooks/_data_ex.html.erb
diff --git a/app/views/hooks/index.html.haml b/app/views/projects/hooks/index.html.haml
similarity index 100%
rename from app/views/hooks/index.html.haml
rename to app/views/projects/hooks/index.html.haml
diff --git a/app/views/issues/_filter.html.haml b/app/views/projects/issues/_filter.html.haml
similarity index 100%
rename from app/views/issues/_filter.html.haml
rename to app/views/projects/issues/_filter.html.haml
diff --git a/app/views/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml
similarity index 100%
rename from app/views/issues/_form.html.haml
rename to app/views/projects/issues/_form.html.haml
diff --git a/app/views/issues/_head.html.haml b/app/views/projects/issues/_head.html.haml
similarity index 100%
rename from app/views/issues/_head.html.haml
rename to app/views/projects/issues/_head.html.haml
diff --git a/app/views/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml
similarity index 100%
rename from app/views/issues/_issue.html.haml
rename to app/views/projects/issues/_issue.html.haml
diff --git a/app/views/issues/_issues.html.haml b/app/views/projects/issues/_issues.html.haml
similarity index 100%
rename from app/views/issues/_issues.html.haml
rename to app/views/projects/issues/_issues.html.haml
diff --git a/app/views/issues/edit.html.haml b/app/views/projects/issues/edit.html.haml
similarity index 100%
rename from app/views/issues/edit.html.haml
rename to app/views/projects/issues/edit.html.haml
diff --git a/app/views/issues/index.atom.builder b/app/views/projects/issues/index.atom.builder
similarity index 100%
rename from app/views/issues/index.atom.builder
rename to app/views/projects/issues/index.atom.builder
diff --git a/app/views/issues/index.html.haml b/app/views/projects/issues/index.html.haml
similarity index 98%
rename from app/views/issues/index.html.haml
rename to app/views/projects/issues/index.html.haml
index bf33769349a..d3fd9886d45 100644
--- a/app/views/issues/index.html.haml
+++ b/app/views/projects/issues/index.html.haml
@@ -1,4 +1,4 @@
-= render "issues/head"
+= render "head"
 .issues_content
   %h3.page_title
     Issues
diff --git a/app/views/issues/index.js.haml b/app/views/projects/issues/index.js.haml
similarity index 100%
rename from app/views/issues/index.js.haml
rename to app/views/projects/issues/index.js.haml
diff --git a/app/views/issues/new.html.haml b/app/views/projects/issues/new.html.haml
similarity index 100%
rename from app/views/issues/new.html.haml
rename to app/views/projects/issues/new.html.haml
diff --git a/app/views/issues/show.html.haml b/app/views/projects/issues/show.html.haml
similarity index 97%
rename from app/views/issues/show.html.haml
rename to app/views/projects/issues/show.html.haml
index 2e204b8240d..138db92eac0 100644
--- a/app/views/issues/show.html.haml
+++ b/app/views/projects/issues/show.html.haml
@@ -65,4 +65,4 @@
     - else
       = link_to 'Close Issue', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped close_issue", title: "Close Issue"
 
-.voting_notes#notes= render "notes/notes_with_form"
+.voting_notes#notes= render "projects/notes/notes_with_form"
diff --git a/app/views/issues/update.js.haml b/app/views/projects/issues/update.js.haml
similarity index 100%
rename from app/views/issues/update.js.haml
rename to app/views/projects/issues/update.js.haml
diff --git a/app/views/labels/_label.html.haml b/app/views/projects/labels/_label.html.haml
similarity index 100%
rename from app/views/labels/_label.html.haml
rename to app/views/projects/labels/_label.html.haml
diff --git a/app/views/labels/index.html.haml b/app/views/projects/labels/index.html.haml
similarity index 91%
rename from app/views/labels/index.html.haml
rename to app/views/projects/labels/index.html.haml
index 53f411d932c..b6a4b07b9ae 100644
--- a/app/views/labels/index.html.haml
+++ b/app/views/projects/labels/index.html.haml
@@ -1,4 +1,4 @@
-= render "issues/head"
+= render "projects/issues/head"
 
 %h3.page_title
   Labels
diff --git a/app/views/merge_requests/_filter.html.haml b/app/views/projects/merge_requests/_filter.html.haml
similarity index 100%
rename from app/views/merge_requests/_filter.html.haml
rename to app/views/projects/merge_requests/_filter.html.haml
diff --git a/app/views/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml
similarity index 100%
rename from app/views/merge_requests/_form.html.haml
rename to app/views/projects/merge_requests/_form.html.haml
diff --git a/app/views/merge_requests/_head.html.haml b/app/views/projects/merge_requests/_head.html.haml
similarity index 100%
rename from app/views/merge_requests/_head.html.haml
rename to app/views/projects/merge_requests/_head.html.haml
diff --git a/app/views/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml
similarity index 100%
rename from app/views/merge_requests/_merge_request.html.haml
rename to app/views/projects/merge_requests/_merge_request.html.haml
diff --git a/app/views/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
similarity index 71%
rename from app/views/merge_requests/_show.html.haml
rename to app/views/projects/merge_requests/_show.html.haml
index d6e00ca9b8b..987fb4bcc49 100644
--- a/app/views/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -1,11 +1,11 @@
 .merge-request
-  = render "merge_requests/show/mr_title"
-  = render "merge_requests/show/how_to_merge"
-  = render "merge_requests/show/mr_box"
-  = render "merge_requests/show/mr_accept"
+  = render "projects/merge_requests/show/mr_title"
+  = render "projects/merge_requests/show/how_to_merge"
+  = render "projects/merge_requests/show/mr_box"
+  = render "projects/merge_requests/show/mr_accept"
   - if @project.gitlab_ci?
-    = render "merge_requests/show/mr_ci"
-  = render "merge_requests/show/commits"
+    = render "projects/merge_requests/show/mr_ci"
+  = render "projects/merge_requests/show/commits"
 
   - if @commits.present?
     %ul.nav.nav-tabs
@@ -19,9 +19,9 @@
           Diff
 
   .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" }
-    = render "notes/notes_with_form"
+    = render "projects/notes/notes_with_form"
   .diffs.tab-content
-    = render "merge_requests/show/diffs" if @diffs
+    = render "projects/merge_requests/show/diffs" if @diffs
   .status
 
 :javascript
diff --git a/app/views/merge_requests/automerge.js.haml b/app/views/projects/merge_requests/automerge.js.haml
similarity index 100%
rename from app/views/merge_requests/automerge.js.haml
rename to app/views/projects/merge_requests/automerge.js.haml
diff --git a/app/views/merge_requests/branch_from.js.haml b/app/views/projects/merge_requests/branch_from.js.haml
similarity index 100%
rename from app/views/merge_requests/branch_from.js.haml
rename to app/views/projects/merge_requests/branch_from.js.haml
diff --git a/app/views/merge_requests/branch_to.js.haml b/app/views/projects/merge_requests/branch_to.js.haml
similarity index 100%
rename from app/views/merge_requests/branch_to.js.haml
rename to app/views/projects/merge_requests/branch_to.js.haml
diff --git a/app/views/merge_requests/commits.js.haml b/app/views/projects/merge_requests/commits.js.haml
similarity index 100%
rename from app/views/merge_requests/commits.js.haml
rename to app/views/projects/merge_requests/commits.js.haml
diff --git a/app/views/merge_requests/diffs.html.haml b/app/views/projects/merge_requests/diffs.html.haml
similarity index 100%
rename from app/views/merge_requests/diffs.html.haml
rename to app/views/projects/merge_requests/diffs.html.haml
diff --git a/app/views/merge_requests/diffs.js.haml b/app/views/projects/merge_requests/diffs.js.haml
similarity index 59%
rename from app/views/merge_requests/diffs.js.haml
rename to app/views/projects/merge_requests/diffs.js.haml
index 266892c01ef..2964f0ec462 100644
--- a/app/views/merge_requests/diffs.js.haml
+++ b/app/views/projects/merge_requests/diffs.js.haml
@@ -1,2 +1,2 @@
 :plain
-  merge_request.$(".diffs").html("#{escape_javascript(render(partial: "merge_requests/show/diffs"))}");
+  merge_request.$(".diffs").html("#{escape_javascript(render(partial: "projects/merge_requests/show/diffs"))}");
diff --git a/app/views/merge_requests/edit.html.haml b/app/views/projects/merge_requests/edit.html.haml
similarity index 100%
rename from app/views/merge_requests/edit.html.haml
rename to app/views/projects/merge_requests/edit.html.haml
diff --git a/app/views/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml
similarity index 100%
rename from app/views/merge_requests/index.html.haml
rename to app/views/projects/merge_requests/index.html.haml
diff --git a/app/views/merge_requests/invalid.html.haml b/app/views/projects/merge_requests/invalid.html.haml
similarity index 79%
rename from app/views/merge_requests/invalid.html.haml
rename to app/views/projects/merge_requests/invalid.html.haml
index a73bef9e80a..c962811a3e4 100644
--- a/app/views/merge_requests/invalid.html.haml
+++ b/app/views/projects/merge_requests/invalid.html.haml
@@ -1,6 +1,6 @@
 .merge-request
-  = render "merge_requests/show/mr_title"
-  = render "merge_requests/show/mr_box"
+  = render "projects/merge_requests/show/mr_title"
+  = render "projects/merge_requests/show/mr_box"
 
   .alert.alert-error
     %h5
diff --git a/app/views/merge_requests/new.html.haml b/app/views/projects/merge_requests/new.html.haml
similarity index 100%
rename from app/views/merge_requests/new.html.haml
rename to app/views/projects/merge_requests/new.html.haml
diff --git a/app/views/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml
similarity index 100%
rename from app/views/merge_requests/show.html.haml
rename to app/views/projects/merge_requests/show.html.haml
diff --git a/app/views/merge_requests/show.js.haml b/app/views/projects/merge_requests/show.js.haml
similarity index 100%
rename from app/views/merge_requests/show.js.haml
rename to app/views/projects/merge_requests/show.js.haml
diff --git a/app/views/merge_requests/show/_commits.html.haml b/app/views/projects/merge_requests/show/_commits.html.haml
similarity index 79%
rename from app/views/merge_requests/show/_commits.html.haml
rename to app/views/projects/merge_requests/show/_commits.html.haml
index eee786d71ef..8630f02d5d9 100644
--- a/app/views/merge_requests/show/_commits.html.haml
+++ b/app/views/projects/merge_requests/show/_commits.html.haml
@@ -7,19 +7,19 @@
       - if @commits.count > 8
         %ul.first-commits.well-list
           - @commits.first(8).each do |commit|
-            = render "commits/commit", commit: commit
+            = render "projects/commits/commit", commit: commit
           %li.bottom
             8 of #{@commits.count} commits displayed.
             %strong
               %a.show-all-commits Click here to show all
         %ul.all-commits.hide.well-list
           - @commits.each do |commit|
-            = render "commits/commit", commit: commit
+            = render "projects/commits/commit", commit: commit
 
       - else
         %ul.well-list
           - @commits.each do |commit|
-            = render "commits/commit", commit: commit
+            = render "projects/commits/commit", commit: commit
 
 - else
   %h4.nothing_here_message
diff --git a/app/views/merge_requests/show/_diffs.html.haml b/app/views/projects/merge_requests/show/_diffs.html.haml
similarity index 85%
rename from app/views/merge_requests/show/_diffs.html.haml
rename to app/views/projects/merge_requests/show/_diffs.html.haml
index 033d66a4ad4..1d52e824fad 100644
--- a/app/views/merge_requests/show/_diffs.html.haml
+++ b/app/views/projects/merge_requests/show/_diffs.html.haml
@@ -1,5 +1,5 @@
 - if @merge_request.valid_diffs?
-  = render "commits/diffs", diffs: @diffs
+  = render "projects/commits/diffs", diffs: @diffs
 - elsif @merge_request.broken_diffs?
   %h4.nothing_here_message
     Can't load diff.
diff --git a/app/views/merge_requests/show/_how_to_merge.html.haml b/app/views/projects/merge_requests/show/_how_to_merge.html.haml
similarity index 100%
rename from app/views/merge_requests/show/_how_to_merge.html.haml
rename to app/views/projects/merge_requests/show/_how_to_merge.html.haml
diff --git a/app/views/merge_requests/show/_mr_accept.html.haml b/app/views/projects/merge_requests/show/_mr_accept.html.haml
similarity index 100%
rename from app/views/merge_requests/show/_mr_accept.html.haml
rename to app/views/projects/merge_requests/show/_mr_accept.html.haml
diff --git a/app/views/merge_requests/show/_mr_box.html.haml b/app/views/projects/merge_requests/show/_mr_box.html.haml
similarity index 100%
rename from app/views/merge_requests/show/_mr_box.html.haml
rename to app/views/projects/merge_requests/show/_mr_box.html.haml
diff --git a/app/views/merge_requests/show/_mr_ci.html.haml b/app/views/projects/merge_requests/show/_mr_ci.html.haml
similarity index 100%
rename from app/views/merge_requests/show/_mr_ci.html.haml
rename to app/views/projects/merge_requests/show/_mr_ci.html.haml
diff --git a/app/views/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml
similarity index 100%
rename from app/views/merge_requests/show/_mr_title.html.haml
rename to app/views/projects/merge_requests/show/_mr_title.html.haml
diff --git a/app/views/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml
similarity index 100%
rename from app/views/milestones/_form.html.haml
rename to app/views/projects/milestones/_form.html.haml
diff --git a/app/views/milestones/_issues.html.haml b/app/views/projects/milestones/_issues.html.haml
similarity index 100%
rename from app/views/milestones/_issues.html.haml
rename to app/views/projects/milestones/_issues.html.haml
diff --git a/app/views/milestones/_merge_request.html.haml b/app/views/projects/milestones/_merge_request.html.haml
similarity index 100%
rename from app/views/milestones/_merge_request.html.haml
rename to app/views/projects/milestones/_merge_request.html.haml
diff --git a/app/views/milestones/_milestone.html.haml b/app/views/projects/milestones/_milestone.html.haml
similarity index 100%
rename from app/views/milestones/_milestone.html.haml
rename to app/views/projects/milestones/_milestone.html.haml
diff --git a/app/views/milestones/edit.html.haml b/app/views/projects/milestones/edit.html.haml
similarity index 100%
rename from app/views/milestones/edit.html.haml
rename to app/views/projects/milestones/edit.html.haml
diff --git a/app/views/milestones/index.html.haml b/app/views/projects/milestones/index.html.haml
similarity index 96%
rename from app/views/milestones/index.html.haml
rename to app/views/projects/milestones/index.html.haml
index fb7cbc41edf..1bc359398ab 100644
--- a/app/views/milestones/index.html.haml
+++ b/app/views/projects/milestones/index.html.haml
@@ -1,4 +1,4 @@
-= render "issues/head"
+= render "projects/issues/head"
 .milestones_content
   %h3.page_title
     Milestones
diff --git a/app/views/milestones/new.html.haml b/app/views/projects/milestones/new.html.haml
similarity index 100%
rename from app/views/milestones/new.html.haml
rename to app/views/projects/milestones/new.html.haml
diff --git a/app/views/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml
similarity index 99%
rename from app/views/milestones/show.html.haml
rename to app/views/projects/milestones/show.html.haml
index de33ab363e6..d16de0da390 100644
--- a/app/views/milestones/show.html.haml
+++ b/app/views/projects/milestones/show.html.haml
@@ -1,4 +1,4 @@
-= render "issues/head"
+= render "projects/issues/head"
 .row
   .span6
     %h3.page_title
diff --git a/app/views/milestones/update.js.haml b/app/views/projects/milestones/update.js.haml
similarity index 100%
rename from app/views/milestones/update.js.haml
rename to app/views/projects/milestones/update.js.haml
diff --git a/app/views/network/_head.html.haml b/app/views/projects/network/_head.html.haml
similarity index 100%
rename from app/views/network/_head.html.haml
rename to app/views/projects/network/_head.html.haml
diff --git a/app/views/network/show.html.haml b/app/views/projects/network/show.html.haml
similarity index 100%
rename from app/views/network/show.html.haml
rename to app/views/projects/network/show.html.haml
diff --git a/app/views/network/show.json.erb b/app/views/projects/network/show.json.erb
similarity index 100%
rename from app/views/network/show.json.erb
rename to app/views/projects/network/show.json.erb
diff --git a/app/views/notes/_diff_note_link.html.haml b/app/views/projects/notes/_diff_note_link.html.haml
similarity index 100%
rename from app/views/notes/_diff_note_link.html.haml
rename to app/views/projects/notes/_diff_note_link.html.haml
diff --git a/app/views/notes/_diff_notes_with_reply.html.haml b/app/views/projects/notes/_diff_notes_with_reply.html.haml
similarity index 77%
rename from app/views/notes/_diff_notes_with_reply.html.haml
rename to app/views/projects/notes/_diff_notes_with_reply.html.haml
index 0808f86b090..5a1a945f399 100644
--- a/app/views/notes/_diff_notes_with_reply.html.haml
+++ b/app/views/projects/notes/_diff_notes_with_reply.html.haml
@@ -8,4 +8,4 @@
     %ul.notes{ rel: note.discussion_id }
       = render notes
 
-    = render "notes/discussion_reply_button", note: note
+    = render "projects/notes/discussion_reply_button", note: note
diff --git a/app/views/notes/_discussion.html.haml b/app/views/projects/notes/_discussion.html.haml
similarity index 91%
rename from app/views/notes/_discussion.html.haml
rename to app/views/projects/notes/_discussion.html.haml
index eaefb442662..14d81bbb5ce 100644
--- a/app/views/notes/_discussion.html.haml
+++ b/app/views/projects/notes/_discussion.html.haml
@@ -38,7 +38,7 @@
     - if note.for_diff_line?
       - if note.diff
         .content
-          .file= render "notes/discussion_diff", discussion_notes: discussion_notes, note: note
+          .file= render "projects/notes/discussion_diff", discussion_notes: discussion_notes, note: note
       - else
         = link_to 'show outdated discussion', '#', class: 'js-show-outdated-discussion'
         %div.hide.outdated-discussion
@@ -51,7 +51,7 @@
       .content
         .notes{ rel: discussion_notes.first.discussion_id }
           = render discussion_notes
-        = render "notes/discussion_reply_button", note: discussion_notes.first
+        = render "projects/notes/discussion_reply_button", note: discussion_notes.first
 
     -# will be shown when the other one is hidden
     .discussion-hidden.content.hide
diff --git a/app/views/notes/_discussion_diff.html.haml b/app/views/projects/notes/_discussion_diff.html.haml
similarity index 90%
rename from app/views/notes/_discussion_diff.html.haml
rename to app/views/projects/notes/_discussion_diff.html.haml
index 20bdb3f3562..c3f41a1b6b5 100644
--- a/app/views/notes/_discussion_diff.html.haml
+++ b/app/views/projects/notes/_discussion_diff.html.haml
@@ -21,4 +21,4 @@
           %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;"
 
           - if line_code == note.line_code
-            = render "notes/diff_notes_with_reply", notes: discussion_notes
+            = render "projects/notes/diff_notes_with_reply", notes: discussion_notes
diff --git a/app/views/notes/_discussion_reply_button.html.haml b/app/views/projects/notes/_discussion_reply_button.html.haml
similarity index 100%
rename from app/views/notes/_discussion_reply_button.html.haml
rename to app/views/projects/notes/_discussion_reply_button.html.haml
diff --git a/app/views/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml
similarity index 100%
rename from app/views/notes/_form.html.haml
rename to app/views/projects/notes/_form.html.haml
diff --git a/app/views/notes/_form_errors.html.haml b/app/views/projects/notes/_form_errors.html.haml
similarity index 100%
rename from app/views/notes/_form_errors.html.haml
rename to app/views/projects/notes/_form_errors.html.haml
diff --git a/app/views/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
similarity index 100%
rename from app/views/notes/_note.html.haml
rename to app/views/projects/notes/_note.html.haml
diff --git a/app/views/notes/_notes.html.haml b/app/views/projects/notes/_notes.html.haml
similarity index 90%
rename from app/views/notes/_notes.html.haml
rename to app/views/projects/notes/_notes.html.haml
index 4904249aeff..ac8901fe704 100644
--- a/app/views/notes/_notes.html.haml
+++ b/app/views/projects/notes/_notes.html.haml
@@ -8,4 +8,4 @@
 - else
   - @notes.each do |note|
     - next unless note.author
-    = render 'note', note: note
+    = render note
diff --git a/app/views/notes/_notes_with_form.html.haml b/app/views/projects/notes/_notes_with_form.html.haml
similarity index 86%
rename from app/views/notes/_notes_with_form.html.haml
rename to app/views/projects/notes/_notes_with_form.html.haml
index 38d1a3c93c0..ac28c7432ef 100644
--- a/app/views/notes/_notes_with_form.html.haml
+++ b/app/views/projects/notes/_notes_with_form.html.haml
@@ -3,7 +3,7 @@
 
 .js-main-target-form
 - if can? current_user, :write_note, @project
-  = render "notes/form"
+  = render "projects/notes/form"
 
 :javascript
   NoteList.init("#{@target_id}", "#{@target_type}", "#{project_notes_path(@project)}");
diff --git a/app/views/notes/create.js.haml b/app/views/projects/notes/create.js.haml
similarity index 71%
rename from app/views/notes/create.js.haml
rename to app/views/projects/notes/create.js.haml
index 43e79c69f11..c113b3482ec 100644
--- a/app/views/notes/create.js.haml
+++ b/app/views/projects/notes/create.js.haml
@@ -1,17 +1,17 @@
 - if @note.valid?
-  var noteHtml = "#{escape_javascript(render "notes/note", note: @note)}";
+  var noteHtml = "#{escape_javascript(render @note)}";
 
   - if note_for_main_target?(@note)
     NoteList.appendNewNote(#{@note.id}, noteHtml);
   - else
     :plain
-      var firstDiscussionNoteHtml = "#{escape_javascript(render "notes/diff_notes_with_reply", notes: [@note])}";
+      var firstDiscussionNoteHtml = "#{escape_javascript(render "projects/notes/diff_notes_with_reply", notes: [@note])}";
       NoteList.appendNewDiscussionNote("#{@note.discussion_id}",
                                        firstDiscussionNoteHtml,
                                        noteHtml);
 
 - else
-  var errorsHtml = "#{escape_javascript(render 'notes/form_errors', note: @note)}";
+  var errorsHtml = "#{escape_javascript(render 'projects/notes/form_errors', note: @note)}";
   - if note_for_main_target?(@note)
     NoteList.errorsOnForm(errorsHtml);
   - else
diff --git a/app/views/notes/index.js.haml b/app/views/projects/notes/index.js.haml
similarity index 60%
rename from app/views/notes/index.js.haml
rename to app/views/projects/notes/index.js.haml
index 826862b1a86..6c4ed203497 100644
--- a/app/views/notes/index.js.haml
+++ b/app/views/projects/notes/index.js.haml
@@ -1,4 +1,4 @@
 - unless @notes.blank?
-  var notesHtml = "#{escape_javascript(render 'notes/notes')}";
+  var notesHtml = "#{escape_javascript(render 'projects/notes/notes')}";
   - new_note_ids = @notes.map(&:id)
   NoteList.setContent(#{new_note_ids}, notesHtml);
diff --git a/app/views/protected_branches/index.html.haml b/app/views/projects/protected_branches/index.html.haml
similarity index 96%
rename from app/views/protected_branches/index.html.haml
rename to app/views/projects/protected_branches/index.html.haml
index a338344c52d..f741f2f0495 100644
--- a/app/views/protected_branches/index.html.haml
+++ b/app/views/projects/protected_branches/index.html.haml
@@ -1,7 +1,7 @@
-= render "commits/head"
+= render "projects/commits/head"
 .row
   .span3
-    = render "repositories/filter"
+    = render "projects/repositories/filter"
   .span9
     .alert
       %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}.
diff --git a/app/views/refs/logs_tree.js.haml b/app/views/projects/refs/logs_tree.js.haml
similarity index 86%
rename from app/views/refs/logs_tree.js.haml
rename to app/views/projects/refs/logs_tree.js.haml
index 0b517327139..1bea286a879 100644
--- a/app/views/refs/logs_tree.js.haml
+++ b/app/views/projects/refs/logs_tree.js.haml
@@ -5,4 +5,4 @@
   :plain
     var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}");
     row.find("td.tree_time_ago").html('#{escape_javascript time_ago_in_words(commit.committed_date)} ago');
-    row.find("td.tree_commit").html('#{escape_javascript render("tree/tree_commit_column", commit: commit)}');
+    row.find("td.tree_commit").html('#{escape_javascript render("projects/tree/tree_commit_column", commit: commit)}');
diff --git a/app/views/repositories/_branch.html.haml b/app/views/projects/repositories/_branch.html.haml
similarity index 100%
rename from app/views/repositories/_branch.html.haml
rename to app/views/projects/repositories/_branch.html.haml
diff --git a/app/views/repositories/_feed.html.haml b/app/views/projects/repositories/_feed.html.haml
similarity index 100%
rename from app/views/repositories/_feed.html.haml
rename to app/views/projects/repositories/_feed.html.haml
diff --git a/app/views/repositories/_filter.html.haml b/app/views/projects/repositories/_filter.html.haml
similarity index 100%
rename from app/views/repositories/_filter.html.haml
rename to app/views/projects/repositories/_filter.html.haml
diff --git a/app/views/repositories/branches.html.haml b/app/views/projects/repositories/branches.html.haml
similarity index 70%
rename from app/views/repositories/branches.html.haml
rename to app/views/projects/repositories/branches.html.haml
index 14b5082e44e..2bdd304cdac 100644
--- a/app/views/repositories/branches.html.haml
+++ b/app/views/projects/repositories/branches.html.haml
@@ -1,4 +1,4 @@
-= render "commits/head"
+= render "projects/commits/head"
 .row
   .span3
     = render "filter"
@@ -12,4 +12,4 @@
             %th
         %tbody
           - @branches.each do |branch|
-            = render "repositories/branch", branch: branch
+            = render "projects/repositories/branch", branch: branch
diff --git a/app/views/repositories/show.html.haml b/app/views/projects/repositories/show.html.haml
similarity index 67%
rename from app/views/repositories/show.html.haml
rename to app/views/projects/repositories/show.html.haml
index e58e16f8bf1..84a32e62426 100644
--- a/app/views/repositories/show.html.haml
+++ b/app/views/projects/repositories/show.html.haml
@@ -1,4 +1,4 @@
-= render "commits/head"
+= render "projects/commits/head"
 .row
   .span3
     = render "filter"
@@ -10,5 +10,5 @@
           %th Last commit
           %th
       - @activities.each do |update|
-        = render "repositories/branch", branch: update.head
+        = render "branch", branch: update.head
 
diff --git a/app/views/repositories/stats.html.haml b/app/views/projects/repositories/stats.html.haml
similarity index 95%
rename from app/views/repositories/stats.html.haml
rename to app/views/projects/repositories/stats.html.haml
index 6d1fb4686ea..dfdbc898912 100644
--- a/app/views/repositories/stats.html.haml
+++ b/app/views/projects/repositories/stats.html.haml
@@ -1,4 +1,4 @@
-= render "commits/head"
+= render "projects/commits/head"
 .row
   .span6
     %div#activity-chart.chart
diff --git a/app/views/repositories/tags.html.haml b/app/views/projects/repositories/tags.html.haml
similarity index 97%
rename from app/views/repositories/tags.html.haml
rename to app/views/projects/repositories/tags.html.haml
index bef5cd0841b..5972ea6c531 100644
--- a/app/views/repositories/tags.html.haml
+++ b/app/views/projects/repositories/tags.html.haml
@@ -1,4 +1,4 @@
-= render "commits/head"
+= render "projects/commits/head"
 - unless @tags.empty?
   %ul.bordered-list
     - @tags.each do |tag|
diff --git a/app/views/services/_form.html.haml b/app/views/projects/services/_form.html.haml
similarity index 100%
rename from app/views/services/_form.html.haml
rename to app/views/projects/services/_form.html.haml
diff --git a/app/views/services/edit.html.haml b/app/views/projects/services/edit.html.haml
similarity index 100%
rename from app/views/services/edit.html.haml
rename to app/views/projects/services/edit.html.haml
diff --git a/app/views/services/index.html.haml b/app/views/projects/services/index.html.haml
similarity index 100%
rename from app/views/services/index.html.haml
rename to app/views/projects/services/index.html.haml
diff --git a/app/views/projects/snippets/show.html.haml b/app/views/projects/snippets/show.html.haml
index da93e4bdbb1..36161c5706c 100644
--- a/app/views/projects/snippets/show.html.haml
+++ b/app/views/projects/snippets/show.html.haml
@@ -10,4 +10,4 @@
       = @snippet.author_name
 %br
 %div= render 'projects/snippets/blob'
-%div#notes= render "notes/notes_with_form"
+%div#notes= render "projects/notes/notes_with_form"
diff --git a/app/views/team_members/_form.html.haml b/app/views/projects/team_members/_form.html.haml
similarity index 100%
rename from app/views/team_members/_form.html.haml
rename to app/views/projects/team_members/_form.html.haml
diff --git a/app/views/team_members/_group_members.html.haml b/app/views/projects/team_members/_group_members.html.haml
similarity index 100%
rename from app/views/team_members/_group_members.html.haml
rename to app/views/projects/team_members/_group_members.html.haml
diff --git a/app/views/team_members/_team.html.haml b/app/views/projects/team_members/_team.html.haml
similarity index 66%
rename from app/views/team_members/_team.html.haml
rename to app/views/projects/team_members/_team.html.haml
index 2a663bd9941..99231e92152 100644
--- a/app/views/team_members/_team.html.haml
+++ b/app/views/projects/team_members/_team.html.haml
@@ -6,4 +6,4 @@
       members (#{members.count})
     %ul.well-list
       - members.each do |team_member|
-        = render 'team_members/team_member', member: team_member, current_user_can_admin_project: can_admin_project
+        = render 'team_member', member: team_member, current_user_can_admin_project: can_admin_project
diff --git a/app/views/team_members/_team_member.html.haml b/app/views/projects/team_members/_team_member.html.haml
similarity index 100%
rename from app/views/team_members/_team_member.html.haml
rename to app/views/projects/team_members/_team_member.html.haml
diff --git a/app/views/team_members/import.html.haml b/app/views/projects/team_members/import.html.haml
similarity index 100%
rename from app/views/team_members/import.html.haml
rename to app/views/projects/team_members/import.html.haml
diff --git a/app/views/team_members/index.html.haml b/app/views/projects/team_members/index.html.haml
similarity index 85%
rename from app/views/team_members/index.html.haml
rename to app/views/projects/team_members/index.html.haml
index 59c65a66794..8f81390ca13 100644
--- a/app/views/team_members/index.html.haml
+++ b/app/views/projects/team_members/index.html.haml
@@ -12,5 +12,5 @@
   Read more about project permissions
   %strong= link_to "here", help_permissions_path, class: "vlink"
 - if @group
-  = render "team_members/group_members"
-= render "team_members/team", members: @users_projects
+  = render "group_members"
+= render "team", members: @users_projects
diff --git a/app/views/projects/team_members/new.html.haml b/app/views/projects/team_members/new.html.haml
new file mode 100644
index 00000000000..b1bc3ba0eba
--- /dev/null
+++ b/app/views/projects/team_members/new.html.haml
@@ -0,0 +1 @@
+= render "form"
diff --git a/app/views/team_members/update.js.haml b/app/views/projects/team_members/update.js.haml
similarity index 100%
rename from app/views/team_members/update.js.haml
rename to app/views/projects/team_members/update.js.haml
diff --git a/app/views/tree/_blob_item.html.haml b/app/views/projects/tree/_blob_item.html.haml
similarity index 100%
rename from app/views/tree/_blob_item.html.haml
rename to app/views/projects/tree/_blob_item.html.haml
diff --git a/app/views/tree/_readme.html.haml b/app/views/projects/tree/_readme.html.haml
similarity index 100%
rename from app/views/tree/_readme.html.haml
rename to app/views/projects/tree/_readme.html.haml
diff --git a/app/views/tree/_submodule_item.html.haml b/app/views/projects/tree/_submodule_item.html.haml
similarity index 100%
rename from app/views/tree/_submodule_item.html.haml
rename to app/views/projects/tree/_submodule_item.html.haml
diff --git a/app/views/tree/_tree.html.haml b/app/views/projects/tree/_tree.html.haml
similarity index 95%
rename from app/views/tree/_tree.html.haml
rename to app/views/projects/tree/_tree.html.haml
index cc45faa1459..0b1148b3e74 100644
--- a/app/views/tree/_tree.html.haml
+++ b/app/views/projects/tree/_tree.html.haml
@@ -40,7 +40,7 @@
     = render_tree(tree)
 
   - if tree.readme
-    = render "tree/readme", readme: tree.readme
+    = render "projects/tree/readme", readme: tree.readme
 
 %div.tree_progress
 
diff --git a/app/views/tree/_tree_commit_column.html.haml b/app/views/projects/tree/_tree_commit_column.html.haml
similarity index 100%
rename from app/views/tree/_tree_commit_column.html.haml
rename to app/views/projects/tree/_tree_commit_column.html.haml
diff --git a/app/views/tree/_tree_item.html.haml b/app/views/projects/tree/_tree_item.html.haml
similarity index 100%
rename from app/views/tree/_tree_item.html.haml
rename to app/views/projects/tree/_tree_item.html.haml
diff --git a/app/views/tree/show.html.haml b/app/views/projects/tree/show.html.haml
similarity index 100%
rename from app/views/tree/show.html.haml
rename to app/views/projects/tree/show.html.haml
diff --git a/app/views/walls/show.html.haml b/app/views/projects/walls/show.html.haml
similarity index 100%
rename from app/views/walls/show.html.haml
rename to app/views/projects/walls/show.html.haml
diff --git a/app/views/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml
similarity index 100%
rename from app/views/wikis/_form.html.haml
rename to app/views/projects/wikis/_form.html.haml
diff --git a/app/views/wikis/_main_links.html.haml b/app/views/projects/wikis/_main_links.html.haml
similarity index 100%
rename from app/views/wikis/_main_links.html.haml
rename to app/views/projects/wikis/_main_links.html.haml
diff --git a/app/views/wikis/_nav.html.haml b/app/views/projects/wikis/_nav.html.haml
similarity index 95%
rename from app/views/wikis/_nav.html.haml
rename to app/views/projects/wikis/_nav.html.haml
index 09a1986e105..d62b46a7e5b 100644
--- a/app/views/wikis/_nav.html.haml
+++ b/app/views/projects/wikis/_nav.html.haml
@@ -16,4 +16,4 @@
         %i.icon-plus
         New Page
 
-= render 'wikis/new'
+= render 'projects/wikis/new'
diff --git a/app/views/wikis/_new.html.haml b/app/views/projects/wikis/_new.html.haml
similarity index 100%
rename from app/views/wikis/_new.html.haml
rename to app/views/projects/wikis/_new.html.haml
diff --git a/app/views/wikis/edit.html.haml b/app/views/projects/wikis/edit.html.haml
similarity index 94%
rename from app/views/wikis/edit.html.haml
rename to app/views/projects/wikis/edit.html.haml
index cd74a738f8b..4e318c92db3 100644
--- a/app/views/wikis/edit.html.haml
+++ b/app/views/projects/wikis/edit.html.haml
@@ -1,4 +1,4 @@
-= render 'wikis/nav'
+= render 'nav'
 %h3.page_title
   Editing page
   = render 'main_links'
diff --git a/app/views/wikis/empty.html.haml b/app/views/projects/wikis/empty.html.haml
similarity index 100%
rename from app/views/wikis/empty.html.haml
rename to app/views/projects/wikis/empty.html.haml
diff --git a/app/views/wikis/git_access.html.haml b/app/views/projects/wikis/git_access.html.haml
similarity index 98%
rename from app/views/wikis/git_access.html.haml
rename to app/views/projects/wikis/git_access.html.haml
index 0b363cbb8c9..71e2b48d370 100644
--- a/app/views/wikis/git_access.html.haml
+++ b/app/views/projects/wikis/git_access.html.haml
@@ -1,4 +1,4 @@
-= render 'wikis/nav'
+= render 'nav'
 %h3.page_title
   Git Access
   %strong= @gollum_wiki.path_with_namespace
diff --git a/app/views/wikis/history.html.haml b/app/views/projects/wikis/history.html.haml
similarity index 97%
rename from app/views/wikis/history.html.haml
rename to app/views/projects/wikis/history.html.haml
index 243c5c7c2c3..138c384353d 100644
--- a/app/views/wikis/history.html.haml
+++ b/app/views/projects/wikis/history.html.haml
@@ -1,4 +1,4 @@
-= render 'wikis/nav'
+= render 'nav'
 %h3.page_title
   %span.light History for
   = @wiki.title.titleize
diff --git a/app/views/wikis/pages.html.haml b/app/views/projects/wikis/pages.html.haml
similarity index 96%
rename from app/views/wikis/pages.html.haml
rename to app/views/projects/wikis/pages.html.haml
index 48c11b8e395..07e942ec62f 100644
--- a/app/views/wikis/pages.html.haml
+++ b/app/views/projects/wikis/pages.html.haml
@@ -1,4 +1,4 @@
-= render 'wikis/nav'
+= render 'nav'
 %h3.page_title
   All Pages
   = render 'main_links'
diff --git a/app/views/wikis/show.html.haml b/app/views/projects/wikis/show.html.haml
similarity index 96%
rename from app/views/wikis/show.html.haml
rename to app/views/projects/wikis/show.html.haml
index b40bbcb4923..d9d57e2d8be 100644
--- a/app/views/wikis/show.html.haml
+++ b/app/views/projects/wikis/show.html.haml
@@ -1,4 +1,4 @@
-= render 'wikis/nav'
+= render 'nav'
 %h3.page_title
   = @wiki.title.titleize
   = render 'main_links'
diff --git a/app/views/shared/_merge_requests.html.haml b/app/views/shared/_merge_requests.html.haml
index a2800b11d8d..a7037d5987a 100644
--- a/app/views/shared/_merge_requests.html.haml
+++ b/app/views/shared/_merge_requests.html.haml
@@ -6,7 +6,7 @@
         = link_to_project project
       %ul.well-list.mr-list
         - group[1].each do |merge_request|
-          = render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
+          = render 'projects/merge_requests/merge_request', merge_request: merge_request
   %hr
   = paginate @merge_requests, theme: "gitlab"
 
diff --git a/app/views/team_members/new.html.haml b/app/views/team_members/new.html.haml
deleted file mode 100644
index 4f70fb4b046..00000000000
--- a/app/views/team_members/new.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "team_members/form"
diff --git a/config/routes.rb b/config/routes.rb
index 3b6a861b668..a59e6b7ce5b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -160,135 +160,135 @@ Gitlab::Application.routes.draw do
       get :autocomplete_sources
     end
 
-    resources :blob,    only: [:show], constraints: {id: /.+/}
-    resources :raw,    only: [:show], constraints: {id: /.+/}
-    resources :tree,    only: [:show], constraints: {id: /.+/, format: /(html|js)/ }
-    resources :edit_tree,    only: [:show, :update], constraints: {id: /.+/}, path: 'edit'
-    resources :commit,  only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
-    resources :commits, only: [:show], constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}
-    resources :compare, only: [:index, :create]
-    resources :blame,   only: [:show], constraints: {id: /.+/}
-    resources :network,   only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
-    resources :graphs, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
-    match "/compare/:from...:to" => "compare#show", as: "compare", via: [:get, :post], constraints: {from: /.+/, to: /.+/}
-
     scope module: :projects do
-      resources :snippets do
-        member do
-          get "raw"
+      resources :blob,    only: [:show], constraints: {id: /.+/}
+      resources :raw,    only: [:show], constraints: {id: /.+/}
+      resources :tree,    only: [:show], constraints: {id: /.+/, format: /(html|js)/ }
+      resources :edit_tree,    only: [:show, :update], constraints: {id: /.+/}, path: 'edit'
+      resources :commit,  only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
+      resources :commits, only: [:show], constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}
+      resources :compare, only: [:index, :create]
+      resources :blame,   only: [:show], constraints: {id: /.+/}
+      resources :network,   only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
+      resources :graphs, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
+      match "/compare/:from...:to" => "compare#show", as: "compare", via: [:get, :post], constraints: {from: /.+/, to: /.+/}
+
+        resources :snippets do
+          member do
+            get "raw"
+          end
         end
-      end
-    end
 
-    resources :wikis, only: [:show, :edit, :destroy, :create] do
-      collection do
-        get :pages
-        put ':id' => 'wikis#update'
-        get :git_access
-      end
+      resources :wikis, only: [:show, :edit, :destroy, :create] do
+        collection do
+          get :pages
+          put ':id' => 'wikis#update'
+          get :git_access
+        end
 
-      member do
-        get "history"
+        member do
+          get "history"
+        end
       end
-    end
 
-    resource :wall, only: [:show] do
-      member do
-        get 'notes'
+      resource :wall, only: [:show] do
+        member do
+          get 'notes'
+        end
       end
-    end
 
-    resource :repository, only: [:show] do
-      member do
-        get "branches"
-        get "tags"
-        get "stats"
-        get "archive"
+      resource :repository, only: [:show] do
+        member do
+          get "branches"
+          get "tags"
+          get "stats"
+          get "archive"
+        end
       end
-    end
 
-    resources :services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do
-      member do
-        get :test
+      resources :services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do
+        member do
+          get :test
+        end
       end
-    end
 
-    resources :deploy_keys do
-      member do
-        put :enable
-        put :disable
+      resources :deploy_keys do
+        member do
+          put :enable
+          put :disable
+        end
       end
-    end
 
-    resources :protected_branches, only: [:index, :create, :destroy]
+      resources :protected_branches, only: [:index, :create, :destroy]
 
-    resources :refs, only: [] do
-      collection do
-        get "switch"
-      end
+      resources :refs, only: [] do
+        collection do
+          get "switch"
+        end
 
-      member do
-        # tree viewer logs
-        get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ }
-        get "logs_tree/:path" => "refs#logs_tree",
-          as: :logs_file,
-          constraints: {
-            id:   /[a-zA-Z.0-9\/_\-#%+]+/,
-            path: /.*/
-          }
+        member do
+          # tree viewer logs
+          get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ }
+          get "logs_tree/:path" => "refs#logs_tree",
+            as: :logs_file,
+            constraints: {
+              id:   /[a-zA-Z.0-9\/_\-#%+]+/,
+              path: /.*/
+            }
+        end
       end
-    end
 
-    resources :merge_requests, constraints: {id: /\d+/}, except: [:destroy] do
-      member do
-        get :diffs
-        get :automerge
-        get :automerge_check
-        get :ci_status
-      end
+      resources :merge_requests, constraints: {id: /\d+/}, except: [:destroy] do
+        member do
+          get :diffs
+          get :automerge
+          get :automerge_check
+          get :ci_status
+        end
 
-      collection do
-        get :branch_from
-        get :branch_to
+        collection do
+          get :branch_from
+          get :branch_to
+        end
       end
-    end
 
-    resources :hooks, only: [:index, :create, :destroy] do
-      member do
-        get :test
+      resources :hooks, only: [:index, :create, :destroy] do
+        member do
+          get :test
+        end
       end
-    end
 
-    resources :team, controller: 'team_members', only: [:index]
-    resources :milestones, except: [:destroy]
+      resources :team, controller: 'team_members', only: [:index]
+      resources :milestones, except: [:destroy]
 
-    resources :labels, only: [:index] do
-      collection do
-        post :generate
+      resources :labels, only: [:index] do
+        collection do
+          post :generate
+        end
       end
-    end
 
-    resources :issues, except: [:destroy] do
-      collection do
-        post  :bulk_update
+      resources :issues, except: [:destroy] do
+        collection do
+          post  :bulk_update
+        end
       end
-    end
 
-    resources :team_members, except: [:index, :edit] do
-      collection do
+      resources :team_members, except: [:index, :edit] do
+        collection do
 
-        # Used for import team
-        # from another project
-        get :import
-        post :apply_import
+          # Used for import team
+          # from another project
+          get :import
+          post :apply_import
+        end
       end
-    end
 
-    resources :notes, only: [:index, :create, :destroy] do
-      collection do
-        post :preview
+      resources :notes, only: [:index, :create, :destroy] do
+        collection do
+          post :preview
+        end
+      end
       end
-    end
   end
 
   root to: "dashboard#show"
-- 
GitLab