diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/context_processors.py | 8 | ||||
| -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 -> 2276 bytes | |||
| -rw-r--r-- | ishtar_common/static/media/style.css | 155 | ||||
| -rw-r--r-- | ishtar_common/templates/base.html | 2 | ||||
| -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, 143 insertions, 55 deletions
| diff --git a/ishtar_common/context_processors.py b/ishtar_common/context_processors.py index 55774ef04..ae4a3405d 100644 --- a/ishtar_common/context_processors.py +++ b/ishtar_common/context_processors.py @@ -51,11 +51,13 @@ def get_base_context(request):          menu.init()          request.session['MENU'] = menu      """ # temporary disabled -    menu = Menu(request.user) -    menu.init() -    request.session['MENU'] = menu      if 'CURRENT_ACTION' in request.session:          dct['CURRENT_ACTION'] = request.session['CURRENT_ACTION'] +    menu = Menu(request.user, current_action=dct['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.gifBinary files differ new file mode 100644 index 000000000..669dd15c5 --- /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 60687e5dd..67446e301 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,40 @@ 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; +} + +input[type=text], +input[role=textbox]{ +    background-color:#FFF; +    border:1px solid #FFF; +    border-radius:4px; +    -moz-border-radius:4px; +    -webkit-border-radius:4px; +} + +input[type=text]:focus, +input[role=textbox]:focus{ +    border:1px solid #922;  }  .hidden{ @@ -152,7 +172,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 +229,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 +274,93 @@ 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-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 +409,10 @@ div.form {      font-weight:normal;  } +.form td ul{ +    list-style:none; +} +  .form .errorlist{      color:#922;  } @@ -345,7 +422,7 @@ div.form {  }  .form input[readonly=True]{ -    background-color:#EEE; +    background-color:#f1f2f6;      border:0;  } @@ -522,7 +599,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 +620,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 +632,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 +653,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 +717,7 @@ table.confirm tr.spacer td:last-child{      width:670px;      padding:1em;      padding-left:2em; -    background-color:#EEE; +    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..56ec34e4a 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 %} 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 %} | 
