Commit e55e23bb authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'refactor/projects_controllers' of /home/git/repositories/gitlab/gitlabhq into 6-0-dev

parents 95791316 40bca524
...@@ -18,19 +18,19 @@ class Dispatcher ...@@ -18,19 +18,19 @@ class Dispatcher
path = page.split(':') path = page.split(':')
switch page switch page
when 'issues:index' when 'projects:issues:index'
Issues.init() Issues.init()
when 'dashboard:show' when 'dashboard:show'
new Dashboard() new Dashboard()
when 'commit:show' when 'projects:commit:show'
new Commit() new Commit()
when 'groups:show', 'teams:show', 'projects:show' when 'groups:show', 'projects:show'
Pager.init(20, true) Pager.init(20, true)
when 'projects:new', 'projects:edit' when 'projects:new', 'projects:edit'
new Project() new Project()
when 'walls:show' when 'projects:walls:show'
new Wall(project_id) new Wall(project_id)
when 'teams:members:index' when 'projects:teams:members:index'
new TeamMembers() new TeamMembers()
when 'groups:people' when 'groups:people'
new GroupMembers() new GroupMembers()
......
class ProjectResourceController < ApplicationController
before_filter :project
before_filter :repository
end
class Projects::ApplicationController < ApplicationController class Projects::ApplicationController < ApplicationController
before_filter :project before_filter :project
before_filter :repository before_filter :repository
layout 'projects'
end end
# Controller for viewing a file's blame # Controller for viewing a file's blame
class BlameController < ProjectResourceController class Projects::BlameController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
# Authorize # Authorize
......
# Controller for viewing a file's blame # Controller for viewing a file's blame
class BlobController < ProjectResourceController class Projects::BlobController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
# Authorize # Authorize
......
# Controller for a specific Commit # Controller for a specific Commit
# #
# Not to be confused with CommitsController, plural. # Not to be confused with CommitsController, plural.
class CommitController < ProjectResourceController class Projects::CommitController < Projects::ApplicationController
# Authorize # Authorize
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :authorize_code_access! before_filter :authorize_code_access!
......
require "base64" require "base64"
class CommitsController < ProjectResourceController class Projects::CommitsController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
# Authorize # Authorize
......
class CompareController < ProjectResourceController class Projects::CompareController < Projects::ApplicationController
# Authorize # Authorize
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :authorize_code_access! before_filter :authorize_code_access!
......
class DeployKeysController < ProjectResourceController class Projects::DeployKeysController < Projects::ApplicationController
respond_to :html respond_to :html
# Authorize # Authorize
......
# Controller for edit a repository's file # Controller for edit a repository's file
class EditTreeController < ProjectResourceController class Projects::EditTreeController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
# Authorize # Authorize
......
class GraphsController < ProjectResourceController class Projects::GraphsController < Projects::ApplicationController
# Authorize # Authorize
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :authorize_code_access! before_filter :authorize_code_access!
......
class HooksController < ProjectResourceController class Projects::HooksController < Projects::ApplicationController
# Authorize # Authorize
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :authorize_admin_project!, only: [:new, :create, :destroy] before_filter :authorize_admin_project!, only: [:new, :create, :destroy]
......
class IssuesController < ProjectResourceController class Projects::IssuesController < Projects::ApplicationController
before_filter :module_enabled before_filter :module_enabled
before_filter :issue, only: [:edit, :update, :show] before_filter :issue, only: [:edit, :update, :show]
......
class LabelsController < ProjectResourceController class Projects::LabelsController < Projects::ApplicationController
before_filter :module_enabled before_filter :module_enabled
# Allow read any issue # Allow read any issue
......
require 'gitlab/satellite/satellite' require 'gitlab/satellite/satellite'
class MergeRequestsController < ProjectResourceController class Projects::MergeRequestsController < Projects::ApplicationController
before_filter :module_enabled before_filter :module_enabled
before_filter :merge_request, only: [:edit, :update, :show, :commits, :diffs, :automerge, :automerge_check, :ci_status] before_filter :merge_request, only: [:edit, :update, :show, :commits, :diffs, :automerge, :automerge_check, :ci_status]
before_filter :validates_merge_request, only: [:show, :diffs] before_filter :validates_merge_request, only: [:show, :diffs]
......
class MilestonesController < ProjectResourceController class Projects::MilestonesController < Projects::ApplicationController
before_filter :module_enabled before_filter :module_enabled
before_filter :milestone, only: [:edit, :update, :destroy, :show] before_filter :milestone, only: [:edit, :update, :destroy, :show]
......
class NetworkController < ProjectResourceController class Projects::NetworkController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
include ApplicationHelper include ApplicationHelper
......
class NotesController < ProjectResourceController class Projects::NotesController < Projects::ApplicationController
# Authorize # Authorize
before_filter :authorize_read_note! before_filter :authorize_read_note!
before_filter :authorize_write_note!, only: [:create] before_filter :authorize_write_note!, only: [:create]
......
class ProtectedBranchesController < ProjectResourceController class Projects::ProtectedBranchesController < Projects::ApplicationController
# Authorize # Authorize
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :require_non_empty_project before_filter :require_non_empty_project
......
# Controller for viewing a file's raw # Controller for viewing a file's raw
class RawController < ProjectResourceController class Projects::RawController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
# Authorize # Authorize
......
class RefsController < ProjectResourceController class Projects::RefsController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
# Authorize # Authorize
......
class RepositoriesController < ProjectResourceController class Projects::RepositoriesController < Projects::ApplicationController
# Authorize # Authorize
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :authorize_code_access! before_filter :authorize_code_access!
......
class ServicesController < ProjectResourceController class Projects::ServicesController < Projects::ApplicationController
# Authorize # Authorize
before_filter :authorize_admin_project! before_filter :authorize_admin_project!
before_filter :service, only: [:edit, :update, :test] before_filter :service, only: [:edit, :update, :test]
......
...@@ -14,7 +14,7 @@ class Projects::SnippetsController < Projects::ApplicationController ...@@ -14,7 +14,7 @@ class Projects::SnippetsController < Projects::ApplicationController
# Allow destroy snippet # Allow destroy snippet
before_filter :authorize_admin_project_snippet!, only: [:destroy] before_filter :authorize_admin_project_snippet!, only: [:destroy]
layout 'project_resource' layout 'projects'
respond_to :html respond_to :html
......
class TeamMembersController < ProjectResourceController class Projects::TeamMembersController < Projects::ApplicationController
# Authorize # Authorize
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :authorize_admin_project!, except: [:index, :show] before_filter :authorize_admin_project!, except: [:index, :show]
......
# Controller for viewing a repository's file structure # Controller for viewing a repository's file structure
class TreeController < ProjectResourceController class Projects::TreeController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
# Authorize # Authorize
......
class WallsController < ProjectResourceController class Projects::WallsController < Projects::ApplicationController
before_filter :module_enabled before_filter :module_enabled
respond_to :js, :html respond_to :js, :html
......
class WikisController < ProjectResourceController class Projects::WikisController < Projects::ApplicationController
before_filter :authorize_read_wiki! before_filter :authorize_read_wiki!
before_filter :authorize_write_wiki!, only: [:edit, :create, :history] before_filter :authorize_write_wiki!, only: [:edit, :create, :history]
before_filter :authorize_admin_wiki!, only: :destroy before_filter :authorize_admin_wiki!, only: :destroy
......
class ProjectsController < ProjectResourceController class ProjectsController < Projects::ApplicationController
skip_before_filter :project, only: [:new, :create] skip_before_filter :project, only: [:new, :create]
skip_before_filter :repository, only: [:new, :create] skip_before_filter :repository, only: [:new, :create]
......
...@@ -109,7 +109,7 @@ module CommitsHelper ...@@ -109,7 +109,7 @@ module CommitsHelper
end end
def commit_to_html commit def commit_to_html commit
escape_javascript(render 'commits/commit', commit: commit) escape_javascript(render 'projects/commits/commit', commit: commit)
end end
def diff_line_content(line) def diff_line_content(line)
......
...@@ -10,13 +10,13 @@ module TreeHelper ...@@ -10,13 +10,13 @@ module TreeHelper
tree = "" tree = ""
# Render folders if we have any # 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 # 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 # 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 tree.html_safe
end end
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
%ul.well-list.issues-list %ul.well-list.issues-list
- group[1].each do |issue| - group[1].each do |issue|
= render issue = render 'projects/issues/issue', issue: issue
%hr %hr
= paginate @issues, theme: "gitlab" = paginate @issues, theme: "gitlab"
- else - else
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
= link_to_project project = link_to_project project
%ul.well-list.issues-list %ul.well-list.issues-list
- group[1].each do |issue| - group[1].each do |issue|
= render issue = render 'projects/issues/issue', issue: issue
%hr %hr
= paginate @issues, theme: "gitlab" = paginate @issues, theme: "gitlab"
- else - else
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
%span.file_name %span.file_name
= @blob.name = @blob.name
%small= number_to_human_size @blob.size %small= number_to_human_size @blob.size
%span.options= render "blob/actions" %span.options= render "projects/blob/actions"
.file_content.blame .file_content.blame
%table %table
- current_line = 1 - current_line = 1
......
...@@ -7,5 +7,5 @@ ...@@ -7,5 +7,5 @@
and and
%span.cred #{@commit.stats.deletions} deletions %span.cred #{@commit.stats.deletions} deletions
= render "commits/diffs", diffs: @commit.diffs = render "projects/commits/diffs", diffs: @commit.diffs
= render "notes/notes_with_form" = render "projects/notes/notes_with_form"
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%p.cgray %p.cgray
Showing #{pluralize(diffs.count, "changed file")} Showing #{pluralize(diffs.count, "changed file")}
.file-stats .file-stats
= render "commits/diff_head", diffs: diffs = render "projects/commits/diff_head", diffs: diffs
.files .files
- unless @suppress_diff - unless @suppress_diff
...@@ -41,9 +41,9 @@ ...@@ -41,9 +41,9 @@
-# Skipp all non non-supported blobs -# Skipp all non non-supported blobs
- next unless file.respond_to?('text?') - next unless file.respond_to?('text?')
- if file.text? - if file.text?
= render "commits/text_file", diff: diff, index: i = render "projects/commits/text_file", diff: diff, index: i
- elsif file.image? - elsif file.image?
- old_file = Gitlab::Git::Blob.new(@repository, @commit.parent_id, @ref, diff.old_path) if @commit.parent_id - 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 - else
%p.nothing_here_message No preview for this file type %p.nothing_here_message No preview for this file type
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
%td.old_line %td.old_line
= link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", id: line_code = link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", id: line_code
- if @comments_allowed - 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.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) %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line)
- if @reply_allowed - if @reply_allowed
- comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at) - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at)
- unless comments.empty? - unless comments.empty?
= render "notes/diff_notes_with_reply", notes: comments = render "projects/notes/diff_notes_with_reply", notes: comments
= render "commits/head" = render "projects/commits/head"
%h3.page_title %h3.page_title
Compare View Compare View
......
= render "commits/head" = render "projects/commits/head"
%h3.page_title %h3.page_title
Compare View Compare View
...@@ -20,4 +20,4 @@ ...@@ -20,4 +20,4 @@
- unless @diffs.empty? - unless @diffs.empty?
%h4 Diff %h4 Diff
= render "commits/diffs", diffs: @diffs = render "projects/commits/diffs", diffs: @diffs
= render "issues/head" = render "head"
.issues_content .issues_content
%h3.page_title %h3.page_title
Issues Issues
......
...@@ -65,4 +65,4 @@ ...@@ -65,4 +65,4 @@
- else - 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" = 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"
= render "issues/head" = render "projects/issues/head"
%h3.page_title %h3.page_title
Labels Labels
......
.merge-request .merge-request
= render "merge_requests/show/mr_title" = render "projects/merge_requests/show/mr_title"
= render "merge_requests/show/how_to_merge" = render "projects/merge_requests/show/how_to_merge"
= render "merge_requests/show/mr_box" = render "projects/merge_requests/show/mr_box"
= render "merge_requests/show/mr_accept" = render "projects/merge_requests/show/mr_accept"
- if @project.gitlab_ci? - if @project.gitlab_ci?
= render "merge_requests/show/mr_ci" = render "projects/merge_requests/show/mr_ci"
= render "merge_requests/show/commits" = render "projects/merge_requests/show/commits"
- if @commits.present? - if @commits.present?
%ul.nav.nav-tabs %ul.nav.nav-tabs
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
Diff Diff
.notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } .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 .diffs.tab-content
= render "merge_requests/show/diffs" if @diffs = render "projects/merge_requests/show/diffs" if @diffs
.status .status
:javascript :javascript
......
:plain :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"))}");
.merge-request .merge-request
= render "merge_requests/show/mr_title" = render "projects/merge_requests/show/mr_title"
= render "merge_requests/show/mr_box" = render "projects/merge_requests/show/mr_box"
.alert.alert-error .alert.alert-error
%h5 %h5
......
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
- if @commits.count > 8 - if @commits.count > 8
%ul.first-commits.well-list %ul.first-commits.well-list
- @commits.first(8).each do |commit| - @commits.first(8).each do |commit|
= render "commits/commit", commit: commit = render "projects/commits/commit", commit: commit
%li.bottom %li.bottom
8 of #{@commits.count} commits displayed. 8 of #{@commits.count} commits displayed.
%strong %strong
%a.show-all-commits Click here to show all %a.show-all-commits Click here to show all
%ul.all-commits.hide.well-list %ul.all-commits.hide.well-list
- @commits.each do |commit| - @commits.each do |commit|
= render "commits/commit", commit: commit = render "projects/commits/commit", commit: commit
- else - else
%ul.well-list %ul.well-list
- @commits.each do |commit| - @commits.each do |commit|
= render "commits/commit", commit: commit = render "projects/commits/commit", commit: commit
- else - else
%h4.nothing_here_message %h4.nothing_here_message
......
- if @merge_request.valid_diffs? - if @merge_request.valid_diffs?
= render "commits/diffs", diffs: @diffs = render "projects/commits/diffs", diffs: @diffs
- elsif @merge_request.broken_diffs? - elsif @merge_request.broken_diffs?
%h4.nothing_here_message %h4.nothing_here_message
Can't load diff. Can't load diff.
......
= render "issues/head" = render "projects/issues/head"
.milestones_content .milestones_content
%h3.page_title %h3.page_title
Milestones Milestones
......
= render "issues/head" = render "projects/issues/head"
.row .row
.span6 .span6
%h3.page_title %h3.page_title
......
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
%ul.notes{ rel: note.discussion_id } %ul.notes{ rel: note.discussion_id }
= render notes = render notes
= render "notes/discussion_reply_button", note: note = render "projects/notes/discussion_reply_button", note: note
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
- if note.for_diff_line? - if note.for_diff_line?
- if note.diff - if note.diff
.content .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 - else
= link_to 'show outdated discussion', '#', class: 'js-show-outdated-discussion' = link_to 'show outdated discussion', '#', class: 'js-show-outdated-discussion'
%div.hide.outdated-discussion %div.hide.outdated-discussion
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
.content .content
.notes{ rel: discussion_notes.first.discussion_id } .notes{ rel: discussion_notes.first.discussion_id }
= render discussion_notes = 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 -# will be shown when the other one is hidden
.discussion-hidden.content.hide .discussion-hidden.content.hide
......
...@@ -21,4 +21,4 @@ ...@@ -21,4 +21,4 @@
%td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;" %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;"
- if line_code == note.line_code - 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
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
- else - else
- @notes.each do |note| - @notes.each do |note|
- next unless note.author - next unless note.author
= render 'note', note: note = render note
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
.js-main-target-form .js-main-target-form
- if can? current_user, :write_note, @project - if can? current_user, :write_note, @project
= render "notes/form" = render "projects/notes/form"
:javascript :javascript
NoteList.init("#{@target_id}", "#{@target_type}", "#{project_notes_path(@project)}"); NoteList.init("#{@target_id}", "#{@target_type}", "#{project_notes_path(@project)}");
- if @note.valid? - if @note.valid?
var noteHtml = "#{escape_javascript(render "notes/note", note: @note)}"; var noteHtml = "#{escape_javascript(render @note)}";
- if note_for_main_target?(@note) - if note_for_main_target?(@note)
NoteList.appendNewNote(#{@note.id}, noteHtml); NoteList.appendNewNote(#{@note.id}, noteHtml);
- else - else
:plain :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}", NoteList.appendNewDiscussionNote("#{@note.discussion_id}",
firstDiscussionNoteHtml, firstDiscussionNoteHtml,
noteHtml); noteHtml);
- else - 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) - if note_for_main_target?(@note)
NoteList.errorsOnForm(errorsHtml); NoteList.errorsOnForm(errorsHtml);
- else - else
......
- unless @notes.blank? - unless @notes.blank?
var notesHtml = "#{escape_javascript(render 'notes/notes')}"; var notesHtml = "#{escape_javascript(render 'projects/notes/notes')}";
- new_note_ids = @notes.map(&:id) - new_note_ids = @notes.map(&:id)
NoteList.setContent(#{new_note_ids}, notesHtml); NoteList.setContent(#{new_note_ids}, notesHtml);
= render "commits/head" = render "projects/commits/head"
.row .row
.span3 .span3
= render "repositories/filter" = render "projects/repositories/filter"
.span9 .span9
.alert .alert
%p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}.
......
...@@ -5,4 +5,4 @@ ...@@ -5,4 +5,4 @@
:plain :plain
var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}"); 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_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)}');
= render "commits/head" = render "projects/commits/head"
.row .row
.span3 .span3
= render "filter" = render "filter"
...@@ -12,4 +12,4 @@ ...@@ -12,4 +12,4 @@
%th %th
%tbody %tbody
- @branches.each do |branch| - @branches.each do |branch|
= render "repositories/branch", branch: branch = render "projects/repositories/branch", branch: branch
= render "commits/head" = render "projects/commits/head"
.row .row
.span3 .span3
= render "filter" = render "filter"
...@@ -10,5 +10,5 @@ ...@@ -10,5 +10,5 @@
%th Last commit %th Last commit
%th %th
- @activities.each do |update| - @activities.each do |update|
= render "repositories/branch", branch: update.head = render "branch", branch: update.head
= render "commits/head" = render "projects/commits/head"
.row .row
.span6 .span6
%div#activity-chart.chart %div#activity-chart.chart
......
= render "commits/head" = render "projects/commits/head"
- unless @tags.empty? - unless @tags.empty?
%ul.bordered-list %ul.bordered-list
- @tags.each do |tag| - @tags.each do |tag|
......
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
= @snippet.author_name = @snippet.author_name
%br %br
%div= render 'projects/snippets/blob' %div= render 'projects/snippets/blob'
%div#notes= render "notes/notes_with_form" %div#notes= render "projects/notes/notes_with_form"
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
members (#{members.count}) members (#{members.count})
%ul.well-list %ul.well-list
- members.each do |team_member| - 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
...@@ -12,5 +12,5 @@ ...@@ -12,5 +12,5 @@
Read more about project permissions Read more about project permissions
%strong= link_to "here", help_permissions_path, class: "vlink" %strong= link_to "here", help_permissions_path, class: "vlink"
- if @group - if @group
= render "team_members/group_members" = render "group_members"
= render "team_members/team", members: @users_projects = render "team", members: @users_projects
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
= render_tree(tree) = render_tree(tree)
- if tree.readme - if tree.readme
= render "tree/readme", readme: tree.readme = render "projects/tree/readme", readme: tree.readme
%div.tree_progress %div.tree_progress
......
...@@ -16,4 +16,4 @@ ...@@ -16,4 +16,4 @@
%i.icon-plus %i.icon-plus
New Page New Page
= render 'wikis/new' = render 'projects/wikis/new'
= render 'wikis/nav' = render 'nav'
%h3.page_title %h3.page_title
Editing page Editing page
= render 'main_links' = render 'main_links'
......
= render 'wikis/nav' = render 'nav'
%h3.page_title %h3.page_title
Git Access Git Access
%strong= @gollum_wiki.path_with_namespace %strong= @gollum_wiki.path_with_namespace
......
= render 'wikis/nav' = render 'nav'
%h3.page_title %h3.page_title
%span.light History for %span.light History for
= @wiki.title.titleize = @wiki.title.titleize
......
= render 'wikis/nav' = render 'nav'
%h3.page_title %h3.page_title
All Pages All Pages
= render 'main_links' = render 'main_links'
......
= render 'wikis/nav' = render 'nav'
%h3.page_title %h3.page_title
= @wiki.title.titleize = @wiki.title.titleize
= render 'main_links' = render 'main_links'
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
= link_to_project project = link_to_project project
%ul.well-list.mr-list %ul.well-list.mr-list
- group[1].each do |merge_request| - 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 %hr
= paginate @merge_requests, theme: "gitlab" = paginate @merge_requests, theme: "gitlab"
......
...@@ -160,6 +160,7 @@ Gitlab::Application.routes.draw do ...@@ -160,6 +160,7 @@ Gitlab::Application.routes.draw do
get :autocomplete_sources get :autocomplete_sources
end end
scope module: :projects do
resources :blob, only: [:show], constraints: {id: /.+/} resources :blob, only: [:show], constraints: {id: /.+/}
resources :raw, only: [:show], constraints: {id: /.+/} resources :raw, only: [:show], constraints: {id: /.+/}
resources :tree, only: [:show], constraints: {id: /.+/, format: /(html|js)/ } resources :tree, only: [:show], constraints: {id: /.+/, format: /(html|js)/ }
...@@ -172,13 +173,11 @@ Gitlab::Application.routes.draw do ...@@ -172,13 +173,11 @@ Gitlab::Application.routes.draw do
resources :graphs, 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: /.+/} match "/compare/:from...:to" => "compare#show", as: "compare", via: [:get, :post], constraints: {from: /.+/, to: /.+/}
scope module: :projects do
resources :snippets do resources :snippets do
member do member do
get "raw" get "raw"
end end
end end
end
resources :wikis, only: [:show, :edit, :destroy, :create] do resources :wikis, only: [:show, :edit, :destroy, :create] do
collection do collection do
...@@ -290,6 +289,7 @@ Gitlab::Application.routes.draw do ...@@ -290,6 +289,7 @@ Gitlab::Application.routes.draw do
end end
end end
end end
end
root to: "dashboard#show" root to: "dashboard#show"
end end
require 'spec_helper' require 'spec_helper'
describe BlobController do describe Projects::BlobController do
let(:project) { create(:project_with_code) } let(:project) { create(:project_with_code) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe CommitController do describe Projects::CommitController do
let(:project) { create(:project_with_code) } let(:project) { create(:project_with_code) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:commit) { project.repository.last_commit_for("master") } let(:commit) { project.repository.last_commit_for("master") }
......
require 'spec_helper' require 'spec_helper'
describe CommitsController do describe Projects::CommitsController do
let(:project) { create(:project_with_code) } let(:project) { create(:project_with_code) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe MergeRequestsController do describe Projects::MergeRequestsController do
let(:project) { create(:project_with_code) } let(:project) { create(:project_with_code) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:merge_request) { create(:merge_request_with_diffs, project: project, target_branch: "bcf03b5d~3", source_branch: "bcf03b5d") } let(:merge_request) { create(:merge_request_with_diffs, project: project, target_branch: "bcf03b5d~3", source_branch: "bcf03b5d") }
...@@ -8,7 +8,7 @@ describe MergeRequestsController do ...@@ -8,7 +8,7 @@ describe MergeRequestsController do
before do before do
sign_in(user) sign_in(user)
project.team << [user, :master] project.team << [user, :master]
MergeRequestsController.any_instance.stub(validates_merge_request: true) Projects::MergeRequestsController.any_instance.stub(validates_merge_request: true)
end end
describe "#show" do describe "#show" do
......
require 'spec_helper' require 'spec_helper'
describe TreeController do describe Projects::TreeController do
let(:project) { create(:project_with_code) } let(:project) { create(:project_with_code) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -25,31 +25,31 @@ shared_examples "RESTful project resources" do ...@@ -25,31 +25,31 @@ shared_examples "RESTful project resources" do
let(:actions) { [:index, :create, :new, :edit, :show, :update, :destroy] } let(:actions) { [:index, :create, :new, :edit, :show, :update, :destroy] }
it "to #index" do it "to #index" do
get("/gitlabhq/#{controller}").should route_to("#{controller}#index", project_id: 'gitlabhq') if actions.include?(:index) get("/gitlabhq/#{controller}").should route_to("projects/#{controller}#index", project_id: 'gitlabhq') if actions.include?(:index)
end end
it "to #create" do it "to #create" do
post("/gitlabhq/#{controller}").should route_to("#{controller}#create", project_id: 'gitlabhq') if actions.include?(:create) post("/gitlabhq/#{controller}").should route_to("projects/#{controller}#create", project_id: 'gitlabhq') if actions.include?(:create)
end end
it "to #new" do it "to #new" do
get("/gitlabhq/#{controller}/new").should route_to("#{controller}#new", project_id: 'gitlabhq') if actions.include?(:new) get("/gitlabhq/#{controller}/new").should route_to("projects/#{controller}#new", project_id: 'gitlabhq') if actions.include?(:new)
end end
it "to #edit" do it "to #edit" do
get("/gitlabhq/#{controller}/1/edit").should route_to("#{controller}#edit", project_id: 'gitlabhq', id: '1') if actions.include?(:edit) get("/gitlabhq/#{controller}/1/edit").should route_to("projects/#{controller}#edit", project_id: 'gitlabhq', id: '1') if actions.include?(:edit)
end end
it "to #show" do it "to #show" do
get("/gitlabhq/#{controller}/1").should route_to("#{controller}#show", project_id: 'gitlabhq', id: '1') if actions.include?(:show) get("/gitlabhq/#{controller}/1").should route_to("projects/#{controller}#show", project_id: 'gitlabhq', id: '1') if actions.include?(:show)
end end
it "to #update" do it "to #update" do
put("/gitlabhq/#{controller}/1").should route_to("#{controller}#update", project_id: 'gitlabhq', id: '1') if actions.include?(:update) put("/gitlabhq/#{controller}/1").should route_to("projects/#{controller}#update", project_id: 'gitlabhq', id: '1') if actions.include?(:update)
end end
it "to #destroy" do it "to #destroy" do
delete("/gitlabhq/#{controller}/1").should route_to("#{controller}#destroy", project_id: 'gitlabhq', id: '1') if actions.include?(:destroy) delete("/gitlabhq/#{controller}/1").should route_to("projects/#{controller}#destroy", project_id: 'gitlabhq', id: '1') if actions.include?(:destroy)
end end
end end
...@@ -76,7 +76,7 @@ describe ProjectsController, "routing" do ...@@ -76,7 +76,7 @@ describe ProjectsController, "routing" do
end end
it "to #wall" do it "to #wall" do
get("/gitlabhq/wall").should route_to('walls#show', project_id: 'gitlabhq') get("/gitlabhq/wall").should route_to('projects/walls#show', project_id: 'gitlabhq')
end end
it "to #edit" do it "to #edit" do
...@@ -100,19 +100,19 @@ describe ProjectsController, "routing" do ...@@ -100,19 +100,19 @@ describe ProjectsController, "routing" do
end end
end end
# pages_project_wikis GET /:project_id/wikis/pages(.:format) wikis#pages # pages_project_wikis GET /:project_id/wikis/pages(.:format) projects/wikis#pages
# history_project_wiki GET /:project_id/wikis/:id/history(.:format) wikis#history # history_project_wiki GET /:project_id/wikis/:id/history(.:format) projects/wikis#history
# project_wikis POST /:project_id/wikis(.:format) wikis#create # project_wikis POST /:project_id/wikis(.:format) projects/wikis#create
# edit_project_wiki GET /:project_id/wikis/:id/edit(.:format) wikis#edit # edit_project_wiki GET /:project_id/wikis/:id/edit(.:format) projects/wikis#edit
# project_wiki GET /:project_id/wikis/:id(.:format) wikis#show # project_wiki GET /:project_id/wikis/:id(.:format) projects/wikis#show
# DELETE /:project_id/wikis/:id(.:format) wikis#destroy # DELETE /:project_id/wikis/:id(.:format) projects/wikis#destroy
describe WikisController, "routing" do describe Projects::WikisController, "routing" do
it "to #pages" do it "to #pages" do
get("/gitlabhq/wikis/pages").should route_to('wikis#pages', project_id: 'gitlabhq') get("/gitlabhq/wikis/pages").should route_to('projects/wikis#pages', project_id: 'gitlabhq')
end end
it "to #history" do it "to #history" do
get("/gitlabhq/wikis/1/history").should route_to('wikis#history', project_id: 'gitlabhq', id: '1') get("/gitlabhq/wikis/1/history").should route_to('projects/wikis#history', project_id: 'gitlabhq', id: '1')
end end
it_behaves_like "RESTful project resources" do it_behaves_like "RESTful project resources" do
...@@ -121,25 +121,25 @@ describe WikisController, "routing" do ...@@ -121,25 +121,25 @@ describe WikisController, "routing" do
end end
end end
# branches_project_repository GET /:project_id/repository/branches(.:format) repositories#branches # branches_project_repository GET /:project_id/repository/branches(.:format) projects/repositories#branches
# tags_project_repository GET /:project_id/repository/tags(.:format) repositories#tags # tags_project_repository GET /:project_id/repository/tags(.:format) projects/repositories#tags
# archive_project_repository GET /:project_id/repository/archive(.:format) repositories#archive # archive_project_repository GET /:project_id/repository/archive(.:format) projects/repositories#archive
# edit_project_repository GET /:project_id/repository/edit(.:format) repositories#edit # edit_project_repository GET /:project_id/repository/edit(.:format) projects/repositories#edit
describe RepositoriesController, "routing" do describe Projects::RepositoriesController, "routing" do
it "to #branches" do it "to #branches" do
get("/gitlabhq/repository/branches").should route_to('repositories#branches', project_id: 'gitlabhq') get("/gitlabhq/repository/branches").should route_to('projects/repositories#branches', project_id: 'gitlabhq')
end end
it "to #tags" do it "to #tags" do
get("/gitlabhq/repository/tags").should route_to('repositories#tags', project_id: 'gitlabhq') get("/gitlabhq/repository/tags").should route_to('projects/repositories#tags', project_id: 'gitlabhq')
end end
it "to #archive" do it "to #archive" do
get("/gitlabhq/repository/archive").should route_to('repositories#archive', project_id: 'gitlabhq') get("/gitlabhq/repository/archive").should route_to('projects/repositories#archive', project_id: 'gitlabhq')
end end
it "to #show" do it "to #show" do
get("/gitlabhq/repository").should route_to('repositories#show', project_id: 'gitlabhq') get("/gitlabhq/repository").should route_to('projects/repositories#show', project_id: 'gitlabhq')
end end
end end
...@@ -150,7 +150,7 @@ end ...@@ -150,7 +150,7 @@ end
# project_deploy_key GET /:project_id/deploy_keys/:id(.:format) deploy_keys#show # project_deploy_key GET /:project_id/deploy_keys/:id(.:format) deploy_keys#show
# PUT /:project_id/deploy_keys/:id(.:format) deploy_keys#update # PUT /:project_id/deploy_keys/:id(.:format) deploy_keys#update
# DELETE /:project_id/deploy_keys/:id(.:format) deploy_keys#destroy # DELETE /:project_id/deploy_keys/:id(.:format) deploy_keys#destroy
describe DeployKeysController, "routing" do describe Projects::DeployKeysController, "routing" do
it_behaves_like "RESTful project resources" do it_behaves_like "RESTful project resources" do
let(:controller) { 'deploy_keys' } let(:controller) { 'deploy_keys' }
end end
...@@ -159,7 +159,7 @@ end ...@@ -159,7 +159,7 @@ end
# project_protected_branches GET /:project_id/protected_branches(.:format) protected_branches#index # project_protected_branches GET /:project_id/protected_branches(.:format) protected_branches#index
# POST /:project_id/protected_branches(.:format) protected_branches#create # POST /:project_id/protected_branches(.:format) protected_branches#create
# project_protected_branch DELETE /:project_id/protected_branches/:id(.:format) protected_branches#destroy # project_protected_branch DELETE /:project_id/protected_branches/:id(.:format) protected_branches#destroy
describe ProtectedBranchesController, "routing" do describe Projects::ProtectedBranchesController, "routing" do
it_behaves_like "RESTful project resources" do it_behaves_like "RESTful project resources" do
let(:actions) { [:index, :create, :destroy] } let(:actions) { [:index, :create, :destroy] }
let(:controller) { 'protected_branches' } let(:controller) { 'protected_branches' }
...@@ -169,58 +169,58 @@ end ...@@ -169,58 +169,58 @@ end
# switch_project_refs GET /:project_id/refs/switch(.:format) refs#switch # switch_project_refs GET /:project_id/refs/switch(.:format) refs#switch
# logs_tree_project_ref GET /:project_id/refs/:id/logs_tree(.:format) refs#logs_tree # logs_tree_project_ref GET /:project_id/refs/:id/logs_tree(.:format) refs#logs_tree
# logs_file_project_ref GET /:project_id/refs/:id/logs_tree/:path(.:format) refs#logs_tree # logs_file_project_ref GET /:project_id/refs/:id/logs_tree/:path(.:format) refs#logs_tree
describe RefsController, "routing" do describe Projects::RefsController, "routing" do
it "to #switch" do it "to #switch" do
get("/gitlabhq/refs/switch").should route_to('refs#switch', project_id: 'gitlabhq') get("/gitlabhq/refs/switch").should route_to('projects/refs#switch', project_id: 'gitlabhq')
end end
it "to #logs_tree" do it "to #logs_tree" do
get("/gitlabhq/refs/stable/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable') get("/gitlabhq/refs/stable/logs_tree").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'stable')
get("/gitlabhq/refs/feature%2345/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45') get("/gitlabhq/refs/feature%2345/logs_tree").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45')
get("/gitlabhq/refs/feature%2B45/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature+45') get("/gitlabhq/refs/feature%2B45/logs_tree").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'feature+45')
get("/gitlabhq/refs/stable/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz') get("/gitlabhq/refs/stable/logs_tree/foo/bar/baz").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz')
get("/gitlabhq/refs/feature%2345/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45', path: 'foo/bar/baz') get("/gitlabhq/refs/feature%2345/logs_tree/foo/bar/baz").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45', path: 'foo/bar/baz')
get("/gitlabhq/refs/feature%2B45/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature+45', path: 'foo/bar/baz') get("/gitlabhq/refs/feature%2B45/logs_tree/foo/bar/baz").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'feature+45', path: 'foo/bar/baz')
get("/gitlab/gitlabhq/refs/stable/logs_tree/files.scss").should route_to('refs#logs_tree', project_id: 'gitlab/gitlabhq', id: 'stable', path: 'files.scss') get("/gitlab/gitlabhq/refs/stable/logs_tree/files.scss").should route_to('projects/refs#logs_tree', project_id: 'gitlab/gitlabhq', id: 'stable', path: 'files.scss')
end end
end end
# diffs_project_merge_request GET /:project_id/merge_requests/:id/diffs(.:format) merge_requests#diffs # diffs_project_merge_request GET /:project_id/merge_requests/:id/diffs(.:format) projects/merge_requests#diffs
# automerge_project_merge_request GET /:project_id/merge_requests/:id/automerge(.:format) merge_requests#automerge # automerge_project_merge_request GET /:project_id/merge_requests/:id/automerge(.:format) projects/merge_requests#automerge
# automerge_check_project_merge_request GET /:project_id/merge_requests/:id/automerge_check(.:format) merge_requests#automerge_check # automerge_check_project_merge_request GET /:project_id/merge_requests/:id/automerge_check(.:format) projects/merge_requests#automerge_check
# branch_from_project_merge_requests GET /:project_id/merge_requests/branch_from(.:format) merge_requests#branch_from # branch_from_project_merge_requests GET /:project_id/merge_requests/branch_from(.:format) projects/merge_requests#branch_from
# branch_to_project_merge_requests GET /:project_id/merge_requests/branch_to(.:format) merge_requests#branch_to # branch_to_project_merge_requests GET /:project_id/merge_requests/branch_to(.:format) projects/merge_requests#branch_to
# project_merge_requests GET /:project_id/merge_requests(.:format) merge_requests#index # project_merge_requests GET /:project_id/merge_requests(.:format) projects/merge_requests#index
# POST /:project_id/merge_requests(.:format) merge_requests#create # POST /:project_id/merge_requests(.:format) projects/merge_requests#create
# new_project_merge_request GET /:project_id/merge_requests/new(.:format) merge_requests#new # new_project_merge_request GET /:project_id/merge_requests/new(.:format) projects/merge_requests#new
# edit_project_merge_request GET /:project_id/merge_requests/:id/edit(.:format) merge_requests#edit # edit_project_merge_request GET /:project_id/merge_requests/:id/edit(.:format) projects/merge_requests#edit
# project_merge_request GET /:project_id/merge_requests/:id(.:format) merge_requests#show # project_merge_request GET /:project_id/merge_requests/:id(.:format) projects/merge_requests#show
# PUT /:project_id/merge_requests/:id(.:format) merge_requests#update # PUT /:project_id/merge_requests/:id(.:format) projects/merge_requests#update
# DELETE /:project_id/merge_requests/:id(.:format) merge_requests#destroy # DELETE /:project_id/merge_requests/:id(.:format) projects/merge_requests#destroy
describe MergeRequestsController, "routing" do describe Projects::MergeRequestsController, "routing" do
it "to #diffs" do it "to #diffs" do
get("/gitlabhq/merge_requests/1/diffs").should route_to('merge_requests#diffs', project_id: 'gitlabhq', id: '1') get("/gitlabhq/merge_requests/1/diffs").should route_to('projects/merge_requests#diffs', project_id: 'gitlabhq', id: '1')
end end
it "to #automerge" do it "to #automerge" do
get("/gitlabhq/merge_requests/1/automerge").should route_to('merge_requests#automerge', project_id: 'gitlabhq', id: '1') get("/gitlabhq/merge_requests/1/automerge").should route_to('projects/merge_requests#automerge', project_id: 'gitlabhq', id: '1')
end end
it "to #automerge_check" do it "to #automerge_check" do
get("/gitlabhq/merge_requests/1/automerge_check").should route_to('merge_requests#automerge_check', project_id: 'gitlabhq', id: '1') get("/gitlabhq/merge_requests/1/automerge_check").should route_to('projects/merge_requests#automerge_check', project_id: 'gitlabhq', id: '1')
end end
it "to #branch_from" do it "to #branch_from" do
get("/gitlabhq/merge_requests/branch_from").should route_to('merge_requests#branch_from', project_id: 'gitlabhq') get("/gitlabhq/merge_requests/branch_from").should route_to('projects/merge_requests#branch_from', project_id: 'gitlabhq')
end end
it "to #branch_to" do it "to #branch_to" do
get("/gitlabhq/merge_requests/branch_to").should route_to('merge_requests#branch_to', project_id: 'gitlabhq') get("/gitlabhq/merge_requests/branch_to").should route_to('projects/merge_requests#branch_to', project_id: 'gitlabhq')
end end
it "to #show" do it "to #show" do
get("/gitlabhq/merge_requests/1.diff").should route_to('merge_requests#show', project_id: 'gitlabhq', id: '1', format: 'diff') get("/gitlabhq/merge_requests/1.diff").should route_to('projects/merge_requests#show', project_id: 'gitlabhq', id: '1', format: 'diff')
get("/gitlabhq/merge_requests/1.patch").should route_to('merge_requests#show', project_id: 'gitlabhq', id: '1', format: 'patch') get("/gitlabhq/merge_requests/1.patch").should route_to('projects/merge_requests#show', project_id: 'gitlabhq', id: '1', format: 'patch')
end end
it_behaves_like "RESTful project resources" do it_behaves_like "RESTful project resources" do
...@@ -275,9 +275,9 @@ end ...@@ -275,9 +275,9 @@ end
# project_hooks GET /:project_id/hooks(.:format) hooks#index # project_hooks GET /:project_id/hooks(.:format) hooks#index
# POST /:project_id/hooks(.:format) hooks#create # POST /:project_id/hooks(.:format) hooks#create
# project_hook DELETE /:project_id/hooks/:id(.:format) hooks#destroy # project_hook DELETE /:project_id/hooks/:id(.:format) hooks#destroy
describe HooksController, "routing" do describe Projects::HooksController, "routing" do
it "to #test" do it "to #test" do
get("/gitlabhq/hooks/1/test").should route_to('hooks#test', project_id: 'gitlabhq', id: '1') get("/gitlabhq/hooks/1/test").should route_to('projects/hooks#test', project_id: 'gitlabhq', id: '1')
end end
it_behaves_like "RESTful project resources" do it_behaves_like "RESTful project resources" do
...@@ -287,12 +287,12 @@ describe HooksController, "routing" do ...@@ -287,12 +287,12 @@ describe HooksController, "routing" do
end end
# project_commit GET /:project_id/commit/:id(.:format) commit#show {id: /[[:alnum:]]{6,40}/, project_id: /[^\/]+/} # project_commit GET /:project_id/commit/:id(.:format) commit#show {id: /[[:alnum:]]{6,40}/, project_id: /[^\/]+/}
describe CommitController, "routing" do describe Projects::CommitController, "routing" do
it "to #show" do it "to #show" do
get("/gitlabhq/commit/4246fb").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb') get("/gitlabhq/commit/4246fb").should route_to('projects/commit#show', project_id: 'gitlabhq', id: '4246fb')
get("/gitlabhq/commit/4246fb.diff").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'diff') get("/gitlabhq/commit/4246fb.diff").should route_to('projects/commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'diff')
get("/gitlabhq/commit/4246fb.patch").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'patch') get("/gitlabhq/commit/4246fb.patch").should route_to('projects/commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'patch')
get("/gitlabhq/commit/4246fbd13872934f72a8fd0d6fb1317b47b59cb5").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fbd13872934f72a8fd0d6fb1317b47b59cb5') get("/gitlabhq/commit/4246fbd13872934f72a8fd0d6fb1317b47b59cb5").should route_to('projects/commit#show', project_id: 'gitlabhq', id: '4246fbd13872934f72a8fd0d6fb1317b47b59cb5')
end end
end end
...@@ -300,14 +300,14 @@ end ...@@ -300,14 +300,14 @@ end
# project_commits GET /:project_id/commits(.:format) commits#index # project_commits GET /:project_id/commits(.:format) commits#index
# POST /:project_id/commits(.:format) commits#create # POST /:project_id/commits(.:format) commits#create
# project_commit GET /:project_id/commits/:id(.:format) commits#show # project_commit GET /:project_id/commits/:id(.:format) commits#show
describe CommitsController, "routing" do describe Projects::CommitsController, "routing" do
it_behaves_like "RESTful project resources" do it_behaves_like "RESTful project resources" do
let(:actions) { [:show] } let(:actions) { [:show] }
let(:controller) { 'commits' } let(:controller) { 'commits' }
end end
it "to #show" do it "to #show" do
get("/gitlab/gitlabhq/commits/master.atom").should route_to('commits#show', project_id: 'gitlab/gitlabhq', id: "master", format: "atom") get("/gitlab/gitlabhq/commits/master.atom").should route_to('projects/commits#show', project_id: 'gitlab/gitlabhq', id: "master", format: "atom")
end end
end end
...@@ -318,7 +318,7 @@ end ...@@ -318,7 +318,7 @@ end
# project_team_member GET /:project_id/team_members/:id(.:format) team_members#show # project_team_member GET /:project_id/team_members/:id(.:format) team_members#show
# PUT /:project_id/team_members/:id(.:format) team_members#update # PUT /:project_id/team_members/:id(.:format) team_members#update
# DELETE /:project_id/team_members/:id(.:format) team_members#destroy # DELETE /:project_id/team_members/:id(.:format) team_members#destroy
describe TeamMembersController, "routing" do describe Projects::TeamMembersController, "routing" do
it_behaves_like "RESTful project resources" do it_behaves_like "RESTful project resources" do
let(:actions) { [:new, :create, :update, :destroy] } let(:actions) { [:new, :create, :update, :destroy] }
let(:controller) { 'team_members' } let(:controller) { 'team_members' }
...@@ -332,7 +332,7 @@ end ...@@ -332,7 +332,7 @@ end
# project_milestone GET /:project_id/milestones/:id(.:format) milestones#show # project_milestone GET /:project_id/milestones/:id(.:format) milestones#show
# PUT /:project_id/milestones/:id(.:format) milestones#update # PUT /:project_id/milestones/:id(.:format) milestones#update
# DELETE /:project_id/milestones/:id(.:format) milestones#destroy # DELETE /:project_id/milestones/:id(.:format) milestones#destroy
describe MilestonesController, "routing" do describe Projects::MilestonesController, "routing" do
it_behaves_like "RESTful project resources" do it_behaves_like "RESTful project resources" do
let(:controller) { 'milestones' } let(:controller) { 'milestones' }
let(:actions) { [:index, :create, :new, :edit, :show, :update] } let(:actions) { [:index, :create, :new, :edit, :show, :update] }
...@@ -340,9 +340,9 @@ describe MilestonesController, "routing" do ...@@ -340,9 +340,9 @@ describe MilestonesController, "routing" do
end end
# project_labels GET /:project_id/labels(.:format) labels#index # project_labels GET /:project_id/labels(.:format) labels#index
describe LabelsController, "routing" do describe Projects::LabelsController, "routing" do
it "to #index" do it "to #index" do
get("/gitlabhq/labels").should route_to('labels#index', project_id: 'gitlabhq') get("/gitlabhq/labels").should route_to('projects/labels#index', project_id: 'gitlabhq')
end end
end end
...@@ -356,9 +356,9 @@ end ...@@ -356,9 +356,9 @@ end
# project_issue GET /:project_id/issues/:id(.:format) issues#show # project_issue GET /:project_id/issues/:id(.:format) issues#show
# PUT /:project_id/issues/:id(.:format) issues#update # PUT /:project_id/issues/:id(.:format) issues#update
# DELETE /:project_id/issues/:id(.:format) issues#destroy # DELETE /:project_id/issues/:id(.:format) issues#destroy
describe IssuesController, "routing" do describe Projects::IssuesController, "routing" do
it "to #bulk_update" do it "to #bulk_update" do
post("/gitlabhq/issues/bulk_update").should route_to('issues#bulk_update', project_id: 'gitlabhq') post("/gitlabhq/issues/bulk_update").should route_to('projects/issues#bulk_update', project_id: 'gitlabhq')
end end
it_behaves_like "RESTful project resources" do it_behaves_like "RESTful project resources" do
...@@ -371,9 +371,9 @@ end ...@@ -371,9 +371,9 @@ end
# project_notes GET /:project_id/notes(.:format) notes#index # project_notes GET /:project_id/notes(.:format) notes#index
# POST /:project_id/notes(.:format) notes#create # POST /:project_id/notes(.:format) notes#create
# project_note DELETE /:project_id/notes/:id(.:format) notes#destroy # project_note DELETE /:project_id/notes/:id(.:format) notes#destroy
describe NotesController, "routing" do describe Projects::NotesController, "routing" do
it "to #preview" do it "to #preview" do
post("/gitlabhq/notes/preview").should route_to('notes#preview', project_id: 'gitlabhq') post("/gitlabhq/notes/preview").should route_to('projects/notes#preview', project_id: 'gitlabhq')
end end
it_behaves_like "RESTful project resources" do it_behaves_like "RESTful project resources" do
...@@ -383,57 +383,57 @@ describe NotesController, "routing" do ...@@ -383,57 +383,57 @@ describe NotesController, "routing" do
end end
# project_blame GET /:project_id/blame/:id(.:format) blame#show {id: /.+/, project_id: /[^\/]+/} # project_blame GET /:project_id/blame/:id(.:format) blame#show {id: /.+/, project_id: /[^\/]+/}
describe BlameController, "routing" do describe Projects::BlameController, "routing" do
it "to #show" do it "to #show" do
get("/gitlabhq/blame/master/app/models/project.rb").should route_to('blame#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') get("/gitlabhq/blame/master/app/models/project.rb").should route_to('projects/blame#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
get("/gitlab/gitlabhq/blame/master/files.scss").should route_to('blame#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss') get("/gitlab/gitlabhq/blame/master/files.scss").should route_to('projects/blame#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss')
end end
end end
# project_blob GET /:project_id/blob/:id(.:format) blob#show {id: /.+/, project_id: /[^\/]+/} # project_blob GET /:project_id/blob/:id(.:format) blob#show {id: /.+/, project_id: /[^\/]+/}
describe BlobController, "routing" do describe Projects::BlobController, "routing" do
it "to #show" do it "to #show" do
get("/gitlabhq/blob/master/app/models/project.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') get("/gitlabhq/blob/master/app/models/project.rb").should route_to('projects/blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
get("/gitlabhq/blob/master/app/models/compare.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/compare.rb') get("/gitlabhq/blob/master/app/models/compare.rb").should route_to('projects/blob#show', project_id: 'gitlabhq', id: 'master/app/models/compare.rb')
get("/gitlab/gitlabhq/blob/master/files.scss").should route_to('blob#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss') get("/gitlab/gitlabhq/blob/master/files.scss").should route_to('projects/blob#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss')
end end
end end
# project_tree GET /:project_id/tree/:id(.:format) tree#show {id: /.+/, project_id: /[^\/]+/} # project_tree GET /:project_id/tree/:id(.:format) tree#show {id: /.+/, project_id: /[^\/]+/}
describe TreeController, "routing" do describe Projects::TreeController, "routing" do
it "to #show" do it "to #show" do
get("/gitlabhq/tree/master/app/models/project.rb").should route_to('tree#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') get("/gitlabhq/tree/master/app/models/project.rb").should route_to('projects/tree#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
get("/gitlab/gitlabhq/tree/master/files.scss").should route_to('tree#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss') get("/gitlab/gitlabhq/tree/master/files.scss").should route_to('projects/tree#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss')
end end
end end
# project_compare_index GET /:project_id/compare(.:format) compare#index {id: /[^\/]+/, project_id: /[^\/]+/} # project_compare_index GET /:project_id/compare(.:format) compare#index {id: /[^\/]+/, project_id: /[^\/]+/}
# POST /:project_id/compare(.:format) compare#create {id: /[^\/]+/, project_id: /[^\/]+/} # POST /:project_id/compare(.:format) compare#create {id: /[^\/]+/, project_id: /[^\/]+/}
# project_compare /:project_id/compare/:from...:to(.:format) compare#show {from: /.+/, to: /.+/, id: /[^\/]+/, project_id: /[^\/]+/} # project_compare /:project_id/compare/:from...:to(.:format) compare#show {from: /.+/, to: /.+/, id: /[^\/]+/, project_id: /[^\/]+/}
describe CompareController, "routing" do describe Projects::CompareController, "routing" do
it "to #index" do it "to #index" do
get("/gitlabhq/compare").should route_to('compare#index', project_id: 'gitlabhq') get("/gitlabhq/compare").should route_to('projects/compare#index', project_id: 'gitlabhq')
end end
it "to #compare" do it "to #compare" do
post("/gitlabhq/compare").should route_to('compare#create', project_id: 'gitlabhq') post("/gitlabhq/compare").should route_to('projects/compare#create', project_id: 'gitlabhq')
end end
it "to #show" do it "to #show" do
get("/gitlabhq/compare/master...stable").should route_to('compare#show', project_id: 'gitlabhq', from: 'master', to: 'stable') get("/gitlabhq/compare/master...stable").should route_to('projects/compare#show', project_id: 'gitlabhq', from: 'master', to: 'stable')
get("/gitlabhq/compare/issue/1234...stable").should route_to('compare#show', project_id: 'gitlabhq', from: 'issue/1234', to: 'stable') get("/gitlabhq/compare/issue/1234...stable").should route_to('projects/compare#show', project_id: 'gitlabhq', from: 'issue/1234', to: 'stable')
end end
end end
describe NetworkController, "routing" do describe Projects::NetworkController, "routing" do
it "to #show" do it "to #show" do
get("/gitlabhq/network/master").should route_to('network#show', project_id: 'gitlabhq', id: 'master') get("/gitlabhq/network/master").should route_to('projects/network#show', project_id: 'gitlabhq', id: 'master')
get("/gitlabhq/network/master.json").should route_to('network#show', project_id: 'gitlabhq', id: 'master', format: "json") get("/gitlabhq/network/master.json").should route_to('projects/network#show', project_id: 'gitlabhq', id: 'master', format: "json")
end end
end end
describe GraphsController, "routing" do describe Projects::GraphsController, "routing" do
it "to #show" do it "to #show" do
get("/gitlabhq/graphs/master").should route_to('graphs#show', project_id: 'gitlabhq', id: 'master') get("/gitlabhq/graphs/master").should route_to('projects/graphs#show', project_id: 'gitlabhq', id: 'master')
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment