move Wall to own resource
This commit is contained in:
parent
f3dfd22993
commit
57f3409bcc
7 changed files with 39 additions and 25 deletions
|
@ -68,22 +68,6 @@ class ProjectsController < ProjectResourceController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
|
||||||
# Wall
|
|
||||||
#
|
|
||||||
|
|
||||||
def wall
|
|
||||||
return render_404 unless @project.wall_enabled
|
|
||||||
|
|
||||||
@target_type = :wall
|
|
||||||
@target_id = nil
|
|
||||||
@note = @project.notes.new
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
return access_denied! unless can?(current_user, :remove_project, project)
|
return access_denied! unless can?(current_user, :remove_project, project)
|
||||||
|
|
||||||
|
|
20
app/controllers/walls_controller.rb
Normal file
20
app/controllers/walls_controller.rb
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
class WallsController < ProjectResourceController
|
||||||
|
before_filter :module_enabled
|
||||||
|
|
||||||
|
respond_to :js, :html
|
||||||
|
|
||||||
|
def show
|
||||||
|
@note = @project.notes.new
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def module_enabled
|
||||||
|
return render_404 unless @project.wall_enabled
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -105,7 +105,7 @@ module ApplicationHelper
|
||||||
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Snippets", url: project_snippets_path(@project) },
|
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Snippets", url: project_snippets_path(@project) },
|
||||||
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Team", url: project_team_index_path(@project) },
|
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Team", url: project_team_index_path(@project) },
|
||||||
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Tree", url: project_tree_path(@project, @ref || @project.repository.root_ref) },
|
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Tree", url: project_tree_path(@project, @ref || @project.repository.root_ref) },
|
||||||
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Wall", url: wall_project_path(@project) },
|
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Wall", url: project_wall_path(@project) },
|
||||||
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Wiki", url: project_wikis_path(@project) },
|
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Wiki", url: project_wikis_path(@project) },
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
- if @project.wall_enabled
|
- if @project.wall_enabled
|
||||||
= nav_link(path: 'projects#wall') do
|
= nav_link(path: 'projects#wall') do
|
||||||
= link_to 'Wall', wall_project_path(@project)
|
= link_to 'Wall', project_wall_path(@project)
|
||||||
|
|
||||||
- if @project.snippets_enabled
|
- if @project.snippets_enabled
|
||||||
= nav_link(controller: :snippets) do
|
= nav_link(controller: :snippets) do
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
%div.wall_page
|
|
||||||
= render "notes/reversed_notes_with_form"
|
|
11
app/views/walls/show.html.haml
Normal file
11
app/views/walls/show.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
%div.wall-page
|
||||||
|
%ul.well-list.notes
|
||||||
|
.notes-busy.js-notes-busy
|
||||||
|
|
||||||
|
.js-main-target-form
|
||||||
|
= render "notes/form"
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
$(function(){
|
||||||
|
Wall.init(#{@project.id});
|
||||||
|
});
|
|
@ -167,11 +167,6 @@ Gitlab::Application.routes.draw do
|
||||||
# Project Area
|
# Project Area
|
||||||
#
|
#
|
||||||
resources :projects, constraints: { id: /(?:[a-zA-Z.0-9_\-]+\/)?[a-zA-Z.0-9_\-]+/ }, except: [:new, :create, :index], path: "/" do
|
resources :projects, constraints: { id: /(?:[a-zA-Z.0-9_\-]+\/)?[a-zA-Z.0-9_\-]+/ }, except: [:new, :create, :index], path: "/" do
|
||||||
member do
|
|
||||||
get "wall"
|
|
||||||
get "files"
|
|
||||||
end
|
|
||||||
|
|
||||||
resources :blob, only: [:show], constraints: {id: /.+/}
|
resources :blob, only: [:show], constraints: {id: /.+/}
|
||||||
resources :tree, only: [:show, :edit, :update], constraints: {id: /.+/}
|
resources :tree, only: [:show, :edit, :update], constraints: {id: /.+/}
|
||||||
resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
|
resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
|
||||||
|
@ -194,6 +189,12 @@ Gitlab::Application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resource :wall, only: [:show] do
|
||||||
|
member do
|
||||||
|
get 'notes'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
resource :repository do
|
resource :repository do
|
||||||
member do
|
member do
|
||||||
get "branches"
|
get "branches"
|
||||||
|
|
Loading…
Reference in a new issue