From 0fcac04804de77f8a9cfb917c127fd3a7818edc0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 28 Dec 2010 12:26:44 +0100 Subject: jQuery integration - reorganization - presentation work --- docs/src/INSTALL.t2t | 1 + ishtar/furnitures/context_processors.py | 1 + ishtar/furnitures/views.py | 2 +- ishtar/settings.py.example | 1 + ishtar/templates/base.html | 8 ++- media/images/favicon.png | Bin 666 -> 0 bytes media/images/ishtar-bg.jpg | Bin 18732 -> 0 bytes media/images/ishtar-text.png | Bin 2928 -> 0 bytes media/images/logo.ico | Bin 766 -> 0 bytes media/images/logo.png | Bin 6198 -> 0 bytes media/style.css | 96 ------------------------- static/js/ishtar.js | 10 +++ static/media/images/favicon.png | Bin 0 -> 666 bytes static/media/images/ishtar-bg.jpg | Bin 0 -> 18732 bytes static/media/images/ishtar-text.png | Bin 0 -> 2928 bytes static/media/images/logo.ico | Bin 0 -> 766 bytes static/media/images/logo.png | Bin 0 -> 6198 bytes static/media/style.css | 123 ++++++++++++++++++++++++++++++++ 18 files changed, 142 insertions(+), 100 deletions(-) delete mode 100644 media/images/favicon.png delete mode 100644 media/images/ishtar-bg.jpg delete mode 100644 media/images/ishtar-text.png delete mode 100644 media/images/logo.ico delete mode 100644 media/images/logo.png delete mode 100644 media/style.css create mode 100644 static/js/ishtar.js create mode 100644 static/media/images/favicon.png create mode 100644 static/media/images/ishtar-bg.jpg create mode 100644 static/media/images/ishtar-text.png create mode 100644 static/media/images/logo.ico create mode 100644 static/media/images/logo.png create mode 100644 static/media/style.css diff --git a/docs/src/INSTALL.t2t b/docs/src/INSTALL.t2t index 6966e7147..68dcc462f 100644 --- a/docs/src/INSTALL.t2t +++ b/docs/src/INSTALL.t2t @@ -16,6 +16,7 @@ Last update: %%date(%m-%d-%Y) - [psycopg2 http://freshmeat.net/projects/psycopg/] - [django-simple-history https://bitbucket.org/q/django-simple-history/src] version 1.0 - registration +- libjs-jquery To install django-simple-history: ``` diff --git a/ishtar/furnitures/context_processors.py b/ishtar/furnitures/context_processors.py index e187d2f76..f58a4cadd 100644 --- a/ishtar/furnitures/context_processors.py +++ b/ishtar/furnitures/context_processors.py @@ -30,5 +30,6 @@ def get_base_context(request): menu.init() request.session['MENU'] = menu dct['MENU'] = request.session['MENU'] + dct['JQUERY_URL'] = settings.JQUERY_URL return dct diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py index cce399d1f..20ef4d597 100644 --- a/ishtar/furnitures/views.py +++ b/ishtar/furnitures/views.py @@ -37,7 +37,7 @@ def action(request, action): """ Main page """ - dct = {} + dct = {'current_action':action} return render_to_response('index.html', dct, context_instance=RequestContext(request)) diff --git a/ishtar/settings.py.example b/ishtar/settings.py.example index 2fe347345..97d396fb5 100644 --- a/ishtar/settings.py.example +++ b/ishtar/settings.py.example @@ -6,6 +6,7 @@ APP_NAME = "" ROOT_PATH = "/var/local/webapp/ishtar/ishtar/" URL_PATH = "" +JQUERY_URL = "/javascript/jquery/jquery.js" DEBUG = True TEMPLATE_DEBUG = DEBUG diff --git a/ishtar/templates/base.html b/ishtar/templates/base.html index ff9744391..1433d932d 100644 --- a/ishtar/templates/base.html +++ b/ishtar/templates/base.html @@ -4,10 +4,12 @@ - - + + {% block title %}Ishtar{% if APP_NAME %} - {{APP_NAME}}{%endif%}{% endblock %} + + @@ -34,7 +36,7 @@
  • {{section.label}}
  • diff --git a/media/images/favicon.png b/media/images/favicon.png deleted file mode 100644 index 49a143457..000000000 Binary files a/media/images/favicon.png and /dev/null differ diff --git a/media/images/ishtar-bg.jpg b/media/images/ishtar-bg.jpg deleted file mode 100644 index 31dff0f15..000000000 Binary files a/media/images/ishtar-bg.jpg and /dev/null differ diff --git a/media/images/ishtar-text.png b/media/images/ishtar-text.png deleted file mode 100644 index 34f3270eb..000000000 Binary files a/media/images/ishtar-text.png and /dev/null differ diff --git a/media/images/logo.ico b/media/images/logo.ico deleted file mode 100644 index c6417a32e..000000000 Binary files a/media/images/logo.ico and /dev/null differ diff --git a/media/images/logo.png b/media/images/logo.png deleted file mode 100644 index e150baa6c..000000000 Binary files a/media/images/logo.png and /dev/null differ diff --git a/media/style.css b/media/style.css deleted file mode 100644 index 890bd535b..000000000 --- a/media/style.css +++ /dev/null @@ -1,96 +0,0 @@ -body{ - font-family:Arial, Helvetica, sans-serif; - font-size: 11pt; - margin:0; - color:#61615C; - background-image:url(images/ishtar-bg.jpg); - background-repeat:no-repeat; - background-position:right top; -} - -a { - text-decoration:none; - color:#D14; -} - -caption { - color:#922; - font-weight:bold; -} - -label{display:block} - -label:first-letter { - text-transform: uppercase; -} - -div#header{ - width:100%; - text-align:right; - font-size: 0.9em; - background-color: #EEE; - border-bottom:1px solid #CCC; - margin-bottom:10px; -} - -div#logo{ - width:200px; - top:30px; - left:30px; - padding-top:90px; - position:absolute; - text-align:center; - background-image:url(images/ishtar-text.png); - background-repeat:no-repeat; -} - -div#context_menu{ - height:150px; - margin-left:200px; - margin-right:20px; - margin-bottom:20px; -} - -div#main_menu{ - width:200px; - position:absolute; -} - -div#content{ - margin-left:200px; -} - -div.form { - margin-left:auto; - margin-right:auto; - padding:1em; - display:block; - width:500px; - background-color: #EEE; - border:1px solid #CCC; - border-radius:10px; - text-align:center; -} - -div.form table{ - padding:0.2em; - margin-left:auto; - margin-right:auto; -} - -div.form table th{ - text-align:left; -} - -.info{ - margin-left:auto; - margin-right:auto; - padding:1em; - display:block; - width:500px; -} - -.info p{ - padding:0; - margin:0.2em; -} diff --git a/static/js/ishtar.js b/static/js/ishtar.js new file mode 100644 index 000000000..9e94b4359 --- /dev/null +++ b/static/js/ishtar.js @@ -0,0 +1,10 @@ +$(document).ready(function(){ + $("#main_menu ul ul").hide(); + $("#main_menu ul ul .selected").parent().show(); +}); + +$("#main_menu ul li").live('click', function(){ + $("#main_menu ul ul").hide('slow'); + $(this).find('ul').show('slow'); +}); + diff --git a/static/media/images/favicon.png b/static/media/images/favicon.png new file mode 100644 index 000000000..49a143457 Binary files /dev/null and b/static/media/images/favicon.png differ diff --git a/static/media/images/ishtar-bg.jpg b/static/media/images/ishtar-bg.jpg new file mode 100644 index 000000000..31dff0f15 Binary files /dev/null and b/static/media/images/ishtar-bg.jpg differ diff --git a/static/media/images/ishtar-text.png b/static/media/images/ishtar-text.png new file mode 100644 index 000000000..34f3270eb Binary files /dev/null and b/static/media/images/ishtar-text.png differ diff --git a/static/media/images/logo.ico b/static/media/images/logo.ico new file mode 100644 index 000000000..c6417a32e Binary files /dev/null and b/static/media/images/logo.ico differ diff --git a/static/media/images/logo.png b/static/media/images/logo.png new file mode 100644 index 000000000..e150baa6c Binary files /dev/null and b/static/media/images/logo.png differ diff --git a/static/media/style.css b/static/media/style.css new file mode 100644 index 000000000..d1b536f1f --- /dev/null +++ b/static/media/style.css @@ -0,0 +1,123 @@ +body{ + font-family:Arial, Helvetica, sans-serif; + font-size: 11pt; + margin:0; + color:#61615C; + background-image:url(images/ishtar-bg.jpg); + background-repeat:no-repeat; + background-position:right top; +} + +a { + text-decoration:none; + color:#D14; +} + +caption { + color:#922; + font-weight:bold; +} + +label{display:block} + +label:first-letter { + text-transform: uppercase; +} + +.hidden{ + display:none; +} + +div#header{ + width:100%; + text-align:right; + font-size: 0.9em; + background-color: #EEE; + border-bottom:1px solid #CCC; + margin-bottom:10px; +} + +div#logo{ + width:200px; + top:30px; + left:30px; + padding-top:90px; + position:absolute; + text-align:center; + background-image:url(images/ishtar-text.png); + background-repeat:no-repeat; +} + +div#context_menu{ + height:150px; + margin-left:200px; + margin-right:20px; + margin-bottom:20px; +} + +div#main_menu{ + width:200px; + position:absolute; +} + +div#main_menu ul{ + padding-left:1.5em; + cursor:pointer; + list-style:none; +} + +div#main_menu a{ + color:#666; +} + +div#main_menu a:hover{ + color:#D14; +} + +div#main_menu .selected a{ + color:#D14; +} + + +div#main_menu > ul{ + color:#922; +} + +div#content{ + margin-left:200px; +} + +div.form { + margin-left:auto; + margin-right:auto; + padding:1em; + display:block; + width:500px; + background-color: #EEE; + border:1px solid #CCC; + border-radius:10px; + text-align:center; +} + +div.form table{ + padding:0.2em; + margin-left:auto; + margin-right:auto; +} + +div.form table th{ + text-align:left; +} + +.info{ + margin-left:auto; + margin-right:auto; + padding:1em; + display:block; + width:500px; +} + +.info p{ + padding:0; + margin:0.2em; +} -- cgit v1.2.3