gollum 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gollum might be problematic. Click here for more details.

Files changed (35) hide show
  1. checksums.yaml +13 -5
  2. data/HISTORY.md +14 -0
  3. data/README.md +15 -11
  4. data/bin/gollum +17 -4
  5. data/{openrc → contrib/openrc}/conf.d/gollum +0 -0
  6. data/{openrc → contrib/openrc}/init.d/gollum +0 -0
  7. data/contrib/systemd/gollum@.service +12 -0
  8. data/gollum.gemspec +9 -5
  9. data/lib/gollum.rb +1 -1
  10. data/lib/gollum/app.rb +44 -12
  11. data/lib/gollum/editing_auth.rb +34 -0
  12. data/lib/gollum/helpers.rb +12 -0
  13. data/lib/gollum/public/gollum/css/dialog.css +117 -15
  14. data/lib/gollum/public/gollum/css/editor.css +220 -62
  15. data/lib/gollum/public/gollum/css/gollum.css +139 -22
  16. data/lib/gollum/public/gollum/css/ie7.css +6 -0
  17. data/lib/gollum/public/gollum/css/template.css +56 -2
  18. data/lib/gollum/public/gollum/javascript/editor/gollum.editor.js +60 -0
  19. data/lib/gollum/public/gollum/javascript/editor/langs/asciidoc.js +26 -11
  20. data/lib/gollum/public/gollum/javascript/gollum.dialog.js +26 -4
  21. data/lib/gollum/templates/compare.mustache +16 -10
  22. data/lib/gollum/templates/editor.mustache +6 -2
  23. data/lib/gollum/templates/history.mustache +4 -2
  24. data/lib/gollum/templates/latest_changes.mustache +39 -0
  25. data/lib/gollum/templates/layout.mustache +14 -5
  26. data/lib/gollum/templates/page.mustache +30 -15
  27. data/lib/gollum/templates/pages.mustache +4 -3
  28. data/lib/gollum/views/compare.rb +1 -1
  29. data/lib/gollum/views/create.rb +8 -0
  30. data/lib/gollum/views/edit.rb +8 -0
  31. data/lib/gollum/views/history.rb +1 -1
  32. data/lib/gollum/views/latest_changes.rb +90 -0
  33. data/lib/gollum/views/page.rb +33 -11
  34. data/lib/gollum/views/pages.rb +6 -2
  35. metadata +38 -34
@@ -4,8 +4,11 @@
4
4
  display: block;
5
5
  overflow: visible;
6
6
  position: absolute;
7
- top: 50%;
8
- left: 50%;
7
+ top: 0;
8
+ left: 0;
9
+ z-index: 999999;
10
+ width: 100%;
11
+ height: 100%;
9
12
  }
10
13
 
11
14
  #gollum-dialog-dialog.active {
@@ -13,24 +16,117 @@
13
16
  }
14
17
 
15
18
  #gollum-dialog-dialog-inner {
16
- margin: 0 0 0 -225px;
17
- position: relative;
18
- width: 450px;
19
-
20
- border: 7px solid #999;
21
- border: 7px solid rgba(0, 0, 0, 0.3);
22
- border-radius: 5px;
23
- -moz-border-radius: 5px;
24
- -webkit-border-radius: 5px;
19
+ margin: 0px;
20
+ top: 0px;
21
+ right: 0px;
22
+ bottom: 0px;
23
+ left: 0px;
24
+ width: 100%;
25
+ height: 100%;
25
26
  }
26
27
 
27
28
  #gollum-dialog-dialog-bg {
28
29
  background-color: #fff;
29
- overflow: hidden;
30
30
  padding: 1em;
31
31
 
