From b91f7f685a391548c4a0e99b5a8a14da60e58ccb Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 4 May 2017 00:40:02 -0400 Subject: [PATCH] Incorporate @Macrobb metadata widget and content visual changes. GitLab issue #378 Signed-off-by: Roberto Rosario --- docs/releases/3.0.rst | 75 +++++++++++++++++++ .../appearance/static/appearance/css/base.css | 16 ++++ mayan/apps/metadata/widgets.py | 12 +-- 3 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 docs/releases/3.0.rst diff --git a/docs/releases/3.0.rst b/docs/releases/3.0.rst new file mode 100644 index 0000000000..3998d3b4f0 --- /dev/null +++ b/docs/releases/3.0.rst @@ -0,0 +1,75 @@ +============================= +Mayan EDMS v3.0 release notes +============================= + +Released: XX XX, 2017 + +What's new +========== + + +Other changes +------------- +- Metadat widget appearance changes +- Content windows appearance changes + +Removals +-------- +- None + +Upgrading from a previous version +--------------------------------- + +If installed via PIP +~~~~~~~~~~~~~~~~~~~~ + +Type in the console:: + + $ pip install -U mayan-edms + +the requirements will also be updated automatically. + +If installed using Git +~~~~~~~~~~~~~~~~~~~~~~ + +If you installed Mayan EDMS by cloning the Git repository issue the commands:: + + $ git reset --hard HEAD + $ git pull + +otherwise download the compressed archived and uncompress it overriding the +existing installation. + +Manually upgrade/add the new requirements:: + + $ pip install --upgrade -r requirements.txt + +Remove deprecated requirements:: + + $ pip uninstall -y -r removals.txt + +Common steps +~~~~~~~~~~~~ + +Migrate existing database schema with:: + + $ mayan-edms.py performupgrade + +Add new static media:: + + $ mayan-edms.py collectstatic --noinput + +The upgrade procedure is now complete. + + +Backward incompatible changes +============================= + +* None + +Bugs fixed or issues closed +=========================== + +* `GitLab issue #378 `_ Add metadata widget changes from @Macrobb + +.. _PyPI: https://pypi.python.org/pypi/mayan-edms/ diff --git a/mayan/apps/appearance/static/appearance/css/base.css b/mayan/apps/appearance/static/appearance/css/base.css index 97c832828e..1e6e6dfd23 100644 --- a/mayan/apps/appearance/static/appearance/css/base.css +++ b/mayan/apps/appearance/static/appearance/css/base.css @@ -171,3 +171,19 @@ a i { .tag-container .label { margin-right: 2px; } + +/* Metadata */ +.metadata-display { + display: inline-block; + min-width: 200px; + padding-right: 10px; + width: 49%; +} + +/* Content */ +@media (min-width:1200px) { + .container { + min-width: 1170px; + width: 95%; + } +} diff --git a/mayan/apps/metadata/widgets.py b/mayan/apps/metadata/widgets.py index 8307a66d5c..a70540577f 100644 --- a/mayan/apps/metadata/widgets.py +++ b/mayan/apps/metadata/widgets.py @@ -1,14 +1,14 @@ from __future__ import unicode_literals +from django.utils.html import format_html_join def get_metadata_string(document): """ Return a formated representation of a document's metadata values """ - return ', '.join( - [ - '%s - %s' % ( - document_metadata.metadata_type, document_metadata.value - ) for document_metadata in document.metadata.all() - ] + return format_html_join( + '\n', '', + ((document_metadata.metadata_type,document_metadata.metadata_type_id,document_metadata.id,document_metadata.value) + for document_metadata in document.metadata.all() + ) )