コード例 #1
0
class Plugin(ad.Plugin):
    """The config descriptor for this plugin."""

    verbose_name = _("Products")
    needs_plugins = ['lino_xl.lib.xl']
    menu_group = 'products'

    def setup_config_menu(self, site, user_type, m):
        mg = self.get_menu_group()
        # if site.is_installed('sales'):
        #     mg = site.plugins.sales
        # else:
        #     mg = self
        m = m.add_menu(mg.app_label, mg.verbose_name)
        for pt in site.models.products.ProductTypes.get_list_items():
            m.add_action(pt.table_name, label=pt.text)
        # m.add_action('products.Products')
        m.add_action('products.ProductCats')

        # mg = site.plugins.sales
        # m2 = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('products.PriceRules')

    def setup_explorer_menu(self, site, user_type, m):
        mg = self.get_menu_group()
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('products.PriceFactors')
コード例 #2
0
ファイル: __init__.py プロジェクト: forexblog/xl
class Plugin(ad.Plugin):
    "See :class:`lino.core.Plugin`."
    verbose_name = _("Lists")
    partner_model = 'contacts.Partner'
    menu_group = 'contacts'

    def on_site_startup(self, site):
        self.partner_model = site.models.resolve(self.partner_model)
        super(Plugin, self).on_site_startup(site)

    def setup_main_menu(self, site, user_type, m):
        # mg = site.plugins.contacts
        mg = self.get_menu_group()
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('lists.Lists')

    def setup_config_menu(self, site, user_type, m):
        mg = self.get_menu_group()
        # mg = site.plugins.contacts
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('lists.ListTypes')

    def setup_explorer_menu(self, site, user_type, m):
        mg = self.get_menu_group()
        # mg = site.plugins.contacts
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('lists.AllMembers')
コード例 #3
0
class Plugin(ad.Plugin):
    verbose_name = _("Groups")
    # member_model = 'users.User'
    menu_group = 'system'
    needs_plugins = ['lino.modlib.comments']

    # def on_plugins_loaded(self, site):
    #     site.plugins.comments.configure(
    #         commentable_model = 'groups.Group')

    # def on_site_startup(self, site):
    #     self.member_model = site.models.resolve(self.member_model)
    #     super(Plugin, self).on_site_startup(site)

    def setup_config_menu(self, site, user_type, m):
        mg = self.get_menu_group()
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('groups.Groups')

    def setup_explorer_menu(self, site, user_type, m):
        mg = self.get_menu_group()
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('groups.AllMemberships')

    def get_dashboard_items(self, user):
        yield self.site.models.groups.MyGroups
コード例 #4
0
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."

    verbose_name = _("System")

    needs_plugins = ['lino.modlib.printing']

    def setup_config_menu(self, site, user_type, m):
        system = m.add_menu(self.app_label, self.verbose_name)
        system.add_instance_action(site.site_config)
        

    def on_site_startup(self, site):
        super(Plugin, self).on_site_startup(site)

        from lino.modlib.system.mixins import Lockable

        if len(list(Lockable.get_lockables())):
            def welcome_messages(ar):
                locked_rows = list(Lockable.get_lockable_rows(ar.get_user()))
                if locked_rows:
                    chunks = [
                        ugettext("You have a dangling edit lock on"), " "]
                    chunks += join_elems(
                        [ar.obj2html(obj) for obj in locked_rows], ", ")
                    chunks.append('.')
                    yield E.div(*chunks)

            site.add_welcome_handler(welcome_messages)
コード例 #5
0
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."

    verbose_name = _("System")

    needs_plugins = ['lino.modlib.printing']

    def setup_config_menu(self, site, user_type, m):
        system = m.add_menu(self.app_label, self.verbose_name)
        system.add_instance_action(site.site_config)

    def on_site_startup(self, site):
        super(Plugin, self).on_site_startup(site)
        from lino.core.utils import models_by_base
        if len(list(models_by_base(site.models.system.Lockable))):

            def welcome_messages(ar):
                def fmt(model, pk):
                    try:
                        obj = model.objects.get(pk=pk)
                    except model.DoesNotExist:
                        return "{}{}".format(model.__name__, pk)
                    return ar.obj2html(obj)

                up = ar.get_user().get_preferences()
                if len(up.locked_rows):
                    chunks = [
                        ugettext("You have a dangling edit lock on"), " "
                    ]
                    chunks += join_elems(
                        [fmt(m, pk) for m, pk in up.locked_rows], ", ")
                    chunks.append('.')
                    yield E.span(*chunks)

            site.add_welcome_handler(welcome_messages)
