Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
ventura-ghr
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
ventura-ghr
Commits
265e25cb
Commit
265e25cb
authored
Jan 12, 2017
by
Bui Minh Duc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pull comment
parent
c461871c
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
13 deletions
+34
-13
app/assets/javascripts/review_comments.coffee
+3
-0
app/assets/stylesheets/review_comments.scss
+3
-0
app/controllers/pulls_controller.rb
+0
-10
app/controllers/review_comments_controller.rb
+11
-0
app/helpers/review_comments_helper.rb
+2
-0
app/views/pulls/show.html.erb
+2
-3
config/routes.rb
+1
-0
github.log
+5
-0
test/controllers/review_comments_controller_test.rb
+7
-0
No files found.
app/assets/javascripts/review_comments.coffee
0 → 100644
View file @
265e25cb
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
app/assets/stylesheets/review_comments.scss
0 → 100644
View file @
265e25cb
// Place all the styles related to the review_comments controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
app/controllers/pulls_controller.rb
View file @
265e25cb
...
@@ -16,14 +16,4 @@ class PullsController < ApplicationController
...
@@ -16,14 +16,4 @@ class PullsController < ApplicationController
{
id:
2
,
type:
"Medium"
},
{
id:
2
,
type:
"Medium"
},
{
id:
3
,
type:
"Large"
}]
{
id:
3
,
type:
"Large"
}]
end
end
def
update
if
!
params
[
:rv_comment
].
nil?
@rv_comment
=
ReviewComment
.
find_by
(
id:
params
[
:rv_comment
][
:id
])
@rv_comment
.
score
=
params
[
:rv_comment
][
:score
]
@rv_comment
.
save
render
json:
{
comment:
@rv_comment
.
id
,
score:
@rv_comment
.
score
}
end
end
end
end
app/controllers/review_comments_controller.rb
0 → 100644
View file @
265e25cb
class
ReviewCommentsController
<
ApplicationController
def
update
@rv_comment
=
ReviewComment
.
find_by
(
id:
params
[
:rv_comment
][
:id
])
@rv_comment
.
score
=
params
[
:rv_comment
][
:score
]
@rv_comment
.
save
render
json:
{
comment:
@rv_comment
.
id
,
score:
@rv_comment
.
score
}
end
end
app/helpers/review_comments_helper.rb
0 → 100644
View file @
265e25cb
module
ReviewCommentsHelper
end
app/views/pulls/show.html.erb
View file @
265e25cb
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</div>
</div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<%
@rv_comments
.
each
do
|
rv_comment
|
%>
<%
@rv_comments
.
each
do
|
rv_comment
|
%>
<%=
form_for
:rv_comment
,
method: :patch
,
html:
{
class:
"form-inline rate-form"
}
do
|
f
|
%>
<%=
form_for
:rv_comment
,
url:
pull_review_comment_path
(
pull_id:
@pull
.
id
,
id:
rv_comment
.
id
),
method: :patch
,
html:
{
class:
"form-inline rate-form"
}
do
|
f
|
%>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<%=
f
.
hidden_field
"id"
,
value:
rv_comment
.
id
%>
<%=
f
.
hidden_field
"id"
,
value:
rv_comment
.
id
%>
<div
class=
"panel-heading"
>
<div
class=
"panel-heading"
>
...
@@ -108,6 +108,7 @@
...
@@ -108,6 +108,7 @@
<%=
f
.
submit
"Submit"
,
class:
"btn btn-default"
,
style:
"float: right;"
%>
<%=
f
.
submit
"Submit"
,
class:
"btn btn-default"
,
style:
"float: right;"
%>
</div>
</div>
<div
class=
"col-md-3"
style=
"float: right;"
>
<div
class=
"col-md-3"
style=
"float: right;"
>
<%
@comment
=
OpenStruct
.
new
({
score:
0
})
%>
<%=
f
.
select
(
:score
,
@options
.
collect
{
|
x
|
[
x
[
:type
],
x
[
:id
]
]
},
{},
{
class:
'form-control'
,
style:
"float: right;"
})
%>
<%=
f
.
select
(
:score
,
@options
.
collect
{
|
x
|
[
x
[
:type
],
x
[
:id
]
]
},
{},
{
class:
'form-control'
,
style:
"float: right;"
})
%>
</div>
</div>
</div>
</div>
...
@@ -185,7 +186,6 @@
...
@@ -185,7 +186,6 @@
});
});
});
});
$
(
".btn-save"
).
click
(
function
()
{
$
(
".rate-form"
).
submit
(
function
(
event
)
{
$
(
".rate-form"
).
submit
(
function
(
event
)
{
var
submitVar
=
$
(
this
).
serialize
();
var
submitVar
=
$
(
this
).
serialize
();
$
.
ajax
({
$
.
ajax
({
...
@@ -206,7 +206,6 @@
...
@@ -206,7 +206,6 @@
});
});
return
false
;
return
false
;
});
});
});
</script>
</script>
</div>
</div>
config/routes.rb
View file @
265e25cb
...
@@ -9,6 +9,7 @@ Rails.application.routes.draw do
...
@@ -9,6 +9,7 @@ Rails.application.routes.draw do
resources
:issues
resources
:issues
resources
:pulls
do
resources
:pulls
do
resources
:comments
resources
:comments
resources
:review_comments
end
end
resources
:repositories
resources
:repositories
resources
:comments
resources
:comments
...
...
github.log
View file @
265e25cb
...
@@ -523,3 +523,8 @@ I, [2017-01-12T14:01:51.798510 #24037] INFO -- : Insert review comments
...
@@ -523,3 +523,8 @@ I, [2017-01-12T14:01:51.798510 #24037] INFO -- : Insert review comments
I, [2017-01-12T14:02:25.461132 #24037] INFO -- : Finished task update in 141.885639132s
I, [2017-01-12T14:02:25.461132 #24037] INFO -- : Finished task update in 141.885639132s
I, [2017-01-12T15:00:04.918096 #28801] INFO -- : Begin task update ["socialtools", "arubaito-ex", "kuruma-ex", "arubaito_v2"]
I, [2017-01-12T15:00:04.918096 #28801] INFO -- : Begin task update ["socialtools", "arubaito-ex", "kuruma-ex", "arubaito_v2"]
I, [2017-01-12T15:00:04.921609 #28801] INFO -- : Insert issues
I, [2017-01-12T15:00:04.921609 #28801] INFO -- : Insert issues
I, [2017-01-12T16:00:04.085646 #428] INFO -- : Begin task update ["socialtools", "arubaito-ex", "kuruma-ex", "arubaito_v2"]
I, [2017-01-12T16:00:04.088863 #428] INFO -- : Insert issues
I, [2017-01-12T16:01:26.415292 #428] INFO -- : Insert comments
I, [2017-01-12T16:01:52.210615 #428] INFO -- : Insert review comments
I, [2017-01-12T16:02:37.067253 #428] INFO -- : Finished task update in 153.136871445s
test/controllers/review_comments_controller_test.rb
0 → 100644
View file @
265e25cb
require
'test_helper'
class
ReviewCommentsControllerTest
<
ActionDispatch
::
IntegrationTest
# test "the truth" do
# assert true
# end
end
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