<#import "/spring.ftl" as spring>

<#-- Common Store for Available Locales -->
Ext.define('App.store.LocaleStore', {
	extend: 'Ext.data.Store',

	constructor: function(cfg) {
		var me = this;
		cfg = cfg || {};
		me.callParent([Ext.apply({
			data: [
<#if availableLocales??>
<#list availableLocales as availableLocale>
				{
					text: '<@spring.message "COMMON.locale.${availableLocale}" />',
					value: '${availableLocale}'
				},
</#list>
</#if>
			],
			fields: [
				{
					name: 'text'
				},
				{
					name: 'value'
				}
			]
		}, cfg)]);
	}
});


<#-- Common Store for Year Combo -->
Ext.define('App.store.common.YearStore', {
	extend: 'Ext.data.Store',

	constructor: function(cfg) {
		var me = this;
		cfg = cfg || {};
		me.callParent([Ext.apply({
			data: [
<#list 2008..2037 as i>
				{
					value: ${i?c}
				},
</#list>
				{
					value: null
				}
			],
			fields: [
				{
					name: 'value'
				}
			]
		}, cfg)]);
	}
});

<#-- Common Store for Month Combo -->
Ext.define('App.store.common.MonthStore', {
	extend: 'Ext.data.Store',

	constructor: function(cfg) {
		var me = this;
		cfg = cfg || {};
		me.callParent([Ext.apply({
			data: [
<#list 1..12 as i>
				{
					value: ${i?c}
				},
</#list>
				{
					value: null
				}
			],
			fields: [
				{
					name: 'value'
				}
			]
		}, cfg)]);
	}
});