added registration templates
This commit is contained in:
parent
43ff76b4e4
commit
f1e712b8d7
|
@ -281,6 +281,14 @@ class Page(models.Model):
|
||||||
b.save()
|
b.save()
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
def deleteme(self):
|
||||||
|
pages_after = Page.objects.filter(article=self.article, page_no__gt=self.page_no)
|
||||||
|
for p in pages_after:
|
||||||
|
p.page_no = p.page_no - 1
|
||||||
|
p.save()
|
||||||
|
self.delete()
|
||||||
|
return
|
||||||
|
|
||||||
def get_dict(self, m):
|
def get_dict(self, m):
|
||||||
"""
|
"""
|
||||||
This function iterates through all boxes on the page and returns a Dict representation which the view converts to json to send to front-end.
|
This function iterates through all boxes on the page and returns a Dict representation which the view converts to json to send to front-end.
|
||||||
|
|
|
@ -137,7 +137,7 @@ def imagebox_crop(request):
|
||||||
}
|
}
|
||||||
return HttpResponse(json.dumps(r), mimetype="application/json")
|
return HttpResponse(json.dumps(r), mimetype="application/json")
|
||||||
|
|
||||||
|
|
||||||
def test_thumb(request):
|
def test_thumb(request):
|
||||||
f = File.objects.filter(type__mime__exact='jpg')[0]
|
f = File.objects.filter(type__mime__exact='jpg')[0]
|
||||||
r = {'path': 'media/images/original/facade.jpg'}
|
r = {'path': 'media/images/original/facade.jpg'}
|
||||||
|
@ -590,6 +590,22 @@ def new_page(request):
|
||||||
}
|
}
|
||||||
return HttpResponse(json.dumps(r), mimetype="application/json")
|
return HttpResponse(json.dumps(r), mimetype="application/json")
|
||||||
|
|
||||||
|
@login_required_json
|
||||||
|
def delete_page(request):
|
||||||
|
page = get_object_or_404_json(Page, id=request.GET['id'])
|
||||||
|
rev_id = saveRevision({
|
||||||
|
'box_id': 0,
|
||||||
|
'box_type': 'page',
|
||||||
|
'prop': 'delete_page',
|
||||||
|
'old_val': page.get_dict(1),
|
||||||
|
'new_val': '',
|
||||||
|
'uuid': request.GET['uuid']
|
||||||
|
})
|
||||||
|
r = {
|
||||||
|
'rev_id': rev_id
|
||||||
|
}
|
||||||
|
return HttpResponse(json.dumps(r), mimetype="application/json")
|
||||||
|
|
||||||
def issue_list(request):
|
def issue_list(request):
|
||||||
issues = Issue.objects.all().order_by('issue_no')
|
issues = Issue.objects.all().order_by('issue_no')
|
||||||
return render_to_response("issue_list.html", {'issues': issues})
|
return render_to_response("issue_list.html", {'issues': issues})
|
||||||
|
@ -605,6 +621,8 @@ def new_issue(request):
|
||||||
def edit_issue(request, id):
|
def edit_issue(request, id):
|
||||||
i = Issue.objects.get(pk=id)
|
i = Issue.objects.get(pk=id)
|
||||||
return render_to_response
|
return render_to_response
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
These are some views that I could think of that need to be created. Please add more.
|
These are some views that I could think of that need to be created. Please add more.
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ INSTALLED_APPS = (
|
||||||
# 'south',
|
# 'south',
|
||||||
'django.contrib.comments',
|
'django.contrib.comments',
|
||||||
'sorl.thumbnail',
|
'sorl.thumbnail',
|
||||||
'django_firefogg',
|
# 'django_firefogg',
|
||||||
)
|
)
|
||||||
|
|
||||||
#overwrite default settings with local settings
|
#overwrite default settings with local settings
|
||||||
|
|
26
edgware/templates/registration/login.html
Normal file
26
edgware/templates/registration/login.html
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% if form.errors %}
|
||||||
|
<p>Your username and password didn't match. Please try again.</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<form method="post" action="{% url django.contrib.auth.views.login %}">{% csrf_token %}
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>{{ form.username.label_tag }}</td>
|
||||||
|
<td>{{ form.username }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{{ form.password.label_tag }}</td>
|
||||||
|
<td>{{ form.password }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<input type="submit" value="login" />
|
||||||
|
<input type="hidden" name="next" value="{{ next }}" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
-e svn+http://code.djangoproject.com/svn/django/branches/releases/1.1.X/#egg=django
|
-e svn+http://code.djangoproject.com/svn/django/trunk/#egg=django
|
||||||
-e bzr+http://code.0xdb.org/python-oxdjango/#egg=python-oxdjango
|
-e bzr+http://code.0xdb.org/python-oxdjango/#egg=python-oxdjango
|
||||||
-e svn+http://django-tagging.googlecode.com/svn/trunk/#egg=tagging
|
-e svn+http://django-tagging.googlecode.com/svn/trunk/#egg=tagging
|
||||||
-e bzr+http://firefogg.org/dev/python-firefogg/#egg=python-firefogg
|
-e bzr+http://firefogg.org/dev/python-firefogg/#egg=python-firefogg
|
||||||
|
|
Loading…
Reference in New Issue
Block a user