svn_record 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +72 -0
- data/Rakefile +7 -0
- data/app/assets/images/svn_record/file_icon/bullet_add.png +0 -0
- data/app/assets/images/svn_record/file_icon/bullet_black.png +0 -0
- data/app/assets/images/svn_record/file_icon/bullet_blue.png +0 -0
- data/app/assets/images/svn_record/file_icon/bullet_delete.png +0 -0
- data/app/assets/images/svn_record/file_icon/bullet_diamond.png +0 -0
- data/app/assets/images/svn_record/file_icon/bullet_end.png +0 -0
- data/app/assets/images/svn_record/file_icon/bullet_go.png +0 -0
- data/app/assets/images/svn_record/file_icon/bullet_orange.png +0 -0
- data/app/assets/images/svn_record/file_icon/bullet_purple.png +0 -0
- data/app/assets/images/svn_record/file_icon/bullet_toggle_minus.png +0 -0
- data/app/assets/images/svn_record/file_icon/bullet_toggle_plus.png +0 -0
- data/app/assets/images/svn_record/file_icon/dir.png +0 -0
- data/app/assets/images/svn_record/file_icon/file.png +0 -0
- data/app/assets/images/svn_record/file_icon/folder.png +0 -0
- data/app/assets/images/svn_record/file_icon/folder_open.png +0 -0
- data/app/assets/images/svn_record/file_icon/folder_open_add.png +0 -0
- data/app/assets/images/svn_record/file_icon/folder_open_orange.png +0 -0
- data/app/assets/javascripts/svn_record/application.js +16 -0
- data/app/assets/javascripts/svn_record/change.js.coffee +4 -0
- data/app/assets/stylesheets/svn_record/application.css +14 -0
- data/app/assets/stylesheets/svn_record/site.css +396 -0
- data/app/controllers/svn_record/application_controller.rb +3 -0
- data/app/controllers/svn_record/repository/application_controller.rb +3 -0
- data/app/controllers/svn_record/repository/changes_controller.rb +38 -0
- data/app/models/svn_record/repository/change.rb +39 -0
- data/app/models/svn_record/repository/file.rb +20 -0
- data/app/models/svn_record/repository/user.rb +14 -0
- data/app/views/layouts/svn_record/subversion.html.slim +22 -0
- data/app/views/svn_record/repository/changes/_changesets_list.slim +29 -0
- data/app/views/svn_record/repository/changes/diff.html.slim +30 -0
- data/app/views/svn_record/repository/changes/entry.html.slim +18 -0
- data/app/views/svn_record/repository/changes/index.html.slim +34 -0
- data/app/views/svn_record/repository/changes/list.html.slim +2 -0
- data/app/views/svn_record/repository/changes/revisions.html.slim +18 -0
- data/config/configuration.yml +5 -0
- data/config/routes.rb +17 -0
- data/lib/Svn/helper.rb +108 -0
- data/lib/Svn/mime_type.rb +492 -0
- data/lib/Svn/scm/adapters/subversion.rb +303 -0
- data/lib/generators/svn_record/install_generator.rb +16 -0
- data/lib/generators/svn_record/templates/create_repository_changes.rb +17 -0
- data/lib/generators/svn_record/templates/create_repository_files.rb +21 -0
- data/lib/generators/svn_record/templates/create_repository_user.rb +8 -0
- data/lib/svn_record/engine.rb +11 -0
- data/lib/svn_record/version.rb +3 -0
- data/lib/svn_record.rb +4 -0
- metadata +161 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3a5caf8caca640dc82c23d1b1c6e19fb9cbd6be0
|
4
|
+
data.tar.gz: 67c77c4704ba61572783f7a69f961ba7a64b67c8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e2252b540fb80e712a99bad30caae0d89b3d90ab773524d4a6b082988f4ab20c6c8f60c861ef575ecd31ef774faf23f9c6cbfbc4f3763b01120cbbcf4953fa97
|
7
|
+
data.tar.gz: e56658a1df1152534cdb8c2c6c296ad767a280a46164a5b6c6d785a0f65c30db9788410a6ca32d5f45990ad5c7ff7fbe0766e15fc5ce7008719d93afa9233754
|
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
|
2
|
+
### 安装
|
3
|
+
|
4
|
+
1.添加Gemfile 文件代码如下
|
5
|
+
|
6
|
+
gem 'svn_record'
|
7
|
+
|
8
|
+
2.执行命令
|
9
|
+
|
10
|
+
rails g svn_record:install
|
11
|
+
|
12
|
+
3.添加脚本文件 application.js
|
13
|
+
|
14
|
+
//= require svn_record/change
|
15
|
+
|
16
|
+
4.添加样式文件 application.cs
|
17
|
+
|
18
|
+
*= require svn_record/site
|
19
|
+
|
20
|
+
5.连接svn配置文件
|
21
|
+
|
22
|
+
config/configuration.yml
|
23
|
+
|
24
|
+
|
25
|
+
### 访问页面
|
26
|
+
运行后访问地址
|
27
|
+
|
28
|
+
http://localhost:3000/repository/changes
|
29
|
+
|
30
|
+
### 国际化参考格式
|
31
|
+
|
32
|
+
datetime:
|
33
|
+
distance_in_words:
|
34
|
+
half_a_minute: "半分钟"
|
35
|
+
less_than_x_seconds:
|
36
|
+
one: "一秒内"
|
37
|
+
other: "少于 %{count} 秒"
|
38
|
+
x_seconds:
|
39
|
+
one: "一秒"
|
40
|
+
other: "%{count} 秒"
|
41
|
+
less_than_x_minutes:
|
42
|
+
one: "一分钟内"
|
43
|
+
other: "少于 %{count} 分钟"
|
44
|
+
x_minutes:
|
45
|
+
one: "一分钟"
|
46
|
+
other: "%{count} 分钟"
|
47
|
+
about_x_hours:
|
48
|
+
one: "大约一小时"
|
49
|
+
other: "大约 %{count} 小时"
|
50
|
+
x_hours:
|
51
|
+
one: "1 小时"
|
52
|
+
other: "%{count} 小时"
|
53
|
+
x_days:
|
54
|
+
one: "一天"
|
55
|
+
other: "%{count} 天"
|
56
|
+
about_x_months:
|
57
|
+
one: "大约一个月"
|
58
|
+
other: "大约 %{count} 个月"
|
59
|
+
x_months:
|
60
|
+
one: "一个月"
|
61
|
+
other: "%{count} 个月"
|
62
|
+
about_x_years:
|
63
|
+
one: "大约一年"
|
64
|
+
other: "大约 %{count} 年"
|
65
|
+
over_x_years:
|
66
|
+
one: "超过一年"
|
67
|
+
other: "超过 %{count} 年"
|
68
|
+
almost_x_years:
|
69
|
+
one: "将近 1 年"
|
70
|
+
other: "将近 %{count} 年"
|
71
|
+
|
72
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
SvnRecord::Application.load_tasks
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require_tree .
|
16
|
+
//= require change
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require_tree .
|
13
|
+
*= require site
|
14
|
+
*/
|
@@ -0,0 +1,396 @@
|
|
1
|
+
html {overflow-y:scroll;}
|
2
|
+
body { font-family: Verdana, sans-serif; font-size: 12px; color:#484848; margin: 0; padding: 0; min-width: 900px; }
|
3
|
+
a{text-decoration:none;}
|
4
|
+
h1, h2, h3, h4 {font-family: "Trebuchet MS", Verdana, sans-serif;padding: 2px 10px 1px 0px;margin: 0 0 10px 0;}
|
5
|
+
#content h1, h2, h3, h4 {color: #555;}
|
6
|
+
h2, .wiki h1 {font-size: 20px;}
|
7
|
+
h3, .wiki h2 {font-size: 16px;}
|
8
|
+
h4, .wiki h3 {font-size: 13px;}
|
9
|
+
h4 {border-bottom: 1px dotted #bbb;}
|
10
|
+
|
11
|
+
/***** Layout *****/
|
12
|
+
#wrapper {background: white;}
|
13
|
+
#top-menu {background: #3E5B76; color: #fff; height:1.8em; font-size: 0.8em; padding: 2px 2px 0px 6px;}
|
14
|
+
#top-menu ul {margin: 0; padding: 0;}
|
15
|
+
#top-menu li {
|
16
|
+
float:left;
|
17
|
+
list-style-type:none;
|
18
|
+
margin: 0px 0px 0px 0px;
|
19
|
+
padding: 0px 0px 0px 0px;
|
20
|
+
white-space:nowrap;
|
21
|
+
}
|
22
|
+
#top-menu a {color: #fff; margin-right: 8px; font-weight: bold;}
|
23
|
+
#top-menu #loggedas { float: right; margin-right: 0.5em; color: #fff; }
|
24
|
+
|
25
|
+
#account {float:right;}
|
26
|
+
|
27
|
+
#header {min-height:5.3em;margin:0;background-color:#628DB6;color:#f8f8f8; padding: 4px 8px 20px 6px; position:relative;}
|
28
|
+
#header a {color:#f8f8f8;}
|
29
|
+
#header h1 a.ancestor { font-size: 80%; }
|
30
|
+
#quick-search {float:right;}
|
31
|
+
|
32
|
+
#main-menu {position: absolute; bottom: 0px; left:6px; margin-right: -500px;}
|
33
|
+
#main-menu ul {margin: 0; padding: 0;}
|
34
|
+
#main-menu li {
|
35
|
+
float:left;
|
36
|
+
list-style-type:none;
|
37
|
+
margin: 0px 2px 0px 0px;
|
38
|
+
padding: 0px 0px 0px 0px;
|
39
|
+
white-space:nowrap;
|
40
|
+
}
|
41
|
+
#main-menu li a {
|
42
|
+
display: block;
|
43
|
+
color: #fff;
|
44
|
+
text-decoration: none;
|
45
|
+
font-weight: bold;
|
46
|
+
margin: 0;
|
47
|
+
padding: 4px 10px 4px 10px;
|
48
|
+
}
|
49
|
+
#main-menu li a:hover {background:#759FCF; color:#fff;}
|
50
|
+
#main-menu li a.selected, #main-menu li a.selected:hover {background:#fff; color:#555;}
|
51
|
+
|
52
|
+
#admin-menu ul {margin: 0; padding: 0;}
|
53
|
+
#admin-menu li {margin: 0; padding: 0 0 6px 0; list-style-type:none;}
|
54
|
+
|
55
|
+
#main {background-color:#EEEEEE;}
|
56
|
+
.contextual {white-space: nowrap; line-height:1.4em;margin-top:5px; padding-left: 10px; font-size:0.9em;}
|
57
|
+
.contextual input, .contextual select {font-size:0.9em;}
|
58
|
+
.message .contextual { margin-top: 0; }
|
59
|
+
|
60
|
+
#sidebar{ float: right; width: 22%; position: relative; z-index: 9; padding: 0; margin: 0;}
|
61
|
+
* html #sidebar{ width: 22%; }
|
62
|
+
#sidebar h3{ font-size: 14px; margin-top:14px; color: #666; }
|
63
|
+
#sidebar hr{ width: 100%; margin: 0 auto; height: 1px; background: #ccc; border: 0; }
|
64
|
+
* html #sidebar hr{ width: 95%; position: relative; left: -6px; color: #ccc; }
|
65
|
+
#sidebar .contextual { margin-right: 1em; }
|
66
|
+
#sidebar ul {margin: 0; padding: 0;}
|
67
|
+
#sidebar ul li {list-style-type:none;margin: 0px 2px 0px 0px; padding: 0px 0px 0px 0px;}
|
68
|
+
|
69
|
+
#content { width: 75%; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; }
|
70
|
+
* html #content{ width: 75%; padding-left: 0; margin-top: 0px; padding: 6px 10px 10px 10px;}
|
71
|
+
html>body #content { }
|
72
|
+
* html body #content { height: 600px; } /* IE */
|
73
|
+
|
74
|
+
#main.nosidebar #sidebar{ display: none; }
|
75
|
+
#main.nosidebar #content{ width: auto; border-right: 0; }
|
76
|
+
|
77
|
+
#footer {clear: both; border-top: 1px solid #bbb; font-size: 0.9em; color: #aaa; padding: 5px; text-align:center; background:#fff;}
|
78
|
+
|
79
|
+
|
80
|
+
/***** Tables *****/
|
81
|
+
table.list { border: 1px solid #e4e4e4; border-collapse: collapse; width: 100%; margin-bottom: 4px; }
|
82
|
+
table.list th { background-color:#EEEEEE; padding: 4px; white-space:nowrap; }
|
83
|
+
table.list td { vertical-align: top; padding-right:10px; text-align: center; }
|
84
|
+
table.list td.id { width: 2%; text-align: center;}
|
85
|
+
table.list td.checkbox { width: 15px; padding: 2px 0 0 0; }
|
86
|
+
table.list td.checkbox input {padding:0px;}
|
87
|
+
table.list td.buttons { width: 15%; white-space:nowrap; text-align: right; }
|
88
|
+
table.list td.buttons a { padding-right: 0.6em; }
|
89
|
+
table.list caption { text-align: left; padding: 0.5em 0.5em 0.5em 0; }
|
90
|
+
|
91
|
+
tr.version.closed, tr.version.closed a { color: #999; }
|
92
|
+
tr.version td.name { padding-left: 20px; }
|
93
|
+
tr.version.shared td.name { background: url(file_icon/link.png) no-repeat 0% 70%; }
|
94
|
+
tr.version td.date, tr.version td.status, tr.version td.sharing { text-align: center; white-space:nowrap; }
|
95
|
+
|
96
|
+
tr.user td { width:13%; }
|
97
|
+
tr.user td.email { width:18%; }
|
98
|
+
tr.user td { white-space: nowrap; }
|
99
|
+
tr.user.locked, tr.user.registered { color: #aaa; }
|
100
|
+
tr.user.locked a, tr.user.registered a { color: #aaa; }
|
101
|
+
|
102
|
+
table.permissions td.role {color:#999;font-size:90%;font-weight:normal !important;text-align:center;vertical-align:bottom;}
|
103
|
+
|
104
|
+
tr.wiki-page-version td.updated_on, tr.wiki-page-version td.author {text-align:center;}
|
105
|
+
|
106
|
+
tr.time-entry { text-align: center; white-space: nowrap; }
|
107
|
+
tr.time-entry td.issue, tr.time-entry td.comments { text-align: left; white-space: normal; }
|
108
|
+
td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; }
|
109
|
+
td.hours .hours-dec { font-size: 0.9em; }
|
110
|
+
|
111
|
+
|
112
|
+
table.list tbody tr.group td { padding: 0.8em 0 0.5em 0.3em; font-weight: bold; border-bottom: 1px solid #ccc; }
|
113
|
+
table.list tbody tr.group span.count {position:relative; top:-1px; color:#fff; font-size:10px; background:#9DB9D5; padding:0px 6px 1px 6px; border-radius:3px; margin-left:4px;}
|
114
|
+
tr.group a.toggle-all { color: #aaa; font-size: 80%; font-weight: normal; display:none;}
|
115
|
+
tr.group:hover a.toggle-all { display:inline;}
|
116
|
+
a.toggle-all:hover {text-decoration:none;}
|
117
|
+
|
118
|
+
table.list tbody tr:hover { background-color:#ffffdd; }
|
119
|
+
table.list tbody tr.group:hover { background-color:inherit; }
|
120
|
+
table td {padding:2px;}
|
121
|
+
table p {margin:0;}
|
122
|
+
.odd {background-color:#f6f7f8;}
|
123
|
+
.even {background-color: #fff;}
|
124
|
+
|
125
|
+
a.sort { padding-right: 16px; background-position: 100% 50%; background-repeat: no-repeat; }
|
126
|
+
a.sort.asc { background-image: url(file_icon/sort_asc.png); }
|
127
|
+
a.sort.desc { background-image: url(file_icon/sort_desc.png); }
|
128
|
+
|
129
|
+
table.attributes { width: 100% }
|
130
|
+
table.attributes th { vertical-align: top; text-align: left; }
|
131
|
+
table.attributes td { vertical-align: top; }
|
132
|
+
|
133
|
+
table.boards a.board, h3.comments { background: url(file_icon/comment.png) no-repeat 0% 50%; padding-left: 20px; }
|
134
|
+
table.boards td.topic-count, table.boards td.message-count {text-align:center;}
|
135
|
+
table.boards td.last-message {font-size:80%;}
|
136
|
+
|
137
|
+
table.messages td.author, table.messages td.created_on, table.messages td.reply-count {text-align:center;}
|
138
|
+
|
139
|
+
table.query-columns {
|
140
|
+
border-collapse: collapse;
|
141
|
+
border: 0;
|
142
|
+
}
|
143
|
+
|
144
|
+
td.radio_span{
|
145
|
+
float: none;
|
146
|
+
width: 50px;
|
147
|
+
}
|
148
|
+
span.float_left{
|
149
|
+
float: left;
|
150
|
+
}
|
151
|
+
span.float_right{
|
152
|
+
float: right;
|
153
|
+
}
|
154
|
+
|
155
|
+
|
156
|
+
table.filecontent { border: 1px solid #e2e2e2; border-collapse: collapse; width:98%; background-color: #fafafa; }
|
157
|
+
table.filecontent tbody {font-family:"Liberation Mono", Courier, monospace; font-size:12px;}
|
158
|
+
table.filecontent th { border: 1px solid #e2e2e2; background-color: #eee; }
|
159
|
+
table.filecontent th.filename { background-color: #e4e4d4; text-align: left; padding:5px;}
|
160
|
+
table.filecontent tr.spacing th { text-align:center; }
|
161
|
+
table.filecontent tr.spacing td { height: 0.4em; background: #EAF2F5;}
|
162
|
+
table.filecontent th.line-num {
|
163
|
+
border: 1px solid #e2e2e2;
|
164
|
+
text-align: right;
|
165
|
+
width: 2%;
|
166
|
+
padding: 0 3px 0 0;
|
167
|
+
color: #999;
|
168
|
+
user-select: none;
|
169
|
+
-moz-user-select: none;
|
170
|
+
-o-user-select: none;
|
171
|
+
-ms-user-select: none;
|
172
|
+
-webkit-user-select: none;
|
173
|
+
font-weight:normal;
|
174
|
+
}
|
175
|
+
table.filecontent th.line-num a {
|
176
|
+
text-decoration: none;
|
177
|
+
color: inherit;
|
178
|
+
}
|
179
|
+
table.filecontent td.line-code {padding: 0 0 0 4px;}
|
180
|
+
table.filecontent td.line-code pre {
|
181
|
+
margin: 0px;
|
182
|
+
white-space: pre-wrap;
|
183
|
+
font-family:"Liberation Mono", Courier, monospace; font-size:12px;
|
184
|
+
}
|
185
|
+
|
186
|
+
|
187
|
+
/***** Diff *****/
|
188
|
+
.diff_out { background: #fcc; }
|
189
|
+
.diff_out span { background: #faa; }
|
190
|
+
.diff_in { background: #cfc; }
|
191
|
+
.diff_in span { background: #afa; }
|
192
|
+
|
193
|
+
.text-diff {
|
194
|
+
padding: 1em;
|
195
|
+
background-color:#f6f6f6;
|
196
|
+
color:#505050;
|
197
|
+
border: 1px solid #e4e4e4;
|
198
|
+
}
|
199
|
+
|
200
|
+
|
201
|
+
table.revision-info td {
|
202
|
+
margin: 0px;
|
203
|
+
padding: 0px;
|
204
|
+
}
|
205
|
+
|
206
|
+
div.revision-graph { position: absolute; min-width: 1px; }
|
207
|
+
|
208
|
+
div.changeset-changes ul { margin: 0; padding: 0; }
|
209
|
+
div.changeset-changes ul > ul { margin-left: 18px; padding: 0; }
|
210
|
+
|
211
|
+
li.change {
|
212
|
+
list-style-type:none;
|
213
|
+
background-image: url(file_icon/bullet_black.png);
|
214
|
+
background-position: 1px 1px;
|
215
|
+
background-repeat: no-repeat;
|
216
|
+
padding-top: 1px;
|
217
|
+
padding-bottom: 1px;
|
218
|
+
padding-left: 20px;
|
219
|
+
margin: 0;
|
220
|
+
}
|
221
|
+
li.change.folder { background-image: url(file_icon/folder_open.png); }
|
222
|
+
li.change.folder.change-A { background-image: url(file_icon/folder_open_add.png); }
|
223
|
+
li.change.folder.change-M { background-image: url(file_icon/folder_open_orange.png); }
|
224
|
+
li.change.change-A { background-image: url(file_icon/bullet_add.png); }
|
225
|
+
li.change.change-M { background-image: url(file_icon/bullet_orange.png); }
|
226
|
+
li.change.change-C { background-image: url(file_icon/bullet_blue.png); }
|
227
|
+
li.change.change-R { background-image: url(file_icon/bullet_purple.png); }
|
228
|
+
li.change.change-D { background-image: url(file_icon/bullet_delete.png); }
|
229
|
+
|
230
|
+
li.change .copied-from { font-style: italic; color: #999; font-size: 0.9em; }
|
231
|
+
li.change .copied-from:before { content: " - "}
|
232
|
+
|
233
|
+
#changes-legend { float: right; font-size: 0.8em; margin: 0; }
|
234
|
+
#changes-legend li { float: left; background-position: 5px 0; }
|
235
|
+
|
236
|
+
table.filecontent { border: 1px solid #e2e2e2; border-collapse: collapse; width:98%; background-color: #fafafa; }
|
237
|
+
table.filecontent tbody {font-family:"Liberation Mono", Courier, monospace; font-size:12px;}
|
238
|
+
table.filecontent th { border: 1px solid #e2e2e2; background-color: #eee; }
|
239
|
+
table.filecontent th.filename { background-color: #e4e4d4; text-align: left; padding:5px;}
|
240
|
+
table.filecontent tr.spacing th { text-align:center; }
|
241
|
+
table.filecontent tr.spacing td { height: 0.4em; background: #EAF2F5;}
|
242
|
+
table.list td.filename{ padding-left: 100px !important ; text-align: left; width: 200px}
|
243
|
+
table.list td.comments{ text-align: left}
|
244
|
+
table.filecontent th.line-num {
|
245
|
+
border: 1px solid #e2e2e2;
|
246
|
+
text-align: right;
|
247
|
+
width: 2%;
|
248
|
+
padding: 0 3px 0 0;
|
249
|
+
color: #999;
|
250
|
+
user-select: none;
|
251
|
+
-moz-user-select: none;
|
252
|
+
-o-user-select: none;
|
253
|
+
-ms-user-select: none;
|
254
|
+
-webkit-user-select: none;
|
255
|
+
font-weight:normal;
|
256
|
+
}
|
257
|
+
table.filecontent th.line-num a {
|
258
|
+
text-decoration: none;
|
259
|
+
color: inherit;
|
260
|
+
}
|
261
|
+
table.filecontent td.line-code {padding: 0 0 0 4px;}
|
262
|
+
table.filecontent td.line-code pre {
|
263
|
+
margin: 0px;
|
264
|
+
white-space: pre-wrap;
|
265
|
+
font-family:"Liberation Mono", Courier, monospace; font-size:12px;
|
266
|
+
}
|
267
|
+
|
268
|
+
/* 12 different colors for the annonate view */
|
269
|
+
table.annotate tr.bloc-0 {background: #FFFFBF;}
|
270
|
+
table.annotate tr.bloc-1 {background: #EABFFF;}
|
271
|
+
table.annotate tr.bloc-2 {background: #BFFFFF;}
|
272
|
+
table.annotate tr.bloc-3 {background: #FFD9BF;}
|
273
|
+
table.annotate tr.bloc-4 {background: #E6FFBF;}
|
274
|
+
table.annotate tr.bloc-5 {background: #BFCFFF;}
|
275
|
+
table.annotate tr.bloc-6 {background: #FFBFEF;}
|
276
|
+
table.annotate tr.bloc-7 {background: #FFE6BF;}
|
277
|
+
table.annotate tr.bloc-8 {background: #FFE680;}
|
278
|
+
table.annotate tr.bloc-9 {background: #AA80FF;}
|
279
|
+
table.annotate tr.bloc-10 {background: #FFBFDC;}
|
280
|
+
table.annotate tr.bloc-11 {background: #BFE4FF;}
|
281
|
+
|
282
|
+
table.annotate td.revision {
|
283
|
+
padding:0;
|
284
|
+
text-align: center;
|
285
|
+
width: 2%;
|
286
|
+
padding-left: 1em;
|
287
|
+
background: inherit;
|
288
|
+
}
|
289
|
+
|
290
|
+
table.annotate td.author {
|
291
|
+
padding:0;
|
292
|
+
text-align: center;
|
293
|
+
border-right: 1px solid #d7d7d7;
|
294
|
+
white-space: nowrap;
|
295
|
+
padding-left: 1em;
|
296
|
+
padding-right: 1em;
|
297
|
+
width: 3%;
|
298
|
+
background: inherit;
|
299
|
+
}
|
300
|
+
|
301
|
+
table.annotate td.line-code { background-color: #fafafa; }
|
302
|
+
|
303
|
+
div.action_M { background: #fd8 }
|
304
|
+
div.action_D { background: #f88 }
|
305
|
+
div.action_A { background: #bfb }
|
306
|
+
/************* CodeRay styles *************/
|
307
|
+
.syntaxhl div {display: inline;}
|
308
|
+
.syntaxhl .line-numbers {padding: 2px 4px 2px 4px; background-color: #eee; margin:0px 5px 0px 0px;}
|
309
|
+
.syntaxhl .code pre { overflow: auto }
|
310
|
+
.syntaxhl .debug { color: white !important; background: blue !important; }
|
311
|
+
|
312
|
+
.syntaxhl .annotation { color:#007 }
|
313
|
+
.syntaxhl .attribute-name { color:#b48 }
|
314
|
+
.syntaxhl .attribute-value { color:#700 }
|
315
|
+
.syntaxhl .binary { color:#509 }
|
316
|
+
.syntaxhl .char .content { color:#D20 }
|
317
|
+
.syntaxhl .char .delimiter { color:#710 }
|
318
|
+
.syntaxhl .char { color:#D20 }
|
319
|
+
.syntaxhl .class { color:#258; font-weight:bold }
|
320
|
+
.syntaxhl .class-variable { color:#369 }
|
321
|
+
.syntaxhl .color { color:#0A0 }
|
322
|
+
.syntaxhl .comment { color:#385 }
|
323
|
+
.syntaxhl .comment .char { color:#385 }
|
324
|
+
.syntaxhl .comment .delimiter { color:#385 }
|
325
|
+
.syntaxhl .complex { color:#A08 }
|
326
|
+
.syntaxhl .constant { color:#258; font-weight:bold }
|
327
|
+
.syntaxhl .decorator { color:#B0B }
|
328
|
+
.syntaxhl .definition { color:#099; font-weight:bold }
|
329
|
+
.syntaxhl .delimiter { color:black }
|
330
|
+
.syntaxhl .directive { color:#088; font-weight:bold }
|
331
|
+
.syntaxhl .doc { color:#970 }
|
332
|
+
.syntaxhl .doc-string { color:#D42; font-weight:bold }
|
333
|
+
.syntaxhl .doctype { color:#34b }
|
334
|
+
.syntaxhl .entity { color:#800; font-weight:bold }
|
335
|
+
.syntaxhl .error { color:#F00; background-color:#FAA }
|
336
|
+
.syntaxhl .escape { color:#666 }
|
337
|
+
.syntaxhl .exception { color:#C00; font-weight:bold }
|
338
|
+
.syntaxhl .float { color:#06D }
|
339
|
+
.syntaxhl .function { color:#06B; font-weight:bold }
|
340
|
+
.syntaxhl .global-variable { color:#d70 }
|
341
|
+
.syntaxhl .hex { color:#02b }
|
342
|
+
.syntaxhl .imaginary { color:#f00 }
|
343
|
+
.syntaxhl .include { color:#B44; font-weight:bold }
|
344
|
+
.syntaxhl .inline { background-color: hsla(0,0%,0%,0.07); color: black }
|
345
|
+
.syntaxhl .inline-delimiter { font-weight: bold; color: #666 }
|
346
|
+
.syntaxhl .instance-variable { color:#33B }
|
347
|
+
.syntaxhl .integer { color:#06D }
|
348
|
+
.syntaxhl .key .char { color: #60f }
|
349
|
+
.syntaxhl .key .delimiter { color: #404 }
|
350
|
+
.syntaxhl .key { color: #606 }
|
351
|
+
.syntaxhl .keyword { color:#939; font-weight:bold }
|
352
|
+
.syntaxhl .label { color:#970; font-weight:bold }
|
353
|
+
.syntaxhl .local-variable { color:#963 }
|
354
|
+
.syntaxhl .namespace { color:#707; font-weight:bold }
|
355
|
+
.syntaxhl .octal { color:#40E }
|
356
|
+
.syntaxhl .operator { }
|
357
|
+
.syntaxhl .predefined { color:#369; font-weight:bold }
|
358
|
+
.syntaxhl .predefined-constant { color:#069 }
|
359
|
+
.syntaxhl .predefined-type { color:#0a5; font-weight:bold }
|
360
|
+
.syntaxhl .preprocessor { color:#579 }
|
361
|
+
.syntaxhl .pseudo-class { color:#00C; font-weight:bold }
|
362
|
+
.syntaxhl .regexp .content { color:#808 }
|
363
|
+
.syntaxhl .regexp .delimiter { color:#404 }
|
364
|
+
.syntaxhl .regexp .modifier { color:#C2C }
|
365
|
+
.syntaxhl .regexp { background-color:hsla(300,100%,50%,0.06); }
|
366
|
+
.syntaxhl .reserved { color:#080; font-weight:bold }
|
367
|
+
.syntaxhl .shell .content { color:#2B2 }
|
368
|
+
.syntaxhl .shell .delimiter { color:#161 }
|
369
|
+
.syntaxhl .shell { background-color:hsla(120,100%,50%,0.06); }
|
370
|
+
.syntaxhl .string .char { color: #46a }
|
371
|
+
.syntaxhl .string .content { color: #46a }
|
372
|
+
.syntaxhl .string .delimiter { color: #46a }
|
373
|
+
.syntaxhl .string .modifier { color: #46a }
|
374
|
+
.syntaxhl .symbol .content { color:#d33 }
|
375
|
+
.syntaxhl .symbol .delimiter { color:#d33 }
|
376
|
+
.syntaxhl .symbol { color:#d33 }
|
377
|
+
.syntaxhl .tag { color:#070 }
|
378
|
+
.syntaxhl .type { color:#339; font-weight:bold }
|
379
|
+
.syntaxhl .value { color: #088; }
|
380
|
+
.syntaxhl .variable { color:#037 }
|
381
|
+
|
382
|
+
.syntaxhl .insert { background: hsla(120,100%,50%,0.12) }
|
383
|
+
.syntaxhl .delete { background: hsla(0,100%,50%,0.12) }
|
384
|
+
.syntaxhl .change { color: #bbf; background: #007; }
|
385
|
+
.syntaxhl .head { color: #f8f; background: #505 }
|
386
|
+
.syntaxhl .head .filename { color: white; }
|
387
|
+
|
388
|
+
.syntaxhl .delete .eyecatcher { background-color: hsla(0,100%,50%,0.2); border: 1px solid hsla(0,100%,45%,0.5); margin: -1px; border-bottom: none; border-top-left-radius: 5px; border-top-right-radius: 5px; }
|
389
|
+
.syntaxhl .insert .eyecatcher { background-color: hsla(120,100%,50%,0.2); border: 1px solid hsla(120,100%,25%,0.5); margin: -1px; border-top: none; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; }
|
390
|
+
|
391
|
+
.syntaxhl .insert .insert { color: #0c0; background:transparent; font-weight:bold }
|
392
|
+
.syntaxhl .delete .delete { color: #c00; background:transparent; font-weight:bold }
|
393
|
+
.syntaxhl .change .change { color: #88f }
|
394
|
+
.syntaxhl .head .head { color: #f4f }
|
395
|
+
|
396
|
+
td.radio_span {text-align: left !important;}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
class SvnRecord::Repository::ChangesController < SvnRecord::Repository::ApplicationController
|
2
|
+
layout 'svn_record/subversion'
|
3
|
+
before_filter :find_repository_params
|
4
|
+
def index
|
5
|
+
SvnRecord::Repository::Change.scm.fetch_changesets unless @path.present?
|
6
|
+
@entries = SvnRecord::Repository::Change.scm.entries(@path)
|
7
|
+
@changesets = SvnRecord::Repository::Change.fetch_revisions(@entries).limit(10)
|
8
|
+
rescue
|
9
|
+
render text: '请检查SVN配置以及安装过程是否有问题'
|
10
|
+
end
|
11
|
+
|
12
|
+
def list
|
13
|
+
@entries = SvnRecord::Repository::Change.scm.entries(@path)
|
14
|
+
@changesets = SvnRecord::Repository::Change.fetch_revisions(@entries)
|
15
|
+
end
|
16
|
+
|
17
|
+
def entry
|
18
|
+
@content = SvnRecord::Repository::Change.scm.cat(@path, params[:rev])
|
19
|
+
@changesets = SvnRecord::Repository::Change.revisions(@path)
|
20
|
+
end
|
21
|
+
|
22
|
+
def revisions
|
23
|
+
@changeset = SvnRecord::Repository::Change.find_by_revision(params[:id])
|
24
|
+
end
|
25
|
+
|
26
|
+
def diff
|
27
|
+
@diff = SvnRecord::Repository::Change.scm.diff(@path, params[:rev], params[:rev_to])
|
28
|
+
end
|
29
|
+
|
30
|
+
protected
|
31
|
+
|
32
|
+
def find_repository_params
|
33
|
+
@root_name = SvnRecord::Repository::Change.scm.root_name
|
34
|
+
@path = params[:path].to_s
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
##
|
2
|
+
# = 版本 修订 表
|
3
|
+
#
|
4
|
+
# == Fields
|
5
|
+
#
|
6
|
+
# user_id :: 用户ID
|
7
|
+
# revision :: 版本号
|
8
|
+
# committer :: 提交人
|
9
|
+
# comment :: 注释
|
10
|
+
# committed_at :: 提交时间
|
11
|
+
#
|
12
|
+
# == Indexessu
|
13
|
+
#
|
14
|
+
|
15
|
+
class SvnRecord::Repository::Change < ActiveRecord::Base
|
16
|
+
self.table_name = 'repository_changes'
|
17
|
+
include Svn::Scm::Adapters
|
18
|
+
attr_accessible :revision, :committer, :comment, :committed_at, :user_id
|
19
|
+
has_many :files
|
20
|
+
belongs_to :user
|
21
|
+
scope :committed_desc, order('revision DESC')
|
22
|
+
|
23
|
+
def self.scm
|
24
|
+
Subversion.new
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.fetch_revisions(entries)
|
28
|
+
where("revision <= ?", entries.map(&:lastrev).map{|lastrev| lastrev.identifier.to_i}.max).order("id DESC")
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.revisions(path)
|
32
|
+
where(revision: scm.revisions(path).map(&:identifier)).reorder('id')
|
33
|
+
end
|
34
|
+
|
35
|
+
def create_change(options, branch = "")
|
36
|
+
SvnRecord::Repository::File.create(options.update(change_id: self.id,revision: self.revision, branch: branch))
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
##
|
2
|
+
# = 版本 文件 表
|
3
|
+
#
|
4
|
+
# == Fields
|
5
|
+
#
|
6
|
+
# change_id :: 修订ID
|
7
|
+
# action :: 状态 可为=> %w[A C D I M R X]
|
8
|
+
# path :: 目录
|
9
|
+
# from_path :: 目录来源
|
10
|
+
# from_revision :: 版本来源
|
11
|
+
# revision :: 版本号
|
12
|
+
# branch :: 分支
|
13
|
+
#
|
14
|
+
# == Indexes
|
15
|
+
#
|
16
|
+
|
17
|
+
class SvnRecord::Repository::File < ActiveRecord::Base
|
18
|
+
self.table_name = "repository_files"
|
19
|
+
attr_accessible :change_id, :action, :path, :from_path, :from_revision, :revision, :branch, :change
|
20
|
+
end
|