Removing Views from Mayan

308 views
Skip to first unread message

Rachael Sewell

unread,
Jan 15, 2016, 7:18:43 PM1/15/16
to Mayan EDMS
Hello,

I'm looking for the best way to customize/remove some views in Mayan. Currently, we won't need:

Trash (deleting documents)
Indexes
Folders
Checkouts
Signatures

I'm able to comment out adding menu items to the menu_main and menu_facet, and menu_object in apps.py to customize what I see, but I'm not sure that this is the right place to remove the view. 

What I'd like to do is customize the navigation bar to include:
* A logout button drop-down from the User button on the right
* A create document link
* Recent Documents

Then I would remove those duplicate items from the home page area. 

Ideally, I'd like to add a button to display My Workflow and My Documents to the navigation bar.

Any pointers to the right place to do this to allow compatibility with Mayan would be great.

Rachael

Roberto Rosario

unread,
Jan 16, 2016, 3:39:30 AM1/16/16
to mayan...@googlegroups.com
Hi,

To customize the navigation create a bare-bones app. In the ready() method unbind the links of the other apps.

        from common import menu_main, menu_front_page
        from folders.links import link_folder_list

        # Remove "Folders" link from main menu
        menu_main.unbind_links(
            links=(link_folder_list,),
        )

        # Remove Trash link from home page
        from documents.links import link_document_list_deleted
        menu_front_page.unbind_links(
            links=(
                link_document_list_deleted,
            )
        )

        # Add "New document" to main menu
        from sources.links import link_document_create_multiple
        menu_main.bind_links(
            links=(link_document_create_multiple,),
        )



The logic to bind a link to a menu is

menu_instance.bind_link(
links=<link instances list>,
source=<which classes of object or which views>
)

Values of Source:
  • If source is omitted the link will always be enabled (such as in the main menu).
  • Specifying a class will only enable the link is an instance of that class is present in the rendered view context.
  • Specifying a string as the source will enable the link for a specific view.

The logic to unbind a link is the same, only using the 'unbind' method.



--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mayan-edms+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rachael Sewell

unread,
Jan 21, 2016, 9:30:39 PM1/21/16
to Mayan EDMS
Hi Roberto,

I noticed that some of the links will be removed but not all of the ones that I unbind. I created a new app navigation_customize and added it to my installed apps and then called the unbind_link() method. I noticed that some of the links would be removed and that depended on where in the list of installed apps, that I added navigation_customize. Is there an order of operations issue here? I ended up just removing several apps from the project to remove all of the unnecessary views:

Checkouts
Indexes
Folders
Signatures

Rachael

Roberto Rosario

unread,
Jan 29, 2016, 5:01:18 PM1/29/16
to Mayan EDMS
That is an unexpected behavior. The unbind method stores unbinded links in their own list (https://gitlab.com/mayan-edms/mayan-edms/blob/master/mayan/apps/navigation/classes.py#L192) this way they can be removed from the resolved links list even if they are unbinded before or after being created (https://gitlab.com/mayan-edms/mayan-edms/blob/master/mayan/apps/navigation/classes.py#L173). The idea is making unbinding commutative.

A test is needed to diagnose and fix this.

Diego R.

unread,
Sep 29, 2017, 3:30:55 PM9/29/17
to Mayan EDMS
This post is exaclty what i'm looking for. There is a guide somewhere to help me create a "bare bones app", unbind the menus and all the stuff talked about here? I just want a very simple Document Archive with a search function and ACL. Can someone help me? Thanks!

Rachael Sewell

unread,
Sep 30, 2017, 12:00:22 PM9/30/17
to mayan...@googlegroups.com
Hi Diego,

Unfortunately, i won't be much help. I want able to get all the features I needed to work in Mayan. There were some limitations which prevented me from making all the modifications I needed. I ended up using a different open source project called seeddms. I ended up forking it from sourceforge and modifying it heavily on github.

Github.com/rachmari/seeddms
Github.com/rachmari/seedbox

Rachael

All the best,
Rachael

From: mayan...@googlegroups.com <mayan...@googlegroups.com> on behalf of Diego R. <dieg...@gmail.com>
Sent: Friday, September 29, 2017 12:30:55 PM
To: Mayan EDMS
Subject: [Mayan EDMS: 2145] Re: Removing Views from Mayan
 
--

---
You received this message because you are subscribed to a topic in the Google Groups "Mayan EDMS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mayan-edms/5411pkKBXoE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mayan-edms+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages