Commit 1219931c by Bui Minh Duc

fixed layout issue

parent 1d581db8
......@@ -12,6 +12,8 @@ class RepositoryJob < ApplicationJob
loader.insert_issues($client, list_db_repo)
loader.insert_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"
end
end
......@@ -37,8 +37,15 @@
</table>
<div class="panel panel-default">
<div class="panel-body">
<%= $markdown.render(@issue.body).html_safe %>
<div class="panel-heading">
<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>
<!-- <h2>List Comments in Issue</h2> -->
......
<div class="container">
<!-- content -->
<div class="form-group">
<label>Select repository</label>
<select class="selectpicker" id="selectpicker1" multiple data-live-search="true"
......@@ -67,7 +66,6 @@
<% if row[label].nil? %>
<td class="col-md-1">0</td>
<% 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>
<% end %>
......@@ -157,10 +155,8 @@
$(document).on('ready', function(event) {
// location.reload();
$('#datetimepicker1').datetimepicker({
format: "DD/MM/YYYY"
});
$('#datetimepicker2').datetimepicker({
format: "DD/MM/YYYY"
format: "DD/MM/YYYY",
showClear: true
});
$('#selectpicker1').selectpicker(); // init picker
......
......@@ -13,36 +13,59 @@
</div>
<% @comments.each do |comment| %>
<div class="panel panel-default">
<div class="panel-heading"><h4><%= link_to comment.user.login, comment.user.html_url %></h4></div>
<div class="panel-body"><%= $markdown.render(comment.body).html_safe %></div>
<div class="panel-heading">
<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>
<% end %>
<% @rv_comments.each do |rv_comment| %>
<%= form_for :rv_comment, method: :patch, html: { class: "form-inline" } do |f| %>
<div class="panel panel-default">
<%= f.hidden_field "id", value: rv_comment.id %>
<div class="panel-heading"><h4><%= link_to rv_comment.user.login %></h4></div>
<div class="panel-body">
<div class="panel panel-primary">
<div class="panel-heading">
<h4><b>Before Release</b></h4>
</div>
<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">
<%= 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">
<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 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>
<% end %>
<% end %>
<% end %>
<% end %>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<h4><b>After Release</b></h4>
</div>
<div class="panel-body">
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
......
......@@ -26,7 +26,7 @@
data-show-export="true"
data-minimum-count-columns="2"
data-show-pagination-switch="true"
data-pagination="true"
data-pagination="false"
data-id-field="id"
data-page-list="[10, 25, 50, 100, ALL]">
<thead>
......@@ -38,7 +38,7 @@
<tbody>
<% @issues.each do |issue| %>
<tr>
<td><%= link_to issue.title, issue %></td>
<td><b><%= link_to issue.title, issue %></b></td>
<td><%= issue.created_at %></td>
</tr>
<% issue.pull_requests.each do |pull| %>
......
......@@ -52,7 +52,7 @@ class GithubLoader
db_label = Label.new
db_label.id = label.id
db_label.url = label.url
db_label.repository_id = repo.id
# db_label.repository_id = repo.id
end
db_label.name = normalized_label
db_label.color = label.color
......@@ -129,6 +129,8 @@ class GithubLoader
db_issue.updated_at = issue.updated_at
db_issue.closed_at = issue.closed_at
db_issue.save
# TODO
col_labels = ["discussion", "todo", "inprogress", "vnreview", "jpreview",
"ready", "done", "releasefailed", "pending"]
......@@ -144,24 +146,29 @@ class GithubLoader
end
end
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)
end
elsif new_label.name != old_label.name
timeline = Timeline.where(issue_id: db_issue.id, label: old_label.name).last
begin
elsif !old_label.nil? and new_label.nil?
timeline = Timeline.where(issue_id: db_issue.id, label: old_label.name).last
timeline.end_time = Time.now
timeline.save
rescue
# byebug
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)
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 TODO
......@@ -175,9 +182,7 @@ class GithubLoader
end
end
end
db_issue.save
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment