Browse Source

Style a bit cabaret

pull/8/head
Florian Mounier 12 years ago
parent
commit
830ec6f48d
  1. 9
      demo/cabaret/static/css.css
  2. 10
      demo/cabaret/templates/_layout.jinja2
  3. 6
      demo/cabaret/templates/index.jinja2
  4. 6
      pygal/config.py

9
demo/cabaret/static/css.css

@ -21,3 +21,12 @@ figure svg {
-moz-transition: all 500ms ease-out;
transition: all 500ms ease-out;
}
.side {
min-width: 400px;
}
label {
font-variant: small-caps;
color: #777;
}

10
demo/cabaret/templates/_layout.jinja2

@ -8,7 +8,7 @@
<script type="text/javascript" src="https://raw.github.com/Kozea/pygal.js/master/pygal-tooltips.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js.js') }}"></script>
<link rel="stylesheet" href="{{ url_for('static', filename='components/bootstrap/docs/assets/css/bootstrap.css') }}" type="text/css" />
<link rel="stylesheet" href="{{ url_for('static', filename='components/bootstrap/docs/assets/css/bootstrap-responsive.css') }}" type="text/css" />
{# <link rel="stylesheet" href="{{ url_for('static', filename='components/bootstrap/docs/assets/css/bootstrap-responsive.css') }}" type="text/css" /> #}
<link rel="stylesheet" href="{{ url_for('static', filename='css.css') }}" type="text/css" />
</head>
<body>
@ -27,11 +27,9 @@
<div class="container-fluid">
<div class="row-fluid">
<div class="span4">
<div class="">
{% block side %}
{% endblock side %}
</div>
<div class="side span4">
{% block side %}
{% endblock side %}
</div>
<div class="span8">
{% block section %}

6
demo/cabaret/templates/index.jinja2

@ -1,16 +1,17 @@
{% extends '_layout.jinja2' %}
{% block side %}
<form class="form-horizontal">
<form class="form">
<div class="tabbable tabs-left">
<ul class="nav nav-tabs">
<li class="active"><a href="#main" data-toggle="tab">Main</a></li>
{% for group in configs[0].categories if group != 'Style' %}
{% for group in configs[0]._categories if group != 'Style' %}
<li><a href="#{{ group }}" data-toggle="tab">{{ group }}</a></li>
{% endfor %}
</ul>
<div class="tab-content">
<div class="tab-pane active" id="main">
<legend>Main</legend>
<div class="control-group tt" title="Chose the chart type">
<label class="control-label" for="type">Type</label>
<div class="controls">
@ -46,6 +47,7 @@
{% for group, keys in configs | groupby('category') %}
<div class="tab-pane" id="{{ group }}">
<legend>{{ group }}</legend>
{% for key in keys if key.name not in ['js', 'css', 'style'] %}
{% set doc = 'title="' + key.doc + ' <br /><small>' + key.subdoc + '</small>"' %}
<div class="control-group tt" {{ doc }}>

6
pygal/config.py

@ -32,7 +32,7 @@ CONFIG_ITEMS = []
class Key(object):
categories = []
_categories = []
def __init__(
self, default_value, type_, category, doc,
@ -45,8 +45,8 @@ class Key(object):
self.subdoc = subdoc
self.subtype = subtype
self.name = "Unbound"
if not category in self.categories:
self.categories.append(category)
if not category in self._categories:
self._categories.append(category)
CONFIG_ITEMS.append(self)

Loading…
Cancel
Save