from agencies.models import Agency from common.utils import encapsulate from navigation.api import register_top_menu, register_model_list_columns from navigation.classes import Link from .links import (link_agency_software_list, link_agency_software_create, link_agency_software_delete, link_agency_software_edit, link_agency_software_view) from .models import Agency, AgencySoftware from .permissions import (PERMISSION_AGENCY_SOFTWARE_CREATE, PERMISSION_AGENCY_SOFTWARE_DELETE, PERMISSION_AGENCY_SOFTWARE_EDIT, PERMISSION_AGENCY_SOFTWARE_VIEW) Link.bind_links(['agency_software_list', 'data_create', AgencySoftware], [link_agency_software_create], menu_name='secondary_menu') Link.bind_links([Agency], [link_agency_software_list]) Link.bind_links([AgencySoftware], [ link_agency_software_view, link_agency_software_edit, link_agency_software_delete ]) register_model_list_columns(AgencySoftware, [ { 'name': _(u'type'), 'attribute': 'software.software_type' }, { 'name': _(u'label'), 'attribute': 'software.label'
#from agencies.classes import AgencyElement from agencies.models import Agency from common.utils import encapsulate from navigation.api import register_top_menu, register_model_list_columns from navigation.classes import Link from .links import (link_circuit_create, link_circuit_delete, link_circuit_edit, link_circuit_view, link_agency_circuit_list, link_equipment_create, link_equipment_delete, link_equipment_edit, link_equipment_view, link_agency_equipment_list) from .models import Circuit, Equipment from .permissions import (PERMISSION_CIRCUIT_CREATE, PERMISSION_CIRCUIT_DELETE, PERMISSION_CIRCUIT_EDIT, PERMISSION_CIRCUIT_VIEW, PERMISSION_EQUIPMENT_CREATE, PERMISSION_EQUIPMENT_DELETE, PERMISSION_EQUIPMENT_EDIT, PERMISSION_EQUIPMENT_VIEW) #Link.bind_links(['equipment_list'], [link_equipment_list], menu_name='secondary_menu') Link.bind_links(['agency_equipment_list', 'equipment_create', Equipment], [link_equipment_create], menu_name='secondary_menu') Link.bind_links([Agency], [link_agency_equipment_list]) Link.bind_links([Equipment], [link_equipment_view, link_equipment_edit, link_equipment_delete]) Link.bind_links(['agency_circuit_list', 'circuit_create', Circuit], [link_circuit_create], menu_name='secondary_menu') Link.bind_links([Agency], [link_agency_circuit_list]) Link.bind_links([Circuit], [link_circuit_view, link_circuit_edit, link_circuit_delete]) register_model_list_columns(Equipment, [ {'name': _(u'name'), 'attribute': 'label'}, ]) register_model_list_columns(Circuit, [ {'name': _(u'purpose'), 'attribute': 'purpose'}, {'name': _(u'provider'), 'attribute': 'provider'}, {'name': _(u'technology'), 'attribute': 'technology'},
from __future__ import absolute_import from navigation.api import register_multi_item_links from navigation.classes import Link from project_setup.api import register_setup from .classes import (AccessHolder, AccessObjectClass, ClassAccessHolder, AccessObject) from .links import (acl_detail, acl_grant, acl_revoke, acl_holder_new, acl_setup_valid_classes, acl_class_list, acl_class_acl_list, acl_class_acl_detail, acl_class_new_holder_for, acl_class_grant, acl_class_revoke) Link.bind_links([AccessHolder], [acl_detail]) register_multi_item_links(['acl_detail'], [acl_grant, acl_revoke]) Link.bind_links([AccessObject], [acl_holder_new], menu_name='sidebar') register_setup(acl_setup_valid_classes) Link.bind_links(['acl_setup_valid_classes', 'acl_class_acl_list', 'acl_class_new_holder_for', 'acl_class_acl_detail', 'acl_class_multiple_grant', 'acl_class_multiple_revoke'], [acl_class_list], menu_name='secondary_menu') Link.bind_links([ClassAccessHolder], [acl_class_acl_detail]) Link.bind_links([AccessObjectClass], [acl_class_acl_list, acl_class_new_holder_for]) register_multi_item_links(['acl_class_acl_detail'], [acl_class_grant, acl_class_revoke])
from navigation.classes import Link from navigation.api import register_top_menu from project_setup.api import register_setup from project_tools.api import register_tool from .links import (link_password_change, link_current_user_details, link_current_user_edit, link_about, link_license, link_admin_site, link_sentry) from .models import AutoAdminSingleton import common.settings as common_settings from .settings import (AUTO_CREATE_ADMIN, AUTO_ADMIN_USERNAME, AUTO_ADMIN_PASSWORD, TEMPORARY_DIRECTORY) from .utils import validate_path Link.bind_links( ['current_user_details', 'current_user_edit', 'password_change_view'], [link_current_user_details, link_current_user_edit, link_password_change], menu_name='secondary_menu') Link.bind_links(['about_view', 'license_view'], [link_about, link_license], menu_name='secondary_menu') register_top_menu('about', link=link_about, position=-1) @receiver(post_migrate, dispatch_uid='create_superuser') def create_superuser(sender, **kwargs): """ From https://github.com/lambdalisue/django-qwert/blob/master/qwert/autoscript/__init__.py From http://stackoverflow.com/questions/1466827/ -- Prevent interactive question about wanting a superuser created. (This code has to go in this otherwise empty "models" module so that it gets processed by
from agencies.models import Agency from common.utils import encapsulate from navigation.api import register_top_menu, register_model_list_columns from navigation.classes import Link from .links import (link_agency_tools_profile_list, link_tools_profile_create, link_tools_profile_delete, link_tools_profile_edit, link_tools_profile_view) from .models import ToolsProfile from .permissions import (PERMISSION_TOOLS_PROFILE_CREATE, PERMISSION_TOOLS_PROFILE_DELETE, PERMISSION_TOOLS_PROFILE_EDIT, PERMISSION_TOOLS_PROFILE_VIEW) Link.bind_links( [ToolsProfile, 'agency_tools_profile_list', 'tools_profile_create'], [link_tools_profile_create], menu_name='secondary_menu') Link.bind_links([Agency], [link_agency_tools_profile_list]) Link.bind_links([ToolsProfile], [ link_tools_profile_view, link_tools_profile_edit, link_tools_profile_delete ]) register_model_list_columns(ToolsProfile, [ { 'name': _(u'creation date and time'), 'attribute': encapsulate(lambda x: x.datetime_created) }, ]) #AgencyElement(link_agency_tools_profile_list)
from acls.api import class_permissions #from agencies.classes import AgencyElement from agencies.models import Agency from common.utils import encapsulate from navigation.api import register_top_menu, register_model_list_columns from navigation.classes import Link from .links import (link_data_create, link_data_delete, link_data_edit, link_data_view, link_agency_data_list) from .models import AgencyData from .permissions import (PERMISSION_DATA_CREATE, PERMISSION_DATA_DELETE, PERMISSION_DATA_EDIT, PERMISSION_DATA_VIEW) #Link.bind_links(['data_list'], [link_data_list], menu_name='secondary_menu') Link.bind_links(['agency_data_list', 'data_create', AgencyData], [link_data_create], menu_name='secondary_menu') Link.bind_links([Agency], [link_agency_data_list]) Link.bind_links([AgencyData], [link_data_view, link_data_edit, link_data_delete]) register_model_list_columns(AgencyData, [ {'name': _(u'name'), 'attribute': 'label'}, {'name': _(u'data type'), 'attribute': 'data_type'}, {'name': _(u'description'), 'attribute': 'description'}, ]) #AgencyElement(link_agency_data_list) class_permissions(Agency, [ PERMISSION_DATA_CREATE, PERMISSION_DATA_DELETE, PERMISSION_DATA_EDIT, PERMISSION_DATA_VIEW ] )
from django.contrib.auth.models import User, Group from django.utils.translation import ugettext_lazy as _ from common.utils import encapsulate from common.widgets import two_state_template from navigation.api import (register_multi_item_links, register_model_list_columns, register_top_menu) from navigation.classes import Link from .links import (link_agencies_menu, link_agency_list, link_agency_add, link_agency_edit, link_agency_delete, link_position_add, link_position_delete, link_position_edit, link_position_list, link_department_add, link_department_delete, link_department_edit, link_department_list) from .models import Agency, AgencyPosition, AgencyDepartment Link.bind_links([Agency], [link_agency_edit, link_agency_delete, link_position_list, link_department_list]) Link.bind_links([Agency, 'agency_list', 'agency_add'], [link_agency_list, link_agency_add], menu_name=u'secondary_menu') Link.bind_links([AgencyPosition, 'position_add', 'position_list'], [link_position_add], menu_name=u'sidebar') Link.bind_links([AgencyPosition], [link_position_edit, link_position_delete]) Link.bind_links([AgencyDepartment, 'department_add', 'department_list'], [link_department_add], menu_name=u'sidebar') Link.bind_links([AgencyDepartment], [link_department_edit, link_department_delete]) register_top_menu('agencies_menu', link=link_agencies_menu, position=2) register_model_list_columns(AgencyDepartment, [ { 'name': _(u'main department?'), 'attribute': encapsulate(lambda x: two_state_template(x.main_department).display_small()) },
from navigation.classes import Link from .links import ( link_agency_list, link_agencies, link_agency_edit, link_agency_delete, link_agency_details, link_agency_view, link_agency_acl_details, ) from .models import Agency from .permissions import PERMISSION_AGENCY_VIEW, PERMISSION_AGENCY_EDIT Link.bind_links([Agency, "agency_list"], [link_agency_list], menu_name="secondary_menu") # Link.bind_links([Agency], [link_agency_details, link_agency_view, link_agency_edit, link_agency_delete]) Link.bind_links([Agency], [link_agency_acl_details]) # , link_agency_view, link_agency_edit])#, link_agency_delete]) register_model_list_columns( Agency, [ # {'name': _(u'registration'), 'attribute': 'registration'}, {"name": _(u"name"), "attribute": "name"} ], ) register_top_menu("agencies", link=link_agencies, position=1) class_permissions(Agency, [PERMISSION_AGENCY_VIEW, PERMISSION_AGENCY_EDIT, ACLS_VIEW_ACL, ACLS_EDIT_ACL])
from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.db.models.signals import post_save from navigation.api import register_multi_item_links from navigation.classes import Link from project_setup.api import register_setup from .links import (role_list, role_create, role_edit, role_members, role_permissions, role_delete, permission_grant, permission_revoke) from .models import Role from .settings import DEFAULT_ROLES Link.bind_links([Role], [role_edit, role_delete, role_permissions, role_members]) Link.bind_links([Role, 'role_list', 'role_create'], [role_list, role_create], menu_name='secondary_menu') register_multi_item_links(['role_permissions'], [permission_grant, permission_revoke]) permission_views = [ 'role_list', 'role_create', 'role_edit', 'role_members', 'role_permissions', 'role_delete' ] def user_post_save(sender, instance, **kwargs): if kwargs.get('created', False): for default_role in DEFAULT_ROLES: if isinstance(default_role, Role):
from __future__ import absolute_import from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.db.models.signals import post_save from navigation.api import register_multi_item_links from navigation.classes import Link from project_setup.api import register_setup from .links import (role_list, role_create, role_edit, role_members, role_permissions, role_delete, permission_grant, permission_revoke) from .models import Role from .settings import DEFAULT_ROLES Link.bind_links([Role], [role_edit, role_delete, role_permissions, role_members]) Link.bind_links([Role, 'role_list', 'role_create'], [role_list, role_create], menu_name='secondary_menu') register_multi_item_links(['role_permissions'], [permission_grant, permission_revoke]) permission_views = ['role_list', 'role_create', 'role_edit', 'role_members', 'role_permissions', 'role_delete'] def user_post_save(sender, instance, **kwargs): if kwargs.get('created', False): for default_role in DEFAULT_ROLES: if isinstance(default_role, Role): #If a model is passed, execute method default_role.add_member(instance) else: #If a role name is passed, lookup the corresponding model try:
from __future__ import absolute_import from navigation.api import register_sidebar_template, register_top_menu from navigation.classes import Link from .links import search, search_advanced, search_again register_sidebar_template(['search', 'search_advanced'], 'search_help.html') #Link.bind_links(['search', 'search_advanced', 'results'], [search, search_advanced], menu_name='form_header') Link.bind_links(['search', 'search_advanced', 'results'], [search], menu_name='form_header') Link.bind_links(['results'], [search_again], menu_name='sidebar') register_sidebar_template(['search', 'search_advanced', 'results'], 'recent_searches.html') #register_top_menu('search', link=search)
from navigation.classes import Link from navigation.api import register_top_menu from project_setup.api import register_setup from project_tools.api import register_tool from .links import (link_password_change, link_current_user_details, link_current_user_edit, link_about, link_license, link_admin_site, link_sentry) from .models import AutoAdminSingleton import common.settings as common_settings from .settings import (AUTO_CREATE_ADMIN, AUTO_ADMIN_USERNAME, AUTO_ADMIN_PASSWORD, TEMPORARY_DIRECTORY) from .utils import validate_path Link.bind_links(['current_user_details', 'current_user_edit', 'password_change_view'], [link_current_user_details, link_current_user_edit, link_password_change], menu_name='secondary_menu') Link.bind_links(['about_view', 'license_view'], [link_about, link_license], menu_name='secondary_menu') register_top_menu('about', link=link_about, position=-1) @receiver(post_migrate, dispatch_uid='create_superuser') def create_superuser(sender, **kwargs): """ From https://github.com/lambdalisue/django-qwert/blob/master/qwert/autoscript/__init__.py From http://stackoverflow.com/questions/1466827/ -- Prevent interactive question about wanting a superuser created. (This code has to go in this otherwise empty "models" module so that it gets processed by the "syncdb" command during database creation.)
from __future__ import absolute_import from django.contrib.auth.models import User, Group from navigation.api import register_multi_item_links from navigation.classes import Link from project_setup.api import register_setup from .links import (user_list, user_setup, user_edit, user_add, user_delete, user_multiple_delete, user_set_password, user_multiple_set_password, user_groups, group_list, group_setup, group_edit, group_add, group_delete, group_multiple_delete, group_members) Link.bind_links([User], [user_edit, user_set_password, user_groups, user_delete]) Link.bind_links([User, 'user_multiple_set_password', 'user_multiple_delete', 'user_list', 'user_add'], [user_list, user_add], menu_name=u'secondary_menu') register_multi_item_links(['user_list'], [user_multiple_set_password, user_multiple_delete]) Link.bind_links([Group], [group_edit, group_members, group_delete]) Link.bind_links(['group_multiple_delete', 'group_delete', 'group_edit', 'group_list', 'group_add', 'group_members'], [group_list, group_add], menu_name=u'secondary_menu') register_multi_item_links(['group_list'], [group_multiple_delete]) user_management_views = [ 'user_list', 'user_edit', 'user_add', 'user_delete', 'user_multiple_delete', 'user_set_password', 'user_multiple_set_password', 'group_list', 'group_edit', 'group_add', 'group_delete', 'group_multiple_delete', 'group_members' ] register_setup(user_setup) register_setup(group_setup)
from django.contrib.auth.models import User, Group from django.utils.translation import ugettext_lazy as _ from common.utils import encapsulate from common.widgets import two_state_template from navigation.api import register_multi_item_links, register_model_list_columns from navigation.classes import Link from project_setup.api import register_setup from .links import (user_list, user_setup, user_edit, user_add, user_delete, user_multiple_delete, user_set_password, user_multiple_set_password, user_groups, group_list, group_setup, group_edit, group_add, group_delete, group_multiple_delete, group_members) Link.bind_links([User], [user_edit, user_set_password, user_groups, user_delete]) Link.bind_links([ User, 'user_multiple_set_password', 'user_multiple_delete', 'user_list', 'user_add' ], [user_list, user_add], menu_name=u'secondary_menu') register_multi_item_links(['user_list'], [user_multiple_set_password, user_multiple_delete]) Link.bind_links([Group], [group_edit, group_members, group_delete]) Link.bind_links([ 'group_multiple_delete', 'group_delete', 'group_edit', 'group_list', 'group_add', 'group_members' ], [group_list, group_add], menu_name=u'secondary_menu') register_multi_item_links(['group_list'], [group_multiple_delete])
from common.utils import encapsulate from common.widgets import two_state_template from navigation.api import (register_multi_item_links, register_model_list_columns, register_top_menu) from navigation.classes import Link from .links import (link_agencies_menu, link_agency_list, link_agency_add, link_agency_edit, link_agency_delete, link_position_add, link_position_delete, link_position_edit, link_position_list, link_department_add, link_department_delete, link_department_edit, link_department_list) from .models import Agency, AgencyPosition, AgencyDepartment Link.bind_links([Agency], [ link_agency_edit, link_agency_delete, link_position_list, link_department_list ]) Link.bind_links([Agency, 'agency_list', 'agency_add'], [link_agency_list, link_agency_add], menu_name=u'secondary_menu') Link.bind_links([AgencyPosition, 'position_add', 'position_list'], [link_position_add], menu_name=u'sidebar') Link.bind_links([AgencyPosition], [link_position_edit, link_position_delete]) Link.bind_links([AgencyDepartment, 'department_add', 'department_list'], [link_department_add], menu_name=u'sidebar') Link.bind_links([AgencyDepartment], [link_department_edit, link_department_delete])
from common.utils import encapsulate from dynamic_search.classes import SearchModel from navigation.api import register_top_menu, register_model_list_columns from navigation.classes import Link from .links import (link_projects, link_project_edit, link_project_view, link_project_delete, link_project_create, link_agency_project_list, #link_project_info_view, link_project_info_edit, link_project_info_delete, #link_project_budget_view, link_project_view_basic, link_project_budget_edit, link_project_budget_delete, #link_project_details_view, link_project_details_edit, link_project_details_delete, link_project_file_list, link_project_file_upload, link_project_file_delete, link_project_file_download) from .models import (Project, ProjectInfo, ProjectBudget, ProjectFile) from .permissions import (PERMISSION_PROJECT_EDIT, PERMISSION_PROJECT_DELETE, PERMISSION_PROJECT_VIEW, PERMISSION_PROJECT_CREATE) Link.bind_links([Agency], [link_agency_project_list]) Link.bind_links([Project, 'agency_infrastructure_project_list', 'infrastructure_project_create'], [link_project_create], menu_name='secondary_menu') Link.bind_links([Project], [link_project_view, link_project_edit, link_project_delete]) #Link.bind_links([Project], [link_project_info_view, link_project_budget_view, link_project_details_view, link_project_opportunities_view, link_project_file_list, link_project_workflow_instance_list], menu_name='form_header') Link.bind_links([Project], [link_project_view, link_project_file_list], menu_name='form_header') #Link.bind_links([ProjectInfo], [link_project_info_edit, link_project_info_delete]) #Link.bind_links([ProjectBudget], [link_project_budget_edit, link_project_budget_delete]) #Link.bind_links([ProjectDetails], [link_project_details_edit, link_project_details_delete]) Link.bind_links([ProjectFile, 'infrastructure_project_file_upload', 'infrastructure_project_file_list'], [link_project_file_upload], menu_name='secondary_menu') Link.bind_links([ProjectFile], [link_project_file_download, link_project_file_delete]) register_model_list_columns(Project, [ {'name': _(u'name'), 'attribute': 'label'}, # {'name': _(u'completion (%)'), 'attribute': encapsulate(lambda x: x.get_completion())},
from django.utils.translation import ugettext_lazy as _ from acls.api import class_permissions #from agencies.classes import AgencyElement from agencies.models import Agency from common.utils import encapsulate from navigation.api import register_top_menu, register_model_list_columns from navigation.classes import Link from .links import (link_agency_software_list, link_agency_software_create, link_agency_software_delete, link_agency_software_edit, link_agency_software_view) from .models import Agency, AgencySoftware from .permissions import (PERMISSION_AGENCY_SOFTWARE_CREATE, PERMISSION_AGENCY_SOFTWARE_DELETE, PERMISSION_AGENCY_SOFTWARE_EDIT, PERMISSION_AGENCY_SOFTWARE_VIEW) Link.bind_links(['agency_software_list', 'data_create', AgencySoftware], [link_agency_software_create], menu_name='secondary_menu') Link.bind_links([Agency], [link_agency_software_list]) Link.bind_links([AgencySoftware], [link_agency_software_view, link_agency_software_edit, link_agency_software_delete]) register_model_list_columns(AgencySoftware, [ {'name': _(u'type'), 'attribute': 'software.software_type'}, {'name': _(u'label'), 'attribute': 'software.label'}, {'name': _(u'amount'), 'attribute': 'amount'}, ]) #AgencyElement(link_agency_tools_profile_list) class_permissions(Agency, [ PERMISSION_AGENCY_SOFTWARE_CREATE, PERMISSION_AGENCY_SOFTWARE_DELETE, PERMISSION_AGENCY_SOFTWARE_EDIT, PERMISSION_AGENCY_SOFTWARE_VIEW ] )
from acls.api import class_permissions #from agencies.classes import AgencyElement from agencies.models import Agency from common.utils import encapsulate from navigation.api import register_top_menu, register_model_list_columns from navigation.classes import Link from .links import (link_data_create, link_data_delete, link_data_edit, link_data_view, link_agency_data_list) from .models import AgencyData from .permissions import (PERMISSION_DATA_CREATE, PERMISSION_DATA_DELETE, PERMISSION_DATA_EDIT, PERMISSION_DATA_VIEW) #Link.bind_links(['data_list'], [link_data_list], menu_name='secondary_menu') Link.bind_links(['agency_data_list', 'data_create', AgencyData], [link_data_create], menu_name='secondary_menu') Link.bind_links([Agency], [link_agency_data_list]) Link.bind_links([AgencyData], [link_data_view, link_data_edit, link_data_delete]) register_model_list_columns(AgencyData, [ { 'name': _(u'name'), 'attribute': 'label' }, { 'name': _(u'data type'), 'attribute': 'data_type' }, {
from django.utils.translation import ugettext_lazy as _ from acls.api import class_permissions #from agencies.classes import AgencyElement from agencies.models import Agency from common.utils import encapsulate from navigation.api import register_top_menu, register_model_list_columns from navigation.classes import Link from .links import (link_agency_tools_profile_list, link_tools_profile_create, link_tools_profile_delete, link_tools_profile_edit, link_tools_profile_view) from .models import ToolsProfile from .permissions import (PERMISSION_TOOLS_PROFILE_CREATE, PERMISSION_TOOLS_PROFILE_DELETE, PERMISSION_TOOLS_PROFILE_EDIT, PERMISSION_TOOLS_PROFILE_VIEW) Link.bind_links([ToolsProfile, 'agency_tools_profile_list', 'tools_profile_create'], [link_tools_profile_create], menu_name='secondary_menu') Link.bind_links([Agency], [link_agency_tools_profile_list]) Link.bind_links([ToolsProfile], [link_tools_profile_view, link_tools_profile_edit, link_tools_profile_delete]) register_model_list_columns(ToolsProfile, [ {'name': _(u'creation date and time'), 'attribute': encapsulate(lambda x: x.datetime_created)}, ]) #AgencyElement(link_agency_tools_profile_list) class_permissions(Agency, [ PERMISSION_TOOLS_PROFILE_CREATE, PERMISSION_TOOLS_PROFILE_DELETE, PERMISSION_TOOLS_PROFILE_EDIT, PERMISSION_TOOLS_PROFILE_VIEW ] )
link_project_delete, link_project_create, link_agency_project_list, link_project_info_view, link_project_info_edit, link_project_info_delete, link_project_budget_view, link_project_view_basic, link_project_budget_edit, link_project_budget_delete, link_project_details_view, link_project_details_edit, link_project_details_delete, link_project_opportunities_view, link_project_opportunities_edit, link_project_opportunities_delete, link_project_file_list, link_project_file_upload, link_project_file_delete, link_project_file_download, link_project_workflow_instance_list, link_project_workflow_instance_history_list, link_project_workflow_instance_action_submit,link_project_reports_view) from .models import (Project, ProjectInfo, ProjectBudget, ProjectDetails, ProjectOpportunities, ProjectFile) # prime workflow permissions from .permissions import PERMISSION_PROJECT_SUBMIT from .permissions import (PERMISSION_PROJECT_EDIT, PERMISSION_PROJECT_DELETE, PERMISSION_PROJECT_VIEW, PERMISSION_PROJECT_CREATE) Link.bind_links([Agency], [link_agency_project_list]) Link.bind_links([Project, 'agency_project_list', 'project_create'], [link_project_create], menu_name='secondary_menu') Link.bind_links([Project], [link_project_view, link_project_edit, link_project_delete]) Link.bind_links([Project], [link_project_view_basic, link_project_info_view, link_project_budget_view, link_project_details_view, link_project_opportunities_view, link_project_file_list, link_project_workflow_instance_list, link_project_reports_view], menu_name='form_header') Link.bind_links([ProjectInfo], [link_project_info_edit, link_project_info_delete]) Link.bind_links([ProjectBudget], [link_project_budget_edit, link_project_budget_delete]) Link.bind_links([ProjectDetails], [link_project_details_edit, link_project_details_delete]) Link.bind_links([ProjectOpportunities], [link_project_opportunities_edit, link_project_opportunities_delete]) Link.bind_links([ProjectFile, 'project_file_upload', 'project_file_list'], [link_project_file_upload], menu_name='secondary_menu') Link.bind_links([ProjectFile], [link_project_file_download, link_project_file_delete]) Link.bind_links([WorkflowInstance], [link_project_workflow_instance_history_list, link_project_workflow_instance_action_submit]) #p = ProgressBar()
user_add, user_delete, user_multiple_delete, user_set_password, user_multiple_set_password, user_groups, group_list, group_setup, group_edit, group_add, group_delete, group_multiple_delete, group_members, ) Link.bind_links([User], [user_edit, user_set_password, user_groups, user_delete]) Link.bind_links( [User, "user_multiple_set_password", "user_multiple_delete", "user_list", "user_add"], [user_list, user_add], menu_name=u"secondary_menu", ) register_multi_item_links(["user_list"], [user_multiple_set_password, user_multiple_delete]) Link.bind_links([Group], [group_edit, group_members, group_delete]) Link.bind_links( ["group_multiple_delete", "group_delete", "group_edit", "group_list", "group_add", "group_members"], [group_list, group_add], menu_name=u"secondary_menu", ) register_multi_item_links(["group_list"], [group_multiple_delete])
from django.utils.translation import ugettext_lazy as _ from acls.api import class_permissions from acls.permissions import ACLS_EDIT_ACL, ACLS_VIEW_ACL from common.utils import encapsulate from dynamic_search.classes import SearchModel from navigation.api import register_top_menu, register_model_list_columns from navigation.classes import Link from .links import (link_agency_list, link_agencies, link_agency_edit, link_agency_delete, link_agency_details, link_agency_view, link_agency_acl_details) from .models import Agency from .permissions import PERMISSION_AGENCY_VIEW, PERMISSION_AGENCY_EDIT Link.bind_links([Agency, 'agency_list'], [link_agency_list], menu_name='secondary_menu') #Link.bind_links([Agency], [link_agency_details, link_agency_view, link_agency_edit, link_agency_delete]) Link.bind_links( [Agency], [link_agency_acl_details ]) #, link_agency_view, link_agency_edit])#, link_agency_delete]) register_model_list_columns( Agency, [ #{'name': _(u'registration'), 'attribute': 'registration'}, { 'name': _(u'name'), 'attribute': 'name' }, ])
link_project_budget_delete, link_project_details_view, link_project_details_edit, link_project_details_delete, link_project_opportunities_view, link_project_opportunities_edit, link_project_opportunities_delete, link_project_file_list, link_project_file_upload, link_project_file_delete, link_project_file_download, link_project_workflow_instance_list, link_project_workflow_instance_history_list, link_project_workflow_instance_action_submit, link_project_reports_view) from .models import (Project, ProjectInfo, ProjectBudget, ProjectDetails, ProjectOpportunities, ProjectFile) # prime workflow permissions from .permissions import PERMISSION_PROJECT_SUBMIT from .permissions import (PERMISSION_PROJECT_EDIT, PERMISSION_PROJECT_DELETE, PERMISSION_PROJECT_VIEW, PERMISSION_PROJECT_CREATE) Link.bind_links([Agency], [link_agency_project_list]) Link.bind_links([Project, 'agency_project_list', 'project_create'], [link_project_create], menu_name='secondary_menu') Link.bind_links([Project], [link_project_view, link_project_edit, link_project_delete]) Link.bind_links([Project], [ link_project_view_basic, link_project_info_view, link_project_budget_view, link_project_details_view, link_project_opportunities_view, link_project_file_list, link_project_workflow_instance_list, link_project_reports_view ], menu_name='form_header') Link.bind_links([ProjectInfo],