Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
42387b73
Commit
42387b73
authored
Feb 27, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'route-helper' into 'master'
Introduce shortcuts for routing helpers See merge request !1600
parents
5bf492fe
6ac0a021
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
77 additions
and
49 deletions
+77
-49
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+1
-0
app/controllers/projects/avatars_controller.rb
app/controllers/projects/avatars_controller.rb
+1
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+3
-5
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-3
app/controllers/projects/repositories_controller.rb
app/controllers/projects/repositories_controller.rb
+1
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+4
-4
app/helpers/gitlab_routing_helper.rb
app/helpers/gitlab_routing_helper.rb
+31
-0
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+2
-2
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+2
-2
app/views/dashboard/_project.html.haml
app/views/dashboard/_project.html.haml
+1
-1
app/views/dashboard/projects.html.haml
app/views/dashboard/projects.html.haml
+1
-1
app/views/groups/_projects.html.haml
app/views/groups/_projects.html.haml
+1
-1
app/views/layouts/nav/_project.html.haml
app/views/layouts/nav/_project.html.haml
+3
-3
app/views/projects/_settings_nav.html.haml
app/views/projects/_settings_nav.html.haml
+1
-1
app/views/projects/diffs/_warning.html.haml
app/views/projects/diffs/_warning.html.haml
+2
-2
app/views/projects/issues/_discussion.html.haml
app/views/projects/issues/_discussion.html.haml
+2
-2
app/views/projects/issues/_issue.html.haml
app/views/projects/issues/_issue.html.haml
+4
-4
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+2
-2
app/views/projects/merge_requests/_discussion.html.haml
app/views/projects/merge_requests/_discussion.html.haml
+2
-2
app/views/projects/merge_requests/_merge_request.html.haml
app/views/projects/merge_requests/_merge_request.html.haml
+1
-1
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+5
-5
app/views/projects/merge_requests/show/_diffs.html.haml
app/views/projects/merge_requests/show/_diffs.html.haml
+1
-1
app/views/projects/merge_requests/show/_mr_title.html.haml
app/views/projects/merge_requests/show/_mr_title.html.haml
+2
-2
app/views/projects/milestones/_issue.html.haml
app/views/projects/milestones/_issue.html.haml
+1
-1
app/views/projects/milestones/_merge_request.html.haml
app/views/projects/milestones/_merge_request.html.haml
+1
-1
app/views/projects/no_repo.html.haml
app/views/projects/no_repo.html.haml
+1
-1
No files found.
app/controllers/application_controller.rb
View file @
42387b73
...
@@ -2,6 +2,7 @@ require 'gon'
...
@@ -2,6 +2,7 @@ require 'gon'
class
ApplicationController
<
ActionController
::
Base
class
ApplicationController
<
ActionController
::
Base
include
Gitlab
::
CurrentSettings
include
Gitlab
::
CurrentSettings
include
GitlabRoutingHelper
before_filter
:authenticate_user_from_token!
before_filter
:authenticate_user_from_token!
before_filter
:authenticate_user!
before_filter
:authenticate_user!
...
...
app/controllers/projects/avatars_controller.rb
View file @
42387b73
...
@@ -24,6 +24,6 @@ class Projects::AvatarsController < Projects::ApplicationController
...
@@ -24,6 +24,6 @@ class Projects::AvatarsController < Projects::ApplicationController
@project
.
save
@project
.
save
@project
.
reset_events_cache
@project
.
reset_events_cache
redirect_to
edit_
namespace_project_path
(
@project
.
namespace
,
@project
)
redirect_to
edit_
project_path
(
@project
)
end
end
end
end
app/controllers/projects/issues_controller.rb
View file @
42387b73
...
@@ -60,8 +60,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -60,8 +60,7 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
do
format
.
html
do
if
@issue
.
valid?
if
@issue
.
valid?
redirect_to
namespace_project_issue_path
(
@project
.
namespace
,
redirect_to
issue_path
(
@issue
)
@project
,
@issue
)
else
else
render
:new
render
:new
end
end
...
@@ -79,7 +78,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -79,7 +78,7 @@ class Projects::IssuesController < Projects::ApplicationController
format
.
js
format
.
js
format
.
html
do
format
.
html
do
if
@issue
.
valid?
if
@issue
.
valid?
redirect_to
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@issue
]
redirect_to
issue_path
(
@issue
)
else
else
render
:edit
render
:edit
end
end
...
@@ -129,8 +128,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -129,8 +128,7 @@ class Projects::IssuesController < Projects::ApplicationController
issue
=
@project
.
issues
.
find_by
(
id:
params
[
:id
])
issue
=
@project
.
issues
.
find_by
(
id:
params
[
:id
])
if
issue
if
issue
redirect_to
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
redirect_to
issue_path
(
issue
)
issue
)
return
return
else
else
raise
ActiveRecord
::
RecordNotFound
.
new
raise
ActiveRecord
::
RecordNotFound
.
new
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
42387b73
...
@@ -79,9 +79,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -79,9 +79,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
if
@merge_request
.
valid?
if
@merge_request
.
valid?
redirect_to
(
redirect_to
(
namespace_project_merge_request_path
(
@merge_request
.
target_project
.
namespace
,
merge_request_path
(
@merge_request
),
@merge_request
.
target_project
,
@merge_request
),
notice:
'Merge request was successfully created.'
notice:
'Merge request was successfully created.'
)
)
else
else
...
...
app/controllers/projects/repositories_controller.rb
View file @
42387b73
...
@@ -7,7 +7,7 @@ class Projects::RepositoriesController < Projects::ApplicationController
...
@@ -7,7 +7,7 @@ class Projects::RepositoriesController < Projects::ApplicationController
def
create
def
create
@project
.
create_repository
@project
.
create_repository
redirect_to
namespace_project_path
(
@project
.
namespace
,
@project
)
redirect_to
project_path
(
@project
)
end
end
def
archive
def
archive
...
...
app/controllers/projects_controller.rb
View file @
42387b73
...
@@ -23,7 +23,7 @@ class ProjectsController < ApplicationController
...
@@ -23,7 +23,7 @@ class ProjectsController < ApplicationController
if
@project
.
saved?
if
@project
.
saved?
redirect_to
(
redirect_to
(
namespace_project_path
(
@project
.
namespace
,
@project
),
project_path
(
@project
),
notice:
'Project was successfully created.'
notice:
'Project was successfully created.'
)
)
else
else
...
@@ -39,7 +39,7 @@ class ProjectsController < ApplicationController
...
@@ -39,7 +39,7 @@ class ProjectsController < ApplicationController
flash
[
:notice
]
=
'Project was successfully updated.'
flash
[
:notice
]
=
'Project was successfully updated.'
format
.
html
do
format
.
html
do
redirect_to
(
redirect_to
(
edit_
namespace_project_path
(
@project
.
namespace
,
@project
),
edit_
project_path
(
@project
),
notice:
'Project was successfully updated.'
notice:
'Project was successfully updated.'
)
)
end
end
...
@@ -133,7 +133,7 @@ class ProjectsController < ApplicationController
...
@@ -133,7 +133,7 @@ class ProjectsController < ApplicationController
@project
.
archive!
@project
.
archive!
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
{
redirect_to
namespace_project_path
(
@project
.
namespace
,
@project
)
}
format
.
html
{
redirect_to
project_path
(
@project
)
}
end
end
end
end
...
@@ -142,7 +142,7 @@ class ProjectsController < ApplicationController
...
@@ -142,7 +142,7 @@ class ProjectsController < ApplicationController
@project
.
unarchive!
@project
.
unarchive!
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
{
redirect_to
namespace_project_path
(
@project
.
namespace
,
@project
)
}
format
.
html
{
redirect_to
project_path
(
@project
)
}
end
end
end
end
...
...
app/helpers/gitlab_routing_helper.rb
0 → 100644
View file @
42387b73
# Shorter routing method for project and project items
# Since update to rails 4.1.9 we are now allowed to use `/` in project routing
# so we use nested routing for project resources which include project and
# project namespace. To avoid writing long methods every time we define shortcuts for
# some of routing.
#
# For example instead of this:
#
# namespace_project_merge_request_path(merge_request.project.namespace, merge_request.projects, merge_request)
#
# We can simply use shortcut:
#
# merge_request_path(merge_request)
#
module
GitlabRoutingHelper
def
project_path
(
project
,
*
args
)
namespace_project_path
(
project
.
namespace
,
project
,
*
args
)
end
def
edit_project_path
(
project
,
*
args
)
edit_namespace_project_path
(
project
.
namespace
,
project
,
*
args
)
end
def
issue_path
(
entity
,
*
args
)
namespace_project_issue_path
(
entity
.
project
.
namespace
,
entity
.
project
,
entity
,
*
args
)
end
def
merge_request_path
(
entity
,
*
args
)
namespace_project_merge_request_path
(
entity
.
project
.
namespace
,
entity
.
project
,
entity
,
*
args
)
end
end
app/helpers/projects_helper.rb
View file @
42387b73
...
@@ -46,7 +46,7 @@ module ProjectsHelper
...
@@ -46,7 +46,7 @@ module ProjectsHelper
simple_sanitize
(
project
.
group
.
name
),
group_path
(
project
.
group
)
simple_sanitize
(
project
.
group
.
name
),
group_path
(
project
.
group
)
)
+
' / '
+
)
+
' / '
+
link_to
(
simple_sanitize
(
project
.
name
),
link_to
(
simple_sanitize
(
project
.
name
),
namespace_project_path
(
project
.
namespace
,
project
))
project_path
(
project
))
end
end
else
else
owner
=
project
.
namespace
.
owner
owner
=
project
.
namespace
.
owner
...
@@ -55,7 +55,7 @@ module ProjectsHelper
...
@@ -55,7 +55,7 @@ module ProjectsHelper
simple_sanitize
(
owner
.
name
),
user_path
(
owner
)
simple_sanitize
(
owner
.
name
),
user_path
(
owner
)
)
+
' / '
+
)
+
' / '
+
link_to
(
simple_sanitize
(
project
.
name
),
link_to
(
simple_sanitize
(
project
.
name
),
namespace_project_path
(
project
.
namespace
,
project
))
project_path
(
project
))
end
end
end
end
end
end
...
...
app/views/admin/projects/show.html.haml
View file @
42387b73
%h3
.page-title
%h3
.page-title
Project:
#{
@project
.
name_with_namespace
}
Project:
#{
@project
.
name_with_namespace
}
=
link_to
edit_
namespace_project_path
(
@project
.
namespace
,
@project
),
class:
"btn pull-right"
do
=
link_to
edit_
project_path
(
@project
),
class:
"btn pull-right"
do
%i
.fa.fa-pencil-square-o
%i
.fa.fa-pencil-square-o
Edit
Edit
%hr
%hr
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
%li
%li
%span
.light
Name:
%span
.light
Name:
%strong
%strong
=
link_to
@project
.
name
,
namespace_project_path
(
@project
.
namespace
,
@project
)
=
link_to
@project
.
name
,
project_path
(
@project
)
%li
%li
%span
.light
Namespace:
%span
.light
Namespace:
%strong
%strong
...
...
app/views/dashboard/_project.html.haml
View file @
42387b73
=
link_to
namespace_project_path
(
project
.
namespace
,
project
),
class:
dom_class
(
project
)
do
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
.dash-project-avatar
.dash-project-avatar
=
project_icon
(
project
,
alt:
''
,
class:
'avatar project-avatar s40'
)
=
project_icon
(
project
,
alt:
''
,
class:
'avatar project-avatar s40'
)
.dash-project-access-icon
.dash-project-access-icon
...
...
app/views/dashboard/projects.html.haml
View file @
42387b73
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
=
project_icon
(
"
#{
project
.
namespace
.
to_param
}
/
#{
project
.
to_param
}
"
,
alt:
''
,
class:
'avatar project-avatar s60'
)
=
project_icon
(
"
#{
project
.
namespace
.
to_param
}
/
#{
project
.
to_param
}
"
,
alt:
''
,
class:
'avatar project-avatar s60'
)
.project-access-icon
.project-access-icon
=
visibility_level_icon
(
project
.
visibility_level
)
=
visibility_level_icon
(
project
.
visibility_level
)
=
link_to
namespace_project_path
(
project
.
namespace
,
project
),
class:
dom_class
(
project
)
do
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
%strong
=
project
.
name_with_namespace
%strong
=
project
.
name_with_namespace
-
if
project
.
forked_from_project
-
if
project
.
forked_from_project
...
...
app/views/groups/_projects.html.haml
View file @
42387b73
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
.nothing-here-block
This group has no projects yet
.nothing-here-block
This group has no projects yet
-
projects
.
each
do
|
project
|
-
projects
.
each
do
|
project
|
%li
.project-row
%li
.project-row
=
link_to
namespace_project_path
(
project
.
namespace
,
project
),
class:
dom_class
(
project
)
do
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
.dash-project-avatar
.dash-project-avatar
=
project_icon
(
project
,
alt:
''
,
class:
'avatar s40'
)
=
project_icon
(
project
,
alt:
''
,
class:
'avatar s40'
)
.dash-project-access-icon
.dash-project-access-icon
...
...
app/views/layouts/nav/_project.html.haml
View file @
42387b73
%ul
.project-navigation.nav.nav-sidebar
%ul
.project-navigation.nav.nav-sidebar
-
if
@project_settings_nav
-
if
@project_settings_nav
=
nav_link
do
=
nav_link
do
=
link_to
namespace_project_path
(
@project
.
namespace
,
@project
),
title:
'Back to project'
,
class:
""
do
=
link_to
project_path
(
@project
),
title:
'Back to project'
,
class:
""
do
%i
.fa.fa-caret-square-o-left
%i
.fa.fa-caret-square-o-left
%span
%span
Back to project
Back to project
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
-
else
-
else
=
nav_link
(
path:
'projects#show'
,
html_options:
{
class:
"home"
})
do
=
nav_link
(
path:
'projects#show'
,
html_options:
{
class:
"home"
})
do
=
link_to
namespace_project_path
(
@project
.
namespace
,
@project
),
title:
'Project'
,
class:
'shortcuts-project'
do
=
link_to
project_path
(
@project
),
title:
'Project'
,
class:
'shortcuts-project'
do
%i
.fa.fa-dashboard
%i
.fa.fa-dashboard
%span
%span
Project
Project
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
-
if
project_nav_tab?
:settings
-
if
project_nav_tab?
:settings
=
nav_link
(
html_options:
{
class:
"
#{
project_tab_class
}
separate-item"
})
do
=
nav_link
(
html_options:
{
class:
"
#{
project_tab_class
}
separate-item"
})
do
=
link_to
edit_
namespace_project_path
(
@project
.
namespace
,
@project
),
title:
'Settings'
,
class:
"stat-tab tab no-highlight"
do
=
link_to
edit_
project_path
(
@project
),
title:
'Settings'
,
class:
"stat-tab tab no-highlight"
do
%i
.fa.fa-cogs
%i
.fa.fa-cogs
%span
%span
Settings
Settings
app/views/projects/_settings_nav.html.haml
View file @
42387b73
%ul
.project-settings-nav.sidebar-subnav
%ul
.project-settings-nav.sidebar-subnav
=
nav_link
(
path:
'projects#edit'
)
do
=
nav_link
(
path:
'projects#edit'
)
do
=
link_to
edit_
namespace_project_path
(
@project
.
namespace
,
@project
),
title:
'Project'
,
class:
"stat-tab tab "
do
=
link_to
edit_
project_path
(
@project
),
title:
'Project'
,
class:
"stat-tab tab "
do
%i
.fa.fa-pencil-square-o
%i
.fa.fa-pencil-square-o
%span
%span
Project
Project
...
...
app/views/projects/diffs/_warning.html.haml
View file @
42387b73
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
=
link_to
"Plain diff"
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
,
format: :diff
),
class:
"btn btn-warning btn-small"
=
link_to
"Plain diff"
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
,
format: :diff
),
class:
"btn btn-warning btn-small"
=
link_to
"Email patch"
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
,
format: :patch
),
class:
"btn btn-warning btn-small"
=
link_to
"Email patch"
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
,
format: :patch
),
class:
"btn btn-warning btn-small"
-
elsif
@merge_request
&&
@merge_request
.
persisted?
-
elsif
@merge_request
&&
@merge_request
.
persisted?
=
link_to
"Plain diff"
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
format: :diff
),
class:
"btn btn-warning btn-small"
=
link_to
"Plain diff"
,
merge_request_path
(
@merge_request
,
format: :diff
),
class:
"btn btn-warning btn-small"
=
link_to
"Email patch"
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
format: :patch
),
class:
"btn btn-warning btn-small"
=
link_to
"Email patch"
,
merge_request_path
(
@merge_request
,
format: :patch
),
class:
"btn btn-warning btn-small"
%p
%p
To preserve performance only
To preserve performance only
%strong
#{
allowed_diff_size
}
of
#{
diffs
.
size
}
%strong
#{
allowed_diff_size
}
of
#{
diffs
.
size
}
...
...
app/views/projects/issues/_discussion.html.haml
View file @
42387b73
-
content_for
:note_actions
do
-
content_for
:note_actions
do
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
-
if
@issue
.
closed?
-
if
@issue
.
closed?
=
link_to
'Reopen Issue'
,
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-reopen js-note-target-reopen"
,
title:
'Reopen Issue'
=
link_to
'Reopen Issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-reopen js-note-target-reopen"
,
title:
'Reopen Issue'
-
else
-
else
=
link_to
'Close Issue'
,
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
,
issue:
{
state_event: :close
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-close js-note-target-close"
,
title:
"Close Issue"
=
link_to
'Close Issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :close
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-close js-note-target-close"
,
title:
"Close Issue"
.row
.row
%section
.col-md-9
%section
.col-md-9
.participants
.participants
...
...
app/views/projects/issues/_issue.html.haml
View file @
42387b73
%li
{
id:
dom_id
(
issue
),
class:
issue_css_classes
(
issue
),
url:
namespace_project_issue_path
(
issue
.
project
.
namespace
,
issue
.
project
,
issue
)
}
%li
{
id:
dom_id
(
issue
),
class:
issue_css_classes
(
issue
),
url:
issue_path
(
issue
)
}
-
if
controller
.
controller_name
==
'issues'
-
if
controller
.
controller_name
==
'issues'
.issue-check
.issue-check
=
check_box_tag
dom_id
(
issue
,
"selected"
),
nil
,
false
,
'data-id'
=>
issue
.
id
,
class:
"selected_issue"
,
disabled:
!
can?
(
current_user
,
:modify_issue
,
issue
)
=
check_box_tag
dom_id
(
issue
,
"selected"
),
nil
,
false
,
'data-id'
=>
issue
.
id
,
class:
"selected_issue"
,
disabled:
!
can?
(
current_user
,
:modify_issue
,
issue
)
.issue-title
.issue-title
%span
.str-truncated
%span
.str-truncated
=
link_to_gfm
issue
.
title
,
namespace_project_issue_path
(
issue
.
project
.
namespace
,
issue
.
project
,
issue
),
class:
"row_title"
=
link_to_gfm
issue
.
title
,
issue_path
(
issue
),
class:
"row_title"
.pull-right.light
.pull-right.light
-
if
issue
.
closed?
-
if
issue
.
closed?
%span
%span
...
@@ -41,9 +41,9 @@
...
@@ -41,9 +41,9 @@
.issue-actions
.issue-actions
-
if
can?
current_user
,
:modify_issue
,
issue
-
if
can?
current_user
,
:modify_issue
,
issue
-
if
issue
.
closed?
-
if
issue
.
closed?
=
link_to
'Reopen'
,
namespace_project_issue_path
(
issue
.
project
.
namespace
,
issue
.
project
,
issue
,
issue:
{
state_event: :reopen
},
status_only:
true
),
method: :put
,
class:
"btn btn-small btn-grouped reopen_issue btn-reopen"
,
remote:
true
=
link_to
'Reopen'
,
issue_path
(
issue
,
issue:
{
state_event: :reopen
},
status_only:
true
),
method: :put
,
class:
"btn btn-small btn-grouped reopen_issue btn-reopen"
,
remote:
true
-
else
-
else
=
link_to
'Close'
,
namespace_project_issue_path
(
issue
.
project
.
namespace
,
issue
.
project
,
issue
,
issue:
{
state_event: :close
},
status_only:
true
),
method: :put
,
class:
"btn btn-small btn-grouped close_issue btn-close"
,
remote:
true
=
link_to
'Close'
,
issue_path
(
issue
,
issue:
{
state_event: :close
},
status_only:
true
),
method: :put
,
class:
"btn btn-small btn-grouped close_issue btn-close"
,
remote:
true
=
link_to
edit_namespace_project_issue_path
(
issue
.
project
.
namespace
,
issue
.
project
,
issue
),
class:
"btn btn-small edit-issue-link btn-grouped"
do
=
link_to
edit_namespace_project_issue_path
(
issue
.
project
.
namespace
,
issue
.
project
,
issue
),
class:
"btn btn-small edit-issue-link btn-grouped"
do
%i
.fa.fa-pencil-square-o
%i
.fa.fa-pencil-square-o
Edit
Edit
...
...
app/views/projects/issues/show.html.haml
View file @
42387b73
...
@@ -17,9 +17,9 @@
...
@@ -17,9 +17,9 @@
New Issue
New Issue
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
-
if
@issue
.
closed?
-
if
@issue
.
closed?
=
link_to
'Reopen'
,
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-reopen"
=
link_to
'Reopen'
,
issue_path
(
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-reopen"
-
else
-
else
=
link_to
'Close'
,
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
,
issue:
{
state_event: :close
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-close"
,
title:
"Close Issue"
=
link_to
'Close'
,
issue_path
(
@issue
,
issue:
{
state_event: :close
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-close"
,
title:
"Close Issue"
=
link_to
edit_namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
),
class:
"btn btn-grouped issuable-edit"
do
=
link_to
edit_namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
),
class:
"btn btn-grouped issuable-edit"
do
%i
.fa.fa-pencil-square-o
%i
.fa.fa-pencil-square-o
...
...
app/views/projects/merge_requests/_discussion.html.haml
View file @
42387b73
-
content_for
:note_actions
do
-
content_for
:note_actions
do
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
-
if
@merge_request
.
open?
-
if
@merge_request
.
open?
=
link_to
'Close'
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-grouped btn-close close-mr-link js-note-target-close"
,
title:
"Close merge request"
=
link_to
'Close'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-grouped btn-close close-mr-link js-note-target-close"
,
title:
"Close merge request"
-
if
@merge_request
.
closed?
-
if
@merge_request
.
closed?
=
link_to
'Reopen'
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"btn btn-grouped btn-reopen reopen-mr-link js-note-target-reopen"
,
title:
"Reopen merge request"
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"btn btn-grouped btn-reopen reopen-mr-link js-note-target-reopen"
,
title:
"Reopen merge request"
.row
.row
%section
.col-md-9
%section
.col-md-9
...
...
app/views/projects/merge_requests/_merge_request.html.haml
View file @
42387b73
%li
{
class:
mr_css_classes
(
merge_request
)
}
%li
{
class:
mr_css_classes
(
merge_request
)
}
.merge-request-title
.merge-request-title
%span
.str-truncated
%span
.str-truncated
=
link_to_gfm
merge_request
.
title
,
namespace_project_merge_request_path
(
merge_request
.
target_project
.
namespace
,
merge_request
.
target_project
,
merge_request
),
class:
"row_title"
=
link_to_gfm
merge_request
.
title
,
merge_request_path
(
merge_request
),
class:
"row_title"
.pull-right.light
.pull-right.light
-
if
merge_request
.
merged?
-
if
merge_request
.
merged?
%span
%span
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
42387b73
.merge-request
{
'data-url'
=>
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)}
.merge-request
{
'data-url'
=>
merge_request_path
(
@merge_request
)}
.merge-request-details
.merge-request-details
=
render
"projects/merge_requests/show/mr_title"
=
render
"projects/merge_requests/show/mr_title"
%hr
%hr
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
Download
as
Download
as
%span
.caret
%span
.caret
%ul
.dropdown-menu
%ul
.dropdown-menu
%li
=
link_to
"Email Patches"
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
format: :patch
)
%li
=
link_to
"Email Patches"
,
merge_request_path
(
@merge_request
,
format: :patch
)
%li
=
link_to
"Plain Diff"
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
format: :diff
)
%li
=
link_to
"Plain Diff"
,
merge_request_path
(
@merge_request
,
format: :diff
)
=
render
"projects/merge_requests/show/how_to_merge"
=
render
"projects/merge_requests/show/how_to_merge"
=
render
"projects/merge_requests/show/state_widget"
=
render
"projects/merge_requests/show/state_widget"
...
@@ -37,12 +37,12 @@
...
@@ -37,12 +37,12 @@
-
if
@commits
.
present?
-
if
@commits
.
present?
%ul
.nav.nav-tabs.merge-request-tabs
%ul
.nav.nav-tabs.merge-request-tabs
%li
.notes-tab
{
data:
{
action:
'notes'
}}
%li
.notes-tab
{
data:
{
action:
'notes'
}}
=
link_to
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
do
=
link_to
merge_request_path
(
@merge_request
)
do
%i
.fa.fa-comments
%i
.fa.fa-comments
Discussion
Discussion
%span
.badge
=
@merge_request
.
mr_and_commit_notes
.
count
%span
.badge
=
@merge_request
.
mr_and_commit_notes
.
count
%li
.commits-tab
{
data:
{
action:
'commits'
}}
%li
.commits-tab
{
data:
{
action:
'commits'
}}
=
link_to
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
title:
'Commits'
do
=
link_to
merge_request_path
(
@merge_request
),
title:
'Commits'
do
%i
.fa.fa-history
%i
.fa.fa-history
Commits
Commits
%span
.badge
=
@commits
.
size
%span
.badge
=
@commits
.
size
...
...
app/views/projects/merge_requests/show/_diffs.html.haml
View file @
42387b73
...
@@ -8,5 +8,5 @@
...
@@ -8,5 +8,5 @@
Changes view for this comparison is extremely large.
Changes view for this comparison is extremely large.
%p
%p
You can
You can
=
link_to
"download it"
,
namespace_project_merge_request_path
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
,
format: :diff
),
class:
"vlink"
=
link_to
"download it"
,
merge_request_path
(
@merge_request
,
format: :diff
),
class:
"vlink"
instead.
instead.
app/views/projects/merge_requests/show/_mr_title.html.haml
View file @
42387b73
...
@@ -14,9 +14,9 @@
...
@@ -14,9 +14,9 @@
.issue-btn-group.pull-right
.issue-btn-group.pull-right
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
-
if
@merge_request
.
open?
-
if
@merge_request
.
open?
=
link_to
'Close'
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-grouped btn-close"
,
title:
"Close merge request"
=
link_to
'Close'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-grouped btn-close"
,
title:
"Close merge request"
=
link_to
edit_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
class:
"btn btn-grouped issuable-edit"
,
id:
"edit_merge_request"
do
=
link_to
edit_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
class:
"btn btn-grouped issuable-edit"
,
id:
"edit_merge_request"
do
%i
.fa.fa-pencil-square-o
%i
.fa.fa-pencil-square-o
Edit
Edit
-
if
@merge_request
.
closed?
-
if
@merge_request
.
closed?
=
link_to
'Reopen'
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"btn btn-grouped btn-reopen reopen-mr-link"
,
title:
"Close merge request"
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"btn btn-grouped btn-reopen reopen-mr-link"
,
title:
"Close merge request"
app/views/projects/milestones/_issue.html.haml
View file @
42387b73
%li
{
id:
dom_id
(
issue
,
'sortable'
),
class:
'issue-row'
,
'data-iid'
=>
issue
.
iid
,
'data-url'
=>
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
issue
)
}
%li
{
id:
dom_id
(
issue
,
'sortable'
),
class:
'issue-row'
,
'data-iid'
=>
issue
.
iid
,
'data-url'
=>
issue_path
(
issue
)
}
%span
.str-truncated
%span
.str-truncated
=
link_to
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
issue
]
do
=
link_to
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
issue
]
do
%span
.cgray
##{issue.iid}
%span
.cgray
##{issue.iid}
...
...
app/views/projects/milestones/_merge_request.html.haml
View file @
42387b73
%li
{
id:
dom_id
(
merge_request
,
'sortable'
),
class:
'mr-row'
,
'data-iid'
=>
merge_request
.
iid
,
'data-url'
=>
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
merge_request
)
}
%li
{
id:
dom_id
(
merge_request
,
'sortable'
),
class:
'mr-row'
,
'data-iid'
=>
merge_request
.
iid
,
'data-url'
=>
merge_request_path
(
merge_request
)
}
%span
.str-truncated
%span
.str-truncated
=
link_to
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
merge_request
]
do
=
link_to
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
merge_request
]
do
%span
.cgray
##{merge_request.iid}
%span
.cgray
##{merge_request.iid}
...
...
app/views/projects/no_repo.html.haml
View file @
42387b73
...
@@ -19,4 +19,4 @@
...
@@ -19,4 +19,4 @@
-
if
can?
current_user
,
:remove_project
,
@project
-
if
can?
current_user
,
:remove_project
,
@project
.prepend-top-20
.prepend-top-20
=
link_to
'Remove project'
,
namespace_project_path
(
@project
.
namespace
,
@project
),
data:
{
confirm:
remove_project_message
(
@project
)},
method: :delete
,
class:
"btn btn-remove pull-right"
=
link_to
'Remove project'
,
project_path
(
@project
),
data:
{
confirm:
remove_project_message
(
@project
)},
method: :delete
,
class:
"btn btn-remove pull-right"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment