BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d537a9a4
Unverified
Commit
d537a9a4
authored
May 22, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move issuable_app_data to helper
parent
ab0374f4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
issuables_helper.rb
app/helpers/issuables_helper.rb
+8
-0
show.html.haml
app/views/projects/issues/show.html.haml
+1
-4
No files found.
app/helpers/issuables_helper.rb
View file @
d537a9a4
module
IssuablesHelper
include
GitlabRoutingHelper
include
EditableHelper
def
sidebar_gutter_toggle_icon
sidebar_gutter_collapsed?
?
icon
(
'angle-double-left'
,
{
'aria-hidden'
:
'true'
})
:
icon
(
'angle-double-right'
,
{
'aria-hidden'
:
'true'
})
...
...
@@ -273,4 +274,11 @@ module IssuablesHelper
container:
(
is_collapsed
?
'body'
:
nil
)
}
end
def
issuable_app_data
(
project
,
issue
)
data
=
{
"endpoint"
=>
realtime_changes_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
),
"can-update"
=>
can?
(
current_user
,
:update_issue
,
issue
).
to_s
,
"issuable-ref"
=>
issue
.
to_reference
}
updated_at_by
=
updated_at_by
(
issue
)
data
.
merge
(
updated_at_by
)
if
updated_at_by
.
present?
end
end
app/views/projects/issues/show.html.haml
View file @
d537a9a4
...
...
@@ -55,10 +55,7 @@
.issue-details.issuable-details
.detail-page-description.content-block
-
issuable_app_data
=
{
"endpoint"
=>
realtime_changes_namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
),
"can-update"
=>
can?
(
current_user
,
:update_issue
,
@issue
).
to_s
,
"issuable-ref"
=>
@issue
.
to_reference
}
-
updated_at_by
=
updated_at_by
(
@issue
)
-
issuable_app_data
.
merge
(
updated_at_by
)
if
updated_at_by
.
present?
#js-issuable-app
{
data:
issuable_app_data
}
#js-issuable-app
{
data:
issuable_app_data
(
@project
,
@issue
)
}
%h2
.title
=
markdown_field
(
@issue
,
:title
)
-
if
@issue
.
description
.
present?
.description
{
class:
can?
(
current_user
,
:update_issue
,
@issue
)
?
'js-task-list-container'
:
''
}
...
...
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