32
- background: -webkit-gradient(linear, left top, left bottom, from(#f7f7f7), to(#ffffff));
33
- background: -moz-linear-gradient(top, #f7f7f7, #ffffff);
32
+ height: 100%;
33
+ box-sizing: border-box;
34
+ -moz-box-sizing: border-box;
35
+ -webkit-box-sizing: border-box;
36
+ }
37
+
38
+ @media all and (min-width: 480px) {
39
+ #gollum-dialog-dialog {
40
+ display: block;
41
+ overflow: visible;
42
+ position: absolute;
43
+ position: fixed;
44
+ top: 0;
45
+ left: 0;
46
+ z-index: 999999;
47
+ width: auto;
48
+ height: auto;
49
+ }
50
+
51
+ #gollum-dialog-dialog.active {
52
+ display: block;
53
+ }
54
+
55
+ #gollum-dialog-dialog-inner {
56
+ margin: auto;
57
+ position: fixed;
58
+
59
+ width: auto;
60
+ height: auto;
61
+
62
+ min-width: 280px;
63
+ min-height: 380px;
64
+
65
+ max-width: 450px;
66
+ max-height: 450px;
67
+
68
+ top: 10px;
69
+ right: 10px;
70
+ bottom: 10px;
71
+ left: 10px;
72
+
73
+ border: 7px solid #999;
74
+ border: 7px solid rgba(0, 0, 0, 0.3);
75
+ border-radius: 5px;
76
+ -moz-border-radius: 5px;
77
+ -webkit-border-radius: 5px;
78
+ }
79
+
80
+ #gollum-dialog-dialog-bg {
81
+ background-color: #fff;
82
+ overflow: hidden;
83
+ padding: 1em;
84
+
85
+ background: -webkit-gradient(linear, left top, left bottom, from(#f7f7f7), to(#ffffff));
86
+ background: -moz-linear-gradient(top, #f7f7f7, #ffffff);
87
+
88
+ height: 100%;
89
+ box-sizing: border-box;
90
+ -moz-box-sizing: border-box;
91
+ -webkit-box-sizing: border-box;
92
+ }
93
+ }
94
+
95
+ @media all and (min-width: 940px) {
96
+ #gollum-dialog-dialog {
97
+ position: absolute;
98
+ top: 50%;
99
+ left: 50%;
100
+ width: auto;
101
+ height: auto;
102
+ }
103
+
104
+ #gollum-dialog-dialog-inner {
105
+ margin: 0 0 0 -225px;
106
+ position: relative;
107
+
108
+ width: 450px;
109
+ height: auto;
110
+
111
+ top: auto;
112
+ right: auto;
113
+ bottom: auto;
114
+ left: auto;
115
+
116
+ border: 7px solid #999;
117
+ border: 7px solid rgba(0, 0, 0, 0.3);
118
+ border-radius: 5px;
119
+ -moz-border-radius: 5px;
120
+ -webkit-border-radius: 5px;
121
+ }
122
+
123
+ #gollum-dialog-dialog-bg {
124
+ height: auto;
125
+
126
+ box-sizing: content-box;
127
+ -moz-box-sizing: content-box;
128
+ -webkit-box-sizing: content-box;
129
+ }
34
130
  }
35
131
 
36
132
  #gollum-dialog-dialog-inner h4 {
@@ -52,10 +148,16 @@
52
148
  display: block;
53
149
  border: 0;
54
150
  margin: 0;
55
- overflow: hidden;
56
151
  padding: 0;
57
152
  }
58
153
 
154
+ #gollum-dialog-dialog-body fieldset:after {
155
+ content: ".";
156
+ display: block;
157
+ clear: both;
158
+ visibility: hidden;
159
+ }
160
+
59
161
  #gollum-dialog-dialog-body fieldset .field {
60
162
  margin: 0 0 1.5em 0;
61
163
  padding: 0;
@@ -19,15 +19,15 @@ a {
19
19
  }
20
20
 
21
21
  #gollum-editor {
22
- border: 1px solid #e4e4e4;
23
- background: #f9f9f9;
24
- margin: 1em 0 5em;
25
- overflow: hidden;
26
- padding: 1em 1em 0.4em;
22
+ margin: 0 0 5em;
23
+ padding: 0em 1em 0.4em;
24
+ }
27
25
 
28
- border-radius: 1em;
29
- -moz-border-radius: 1em;
30
- -webkit-border-radius: 1em;
26
+ #gollum-editor:after {
27
+ content: ".";
28
+ display: block;
29
+ visibility: hidden;
30
+ clear: both;
31
31
  }
