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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
ba67af79
Commit
ba67af79
authored
Nov 05, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More release related logic to separate resource
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
1c4d1c3b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
11 deletions
+46
-11
app/controllers/projects/releases_controller.rb
app/controllers/projects/releases_controller.rb
+32
-0
app/controllers/projects/tags_controller.rb
app/controllers/projects/tags_controller.rb
+0
-8
app/models/project.rb
app/models/project.rb
+2
-1
app/views/projects/releases/edit.html.haml
app/views/projects/releases/edit.html.haml
+6
-0
app/views/projects/releases/show.html.haml
app/views/projects/releases/show.html.haml
+1
-0
app/views/projects/tags/_tag.html.haml
app/views/projects/tags/_tag.html.haml
+1
-1
app/views/projects/tags/edit.html.haml
app/views/projects/tags/edit.html.haml
+0
-0
config/routes.rb
config/routes.rb
+4
-1
No files found.
app/controllers/projects/releases_controller.rb
0 → 100644
View file @
ba67af79
class
Projects::ReleasesController
<
Projects
::
ApplicationController
# Authorize
before_action
:require_non_empty_project
before_action
:authorize_download_code!
before_action
:authorize_push_code!
before_action
:tag
before_action
:release
def
show
end
def
edit
end
def
update
description
=
params
[
:release
][
:description
]
release
.
update_attributes
(
description:
description
)
release
.
save
redirect_to
namespace_project_tag_release_path
(
@project
.
namespace
,
@project
,
@tag
.
name
)
end
private
def
tag
@tag
||=
@repository
.
find_tag
(
params
[
:tag_id
])
end
def
release
@release
||=
@project
.
releases
.
find_or_initialize_by
(
tag:
@tag
.
name
)
end
end
app/controllers/projects/tags_controller.rb
View file @
ba67af79
...
...
@@ -10,14 +10,6 @@ class Projects::TagsController < Projects::ApplicationController
@tags
=
Kaminari
.
paginate_array
(
sorted
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
edit
# TODO: implement
end
def
update
# TODO: implement
end
def
create
result
=
CreateTagService
.
new
(
@project
,
current_user
).
execute
(
params
[
:tag_name
],
params
[
:ref
],
params
[
:message
])
...
...
app/models/project.rb
View file @
ba67af79
...
...
@@ -121,6 +121,7 @@ class Project < ActiveRecord::Base
has_many
:starrers
,
through: :users_star_projects
,
source: :user
has_many
:ci_commits
,
dependent: :destroy
,
class_name:
'Ci::Commit'
,
foreign_key: :gl_project_id
has_many
:ci_builds
,
through: :ci_commits
,
source: :builds
,
dependent: :destroy
,
class_name:
'Ci::Build'
has_many
:releases
,
dependent: :destroy
has_one
:import_data
,
dependent: :destroy
,
class_name:
"ProjectImportData"
has_one
:gitlab_ci_project
,
dependent: :destroy
,
class_name:
"Ci::Project"
,
foreign_key: :gitlab_id
...
...
@@ -247,7 +248,7 @@ class Project < ActiveRecord::Base
joins
(
:namespace
).
iwhere
(
'namespaces.path'
=>
namespace_path
)
projects
.
where
(
'projects.path'
=>
project_path
).
take
||
projects
.
where
(
'projects.path'
=>
project_path
).
take
||
projects
.
iwhere
(
'projects.path'
=>
project_path
).
take
end
...
...
app/views/projects/releases/edit.html.haml
0 → 100644
View file @
ba67af79
=
form_for
(
@release
,
method: :put
,
url:
namespace_project_tag_release_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
html:
{
class:
'form-horizontal gfm-form'
})
do
|
f
|
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"md-preview"
,
referenced_users:
true
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :description
,
classes:
'js-quick-submit'
=
render
'projects/notes/hints'
.error-alert
=
f
.
submit
'Save changes'
,
class:
'btn btn-save'
app/views/projects/releases/show.html.haml
0 → 100644
View file @
ba67af79
=
debug
@release
app/views/projects/tags/_tag.html.haml
View file @
ba67af79
...
...
@@ -9,7 +9,7 @@
=
strip_gpg_signature
(
tag
.
message
)
.controls
=
link_to
edit_namespace_project_tag_path
(
@project
.
namespace
,
@project
,
tag
.
name
),
class:
'btn-grouped btn'
do
=
link_to
edit_namespace_project_tag_
release_
path
(
@project
.
namespace
,
@project
,
tag
.
name
),
class:
'btn-grouped btn'
do
=
icon
(
"pencil"
)
-
if
can?
current_user
,
:download_code
,
@project
=
render
'projects/repositories/download_archive'
,
ref:
tag
.
name
,
btn_class:
'btn-grouped btn-group-xs'
...
...
app/views/projects/tags/edit.html.haml
deleted
100644 → 0
View file @
1c4d1c3b
config/routes.rb
View file @
ba67af79
...
...
@@ -569,7 +569,10 @@ Gitlab::Application.routes.draw do
end
resources
:branches
,
only:
[
:index
,
:new
,
:create
,
:destroy
],
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
resources
:tags
,
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
resources
:tags
,
only:
[
:index
,
:new
,
:create
,
:destroy
],
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
do
resource
:release
end
resources
:protected_branches
,
only:
[
:index
,
:create
,
:update
,
:destroy
],
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
resource
:variables
,
only:
[
:show
,
:update
]
resources
:triggers
,
only:
[
:index
,
:create
,
:destroy
]
...
...
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