Commit 9aed1f7e authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Muestra nueva información sobre documentos

Amplía plantillas de listados e información para contener y mostrar los
nuevos campos de los documentos.

Controla permisos por rol para mostrar o no la nueva información.

Permite acceso directo a enlaces externos desde listado, ubica
medallones informativos en parte inferior del elemento.

Actualiza submódulos de estilos y plantillas.

Corrige campo 'enabled' en edición de documento y traduce el nombre de
los nuevos campos.

Ref #53.
Fix #54.
parent b6bae96c
Loading
Loading
Loading
Loading
+26 −24
Original line number Diff line number Diff line
define([
	"app/base/views/extensions/_EditionWizardView"
	, "app/designs/textSearchFacetsList/main/Bibliography"
	, "app/redmicConfig"
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "RWidgets/Button"
	'app/base/views/extensions/_EditionWizardView'
	, 'app/designs/textSearchFacetsList/main/Bibliography'
	, 'app/redmicConfig'
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'RWidgets/Button'
], function (
	_EditionWizardView
	, BibliographyMain
@@ -13,6 +13,7 @@ define([
	, lang
	, Button
) {

	return declare([BibliographyMain, _EditionWizardView], {
		//	summary:
		//		Vista de Document.
@@ -43,28 +44,29 @@ define([
				rowConfig: {
					buttonsConfig: {
						listButton: [{
							groupId: "edition",
							groupId: 'edition',
							icons: [{
								icon: "fa-edit",
								btnId: "edit",
								title: "edit",
								option: "default",
								icon: 'fa-edit',
								btnId: 'edit',
								title: 'edit',
								option: 'default',
								href: this.viewPaths.documentEdit
							},{
								icon: "fa-copy",
								btnId: "copy",
								title: "copy",
								icon: 'fa-copy',
								btnId: 'copy',
								title: 'copy',
								href: this.viewPaths.documentAdd
							}]
						},{
							icon: "fa-info-circle",
							btnId: "details",
							title: "info",
							href: this.viewPaths.documentDetails
							icon: 'fa-external-link',
							btnId: 'url',
							condition: this._urlCondition,
							href: '{url}'
						},{
							icon: "fa-file-pdf-o",
							btnId: "downloadPdf",
							condition: "url"
							icon: 'fa-info-circle',
							btnId: 'details',
							title: 'info',
							href: this.viewPaths.documentDetails
						}]
					},
					shownOptionTemplate: {
@@ -79,8 +81,8 @@ define([
			this.inherited(arguments);

			this.loadButton = new Button({
				iconClass: "fa fa-upload",
				'class': "warning",
				iconClass: 'fa fa-upload',
				'class': 'warning',
				'title': this.i18n.loadDocument,
				'href': this.loadPath
			}).placeAt(this.buttonsNode);
+1 −1
Original line number Diff line number Diff line
@@ -36,6 +36,6 @@

		<div data-redmic-type="boolean" data-redmic-model="privateInternalUrl"></div>

		<div data-redmic-type="boolean" data-redmic-model="enable"></div>
		<div data-redmic-type="boolean" data-redmic-model="enabled"></div>
	</form>
</div>
+14 −4
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ define([
	'app/redmicConfig'
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'redmic/base/Credentials'
	, 'templates/DocumentInfo'
	, './_DetailsBase'
	, './DocumentPDF'
@@ -9,6 +10,7 @@ define([
	redmicConfig
	, declare
	, lang
	, Credentials
	, TemplateInfo
	, _DetailsBase
	, DocumentPDF
@@ -73,10 +75,18 @@ define([

			this.inherited(arguments);

			if (resWrapper.target === redmicConfig.services.document) {
				if (res.data.url) {
					this._showWidget('pdf');
			if (resWrapper.target !== redmicConfig.services.document) {
				return;
			}

			var documentData = res.data,
				pdfUrl = documentData.internalUrl,
				privatePdf = documentData.privateInternalUrl;

			if (!pdfUrl || (privatePdf && Credentials.get('userRole') !== 'ROLE_ADMINISTRATOR')) {
				this._hideWidget('pdf');
			} else {
				this._showWidget('pdf');
			}
		},

+3 −2
Original line number Diff line number Diff line
@@ -63,10 +63,11 @@ define([

		_itemAvailable: function(item) {

			var pdfUrl = item.data.url,
			var documentData = item.data,
				pdfUrl = documentData.internalUrl,
				widgetInstance = this._getWidgetInstance('pdf');

			if (!pdfUrl || !widgetInstance) {
			if (!widgetInstance) {
				return;
			}

+19 −13
Original line number Diff line number Diff line
define([
	"app/designs/base/_Main"
	, "app/designs/textSearchFacetsList/Controller"
	, "app/designs/textSearchFacetsList/Layout"
	'app/designs/base/_Main'
	, 'app/designs/textSearchFacetsList/Controller'
	, 'app/designs/textSearchFacetsList/Layout'
	, 'app/redmicConfig'
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "templates/DocumentList"
	, "redmic/modules/browser/_Select"
	, "redmic/modules/browser/bars/SelectionBox"
	, "redmic/modules/browser/bars/Order"
	, "redmic/modules/browser/bars/Total"
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'redmic/modules/browser/_Select'
	, 'redmic/modules/browser/bars/SelectionBox'
	, 'redmic/modules/browser/bars/Order'
	, 'redmic/modules/browser/bars/Total'
	, 'templates/DocumentList'
], function (
	_Main
	, Controller
@@ -17,15 +17,16 @@ define([
	, redmicConfig
	, declare
	, lang
	, templateList
	, _Select
	, SelectionBox
	, Order
	, Total
	, templateList
) {

	return declare([Layout, Controller, _Main], {
		//	summary:
		//		Vista de Bibliography.
		//		Base de vista de Bibliography/Document.

		//	title: String
		//		Título de la vista.
@@ -71,6 +72,11 @@ define([
			this.facetsConfig = this._merge([{
				aggs: redmicConfig.aggregations.document
			}, this.facetsConfig || {}]);
		},

		_urlCondition: function(item) {

			return !!item.url;
		}
	});
});
Loading