diff options
author | Leif Johansson <leifj@sunet.se> | 2011-06-19 23:36:45 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-06-19 23:37:58 +0200 |
commit | 3cb58a9e9c9aae32ae1b22c3d8e83528df766764 (patch) | |
tree | 61873cbc7f1f09bb4b81a825a449f906d1329af4 | |
parent | db6a38249c1f9fdcaa46d1eaffa91ae067aeefca (diff) |
allow tree to be hidden
-rw-r--r-- | site-media/css/style.css | 19 | ||||
-rw-r--r-- | site-media/img/vertical-separator.gif | bin | 0 -> 51 bytes | |||
-rw-r--r-- | templates/apps/name/name.html | 3 | ||||
-rw-r--r-- | templates/base.html | 2 | ||||
-rw-r--r-- | templates/tree.html | 121 |
5 files changed, 95 insertions, 50 deletions
diff --git a/site-media/css/style.css b/site-media/css/style.css index 2de5324..b6b5e95 100644 --- a/site-media/css/style.css +++ b/site-media/css/style.css @@ -5,7 +5,7 @@ div#container { position: relative; height:auto !important; height: 100%; min-he #modal-dialog input.text textarea { margin-bottom:12px; width:95%; padding: .4em; } #modal-dialog fieldset { padding:0; border:0; margin-top:25px; } div#intro { font-size: 150%; margin-top: 50px; } -div#footer { margin-right: 50px; border-top: 1px solid #CECECE; position: absolute; bottom: 0; padding-bottom: 0px; width: 100%; } +div#footer { margin-right: 50px; border-top: 1px solid #CECECE; position: absolute; bottom: 0; padding-bottom: 20px; width: 100%; } div#footer ul { list-style: none; padding: 0; margin: 0; } div#footer li { display: inline; } div#footer li li { display: block; } @@ -20,9 +20,6 @@ h3.listheader { padding-left: 20px; } ul.ilist { list-style: none inside; margin: 0; padding 0; padding-left: 0px} .ilist li { display: inline-block; margin: 0; padding 0; } -ul.leftright { padding: 0px; margin: 0px; } -li.leftright { display: inline-block; list-style: none inside; padding: 0px; vertical-align: top;} - ul.rlist { list-style: none inside; padding: 0; margin: 0; padding-left: 0px} .rlist li { float: right; display: inline; padding: 0; margin: 0; } @@ -78,13 +75,7 @@ h2, h2 a { font-size: 150% } -#files { width: 520px; clear: both; margin: 20px 0 10px; } -#files .viewport { width: 500px; height: 200px; overflow: hidden; position: relative; } -#files .overview { list-style: none; position: absolute; left: 0; top: 0; } -#files .thumb .end, -#files .thumb { background-color: #003D5D; } -#files .scrollbar { position: relative; float: right; width: 15px; } -#files .track { background-color: #D8EEFD; height: 100%; width:13px; position: relative; padding: 0 1px; } -#files .thumb { height: 20px; width: 13px; cursor: pointer; overflow: hidden; position: absolute; top: 0; } -#files .thumb .end { overflow: hidden; height: 5px; width: 13px; } -#files .disable{ display: none; }
\ No newline at end of file +#thesidebar, #thecontent, #theseparator { vertical-align: top; display: inline-block; } +#thesidebar { width: 35%; float: left; } +#thecontent { width: 58%; } +#theseparator { display: none; } diff --git a/site-media/img/vertical-separator.gif b/site-media/img/vertical-separator.gif Binary files differnew file mode 100644 index 0000000..38fc154 --- /dev/null +++ b/site-media/img/vertical-separator.gif diff --git a/templates/apps/name/name.html b/templates/apps/name/name.html index ddaa6d8..cf3e7ee 100644 --- a/templates/apps/name/name.html +++ b/templates/apps/name/name.html @@ -60,7 +60,7 @@ <div> {{m|memberdisplay}} became a member of {{name.shortname}} {{m.timecreated|datehumanize}} {% if m.tags %}<h4>Role{{m.tags|pluralize}}</h4> - <ul class="clist">{% for tag in m.tags %}<li>{{ tag|escape }}</li>{%endfor%}</ul>{%endif%} + <ul class="ilist">{% for tag in m.tags %}<li style="padding: 2px;">{{ tag|escape }}</li>{%endfor%}</ul>{%endif%} </div> <div class="rlist button"> <ul> @@ -93,7 +93,6 @@ <li class="button"><a href="/invitation/{{i.id}}/resend">Resend</a></li> </ul> </div> - <!-- div class="clear"></div --> </div> </div> {% empty %} diff --git a/templates/base.html b/templates/base.html index 7d44bd8..e784293 100644 --- a/templates/base.html +++ b/templates/base.html @@ -109,7 +109,7 @@ <li> <ul> <li><h3>Users</h3></li> - <li><a href="/user/home">Logged in as {{ profile.display_name }} ({{ profile.identifier }})</a></li> + <li><a href="/user/home">My Dashboard</a></li> <li><a class="tip" title="Logout" id="logout" href="/accounts/logout/">Logout</a></li> </ul> </li> diff --git a/templates/tree.html b/templates/tree.html index 9fab51b..f1e45b4 100644 --- a/templates/tree.html +++ b/templates/tree.html @@ -3,43 +3,96 @@ <script type="text/javascript"> $(function() { {% block widgets %}{% endblock %} - $('#jstree').jstree({ - 'json_data': { - 'ajax': { - 'url': function(n) { - if (n == -1) { - return {% if name %}"/rtree/"+{{name.id}}+".json"{% else %}"/rtree.json"{% endif %}; - } else { - return "/ctree/"+n.attr('id')+".json"; - } - } - }, - "progressive_render" : true - }, - 'themes': { - 'theme': 'classic' - }, - 'animation': 0, - 'plugins': ['themes','json_data'] + function _hide_sidebar(first) { + if (first) { + $('#thesidebar').hide(); + } else { + $('#thesidebar').hide("fast"); + } + $('#theseparator').addClass('ui-icon-arrowthickstop-1-e'); + $('#theseparator').removeClass('ui-icon-arrowthickstop-1-w'); + $.cookie('sidebar', 'off', { expires: 30 }); + return "off"; + } + function _show_sidebar(first) { + _refresh_tree(); + if (first) { + $('#thesidebar').show(); + } else { + $('#thesidebar').show("fast"); + } + $('#theseparator').removeClass('ui-icon-arrowthickstop-1-e'); + $('#theseparator').addClass('ui-icon-arrowthickstop-1-w'); + $.cookie('sidebar', 'on', { expires: 30 }); + return "on"; + } + function _load_state() { + c = $.cookie('sidebar'); + _hide_sidebar(true); + if (c == "on") { + _show_sidebar(true); + return "on"; + } else { + return "off"; + } + } + var sidebar = _load_state(); + $('#theseparator').addClass('ui-icon'); + //$('#theseparator').hover(function() { + // $(this).addClass('ui-state-hover'); + //},function() { + // $(this).removeClass('ui-state-hover'); + //}); + $('#theseparator').click(function() { + if (sidebar == "on") { + sidebar = _hide_sidebar(); + } else { + sidebar = _show_sidebar(); + } }); + // must be last to avoid loading the tree if it is invisible + function _refresh_tree() { + $('#jstree').jstree({ + 'json_data': { + 'ajax': { + 'url': function(n) { + if (n == -1) { + return {% if name %}"/rtree/"+{{name.id}}+".json"{% else %}"/rtree.json"{% endif %}; + } else { + return "/ctree/"+n.attr('id')+".json"; + } + } + }, + "progressive_render" : true + }, + 'animation': 0, + 'themeroller': { + 'item': 'ui-state-none', + 'opened': 'ui-icon-circlesmall-minus', + 'closed': 'ui-icon-circlesmall-plus' + }, + 'plugins': ['json_data','themeroller'] + }); + $('#jstree').removeClass('ui-widget-content'); + } }); </script> {% endblock %} {% block main %} -<ul class="leftright"> - <li class="leftright" style="width: 35%"> - <div class="ui-helper-reset" id="tree"> - <ul class="ilist" style="padding-left: 0px;"> - <li><b>{{ prefix_url }}</b></li> - {% if name and render.up %} - {% if name.parent %} - <li><a class="tip" title="Up one level" href="{{name.parent.url}}"><span style="vertical-align: bottom;" class="ui-icon ui-icon-arrowthick-1-n"></span></a></li> - {% else %} - <li><a class="tip" title="Up one level" href="/name"><span style="vertical-align: bottom;" class="ui-icon ui-icon-arrowthickstop-1-n"></span></a></li> - {% endif %} - {% endif %} - </ul> - <div class="ui-helper-reset" id="jstree"></div> + +<ul class="ilist" style="margin-bottom: 80px;"> + <li id="thesidebar"> + <div id="tree"> + <ul class="clist"> + {% if name %} + {% if name.parent %} + <li>{% if render.up %}<a href="{{name.parent.url}}">{%endif%}{{name.parent.url}}{%if render.up%}</a>{%endif%}</li> + {% else %} + <li><a href="/name">{{prefix_url}}</a></li> + {% endif %} + {% endif %} + <li><div style="min-height: 300px;" class="ui-helper-reset" id="jstree"></div></li> + </ul> </div> <!-- div id="related"> {% if name and name.links %} @@ -60,7 +113,8 @@ $(function() { {% endif %} </div --> </li> - <li class="leftright" style="margin-bottom: 80px; margin-left: 10px; width: 59%;"> + <li id="theseparator"> </li> + <li id="thecontent"> <div id="headline"> <a style="text-decoration: none" href="{% if name %}{{name.url}}{% else %}/user/home{% endif %}">{% if name %}{{name.shortname}}{% else %}Dashboard{% endif %}</a> </div> @@ -68,5 +122,6 @@ $(function() { {% block content %}{% endblock %} </div> </li> + </ul> {% endblock %}
\ No newline at end of file |