Merge branch 'master' into feature/hostingpackages

* master:
  load Font Mfizz in base template head
  add userdb template tags
  add Font Mfizz from http://mfizz.com/oss/font-mfizz

merged docs/changelog.rst
This commit is contained in:
Jan Dittberner 2015-01-18 16:24:53 +01:00
commit 30aa09c0af
12 changed files with 1736 additions and 6 deletions

View file

@ -5,6 +5,8 @@ Changelog
* :feature:`-` implement new hostingpackages app to provide hosting package
templates, hosting options and customer hosting packages as well as customer
specific hosting package options
* :feature:`-` add template tags for database icons and human readable names in
:py:mod:`userdbs.templatetags.userdb`
* :release:`0.5.2 <2015-01-18>`
* :bug:`-` define proper allauth production settings with https and mandatory

View file

@ -23,8 +23,14 @@
.. automodule:: userdbs.models
:members:
:py:mod:`templatetags <userdbs.templatetags>`
---------------------------------------------
:py:mod:`views <userdbs.views>`
-------------------------------
.. automodule:: userdbs.templatetags
.. automodule:: userdbs.views
:py:mod:`userdb <userdbs.templatetags.userdb>`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: userdbs.templatetags.userdb
:members:

View file

@ -0,0 +1,318 @@
/*
* Font Mfizz v1.2
* Copyright 2013 Mfizz Inc, Joe Lauer
* MIT License
*
* Project: http://mfizz.com/oss/font-mfizz
*
* The font designed for technology and software geeks representing programming
* languages, operating systems, software engineering, and technology.
*
* Mfizz Inc
* Web: http://mfizz.com/
* Twitter: http://twitter.com/mfizz_inc
*
* Joe Lauer
* Web: http://lauer.bz/
* Twitter: http://twitter.com/jjlauer
*/
@font-face {
font-family: "FontMfizz";
src: url("font-mfizz.eot");
src: url("font-mfizz.eot?#iefix") format("embedded-opentype"),
url("font-mfizz.woff") format("woff"),
url("font-mfizz.ttf") format("truetype"),
url("font-mfizz.svg#font-mfizz") format("svg");
font-weight: normal;
font-style: normal;
}
.icon-microscope:before,
.icon-cplusplus:before,
.icon-wireless:before,
.icon-fire-alt:before,
.icon-mobile-device:before,
.icon-objc:before,
.icon-redhat:before,
.icon-freebsd:before,
.icon-heroku:before,
.icon-python:before,
.icon-java:before,
.icon-satellite:before,
.icon-debian:before,
.icon-grails:before,
.icon-c:before,
.icon-postgres:before,
.icon-database-alt2:before,
.icon-raspberrypi:before,
.icon-nginx:before,
.icon-ruby-on-rails:before,
.icon-redis:before,
.icon-scala:before,
.icon-gnome:before,
.icon-perl:before,
.icon-mysql:before,
.icon-fedora:before,
.icon-ghost:before,
.icon-google:before,
.icon-netbsd:before,
.icon-aws:before,
.icon-bomb:before,
.icon-looking:before,
.icon-ruby:before,
.icon-mysql-alt:before,
.icon-playframework-alt:before,
.icon-osx:before,
.icon-database:before,
.icon-database-alt:before,
.icon-shell:before,
.icon-script:before,
.icon-antenna:before,
.icon-coffee-bean:before,
.icon-scala-alt:before,
.icon-platter:before,
.icon-java-duke:before,
.icon-iphone:before,
.icon-script-alt:before,
.icon-google-alt:before,
.icon-haskell:before,
.icon-mariadb:before,
.icon-phone-retro:before,
.icon-phone-alt:before,
.icon-csharp:before,
.icon-php:before,
.icon-postgres-alt:before,
.icon-html:before,
.icon-mfizz:before,
.icon-apache:before,
.icon-hadoop:before,
.icon-ruby-on-rails-alt:before,
.icon-mobile-phone-broadcast:before,
.icon-css:before,
.icon-playframework:before,
.icon-clojure:before,
.icon-mobile-phone-alt:before,
.icon-suse:before,
.icon-java-bold:before,
.icon-nginx-alt:before,
.icon-nginx-alt2:before,
.icon-linux-mint:before,
.icon-dreamhost:before,
.icon-blackberry:before,
.icon-javascript:before,
.icon-ubuntu:before,
.icon-php-alt:before,
.icon-centos:before,
.icon-nodejs:before,
.icon-splatter:before,
.icon-3dprint:before,
.icon-line-graph:before,
.icon-cassandra:before,
.icon-solaris:before,
.icon-jetty:before,
.icon-tomcat:before,
.icon-oracle:before,
.icon-oracle-alt:before,
.icon-mssql:before,
.icon-google-developers:before,
.icon-google-code:before,
.icon-kde:before,
.icon-grails-alt:before {
font-family: "FontMfizz";
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
display: inline-block;
text-decoration: inherit;
}
.icon-microscope:before { content: "\f100"; }
.icon-cplusplus:before { content: "\f101"; }
.icon-wireless:before { content: "\f102"; }
.icon-fire-alt:before { content: "\f103"; }
.icon-mobile-device:before { content: "\f104"; }
.icon-objc:before { content: "\f105"; }
.icon-redhat:before { content: "\f106"; }
.icon-freebsd:before { content: "\f107"; }
.icon-heroku:before { content: "\f108"; }
.icon-python:before { content: "\f109"; }
.icon-java:before { content: "\f10a"; }
.icon-satellite:before { content: "\f10b"; }
.icon-debian:before { content: "\f10c"; }
.icon-grails:before { content: "\f10d"; }
.icon-c:before { content: "\f10e"; }
.icon-postgres:before { content: "\f10f"; }
.icon-database-alt2:before { content: "\f110"; }
.icon-raspberrypi:before { content: "\f111"; }
.icon-nginx:before { content: "\f112"; }
.icon-ruby-on-rails:before { content: "\f113"; }
.icon-redis:before { content: "\f114"; }
.icon-scala:before { content: "\f115"; }
.icon-gnome:before { content: "\f116"; }
.icon-perl:before { content: "\f117"; }
.icon-mysql:before { content: "\f118"; }
.icon-fedora:before { content: "\f119"; }
.icon-ghost:before { content: "\f11a"; }
.icon-google:before { content: "\f11b"; }
.icon-netbsd:before { content: "\f11c"; }
.icon-aws:before { content: "\f11d"; }
.icon-bomb:before { content: "\f11e"; }
.icon-looking:before { content: "\f11f"; }
.icon-ruby:before { content: "\f120"; }
.icon-mysql-alt:before { content: "\f121"; }
.icon-playframework-alt:before { content: "\f122"; }
.icon-osx:before { content: "\f123"; }
.icon-database:before { content: "\f124"; }
.icon-database-alt:before { content: "\f125"; }
.icon-shell:before { content: "\f126"; }
.icon-script:before { content: "\f127"; }
.icon-antenna:before { content: "\f128"; }
.icon-coffee-bean:before { content: "\f129"; }
.icon-scala-alt:before { content: "\f12a"; }
.icon-platter:before { content: "\f12b"; }
.icon-java-duke:before { content: "\f12c"; }
.icon-iphone:before { content: "\f12d"; }
.icon-script-alt:before { content: "\f12e"; }
.icon-google-alt:before { content: "\f12f"; }
.icon-haskell:before { content: "\f130"; }
.icon-mariadb:before { content: "\f131"; }
.icon-phone-retro:before { content: "\f132"; }
.icon-phone-alt:before { content: "\f133"; }
.icon-csharp:before { content: "\f134"; }
.icon-php:before { content: "\f135"; }
.icon-postgres-alt:before { content: "\f136"; }
.icon-html:before { content: "\f137"; }
.icon-mfizz:before { content: "\f138"; }
.icon-apache:before { content: "\f139"; }
.icon-hadoop:before { content: "\f13a"; }
.icon-ruby-on-rails-alt:before { content: "\f13b"; }
.icon-mobile-phone-broadcast:before { content: "\f13c"; }
.icon-css:before { content: "\f13d"; }
.icon-playframework:before { content: "\f13e"; }
.icon-clojure:before { content: "\f13f"; }
.icon-mobile-phone-alt:before { content: "\f140"; }
.icon-suse:before { content: "\f141"; }
.icon-java-bold:before { content: "\f142"; }
.icon-nginx-alt:before { content: "\f143"; }
.icon-nginx-alt2:before { content: "\f144"; }
.icon-linux-mint:before { content: "\f145"; }
.icon-dreamhost:before { content: "\f146"; }
.icon-blackberry:before { content: "\f147"; }
.icon-javascript:before { content: "\f148"; }
.icon-ubuntu:before { content: "\f149"; }
.icon-php-alt:before { content: "\f14a"; }
.icon-centos:before { content: "\f14b"; }
.icon-nodejs:before { content: "\f14c"; }
.icon-splatter:before { content: "\f14d"; }
.icon-3dprint:before { content: "\f14e"; }
.icon-line-graph:before { content: "\f14f"; }
.icon-cassandra:before { content: "\f150"; }
.icon-solaris:before { content: "\f151"; }
.icon-jetty:before { content: "\f152"; }
.icon-tomcat:before { content: "\f153"; }
.icon-oracle:before { content: "\f154"; }
.icon-oracle-alt:before { content: "\f155"; }
.icon-mssql:before { content: "\f156"; }
.icon-google-developers:before { content: "\f157"; }
.icon-google-code:before { content: "\f158"; }
.icon-kde:before { content: "\f159"; }
.icon-grails-alt:before { content: "\f15a"; }
/* These classes only added to fix FontFamily to display FontMfizz during debug/inspection */
.icon-osx,
.icon-bomb,
.icon-mobile-phone-broadcast,
.icon-objc,
.icon-nginx-alt2,
.icon-mysql,
.icon-phone-retro,
.icon-netbsd,
.icon-mobile-device,
.icon-ruby-on-rails,
.icon-phone-alt,
.icon-line-graph,
.icon-postgres,
.icon-playframework,
.icon-python,
.icon-ruby-on-rails-alt,
.icon-nginx,
.icon-database-alt2,
.icon-google-alt,
.icon-microscope,
.icon-blackberry,
.icon-dreamhost,
.icon-google,
.icon-centos,
.icon-kde,
.icon-csharp,
.icon-scala,
.icon-redis,
.icon-looking,
.icon-database-alt,
.icon-javascript,
.icon-postgres-alt,
.icon-linux-mint,
.icon-ubuntu,
.icon-apache,
.icon-script-alt,
.icon-mssql,
.icon-c,
.icon-gnome,
.icon-java-duke,
.icon-scala-alt,
.icon-clojure,
.icon-oracle-alt,
.icon-redhat,
.icon-haskell,
.icon-3dprint,
.icon-mariadb,
.icon-java,
.icon-script,
.icon-cplusplus,
.icon-jetty,
.icon-perl,
.icon-heroku,
.icon-nginx-alt,
.icon-iphone,
.icon-splatter,
.icon-shell,
.icon-mysql-alt,
.icon-wireless,
.icon-ruby,
.icon-playframework-alt,
.icon-raspberrypi,
.icon-suse,
.icon-nodejs,
.icon-java-bold,
.icon-google-developers,
.icon-mobile-phone-alt,
.icon-grails-alt,
.icon-coffee-bean,
.icon-cassandra,
.icon-google-code,
.icon-fedora,
.icon-antenna,
.icon-hadoop,
.icon-solaris,
.icon-html,
.icon-css,
.icon-satellite,
.icon-aws,
.icon-mfizz,
.icon-php,
.icon-debian,
.icon-ghost,
.icon-php-alt,
.icon-tomcat,
.icon-database,
.icon-grails,
.icon-freebsd,
.icon-oracle,
.icon-fire-alt,
.icon-platter{
font-family: "FontMfizz";
}