32
32
 
33
33
  .ff #gollum-editor,
@@ -35,6 +35,18 @@ a {
35
35
  padding-bottom: 1em;
36
36
  }
37
37
 
38
+ @media all and (min-width: 940px) {
39
+ #gollum-editor {
40
+ border: 1px solid #e4e4e4;
41
+ background: #f9f9f9;
42
+ margin: 1em 0 5em;
43
+
44
+ border-radius: 1em;
45
+ -moz-border-radius: 1em;
46
+ -webkit-border-radius: 1em;
47
+ }
48
+ }
49
+
38
50
  #gollum-editor form fieldset {
39
51
  border: 0;
40
52
  margin: 0;
@@ -45,7 +57,13 @@ a {
45
57
  #gollum-editor .singleline {
46
58
  display: block;
47
59
  margin: 0 0 0.7em 0;
48
- overflow: hidden;
60
+ }
61
+
62
+ #gollum-editor .singleline:after {
63
+ content: ".";
64
+ display: block;
65
+ visibility: hidden;
66
+ clear: both;
49
67
  }
50
68
 
51
69
  #gollum-editor .singleline input {
@@ -94,7 +112,6 @@ a {
94
112
  /* @control function-bar */
95
113
  #gollum-editor #gollum-editor-function-bar {
96
114
  border-bottom: 1px solid #ddd;
97
- overflow: hidden;
98
115
  padding: 0;
99
116
  }
100
117
 
@@ -109,9 +126,21 @@ a {
109
126
 
110
127
  #gollum-editor #gollum-editor-function-bar.active #gollum-editor-function-buttons {
111
128
  display: block;
112
- float: left;
113
- overflow: hidden;
114
- padding: 0 0 1.1em 0;
129
+ margin: 0;
130
+ padding: 0;
131
+ }
132
+
133
+ @media all and (min-width: 940px) {
134
+ #gollum-editor #gollum-editor-function-bar {
135
+ overflow: hidden;
136
+ }
137
+
138
+ #gollum-editor #gollum-editor-function-bar.active #gollum-editor-function-buttons {
139
+ overflow: hidden;
140
+ margin: 0;
141
+ padding: 0 0 1.1em 0;
142
+ float: left;
143
+ }
115
144
  }
116
145
 
117
146
  #gollum-editor #gollum-editor-function-bar a.function-button {
@@ -120,12 +149,12 @@ a {
120
149
  color: #333;
121
150
  display: block;
122
151
  float: left;
123
- height: 25px;
152
+ height: 32px;
124
153
  overflow: hidden;
125
- margin: 0.2em 0.5em 0 0;
154
+ margin: 1px 1px 0 0;
126
155
  /* text-indent: -5000px; */
127
156
  text-shadow: 0 1px 0 #fff;
128
- width: 25px;
157
+ width: 32px;
129
158
 
130
159
  border-radius: 0.3em;
131
160
  -moz-border-radius: 0.3em;
@@ -150,41 +179,84 @@ a {
150
179
  background-image: url(../images/icon-sprite.png);
151
180
  background-repeat: no-repeat;
152
181
  display: block;
153
- height: 25px;
182
+ height: 32px;
154
183
  overflow: hidden;
155
184
  text-indent: -5000px;
156
- width: 25px;
157
- }
185
+ width: 32px;
186
+ }
187
+
188
+ a#function-bold span { background-position: 3px 3px; }
189
+ a#function-italic span { background-position: -24px 3px; }
190
+ a#function-underline span { background-position: -51px 3px; }
191
+ a#function-code span { background-position: -79px 3px; }
192
+ a#function-ul span { background-position: -106px 3px; }
193
+ a#function-ol span { background-position: -133px 3px; }
194
+ a#function-blockquote span { background-position: -160px 3px; }
195
+ a#function-hr span { background-position: -187px 3px; }
196
+ a#function-h1 span { background-position: -214px 3px; }
197
+ a#function-h2 span { background-position: -241px 3px; }
198
+ a#function-h3 span { background-position: -268px 3px; }
199
+ a#function-link span { background-position: -295px 3px; }
200
+ a#function-image span { background-position: -321px 3px; }
201
+ a#function-help span { background-position: -402px 3px; }
202
+
203
+ a#function-bold:hover span { background-position: 3px -25px; }
204
+ a#function-italic:hover span { background-position: -24px -25px; }
205
+ a#function-underline:hover span { background-position: -51px -25px; }
206
+ a#function-code:hover span { background-position: -79px -25px; }
207
+ a#function-ul:hover span { background-position: -106px -25px; }
208
+ a#function-ol:hover span { background-position: -133px -25px; }
209
+ a#function-blockquote:hover span { background-position: -160px -25px; }
210
+ a#function-hr:hover span { background-position: -187px -25px; }
211
+ a#function-h1:hover span { background-position: -214px -25px; }
212
+ a#function-h2:hover span { background-position: -241px -25px; }
213
+ a#function-h3:hover span { background-position: -268px -25px; }
214
+ a#function-link:hover span { background-position: -295px -25px; }
215
+ a#function-image:hover span { background-position: -321px -25px; }
216
+ a#function-help:hover span { background-position: -402px -25px; }
217
+
218
+ @media all and (min-width: 940px) {
219
+ #gollum-editor #gollum-editor-function-bar a.function-button {
220
+ height: 25px;
221
+ width: 25px;
222
+ margin: 0.2em 0.5em 0 0;
223
+ }
224
+
225
+ #gollum-editor #gollum-editor-function-bar a span {
226
+ width: 25px;
227
+ height: 25px;
228
+ }
158
229
 
