Added an edit screen, removed and ignore generated files or data files.
This commit is contained in:
parent
1803fbe824
commit
e117bd5e58
6
.bzrignore
Normal file
6
.bzrignore
Normal file
@ -0,0 +1,6 @@
|
||||
data
|
||||
.eric4project
|
||||
ScribeEngine.e4p
|
||||
scribeengine.sqlite
|
||||
posts.sql
|
||||
*.egg-info
|
@ -1,10 +0,0 @@
|
||||
Metadata-Version: 1.0
|
||||
Name: ScribeEngine
|
||||
Version: 0.1dev
|
||||
Summary: UNKNOWN
|
||||
Home-page: UNKNOWN
|
||||
Author: UNKNOWN
|
||||
Author-email: UNKNOWN
|
||||
License: UNKNOWN
|
||||
Description: UNKNOWN
|
||||
Platform: UNKNOWN
|
@ -1,34 +0,0 @@
|
||||
MANIFEST.in
|
||||
README.txt
|
||||
setup.cfg
|
||||
setup.py
|
||||
ScribeEngine.egg-info/PKG-INFO
|
||||
ScribeEngine.egg-info/SOURCES.txt
|
||||
ScribeEngine.egg-info/dependency_links.txt
|
||||
ScribeEngine.egg-info/entry_points.txt
|
||||
ScribeEngine.egg-info/not-zip-safe
|
||||
ScribeEngine.egg-info/paster_plugins.txt
|
||||
ScribeEngine.egg-info/requires.txt
|
||||
ScribeEngine.egg-info/top_level.txt
|
||||
scribeengine/__init__.py
|
||||
scribeengine/websetup.py
|
||||
scribeengine/config/__init__.py
|
||||
scribeengine/config/deployment.ini_tmpl
|
||||
scribeengine/config/environment.py
|
||||
scribeengine/config/middleware.py
|
||||
scribeengine/config/routing.py
|
||||
scribeengine/controllers/__init__.py
|
||||
scribeengine/controllers/error.py
|
||||
scribeengine/lib/__init__.py
|
||||
scribeengine/lib/app_globals.py
|
||||
scribeengine/lib/base.py
|
||||
scribeengine/lib/helpers.py
|
||||
scribeengine/model/__init__.py
|
||||
scribeengine/model/meta.py
|
||||
scribeengine/public/bg.png
|
||||
scribeengine/public/favicon.ico
|
||||
scribeengine/public/index.html
|
||||
scribeengine/public/pylons-logo.gif
|
||||
scribeengine/tests/__init__.py
|
||||
scribeengine/tests/test_models.py
|
||||
scribeengine/tests/functional/__init__.py
|
@ -1 +0,0 @@
|
||||
|
@ -1,7 +0,0 @@
|
||||
|
||||
[paste.app_factory]
|
||||
main = scribeengine.config.middleware:make_app
|
||||
|
||||
[paste.app_install]
|
||||
main = pylons.util:PylonsInstaller
|
||||
|
@ -1 +0,0 @@
|
||||
|
@ -1,2 +0,0 @@
|
||||
PasteScript
|
||||
Pylons
|
@ -1,2 +0,0 @@
|
||||
Pylons>=0.9.7
|
||||
SQLAlchemy>=0.5
|
@ -1 +0,0 @@
|
||||
scribeengine
|
@ -42,7 +42,10 @@ class PostController(BaseController):
|
||||
|
||||
@authenticate(u'Edit My Posts')
|
||||
def edit(self, id=None):
|
||||
c.page_title = 'New Post'
|
||||
if id is None:
|
||||
h.redirect_to('/post/new')
|
||||
c.post = Session.query(Post).get(id)
|
||||
c.page_title = 'Edit Post: %s' % c.post.title
|
||||
return render(u'/post/edit.mako')
|
||||
|
||||
def edit_POST(self, id=None):
|
||||
|
@ -227,7 +227,7 @@ def authenticate(permission=None):
|
||||
session[u'redirect_url'] = request.environ[u'PATH_INFO']
|
||||
session.save()
|
||||
h.flash.set_message(u'You need to be logged in to do that.', u'error')
|
||||
h.redirect_to('/login')
|
||||
h.redirect_to('/admin/login')
|
||||
return decorator(validate)
|
||||
|
||||
|
||||
|
21
scribeengine/templates/post/edit.mako
Normal file
21
scribeengine/templates/post/edit.mako
Normal file
@ -0,0 +1,21 @@
|
||||
<%inherit file="/base.mako"/>
|
||||
<div class="post">
|
||||
<h2 class="title">Edit Post: ${c.post.title}</h2>
|
||||
<%include file="/errors.mako"/>
|
||||
<form id="post-new" action="${h.url_for('/post/edit/%s' % str(c.post.id))}" method="post">
|
||||
<fieldset>
|
||||
<div class="form-item">
|
||||
<!-- <label for="post-title">Title:</label> -->
|
||||
<input type="text" name="title" value="${c.post.title}" id="post-title" class="form-text" />
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<!-- <label for="post-body">Body:</label> -->
|
||||
<textarea name="body" id="post-body" class="form-textarea">${c.post.body}</textarea>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<input type="submit" name="action" value="Save Draft"/>
|
||||
<input type="submit" name="action" value="Save & Publish"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
@ -32,7 +32,7 @@ h3 {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
p, ul, ol {
|
||||
p, ul, ol, pre {
|
||||
margin-top: 1.8em;
|
||||
line-height: 180%;
|
||||
}
|
||||
@ -186,6 +186,14 @@ hr {
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.post pre {
|
||||
background-color: #191919;
|
||||
border: 1px solid #333333;
|
||||
font-family: Monaco, Lucida Typewriter, Courier New, monospace;
|
||||
margin-bottom: 0.5em;
|
||||
padding: 0.3em 0.5em;
|
||||
}
|
||||
|
||||
/* Sidebar */
|
||||
|
||||
#sidebar {
|
||||
|
Reference in New Issue
Block a user