Commit 535ffbec authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Actualiza módulo y añade estadísticas al inicio

parent a92606bf
Loading
Loading
Loading
Loading
+19 −9
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ define([
	, 'app/home/views/SearchFilterWidget'
	, 'app/home/views/SearchResultsWidget'
	, "app/home/views/SocialWidget"
	, 'app/home/views/StatsWidget'
	, "app/home/views/WidgetLastActivity"
	, "app/home/views/WidgetFavourites"
], function(
@@ -30,6 +31,7 @@ define([
	, SearchFilterWidget
	, SearchResultsWidget
	, SocialWidget
	, StatsWidget
	, WidgetLastActivity
	, WidgetFavourites
) {
@@ -92,6 +94,15 @@ define([
						omitTitleCloseButton: true
					}
				},
				favourites: {
					width: 3,
					height: 5,
					type: WidgetFavourites,
					props: {
						windowTitle: 'favourites',
						"class": "containerDetails"
					}
				},
				info: {
					width: 3,
					height: 1,
@@ -103,21 +114,20 @@ define([
						target: "initial_info"
					}
				},
				social: {
				stats: {
					width: 3,
					height: 1,
					type: SocialWidget,
					height: 3,
					type: StatsWidget,
					props: {
						windowTitle: 'followUs'
						windowTitle: 'statistics'
					}
				},
				favourites: {
				social: {
					width: 3,
					height: 5,
					type: WidgetFavourites,
					height: 1,
					type: SocialWidget,
					props: {
						windowTitle: 'favourites',
						"class": "containerDetails"
						windowTitle: 'followUs'
					}
				},
				lastActivities: {
+117 −0
Original line number Diff line number Diff line
define([
	'app/redmicConfig'
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'redmic/modules/base/_Module'
	, 'redmic/modules/base/_Show'
	, 'redmic/modules/base/_Store'
	, 'redmic/modules/browser/_ButtonsInRow'
	, 'redmic/modules/browser/ListImpl'
	, 'templates/AdministrativeStatisticsList'
], function(
	redmicConfig
	, declare
	, lang
	, _Module
	, _Show
	, _Store
	, _ButtonsInRow
	, ListImpl
	, ListTemplate
) {

	return declare([_Module, _Show, _Store], {
		//	summary:
		//		Widget contenedor de estadísticas públicas de la plataforma

		constructor: function(args) {

			this.config = {
				target: redmicConfig.services.administrativeStatistics,
				_browserTarget: 'browserStatistics',
				'class': 'statsPanel',
				_titleRightButtonsList: []
			};

			lang.mixin(this, this.config, args);
		},

		_initialize: function() {

			this.browserConfig = this._merge([{
				parentChannel: this.getChannel(),
				target: this._browserTarget,
				template: ListTemplate,
				rowConfig: {
					buttonsConfig: {
						listButton: [{
							icon: 'fa-arrow-right',
							btnId: 'details',
							title: this.i18n.info,
							href: '/admin/{href}'
						}]
					}
				}
			}, this.browserConfig || {}]);

			var browserDefinition = declare([ListImpl, _ButtonsInRow]);
			this.browser = new browserDefinition(this.browserConfig);
		},

		_afterShow: function() {

			if (this._getPreviouslyShown()) {
				return;
			}

			this._publish(this.browser.getChannel('SHOW'), {
				node: this.domNode
			});

			this._emitEvt('REQUEST', this._getRequestObj());
		},

		_getRequestObj: function() {

			return {
				target: this.target,
				method: 'GET',
				type: 'API',
				requesterId: this.getOwnChannel()
			};
		},

		_dataAvailable: function(res, resWrapper) {

			var data = res.data;

			if (!data) {
				return;
			}

			var id = 1;

			for (var item in data) {
				var result = {};
				result.data = data[item];
				result.name = item;
				result.id = id;

				if ('activityOutProject' === item) {
					result.href = 'activity';
				} else if ('projectOutProgram' === item) {
					result.href = 'project';
				} else {
					result.href = item;
				}

				this._emitEvt('INJECT_ITEM', {
					data: result,
					target: this._browserTarget
				});

				id++;
			}
		}
	});
});
Compare db88dabe to 0a1cb2c5
Original line number Diff line number Diff line
Subproject commit db88dabeec01d82f5d1136c2dede2d92df6b0e80
Subproject commit 0a1cb2c5475a81e124309be7c1bad718c15c3621