public: add minimalistic styling (#6218)

This commit is contained in:
Frédéric Péters 2014-12-30 14:23:36 +01:00
parent 198e5699e1
commit ac28c3eff2
5 changed files with 116 additions and 36 deletions

View File

@ -121,6 +121,10 @@ class CellBase(models.Model):
def get_verbose_name(cls):
return cls._meta.verbose_name
@property
def css_class_name(self):
return self.__class__.__name__.lower()
@classmethod
def get_cell_content_types(cls):
content_types = []

View File

@ -0,0 +1,89 @@
html, body {
margin: 0;
font-family: serif;
}
div#title {
background: linear-gradient(to bottom, #0036f1 5%, #0078ff 30%) top right no-repeat;
color: white;
font-family: sans-serif;
position: relative;
}
div#title:before {
content: "Combo";
position: absolute;
font-size: 300%;
right: 0;
bottom: -0.45ex;
color: #0068ef;
font-weight: bold;
}
div#title h1 {
font-size: 300%;
margin: 0;
padding: 0.5ex 1ex 0.5ex 1ex;
text-shadow: black 0px -1px 2px;
}
div.fortunecell {
position: relative;
margin: 20px auto;
width: 80%;
background: #eee;
min-height: 5em;
}
div.fortunecell div {
padding: 2em 4em 1em 4em;
font-size: 110%;
}
div.fortunecell:before {
position: absolute;
content: "« ";
top: -1ex;
font-size: 500%;
color: #444;
}
div.fortunecell:after {
color: #444;
position: absolute;
bottom: -1ex;
right: 0;
content: " »";
font-size: 500%;
}
div.textcell {
margin: 1em;
text-align: justify;
}
#content {
position: relative;
margin-bottom: 5em;
}
#footer {
background: #333;
color: white;
padding: 1em 0;
position: fixed;
bottom: 0;
width: 100%;
}
div#main-content {
margin-right: 20%;
padding: 1em 0;
}
div#sidebar {
position: absolute;
right: 0;
top: 0em;
width: 20%;
}

View File

@ -2,13 +2,18 @@
<html>
<head>
<meta charset="utf-8"/>
<title>Combo</title>
<title>Combo - {{ page.title }}</title>
<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/combo-style.css"/>
</head>
<body>
<h1>{{ page.title }}</h1>
<body class="page-{{ page.slug }}">
<div id="title"><h1>{{ page.title }}</h1></div>
<div id="content">
{% block combo-content %}
{% placeholder "content" %}
<hr/>
{% endblock %}
</div>
<div id="footer">
{% placeholder "footer" %}
</div>
</body>
</html>

View File

@ -1,30 +1,12 @@
{% load combo %}<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Combo</title>
<style>
div#content {
margin-right: 20%;
}
div#sidebar {
position: absolute;
right: 0;
top: 2em;
width: 20%;
}
</style>
</head>
<body>
<h1>{{ page.title }}</h1>
<div id="content">
{% placeholder "content" %}
</div>
<div id="sidebar">
<h2>Sidebar</h2>
{% placeholder "sidebar" %}
</div>
<hr/>
{% placeholder "footer" %}
</body>
</html>
{% extends "combo/page_template.html" %}
{% load combo %}
{% block combo-content %}
<div id="main-content">
{% placeholder "content" %}
</div>
<div id="sidebar">
<h2>Sidebar</h2>
{% placeholder "sidebar" %}
</div>
{% endblock %}

View File

@ -1,4 +1,4 @@
{% load combo %}
{% for cell in cells %}
<div>{% render_cell cell %}</div>
<div class="{{ cell.css_class_name }}"><div>{% render_cell cell %}</div></div>
{% endfor %}