From 0932a0778535eb4bbe6380072a4b5c4d3633513d Mon Sep 17 00:00:00 2001 From: Manish Tripathy Date: Mon, 11 Jun 2018 17:28:00 +0530 Subject: [PATCH] Apply new card based design Signed-off-by: Manish Tripathy Signed-off-by: Sunil Mohan Adapa Reviewed-by: Sunil Mohan Adapa --- plinth/menu.py | 12 +- plinth/templates/apps.html | 38 +---- plinth/templates/base.html | 80 ++++----- plinth/templates/cards.html | 52 ++++++ plinth/templates/index.html | 130 +++++++------- plinth/templates/system.html | 33 +--- plinth/tests/test_menu.py | 28 ++- static/themes/default/css/plinth.css | 106 +++++++++++- .../img/FreedomBox-logo-32px-white.png | Bin 0 -> 684 bytes .../default/img/FreedomBox-logo-white.svg | 127 ++++++++++++++ static/themes/default/img/apps-background.svg | 160 ++++++++++++++++++ .../img/freedombox-logo-background.svg | 72 ++++++++ .../themes/default/img/system-background.svg | 62 +++++++ 13 files changed, 727 insertions(+), 173 deletions(-) create mode 100644 plinth/templates/cards.html create mode 100644 static/themes/default/img/FreedomBox-logo-32px-white.png create mode 100644 static/themes/default/img/FreedomBox-logo-white.svg create mode 100644 static/themes/default/img/apps-background.svg create mode 100644 static/themes/default/img/freedombox-logo-background.svg create mode 100644 static/themes/default/img/system-background.svg diff --git a/plinth/menu.py b/plinth/menu.py index 074f040d9..10fb6c385 100644 --- a/plinth/menu.py +++ b/plinth/menu.py @@ -23,7 +23,7 @@ from plinth.utils import format_lazy class Menu(object): """One menu item.""" - def __init__(self, label="", icon="", url="#", order=50): + def __init__(self, name="",short_description="", label="", icon="", url="#", order=50): """label is the text that is displayed on the menu. icon is the icon to be displayed next to the label. @@ -41,6 +41,8 @@ class Menu(object): use fractional orders. """ + self.name = name + self.short_description = short_description self.label = label self.icon = icon self.url = url @@ -61,7 +63,7 @@ class Menu(object): def sorted_items(self): """Return menu items in sorted order according to current locale.""" - return sorted(self.items, key=lambda x: (x.order, x.label)) + return sorted(self.items, key=lambda x: (x.order, x.name.lower())) def add_urlname(self, name, icon, urlname, short_description="", order=50, url_args=None, url_kwargs=None): @@ -75,14 +77,14 @@ class Menu(object): else: label = name url = reverse_lazy(urlname, args=url_args, kwargs=url_kwargs) - return self.add_item(label, icon, url, order) + return self.add_item(name, short_description, label, icon, url, order) - def add_item(self, label, icon, url, order=50): + def add_item(self, name, short_description, label, icon, url, order=50): """Create a new menu item with given parameters, add it to this menu and return it. """ - item = Menu(label=label, icon=icon, url=url, order=order) + item = Menu(name=name, short_description=short_description, label=label, icon=icon, url=url, order=order) self.items.append(item) return item diff --git a/plinth/templates/apps.html b/plinth/templates/apps.html index 2bbc73d45..db6b26d84 100644 --- a/plinth/templates/apps.html +++ b/plinth/templates/apps.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'cards.html' %} {% comment %} # # This file is part of FreedomBox. @@ -18,35 +18,13 @@ # {% endcomment %} +{% load static %} {% load i18n %} -{% block submenu %} - {% if submenu %} - - {% endif %} -{% endblock %} - -{% block content %} - -

{% trans "Services and Applications" %}

- -

- {% blocktrans trimmed %} - You can install and run various services and applications on - your {{ box_name }}. Click on any app page link on the left to - read a description of the application and choose to install it. - {% endblocktrans %} -

- -

- {% blocktrans trimmed %} - This box can be your photo sharing site, your instant messaging - site, your social networking site, your news site. Remember web - portals? We can be one of those too. Many of the services you - use on the web could soon be on site and under your control! - {% endblocktrans %} -

- +{% block page_head %} + {% endblock %} diff --git a/plinth/templates/base.html b/plinth/templates/base.html index f4e5810ee..8450f2d0a 100644 --- a/plinth/templates/base.html +++ b/plinth/templates/base.html @@ -77,7 +77,7 @@
-