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
1219931c
Commit
1219931c
authored
Jan 10, 2017
by
Bui Minh Duc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed layout issue
parent
1d581db8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
81 additions
and
48 deletions
+81
-48
app/jobs/repository_job.rb
+2
-0
app/views/issues/show.html.erb
+9
-2
app/views/main/index.html.erb
+2
-6
app/views/pulls/show.html.erb
+46
-23
app/views/repositories/show.html.erb
+2
-2
github.log
+0
-0
lib/github_loader.rb
+20
-15
No files found.
app/jobs/repository_job.rb
View file @
1219931c
...
@@ -12,6 +12,8 @@ class RepositoryJob < ApplicationJob
...
@@ -12,6 +12,8 @@ class RepositoryJob < ApplicationJob
loader
.
insert_issues
(
$client
,
list_db_repo
)
loader
.
insert_issues
(
$client
,
list_db_repo
)
loader
.
insert_comments
(
$client
,
list_db_repo
)
loader
.
insert_comments
(
$client
,
list_db_repo
)
loader
.
insert_review_comments
(
$client
,
list_db_repo
)
loader
.
insert_review_comments
(
$client
,
list_db_repo
)
loader
.
update_issue_pull_association
logger
.
info
"Finished task update in
#{
Time
.
now
-
start_time
}
s"
logger
.
info
"Finished task update in
#{
Time
.
now
-
start_time
}
s"
end
end
end
end
app/views/issues/show.html.erb
View file @
1219931c
...
@@ -37,8 +37,15 @@
...
@@ -37,8 +37,15 @@
</table>
</table>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
<div
class=
"panel-heading"
>
<%=
$markdown
.
render
(
@issue
.
body
).
html_safe
%>
<h4
class=
"panel-title"
>
<a
data-toggle=
"collapse"
href=
"#collapse1"
>
Show Content
</a>
</h4>
</div>
<div
id=
"collapse1"
class=
"panel-collapse collapse"
>
<div
class=
"panel-body"
>
<%=
$markdown
.
render
(
@issue
.
body
).
html_safe
%>
</div>
</div>
</div>
</div>
</div>
<!-- <h2>List Comments in Issue</h2> -->
<!-- <h2>List Comments in Issue</h2> -->
...
...
app/views/main/index.html.erb
View file @
1219931c
<div
class=
"container"
>
<div
class=
"container"
>
<!-- content -->
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label>
Select repository
</label>
<label>
Select repository
</label>
<select
class=
"selectpicker"
id=
"selectpicker1"
multiple
data-live-search=
"true"
<select
class=
"selectpicker"
id=
"selectpicker1"
multiple
data-live-search=
"true"
...
@@ -67,7 +66,6 @@
...
@@ -67,7 +66,6 @@
<%
if
row
[
label
].
nil?
%>
<%
if
row
[
label
].
nil?
%>
<td
class=
"col-md-1"
>
0
</td>
<td
class=
"col-md-1"
>
0
</td>
<%
else
%>
<%
else
%>
<!-- <td class="col-md-1"><a href="" data-toggle="modal" data-target="#
<%=
format_html_id
(
row
[
:name
]
+
label
)
%>
">
<%=
row
[
label
][
:count
]
%>
</a></td> -->
<td
class=
"col-md-1"
>
<%=
link_to
row
[
label
][
:count
],
issues_path
(
repo:
row
[
:name
],
label:
label
,
date:
@from_date
,
filter:
@label_filter_params
,
type:
@type_of_issue
),
target:
"_blank"
%>
</td>
<td
class=
"col-md-1"
>
<%=
link_to
row
[
label
][
:count
],
issues_path
(
repo:
row
[
:name
],
label:
label
,
date:
@from_date
,
filter:
@label_filter_params
,
type:
@type_of_issue
),
target:
"_blank"
%>
</td>
<%
end
%>
<%
end
%>
...
@@ -157,10 +155,8 @@
...
@@ -157,10 +155,8 @@
$
(
document
).
on
(
'ready'
,
function
(
event
)
{
$
(
document
).
on
(
'ready'
,
function
(
event
)
{
// location.reload();
// location.reload();
$
(
'#datetimepicker1'
).
datetimepicker
({
$
(
'#datetimepicker1'
).
datetimepicker
({
format
:
"DD/MM/YYYY"
format
:
"DD/MM/YYYY"
,
});
showClear
:
true
$
(
'#datetimepicker2'
).
datetimepicker
({
format
:
"DD/MM/YYYY"
});
});
$
(
'#selectpicker1'
).
selectpicker
();
// init picker
$
(
'#selectpicker1'
).
selectpicker
();
// init picker
...
...
app/views/pulls/show.html.erb
View file @
1219931c
...
@@ -13,36 +13,59 @@
...
@@ -13,36 +13,59 @@
</div>
</div>
<%
@comments
.
each
do
|
comment
|
%>
<%
@comments
.
each
do
|
comment
|
%>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
><h4>
<%=
link_to
comment
.
user
.
login
,
comment
.
user
.
html_url
%>
</h4></div>
<div
class=
"panel-heading"
>
<div
class=
"panel-body"
>
<%=
$markdown
.
render
(
comment
.
body
).
html_safe
%>
</div>
<h5>
<%=
link_to
comment
.
user
.
login
,
comment
.
user
.
html_url
%>
|
<span><a
data-toggle=
"collapse"
href=
"#collapse
<%=
comment
.
id
%>
"
>
Show Content
</a></span>
</h5>
</div>
<div
id=
"collapse
<%=
comment
.
id
%>
"
class=
"panel-collapse collapse"
>
<div
class=
"panel-body"
>
<%=
$markdown
.
render
(
comment
.
body
).
html_safe
%>
</div>
</div>
</div>
</div>
<%
end
%>
<%
end
%>
<%
@rv_comments
.
each
do
|
rv_comment
|
%>
<div
class=
"panel panel-primary"
>
<%=
form_for
:rv_comment
,
method: :patch
,
html:
{
class:
"form-inline"
}
do
|
f
|
%>
<div
class=
"panel-heading"
>
<div
class=
"panel panel-default"
>
<h4><b>
Before Release
</b></h4>
<%=
f
.
hidden_field
"id"
,
value:
rv_comment
.
id
%>
</div>
<div
class=
"panel-heading"
><h4>
<%=
link_to
rv_comment
.
user
.
login
%>
</h4></div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<%
@rv_comments
.
each
do
|
rv_comment
|
%>
<%=
form_for
:rv_comment
,
method: :patch
,
html:
{
class:
"form-inline"
}
do
|
f
|
%>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<%=
f
.
hidden_field
"id"
,
value:
rv_comment
.
id
%>
<div
class=
"panel-heading"
><h5>
<%=
link_to
rv_comment
.
user
.
login
,
rv_comment
.
user
.
html_url
%>
</h5></div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<p>
<%=
simple_format
(
rv_comment
.
diff_hunk
)
%>
</p>
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
<p>
<%=
simple_format
(
rv_comment
.
diff_hunk
)
%>
</p>
</div>
</div>
<div
class=
"col-md-8"
>
<%=
$markdown
.
render
(
rv_comment
.
body
).
html_safe
%>
</div>
<div
class=
"col-md-4"
>
<div
class=
"form-group"
style=
"float: right;"
>
<%
@rv_comment
=
OpenStruct
.
new
({
score:
rv_comment
.
score
})
%>
<%=
f
.
select
(
"score"
,
@options
.
collect
{
|
x
|
[
x
[
:type
],
x
[
:id
]
]
},
{},
{
class:
'form-control'
})
%>
<%=
f
.
submit
"Save"
,
class:
"btn btn-default"
%>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"col-md-8"
>
<%
end
%>
<%=
$markdown
.
render
(
rv_comment
.
body
).
html_safe
%>
<%
end
%>
</div>
</div>
<div
class=
"col-md-4"
>
</div>
<div
class=
"form-group"
style=
"float: right;"
>
<%
@rv_comment
=
OpenStruct
.
new
({
score:
rv_comment
.
score
})
%>
<div
class=
"panel panel-primary"
>
<%=
f
.
select
(
"score"
,
@options
.
collect
{
|
x
|
[
x
[
:type
],
x
[
:id
]
]
},
{},
{
class:
'form-control'
})
%>
<div
class=
"panel-heading"
>
<%=
f
.
submit
"Save"
,
class:
"btn btn-default"
%>
<h4><b>
After Release
</b></h4>
</div>
</div>
</div>
<div
class=
"panel-body"
>
</div>
</div>
</div>
<%
end
%>
</div>
<%
end
%>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
...
...
app/views/repositories/show.html.erb
View file @
1219931c
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
data-show-export=
"true"
data-show-export=
"true"
data-minimum-count-columns=
"2"
data-minimum-count-columns=
"2"
data-show-pagination-switch=
"true"
data-show-pagination-switch=
"true"
data-pagination=
"
tru
e"
data-pagination=
"
fals
e"
data-id-field=
"id"
data-id-field=
"id"
data-page-list=
"[10, 25, 50, 100, ALL]"
>
data-page-list=
"[10, 25, 50, 100, ALL]"
>
<thead>
<thead>
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<tbody>
<tbody>
<%
@issues
.
each
do
|
issue
|
%>
<%
@issues
.
each
do
|
issue
|
%>
<tr>
<tr>
<td>
<
%=
link_to
issue
.
title
,
issue
%
>
</td>
<td><
b>
<%=
link_to
issue
.
title
,
issue
%>
</b
></td>
<td>
<%=
issue
.
created_at
%>
</td>
<td>
<%=
issue
.
created_at
%>
</td>
</tr>
</tr>
<%
issue
.
pull_requests
.
each
do
|
pull
|
%>
<%
issue
.
pull_requests
.
each
do
|
pull
|
%>
...
...
github.log
View file @
1219931c
This diff is collapsed.
Click to expand it.
lib/github_loader.rb
View file @
1219931c
...
@@ -52,7 +52,7 @@ class GithubLoader
...
@@ -52,7 +52,7 @@ class GithubLoader
db_label
=
Label
.
new
db_label
=
Label
.
new
db_label
.
id
=
label
.
id
db_label
.
id
=
label
.
id
db_label
.
url
=
label
.
url
db_label
.
url
=
label
.
url
db_label
.
repository_id
=
repo
.
id
#
db_label.repository_id = repo.id
end
end
db_label
.
name
=
normalized_label
db_label
.
name
=
normalized_label
db_label
.
color
=
label
.
color
db_label
.
color
=
label
.
color
...
@@ -129,6 +129,8 @@ class GithubLoader
...
@@ -129,6 +129,8 @@ class GithubLoader
db_issue
.
updated_at
=
issue
.
updated_at
db_issue
.
updated_at
=
issue
.
updated_at
db_issue
.
closed_at
=
issue
.
closed_at
db_issue
.
closed_at
=
issue
.
closed_at
db_issue
.
save
# TODO
# TODO
col_labels
=
[
"discussion"
,
"todo"
,
"inprogress"
,
"vnreview"
,
"jpreview"
,
col_labels
=
[
"discussion"
,
"todo"
,
"inprogress"
,
"vnreview"
,
"jpreview"
,
"ready"
,
"done"
,
"releasefailed"
,
"pending"
]
"ready"
,
"done"
,
"releasefailed"
,
"pending"
]
...
@@ -144,24 +146,29 @@ class GithubLoader
...
@@ -144,24 +146,29 @@ class GithubLoader
end
end
end
end
new_label
=
db_issue
.
labels
.
find_by
(
name:
col_labels
)
new_label
=
db_issue
.
labels
.
find_by
(
name:
col_labels
)
if
old_label
.
nil?
unless
new_label
.
nil?
if
old_label
.
nil?
or
new_label
.
nil?
if
old_label
.
nil?
and
new_label
.
nil?
# do nothing
elsif
old_label
.
nil?
and
!
new_label
.
nil?
new_timeline
(
db_issue
.
id
,
new_label
.
name
)
new_timeline
(
db_issue
.
id
,
new_label
.
name
)
end
elsif
!
old_label
.
nil?
and
new_label
.
nil?
elsif
new_label
.
name
!=
old_label
.
name
timeline
=
Timeline
.
where
(
issue_id:
db_issue
.
id
,
label:
old_label
.
name
).
last
timeline
=
Timeline
.
where
(
issue_id:
db_issue
.
id
,
label:
old_label
.
name
).
last
begin
timeline
.
end_time
=
Time
.
now
timeline
.
end_time
=
Time
.
now
timeline
.
save
timeline
.
save
rescue
# byebug
end
end
else
# both old_label and new label is not nil
if
new_label
.
name
!=
old_label
.
name
timeline
=
Timeline
.
where
(
issue_id:
db_issue
.
id
,
label:
old_label
.
name
).
last
timeline
.
end_time
=
Time
.
now
timeline
.
save
new_timeline
(
db_issue
.
id
,
new_label
.
name
)
elsif
new_label
.
name
==
old_label
.
name
timeline
=
Timeline
.
where
(
issue_id:
db_issue
.
id
,
label:
new_label
.
name
).
first
if
timeline
.
nil?
new_timeline
(
db_issue
.
id
,
new_label
.
name
)
new_timeline
(
db_issue
.
id
,
new_label
.
name
)
elsif
new_label
.
name
==
old_label
.
name
timeline
=
Timeline
.
where
(
issue_id:
db_issue
.
id
,
label:
new_label
.
name
).
first
if
timeline
.
nil?
new_timeline
(
db_issue
.
id
,
new_label
.
name
)
end
end
end
end
end
# end TODO
# end TODO
...
@@ -175,9 +182,7 @@ class GithubLoader
...
@@ -175,9 +182,7 @@ class GithubLoader
end
end
end
end
end
end
db_issue
.
save
db_issue
.
save
end
end
end
end
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