Example #1
0
group_list = {"text": _(u"view all groups"), "view": "group_list", "famfam": "chart_pie"}
group_create = {"text": _(u"create group"), "view": "group_create", "famfam": "chart_pie_add"}
group_update = {"text": _(u"edit"), "view": "group_update", "args": "object.id", "famfam": "chart_pie_edit"}
group_delete = {"text": _(u"delete"), "view": "group_delete", "args": "object.id", "famfam": "chart_pie_delete"}

state_filter = {"name": "state", "title": _(u"state"), "queryset": State.objects.all(), "destination": "itemstate"}


register_links(
    [
        "item_list",
        "item_view",
        "item_create",
        "item_orphans_list",
        "item_update",
        "item_delete",
        "item_photos",
        "item_assign_person",
        "template_items_list",
    ],
    [asset_create],
    menu_name="sidebar",
)
register_links(Item, [asset_edit, asset_delete, asset_photos, asset_assign_person, asset_template])

register_links(
    [
        "person_list",
        "person_create",
        "person_view",
        "person_update",
Example #2
0
template_photos = {'text':_(u'add / remove photos'), 'view':'template_photos', 'args':'object.id', 'famfam':'picture_go'}
template_assets = {'text':_(u'related assets'), 'view':'template_items_list', 'args':'object.id', 'famfam':'computer_go'}
template_assign_supplies = {'text':_(u'assign supplies'), 'view':'template_assign_supply', 'args':'object.id', 'famfam':'monitor'}
template_assign_suppliers = {'text':_(u'assign suppliers'), 'view':'template_assign_suppliers', 'args':'object.id', 'famfam':'lorry_go'}

jump_to_template = {'text':_(u'template'), 'view':'template_view', 'args':'object.supply.id', 'famfam':'page_go'}
jump_to_inventory = {'text':_(u'return to inventory'), 'view':'inventory_view', 'args':'object.inventory.id', 'famfam':'package_go'}

template_menu_links = [template_list, template_orphan_list, supplier_list]
inventory_menu_links = [
    inventory_list,#, inventory_transaction_list, inventory_transaction_create
]

location_filter = {'name':'location', 'title':_(u'location'), 'queryset':Location.objects.all(), 'destination':'location'}

register_links(['template_list', 'template_create', 'template_view', 'template_orphans_list', 'template_update', 'template_delete', 'template_photos', 'template_assign_supply', 'template_assign_suppliers'], [template_create], menu_name='sidebar')
register_links(ItemTemplate, [template_update, template_delete, template_photos, template_assets, template_assign_supplies, template_assign_suppliers])

register_links(['supplier_list', 'supplier_create', 'supplier_update', 'supplier_view', 'supplier_delete', 'supplier_assign_itemtemplates'], [supplier_create], menu_name='sidebar')
register_links(Supplier, [supplier_update, supplier_delete, supplier_assign_itemtemplate, supplier_purchase_orders])

register_links(['inventory_view', 'inventory_list', 'inventory_create', 'inventory_update', 'inventory_delete', 'inventory_transaction_list'], [inventory_create], menu_name='sidebar')
register_links(Inventory, [inventory_update, inventory_delete, inventory_list_transactions, inventory_create_transaction])
register_links(Inventory, [inventory_view], menu_name='sidebar')

register_links(['inventory_transaction_list', 'inventory_transaction_create', 'inventory_transaction_update', 'inventory_transaction_delete', 'inventory_transaction_view'], [inventory_create_transaction], menu_name='sidebar')
register_links(InventoryTransaction, [inventory_transaction_view, inventory_transaction_update, inventory_transaction_delete, jump_to_template])
register_links(InventoryTransaction, [jump_to_inventory], menu_name='sidebar')

register_links(['location_list', 'location_create', 'location_update', 'location_delete'], [location_create], menu_name='sidebar')
register_links(Location, [location_update, location_delete])