georgi-shinmun 0.3.10 → 0.4
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.
- data/README.md +4 -34
- data/Rakefile +25 -2
- data/example/assets/stylesheets/{6-comments.css → 5-comments.css} +0 -0
- data/example/assets/stylesheets/{7-diff.css → 6-diff.css} +0 -0
- data/example/assets/stylesheets/{8-blog.css → 7-blog.css} +0 -0
- data/example/templates/archive.rhtml +12 -0
- data/lib/shinmun/post.rb +1 -1
- data/lib/shinmun/routes.rb +18 -69
- data/test/blog_spec.rb +2 -3
- data/test/post_spec.rb +2 -2
- metadata +31 -61
- data/.gitignore +0 -4
- data/LICENSE +0 -18
- data/example/assets/stylesheets/5-coderay.css +0 -112
- data/example/assets/wmd/images/bg-fill.png +0 -0
- data/example/assets/wmd/images/bg.png +0 -0
- data/example/assets/wmd/images/blockquote.png +0 -0
- data/example/assets/wmd/images/bold.png +0 -0
- data/example/assets/wmd/images/code.png +0 -0
- data/example/assets/wmd/images/h1.png +0 -0
- data/example/assets/wmd/images/hr.png +0 -0
- data/example/assets/wmd/images/img.png +0 -0
- data/example/assets/wmd/images/italic.png +0 -0
- data/example/assets/wmd/images/link.png +0 -0
- data/example/assets/wmd/images/ol.png +0 -0
- data/example/assets/wmd/images/redo.png +0 -0
- data/example/assets/wmd/images/separator.png +0 -0
- data/example/assets/wmd/images/ul.png +0 -0
- data/example/assets/wmd/images/undo.png +0 -0
- data/example/assets/wmd/images/wmd-on.png +0 -0
- data/example/assets/wmd/images/wmd.png +0 -0
- data/example/assets/wmd/showdown.js +0 -421
- data/example/assets/wmd/wmd-base.js +0 -1799
- data/example/assets/wmd/wmd-plus.js +0 -311
- data/example/assets/wmd/wmd.js +0 -73
- data/example/templates/admin/commit.rhtml +0 -27
- data/example/templates/admin/commits.rhtml +0 -9
- data/example/templates/admin/edit.rhtml +0 -17
- data/example/templates/admin/pages.rhtml +0 -19
- data/example/templates/admin/posts.rhtml +0 -24
@@ -1,311 +0,0 @@
|
|
1
|
-
var Attacklab=Attacklab||{};
|
2
|
-
Attacklab.wmdPlus=function(){
|
3
|
-
this.symboltable;
|
4
|
-
var _1=top;
|
5
|
-
var _2=_1["Attacklab"];
|
6
|
-
var _3=_1["document"];
|
7
|
-
var _4=_1["RegExp"];
|
8
|
-
var _5=_1["navigator"];
|
9
|
-
var _6=_2.Util;
|
10
|
-
var _7=_2.Position;
|
11
|
-
var _8=_2.Command;
|
12
|
-
_8.doAutoindent=function(_9){
|
13
|
-
_9.before=_9.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n");
|
14
|
-
_9.before=_9.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n");
|
15
|
-
_9.before=_9.before.replace(/(\n|^)[ \t]+\n$/,"\n\n");
|
16
|
-
if(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(_9.before)){
|
17
|
-
if(_8.doList){
|
18
|
-
_8.doList(_9);
|
19
|
-
}
|
20
|
-
}
|
21
|
-
if(/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(_9.before)){
|
22
|
-
if(_8.doBlockquote){
|
23
|
-
_8.doBlockquote(_9);
|
24
|
-
}
|
25
|
-
}
|
26
|
-
if(/(\n|^)(\t|[ ]{4,}).*\n$/.test(_9.before)){
|
27
|
-
if(_8.doCode){
|
28
|
-
_8.doCode(_9);
|
29
|
-
}
|
30
|
-
}
|
31
|
-
};
|
32
|
-
_8.doBlockquote=function(_a){
|
33
|
-
_a.selection=_a.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(_b,_c,_d,_e){
|
34
|
-
_a.before+=_c;
|
35
|
-
_a.after=_e+_a.after;
|
36
|
-
return _d;
|
37
|
-
});
|
38
|
-
_a.before=_a.before.replace(/(>[ \t]*)$/,function(_f,_10){
|
39
|
-
_a.selection=_10+_a.selection;
|
40
|
-
return "";
|
41
|
-
});
|
42
|
-
_a.selection=_a.selection.replace(/^(\s|>)+$/,"");
|
43
|
-
_a.selection=_a.selection||"Blockquote";
|
44
|
-
if(_a.before){
|
45
|
-
_a.before=_a.before.replace(/\n?$/,"\n");
|
46
|
-
}
|
47
|
-
if(_a.after){
|
48
|
-
_a.after=_a.after.replace(/^\n?/,"\n");
|
49
|
-
}
|
50
|
-
_a.before=_a.before.replace(/(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*$)/,function(_11){
|
51
|
-
_a.startTag=_11;
|
52
|
-
return "";
|
53
|
-
});
|
54
|
-
_a.after=_a.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(_12){
|
55
|
-
_a.endTag=_12;
|
56
|
-
return "";
|
57
|
-
});
|
58
|
-
var _13=function(_14){
|
59
|
-
var _15=_14?"> ":"";
|
60
|
-
if(_a.startTag){
|
61
|
-
_a.startTag=_a.startTag.replace(/\n((>|\s)*)\n$/,function(_16,_17){
|
62
|
-
return "\n"+_17.replace(/^[ ]{0,3}>?[ \t]*$/gm,_15)+"\n";
|
63
|
-
});
|
64
|
-
}
|
65
|
-
if(_a.endTag){
|
66
|
-
_a.endTag=_a.endTag.replace(/^\n((>|\s)*)\n/,function(_18,_19){
|
67
|
-
return "\n"+_19.replace(/^[ ]{0,3}>?[ \t]*$/gm,_15)+"\n";
|
68
|
-
});
|
69
|
-
}
|
70
|
-
};
|
71
|
-
if(/^(?![ ]{0,3}>)/m.test(_a.selection)){
|
72
|
-
_8.wrap(_a,_2.wmd_env.lineLength-2);
|
73
|
-
_a.selection=_a.selection.replace(/^/gm,"> ");
|
74
|
-
_13(true);
|
75
|
-
_a.skipLines();
|
76
|
-
}else{
|
77
|
-
_a.selection=_a.selection.replace(/^[ ]{0,3}> ?/gm,"");
|
78
|
-
_8.unwrap(_a);
|
79
|
-
_13(false);
|
80
|
-
if(!/^(\n|^)[ ]{0,3}>/.test(_a.selection)){
|
81
|
-
if(_a.startTag){
|
82
|
-
_a.startTag=_a.startTag.replace(/\n{0,2}$/,"\n\n");
|
83
|
-
}
|
84
|
-
}
|
85
|
-
if(!/(\n|^)[ ]{0,3}>.*$/.test(_a.selection)){
|
86
|
-
if(_a.endTag){
|
87
|
-
_a.endTag=_a.endTag.replace(/^\n{0,2}/,"\n\n");
|
88
|
-
}
|
89
|
-
}
|
90
|
-
}
|
91
|
-
if(!/\n/.test(_a.selection)){
|
92
|
-
_a.selection=_a.selection.replace(/^(> *)/,function(_1a,_1b){
|
93
|
-
_a.startTag+=_1b;
|
94
|
-
return "";
|
95
|
-
});
|
96
|
-
}
|
97
|
-
};
|
98
|
-
_8.doCode=function(_1c){
|
99
|
-
var _1d=/\S[ ]*$/.test(_1c.before);
|
100
|
-
var _1e=/^[ ]*\S/.test(_1c.after);
|
101
|
-
if((!_1e&&!_1d)||/\n/.test(_1c.selection)){
|
102
|
-
_1c.before=_1c.before.replace(/[ ]{4}$/,function(_1f){
|
103
|
-
_1c.selection=_1f+_1c.selection;
|
104
|
-
return "";
|
105
|
-
});
|
106
|
-
var _20=1;
|
107
|
-
var _21=1;
|
108
|
-
if(/\n(\t|[ ]{4,}).*\n$/.test(_1c.before)){
|
109
|
-
_20=0;
|
110
|
-
}
|
111
|
-
if(/^\n(\t|[ ]{4,})/.test(_1c.after)){
|
112
|
-
_21=0;
|
113
|
-
}
|
114
|
-
_1c.skipLines(_20,_21);
|
115
|
-
if(!_1c.selection){
|
116
|
-
_1c.startTag=" ";
|
117
|
-
_1c.selection="print(\"code sample\");";
|
118
|
-
return;
|
119
|
-
}
|
120
|
-
if(/^[ ]{0,3}\S/m.test(_1c.selection)){
|
121
|
-
_1c.selection=_1c.selection.replace(/^/gm," ");
|
122
|
-
}else{
|
123
|
-
_1c.selection=_1c.selection.replace(/^[ ]{4}/gm,"");
|
124
|
-
}
|
125
|
-
}else{
|
126
|
-
_1c.trimWhitespace();
|
127
|
-
_1c.findTags(/`/,/`/);
|
128
|
-
if(!_1c.startTag&&!_1c.endTag){
|
129
|
-
_1c.startTag=_1c.endTag="`";
|
130
|
-
if(!_1c.selection){
|
131
|
-
_1c.selection="print(\"code sample\");";
|
132
|
-
}
|
133
|
-
}else{
|
134
|
-
if(_1c.endTag&&!_1c.startTag){
|
135
|
-
_1c.before+=_1c.endTag;
|
136
|
-
_1c.endTag="";
|
137
|
-
}else{
|
138
|
-
_1c.startTag=_1c.endTag="";
|
139
|
-
}
|
140
|
-
}
|
141
|
-
}
|
142
|
-
};
|
143
|
-
_8.autoindent={};
|
144
|
-
_8.autoindent.textOp=_8.doAutoindent;
|
145
|
-
_8.blockquote={};
|
146
|
-
_8.blockquote.description="Blockquote <blockquote>";
|
147
|
-
_8.blockquote.image="images/blockquote.png";
|
148
|
-
_8.blockquote.key=".";
|
149
|
-
_8.blockquote.keyCode=190;
|
150
|
-
_8.blockquote.textOp=function(_22){
|
151
|
-
return _8.doBlockquote(_22);
|
152
|
-
};
|
153
|
-
_8.code={};
|
154
|
-
_8.code.description="Code Sample <pre><code>";
|
155
|
-
_8.code.image="images/code.png";
|
156
|
-
_8.code.key="k";
|
157
|
-
_8.code.textOp=_8.doCode;
|
158
|
-
_8.img={};
|
159
|
-
_8.img.description="Image <img>";
|
160
|
-
_8.img.image="images/img.png";
|
161
|
-
_8.img.key="g";
|
162
|
-
_8.img.textOp=function(_23,_24){
|
163
|
-
return _8.doLinkOrImage(_23,true,_24);
|
164
|
-
};
|
165
|
-
_8.doList=function(_25,_26){
|
166
|
-
var _27=/(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/;
|
167
|
-
var _28="";
|
168
|
-
var _29=1;
|
169
|
-
var _2a=function(){
|
170
|
-
if(_26){
|
171
|
-
var _2b=" "+_29+". ";
|
172
|
-
_29++;
|
173
|
-
return _2b;
|
174
|
-
}
|
175
|
-
var _2c=_28||"-";
|
176
|
-
return " "+_2c+" ";
|
177
|
-
};
|
178
|
-
var _2d=function(_2e){
|
179
|
-
if(_26==undefined){
|
180
|
-
_26=/^\s*\d/.test(_2e);
|
181
|
-
}
|
182
|
-
_2e=_2e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(_2f){
|
183
|
-
return _2a();
|
184
|
-
});
|
185
|
-
return _2e;
|
186
|
-
};
|
187
|
-
var _30=function(){
|
188
|
-
_31=_6.regexToString(_27);
|
189
|
-
_31.expression="^\n*"+_31.expression;
|
190
|
-
var _32=_6.stringToRegex(_31);
|
191
|
-
_25.after=_25.after.replace(_32,_2d);
|
192
|
-
};
|
193
|
-
_25.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null);
|
194
|
-
var _33=/^\n/;
|
195
|
-
if(_25.before&&!/\n$/.test(_25.before)&&!_33.test(_25.startTag)){
|
196
|
-
_25.before+=_25.startTag;
|
197
|
-
_25.startTag="";
|
198
|
-
}
|
199
|
-
if(_25.startTag){
|
200
|
-
var _34=/\d+[.]/.test(_25.startTag);
|
201
|
-
_25.startTag="";
|
202
|
-
_25.selection=_25.selection.replace(/\n[ ]{4}/g,"\n");
|
203
|
-
_8.unwrap(_25);
|
204
|
-
_25.skipLines();
|
205
|
-
if(_34){
|
206
|
-
_30();
|
207
|
-
}
|
208
|
-
if(_26==_34){
|
209
|
-
return;
|
210
|
-
}
|
211
|
-
}
|
212
|
-
var _35=1;
|
213
|
-
var _31=_6.regexToString(_27);
|
214
|
-
_31.expression="(\\n|^)"+_31.expression+"$";
|
215
|
-
var _36=_6.stringToRegex(_31);
|
216
|
-
_25.before=_25.before.replace(_36,function(_37){
|
217
|
-
if(/^\s*([*+-])/.test(_37)){
|
218
|
-
_28=_4.$1;
|
219
|
-
}
|
220
|
-
_35=/[^\n]\n\n[^\n]/.test(_37)?1:0;
|
221
|
-
return _2d(_37);
|
222
|
-
});
|
223
|
-
if(!_25.selection){
|
224
|
-
_25.selection="List item";
|
225
|
-
}
|
226
|
-
var _38=_2a();
|
227
|
-
var _39=1;
|
228
|
-
_31=_6.regexToString(_27);
|
229
|
-
_31.expression="^\n*"+_31.expression;
|
230
|
-
_36=_6.stringToRegex(_31);
|
231
|
-
_25.after=_25.after.replace(_36,function(_3a){
|
232
|
-
_39=/[^\n]\n\n[^\n]/.test(_3a)?1:0;
|
233
|
-
return _2d(_3a);
|
234
|
-
});
|
235
|
-
_25.trimWhitespace(true);
|
236
|
-
_25.skipLines(_35,_39,true);
|
237
|
-
_25.startTag=_38;
|
238
|
-
var _3b=_38.replace(/./g," ");
|
239
|
-
_8.wrap(_25,_2.wmd_env.lineLength-_3b.length);
|
240
|
-
_25.selection=_25.selection.replace(/\n/g,"\n"+_3b);
|
241
|
-
};
|
242
|
-
_8.doHeading=function(_3c){
|
243
|
-
_3c.selection=_3c.selection.replace(/\s+/g," ");
|
244
|
-
_3c.selection=_3c.selection.replace(/(^\s+|\s+$)/g,"");
|
245
|
-
var _3d=0;
|
246
|
-
_3c.findTags(/#+[ ]*/,/[ ]*#+/);
|
247
|
-
if(/#+/.test(_3c.startTag)){
|
248
|
-
_3d=_4.lastMatch.length;
|
249
|
-
}
|
250
|
-
_3c.startTag=_3c.endTag="";
|
251
|
-
_3c.findTags(null,/\s?(-+|=+)/);
|
252
|
-
if(/=+/.test(_3c.endTag)){
|
253
|
-
_3d=1;
|
254
|
-
}
|
255
|
-
if(/-+/.test(_3c.endTag)){
|
256
|
-
_3d=2;
|
257
|
-
}
|
258
|
-
_3c.startTag=_3c.endTag="";
|
259
|
-
_3c.skipLines(1,1);
|
260
|
-
if(!_3c.selection){
|
261
|
-
_3c.startTag="## ";
|
262
|
-
_3c.selection="Heading";
|
263
|
-
_3c.endTag=" ##";
|
264
|
-
return;
|
265
|
-
}
|
266
|
-
var _3e=_3d==0?2:_3d-1;
|
267
|
-
if(_3e){
|
268
|
-
var _3f=_3e>=2?"-":"=";
|
269
|
-
var _40=_3c.selection.length;
|
270
|
-
if(_40>_2.wmd_env.lineLength){
|
271
|
-
_40=_2.wmd_env.lineLength;
|
272
|
-
}
|
273
|
-
_3c.endTag="\n";
|
274
|
-
while(_40--){
|
275
|
-
_3c.endTag+=_3f;
|
276
|
-
}
|
277
|
-
}
|
278
|
-
};
|
279
|
-
_8.ol={};
|
280
|
-
_8.ol.description="Numbered List <ol>";
|
281
|
-
_8.ol.image="images/ol.png";
|
282
|
-
_8.ol.key="o";
|
283
|
-
_8.ol.textOp=function(_41){
|
284
|
-
_8.doList(_41,true);
|
285
|
-
};
|
286
|
-
_8.ul={};
|
287
|
-
_8.ul.description="Bulleted List <ul>";
|
288
|
-
_8.ul.image="images/ul.png";
|
289
|
-
_8.ul.key="u";
|
290
|
-
_8.ul.textOp=function(_42){
|
291
|
-
_8.doList(_42,false);
|
292
|
-
};
|
293
|
-
_8.h1={};
|
294
|
-
_8.h1.description="Heading <h1>/<h2>";
|
295
|
-
_8.h1.image="images/h1.png";
|
296
|
-
_8.h1.key="h";
|
297
|
-
_8.h1.textOp=_8.doHeading;
|
298
|
-
_8.hr={};
|
299
|
-
_8.hr.description="Horizontal Rule <hr>";
|
300
|
-
_8.hr.image="images/hr.png";
|
301
|
-
_8.hr.key="r";
|
302
|
-
_8.hr.textOp=function(_43){
|
303
|
-
_43.startTag="----------\n";
|
304
|
-
_43.selection="";
|
305
|
-
_43.skipLines(2,1,true);
|
306
|
-
};
|
307
|
-
};
|
308
|
-
if(Attacklab.fileLoaded){
|
309
|
-
Attacklab.fileLoaded("wmd-plus.js");
|
310
|
-
}
|
311
|
-
|
data/example/assets/wmd/wmd.js
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
var Attacklab=Attacklab||{};
|
2
|
-
Attacklab.wmd_env={};
|
3
|
-
Attacklab.account_options={};
|
4
|
-
Attacklab.wmd_defaults={version:1,output:"HTML",lineLength:40,delayLoad:false};
|
5
|
-
if(!Attacklab.wmd){
|
6
|
-
Attacklab.wmd=function(){
|
7
|
-
Attacklab.loadEnv=function(){
|
8
|
-
var _1=function(_2){
|
9
|
-
if(!_2){
|
10
|
-
return;
|
11
|
-
}
|
12
|
-
for(var _3 in _2){
|
13
|
-
Attacklab.wmd_env[_3]=_2[_3];
|
14
|
-
}
|
15
|
-
};
|
16
|
-
_1(Attacklab.wmd_defaults);
|
17
|
-
_1(Attacklab.account_options);
|
18
|
-
_1(top["wmd_options"]);
|
19
|
-
Attacklab.full=true;
|
20
|
-
var _4="bold italic | link blockquote code image | ol ul heading hr";
|
21
|
-
Attacklab.wmd_env.buttons=Attacklab.wmd_env.buttons||_4;
|
22
|
-
};
|
23
|
-
Attacklab.loadEnv();
|
24
|
-
var _5=["showdown.js","wmd-base.js","wmd-plus.js"];
|
25
|
-
var _6=function(_7){
|
26
|
-
};
|
27
|
-
Attacklab.fileLoaded=function(_8){
|
28
|
-
arguments.callee.count=arguments.callee.count||0;
|
29
|
-
if(++arguments.callee.count>=_5.length){
|
30
|
-
var go=function(){
|
31
|
-
Attacklab.wmdBase();
|
32
|
-
Attacklab.Util.startEditor();
|
33
|
-
};
|
34
|
-
if(Attacklab.wmd_env.delayLoad){
|
35
|
-
window.setTimeout(go,0);
|
36
|
-
}else{
|
37
|
-
go();
|
38
|
-
}
|
39
|
-
}
|
40
|
-
};
|
41
|
-
Attacklab.editorInit=function(){
|
42
|
-
Attacklab.wmdPlus();
|
43
|
-
};
|
44
|
-
var _a=function(_b,_c){
|
45
|
-
var _d=Attacklab.basePath+_b;
|
46
|
-
if(_c){
|
47
|
-
_d+="?nocache="+(new Date()).getTime();
|
48
|
-
}
|
49
|
-
var _e=document.createElement("script");
|
50
|
-
_e.src=_d;
|
51
|
-
top.document.documentElement.firstChild.appendChild(_e);
|
52
|
-
};
|
53
|
-
var _f=function(_10){
|
54
|
-
var _11=RegExp("(.*)"+_10+"(\\?(.+))?$","g");
|
55
|
-
var _12=document.getElementsByTagName("script");
|
56
|
-
for(var i=0;i<_12.length;i++){
|
57
|
-
if(_11.test(_12[i].src)){
|
58
|
-
var _14=RegExp.$1;
|
59
|
-
if(/wmd-editor.com/.test(_12[i].src)){
|
60
|
-
return null;
|
61
|
-
}
|
62
|
-
return _14;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
};
|
66
|
-
Attacklab.basePath=_f("wmd.js")||"http://static.wmd-editor.com/v2/";
|
67
|
-
for(var f,i=0;f=_5[i];i++){
|
68
|
-
_a(f,false);
|
69
|
-
}
|
70
|
-
};
|
71
|
-
Attacklab.wmd();
|
72
|
-
}
|
73
|
-
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<h2>Commit <%= @commit.id %></h2>
|
2
|
-
|
3
|
-
<em><%= @commit.author %> on <%= @commit.date %></em>
|
4
|
-
|
5
|
-
<pre><%= @commit.message %></pre>
|
6
|
-
|
7
|
-
<ul>
|
8
|
-
<% for diff in @commit.diffs %>
|
9
|
-
<li><a href="#<%= diff.a_path %>"><%= diff.a_path %></a></li>
|
10
|
-
<% end %>
|
11
|
-
</ul>
|
12
|
-
|
13
|
-
<% for diff in @commit.diffs %>
|
14
|
-
<a name="<%= diff.a_path %>"></a>
|
15
|
-
<div class="diff">
|
16
|
-
<div class="path"><%= diff.a_path %></div>
|
17
|
-
<div class="body">
|
18
|
-
<% for line in diff.diff.split("\n")[3..-1] %>
|
19
|
-
<div class="line <%= diff_line_class line %>">
|
20
|
-
<%=h line[1..-1] %>
|
21
|
-
</div>
|
22
|
-
<% end %>
|
23
|
-
</div>
|
24
|
-
</div>
|
25
|
-
<% end %>
|
26
|
-
|
27
|
-
<hr/>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<h1><%= @post.title %></h1>
|
2
|
-
|
3
|
-
<form method="post">
|
4
|
-
<p>
|
5
|
-
<textarea style="width:100%" name="data" rows="20"><%= @post.dump %></textarea>
|
6
|
-
</p>
|
7
|
-
<p>
|
8
|
-
<input type="submit" value="Save"/>
|
9
|
-
</p>
|
10
|
-
</form>
|
11
|
-
|
12
|
-
<% if @post.type == 'md' %>
|
13
|
-
<script type="text/javascript">
|
14
|
-
wmd_options = { output: "Markdown" };
|
15
|
-
</script>
|
16
|
-
<script type="text/javascript" src="/assets/wmd/wmd.js"></script>
|
17
|
-
<% end %>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<h1>Pages</h1>
|
2
|
-
|
3
|
-
<form method="post" action="/admin/create">
|
4
|
-
<input type="text" name="title" size="40"/>
|
5
|
-
<input type="submit" value="Create page"/>
|
6
|
-
</form>
|
7
|
-
|
8
|
-
<hr/>
|
9
|
-
|
10
|
-
<table style="width:100%">
|
11
|
-
<% for page in @blog.pages %>
|
12
|
-
<tr>
|
13
|
-
<td><%= link_to page.title, "/#{page.name}" %></td>
|
14
|
-
<td><%= link_to 'Edit', "/admin/edit/#{page.path}" %></td>
|
15
|
-
</tr>
|
16
|
-
<% end %>
|
17
|
-
</table>
|
18
|
-
|
19
|
-
<hr/>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<h1>Posts</h1>
|
2
|
-
|
3
|
-
<form method="post" action="/admin/create">
|
4
|
-
<input type="hidden" name="date" value="<%= Date.today.strftime %>"/>
|
5
|
-
<input type="text" name="title" size="40"/>
|
6
|
-
<input type="submit" value="Create post"/>
|
7
|
-
</form>
|
8
|
-
|
9
|
-
<hr/>
|
10
|
-
|
11
|
-
<table style="width:100%">
|
12
|
-
<% for post in @posts[@page * @page_size, @page_size] %>
|
13
|
-
<tr>
|
14
|
-
<td><%= post_link post %></td>
|
15
|
-
<td><%= human_date post.date %></td>
|
16
|
-
<td><%= link_to 'Edit', "/admin/edit/#{post.path}" %></td>
|
17
|
-
<td><form method="post" action="/admin/delete/<%= post.path %>"><input type="submit" value="Delete"/></form></td>
|
18
|
-
</tr>
|
19
|
-
<% end %>
|
20
|
-
</table>
|
21
|
-
|
22
|
-
<%= render '_pagination.rhtml', :list => @posts, :page => @page, :page_size => @page_size, :path => '/admin/posts' %>
|
23
|
-
|
24
|
-
<hr/>
|