diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2014-05-26 15:21:54 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2014-05-26 15:21:54 +0200 |
commit | d28857c8e7e8fcdfc2b0a3b6fccfee2eff35044a (patch) | |
tree | 0c63372a171b2da2a1223ff609e691735d4fdd31 /ishtar_common | |
parent | 0e811b4439255a9c9030c0c211e78694467656cf (diff) | |
parent | 9e0053f764bc68d13664e4d47f9b020538453f7e (diff) | |
download | Ishtar-d28857c8e7e8fcdfc2b0a3b6fccfee2eff35044a.tar.bz2 Ishtar-d28857c8e7e8fcdfc2b0a3b6fccfee2eff35044a.zip |
Merge branch 'newstyle'
Conflicts:
ishtar_common/static/media/style.css
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/context_processors.py | 10 | ||||
-rw-r--r-- | ishtar_common/menu_base.py | 10 | ||||
-rw-r--r-- | ishtar_common/menus.py | 11 | ||||
-rw-r--r-- | ishtar_common/static/media/images/crumbs.gif | bin | 0 -> 307 bytes | |||
-rw-r--r-- | ishtar_common/static/media/style.css | 170 | ||||
-rw-r--r-- | ishtar_common/templates/base.html | 10 | ||||
-rw-r--r-- | ishtar_common/templates/ishtar/wizard/confirm_wizard.html | 4 | ||||
-rw-r--r-- | ishtar_common/templates/ishtar/wizard/default_wizard.html | 6 | ||||
-rw-r--r-- | ishtar_common/templates/ishtar/wizard/search.html | 2 |
9 files changed, 163 insertions, 60 deletions
diff --git a/ishtar_common/context_processors.py b/ishtar_common/context_processors.py index 55774ef04..293a5ad44 100644 --- a/ishtar_common/context_processors.py +++ b/ishtar_common/context_processors.py @@ -51,11 +51,15 @@ def get_base_context(request): menu.init() request.session['MENU'] = menu """ # temporary disabled - menu = Menu(request.user) - menu.init() - request.session['MENU'] = menu + current_action = None if 'CURRENT_ACTION' in request.session: dct['CURRENT_ACTION'] = request.session['CURRENT_ACTION'] + current_action = dct['CURRENT_ACTION'] + menu = Menu(request.user, current_action=current_action) + menu.init() + if menu.selected_idx != None: + dct['current_theme'] = "theme-%d" % (menu.selected_idx+1) + request.session['MENU'] = menu dct['MENU'] = request.session['MENU'] dct['JQUERY_URL'] = settings.JQUERY_URL dct['JQUERY_UI_URL'] = settings.JQUERY_UI_URL diff --git a/ishtar_common/menu_base.py b/ishtar_common/menu_base.py index 9ae378b8e..24d63a3e6 100644 --- a/ishtar_common/menu_base.py +++ b/ishtar_common/menu_base.py @@ -37,12 +37,14 @@ class SectionItem: return True return False - def set_items(self, user, items): + def set_items(self, user, items, current_action=None): + selected = None if user: self.available = self.can_be_available(user) for child in self.childs: - child.set_items(user, items) + selected = child.set_items(user, items, current_action) or selected items[child.idx] = child + return selected class MenuItem: def __init__(self, idx, label, model=None, access_controls=[]): @@ -79,7 +81,9 @@ class MenuItem: return True return False - def set_items(self, user, items): + def set_items(self, user, items, current_action=None): if user: self.available = self.can_be_available(user) + if self.idx == current_action: + return True diff --git a/ishtar_common/menus.py b/ishtar_common/menus.py index 465692ec6..6333a4197 100644 --- a/ishtar_common/menus.py +++ b/ishtar_common/menus.py @@ -53,17 +53,22 @@ for section_item in __section_items: class Menu: childs = _section_items - def __init__(self, user): + def __init__(self, user, current_action=None): self.user = user self.initialized = False self.items = {} + self.current_action = current_action + self.selected_idx = None def init(self): if self.initialized: return self.items = {} - for main_menu in self.childs: - main_menu.set_items(self.user, self.items) + for idx, main_menu in enumerate(self.childs): + selected = main_menu.set_items(self.user, self.items, + self.current_action) + if selected: + self.selected_idx = idx self.initialized = True menu = Menu(None) diff --git a/ishtar_common/static/media/images/crumbs.gif b/ishtar_common/static/media/images/crumbs.gif Binary files differnew file mode 100644 index 000000000..c0278c6a4 --- /dev/null +++ b/ishtar_common/static/media/images/crumbs.gif diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 4f7feddd7..8b05603df 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -9,7 +9,7 @@ a.add-button, a.remove, } div.form { - background-color: #EEE; + background-color: #f1f2f6; } #window h1{ @@ -32,7 +32,7 @@ a.add-button{ a.add-button, a.remove, #progress-content, div.form { - border:2px solid #CCC; + border:0 solid #CCC; } /* shadows */ @@ -48,9 +48,9 @@ a.add-button, a.remove, .sheet, #progress-content, div.form { - -moz-border-radius:8px; - -webkit-border-radius:8px; - border-radius:8px; + -moz-border-radius:4px; + -webkit-border-radius:4px; + border-radius:4px; } body{ @@ -107,20 +107,42 @@ td{ } button{ - background-color:#EEE; + background-color:#f1f2f6; border:1px solid #AAA; color:#444; } -input[type=submit], button.submit{ +button, input[type=submit], button.submit{ background-color:#FFF; - border:1px solid #AAA; - color:#922; + border:1px solid #FFF; margin:6px; + font-size:0.9em; + padding:4px 3px; + border-radius:4px; + -moz-border-radius:4px; + -webkit-border-radius:4px; } button:hover, input[type=submit]:hover{ cursor:pointer; + color:#922; + border:1px solid #922; +} + +textarea, +input[type=text], +input[role=textbox]{ + background-color:#FFF; + border:1px solid #FFF; + border-radius:4px; + -moz-border-radius:4px; + -webkit-border-radius:4px; +} + +textarea:focus, +input[type=text]:focus, +input[role=textbox]:focus{ + border:1px solid #D14; } .hidden{ @@ -152,7 +174,7 @@ div#header{ width:100%; text-align:left; font-size: 0.9em; - background-color: #EEE; + background-color: #f1f2f6; border-bottom:1px solid #CCC; margin-bottom:10px; line-height:30px; @@ -209,11 +231,11 @@ div#context_menu{ } div#context_menu fieldset{ - background-color:#EEE; - border:2px solid #CCC; - -moz-border-radius:8px; - -webkit-border-radius:8px; - border-radius:8px; + background-color:#f1f2f6; + border:0 solid #CCC; + -moz-border-radius:4px; + -webkit-border-radius:4px; + border-radius:4px; } div#context_menu ul{ @@ -254,40 +276,104 @@ div#main_menu > ul{ color:#922; } +div#main_menu > ul > li{ + padding:0.5em; + margin:0 0.5em; + border-radius:4px; + -moz-border-radius:4px; + -webkit-border-radius:4px; +} + +#section-file_management, #section-administration, +#section-administrativact_management{ + background-color:#ddffdd; +} + +#subsection-admin_act_operations{ + background-color:#f0fff0; +} + +/* +#section-1, #theme-1 div.form{ + background-color:#ccccff; +} + +#section-2, #theme-2 div.form{ + background-color:#ccffcc; +} + +#section-3, #theme-3 div.form{ + background-color:#ffffcc; +} + +#section-4, #theme-4 div.form{ + background-color:#ffcccc; +} + +#section-5, #theme-5 div.form{ + background-color:#decfad; +} + +#section-6, #theme-6 div.form{ + background-color:#ffcc99; +} + +#section-7, #theme-7 div.form{ + background-color:#ccc; +} +*/ + div#content{ clear:both; margin:0 200px; text-align:center; } +ul#form_path, ul#form_path li{ + list-style-type:none; + padding:0; + margin:0; +} + ul#form_path{ + border:1px solid #dedede; + /*height:2.3em;*/ + background-color:#fff; + margin-bottom:10px; text-align:left; - margin:4px 0; - font-size:0.9em; } -ul#form_path li{ - display: inline; - text-align: center; - padding-left: 10px ; - margin: 0; - white-space:nowrap; + +ul#form_path li { + display:inline-block; + line-height:2.3em; + padding-left:.75em; + color:#777; } -ul#form_path li.current a{ - color:#922; +ul#form_path li a, ul#form_path li button{ + display:inline-block; + padding:0 15px 0 0; + background:url(images/crumbs.gif) no-repeat right center; } -ul#form_path button { - text-decoration:none; - color:#D14; - border:none; - background-color:white; - font-size: 1em; - cursor:pointer; +ul#form_path li button{ + height:33px; padding:0; margin:0; - font-family:Arial, Helvetica, sans-serif; + padding-right:10px; + border:0 solid #fff; +} + +ul#form_path li button:hover{ + color:#D14; + border:0 solid #fff; +} + + +ul#form_path li a:link, ul#form_path li a:visited { + text-decoration:none; + color:#922; } #reminder{ @@ -336,6 +422,10 @@ div.form { font-weight:normal; } +.form td ul{ + list-style:none; +} + .form .errorlist{ color:#922; } @@ -345,7 +435,7 @@ div.form { } .form input[readonly=True]{ - background-color:#EEE; + background-color:#f1f2f6; border:0; } @@ -361,7 +451,7 @@ div.form { -moz-border-radius:8px; -webkit-border-radius:8px; border-radius:8px; - border:1px solid #AAA; + border:1px solid #fff; } .help_text .example{ @@ -522,7 +612,7 @@ table.confirm tr.spacer td:last-child{ #window table th, .dashboard table th{ background-color:#922; - border:1px solid #EEE; + border:1px solid #f1f2f6; color:#FFF; } @@ -543,7 +633,7 @@ table.confirm tr.spacer td:last-child{ #window table th.sub, .dashboard table th.sub, .dashboard table td.sub{ background-color:#994242; - border:1px solid #EEE; + border:1px solid #f1f2f6; color:#FFF; padding:0 1em; } @@ -555,7 +645,7 @@ table.confirm tr.spacer td:last-child{ #window table td, .dashboard table td{ text-align:right; padding:0 1em; - border:1px solid #EEE; + border:1px solid #f1f2f6; } #window table td.string, .dashboard table td.string{ @@ -576,7 +666,7 @@ table.confirm tr.spacer td:last-child{ #window .head{ text-align:center; - background-color:#EEE; + background-color:#f1f2f6; -webkit-border-top-left-radius: 8px; -webkit-border-top-right-radius: 8px; -moz-border-radius-topleft: 8px; @@ -640,7 +730,7 @@ p.alert{ width:670px; padding:1em; padding-left:2em; - background-color:#FFF; + background-color:#f1f2f6; -moz-border-radius:8px; -webkit-border-radius:8px; border-radius:8px; diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index baab57409..cea906f26 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -22,7 +22,7 @@ {% block extra_head %} {% endblock %} </head> -<body> +<body{% if current_theme%} id='{{current_theme}}'{%endif%}> <div id="header"> {% block header %} {% if user.is_authenticated %} @@ -89,16 +89,16 @@ <div id="main_menu"> <ul> {% for section in MENU.childs %} - {% if section.available %}<li id='section-{{forloop.counter}}'>{{section.label}} + {% if section.available %}<li id='section-{{section.idx}}'>{{section.label}} <ul> {% for menu_item in section.childs %}{%if menu_item.available%} - {% if menu_item.childs %}<li id='section-{{forloop.parentloop.counter}}-{{forloop.counter}}'>{{menu_item.label}} + {% if menu_item.childs %}<li id='subsection-{{menu_item.idx}}'>{{menu_item.label}} <ul> {% for menu_subitem in menu_item.childs %}{%if menu_subitem.available%} - <li id='section-{{forloop.parentloop.parentloop.counter}}-{{forloop.parentloop.counter}}-{{forloop.counter}}'{%ifequal menu_subitem.idx CURRENT_ACTION%} class='selected'{%endifequal%}><a href='{% url 'action' menu_subitem.idx%}'>{{menu_subitem.label}}</a></li> + <li id='{{menu_subitem.idx}}'{%ifequal menu_subitem.idx CURRENT_ACTION%} class='selected'{%endifequal%}><a href='{% url 'action' menu_subitem.idx%}'>{{menu_subitem.label}}</a></li> {%endif%}{% endfor %}</ul></li> {%else%} - <li{%ifequal menu_item.idx CURRENT_ACTION%} class='selected'{%endifequal%}><a href='{% url 'action' menu_item.idx%}'>{{menu_item.label}}</a></li> + <li id='{{menu_item.idx}}'{%ifequal menu_item.idx CURRENT_ACTION%} class='selected'{%endifequal%}><a href='{% url 'action' menu_item.idx%}'>{{menu_item.label}}</a></li> {%endif%}{% endif %}{% endfor %} </ul> </li>{%endif%} diff --git a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html index 8550d6a1c..0dd1f6f12 100644 --- a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html @@ -6,9 +6,9 @@ <form action="." method="post">{% csrf_token %} <ul id='form_path'> {% for step in previous_steps %} - <li>» <button name="form_prev_step" value="{{forloop.counter0}}">{{step.form_label}}</button></li> + <li><button name="form_prev_step" value="{{forloop.counter0}}">{{step.form_label}}</button></li> {% endfor %} - <li class='current'>» <a href='#'>{{current_step.form_label}}</a></li> + <li class='current'><a href='#'>{{current_step.form_label}}</a></li> </ul> </form> <form action="." method="post">{% csrf_token %} diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html index c1c0cb5cf..6d295e2c9 100644 --- a/ishtar_common/templates/ishtar/wizard/default_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html @@ -9,11 +9,11 @@ <form action="." method="post">{% csrf_token %} <ul id='form_path'> {% for step in previous_steps %} - <li>» <button class='change_step' name="form_prev_step" value="{{forloop.counter0}}">{{step.form_label}}</button></li> + <li><button class='change_step' name="form_prev_step" value="{{forloop.counter0}}">{{step.form_label}}</button></li> {% endfor %} - <li class='current'>» <a href='#'>{{current_step.form_label}}</a></li> + <li class='current'><a href='#'>{{current_step.form_label}}</a></li> {% for step in next_steps %} - <li>» <button class='change_step' name="form_prev_step" value="{{forloop.counter|add:previous_step_counter}}">{{step.form_label}}</button></li> + <li><button class='change_step' name="form_prev_step" value="{{forloop.counter|add:previous_step_counter}}">{{step.form_label}}</button></li> {% endfor %} </ul> </form> diff --git a/ishtar_common/templates/ishtar/wizard/search.html b/ishtar_common/templates/ishtar/wizard/search.html index 53455a7b4..5cf96552b 100644 --- a/ishtar_common/templates/ishtar/wizard/search.html +++ b/ishtar_common/templates/ishtar/wizard/search.html @@ -6,7 +6,7 @@ {% block content %} <h2>{{wizard_label}}</h2> <ul id='form_path'> - <li class='current'>» <a href='#'>{{current_step.form_label}}</a></li> + <li class='current'><a href='#'>{{current_step.form_label}}</a></li> </ul> <div class='form'> {% if wizard.form.forms %} |