ginatra 4.0.2 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/CHANGELOG.md +10 -0
- data/README.md +16 -9
- data/bin/ginatra +1 -1
- data/config.ru +13 -2
- data/ginatra.gemspec +7 -4
- data/lib/ginatra.rb +2 -0
- data/lib/ginatra/config.rb +15 -5
- data/lib/ginatra/helpers.rb +9 -9
- data/lib/ginatra/logger.rb +33 -0
- data/lib/ginatra/repo.rb +5 -2
- data/lib/ginatra/repo_list.rb +3 -1
- data/lib/ginatra/version.rb +2 -2
- data/public/css/application.css +1 -2
- data/public/css/custom.css +14 -14
- data/public/css/twbs.sass +8 -0
- data/public/img/asterisk.svg +6 -0
- data/public/img/download.svg +6 -0
- data/public/img/edit.svg +6 -0
- data/public/img/exclamation-circle.svg +6 -0
- data/public/img/file.svg +6 -0
- data/public/img/folder.svg +6 -0
- data/public/img/hdd-o.svg +6 -0
- data/public/img/loader.svg +33 -0
- data/public/img/mail-forward.svg +6 -0
- data/public/img/minus-square.svg +6 -0
- data/public/img/plus-square.svg +6 -0
- data/public/js/custom.js +1 -1
- data/spec/ginatra/helpers_spec.rb +4 -4
- data/spec/ginatra/logger_spec.rb +9 -0
- data/spec/spec_helper.rb +2 -0
- data/views/_footer.erb +2 -6
- data/views/_tree_nav.erb +45 -41
- data/views/blob.erb +6 -4
- data/views/commit.erb +20 -18
- data/views/empty_repo.erb +3 -5
- data/views/index.erb +16 -14
- data/views/layout.erb +4 -3
- data/views/log.erb +25 -23
- data/views/stats.erb +26 -24
- data/views/tree.erb +12 -19
- metadata +39 -15
- data/public/css/lib/bootstrap-responsive.min.css +0 -9
- data/public/css/lib/bootstrap.min.css +0 -9
- data/public/img/glyphicons-halflings-white.png +0 -0
- data/public/img/glyphicons-halflings.png +0 -0
- data/public/img/spin.gif +0 -0
data/public/img/file.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generated by IcoMoon.io -->
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128" viewBox="0 0 128 128">
|
|
5
|
+
<path d="M73.143 36.571v-33.714q1.571 1 2.571 2l29.143 29.143q1 1 2 2.571h-33.714zM64 38.857q0 2.857 2 4.857t4.857 2h38.857v75.429q0 2.857-2 4.857t-4.857 2h-96q-2.857 0-4.857-2t-2-4.857v-114.286q0-2.857 2-4.857t4.857-2h57.143v38.857z" fill="#444444"></path>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generated by IcoMoon.io -->
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="119" height="128" viewBox="0 0 119 128">
|
|
5
|
+
<path d="M118.857 43.429v50.286q0 6.571-4.714 11.286t-11.286 4.714h-86.857q-6.571 0-11.286-4.714t-4.714-11.286v-68.571q0-6.571 4.714-11.286t11.286-4.714h22.857q6.571 0 11.286 4.714t4.714 11.286v2.286h48q6.571 0 11.286 4.714t4.714 11.286z" fill="#444444"></path>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generated by IcoMoon.io -->
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128" viewBox="0 0 128 128">
|
|
5
|
+
<path d="M74.286 86.857q0 2.357-1.679 4.036t-4.036 1.679-4.036-1.679-1.679-4.036 1.679-4.036 4.036-1.679 4.036 1.679 1.679 4.036zM92.571 86.857q0 2.357-1.679 4.036t-4.036 1.679-4.036-1.679-1.679-4.036 1.679-4.036 4.036-1.679 4.036 1.679 1.679 4.036zM100.571 98.286v-22.857q0-0.929-0.679-1.607t-1.607-0.679h-86.857q-0.929 0-1.607 0.679t-0.679 1.607v22.857q0 0.929 0.679 1.607t1.607 0.679h86.857q0.929 0 1.607-0.679t0.679-1.607zM12.714 64h84.286l-11.214-34.429q-0.286-0.929-1.143-1.536t-1.857-0.607h-55.857q-1 0-1.857 0.607t-1.143 1.536zM109.714 75.429v22.857q0 4.714-3.357 8.071t-8.071 3.357h-86.857q-4.714 0-8.071-3.357t-3.357-8.071v-22.857q0-1.786 1.143-5.357l14.071-43.286q1.214-3.786 4.5-6.143t7.214-2.357h55.857q3.929 0 7.214 2.357t4.5 6.143l14.071 43.286q1.143 3.571 1.143 5.357z" fill="#444444"></path>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL -->
|
|
2
|
+
<svg width="120" height="30" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="#3498db">
|
|
3
|
+
<circle cx="15" cy="15" r="15">
|
|
4
|
+
<animate attributeName="r" from="15" to="15"
|
|
5
|
+
begin="0s" dur="0.8s"
|
|
6
|
+
values="15;9;15" calcMode="linear"
|
|
7
|
+
repeatCount="indefinite" />
|
|
8
|
+
<animate attributeName="fill-opacity" from="1" to="1"
|
|
9
|
+
begin="0s" dur="0.8s"
|
|
10
|
+
values="1;.5;1" calcMode="linear"
|
|
11
|
+
repeatCount="indefinite" />
|
|
12
|
+
</circle>
|
|
13
|
+
<circle cx="60" cy="15" r="9" fill-opacity="0.3">
|
|
14
|
+
<animate attributeName="r" from="9" to="9"
|
|
15
|
+
begin="0s" dur="0.8s"
|
|
16
|
+
values="9;15;9" calcMode="linear"
|
|
17
|
+
repeatCount="indefinite" />
|
|
18
|
+
<animate attributeName="fill-opacity" from="0.5" to="0.5"
|
|
19
|
+
begin="0s" dur="0.8s"
|
|
20
|
+
values=".5;1;.5" calcMode="linear"
|
|
21
|
+
repeatCount="indefinite" />
|
|
22
|
+
</circle>
|
|
23
|
+
<circle cx="105" cy="15" r="15">
|
|
24
|
+
<animate attributeName="r" from="15" to="15"
|
|
25
|
+
begin="0s" dur="0.8s"
|
|
26
|
+
values="15;9;15" calcMode="linear"
|
|
27
|
+
repeatCount="indefinite" />
|
|
28
|
+
<animate attributeName="fill-opacity" from="1" to="1"
|
|
29
|
+
begin="0s" dur="0.8s"
|
|
30
|
+
values="1;.5;1" calcMode="linear"
|
|
31
|
+
repeatCount="indefinite" />
|
|
32
|
+
</circle>
|
|
33
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generated by IcoMoon.io -->
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128" viewBox="0 0 128 128">
|
|
5
|
+
<path d="M128 45.714q0 1.857-1.357 3.214l-36.571 36.571q-1.357 1.357-3.214 1.357t-3.214-1.357-1.357-3.214v-18.286h-16q-7 0-12.536 0.429t-11 1.536-9.5 3.036-7.536 4.964-5.714 7.214-3.464 9.893-1.25 12.929q0 3.929 0.357 8.786 0 0.429 0.179 1.679t0.179 1.893q0 1.071-0.607 1.786t-1.679 0.714q-1.143 0-2-1.214-0.5-0.643-0.929-1.571t-0.964-2.143-0.75-1.714q-9.071-20.357-9.071-32.214 0-14.214 3.786-23.786 11.571-28.786 62.5-28.786h16v-18.286q0-1.857 1.357-3.214t3.214-1.357 3.214 1.357l36.571 36.571q1.357 1.357 1.357 3.214z" fill="#444444"></path>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generated by IcoMoon.io -->
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128" viewBox="0 0 128 128">
|
|
5
|
+
<path d="M91.429 68.571v-9.143q0-1.857-1.357-3.214t-3.214-1.357h-64q-1.857 0-3.214 1.357t-1.357 3.214v9.143q0 1.857 1.357 3.214t3.214 1.357h64q1.857 0 3.214-1.357t1.357-3.214zM109.714 29.714v68.571q0 8.5-6.036 14.536t-14.536 6.036h-68.571q-8.5 0-14.536-6.036t-6.036-14.536v-68.571q0-8.5 6.036-14.536t14.536-6.036h68.571q8.5 0 14.536 6.036t6.036 14.536z" fill="#444444"></path>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generated by IcoMoon.io -->
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128" viewBox="0 0 128 128">
|
|
5
|
+
<path d="M91.429 68.571v-9.143q0-1.857-1.357-3.214t-3.214-1.357h-22.857v-22.857q0-1.857-1.357-3.214t-3.214-1.357h-9.143q-1.857 0-3.214 1.357t-1.357 3.214v22.857h-22.857q-1.857 0-3.214 1.357t-1.357 3.214v9.143q0 1.857 1.357 3.214t3.214 1.357h22.857v22.857q0 1.857 1.357 3.214t3.214 1.357h9.143q1.857 0 3.214-1.357t1.357-3.214v-22.857h22.857q1.857 0 3.214-1.357t1.357-3.214zM109.714 29.714v68.571q0 8.5-6.036 14.536t-14.536 6.036h-68.571q-8.5 0-14.536-6.036t-6.036-14.536v-68.571q0-8.5 6.036-14.536t14.536-6.036h68.571q8.5 0 14.536 6.036t6.036 14.536z" fill="#444444"></path>
|
|
6
|
+
</svg>
|
data/public/js/custom.js
CHANGED
|
@@ -41,7 +41,7 @@ $(function() {
|
|
|
41
41
|
// filter repositories
|
|
42
42
|
$('.js-filter-query').on('keyup', function() {
|
|
43
43
|
var regexp = new RegExp($(this).val(), 'i'),
|
|
44
|
-
$repolist = $('.js-repolist
|
|
44
|
+
$repolist = $('.js-repolist a');
|
|
45
45
|
|
|
46
46
|
$repolist.hide();
|
|
47
47
|
$repolist.filter(function() {
|
|
@@ -33,19 +33,19 @@ describe Ginatra::Helpers do
|
|
|
33
33
|
describe "#file_icon" do
|
|
34
34
|
context "symbolic link" do
|
|
35
35
|
it "returns icon share-alt" do
|
|
36
|
-
expect(file_icon(40960)).to eq("<
|
|
36
|
+
expect(file_icon(40960)).to eq("<img src='/img/mail-forward.svg' alt='symbolic link' class='icon'>")
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
context "executable file" do
|
|
41
41
|
it "returns icon asterisk" do
|
|
42
|
-
expect(file_icon(33261)).to eq("<
|
|
42
|
+
expect(file_icon(33261)).to eq("<img src='/img/asterisk.svg' alt='executable file' class='icon'>")
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
context "non-executable file" do
|
|
47
47
|
it "returns icon file" do
|
|
48
|
-
expect(file_icon(33188)).to eq("<
|
|
48
|
+
expect(file_icon(33188)).to eq("<img src='/img/file.svg' alt='file' class='icon'>")
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
end
|
|
@@ -75,7 +75,7 @@ describe Ginatra::Helpers do
|
|
|
75
75
|
describe "#empty_description_hint_for" do
|
|
76
76
|
it "returns a hint for a repo with empty description" do
|
|
77
77
|
hint_text = "Edit `#{repo.path}description` file to set the repository description."
|
|
78
|
-
expect(empty_description_hint_for(repo)).to eq("<
|
|
78
|
+
expect(empty_description_hint_for(repo)).to eq("<img src='/img/exclamation-circle.svg' title='#{hint_text}' alt='hint' class='icon'>")
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
data/spec/spec_helper.rb
CHANGED
data/views/_footer.erb
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
<footer
|
|
2
|
-
<
|
|
3
|
-
<div class="container-fluid">
|
|
4
|
-
<p>Powered by <a href="https://github.com/narkoz/ginatra" target="_blank">Ginatra</a></p>
|
|
5
|
-
</div>
|
|
6
|
-
</nav>
|
|
1
|
+
<footer>
|
|
2
|
+
<p class="text-center">Powered by <a href="https://github.com/narkoz/ginatra" target="_blank">Ginatra</a></p>
|
|
7
3
|
</footer>
|
data/views/_tree_nav.erb
CHANGED
|
@@ -1,53 +1,57 @@
|
|
|
1
1
|
<% if @repo.branch_exists?(params[:tree]) %>
|
|
2
|
-
<div class="row
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
<div class="row">
|
|
3
|
+
<div class="col-md-12">
|
|
4
|
+
<ul class="nav nav-pills pull-left">
|
|
5
|
+
<li>
|
|
6
|
+
<a href="<%= prefix_url(@repo.param) %>/<%= params[:tree] %>">Commits</a>
|
|
7
|
+
</li>
|
|
8
|
+
<li class="active">
|
|
9
|
+
<a href="<%= prefix_url(@repo.param) %>/tree/<%= params[:tree] %>">Source</a>
|
|
10
|
+
</li>
|
|
11
|
+
<li>
|
|
12
|
+
<a href="<%= prefix_url(@repo.param) %>/stats/<%= params[:tree] %>">Stats</a>
|
|
13
|
+
</li>
|
|
14
|
+
</ul>
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
<div class="btn-group pull-right">
|
|
17
|
+
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
|
|
18
|
+
<%= params[:tree] %> <span class="caret"></span>
|
|
19
|
+
</button>
|
|
20
|
+
<ul class="dropdown-menu">
|
|
21
|
+
<li class="dropdown-hint">Branches</li>
|
|
22
|
+
<li class="divider"></li>
|
|
23
|
+
<% @repo.branches.each do |branch| %>
|
|
24
|
+
<% if @blob %>
|
|
25
|
+
<li><a href="<%= prefix_url(@repo.param) %>/blob/<%= branch.name %>/<%= params[:splat].first %>"><%= branch.name %></a></li>
|
|
26
|
+
<% else %>
|
|
27
|
+
<li><a href="<%= prefix_url(@repo.param) %>/tree/<%= branch.name %><%= "/#{params[:splat].first}" unless params[:splat].nil? || params[:splat].empty? %>"><%= branch.name %></a></li>
|
|
28
|
+
<% end %>
|
|
27
29
|
<% end %>
|
|
28
|
-
|
|
29
|
-
</
|
|
30
|
+
</ul>
|
|
31
|
+
</div>
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
32
34
|
<% end %>
|
|
33
35
|
|
|
34
36
|
<% unless params[:splat].nil? or params[:splat].empty? %>
|
|
35
37
|
<% tree_nav = params[:splat].first.split('/') %>
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
<span class="divider">/</span>
|
|
40
|
-
</li>
|
|
41
|
-
|
|
42
|
-
<% tree_nav.each_with_index do |path, index| %>
|
|
43
|
-
<% if index == tree_nav.size - 1 %>
|
|
44
|
-
<li class="active"><%= tree_nav.last %></li>
|
|
45
|
-
<% else %>
|
|
38
|
+
<div class="row">
|
|
39
|
+
<div class="col-md-12">
|
|
40
|
+
<ol class="breadcrumb" id="js-tree-nav">
|
|
46
41
|
<li>
|
|
47
|
-
<a href="<%= prefix_url(@repo.param) %>/tree/<%= params[:tree]
|
|
48
|
-
<span class="divider">/</span>
|
|
42
|
+
<a href="<%= prefix_url(@repo.param) %>/tree/<%= params[:tree] %>"><%= @repo.name %></a>
|
|
49
43
|
</li>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
|
|
45
|
+
<% tree_nav.each_with_index do |path, index| %>
|
|
46
|
+
<% if index == tree_nav.size - 1 %>
|
|
47
|
+
<li class="active"><%= tree_nav.last %></li>
|
|
48
|
+
<% else %>
|
|
49
|
+
<li>
|
|
50
|
+
<a href="<%= prefix_url(@repo.param) %>/tree/<%= params[:tree] %>/<%= tree_nav[0..index].join('/') %>"><%= path %></a>
|
|
51
|
+
</li>
|
|
52
|
+
<% end %>
|
|
53
|
+
<% end %>
|
|
54
|
+
</ol>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
53
57
|
<% end %>
|
data/views/blob.erb
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
<% raw_blob_url = "#{prefix_url(@repo.param)}/raw/#{params[:tree]}/#{params[:splat].first}" %>
|
|
7
7
|
|
|
8
|
-
<div class="row
|
|
9
|
-
<
|
|
10
|
-
|
|
8
|
+
<div class="row">
|
|
9
|
+
<div class="col-md-12">
|
|
10
|
+
<p class="pull-left"><%= file_icon @blob[:filemode] %> <%= @blob[:name] %></p>
|
|
11
|
+
<p class="pull-right"><a href="<%= raw_blob_url %>">Raw</a></p>
|
|
12
|
+
</div>
|
|
11
13
|
</div>
|
|
12
14
|
|
|
13
15
|
<% blob = @repo.find_blob @blob[:oid] %>
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
</a>
|
|
20
22
|
<% else %>
|
|
21
23
|
<p>Binary file</p>
|
|
22
|
-
<p><
|
|
24
|
+
<p><img src="/img/download.svg" alt="download" class="icon"> <a href="<%= raw_blob_url %>">Download</a></p>
|
|
23
25
|
<% end %>
|
|
24
26
|
<% else %>
|
|
25
27
|
<div class="source-wrapper highlight">
|
data/views/commit.erb
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<%= partial :header, locals: { repo: @repo } %>
|
|
3
3
|
|
|
4
4
|
<div class="info-box">
|
|
5
|
-
<div class="row
|
|
6
|
-
<div class="
|
|
5
|
+
<div class="row">
|
|
6
|
+
<div class="col-md-5">
|
|
7
7
|
<%= simple_format h(@commit.message) %>
|
|
8
8
|
|
|
9
9
|
<div class="author-box">
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
<% end %>
|
|
31
31
|
</p>
|
|
32
32
|
</div>
|
|
33
|
-
<div class="
|
|
34
|
-
<div class="row
|
|
35
|
-
<div class="
|
|
33
|
+
<div class="col-md-7">
|
|
34
|
+
<div class="row">
|
|
35
|
+
<div class="col-md-1">
|
|
36
36
|
<p><strong>commit:</strong></p>
|
|
37
37
|
<p><strong>tree:</strong></p>
|
|
38
38
|
<% @commit.parents.size.times do %>
|
|
39
39
|
<p><strong>parent:</strong></p>
|
|
40
40
|
<% end %>
|
|
41
41
|
</div>
|
|
42
|
-
<div class="
|
|
42
|
+
<div class="col-md-3">
|
|
43
43
|
<p>
|
|
44
44
|
<a href="<%= prefix_url(@repo.param) %>/commit/<%= @commit.oid %>">
|
|
45
45
|
<%= @commit.oid %>
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
</p>
|
|
61
61
|
<% end %>
|
|
62
62
|
|
|
63
|
-
<p><
|
|
63
|
+
<p><img src="/img/download.svg" alt="download" class="icon"> <%= patch_link @commit, @repo.param %></p>
|
|
64
64
|
</div>
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
@@ -72,23 +72,25 @@
|
|
|
72
72
|
|
|
73
73
|
<p>
|
|
74
74
|
<button class="btn btn-primary"><%= diff.deltas.size %> changed files</button>
|
|
75
|
-
<button class="btn" type="button" id="js-toggle-file-listing">Show file listing</button>
|
|
75
|
+
<button class="btn btn-default" type="button" id="js-toggle-file-listing">Show file listing</button>
|
|
76
76
|
</p>
|
|
77
77
|
|
|
78
|
-
<div class="
|
|
78
|
+
<div class="diff-files-list" id="js-file-listing">
|
|
79
79
|
<%= file_listing diff %>
|
|
80
80
|
</div>
|
|
81
81
|
|
|
82
82
|
<% diff.patches.each_with_index do |patch, index| %>
|
|
83
|
-
<div class="row
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
<div class="row">
|
|
84
|
+
<div class="col-md-12">
|
|
85
|
+
<p class="pull-left">
|
|
86
|
+
<img src="/img/file.svg" alt="file" class="icon"> <a id='file-<%= index + 1 %>'><%= patch.delta.new_file[:path] %></a>
|
|
87
|
+
</p>
|
|
88
|
+
<p class="pull-right">
|
|
89
|
+
<% unless patch.delta.deleted? %>
|
|
90
|
+
<a href="<%= prefix_url(@repo.param) %>/blob/<%= @commit.tree.oid %>/<%= patch.delta.new_file[:path] %>">view file</a>
|
|
91
|
+
<% end %>
|
|
92
|
+
</p>
|
|
93
|
+
</div>
|
|
92
94
|
</div>
|
|
93
95
|
|
|
94
96
|
<% patch.hunks.each do |hunk| %>
|
data/views/empty_repo.erb
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<% title @repo.name, headline: 'Empty repository' %>
|
|
2
2
|
<%= partial :header, locals: { repo: @repo } %>
|
|
3
3
|
|
|
4
|
-
<div class="row
|
|
5
|
-
<div class="
|
|
6
|
-
|
|
7
|
-
Repository is empty.
|
|
8
|
-
</div>
|
|
4
|
+
<div class="row">
|
|
5
|
+
<div class="col-md-12">
|
|
6
|
+
Repository is empty.
|
|
9
7
|
</div>
|
|
10
8
|
</div>
|
data/views/index.erb
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
<% title 'Repositories' %>
|
|
2
|
+
|
|
1
3
|
<div class="page-header">
|
|
2
|
-
<h1
|
|
4
|
+
<h1>Repositories <small><%= h Ginatra.config.description %></small></h1>
|
|
3
5
|
<% if Ginatra.config.git_clone_enabled? && @repositories.any? %>
|
|
4
|
-
<div class="muted clone-hint">
|
|
6
|
+
<div class="text-muted clone-hint">
|
|
5
7
|
To clone one of these repositories, install git, and run:
|
|
6
8
|
git clone <%= url %><strong>repo-name</strong>
|
|
7
9
|
</div>
|
|
@@ -9,20 +11,20 @@
|
|
|
9
11
|
</div>
|
|
10
12
|
|
|
11
13
|
<% if @repositories.size > 10 %>
|
|
12
|
-
<div class="row
|
|
13
|
-
<
|
|
14
|
+
<div class="row filter">
|
|
15
|
+
<div class="col-md-12">
|
|
16
|
+
<input type="text" class="form-control js-filter-query" placeholder="Filter...">
|
|
17
|
+
</div>
|
|
14
18
|
</div>
|
|
15
19
|
<% end %>
|
|
16
20
|
|
|
17
|
-
<
|
|
21
|
+
<div class="list-group repo-list js-repolist">
|
|
18
22
|
<% @repositories.each do |repo| %>
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</a>
|
|
26
|
-
</li>
|
|
23
|
+
<a href="<%= prefix_url(repo.param) %>" class="list-group-item">
|
|
24
|
+
<h2>
|
|
25
|
+
<%= empty_description_hint_for(repo) %>
|
|
26
|
+
<%= repo.name %> <small><%= h repo.description %></small>
|
|
27
|
+
</h2>
|
|
28
|
+
</a>
|
|
27
29
|
<% end %>
|
|
28
|
-
</
|
|
30
|
+
</div>
|
data/views/layout.erb
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
|
-
<title><%= title
|
|
5
|
+
<title><%= title %></title>
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
7
|
<link href="<%= prefix_url("assets/application.css") %>" rel="stylesheet">
|
|
7
8
|
<% if @repo %>
|
|
8
9
|
<link href="<%= atom_feed_url @repo.name, params[:ref] %>" title="Commits to <%= @repo.name %><%= ": #{params[:ref]}" if params[:ref] %>" type="application/atom+xml" rel="alternate">
|
|
9
10
|
<% end %>
|
|
10
11
|
</head>
|
|
11
12
|
<body>
|
|
12
|
-
<div class="container-fluid
|
|
13
|
+
<div class="container-fluid">
|
|
13
14
|
<div class="well header">
|
|
14
|
-
<h1><a href="<%= prefix_url %>"
|
|
15
|
+
<h1><a href="<%= prefix_url %>"><%= Ginatra.config.sitename %></a></h1>
|
|
15
16
|
</div>
|
|
16
17
|
|
|
17
18
|
<%= yield %>
|
data/views/log.erb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<% title @repo.name, headline: 'Commits' %>
|
|
2
2
|
<%= partial :header, locals: { repo: @repo } %>
|
|
3
3
|
|
|
4
|
-
<div class="row
|
|
5
|
-
<div class="
|
|
6
|
-
<div class="row
|
|
7
|
-
<div class="
|
|
4
|
+
<div class="row">
|
|
5
|
+
<div class="col-md-12">
|
|
6
|
+
<div class="row">
|
|
7
|
+
<div class="col-md-8">
|
|
8
8
|
<ul class="nav nav-pills">
|
|
9
9
|
<li class="active">
|
|
10
10
|
<a href="<%= prefix_url(@repo.param) %>/<%= params[:ref] %>">Commits</a>
|
|
@@ -52,32 +52,34 @@
|
|
|
52
52
|
</ul>
|
|
53
53
|
</div>
|
|
54
54
|
|
|
55
|
-
<div class="
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
<div class="col-md-4">
|
|
56
|
+
<div class="panel panel-default">
|
|
57
|
+
<div class="panel-heading">Branches (<%= @repo.branches.size %>)</div>
|
|
58
|
+
|
|
59
|
+
<ul class="list-group">
|
|
60
|
+
<% @repo.branches.each do |branch| %>
|
|
61
|
+
<a class="list-group-item <%= 'active' if branch.name == params[:ref] %>" href="<%= h prefix_url(@repo.param) %>/<%= h branch.name %>">
|
|
61
62
|
<%= h branch.name %>
|
|
62
63
|
</a>
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
<% end %>
|
|
65
|
+
</ul>
|
|
66
|
+
</div>
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
<div class="panel panel-default">
|
|
69
|
+
<div class="panel-heading">Tags (<%= @repo.tags.count %>)</div>
|
|
67
70
|
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<a href="<%= h prefix_url(@repo.param) %>/tag/<%= h tag %>">
|
|
71
|
+
<ul class="list-group">
|
|
72
|
+
<% if @repo.tags.any? %>
|
|
73
|
+
<% @repo.tags.each_name do |tag| %>
|
|
74
|
+
<a class="list-group-item" href="<%= h prefix_url(@repo.param) %>/tag/<%= h tag %>">
|
|
73
75
|
<%= h tag %>
|
|
74
76
|
</a>
|
|
75
|
-
|
|
77
|
+
<% end %>
|
|
78
|
+
<% else %>
|
|
79
|
+
<li class="list-group-item">No tags</li>
|
|
76
80
|
<% end %>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<% end %>
|
|
80
|
-
</ul>
|
|
81
|
+
</ul>
|
|
82
|
+
</div>
|
|
81
83
|
</div>
|
|
82
84
|
</div>
|
|
83
85
|
</div>
|