159
- a#function-bold span { background-position: 0 0; }
160
- a#function-italic span { background-position: -27px 0; }
161
- a#function-underline span { background-position: -54px 0; }
162
- a#function-code span { background-position: -82px 0; }
163
- a#function-ul span { background-position: -109px 0; }
164
- a#function-ol span { background-position: -136px 0; }
165
- a#function-blockquote span { background-position: -163px 0; }
166
- a#function-hr span { background-position: -190px 0; }
167
- a#function-h1 span { background-position: -217px 0; }
168
- a#function-h2 span { background-position: -244px 0; }
169
- a#function-h3 span { background-position: -271px 0; }
170
- a#function-link span { background-position: -298px 0; }
171
- a#function-image span { background-position: -324px 0; }
172
- a#function-help span { background-position: -405px 0; }
173
-
174
- a#function-bold:hover span { background-position: 0 -28px; }
175
- a#function-italic:hover span { background-position: -27px -28px; }
176
- a#function-underline:hover span { background-position: -54px -28px; }
177
- a#function-code:hover span { background-position: -82px -28px; }
178
- a#function-ul:hover span { background-position: -109px -28px; }
179
- a#function-ol:hover span { background-position: -136px -28px; }
180
- a#function-blockquote:hover span { background-position: -163px -28px; }
181
- a#function-hr:hover span { background-position: -190px -28px; }
182
- a#function-h1:hover span { background-position: -217px -28px; }
183
- a#function-h2:hover span { background-position: -244px -28px; }
184
- a#function-h3:hover span { background-position: -271px -28px; }
185
- a#function-link:hover span { background-position: -298px -28px; }
186
- a#function-image:hover span { background-position: -324px -28px; }
187
- a#function-help:hover span { background-position: -405px -28px; }
230
+ a#function-bold span { background-position: 0 0; }
231
+ a#function-italic span { background-position: -27px 0; }
232
+ a#function-underline span { background-position: -54px 0; }
233
+ a#function-code span { background-position: -82px 0; }
234
+ a#function-ul span { background-position: -109px 0; }
235
+ a#function-ol span { background-position: -136px 0; }
236
+ a#function-blockquote span { background-position: -163px 0; }
237
+ a#function-hr span { background-position: -190px 0; }
238
+ a#function-h1 span { background-position: -217px 0; }
239
+ a#function-h2 span { background-position: -244px 0; }
240
+ a#function-h3 span { background-position: -271px 0; }
241
+ a#function-link span { background-position: -298px 0; }
242
+ a#function-image span { background-position: -324px 0; }
243
+ a#function-help span { background-position: -405px 0; }
244
+
245
+ a#function-bold:hover span { background-position: 0 -28px; }
246
+ a#function-italic:hover span { background-position: -27px -28px; }
247
+ a#function-underline:hover span { background-position: -54px -28px; }
248
+ a#function-code:hover span { background-position: -82px -28px; }
249
+ a#function-ul:hover span { background-position: -109px -28px; }
250
+ a#function-ol:hover span { background-position: -136px -28px; }
251
+ a#function-blockquote:hover span { background-position: -163px -28px; }
252
+ a#function-hr:hover span { background-position: -190px -28px; }
253
+ a#function-h1:hover span { background-position: -217px -28px; }
254
+ a#function-h2:hover span { background-position: -244px -28px; }
255
+ a#function-h3:hover span { background-position: -271px -28px; }
256
+ a#function-link:hover span { background-position: -298px -28px; }
257
+ a#function-image:hover span { background-position: -324px -28px; }
258
+ a#function-help:hover span { background-position: -405px -28px; }
259
+ }
188
260
 
