Skip to content

Commit e2fb628

Browse files
committed
profile fixes
filters and format fixes
1 parent 3892daf commit e2fb628

File tree

3 files changed

+12
-51
lines changed

3 files changed

+12
-51
lines changed

Diff for: app/views/repositories/profile.html.erb

+6-41
Original file line numberDiff line numberDiff line change
@@ -17,56 +17,21 @@
1717
<div class="row">
1818
<% if @from_date && @until_date %>
1919
<div class="col-3 offset-1"><strong>Message:</strong> <%= commit.message %></div>
20-
<div class="col-2"><strong>A:</strong> <%= commit.additions %> </div>
21-
<div class="col-2"><strong>D:</strong> <%= commit.deletions %> </div>
22-
<div class="col-2"><strong>M:</strong> <%= commit.files_changed %> </div>
23-
<div class="col-2"><strong>C:</strong> <%= commit.created %> </div>
20+
<div class="col-2"><strong>Additions:</strong> <%= commit.additions %> </div>
21+
<div class="col-2"><strong>Deletions:</strong> <%= commit.deletions %> </div>
22+
<div class="col-2"><strong>Created:</strong> <%= commit.created %> </div>
2423
<% else %>
2524
<div class="col-3 offset-1"><strong>Message:</strong> <%= commit.message %></div>
26-
<div class="col-2"><strong>A:</strong> <%= commit.additions %> </div>
27-
<div class="col-2"><strong>D:</strong> <%= commit.deletions %> </div>
28-
<div class="col-2"><strong>M:</strong> <%= commit.files_changed %> </div>
29-
<div class="col-2"><strong>C:</strong> <%= commit.created %> </div>
25+
<div class="col-2"><strong>Additions:</strong> <%= commit.additions %> </div>
26+
<div class="col-2"><strong>Deletions:</strong> <%= commit.deletions %> </div>
27+
<div class="col-2"><strong>Created:</strong> <%= commit.created %> </div>
3028
<% end %>
3129
</div>
3230
</li>
3331
<%end%>
3432
</ul>
3533
</div>
3634
</div>
37-
<div class="row" style="padding: 1em 0px 0px 0px">
38-
<div class="col-12" align="right">
39-
<%= form_tag(repository_path, method: :get) do %>
40-
<div class="row">
41-
<div class="col-4 offset-2">
42-
<div class="input-group mb-3">
43-
<div class="input-group-prepend">
44-
<label class="input-group-text" for="start_date">Start date</label>
45-
</div>
46-
47-
<input class="form-control" as="date" type="date" id="from_date" name="from_date">
48-
</div>
49-
50-
</div>
51-
<div class="col-4">
52-
<div class="input-group mb-3">
53-
<div class="input-group-prepend">
54-
<label class="input-group-text" for="end_date">End date</label>
55-
</div>
56-
57-
<input class="form-control" as="date" type="date" id="until_date" name="until_date">
58-
</div>
59-
60-
</div>
61-
<div class="col-1">
62-
<input type="submit" name="commit" class="btn btn-info" value="Filter" data-disabled-with="Filter">
63-
</div>
64-
</div>
65-
</div>
66-
67-
<% end %>
68-
</div>
69-
</div>
7035
</div>
7136
</div>
7237
</div>

Diff for: app/views/repositories/show.html.erb

+6-8
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@
3333
</strong>
3434
</div>
3535
<% if @from_date && @until_date %>
36-
<div class="col-2"><strong>A:</strong> <%= @repository.commits.where(author_username: author.username).with_date(@from_date, @until_date).sum(&:additions) %> </div>
37-
<div class="col-2"><strong>D:</strong> <%= @repository.commits.where(author_username: author.username).with_date(@from_date, @until_date).sum(&:deletions) %> </div>
38-
<div class="col-2"><strong>M:</strong> <%= @repository.commits.where(author_username: author.username).with_date(@from_date, @until_date).sum(&:files_changed) %> </div>
39-
<div class="col-2"><strong>C:</strong> <%= @repository.commits.where(author_username: author.username).with_date(@from_date, @until_date).count %> </div>
36+
<div class="col-2"><strong>Additions:</strong> <%= @repository.commits.where(author_username: author.username).with_date(@from_date, @until_date).sum(&:additions) %> </div>
37+
<div class="col-2"><strong>Deletions:</strong> <%= @repository.commits.where(author_username: author.username).with_date(@from_date, @until_date).sum(&:deletions) %> </div>
38+
<div class="col-2"><strong>Commits:</strong> <%= @repository.commits.where(author_username: author.username).with_date(@from_date, @until_date).count %> </div>
4039
<% else %>
41-
<div class="col-2"><strong>A:</strong> <%= @repository.commits.where(author_username: author.username).sum(&:additions) %> </div>
42-
<div class="col-2"><strong>D:</strong> <%= @repository.commits.where(author_username: author.username).sum(&:deletions) %> </div>
43-
<div class="col-2"><strong>M:</strong> <%= @repository.commits.where(author_username: author.username).sum(&:files_changed) %> </div>
44-
<div class="col-2"><strong>C:</strong> <%= @repository.commits.where(author_username: author.username).count %> </div>
40+
<div class="col-2"><strong>Additions:</strong> <%= @repository.commits.where(author_username: author.username).sum(&:additions) %> </div>
41+
<div class="col-2"><strong>Deletions:</strong> <%= @repository.commits.where(author_username: author.username).sum(&:deletions) %> </div>
42+
<div class="col-2"><strong>Commits:</strong> <%= @repository.commits.where(author_username: author.username).count %> </div>
4543
<% end %>
4644
</div>
4745
</li>

Diff for: config/database.yml

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ default: &default
2222
# For details on connection pooling, see Rails configuration guide
2323
# http://guides.rubyonrails.org/configuring.html#database-pooling
2424
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
25-
password: postgres
26-
username: postgres
2725
development:
2826
<<: *default
2927
database: repo-io_development

0 commit comments

Comments
 (0)