Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 26a7a25

Browse files
committedMay 9, 2015
deprecate webapp and replace it with a Coil advert
closes #77 Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 75a2f72 commit 26a7a25

16 files changed

+15
-4061
lines changed
 

Diff for: ‎v7/webapp/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bottle
1+
coil

Diff for: ‎v7/webapp/static/js/epiceditor.js

-2,899
This file was deleted.

Diff for: ‎v7/webapp/static/js/epiceditor.min.js

-5
This file was deleted.

Diff for: ‎v7/webapp/static/js/jPages.min.js

-13
This file was deleted.

Diff for: ‎v7/webapp/static/themes/base/epiceditor.css

-70
This file was deleted.

Diff for: ‎v7/webapp/static/themes/editor/epic-dark.css

-13
This file was deleted.

Diff for: ‎v7/webapp/static/themes/editor/epic-light.css

-12
This file was deleted.

Diff for: ‎v7/webapp/static/themes/preview/bartik.css

-167
This file was deleted.

Diff for: ‎v7/webapp/static/themes/preview/github.css

-368
This file was deleted.

Diff for: ‎v7/webapp/static/themes/preview/preview-dark.css

-121
This file was deleted.

Diff for: ‎v7/webapp/templates/base.tpl

-87
This file was deleted.

Diff for: ‎v7/webapp/templates/delete_post.tpl

-7
This file was deleted.

Diff for: ‎v7/webapp/templates/edit_post.tpl

-60
This file was deleted.

Diff for: ‎v7/webapp/templates/index.tpl

-112
This file was deleted.

Diff for: ‎v7/webapp/webapp.plugin

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Name = webapp
33
Module = webapp
44

55
[Documentation]
6-
Author = Roberto Alsina
7-
Version = 0.1.1
8-
Website = http://plugins.getnikola.com/#webapp
9-
Description = Turn Nikola into a webapp
6+
Author = the Coil contributors
7+
Version = 9.9.9
8+
Website = http://coil.readthedocs.org/
9+
Description = Advertise Coil CMS

Diff for: ‎v7/webapp/webapp.py

+10-122
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3+
# Copyright © 2015 The Coil Contributors
34
# Copyright © 2014 Roberto Alsina
45

56
# Permission is hereby granted, free of charge, to any
@@ -25,27 +26,17 @@
2526
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2627

2728
from __future__ import print_function, unicode_literals
28-
import json
29-
import os
30-
import webbrowser
31-
32-
import bottle as b
33-
import mako
34-
3529
from nikola.plugin_categories import Command
3630

37-
_site = None
38-
31+
import webbrowser
3932

40-
def init_site():
41-
_site.scan_posts(really=True)
4233

4334

44-
class Webapp(Command):
35+
class WebAppCoilAdvertisement(Command):
4536

4637
name = "webapp"
47-
doc_usage = "[[-u] theme_name] | [[-u] -l]"
48-
doc_purpose = "install theme into current site"
38+
doc_usage = ""
39+
doc_purpose = "deprecated, use Coil CMS instead"
4940
cmd_options = [
5041
{
5142
'name': 'browser',
@@ -65,112 +56,9 @@ class Webapp(Command):
6556
]
6657

6758
def _execute(self, options, args):
68-
global _site
69-
_site = self.site
70-
init_site()
71-
port = options and options.get('port')
59+
print("Nikola WebApp is not available anymore. It has been replaced by Coil CMS.")
60+
print("Coil CMS is a full-featured CMS, ready to be used everywhere from small single-user sites environments to big corporate blogs.")
61+
print("The most basic setup does not require a database and can be done in 2 minutes.")
62+
print("Coil setup guide: http://coil.readthedocs.org/admin/setup/")
7263
if options and options.get('browser'):
73-
webbrowser.open('http://localhost:{0}'.format(port))
74-
b.run(host='localhost', port=port)
75-
76-
@staticmethod
77-
@b.route('/')
78-
def index():
79-
context = {}
80-
context['site'] = _site
81-
return render('index.tpl', context)
82-
83-
@staticmethod
84-
@b.route('/edit/<path:path>', method='POST')
85-
@b.route('/edit/<path:path>', method='GET')
86-
def edit(path):
87-
context = {'path': path}
88-
context['site'] = _site
89-
context['json'] = json
90-
post = None
91-
for p in _site.timeline:
92-
if p.source_path == path:
93-
post = p
94-
break
95-
if post is None:
96-
b.abort(404, "No such post or page")
97-
context['post'] = post
98-
return render('edit_post.tpl', context)
99-
100-
@staticmethod
101-
@b.route('/save/<path:path>', method='POST')
102-
def save(path):
103-
# FIXME insecure pending defnull/bottle#411
104-
context = {'path': path}
105-
context['site'] = _site
106-
post = None
107-
for p in _site.timeline:
108-
if p.source_path == path:
109-
post = p
110-
break
111-
if post is None:
112-
b.abort(404, "No such post")
113-
content = b.request.forms.pop('content').decode("utf8")
114-
post.compiler.create_post(post.source_path, content=content, onefile=True, is_page=False, **b.request.forms)
115-
init_site()
116-
b.redirect('/edit/' + path)
117-
118-
@staticmethod
119-
@b.route('/delete/<path:path>')
120-
def delete(path):
121-
context = {'path': path}
122-
context['site'] = _site
123-
post = None
124-
for p in _site.timeline:
125-
if p.source_path == path:
126-
post = p
127-
break
128-
if post is None:
129-
b.abort(404, "No such post")
130-
context['post'] = post
131-
return render('delete_post.tpl', context)
132-
133-
@staticmethod
134-
@b.route('/really_delete/<path:path>')
135-
def really_delete(path):
136-
# FIXME insecure pending defnull/bottle#411
137-
os.unlink(path)
138-
init_site()
139-
b.redirect('/')
140-
141-
@staticmethod
142-
@b.route('/static/<path:path>')
143-
def server_static(path):
144-
return b.static_file(path, root=os.path.join(os.path.dirname(__file__), 'static'))
145-
146-
@staticmethod
147-
@b.route('/new/post', method='POST')
148-
def new_post():
149-
title = b.request.forms['title']
150-
# So, let's create a post with that title, lumberjack style
151-
# FIXME but I am a lumberjack and I don't care.
152-
os.system("nikola new_post -t '{0}'".format(title))
153-
# reload post list and go to index
154-
init_site()
155-
b.redirect('/')
156-
157-
@staticmethod
158-
@b.route('/new/page', method='POST')
159-
def new_page():
160-
title = b.request.forms['title']
161-
# So, let's create a page with that title, lumberjack style
162-
# FIXME but I am a lumberjack and I don't care.
163-
os.system("nikola new_page -t '{0}'".format(title))
164-
# reload post list and go to index
165-
init_site()
166-
b.redirect('/')
167-
168-
lookup = mako.lookup.TemplateLookup(
169-
directories=os.path.join(os.path.dirname(__file__), 'templates'),
170-
output_encoding='utf-8')
171-
172-
173-
def render(template_name, context=None):
174-
if context is None:
175-
context = {}
176-
return lookup.get_template(template_name).render_unicode(**context)
64+
webbrowser.open('http://coil.readthedocs.org/admin/setup')

0 commit comments

Comments
 (0)
Please sign in to comment.