189
261
 
190
262
  #gollum-editor #gollum-editor-function-bar a.disabled {
@@ -192,14 +264,19 @@ a#function-help:hover span { background-position: -405px -28px; }
192
264
  }
193
265
 
194
266
  #gollum-editor #gollum-editor-function-bar span.function-divider {
195
- display: block;
196
- float: left;
197
- width: 0.5em;
267
+ display: none;
198
268
  }
199
269
 
200
270
  #gollum-editor #gollum-editor-function-bar #gollum-editor-format-selector {
201
- overflow: hidden;
202
- padding: .2em 0 .5em 0;
271
+ padding: 0.2em 0 0.5em 0;
272
+ clear: both;
273
+ }
274
+
275
+ #gollum-editor #gollum-editor-function-bar #gollum-editor-format-selector:after {
276
+ content: ".";
277
+ display: block;
278
+ clear: both;
279
+ visibility: hidden;
203
280
  }
204
281
 
205
282
  #gollum-editor #gollum-editor-function-bar
@@ -208,13 +285,12 @@ a#function-help:hover span { background-position: -405px -28px; }
208
285
  border: 1px solid #ddd;
209
286
  color: #333;
210
287
 
211
- float: right;
212
288
  font-size: 1em;
213
289
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
214
290
  font-weight: bold;
215
291
  line-height: 1.6em;
216
292
  padding: 0.3em 0.4em;
217
-
293
+ display: inline-block;
218
294
 
219
295
  border-radius: 0.5em;
220
296
  -moz-border-radius: 0.5em;
@@ -224,11 +300,11 @@ a#function-help:hover span { background-position: -405px -28px; }
224
300
  #gollum-editor #gollum-editor-function-bar
225
301
  #gollum-editor-format-selector label {
226
302
  color: #999;
227
- float: right;
228
303
  font-size: 1em;
229
304
  font-weight: bold;
230
305
  line-height: 1.6em;
231
306
  padding: .3em 0.5em 0 0;
307
+ display: inline-block;
232
308
  }
233
309
 
234
310
  #gollum-editor #gollum-editor-function-bar
@@ -236,6 +312,56 @@ a#function-help:hover span { background-position: -405px -28px; }
236
312
  content: ':';
237
313
  }
238
314
 
315
+ @media all and (min-width: 940px) {
316
+ #gollum-editor #gollum-editor-function-bar span.function-divider {
317
+ display: block;
318
+ width: 0.5em;
319
+ }
320
+
321
+ #gollum-editor #gollum-editor-function-bar span.function-divider {
322
+ float: left;
323
+ }
324
+
325
+ #gollum-editor #gollum-editor-function-bar
326
+ #gollum-editor-format-selector {
327
+ clear: none;
328
+ text-align: right;
329
+ }
330
+
331
+ #gollum-editor #gollum-editor-function-bar
332
+ #gollum-editor-format-selector select {
333
+ }
334
+
335
+ #gollum-editor #gollum-editor-function-bar
336
+ #gollum-editor-format-selector label {
337
+ }
338
+ }
339
+
340
+
341
+ /* @section uploads */
342
+
343
+ #gollum-editor-body.dragging {
344
+ box-shadow: 0 0 10px #AAE000;
345
+ }
346
+
347
+ #gollum-editor-body.uploading {
348
+ opacity: 0.5;
349
+ }
350
+
351
+ #gollum-editor-body + div {
352
+ display: none;
353
+ font-size: 1.5em;
354
+ }
355
+
356
+ #gollum-editor-body + div > i {
357
+ font-size: 1em;
358
+ }
359
+
360
+ #gollum-editor-body.uploading + div {
361
+ display: block;
362
+ }
363
+
364
+
239
365
 
