Quantcast

[Mayan EDMS: 1567] Metadata display on Preview screen

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mayan EDMS: 1567] Metadata display on Preview screen

MacRobb Simpson
Hello,

I'm trying to rig up a 'main' screen for Document display for our organization.
It needs to do two things:
1. Display the raw PDF file(the preview images feature works OK, but it's not quite what we need).
I've made this work already by changing the content of DocumentPagesCarouselWidget to just spit out an Iframe, and modified document_download to just spit out the raw file on GET if only a single Document ID is given.
Hackish but it works.

2. Display Metadata on the same page(preferably just a list of Key -> Value in a small table somewhere).
Unfortunately, I can't really figure this out. The code is so well abstracted that I'm just plain not sure where things are hiding.

I would like to do one of these:
1. Modify the preview screen to add metadata to, say, the top or sidebar
2. Add a metadata table to the sidebar of *all* of the Document Detail screens
3. Create a new (default) document detail screen that includes the metadata and PDF view.

Any thoughts or pointers on where to start?

Thanks,

-Rob



--

---
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mayan EDMS: 1593] Re: Metadata display on Preview screen

MacRobb Simpson
I just wanted to throw this out here as something somewhat related:
If you are interested in a better metadata display on the Index/Search views, here's how to do it:

1. Edit /lib/python2.7/site-packages/mayan/apps/metadata/widgets.py and replace the get_metadata_string function with this:

def get_metadata_string(document):
    """
    Return a formated representation of a document's metadata values
    """
    return mark_safe(''.join(
        [
            '<div data-id="%s" class="md-disp"><b>%s:</b> %s</div>' % (document_metadata.id,document_metadata.metadata_type, document_metadata.value) for document_metadata in document.metadata.all()
        ]
    ))

2. Edit /lib/python2.7/site-packages/mayan/apps/appearance/static/appearance/css/base.css and add this at the bottom:
.md-disp {
    min-width: 200px;
    display: inline-block;
    padding-right: 10px;
    width: 49%;
}


3. You may also want to add this:
@media (min-width:1200px) {
    .container {
        width: 95%;
                min-width: 1170px;
    }
}

What these changes will do is split the metadata into 'blocks', the metadata-type being bold, and, if the screen is wide enough, split them into two columns(otherwise a single column of metadata).

Also, I wrapped them in divs with class md-disp so it can be wrapped in the future with a Jquery editable function, for inline metadata editing.

--

---
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mayan EDMS: 1629] Re: Metadata display on Preview screen

rosarior
Administrator
Thanks for this I will give it a try. For an explanation of where things are in the apps read this chapter: https://mayan.readthedocs.io/en/v2.1.11/topics/app_creation.html


On Thursday, April 13, 2017 at 5:19:51 PM UTC-4, MacRobb Simpson wrote:
I just wanted to throw this out here as something somewhat related:
If you are interested in a better metadata display on the Index/Search views, here's how to do it:

1. Edit /lib/python2.7/site-packages/mayan/apps/metadata/widgets.py and replace the get_metadata_string function with this:

def get_metadata_string(document):
    """
    Return a formated representation of a document's metadata values
    """
    return mark_safe(''.join(
        [
            '<div data-id="%s" class="md-disp"><b>%s:</b> %s</div>' % (<a href="http://document_metadata.id" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdocument_metadata.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG3PinbLj0e6Odo3zY-4URKCAiWpQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdocument_metadata.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG3PinbLj0e6Odo3zY-4URKCAiWpQ&#39;;return true;">document_metadata.id,document_metadata.metadata_type, document_metadata.value) for document_metadata in document.metadata.all()
        ]
    ))

2. Edit /lib/python2.7/site-packages/mayan/apps/appearance/static/appearance/css/base.css and add this at the bottom:
.md-disp {
    min-width: 200px;
    display: inline-block;
    padding-right: 10px;
    width: 49%;
}


3. You may also want to add this:
@media (min-width:1200px) {
    .container {
        width: 95%;
                min-width: 1170px;
    }
}

What these changes will do is split the metadata into 'blocks', the metadata-type being bold, and, if the screen is wide enough, split them into two columns(otherwise a single column of metadata).

Also, I wrapped them in divs with class md-disp so it can be wrapped in the future with a Jquery editable function, for inline metadata editing.

--

---
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mayan EDMS: 1631] Re: Metadata display on Preview screen

rosarior
Administrator
Oh! Much better and so simple. Thanks! 

On Thursday, April 20, 2017 at 7:48:41 PM UTC-4, Roberto Rosario wrote:
Thanks for this I will give it a try. For an explanation of where things are in the apps read this chapter: <a href="https://mayan.readthedocs.io/en/v2.1.11/topics/app_creation.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fmayan.readthedocs.io%2Fen%2Fv2.1.11%2Ftopics%2Fapp_creation.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHaQ2hY1Rs6yP9NQ9SBcj0oK8h7rQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fmayan.readthedocs.io%2Fen%2Fv2.1.11%2Ftopics%2Fapp_creation.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHaQ2hY1Rs6yP9NQ9SBcj0oK8h7rQ&#39;;return true;">https://mayan.readthedocs.io/en/v2.1.11/topics/app_creation.html


On Thursday, April 13, 2017 at 5:19:51 PM UTC-4, MacRobb Simpson wrote:
I just wanted to throw this out here as something somewhat related:
If you are interested in a better metadata display on the Index/Search views, here's how to do it:

1. Edit /lib/python2.7/site-packages/mayan/apps/metadata/widgets.py and replace the get_metadata_string function with this:

def get_metadata_string(document):
    """
    Return a formated representation of a document's metadata values
    """
    return mark_safe(''.join(
        [
            '<div data-id="%s" class="md-disp"><b>%s:</b> %s</div>' % (<a href="http://document_metadata.id" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdocument_metadata.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG3PinbLj0e6Odo3zY-4URKCAiWpQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdocument_metadata.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG3PinbLj0e6Odo3zY-4URKCAiWpQ&#39;;return true;">document_metadata.id,document_metadata.metadata_type, document_metadata.value) for document_metadata in document.metadata.all()
        ]
    ))

2. Edit /lib/python2.7/site-packages/mayan/apps/appearance/static/appearance/css/base.css and add this at the bottom:
.md-disp {
    min-width: 200px;
    display: inline-block;
    padding-right: 10px;
    width: 49%;
}


3. You may also want to add this:
@media (min-width:1200px) {
    .container {
        width: 95%;
                min-width: 1170px;
    }
}

What these changes will do is split the metadata into 'blocks', the metadata-type being bold, and, if the screen is wide enough, split them into two columns(otherwise a single column of metadata).

Also, I wrapped them in divs with class md-disp so it can be wrapped in the future with a Jquery editable function, for inline metadata editing.

--

---
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...