Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django roll-up (collapsible) menu

I have a web app with three frames (banner, menu, content) The menu frame needs to have a dynamic roll-up menu Example:

+ Teachers
  - Create
  - Edit
  - Delete

+ Schools
  - Create
  - Edit
  - Delete
  - View Staff

+ Classrooms
  - Create
  - Edit
  - Delete

If you click on the + or "Schools" it will hide/un-hide items under it. The menu needs to be dynamically drawn after user login based on user group and role. Some users may only be authorized to see

+ Classrooms
  -Edit 

and some users will see everything.

Is there anything built or a plugin that anyone has used that would provide a framework for what I need?

like image 467
storm_to Avatar asked Oct 20 '25 03:10

storm_to


1 Answers

Simple implementation using jQuery:

<div id="menu">
    <a>Teachers</a><br />
    <div style="display: none">
        <a href="">Edit</a><br />
        <a href="">Delete</a><br /> 
    </div>
    <a>Schools</a><br />
    <div style="display: none">
        <a href="">Edit</a><br />
        <a href="">Delete</a><br /> 
    </div>
</div>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$('#menu > a').click(function(){
    $(this).next().next().slideToggle();
    return false;
});
</script>
like image 171
Ski Avatar answered Oct 21 '25 16:10

Ski