endi.panels package

Subpackages

Submodules

endi.panels.activity module

Panel related to PDF rendering of activities

The page is constructed with a content and a footer

Content is a full html page (enclosed in <html></html>

Footer is added through our utils.pdf.HTMLWithHeaderAndFooter weasyprint utility class

endi.panels.activity.includeme(config)
endi.panels.activity.pdf_content_panel(context, request)

The panel used to render the activity as a PDF

Paramètres:

context (obj) – The current activity

The panel used to render the activity pdf footer

Paramètres:

context (obj) – The current activity

endi.panels.activity.pdf_header_panel(context, request)

The panel used to render the header of the pdf content

endi.panels.files module

endi.panels.files.filetable_panel(context, request, add_url, files, add_perm='add.file', help_message=None, show_parent=False)

render a table listing files

files should be loaded with the following columns included :

description updated_at id parent.id parent.name parent.type_

Paramètres:
  • context (obj) – The context for which we display the files

  • add_url (str) – The url for adding elements

  • files (list) – A list of endi.models.files.File

  • add_perm (str) – The permission required to add a file

  • help_message (str) – An optionnal help message

  • show_parent (bool) – Should a column show the parent ?

Renvoie:

dict

endi.panels.files.includeme(config)
endi.panels.files.parent_label(node)

Render a label for the given node

Paramètres:

node (obj) – endi.models.node.Node instance

Renvoie:

A label for filetable display

endi.panels.files.stream_actions(request, item)

Collect actions available for the given item

endi.panels.form module

A form display panel

Display a form including messages

endi.panels.form.help_message_panel(context, request, parent_tmpl_dict)

Collect panel datas for rendering help/info/warn messages

Paramètres:
  • context (obj) – Auto-filled context (Pyramid original view context)

  • request (obj) – The request object (auto-filled)

  • parent_tmpl_dict (dict) – The parent template context dict

endi.panels.form.includeme(config)

Implement Pyramid inclusion mechanism

endi.panels.indicators module

Panel displaying CustomBusinessIndicators

  • bpf

  • facturation

endi.panels.indicators.custom_indicator_panel(context, request, indicator)

Panel displaying an indicator in a generic format

endi.panels.indicators.includeme(config)

endi.panels.menu module

Panels for the top main menus

A common user has his company menu with customers, projects … A manager or an admin has an admin menu and eventually a usermenu if he’s consulting a company’s account

each user has his own menu with preferences, logout, holidays declaration

endi.panels.menu.company_choice(request, companies, current_company=None)

Add the company choose menu

endi.panels.menu.get_admin_menus(request)

Build the admin menu

endi.panels.menu.get_companies(request, company=None)

Retrieve the companies the current user has access to

Paramètres:
  • request (obj) – The current pyramid request

  • company (obj) – The current company

Renvoie:

The list of companies

Type renvoyé:

list

endi.panels.menu.get_company_menu(request, company, css=None, submenu=True, is_user_company=True)

Build the Company related menu

endi.panels.menu.get_current_company(request, submenu=False, is_user_company=True)

Extract the current company from the request

  • If already retrieved -> request.current_company

  • If company-context request → request.context

  • If non-admin and single-company → that company

  • If non-admin and multi-company and not a company-context request:

    → latest used company

Paramètres:
  • request (obj) – the pyramid request

  • submenu (bool) – Do we ask this for the submenu ?

endi.panels.menu.get_usermenu(request)

Return the user menu (My account, holidays …)

endi.panels.menu.includeme(config)

Pyramid’s inclusion mechanism

endi.panels.menu.menu_panel(context, request)

Top menu panel

Build the top menu dict representation

Type renvoyé:

dict

endi.panels.menu.submenu_panel(context, request)

Submenu panel, build a dict representation of the submenu, if one is expected

Type renvoyé:

dict

endi.panels.navigation module

endi.panels.navigation.includeme(config)
endi.panels.navigation.navigation_panel(context, request)

Show the navigation panel

Breadcrumb Alternative links Back link

endi.panels.sidebar module

User page sidebar menu panels

endi.panels.sidebar.includeme(config)

Pyramid’s inclusion mechanism

endi.panels.sidebar.sidebar_item_panel(context, request, menu_item, bind_params)

Collect datas for menu entry display

Paramètres:
  • context (obj) – The current context

  • request – The current request object

  • menu_item (obj) – An instance of utils.menu.MenuItem or

utils.menu.MenuDropdown :param dict bind_params: Binding parameters attached to the parent menu and used to dynamically render some attributes

endi.panels.sidebar.sidebar_panel(context, request, menu)

Collect datas for menu display

Paramètres:
  • context (obj) – The current context

  • request – The current request object

  • menu (obj) – An instance of utils.menu.Menu

endi.panels.tabs module

Tabs menu panels

endi.panels.tabs.includeme(config)
endi.panels.tabs.tabs_item_panel(context, request, menu_item, bind_params)

Collect datas for menu entry display

Paramètres:
  • context (obj) – The current context

  • request – The current request object

  • menu_item (obj) – An instance of utils.menu.MenuItem or

utils.menu.MenuDropdown :param dict bind_params: Binding parameters attached to the parent menu and used to dynamically render some attributes

endi.panels.tabs.tabs_panel(context, request, menu)

Collect datas for menu display

Paramètres:
  • context (obj) – The current context

  • request – The current request object

  • menu (obj) – An instance of utils.menu.Menu

endi.panels.third_party module

endi.panels.third_party.includeme(config)
endi.panels.third_party.third_party_accounting_info(context, request)
endi.panels.third_party.third_party_general_info(context, request)

endi.panels.widgets module

endi.panels.widgets.action_buttons_panel(context, request, links=())

Inline action buttons (at the top of the page

Paramètres:
  • context (obj) – The current context

  • request (obj) – The current pyramid request

  • links (list) – List of endi.widgets.Link (or POSTButtons)

endi.panels.widgets.action_buttons_td_panel(context, request, links=(), label='Actions')

Action buttons panel returns a dropdown or a button list (without labels)

Paramètres:
  • context (obj) – The current context

  • request (obj) – The current pyramid request

  • links (list) – List of endi.widgets.Link

endi.panels.widgets.admin_index_nav_panel(context, request)

A panel to render the navigation inside the administration interface

Paramètres:
  • context (obj) – The context to render, list of Link or AdminLin

  • request (obj) – The current pyramid request

endi.panels.widgets.includeme(config)

simple link panel used to render links

Paramètres:
  • context (obj) – The context to render, an instance of the Link class

  • request (obj) – The current pyramid request

  • extra_classes – string to be appendend to the <a> class attr

endi.panels.widgets.menu_dropdown_panel(context, request, label, links, icon=None, display_label=False, alignment='right')

Menu dropdown panel

Paramètres:
  • context (obj) – The current context

  • request (obj) – The current pyramid request

  • label (str) – the label to use

  • icon (str) – An optionnal icon to add

  • buttons (list) – List of endi.widgets.Link

endi.panels.widgets.post_button_panel(context, request, extra_classes='')

simple form+submit panel used to render single-POST action links.

Paramètres:
  • context (obj) – The context to render, an instance of POSTButton

  • extra_classes – string to be appendend to the <button> class attr

  • request (obj) – The current pyramid request

endi.panels.widgets.status_title_panel(context, request)

Syntethizing the statuses of an object into a sentence and an icon

endi.panels.workshop module

Panel related to PDF rendering of activities

The page is constructed with a content and a footer

Content is a full html page (enclosed in <html></html>

Footer is added through our utils.pdf.HTMLWithHeaderAndFooter weasyprint utility class

endi.panels.workshop.includeme(config)
endi.panels.workshop.pdf_content_panel(context, request, timeslots)

The panel used to render the workshop as a PDF

Paramètres:

context (obj) – The current workshop

The panel used to render the workshop pdf footer

Paramètres:

context (obj) – The current workshop

endi.panels.workshop.pdf_header_panel(context, request)

The panel used to render the header of the pdf content

Module contents

class endi.panels.BasePanel(context, request)

Bases : object