240
366
  /* @section form-fields */
241
367
 
@@ -245,12 +371,18 @@ a#function-help:hover span { background-position: -405px -28px; }
245
371
  font-size: 1em;
246
372
  font-family: Consolas, "Liberation Mono", Courier, monospace;
247
373
  line-height: 1.4em;
248
- margin: 1em 0 0.4em;
374
+ margin: 0 0 0.4em;
249
375
  padding: 0.5em;
250
376
  width: 98%;
251
377
  height: 20em;
252
378
  }
253
379
 
380
+ @media all and (min-width: 940px) {
381
+ #gollum-editor textarea {
382
+ margin: 1em 0 0.4em;
383
+ }
384
+ }
385
+
254
386
  #gollum-editor input#gollum-editor-submit {
255
387
  background-color: #f7f7f7;
256
388
  border: 1px solid #d4d4d4;
@@ -445,6 +577,7 @@ a#function-help:hover span { background-position: -405px -28px; }
445
577
 
446
578
  /* @section help */
447
579
  #gollum-editor-help {
580
+ clear: both;
448
581
  margin: 0;
449
582
  overflow: hidden;
450
583
  padding: 0;
@@ -455,13 +588,13 @@ a#function-help:hover span { background-position: -405px -28px; }
455
588
  #gollum-editor-help-parent,
456
589
  #gollum-editor-help-list {
457
590
  display: block;
458
- float: left;
459
- height: 17em;
460
591
  list-style-type: none;
461
- overflow: auto;
462
592
  margin: 0;
463
- padding: 1em 0;
464
- width: 18%;
593
+ float: left;
594
+ width: 50%;
595
+ box-sizing: border-box;
596
+ -webkit-box-sizing: border-box;
597
+ -moz-box-sizing: border-box;
465
598
  }
466
599
 
467
600
  #gollum-editor-help-parent {
@@ -491,6 +624,7 @@ a#function-help:hover span { background-position: -405px -28px; }
491
624
  width: auto;
492
625
  padding: 0.2em 1em;
493
626
  text-shadow: 0 -1px 0 #fff;
627
+ font-size: 0.8em;
494
628
  }
495
629
 
496
630
  #gollum-editor-help-parent li a:hover,
@@ -518,6 +652,7 @@ a#function-help:hover span { background-position: -405px -28px; }
518
652
  overflow: auto;
519
653
  height: 17em;
520
654
  padding: 1em;
655
+ clear: both;
521
656
  }
522
657
 
523
658
  #gollum-editor-help-content {
@@ -532,6 +667,29 @@ a#function-help:hover span { background-position: -405px -28px; }
532
667
  padding: 0;
533
668
  }
534
669
 
670
+ @media all and (min-width: 940px) {
671
+ #gollum-editor-help {
672
+ clear: none;
673
+ }
674
+
675
+ #gollum-editor-help-parent,
676
+ #gollum-editor-help-list {
677
+ height: 17em;
678
+ width: 18%;
679
+ overflow: auto;
680
+ padding: 1em 0;
681
+ }
682
+
683
+ #gollum-editor-help-parent li a,
684
+ #gollum-editor-help-list li a {
685
+ font-size: 1em;
686
+ }
687
+
688
+ #gollum-editor-help-wrapper {
689
+ clear: none;
690
+ }
691
+ }
692
+
535
693
  /* IE */
536
694
  .ie #gollum-editor .singleline input {
537
695
  padding-top: 0.25em;