コード例 #6
0
class Plugin(ad.Plugin):
    "See :class:`lino.core.Plugin`."

    verbose_name = _("Excerpts")

    needs_plugins = [
        'lino.modlib.gfks', 'lino.modlib.printing',
        'lino.modlib.office', 'lino_xl.lib.xl']

    # _default_template_handlers = {}

    responsible_user = None
    """
    The username of the user responsible for monitoring the excerpts
    system.  This is currently used only by
    :mod:`lino_xl.lib.excerpts.fixtures.demo2`.
    """

    def setup_main_menu(self, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('excerpts.MyExcerpts')

    def setup_config_menu(self, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('excerpts.ExcerptTypes')

    def setup_explorer_menu(self, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('excerpts.AllExcerpts')
コード例 #7
0
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."

    verbose_name = _("Concepts")

    def setup_main_menu(self, site, user_type, m):
        m = m.add_menu(self.app_label, self.verbose_name)
        m.add_action('concepts.Concepts')
コード例 #8
0
ファイル: __init__.py プロジェクト: einarfelix/xl
class Plugin(ad.Plugin):
    "See :class:`lino.core.Plugin`."
    verbose_name = _("Rooms")
    menu_group = "cal"

    def setup_main_menu(self, site, user_type, m):
        mg = self.get_menu_group()
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('rooms.Bookings')
コード例 #9
0
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."

    verbose_name = _("Boards")

    def setup_config_menu(self, site, user_type, m):
        p = self.get_menu_group()
        m = m.add_menu(p.app_label, p.verbose_name)
        m.add_action('languages.Languages')
コード例 #10
0
ファイル: __init__.py プロジェクト: DarioGT/lino
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."

    verbose_name = _("Products")

    def setup_main_menu(self, site, profile, m):
        m = m.add_menu(self.app_label, self.verbose_name)
        m.add_action('products.Products')
        m.add_action('products.ProductCats')
コード例 #11
0
ファイル: __init__.py プロジェクト: DarioGT/lino
class Plugin(ad.Plugin):

    "See :doc:`/dev/plugins`."

    verbose_name = _("Families")

    def setup_explorer_menu(config, site, profile, m):
        mg = site.plugins.contacts
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('families.Couples')
コード例 #12
0
ファイル: __init__.py プロジェクト: forexblog/xl
class Plugin(ad.Plugin):

    "See :class:`lino.core.Plugin`."

    verbose_name = _("Families")

    def setup_explorer_menu(config, site, user_type, m):
        mg = site.plugins.contacts
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('families.Couples')
コード例 #13
0
class Plugin(ad.Plugin):

    verbose_name = _("Dupe control")

    needs_plugins = ['lino.modlib.gfks']

    def setup_explorer_menu(self, site, user_type, main):
        mg = site.plugins.system
        m = main.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('dupable.PhoneticWords')
コード例 #14
0
ファイル: __init__.py プロジェクト: forexblog/xl
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."

    verbose_name = _("Events")

    def setup_config_menu(self, site, user_type, m):
        m = m.add_menu(self.app_label, self.verbose_name)
        m.add_action('events.Types')
        m.add_action('events.Places')
        m.add_action('events.Features')

    def setup_main_menu(self, site, user_type, m):
        m = m.add_menu(self.app_label, self.verbose_name)
        m.add_action('events.Events')
コード例 #15
0
ファイル: __init__.py プロジェクト: DarioGT/lino
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."

    verbose_name = _("Projects")

    def setup_main_menu(self, site, profile, m):
        m = m.add_menu(self.app_label, self.verbose_name)
        m.add_action('projects.MyProjects')

    def setup_config_menu(self, site, profile, m):
        m = m.add_menu(self.app_label, self.verbose_name)
        m.add_action('projects.ProjectTypes')

    def setup_explorer_menu(self, site, profile, m):
        m = m.add_menu(self.app_label, self.verbose_name)
        m.add_action('projects.Projects')
コード例 #16
0
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."

    verbose_name = _("Uploads")

    def setup_main_menu(config, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('uploads.MyUploads')

    def setup_config_menu(config, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('uploads.UploadTypes')

    def setup_explorer_menu(config, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('uploads.AllUploads')
        m.add_action('uploads.UploadAreas')
コード例 #17
0
ファイル: __init__.py プロジェクト: TonisPiip/xl
class Plugin(ad.Plugin):
    "See :class:`lino.core.Plugin`."

    verbose_name = _("Properties")

    def setup_explorer_menu(self, site, profile, m):
        m = m.add_menu(self.app_label, self.verbose_name)
        m.add_action('properties.Properties')

    def setup_config_menu(self, site, profile, m):
        m = m.add_menu(self.app_label, self.verbose_name)
        m.add_action('properties.PropGroups')
        m.add_action('properties.PropTypes')
        PropGroup = site.modules.properties.PropGroup
        PropsByGroup = site.modules.properties.PropsByGroup
        for pg in PropGroup.objects.all():
            m.add_action(
                PropsByGroup,
                params=dict(master_instance=pg),
                #~ label=pg.name)
                label=unicode(pg))
コード例 #18
0
ファイル: __init__.py プロジェクト: forexblog/lino
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."
    verbose_name = _("Comments")

    site_js_snippets = ['comments/comments.js']

    needs_plugins = ['lino.modlib.office', 'lino.modlib.memo']

    private_default = True
    """Whether comments are private by default.

    The default value for the :attr:`lino.modlib.comments.Comment.private`
    field.

    """
    def setup_main_menu(self, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('comments.MyComments')
        # if self.user_must_publish:
        #     m.add_action('comments.MyPendingComments')
        m.add_action('comments.RecentComments')

    def setup_config_menu(self, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('comments.CommentTypes')

    def setup_explorer_menu(self, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('comments.AllComments')
        m.add_action('comments.Mentions')
        m.add_action('comments.Reactions')

    def get_dashboard_items(self, user):
        # if self.user_must_publish:
        #     yield self.site.models.comments.MyPendingComments
        yield self.site.models.comments.RecentComments
コード例 #19
0
ファイル: __init__.py プロジェクト: gary-ops/lino
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."

    verbose_name = _("Uploads")
    menu_group = "office"

    def setup_main_menu(self, site, user_type, m):
        mg = self.get_menu_group()
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('uploads.MyUploads')

    def setup_config_menu(self, site, user_type, m):
        mg = self.get_menu_group()
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('uploads.Volumes')
        m.add_action('uploads.UploadTypes')

    def setup_explorer_menu(self, site, user_type, m):
        mg = self.get_menu_group()
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('uploads.AllUploads')
        m.add_action('uploads.UploadAreas')
コード例 #20
0
ファイル: __init__.py プロジェクト: NewRGB/lino
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."
    verbose_name = _("Comments")

    site_js_snippets = ['comments/comments.js']

    needs_plugins = ['lino.modlib.office', 'lino.modlib.memo']

    # user_must_publish = True
    # """
    # Whether the users are invited to "publish" their comments.
    # """

    def setup_main_menu(self, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('comments.MyComments')
        # if self.user_must_publish:
        #     m.add_action('comments.MyPendingComments')
        m.add_action('comments.RecentComments')

    def setup_config_menu(self, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('comments.CommentTypes')

    def setup_explorer_menu(self, site, user_type, m):
        mg = site.plugins.office
        m = m.add_menu(mg.app_label, mg.verbose_name)
        m.add_action('comments.AllComments')
        m.add_action('comments.Mentions')

    def get_dashboard_items(self, user):
        # if self.user_must_publish:
        #     yield self.site.models.comments.MyPendingComments
        yield self.site.models.comments.RecentComments
コード例 #21
0
ファイル: __init__.py プロジェクト: gary-ops/lino
class Plugin(ad.Plugin):
    "See :doc:`/dev/plugins`."
    verbose_name = _("Export to Excel xls format")