setup api, core and frontend apps, also added initial homepage template from stefan
|
@ -0,0 +1,2 @@
|
||||||
|
*.db
|
||||||
|
*.pyc
|
22
README.md
|
@ -1,2 +1,24 @@
|
||||||
regluit
|
regluit
|
||||||
|
=======
|
||||||
|
|
||||||
|
A 'monolithic' alternative to [unglu](http://github.com/gluejar/unglu)
|
||||||
|
for the unglue.it website. It's just one code base that can be deployed
|
||||||
|
to as many ec2 instances as needed to support traffic.
|
||||||
|
|
||||||
|
Develop
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
Here are some instructions for setting up regluit for development on
|
||||||
|
an Ubuntu system:
|
||||||
|
|
||||||
|
1. `aptitude install python-setuptools`
|
||||||
|
1. `sudo easy_install virtualenv virtualenvwrapper`
|
||||||
|
1. `git clone git@github.com:Gluejar/regluit.git`
|
||||||
|
1. `cd reglueit`
|
||||||
|
1. `mkvirtualenv --no-site-packages regluit`
|
||||||
|
1. `pip install -r requirements.pip`
|
||||||
|
1. `add2virtualenv ..`
|
||||||
|
1. `echo 'export DJANGO_SETTINGS_MODULE=regluit.settings.dev' >> ~/.virtualenvs/regluit/bin/postactivate`
|
||||||
|
1. `deactivate ; workon regluit`
|
||||||
|
1. `django-admin.py syncdb --migrate`
|
||||||
|
1. `django-admin runserver`
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
"""
|
||||||
|
This file demonstrates two different styles of tests (one doctest and one
|
||||||
|
unittest). These will both pass when you run "manage.py test".
|
||||||
|
|
||||||
|
Replace these with more appropriate tests for your application.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
class SimpleTest(TestCase):
|
||||||
|
def test_basic_addition(self):
|
||||||
|
"""
|
||||||
|
Tests that 1 + 1 always equals 2.
|
||||||
|
"""
|
||||||
|
self.failUnlessEqual(1 + 1, 2)
|
||||||
|
|
||||||
|
__test__ = {"doctest": """
|
||||||
|
Another way to test that 1 + 1 is equal to 2.
|
||||||
|
|
||||||
|
>>> 1 + 1 == 2
|
||||||
|
True
|
||||||
|
"""}
|
||||||
|
|
|
@ -0,0 +1,121 @@
|
||||||
|
# encoding: utf-8
|
||||||
|
import datetime
|
||||||
|
from south.db import db
|
||||||
|
from south.v2 import SchemaMigration
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
class Migration(SchemaMigration):
|
||||||
|
|
||||||
|
def forwards(self, orm):
|
||||||
|
|
||||||
|
# Adding model 'Campaign'
|
||||||
|
db.create_table('core_campaign', (
|
||||||
|
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||||
|
('name', self.gf('django.db.models.fields.CharField')(max_length=500)),
|
||||||
|
('description', self.gf('django.db.models.fields.CharField')(max_length=10000)),
|
||||||
|
('target', self.gf('django.db.models.fields.FloatField')()),
|
||||||
|
('deadline', self.gf('django.db.models.fields.DateTimeField')()),
|
||||||
|
('paypal_receiver', self.gf('django.db.models.fields.CharField')(max_length=100, null=True)),
|
||||||
|
('amazon_receiver', self.gf('django.db.models.fields.CharField')(max_length=100, null=True)),
|
||||||
|
('work', self.gf('django.db.models.fields.related.ForeignKey')(related_name='campaign', to=orm['core.Work'])),
|
||||||
|
))
|
||||||
|
db.send_create_signal('core', ['Campaign'])
|
||||||
|
|
||||||
|
# Adding model 'Work'
|
||||||
|
db.create_table('core_work', (
|
||||||
|
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||||
|
('title', self.gf('django.db.models.fields.CharField')(max_length=1000)),
|
||||||
|
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
|
||||||
|
))
|
||||||
|
db.send_create_signal('core', ['Work'])
|
||||||
|
|
||||||
|
# Adding model 'Edition'
|
||||||
|
db.create_table('core_edition', (
|
||||||
|
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||||
|
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
|
||||||
|
('title', self.gf('django.db.models.fields.CharField')(max_length=1000)),
|
||||||
|
('publisher', self.gf('django.db.models.fields.CharField')(max_length=255)),
|
||||||
|
('year', self.gf('django.db.models.fields.CharField')(max_length=10)),
|
||||||
|
('work', self.gf('django.db.models.fields.related.ForeignKey')(related_name='editions', to=orm['core.Work'])),
|
||||||
|
))
|
||||||
|
db.send_create_signal('core', ['Edition'])
|
||||||
|
|
||||||
|
# Adding model 'Identifier'
|
||||||
|
db.create_table('core_identifier', (
|
||||||
|
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||||
|
('name', self.gf('django.db.models.fields.CharField')(max_length=10)),
|
||||||
|
('value', self.gf('django.db.models.fields.CharField')(max_length=500)),
|
||||||
|
('edition', self.gf('django.db.models.fields.related.ForeignKey')(related_name='identifiers', to=orm['core.Edition'])),
|
||||||
|
))
|
||||||
|
db.send_create_signal('core', ['Identifier'])
|
||||||
|
|
||||||
|
# Adding model 'Author'
|
||||||
|
db.create_table('core_author', (
|
||||||
|
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||||
|
('name', self.gf('django.db.models.fields.CharField')(max_length=500)),
|
||||||
|
('edition', self.gf('django.db.models.fields.related.ForeignKey')(related_name='authors', to=orm['core.Edition'])),
|
||||||
|
))
|
||||||
|
db.send_create_signal('core', ['Author'])
|
||||||
|
|
||||||
|
|
||||||
|
def backwards(self, orm):
|
||||||
|
|
||||||
|
# Deleting model 'Campaign'
|
||||||
|
db.delete_table('core_campaign')
|
||||||
|
|
||||||
|
# Deleting model 'Work'
|
||||||
|
db.delete_table('core_work')
|
||||||
|
|
||||||
|
# Deleting model 'Edition'
|
||||||
|
db.delete_table('core_edition')
|
||||||
|
|
||||||
|
# Deleting model 'Identifier'
|
||||||
|
db.delete_table('core_identifier')
|
||||||
|
|
||||||
|
# Deleting model 'Author'
|
||||||
|
db.delete_table('core_author')
|
||||||
|
|
||||||
|
|
||||||
|
models = {
|
||||||
|
'core.author': {
|
||||||
|
'Meta': {'object_name': 'Author'},
|
||||||
|
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'authors'", 'to': "orm['core.Edition']"}),
|
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||||
|
'name': ('django.db.models.fields.CharField', [], {'max_length': '500'})
|
||||||
|
},
|
||||||
|
'core.campaign': {
|
||||||
|
'Meta': {'object_name': 'Campaign'},
|
||||||
|
'amazon_receiver': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
|
||||||
|
'deadline': ('django.db.models.fields.DateTimeField', [], {}),
|
||||||
|
'description': ('django.db.models.fields.CharField', [], {'max_length': '10000'}),
|
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||||
|
'name': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
|
||||||
|
'paypal_receiver': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
|
||||||
|
'target': ('django.db.models.fields.FloatField', [], {}),
|
||||||
|
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'campaign'", 'to': "orm['core.Work']"})
|
||||||
|
},
|
||||||
|
'core.edition': {
|
||||||
|
'Meta': {'object_name': 'Edition'},
|
||||||
|
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||||
|
'publisher': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
|
||||||
|
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'editions'", 'to': "orm['core.Work']"}),
|
||||||
|
'year': ('django.db.models.fields.CharField', [], {'max_length': '10'})
|
||||||
|
},
|
||||||
|
'core.identifier': {
|
||||||
|
'Meta': {'object_name': 'Identifier'},
|
||||||
|
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'identifiers'", 'to': "orm['core.Edition']"}),
|
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||||
|
'name': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
|
||||||
|
'value': ('django.db.models.fields.CharField', [], {'max_length': '500'})
|
||||||
|
},
|
||||||
|
'core.work': {
|
||||||
|
'Meta': {'object_name': 'Work'},
|
||||||
|
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
complete_apps = ['core']
|
|
@ -0,0 +1,30 @@
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
class Campaign(models.Model):
|
||||||
|
name = models.CharField(max_length=500, null=False)
|
||||||
|
description = models.CharField(max_length=10000, null=False)
|
||||||
|
target = models.FloatField()
|
||||||
|
deadline = models.DateTimeField()
|
||||||
|
paypal_receiver = models.CharField(max_length=100, null=True)
|
||||||
|
amazon_receiver = models.CharField(max_length=100, null=True)
|
||||||
|
work = models.ForeignKey("Work", related_name="campaign")
|
||||||
|
|
||||||
|
class Work(models.Model):
|
||||||
|
title = models.CharField(max_length=1000)
|
||||||
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
|
class Edition(models.Model):
|
||||||
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
|
title = models.CharField(max_length=1000)
|
||||||
|
publisher = models.CharField(max_length=255)
|
||||||
|
year = models.CharField(max_length=10)
|
||||||
|
work = models.ForeignKey("Work", related_name="editions")
|
||||||
|
|
||||||
|
class Identifier(models.Model):
|
||||||
|
name = models.CharField(max_length=10)
|
||||||
|
value = models.CharField(max_length=500)
|
||||||
|
edition = models.ForeignKey("Edition", related_name="identifiers")
|
||||||
|
|
||||||
|
class Author(models.Model):
|
||||||
|
name = models.CharField(max_length=500)
|
||||||
|
edition = models.ForeignKey("Edition", related_name="authors")
|
|
@ -0,0 +1,23 @@
|
||||||
|
"""
|
||||||
|
This file demonstrates two different styles of tests (one doctest and one
|
||||||
|
unittest). These will both pass when you run "manage.py test".
|
||||||
|
|
||||||
|
Replace these with more appropriate tests for your application.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
class SimpleTest(TestCase):
|
||||||
|
def test_basic_addition(self):
|
||||||
|
"""
|
||||||
|
Tests that 1 + 1 always equals 2.
|
||||||
|
"""
|
||||||
|
self.failUnlessEqual(1 + 1, 2)
|
||||||
|
|
||||||
|
__test__ = {"doctest": """
|
||||||
|
Another way to test that 1 + 1 is equal to 2.
|
||||||
|
|
||||||
|
>>> 1 + 1 == 2
|
||||||
|
True
|
||||||
|
"""}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
# Create your views here.
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
|
import socket
|
||||||
|
|
||||||
|
import django.core.handlers.wsgi
|
||||||
|
|
||||||
|
hostname = socket.gethostname()
|
||||||
|
os.environ['DJANGO_SETTING_MODULE'] = 'regluit.settigns_%s' % hostname
|
||||||
|
application = django.core.handlers.wsgi.WSGIHander()
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
|
@ -0,0 +1,344 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>unglue.it</title>
|
||||||
|
<link type="text/css" rel="stylesheet" href="/static/css/layout.css" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="js-page-wrap">
|
||||||
|
<div id="js-header">
|
||||||
|
<div class="js-main">
|
||||||
|
<div class="js-logo">
|
||||||
|
<a href="index.html"><img src="/static/images/logo.png" alt="unglue.it" title="unglue.it" /></a>
|
||||||
|
</div>
|
||||||
|
<div class="js-topmenu">
|
||||||
|
<ul class="menu">
|
||||||
|
<li class="first"><a href="#"><span>Sign In</span></a></li>
|
||||||
|
<li><a href="#"><span>Tour</span></a></li>
|
||||||
|
<li><a href="#"><span>FAQ’s</span></a></li>
|
||||||
|
<li><a href="#"><span>Help</span></a></li>
|
||||||
|
<li class="last"><a href="#"><span>sign up</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="js-topsection">
|
||||||
|
<div class="js-main">
|
||||||
|
<div class="js-topnews">
|
||||||
|
<div class="js-news-text">With your help we raise money to buy book rights. The unglued books are free to download, here.</div>
|
||||||
|
<div class="js-news-links"><a class="readon"><span>Learn more</span></a></div>
|
||||||
|
</div>
|
||||||
|
<div class="js-search">
|
||||||
|
<div class="js-search-inner">
|
||||||
|
<form action="">
|
||||||
|
<input type="text" onfocus="if (this.value=='Search for a book...') this.value='';" onblur="if (this.value=='') this.value='Search for a book...';" value="Search for a book..." size="30" class="inputbox" maxlength="200" id="ssearchword" name="searchword">
|
||||||
|
<input type="button" onclick="this.form.searchword.focus();" class="button" value="Search">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="main-container">
|
||||||
|
<div class="js-main">
|
||||||
|
<div id="js-leftcol">
|
||||||
|
<div class="jsmodule">
|
||||||
|
<h3 class="jsmod-title"><span>Explore</span></h3>
|
||||||
|
<div class="jsmod-content">
|
||||||
|
<ul class="menu level1">
|
||||||
|
<li class="first parent">
|
||||||
|
<a href="#"><span>Show me...</span></a>
|
||||||
|
<ul class="menu level2">
|
||||||
|
<li class="first"><a href="#"><span>Recommended</span></a></li>
|
||||||
|
<li><a href="#"><span>Popular</span></a></li>
|
||||||
|
<li><a href="#"><span>Almost unglued</span></a></li>
|
||||||
|
<li><a href="#"><span>Recently unglued</span></a></li>
|
||||||
|
<li><a href="#"><span>Ending Soon</span></a></li>
|
||||||
|
<li class="last"><a href="#"><span>Just Listed</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="parent">
|
||||||
|
<a href="#"><span>Show me...</span></a>
|
||||||
|
<ul class="menu level2">
|
||||||
|
<li class="first"><a href="#"><span>Recommended</span></a></li>
|
||||||
|
<li><a href="#"><span>Popular</span></a></li>
|
||||||
|
<li><a href="#"><span>Almost unglued</span></a></li>
|
||||||
|
<li><a href="#"><span>Recently unglued</span></a></li>
|
||||||
|
<li><a href="#"><span>Ending Soon</span></a></li>
|
||||||
|
<li class="last"><a href="#"><span>Just Listed</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="js-maincol-fr">
|
||||||
|
<div class="js-maincol-inner">
|
||||||
|
<div class="content-block">
|
||||||
|
<div class="content-block-heading">
|
||||||
|
<h2 class="content-heading">Currently being <span>unglued</span></h2>
|
||||||
|
<a class="block-link">See all books</a>
|
||||||
|
</div>
|
||||||
|
<div class="content-block-content">
|
||||||
|
<div class="row row1 cols3">
|
||||||
|
<div class="column column-left">
|
||||||
|
<div class="item item1">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book1.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 99%
|
||||||
|
<span class="status percent99"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item item2">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book4.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
<span class="book-new">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 7%
|
||||||
|
<span class="status percent7"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="column column-center">
|
||||||
|
<div class="item item1">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book2.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 60%
|
||||||
|
<span class="status percent60"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item item2">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book5.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 62%
|
||||||
|
<span class="status percent62"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="column column-right">
|
||||||
|
<div class="item item1">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book3.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 22%
|
||||||
|
<span class="status percent22"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item item2">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book6.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 21%
|
||||||
|
<span class="status percent21"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="content-block">
|
||||||
|
<div class="content-block-heading">
|
||||||
|
<h2 class="content-heading">Most popular</h2>
|
||||||
|
<a class="block-link">See all books</a>
|
||||||
|
</div>
|
||||||
|
<div class="content-block-content">
|
||||||
|
<div class="row row1 cols3">
|
||||||
|
<div class="column column-left">
|
||||||
|
<div class="item item1">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book1.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 99%
|
||||||
|
<span class="status percent99"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item item2">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book4.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
<span class="book-new">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 7%
|
||||||
|
<span class="status percent7"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="column column-center">
|
||||||
|
<div class="item item1">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book2.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 60%
|
||||||
|
<span class="status percent60"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item item2">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book5.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 62%
|
||||||
|
<span class="status percent62"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="column column-right">
|
||||||
|
<div class="item item1">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book3.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 22%
|
||||||
|
<span class="status percent22"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item item2">
|
||||||
|
<div class="book-image">
|
||||||
|
<img src="/static/images/images/book6.png" align="" title="" />
|
||||||
|
</div>
|
||||||
|
<div class="book-info">
|
||||||
|
<div class="book-name">
|
||||||
|
Nineteen Eighty-Four
|
||||||
|
</div>
|
||||||
|
<div class="book-author">
|
||||||
|
George Orwell
|
||||||
|
Penguin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="book-status">
|
||||||
|
<span class="unglue">unglue</span> status 21%
|
||||||
|
<span class="status percent21"> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,23 @@
|
||||||
|
"""
|
||||||
|
This file demonstrates two different styles of tests (one doctest and one
|
||||||
|
unittest). These will both pass when you run "manage.py test".
|
||||||
|
|
||||||
|
Replace these with more appropriate tests for your application.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
class SimpleTest(TestCase):
|
||||||
|
def test_basic_addition(self):
|
||||||
|
"""
|
||||||
|
Tests that 1 + 1 always equals 2.
|
||||||
|
"""
|
||||||
|
self.failUnlessEqual(1 + 1, 2)
|
||||||
|
|
||||||
|
__test__ = {"doctest": """
|
||||||
|
Another way to test that 1 + 1 is equal to 2.
|
||||||
|
|
||||||
|
>>> 1 + 1 == 2
|
||||||
|
True
|
||||||
|
"""}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
from django.conf.urls.defaults import *
|
||||||
|
|
||||||
|
urlpatterns = patterns(
|
||||||
|
"regluit.frontend.views",
|
||||||
|
url(r"^$", "home", name="home"),
|
||||||
|
)
|
|
@ -0,0 +1,4 @@
|
||||||
|
from django.shortcuts import render_to_response
|
||||||
|
|
||||||
|
def home(request):
|
||||||
|
return render_to_response('home.html')
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
from django.core.management import execute_manager
|
||||||
|
try:
|
||||||
|
import settings # Assumed to be in the same directory.
|
||||||
|
except ImportError:
|
||||||
|
import sys
|
||||||
|
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
execute_manager(settings)
|
|
@ -0,0 +1,4 @@
|
||||||
|
django
|
||||||
|
south
|
||||||
|
django-extensions
|
||||||
|
django-tastypie
|
|
@ -0,0 +1,118 @@
|
||||||
|
from os.path import dirname, realpath, join
|
||||||
|
|
||||||
|
PROJECT_DIR = dirname(dirname(realpath(__file__)))
|
||||||
|
|
||||||
|
LANGUAGE_CODE = 'en-us'
|
||||||
|
|
||||||
|
SITE_ID = 1
|
||||||
|
|
||||||
|
# If you set this to False, Django will make some optimizations so as not
|
||||||
|
# to load the internationalization machinery.
|
||||||
|
USE_I18N = True
|
||||||
|
|
||||||
|
# If you set this to False, Django will not format dates, numbers and
|
||||||
|
# calendars according to the current locale
|
||||||
|
USE_L10N = True
|
||||||
|
|
||||||
|
# Absolute filesystem path to the directory that will hold user-uploaded files.
|
||||||
|
# Example: "/home/media/media.lawrence.com/media/"
|
||||||
|
MEDIA_ROOT = ''
|
||||||
|
|
||||||
|
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
||||||
|
# trailing slash.
|
||||||
|
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
|
||||||
|
MEDIA_URL = ''
|
||||||
|
|
||||||
|
# Absolute path to the directory static files should be collected to.
|
||||||
|
# Don't put anything in this directory yourself; store your static files
|
||||||
|
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
|
||||||
|
# Example: "/home/media/media.lawrence.com/static/"
|
||||||
|
STATIC_ROOT = ''
|
||||||
|
|
||||||
|
# URL prefix for static files.
|
||||||
|
# Example: "http://media.lawrence.com/static/"
|
||||||
|
STATIC_URL = '/static/'
|
||||||
|
|
||||||
|
# URL prefix for admin static files -- CSS, JavaScript and images.
|
||||||
|
# Make sure to use a trailing slash.
|
||||||
|
# Examples: "http://foo.com/static/admin/", "/static/admin/".
|
||||||
|
ADMIN_MEDIA_PREFIX = '/static/admin/'
|
||||||
|
|
||||||
|
# Additional locations of static files
|
||||||
|
STATICFILES_DIRS = (
|
||||||
|
join(PROJECT_DIR, 'static'),
|
||||||
|
# Put strings here, like "/home/html/static" or "C:/www/django/static".
|
||||||
|
# Always use forward slashes, even on Windows.
|
||||||
|
# Don't forget to use absolute paths, not relative paths.
|
||||||
|
)
|
||||||
|
|
||||||
|
# List of finder classes that know how to find static files in
|
||||||
|
# various locations.
|
||||||
|
STATICFILES_FINDERS = (
|
||||||
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||||
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||||
|
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
||||||
|
)
|
||||||
|
|
||||||
|
# Make this unique, and don't share it with anybody.
|
||||||
|
SECRET_KEY = 'a+bo0@3$n18e(newe7og6hmq$r#bkib73z(+s*n25%6q3+22jo'
|
||||||
|
|
||||||
|
# List of callables that know how to import templates from various sources.
|
||||||
|
TEMPLATE_LOADERS = (
|
||||||
|
'django.template.loaders.filesystem.Loader',
|
||||||
|
'django.template.loaders.app_directories.Loader',
|
||||||
|
# 'django.template.loaders.eggs.Loader',
|
||||||
|
)
|
||||||
|
|
||||||
|
MIDDLEWARE_CLASSES = (
|
||||||
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
|
)
|
||||||
|
|
||||||
|
ROOT_URLCONF = 'regluit.urls'
|
||||||
|
|
||||||
|
TEMPLATE_DIRS = (
|
||||||
|
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
||||||
|
# Always use forward slashes, even on Windows.
|
||||||
|
# Don't forget to use absolute paths, not relative paths.
|
||||||
|
)
|
||||||
|
|
||||||
|
INSTALLED_APPS = (
|
||||||
|
'django.contrib.auth',
|
||||||
|
'django.contrib.contenttypes',
|
||||||
|
'django.contrib.sessions',
|
||||||
|
'django.contrib.sites',
|
||||||
|
'django.contrib.messages',
|
||||||
|
'django.contrib.staticfiles',
|
||||||
|
'south',
|
||||||
|
'django_extensions',
|
||||||
|
'regluit.frontend',
|
||||||
|
'regluit.api',
|
||||||
|
'regluit.core',
|
||||||
|
)
|
||||||
|
|
||||||
|
# A sample logging configuration. The only tangible logging
|
||||||
|
# performed by this configuration is to send an email to
|
||||||
|
# the site admins on every HTTP 500 error.
|
||||||
|
# See http://docs.djangoproject.com/en/dev/topics/logging for
|
||||||
|
# more details on how to customize your logging configuration.
|
||||||
|
LOGGING = {
|
||||||
|
'version': 1,
|
||||||
|
'disable_existing_loggers': False,
|
||||||
|
'handlers': {
|
||||||
|
'mail_admins': {
|
||||||
|
'level': 'ERROR',
|
||||||
|
'class': 'django.utils.log.AdminEmailHandler'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'loggers': {
|
||||||
|
'django.request': {
|
||||||
|
'handlers': ['mail_admins'],
|
||||||
|
'level': 'ERROR',
|
||||||
|
'propagate': True,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
from regluit.settings.common import *
|
||||||
|
|
||||||
|
DEBUG = True
|
||||||
|
TEMPLATE_DEBUG = DEBUG
|
||||||
|
|
||||||
|
ADMINS = (
|
||||||
|
# ('Your Name', 'your_email@domain.com'),
|
||||||
|
)
|
||||||
|
|
||||||
|
MANAGERS = ADMINS
|
||||||
|
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
|
'NAME': 'regluit.db',
|
||||||
|
'USER': '',
|
||||||
|
'PASSWORD': '',
|
||||||
|
'HOST': '',
|
||||||
|
'PORT': '',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TIME_ZONE = 'America/New_York'
|
||||||
|
SECRET_KEY = '_^_off!8zsj4+)%qq623m&$7_m-q$iau5le0w!mw&n5tgt#x=t'
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>Untitled Document</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,113 @@
|
||||||
|
@charset "utf-8";
|
||||||
|
/* CSS Document */
|
||||||
|
|
||||||
|
body{
|
||||||
|
background:url(../images/bg-body.png) 0 0 repeat-x;
|
||||||
|
padding:0 0 20px 0;
|
||||||
|
margin:0;
|
||||||
|
font-size:12px;
|
||||||
|
font-family: Lucida "Lucida Grande", "Lucida Sans Unicode", sans-serif, Helvetica, sans-serif;
|
||||||
|
color:#3d4e53;
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-main{
|
||||||
|
width:960px;
|
||||||
|
margin:0 auto;
|
||||||
|
clear:both;
|
||||||
|
padding:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#js-header{ height:90px;}
|
||||||
|
|
||||||
|
.js-logo{ float:left; padding-top:20px;}
|
||||||
|
.js-topmenu{ float:right; padding-top:25px;}
|
||||||
|
.js-topmenu ul li{ float:left; padding:0 10px;}
|
||||||
|
.js-topmenu ul li a{ height:36px; line-height:36px; display:block; color:#fff; text-decoration:none; font-weight:bold; font-size:13px; letter-spacing:1px; text-transform:capitalize;}
|
||||||
|
.js-topmenu ul li.last a{ background: url(../images/bg.png) right top no-repeat;}
|
||||||
|
.js-topmenu ul li.last a span{ background:url(../images/bg.png) -770px -36px no-repeat; margin-right:29px; display:block; padding:0 5px 0 15px;}
|
||||||
|
|
||||||
|
#js-topsection{ padding:15px 0; overflow:hidden;}
|
||||||
|
.js-topnews{ float:left; width:60%;}
|
||||||
|
.js-news-text{ float:left; width:70%; font-size:16px; color:#3d4e53; font-family:lucida grande;}
|
||||||
|
.js-news-links { float:right; width:30%;}
|
||||||
|
|
||||||
|
.js-search{ float:right; width:30%;}
|
||||||
|
.js-search-inner{ float:right;}
|
||||||
|
.js-search .inputbox{ padding:0 0 0 15px; margin:0; border:none; background:url(../images/bg.png) -645px -180px; height:36px; line-height:36px; float: left; color:#6994a3;}
|
||||||
|
.js-search .button{ background:url(../images/bg.png) 100% -144px no-repeat; padding:0; margin:0; width:40px; height:36px; display:block; border:none; text-indent:-10000px; cursor:pointer;}
|
||||||
|
|
||||||
|
|
||||||
|
#js-leftcol{ float:left; width:235px;}
|
||||||
|
h3.jsmod-title{ background:url(../images/bg.png) 0 0 no-repeat; padding:0; margin:0; height:73px;}
|
||||||
|
h3.jsmod-title span{ background:url(../images/icon-h3.png) 90% center no-repeat; font-size:17px; color:#fff;
|
||||||
|
padding:26px 40px 27px 20px;
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#js-leftcol .jsmod-content{ border:1px solid #edf3f4; margin-left:10px; border-radius:0 0 10px 10px ;}
|
||||||
|
|
||||||
|
#js-leftcol ul.level1 > li > a{ text-transform:uppercase; color:#3d4e53; font-size:12px; border-bottom:1px solid #edf3f4;border-top:1px solid #edf3f4; display:block; padding:10px;}
|
||||||
|
|
||||||
|
#js-leftcol ul.level2 li{
|
||||||
|
padding:5px 10px;
|
||||||
|
}
|
||||||
|
#js-leftcol ul.level2 li a{
|
||||||
|
color:#6994a3;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
#js-leftcol a{ font-weight:normal;}
|
||||||
|
#js-leftcol a:hover{ text-decoration:underline;}
|
||||||
|
|
||||||
|
|
||||||
|
#js-maincol-fr{ float:right; width:725px;}
|
||||||
|
|
||||||
|
div.content-block{
|
||||||
|
overflow:hidden;
|
||||||
|
background:url(../images/bg.png) 100% -223px no-repeat;
|
||||||
|
padding:0 0 0 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2.content-heading{
|
||||||
|
padding:15px; margin:0;
|
||||||
|
font-size:19px;
|
||||||
|
font-weight:normal;
|
||||||
|
color:#3d4e53;
|
||||||
|
float:left; width:70%;
|
||||||
|
}
|
||||||
|
h2.content-heading span{ font-style:italic;}
|
||||||
|
.content-block-heading a.block-link{ float:right; padding:15px; font-size:11px; color:#3d4e53; text-decoration:underline; font-weight:normal;}
|
||||||
|
|
||||||
|
div.content-block-content{ width:100%; overflow:hidden;}
|
||||||
|
div.content-block-content .cols3 .column{ width:33.33%; float:left;}
|
||||||
|
|
||||||
|
.column-left .item{ margin:0 10px 10px 0;}
|
||||||
|
.column-center .item{ margin:0 5px 10px 5px;}
|
||||||
|
.column-right .item{ margin:0 0 10px 10px;}
|
||||||
|
.column .item{ border:7px solid #edf3f4; padding:10px;}
|
||||||
|
.book-image{ padding:0 0 10px 0;}
|
||||||
|
.book-info{ padding:0 0 10px 0; line-height:125%; position:relative;}
|
||||||
|
.book-info span.book-new{ background:url(../images/images/icon-new.png) 0 0 no-repeat; width:38px; height:36px; display:block; position:absolute;
|
||||||
|
right:10px; top:0;}
|
||||||
|
.book-name{ color:#3d4e53; font-weight:bold;}
|
||||||
|
.book-author{ color:#6994a3;}
|
||||||
|
|
||||||
|
.book-status{ margin:0 -10px; border-top:1px solid #edf3f4; padding:15px 10px 0 10px; position:relative;}
|
||||||
|
.book-status span.unglue{ font-style:italic;}
|
||||||
|
.book-status span.status{ position:absolute; right:10px; bottom:-5px; width:37px; height:25px; display:block;}
|
||||||
|
.book-status span.percent99{ background:url(../images/images/icon-book1.png) 0 0 no-repeat;}
|
||||||
|
.book-status span.percent60{ background:url(../images/images/icon-book2.png) 0 0 no-repeat;}
|
||||||
|
.book-status span.percent22{ background:url(../images/images/icon-book3.png) 0 0 no-repeat;}
|
||||||
|
.book-status span.percent7{ background:url(../images/images/icon-book4.png) 0 0 no-repeat;}
|
||||||
|
.book-status span.percent62{ background:url(../images/images/icon-book5.png) 0 0 no-repeat;}
|
||||||
|
.book-status span.percent21{ background:url(../images/images/icon-book6.png) 0 0 no-repeat;}
|
||||||
|
|
||||||
|
ul.menu{
|
||||||
|
list-style:none;
|
||||||
|
padding:0;
|
||||||
|
margin:0;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
a.readon{ background:url(../images/bg.png) 100% -72px no-repeat; color:#fff; text-transform:capitalize; display:block; float:right; font-size:13px; font-weight:bold;}
|
||||||
|
a.readon span{ background:url(../images/bg.png) -770px -108px no-repeat; margin-right:34px; padding:0 5px 0 20px; height:36px; line-height:36px; display:block;}
|
||||||
|
|
||||||
|
a{ font-weight:bold; font-size:13px; text-decoration:none; cursor:pointer;}
|
After Width: | Height: | Size: 726 B |
After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 594 B |
After Width: | Height: | Size: 124 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 101 KiB |
After Width: | Height: | Size: 121 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 461 B |
After Width: | Height: | Size: 481 B |
After Width: | Height: | Size: 490 B |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 481 B |
After Width: | Height: | Size: 490 B |
After Width: | Height: | Size: 860 B |
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>Untitled Document</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>Untitled Document</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
After Width: | Height: | Size: 2.3 KiB |