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
e6966300
Commit
e6966300
authored
Nov 17, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add serialize_issuable helper and implement.
parent
feeda94b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+9
-0
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
No files found.
app/helpers/issuables_helper.rb
View file @
e6966300
...
...
@@ -30,6 +30,15 @@ module IssuablesHelper
end
end
def
serialize_issuable
(
issuable
)
case
issuable
when
Issue
IssueSerializer
.
new
.
represent
(
issuable
).
to_json
when
MergeRequest
MergeRequestSerializer
.
new
.
represent
(
issuable
).
to_json
end
end
def
can_add_template?
(
issuable
)
names
=
issuable_templates
(
issuable
)
names
.
empty?
&&
can?
(
current_user
,
:push_code
,
@project
)
&&
!
@project
.
private?
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
e6966300
...
...
@@ -206,7 +206,7 @@
:javascript
gl
.
IssuableResource
=
new
gl
.
SubbableResource
(
'
#{
issuable_json_path
(
issuable
)
}
'
);
new
gl
.
IssuableTimeTracking
(
'
#{
issuable
.
to_json
}
'
);
new
gl
.
IssuableTimeTracking
(
'
#{
serialize_issuable
(
issuable
)
}
'
);
new
MilestoneSelect
(
'
{"namespace":"
#{
@project
.
namespace
.
path
}
","path":"
#{
@project
.
path
}
"}
'
);
new
LabelsSelect
();
new
WeightSelect
();
...
...
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