nesta-plugin-admin 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.md +13 -0
- data/README.md +14 -4
- data/doc/Nesta.html +1 -1
- data/doc/Nesta/AdminScreens.html +1 -1
- data/doc/Nesta/App.html +1 -1
- data/doc/Nesta/Config.html +1 -1
- data/doc/Nesta/Page.html +10 -10
- data/doc/Nesta/Plugin.html +1 -1
- data/doc/Nesta/Plugin/Admin.html +51 -51
- data/doc/Nesta/Plugin/Admin/Helpers.html +2 -89
- data/doc/_index.html +1 -1
- data/doc/file.README.html +13 -3
- data/doc/index.html +13 -3
- data/doc/method_list.html +14 -22
- data/doc/top-level-namespace.html +1 -1
- data/lib/nesta-plugin-admin/init.rb +13 -14
- data/lib/nesta-plugin-admin/version.rb +1 -1
- data/views/layout.haml +2 -2
- metadata +2 -1
data/HISTORY.md
ADDED
data/README.md
CHANGED
@@ -4,10 +4,20 @@
|
|
4
4
|
|
5
5
|
An Admin interface for Nesta allowing currently allowing the following:
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
#### Note on the default admin interface
|
8
|
+
This is U-G-L-Y, as far as interfaces go. I am not an interface person.
|
9
|
+
If you would like a cleaner, prettier interface, feel free to fork and update.
|
10
|
+
If you do, please submit a pull request to me, I would like to make it better
|
11
|
+
looking.
|
12
|
+
|
13
|
+
You can override this in two ways.
|
14
|
+
|
15
|
+
First, locally by adding templates to APP_ROOT/views, to use this, you must add
|
16
|
+
"admin_from_local: true" to your config/config.yml file.
|
17
|
+
|
18
|
+
Second, via a theme by adding "admin_from_theme: true" to your config/config.yml
|
19
|
+
file.
|
20
|
+
|
11
21
|
|
12
22
|
### Current Features:
|
13
23
|
1. Create new pages.
|
data/doc/Nesta.html
CHANGED
@@ -110,7 +110,7 @@
|
|
110
110
|
</div>
|
111
111
|
|
112
112
|
<div id="footer">
|
113
|
-
Generated on Fri Aug 24
|
113
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
114
114
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
115
115
|
0.8.2.1 (ruby-1.9.3).
|
116
116
|
</div>
|
data/doc/Nesta/AdminScreens.html
CHANGED
@@ -114,7 +114,7 @@
|
|
114
114
|
</div>
|
115
115
|
|
116
116
|
<div id="footer">
|
117
|
-
Generated on Fri Aug 24
|
117
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
118
118
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
119
|
0.8.2.1 (ruby-1.9.3).
|
120
120
|
</div>
|
data/doc/Nesta/App.html
CHANGED
@@ -122,7 +122,7 @@
|
|
122
122
|
</div>
|
123
123
|
|
124
124
|
<div id="footer">
|
125
|
-
Generated on Fri Aug 24
|
125
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
126
126
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
127
127
|
0.8.2.1 (ruby-1.9.3).
|
128
128
|
</div>
|
data/doc/Nesta/Config.html
CHANGED
@@ -122,7 +122,7 @@
|
|
122
122
|
</div>
|
123
123
|
|
124
124
|
<div id="footer">
|
125
|
-
Generated on Fri Aug 24
|
125
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
126
126
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
127
127
|
0.8.2.1 (ruby-1.9.3).
|
128
128
|
</div>
|
data/doc/Nesta/Page.html
CHANGED
@@ -239,12 +239,12 @@ seemed to fix here within the context of the Page module.</p>
|
|
239
239
|
<pre class="lines">
|
240
240
|
|
241
241
|
|
242
|
+
235
|
242
243
|
236
|
243
|
-
237
|
244
|
-
238</pre>
|
244
|
+
237</pre>
|
245
245
|
</td>
|
246
246
|
<td>
|
247
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
247
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 235</span>
|
248
248
|
|
249
249
|
<span class='kw'>def</span> <span class='id identifier rubyid_format'>format</span>
|
250
250
|
<span class='ivar'>@format</span>
|
@@ -276,12 +276,12 @@ seemed to fix here within the context of the Page module.</p>
|
|
276
276
|
<pre class="lines">
|
277
277
|
|
278
278
|
|
279
|
+
240
|
279
280
|
241
|
280
|
-
242
|
281
|
-
243</pre>
|
281
|
+
242</pre>
|
282
282
|
</td>
|
283
283
|
<td>
|
284
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
284
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 240</span>
|
285
285
|
|
286
286
|
<span class='kw'>def</span> <span class='id identifier rubyid_path_for_admin'>path_for_admin</span>
|
287
287
|
<span class='kw'>return</span> <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>index</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
@@ -306,13 +306,13 @@ seemed to fix here within the context of the Page module.</p>
|
|
306
306
|
<pre class="lines">
|
307
307
|
|
308
308
|
|
309
|
+
236
|
309
310
|
237
|
310
311
|
238
|
311
|
-
239
|
312
|
-
240</pre>
|
312
|
+
239</pre>
|
313
313
|
</td>
|
314
314
|
<td>
|
315
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
315
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 236</span>
|
316
316
|
|
317
317
|
<span class='kw'>def</span> <span class='id identifier rubyid_title_for_admin'>title_for_admin</span>
|
318
318
|
<span class='id identifier rubyid_t'>t</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_title'>title</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> - </span><span class='embexpr_beg'>#{</span><span class='const'>Nesta</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_title'>title</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
@@ -328,7 +328,7 @@ seemed to fix here within the context of the Page module.</p>
|
|
328
328
|
</div>
|
329
329
|
|
330
330
|
<div id="footer">
|
331
|
-
Generated on Fri Aug 24
|
331
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
332
332
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
333
333
|
0.8.2.1 (ruby-1.9.3).
|
334
334
|
</div>
|
data/doc/Nesta/Plugin.html
CHANGED
@@ -108,7 +108,7 @@
|
|
108
108
|
</div>
|
109
109
|
|
110
110
|
<div id="footer">
|
111
|
-
Generated on Fri Aug 24
|
111
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
112
112
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
113
113
|
0.8.2.1 (ruby-1.9.3).
|
114
114
|
</div>
|
data/doc/Nesta/Plugin/Admin.html
CHANGED
@@ -104,7 +104,7 @@
|
|
104
104
|
<dt id="VERSION-constant" class="">VERSION =
|
105
105
|
|
106
106
|
</dt>
|
107
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.0.
|
107
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.0.3</span><span class='tstring_end'>"</span></span></pre></dd>
|
108
108
|
|
109
109
|
</dl>
|
110
110
|
|
@@ -378,12 +378,12 @@ plugin -- of which I may write.</p>
|
|
378
378
|
<pre class="lines">
|
379
379
|
|
380
380
|
|
381
|
-
|
382
|
-
|
383
|
-
|
381
|
+
88
|
382
|
+
89
|
383
|
+
90</pre>
|
384
384
|
</td>
|
385
385
|
<td>
|
386
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
386
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 88</span>
|
387
387
|
|
388
388
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_path'>path</span>
|
389
389
|
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_full_path'>full_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
@@ -419,17 +419,17 @@ plugin -- of which I may write.</p>
|
|
419
419
|
<pre class="lines">
|
420
420
|
|
421
421
|
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
422
|
+
137
|
423
|
+
138
|
424
|
+
139
|
425
|
+
140
|
426
|
+
141
|
427
|
+
142
|
428
|
+
143
|
429
|
+
144</pre>
|
430
430
|
</td>
|
431
431
|
<td>
|
432
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
432
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 137</span>
|
433
433
|
|
434
434
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_expire_caches'>expire_caches</span>
|
435
435
|
<span class='const'>Nesta</span><span class='op'>::</span><span class='const'>Page</span><span class='period'>.</span><span class='id identifier rubyid_purge_cache'>purge_cache</span>
|
@@ -504,21 +504,21 @@ plugin -- of which I may write.</p>
|
|
504
504
|
<pre class="lines">
|
505
505
|
|
506
506
|
|
507
|
+
123
|
508
|
+
124
|
509
|
+
125
|
510
|
+
126
|
511
|
+
127
|
512
|
+
128
|
513
|
+
129
|
514
|
+
130
|
515
|
+
131
|
507
516
|
132
|
508
517
|
133
|
509
|
-
134
|
510
|
-
135
|
511
|
-
136
|
512
|
-
137
|
513
|
-
138
|
514
|
-
139
|
515
|
-
140
|
516
|
-
141
|
517
|
-
142
|
518
|
-
143</pre>
|
518
|
+
134</pre>
|
519
519
|
</td>
|
520
520
|
<td>
|
521
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
521
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 123</span>
|
522
522
|
|
523
523
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_full_path'>full_path</span> <span class='id identifier rubyid_path'>path</span>
|
524
524
|
<span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_gsub!'>gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\/</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
@@ -563,12 +563,12 @@ plugin -- of which I may write.</p>
|
|
563
563
|
<pre class="lines">
|
564
564
|
|
565
565
|
|
566
|
-
|
567
|
-
|
568
|
-
|
566
|
+
101
|
567
|
+
102
|
568
|
+
103</pre>
|
569
569
|
</td>
|
570
570
|
<td>
|
571
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
571
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 101</span>
|
572
572
|
|
573
573
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_menu'>load_menu</span>
|
574
574
|
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_menu_path'>menu_path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>r</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
|
@@ -624,13 +624,13 @@ plugin -- of which I may write.</p>
|
|
624
624
|
<pre class="lines">
|
625
625
|
|
626
626
|
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
627
|
+
95
|
628
|
+
96
|
629
|
+
97
|
630
|
+
98</pre>
|
631
631
|
</td>
|
632
632
|
<td>
|
633
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
633
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 95</span>
|
634
634
|
|
635
635
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_raw'>load_raw</span> <span class='id identifier rubyid_path'>path</span>
|
636
636
|
<span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_full_path'>full_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
@@ -687,12 +687,12 @@ plugin -- of which I may write.</p>
|
|
687
687
|
<pre class="lines">
|
688
688
|
|
689
689
|
|
690
|
-
|
691
|
-
|
692
|
-
|
690
|
+
115
|
691
|
+
116
|
692
|
+
117</pre>
|
693
693
|
</td>
|
694
694
|
<td>
|
695
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
695
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 115</span>
|
696
696
|
|
697
697
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_menu_path'>menu_path</span>
|
698
698
|
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>menu.txt</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span> <span class='const'>Nesta</span><span class='op'>::</span><span class='const'>Env</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span><span class='comma'>,</span> <span class='const'>Nesta</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_content_path'>content_path</span> <span class='rparen'>)</span><span class='rparen'>)</span>
|
@@ -771,16 +771,16 @@ plugin -- of which I may write.</p>
|
|
771
771
|
<pre class="lines">
|
772
772
|
|
773
773
|
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
774
|
+
77
|
775
|
+
78
|
776
|
+
79
|
777
|
+
80
|
778
|
+
81
|
779
|
+
82
|
780
|
+
83</pre>
|
781
781
|
</td>
|
782
782
|
<td>
|
783
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
783
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 77</span>
|
784
784
|
|
785
785
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span>
|
786
786
|
<span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_gsub!'>gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\/</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
@@ -840,12 +840,12 @@ plugin -- of which I may write.</p>
|
|
840
840
|
<pre class="lines">
|
841
841
|
|
842
842
|
|
843
|
-
|
844
|
-
|
845
|
-
|
843
|
+
108
|
844
|
+
109
|
845
|
+
110</pre>
|
846
846
|
</td>
|
847
847
|
<td>
|
848
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line
|
848
|
+
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 108</span>
|
849
849
|
|
850
850
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_write_menu'>write_menu</span> <span class='id identifier rubyid_params'>params</span>
|
851
851
|
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_menu_path'>menu_path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>w</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>contents</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
@@ -860,7 +860,7 @@ plugin -- of which I may write.</p>
|
|
860
860
|
</div>
|
861
861
|
|
862
862
|
<div id="footer">
|
863
|
-
Generated on Fri Aug 24
|
863
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
864
864
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
865
865
|
0.8.2.1 (ruby-1.9.3).
|
866
866
|
</div>
|
@@ -102,31 +102,6 @@
|
|
102
102
|
<li class="public ">
|
103
103
|
<span class="summary_signature">
|
104
104
|
|
105
|
-
<a href="#admin_haml-instance_method" title="#admin_haml (instance method)">- (String) <strong>admin_haml</strong>(template, options = {}) </a>
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
</span>
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
<span class="summary_desc"><div class='inline'>
|
120
|
-
<p>Override standard haml call to include special view location for admin
|
121
|
-
templates.</p>
|
122
|
-
</div></span>
|
123
|
-
|
124
|
-
</li>
|
125
|
-
|
126
|
-
|
127
|
-
<li class="public ">
|
128
|
-
<span class="summary_signature">
|
129
|
-
|
130
105
|
<a href="#authorized%3F-instance_method" title="#authorized? (instance method)">- (Boolean) <strong>authorized?</strong> </a>
|
131
106
|
|
132
107
|
|
@@ -237,69 +212,7 @@ it's a middleware.</p>
|
|
237
212
|
|
238
213
|
|
239
214
|
<div class="method_details first">
|
240
|
-
<h3 class="signature first" id="
|
241
|
-
|
242
|
-
- (<tt>String</tt>) <strong>admin_haml</strong>(template, options = {})
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
</h3><div class="docstring">
|
249
|
-
<div class="discussion">
|
250
|
-
|
251
|
-
<p>Override standard haml call to include special view location for admin
|
252
|
-
templates.</p>
|
253
|
-
|
254
|
-
<p>This can be overriden by themes which contain admin.haml and/or edit.haml</p>
|
255
|
-
|
256
|
-
|
257
|
-
</div>
|
258
|
-
</div>
|
259
|
-
<div class="tags">
|
260
|
-
|
261
|
-
<p class="tag_title">Returns:</p>
|
262
|
-
<ul class="return">
|
263
|
-
|
264
|
-
<li>
|
265
|
-
|
266
|
-
|
267
|
-
<span class='type'>(<tt>String</tt>)</span>
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
—
|
272
|
-
<div class='inline'>
|
273
|
-
<p>rendered html from haml</p>
|
274
|
-
</div>
|
275
|
-
|
276
|
-
</li>
|
277
|
-
|
278
|
-
</ul>
|
279
|
-
|
280
|
-
</div><table class="source_code">
|
281
|
-
<tr>
|
282
|
-
<td>
|
283
|
-
<pre class="lines">
|
284
|
-
|
285
|
-
|
286
|
-
70
|
287
|
-
71
|
288
|
-
72</pre>
|
289
|
-
</td>
|
290
|
-
<td>
|
291
|
-
<pre class="code"><span class="info file"># File 'lib/nesta-plugin-admin/init.rb', line 70</span>
|
292
|
-
|
293
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_admin_haml'>admin_haml</span> <span class='id identifier rubyid_template'>template</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
|
294
|
-
<span class='id identifier rubyid_haml'>haml</span> <span class='id identifier rubyid_template'>template</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>views:</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>../../views</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='kw'>__FILE__</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
295
|
-
<span class='kw'>end</span></pre>
|
296
|
-
</td>
|
297
|
-
</tr>
|
298
|
-
</table>
|
299
|
-
</div>
|
300
|
-
|
301
|
-
<div class="method_details ">
|
302
|
-
<h3 class="signature " id="authorized?-instance_method">
|
215
|
+
<h3 class="signature first" id="authorized?-instance_method">
|
303
216
|
|
304
217
|
- (<tt>Boolean</tt>) <strong>authorized?</strong>
|
305
218
|
|
@@ -563,7 +476,7 @@ it's a middleware.</p>
|
|
563
476
|
</div>
|
564
477
|
|
565
478
|
<div id="footer">
|
566
|
-
Generated on Fri Aug 24
|
479
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
567
480
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
568
481
|
0.8.2.1 (ruby-1.9.3).
|
569
482
|
</div>
|
data/doc/_index.html
CHANGED
@@ -182,7 +182,7 @@
|
|
182
182
|
</div>
|
183
183
|
|
184
184
|
<div id="footer">
|
185
|
-
Generated on Fri Aug 24
|
185
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
186
186
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
187
187
|
0.8.2.1 (ruby-1.9.3).
|
188
188
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -67,10 +67,20 @@
|
|
67
67
|
|
68
68
|
<p>An Admin interface for Nesta allowing currently allowing the following:</p>
|
69
69
|
|
70
|
-
<
|
70
|
+
<h4>Note on the default admin interface</h4>
|
71
|
+
|
72
|
+
<p>This is U-G-L-Y, as far as interfaces go. I am not an interface person.
|
71
73
|
If you would like a cleaner, prettier interface, feel free to fork and update.
|
72
74
|
If you do, please submit a pull request to me, I would like to make it better
|
73
|
-
looking.</p
|
75
|
+
looking.</p>
|
76
|
+
|
77
|
+
<p>You can override this in two ways.</p>
|
78
|
+
|
79
|
+
<p>First, locally by adding templates to APP_ROOT/views, to use this, you must add
|
80
|
+
"admin_from_local: true" to your config/config.yml file.</p>
|
81
|
+
|
82
|
+
<p>Second, via a theme by adding "admin_from_theme: true" to your config/config.yml
|
83
|
+
file.</p>
|
74
84
|
|
75
85
|
<h3>Current Features:</h3>
|
76
86
|
|
@@ -151,7 +161,7 @@ looking.</p></blockquote>
|
|
151
161
|
</div></div>
|
152
162
|
|
153
163
|
<div id="footer">
|
154
|
-
Generated on Fri Aug 24
|
164
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
155
165
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
156
166
|
0.8.2.1 (ruby-1.9.3).
|
157
167
|
</div>
|
data/doc/index.html
CHANGED
@@ -67,10 +67,20 @@
|
|
67
67
|
|
68
68
|
<p>An Admin interface for Nesta allowing currently allowing the following:</p>
|
69
69
|
|
70
|
-
<
|
70
|
+
<h4>Note on the default admin interface</h4>
|
71
|
+
|
72
|
+
<p>This is U-G-L-Y, as far as interfaces go. I am not an interface person.
|
71
73
|
If you would like a cleaner, prettier interface, feel free to fork and update.
|
72
74
|
If you do, please submit a pull request to me, I would like to make it better
|
73
|
-
looking.</p
|
75
|
+
looking.</p>
|
76
|
+
|
77
|
+
<p>You can override this in two ways.</p>
|
78
|
+
|
79
|
+
<p>First, locally by adding templates to APP_ROOT/views, to use this, you must add
|
80
|
+
"admin_from_local: true" to your config/config.yml file.</p>
|
81
|
+
|
82
|
+
<p>Second, via a theme by adding "admin_from_theme: true" to your config/config.yml
|
83
|
+
file.</p>
|
74
84
|
|
75
85
|
<h3>Current Features:</h3>
|
76
86
|
|
@@ -151,7 +161,7 @@ looking.</p></blockquote>
|
|
151
161
|
</div></div>
|
152
162
|
|
153
163
|
<div id="footer">
|
154
|
-
Generated on Fri Aug 24
|
164
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
155
165
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
156
166
|
0.8.2.1 (ruby-1.9.3).
|
157
167
|
</div>
|
data/doc/method_list.html
CHANGED
@@ -47,14 +47,6 @@
|
|
47
47
|
|
48
48
|
|
49
49
|
<li class="r1 ">
|
50
|
-
<span class='object_link'><a href="Nesta/Plugin/Admin/Helpers.html#admin_haml-instance_method" title="Nesta::Plugin::Admin::Helpers#admin_haml (method)">#admin_haml</a></span>
|
51
|
-
|
52
|
-
<small>Nesta::Plugin::Admin::Helpers</small>
|
53
|
-
|
54
|
-
</li>
|
55
|
-
|
56
|
-
|
57
|
-
<li class="r2 ">
|
58
50
|
<span class='object_link'><a href="Nesta/Plugin/Admin/Helpers.html#authorized%3F-instance_method" title="Nesta::Plugin::Admin::Helpers#authorized? (method)">#authorized?</a></span>
|
59
51
|
|
60
52
|
<small>Nesta::Plugin::Admin::Helpers</small>
|
@@ -62,7 +54,7 @@
|
|
62
54
|
</li>
|
63
55
|
|
64
56
|
|
65
|
-
<li class="
|
57
|
+
<li class="r2 ">
|
66
58
|
<span class='object_link'><a href="Nesta/Plugin/Admin.html#delete-class_method" title="Nesta::Plugin::Admin.delete (method)">delete</a></span>
|
67
59
|
|
68
60
|
<small>Nesta::Plugin::Admin</small>
|
@@ -70,7 +62,7 @@
|
|
70
62
|
</li>
|
71
63
|
|
72
64
|
|
73
|
-
<li class="
|
65
|
+
<li class="r1 ">
|
74
66
|
<span class='object_link'><a href="Nesta/Plugin/Admin.html#expire_caches-class_method" title="Nesta::Plugin::Admin.expire_caches (method)">expire_caches</a></span>
|
75
67
|
|
76
68
|
<small>Nesta::Plugin::Admin</small>
|
@@ -78,7 +70,7 @@
|
|
78
70
|
</li>
|
79
71
|
|
80
72
|
|
81
|
-
<li class="
|
73
|
+
<li class="r2 ">
|
82
74
|
<span class='object_link'><a href="Nesta/Page.html#format-instance_method" title="Nesta::Page#format (method)">#format</a></span>
|
83
75
|
|
84
76
|
<small>Nesta::Page</small>
|
@@ -86,7 +78,7 @@
|
|
86
78
|
</li>
|
87
79
|
|
88
80
|
|
89
|
-
<li class="
|
81
|
+
<li class="r1 ">
|
90
82
|
<span class='object_link'><a href="Nesta/Plugin/Admin.html#full_path-class_method" title="Nesta::Plugin::Admin.full_path (method)">full_path</a></span>
|
91
83
|
|
92
84
|
<small>Nesta::Plugin::Admin</small>
|
@@ -94,7 +86,7 @@
|
|
94
86
|
</li>
|
95
87
|
|
96
88
|
|
97
|
-
<li class="
|
89
|
+
<li class="r2 ">
|
98
90
|
<span class='object_link'><a href="Nesta/Plugin/Admin.html#load_menu-class_method" title="Nesta::Plugin::Admin.load_menu (method)">load_menu</a></span>
|
99
91
|
|
100
92
|
<small>Nesta::Plugin::Admin</small>
|
@@ -102,7 +94,7 @@
|
|
102
94
|
</li>
|
103
95
|
|
104
96
|
|
105
|
-
<li class="
|
97
|
+
<li class="r1 ">
|
106
98
|
<span class='object_link'><a href="Nesta/Plugin/Admin.html#load_raw-class_method" title="Nesta::Plugin::Admin.load_raw (method)">load_raw</a></span>
|
107
99
|
|
108
100
|
<small>Nesta::Plugin::Admin</small>
|
@@ -110,7 +102,7 @@
|
|
110
102
|
</li>
|
111
103
|
|
112
104
|
|
113
|
-
<li class="
|
105
|
+
<li class="r2 ">
|
114
106
|
<span class='object_link'><a href="Nesta/Plugin/Admin/Helpers.html#local_stylesheet_link_tag-instance_method" title="Nesta::Plugin::Admin::Helpers#local_stylesheet_link_tag (method)">#local_stylesheet_link_tag</a></span>
|
115
107
|
|
116
108
|
<small>Nesta::Plugin::Admin::Helpers</small>
|
@@ -118,7 +110,7 @@
|
|
118
110
|
</li>
|
119
111
|
|
120
112
|
|
121
|
-
<li class="
|
113
|
+
<li class="r1 ">
|
122
114
|
<span class='object_link'><a href="Nesta/Plugin/Admin.html#menu_path-class_method" title="Nesta::Plugin::Admin.menu_path (method)">menu_path</a></span>
|
123
115
|
|
124
116
|
<small>Nesta::Plugin::Admin</small>
|
@@ -126,7 +118,7 @@
|
|
126
118
|
</li>
|
127
119
|
|
128
120
|
|
129
|
-
<li class="
|
121
|
+
<li class="r2 ">
|
130
122
|
<span class='object_link'><a href="Nesta/Page.html#path_for_admin-instance_method" title="Nesta::Page#path_for_admin (method)">#path_for_admin</a></span>
|
131
123
|
|
132
124
|
<small>Nesta::Page</small>
|
@@ -134,7 +126,7 @@
|
|
134
126
|
</li>
|
135
127
|
|
136
128
|
|
137
|
-
<li class="
|
129
|
+
<li class="r1 ">
|
138
130
|
<span class='object_link'><a href="Nesta/Plugin/Admin/Helpers.html#path_to-instance_method" title="Nesta::Plugin::Admin::Helpers#path_to (method)">#path_to</a></span>
|
139
131
|
|
140
132
|
<small>Nesta::Plugin::Admin::Helpers</small>
|
@@ -142,7 +134,7 @@
|
|
142
134
|
</li>
|
143
135
|
|
144
136
|
|
145
|
-
<li class="
|
137
|
+
<li class="r2 ">
|
146
138
|
<span class='object_link'><a href="Nesta/Plugin/Admin/Helpers.html#protected%21-instance_method" title="Nesta::Plugin::Admin::Helpers#protected! (method)">#protected!</a></span>
|
147
139
|
|
148
140
|
<small>Nesta::Plugin::Admin::Helpers</small>
|
@@ -150,7 +142,7 @@
|
|
150
142
|
</li>
|
151
143
|
|
152
144
|
|
153
|
-
<li class="
|
145
|
+
<li class="r1 ">
|
154
146
|
<span class='object_link'><a href="Nesta/Page.html#title_for_admin-instance_method" title="Nesta::Page#title_for_admin (method)">#title_for_admin</a></span>
|
155
147
|
|
156
148
|
<small>Nesta::Page</small>
|
@@ -158,7 +150,7 @@
|
|
158
150
|
</li>
|
159
151
|
|
160
152
|
|
161
|
-
<li class="
|
153
|
+
<li class="r2 ">
|
162
154
|
<span class='object_link'><a href="Nesta/Plugin/Admin.html#write-class_method" title="Nesta::Plugin::Admin.write (method)">write</a></span>
|
163
155
|
|
164
156
|
<small>Nesta::Plugin::Admin</small>
|
@@ -166,7 +158,7 @@
|
|
166
158
|
</li>
|
167
159
|
|
168
160
|
|
169
|
-
<li class="
|
161
|
+
<li class="r1 ">
|
170
162
|
<span class='object_link'><a href="Nesta/Plugin/Admin.html#write_menu-class_method" title="Nesta::Plugin::Admin.write_menu (method)">write_menu</a></span>
|
171
163
|
|
172
164
|
<small>Nesta::Plugin::Admin</small>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on Fri Aug 24
|
106
|
+
Generated on Fri Aug 24 13:14:36 2012 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.2.1 (ruby-1.9.3).
|
109
109
|
</div>
|
@@ -61,15 +61,6 @@ module Nesta
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
# Override standard haml call to include special view location for
|
65
|
-
# admin templates.
|
66
|
-
#
|
67
|
-
# This can be overriden by themes which contain admin.haml and/or edit.haml
|
68
|
-
#
|
69
|
-
# @return [String] rendered html from haml
|
70
|
-
def admin_haml template, options={}
|
71
|
-
haml template, { views: File.expand_path('../../views', File.dirname(__FILE__)) }.merge(options)
|
72
|
-
end
|
73
64
|
end
|
74
65
|
|
75
66
|
########################################################################
|
@@ -156,13 +147,21 @@ module Nesta
|
|
156
147
|
|
157
148
|
# Adding username and password to settings list.
|
158
149
|
class Config
|
159
|
-
@settings += %w[ username password ]
|
150
|
+
@settings += %w[ admin_from_local admin_from_theme username password ]
|
160
151
|
end
|
161
152
|
|
162
153
|
class AdminScreens < Sinatra::Base
|
163
154
|
register Sinatra::Cache
|
164
155
|
set :cache_enabled, false
|
165
156
|
|
157
|
+
if Nesta::Config.admin_from_theme
|
158
|
+
set :views, Nesta::Path.themes(Nesta::Config.theme, "views")
|
159
|
+
elsif Nesta::Config.admin_from_local
|
160
|
+
set :views, Nesta::Path.local("views")
|
161
|
+
else
|
162
|
+
set :views, File.expand_path("../../views", File.dirname(__FILE__))
|
163
|
+
end
|
164
|
+
|
166
165
|
helpers Nesta::Plugin::Admin::Helpers
|
167
166
|
|
168
167
|
before '/admin*' do
|
@@ -181,7 +180,7 @@ module Nesta
|
|
181
180
|
get '/admin/new' do
|
182
181
|
@action = "New Page"
|
183
182
|
@path, @content = nil
|
184
|
-
|
183
|
+
haml :edit
|
185
184
|
end
|
186
185
|
|
187
186
|
post '/admin/new' do
|
@@ -198,7 +197,7 @@ module Nesta
|
|
198
197
|
get '/admin' do
|
199
198
|
@action = "Pages"
|
200
199
|
@pages = Nesta::Page.find_all.sort { |a,b| a.title_for_admin <=> b.title_for_admin }
|
201
|
-
|
200
|
+
haml :admin
|
202
201
|
end
|
203
202
|
|
204
203
|
get '/admin/menu' do
|
@@ -206,7 +205,7 @@ module Nesta
|
|
206
205
|
@path = "menu"
|
207
206
|
@format = nil
|
208
207
|
@content = Nesta::Plugin::Admin.load_menu
|
209
|
-
|
208
|
+
haml :edit
|
210
209
|
end
|
211
210
|
|
212
211
|
post '/admin/menu' do
|
@@ -224,7 +223,7 @@ module Nesta
|
|
224
223
|
@action = "Edit Template"
|
225
224
|
@path = File.join(params[:splat])
|
226
225
|
@content, @format = Nesta::Plugin::Admin.load_raw @path
|
227
|
-
|
226
|
+
haml :edit
|
228
227
|
end
|
229
228
|
|
230
229
|
end
|
data/views/layout.haml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nesta-plugin-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -52,6 +52,7 @@ extra_rdoc_files: []
|
|
52
52
|
files:
|
53
53
|
- .gitignore
|
54
54
|
- Gemfile
|
55
|
+
- HISTORY.md
|
55
56
|
- LICENSE
|
56
57
|
- README.md
|
57
58
|
- Rakefile
|