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
67043ec5
Commit
67043ec5
authored
Mar 09, 2016
by
Zeger-Jan van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide delete botton on edit page
parent
212e83ba
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
11 deletions
+9
-11
app/models/concerns/internal_id.rb
app/models/concerns/internal_id.rb
+1
-2
app/models/user.rb
app/models/user.rb
+4
-0
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+0
-4
app/views/projects/merge_requests/show/_mr_title.html.haml
app/views/projects/merge_requests/show/_mr_title.html.haml
+0
-4
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+4
-0
db/schema.rb
db/schema.rb
+0
-1
No files found.
app/models/concerns/internal_id.rb
View file @
67043ec5
...
...
@@ -7,8 +7,7 @@ module InternalId
end
def
set_iid
max_iid
=
case
self
.
class
when
Issue
,
MergeRequest
max_iid
=
if
self
.
paranoid?
project
.
send
(
self
.
class
.
name
.
tableize
).
with_deleted
.
maximum
(
:iid
)
else
project
.
send
(
self
.
class
.
name
.
tableize
).
maximum
(
:iid
)
...
...
app/models/user.rb
View file @
67043ec5
...
...
@@ -440,6 +440,10 @@ class User < ActiveRecord::Base
Project
.
where
(
"projects.id IN (
#{
projects_union
.
to_sql
}
)"
)
end
def
owner?
(
project
)
owned_projects
.
include?
(
project
)
end
def
owned_projects
@owned_projects
||=
Project
.
where
(
'namespace_id IN (?) OR namespace_id = ?'
,
...
...
app/views/projects/issues/show.html.haml
View file @
67043ec5
...
...
@@ -45,10 +45,6 @@
-
if
can?
(
current_user
,
:update_issue
,
@issue
)
=
link_to
'Reopen issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
,
format:
'json'
),
data:
{
no_turbolink:
true
},
class:
"btn btn-nr btn-grouped btn-reopen
#{
issue_button_visibility
(
@issue
,
false
)
}
"
,
title:
'Reopen issue'
=
link_to
'Close issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :close
},
status_only:
true
,
format:
'json'
),
data:
{
no_turbolink:
true
},
class:
"btn btn-nr btn-grouped btn-close
#{
issue_button_visibility
(
@issue
,
true
)
}
"
,
title:
'Close issue'
-
if
current_user
.
admin?
=
link_to
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
),
method: :delete
,
class:
'btn btn-grouped'
do
=
icon
(
'trash-o'
)
Delete
=
link_to
edit_namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
),
class:
'btn btn-nr btn-grouped issuable-edit'
do
=
icon
(
'pencil-square-o'
)
Edit
...
...
app/views/projects/merge_requests/show/_mr_title.html.haml
View file @
67043ec5
...
...
@@ -33,7 +33,3 @@
Edit
-
if
@merge_request
.
closed?
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
'btn btn-nr btn-grouped btn-reopen reopen-mr-link'
,
title:
'Reopen merge request'
-
if
current_user
.
admin?
=
link_to
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
method: :delete
,
class:
'btn btn-grouped'
do
=
icon
(
'trash-o'
)
Delete
app/views/shared/issuable/_form.html.haml
View file @
67043ec5
...
...
@@ -106,6 +106,10 @@
=
f
.
submit
"Submit
#{
issuable
.
class
.
model_name
.
human
.
downcase
}
"
,
class:
'btn btn-create'
-
else
=
f
.
submit
'Save changes'
,
class:
'btn btn-save'
-
if
current_user
.
admin?
||
current_user
.
owner?
(
@project
)
=
link_to
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
issuable
),
method: :delete
,
class:
'btn'
do
=
icon
(
'trash-o'
)
Delete
-
if
!
issuable
.
persisted?
&&
!
issuable
.
project
.
empty_repo?
&&
(
guide_url
=
contribution_guide_path
(
issuable
.
project
))
.inline.prepend-left-10
...
...
db/schema.rb
View file @
67043ec5
...
...
@@ -948,7 +948,6 @@ ActiveRecord::Schema.define(version: 20160316204731) do
t
.
string
"unlock_token"
t
.
datetime
"otp_grace_period_started_at"
t
.
boolean
"ldap_email"
,
default:
false
,
null:
false
t
.
boolean
"external"
,
default:
false
end
add_index
"users"
,
[
"admin"
],
name:
"index_users_on_admin"
,
using: :btree
...
...
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