# ############################################################################## # This file contains the principle definition of the module. # The contents of this file will be hooked into the namespace in which it # is imported. In this case to import this module we would add the following # to main.py (in the module loading section): # # import modules.organization # from base import add_content_module from base import register_data_models from base.module import ContentModule org_mod = ContentModule('organization', __name__) # ############################################################################## # main menu org_mod.add_menu('About Us', 'organization.default' ) # ############################################################################## # side panel menu org_mod.add_side_menu( 'Organization/Officers', # Side panel title [ ( 'Update Offices', 'organization.update_offices' ), ( 'Update Officers', 'organization.edit_officer' ), ( 'Edit About Us', 'organization.edit_aboutus') ], 'admin'
# ######################################################################3####### # imports from base import base_app, add_content_module, register_data_models, url_for from base.module import ContentModule # ######################################################################3####### # Initialization newsMod = ContentModule('news', __name__) newsMod.add_menu('News', 'news.default' ) newsMod.add_side_menu( 'News', [ ('Add Post', 'news.add_post'), ('List Posts', 'news.admin_list_posts') ], 'admin' ) import models import views # ######################################################################3####### # Hooking into main website add_content_module( newsMod ) # ######################################################################3####### # Register data models
from base import add_content_module from base import register_data_models from base import register_user_role from base import url_for from base.module import ContentModule # ############################################################################## # Define the ContentModule object which will hook into the main website # the first argument specifies the modules 'name', and the second specifies the # package that contains the module. # seminar_mod = ContentModule('seminars', __name__) # ############################################################################## # Add a main menu entry seminar_mod.add_menu('Seminars', 'seminars.default') # ############################################################################## # Add a side panel menu seminar_mod.add_side_menu( 'Seminars', # Side panel title [ ( 'Add Seminar', 'seminars.add_seminar' ), ( 'Edit Seminars', 'seminars.update_seminars' ), ( 'Edit Talks', 'seminars.update_talks' ) ], 'seminar-organizer'
# ######################################################################3####### # imports from base import base_app, add_content_module, register_data_models, url_for from base import register_user_role from base.module import ContentModule # ######################################################################3####### # Initialization articles_mod = ContentModule('articles', __name__) articles_mod.add_menu('Articles', 'articles.default' ) articles_mod.add_side_menu( 'Articles', [ ('Add Article', 'articles.add_article'), ('Edit Articles', 'articles.update_articles') ], 'contributor' ) import models import views # ######################################################################3####### # Hooking into main website add_content_module( articles_mod ) # ######################################################################3#######
# -> Update templates/js/css files # # import modules.admin # from base import add_content_module from base import register_data_models from base import register_user_role from base import url_for from base.module import ContentModule from base.utils.autoindex import AutoIndex # ############################################################################## # Define the ContentModule object admin_mod = ContentModule('ifadmin', __name__) # ############################################################################## # define aux objects #templates_obj = AutoIndex(admin_mod, browse_root="static" ) # ############################################################################## # Add admin side panel menu admin_mod.add_side_menu( 'Administration', # Side panel title [ # A link which will be in the side-menu # the format is: ([Name], [target])
# # import modules.example # from base import add_content_module from base import register_data_models from base import url_for from base.module import ContentModule # ############################################################################## # Define the ContentModule object which will hook into the main website # the first argument specifies the modules 'name', and the second specifies the # package that contains the module. # example_mod = ContentModule('example', __name__) # ############################################################################## # Add a main menu entry # The display name in this case will be: Example # And the target for the link will be: url_for('example.default') # # Note: when we specify a link for a view in a module, we do so with the # convention: [module name].[function name] # # Note: we can add more than one menu entry by calling this function again # example_mod.add_menu('Example', 'example.default') # ##############################################################################
# ############################################################################## # Module: usertools # Synop: A collection of views which allow the user to update his/her profile # and provides a sidepane menu including links for logout, and others # actions # Menus: # Main menu: none # Side menu: user info access, and logout # from base import add_content_module, register_data_models, url_for from base.module import ContentModule from base.user import Role, User usertools_mod = ContentModule('usertools', __name__) usertools_mod.add_side_menu( 'User', # Side panel title [ ( 'Update Information', 'user_update' ), ( 'Logout', 'auth_logout' ) ] ) # attach module to website add_content_module( usertools_mod ) register_data_models([User, Role])