Binary file not shown.

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

Binary file not shown.

View file

@ -11,6 +11,7 @@
<!-- Le styles -->
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
<link href="{% static 'css/font-awesome.min.css' %}" rel="stylesheet">
<link href="{% static 'fonts/font-mfizz.css' %}" rel="stylesheet">
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */

View file

@ -0,0 +1,3 @@
{# format database types #}
{% load userdb %}
<i class="{% db_type_icon_class %}" title="{% db_type_name %}"></i><span class="sr-only">{% db_type_name %}</span>

View file

@ -0,0 +1,4 @@
"""
This module provides custom template tags for user databases.
"""

View file

@ -0,0 +1,55 @@
"""
This is the template tag library for user databases.
"""
from django import template
from django.utils.translation import gettext_lazy as _
from userdbs.models import DB_TYPES
register = template.Library()
_TYPE_NAME_MAP = {
DB_TYPES.mysql: 'mysql',
DB_TYPES.pgsql: 'postgres',
}
def db_type_icon_class(context):
"""
This template tag derives the matching icon name for the numeric database
type stored in the context variable db_type.
The icon names used are those of `Font Mfizz
<http://mfizz.com/oss/font-mfizz>`_.
:param context: the template context
:return: icon name
:rtype: str
"""
db_type = context['db_type']
if db_type in _TYPE_NAME_MAP:
return 'icon-' + _TYPE_NAME_MAP[db_type]
return 'icon-database'
register.simple_tag(db_type_icon_class, takes_context=True)
def db_type_name(context):
"""
This template tag gets the human readable database type for the numeric
database type stored in the context variable db_type.
:param context: the template context
:return: human readable database type name
:rtype: str
"""
db_type = context['db_type']
return _(DB_TYPES[db_type])
register.simple_tag(db_type_name, takes_context=True)

View file

@ -1,3 +0,0 @@
from django.shortcuts import render
# Create your views here.