dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25207
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12435: Replaced silly list of languages/countries with java locale lists. Moved javascript from login pa...
------------------------------------------------------------
revno: 12435
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-10-04 18:25:27 +0200
message:
Replaced silly list of languages/countries with java locale lists. Moved javascript from login page into javascript file.
added:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/security/login.js
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/i18n/DefaultI18nLocaleService.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/security/login.vm
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm
dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties
dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_fr.properties
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/i18n/DefaultI18nLocaleService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/i18n/DefaultI18nLocaleService.java 2013-10-04 15:05:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/i18n/DefaultI18nLocaleService.java 2013-10-04 16:25:27 +0000
@@ -28,10 +28,20 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
import java.util.Map;
+import javax.annotation.PostConstruct;
+
+import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.GenericIdentifiableObjectStore;
+import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
import org.hisp.dhis.i18n.locale.I18nLocale;
import org.hisp.dhis.system.util.LocaleUtils;
import org.hisp.dhis.system.util.TextUtils;
@@ -53,19 +63,42 @@
{
this.localeStore = localeStore;
}
-
- private Map<String, String> languages;
-
- public void setLanguages( Map<String, String> languages )
- {
- this.languages = languages;
- }
-
- private Map<String, String> countries;
-
- public void setCountries( Map<String, String> countries )
- {
- this.countries = countries;
+
+ private Map<String, String> languages = new LinkedHashMap<String, String>();
+
+ private Map<String, String> countries = new LinkedHashMap<String, String>();
+
+ /**
+ * Load all ISO languages and countries into mappings.
+ */
+ @PostConstruct
+ public void init()
+ {
+ List<IdentifiableObject> langs = new ArrayList<IdentifiableObject>();
+ List<IdentifiableObject> countrs = new ArrayList<IdentifiableObject>();
+
+ for ( String lang : Locale.getISOLanguages() )
+ {
+ langs.add( new BaseIdentifiableObject( lang, lang, new Locale( lang ).getDisplayLanguage() ) );
+ }
+
+ for ( String country : Locale.getISOCountries() )
+ {
+ countrs.add( new BaseIdentifiableObject( country, country, new Locale( "en", country ).getDisplayCountry() ) );
+ }
+
+ Collections.sort( langs, IdentifiableObjectNameComparator.INSTANCE );
+ Collections.sort( countrs, IdentifiableObjectNameComparator.INSTANCE );
+
+ for ( IdentifiableObject lang : langs )
+ {
+ languages.put( lang.getCode(), lang.getName() );
+ }
+
+ for ( IdentifiableObject countr : countrs )
+ {
+ countries.put( countr.getCode(), countr.getName() );
+ }
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2013-10-04 15:05:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2013-10-04 16:25:27 +0000
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
+ xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">
<!-- Store definitions -->
@@ -832,8 +831,6 @@
<bean id="org.hisp.dhis.i18n.118nLocaleService" class="org.hisp.dhis.i18n.DefaultI18nLocaleService">
<property name="localeStore" ref="org.hisp.dhis.i18n.I18nLocaleStore" />
- <property name="languages" ref="languages" />
- <property name="countries" ref="countries" />
</bean>
<!-- Startup routine definitions -->
@@ -1165,369 +1162,6 @@
)" method="intercept" returning="idObject"/> <aop:after-returning pointcut="execution( * org.hisp.dhis.organisationunit.OrganisationUnitGroupService.get*(..)
)" method="intercept" returning="idObject"/> </aop:aspect> -->
</aop:config>
-
- <!-- Languages -->
-
- <util:map id="languages" map-class="java.util.LinkedHashMap">
- <entry key="ab" value="Abkhazian"/>
- <entry key="af" value="Afrikaans"/>
- <entry key="sq" value="Albanian"/>
- <entry key="am" value="Amharic"/>
- <entry key="ar" value="Arabic"/>
- <entry key="an" value="Aragonese"/>
- <entry key="hy" value="Armenian"/>
- <entry key="as" value="Assamese"/>
- <entry key="az" value="Azerbaijani"/>
- <entry key="eu" value="Basque"/>
- <entry key="be" value="Belarusian"/>
- <entry key="bn" value="Bengali"/>
- <entry key="bi" value="Bislama"/>
- <entry key="bs" value="Bosnian"/>
- <entry key="br" value="Breton"/>
- <entry key="bg" value="Bulgarian"/>
- <entry key="my" value="Burmese"/>
- <entry key="ca" value="Catalan"/>
- <entry key="ce" value="Chechen"/>
- <entry key="zh" value="Chinese"/>
- <entry key="cu" value="Church Slavic"/>
- <entry key="kw" value="Cornish"/>
- <entry key="co" value="Corsican"/>
- <entry key="hr" value="Croatian"/>
- <entry key="cs" value="Czech"/>
- <entry key="da" value="Danish"/>
- <entry key="nl" value="Dutch"/>
- <entry key="en" value="English"/>
- <entry key="eo" value="Esperanto"/>
- <entry key="et" value="Estonian"/>
- <entry key="fo" value="Faroese"/>
- <entry key="fj" value="Fijian"/>
- <entry key="fi" value="Finnish"/>
- <entry key="fr" value="French"/>
- <entry key="gd" value="Gaelic"/>
- <entry key="gl" value="Galician"/>
- <entry key="ka" value="Georgian"/>
- <entry key="de" value="German"/>
- <entry key="el" value="Greek"/>
- <entry key="gu" value="Gujarati"/>
- <entry key="ht" value="Haitian"/>
- <entry key="he" value="Hebrew"/>
- <entry key="hi" value="Hindi"/>
- <entry key="hu" value="Hungarian"/>
- <entry key="is" value="Icelandic"/>
- <entry key="id" value="Indonesian"/>
- <entry key="ga" value="Irish"/>
- <entry key="it" value="Italian"/>
- <entry key="ja" value="Japanese"/>
- <entry key="jv" value="Javanese"/>
- <entry key="rw" value="Kinyarwanda"/>
- <entry key="ky" value="Kirghiz"/>
- <entry key="kg" value="Kongo"/>
- <entry key="ko" value="Korean"/>
- <entry key="ku" value="Kurdish"/>
- <entry key="la" value="Latin"/>
- <entry key="lv" value="Latvian"/>
- <entry key="li" value="Limburgan"/>
- <entry key="ln" value="Lingala"/>
- <entry key="lt" value="Lithuanian"/>
- <entry key="lb" value="Luxembourgish"/>
- <entry key="mk" value="Macedonian"/>
- <entry key="mg" value="Malagasy"/>
- <entry key="ms" value="Malay"/>
- <entry key="mt" value="Maltese"/>
- <entry key="gv" value="Manx"/>
- <entry key="mo" value="Moldavian"/>
- <entry key="mn" value="Mongolian"/>
- <entry key="ne" value="Nepali"/>
- <entry key="se" value="Northern Sami"/>
- <entry key="no" value="Norwegian"/>
- <entry key="nb" value="Norwegian"/>
- <entry key="fa" value="Persian"/>
- <entry key="pl" value="Polish"/>
- <entry key="pt" value="Portuguese"/>
- <entry key="ps" value="Pushto"/>
- <entry key="rm" value="Raeto-Romance"/>
- <entry key="ro" value="Romanian"/>
- <entry key="ru" value="Russian"/>
- <entry key="sc" value="Sardinian"/>
- <entry key="sr" value="Serbian"/>
- <entry key="sk" value="Slovak"/>
- <entry key="sl" value="Slovenian"/>
- <entry key="so" value="Somali"/>
- <entry key="es" value="Spanish"/>
- <entry key="sw" value="Swahili"/>
- <entry key="sv" value="Swedish"/>
- <entry key="ty" value="Tahitian"/>
- <entry key="tg" value="Tajik"/>
- <entry key="bo" value="Tibetan"/>
- <entry key="tr" value="Turkish"/>
- <entry key="tk" value="Turkmen"/>
- <entry key="uk" value="Ukrainian"/>
- <entry key="ur" value="Urdu"/>
- <entry key="uz" value="Uzbek"/>
- <entry key="vi" value="Vietnamese"/>
- <entry key="vo" value="Volapuk"/>
- <entry key="cy" value="Welsh"/>
- <entry key="fy" value="Western Frisian"/>
- <entry key="yi" value="Yiddish"/>
- </util:map>
-
- <!-- Countries -->
-
- <util:map id="countries" map-class="java.util.LinkedHashMap">
- <entry key="AC" value="Ascension Island"/>
- <entry key="AD" value="Andorra"/>
- <entry key="AE" value="United Arab Emirates"/>
- <entry key="AF" value="Afghanistan"/>
- <entry key="AG" value="Antigua and Barbuda"/>
- <entry key="AI" value="Anguilla"/>
- <entry key="AL" value="Albania"/>
- <entry key="AM" value="Armenia"/>
- <entry key="AO" value="Angola"/>
- <entry key="AQ" value="Antarctica"/>
- <entry key="AR" value="Argentina"/>
- <entry key="AS" value="American Samoa"/>
- <entry key="AT" value="Austria"/>
- <entry key="AU" value="Australia"/>
- <entry key="AW" value="Aruba"/>
- <entry key="AX" value="Åland Islands"/>
- <entry key="AZ" value="Azerbaijan"/>
- <entry key="BA" value="Bosnia and Herzegovina"/>
- <entry key="BB" value="Barbados"/>
- <entry key="BD" value="Bangladesh"/>
- <entry key="BE" value="Belgium"/>
- <entry key="BF" value="Burkina Faso"/>
- <entry key="BG" value="Bulgaria"/>
- <entry key="BH" value="Bahrain"/>
- <entry key="BI" value="Burundi"/>
- <entry key="BJ" value="Benin"/>
- <entry key="BL" value="Saint Barthélemy"/>
- <entry key="BM" value="Bermuda"/>
- <entry key="BN" value="Brunei Darussalam"/>
- <entry key="BO" value="Bolivia"/>
- <entry key="BQ" value="Bonaire, Sint Eustatius and Saba"/>
- <entry key="BR" value="Brazil"/>
- <entry key="BS" value="Bahamas"/>
- <entry key="BT" value="Bhutan"/>
- <entry key="BV" value="Bouvet Island"/>
- <entry key="BW" value="Botswana"/>
- <entry key="BY" value="Belarus"/>
- <entry key="BZ" value="Belize"/>
- <entry key="CA" value="Canada"/>
- <entry key="CC" value="Cocos (Keeling) Islands"/>
- <entry key="CD" value="The Democratic Republic of the Congo"/>
- <entry key="CF" value="Central African Republic"/>
- <entry key="CG" value="Congo"/>
- <entry key="CH" value="Switzerland"/>
- <entry key="CI" value="Côte d'Ivoire"/>
- <entry key="CK" value="Cook Islands"/>
- <entry key="CL" value="Chile"/>
- <entry key="CM" value="Cameroon"/>
- <entry key="CN" value="China"/>
- <entry key="CO" value="Colombia"/>
- <entry key="CP" value="Clipperton Island"/>
- <entry key="CR" value="Costa Rica"/>
- <entry key="CU" value="Cuba"/>
- <entry key="CV" value="Cape Verde"/>
- <entry key="CW" value="Curaçao"/>
- <entry key="CX" value="Christmas Island"/>
- <entry key="CY" value="Cyprus"/>
- <entry key="CZ" value="Czech Republic"/>
- <entry key="DE" value="Germany"/>
- <entry key="DG" value="Diego Garcia"/>
- <entry key="DJ" value="Djibouti"/>
- <entry key="DK" value="Denmark"/>
- <entry key="DM" value="Dominica"/>
- <entry key="DO" value="Dominican Republic"/>
- <entry key="DZ" value="Algeria"/>
- <entry key="EA" value="Ceuta, Melilla"/>
- <entry key="EC" value="Ecuador"/>
- <entry key="EE" value="Estonia"/>
- <entry key="EG" value="Egypt"/>
- <entry key="EH" value="Western Sahara"/>
- <entry key="ER" value="Eritrea"/>
- <entry key="ES" value="Spain"/>
- <entry key="ET" value="Ethiopia"/>
- <entry key="FI" value="Finland"/>
- <entry key="FJ" value="Fiji"/>
- <entry key="FK" value="Falkland Islands (Malvinas)"/>
- <entry key="FM" value="Federated States of Micronesia"/>
- <entry key="FO" value="Faroe Islands"/>
- <entry key="FR" value="France"/>
- <entry key="GA" value="Gabon"/>
- <entry key="GB" value="United Kingdom"/>
- <entry key="GD" value="Grenada"/>
- <entry key="GE" value="Georgia"/>
- <entry key="GF" value="French Guiana"/>
- <entry key="GG" value="Guernsey"/>
- <entry key="GH" value="Ghana"/>
- <entry key="GI" value="Gibraltar"/>
- <entry key="GL" value="Greenland"/>
- <entry key="GM" value="Gambia"/>
- <entry key="GN" value="Guinea"/>
- <entry key="GP" value="Guadeloupe"/>
- <entry key="GQ" value="Equatorial Guinea"/>
- <entry key="GR" value="Greece"/>
- <entry key="GS" value="South Georgia and the South Sandwich Islands"/>
- <entry key="GT" value="Guatemala"/>
- <entry key="GU" value="Guam"/>
- <entry key="GW" value="Guinea-Bissau"/>
- <entry key="GY" value="Guyana"/>
- <entry key="HK" value="Hong Kong"/>
- <entry key="HM" value="Heard Island and McDonald Islands"/>
- <entry key="HN" value="Honduras"/>
- <entry key="HR" value="Croatia"/>
- <entry key="HT" value="Haiti"/>
- <entry key="HU" value="Hungary"/>
- <entry key="IC" value="Canary Islands"/>
- <entry key="ID" value="Indonesia"/>
- <entry key="IE" value="Ireland"/>
- <entry key="IL" value="Israel"/>
- <entry key="IM" value="Isle of Man"/>
- <entry key="IN" value="India"/>
- <entry key="IO" value="British Indian Ocean Territory"/>
- <entry key="IQ" value="Iraq"/>
- <entry key="IR" value="Islamic Republic of Iran"/>
- <entry key="IS" value="Iceland"/>
- <entry key="IT" value="Italy"/>
- <entry key="JE" value="Jersey"/>
- <entry key="JM" value="Jamaica"/>
- <entry key="JO" value="Jordan"/>
- <entry key="JP" value="Japan"/>
- <entry key="KE" value="Kenya"/>
- <entry key="KG" value="Kyrgyzstan"/>
- <entry key="KH" value="Cambodia"/>
- <entry key="KI" value="Kiribati"/>
- <entry key="KM" value="Comoros"/>
- <entry key="KN" value="Saint Kitts and Nevis"/>
- <entry key="KP" value="Democratic People's Republic of Korea"/>
- <entry key="KR" value="Republic of Korea"/>
- <entry key="KW" value="Kuwait"/>
- <entry key="KY" value="Cayman Islands"/>
- <entry key="KZ" value="Kazakhstan"/>
- <entry key="LA" value="Lao People's Democratic Republic"/>
- <entry key="LB" value="Lebanon"/>
- <entry key="LC" value="Saint Lucia"/>
- <entry key="LI" value="Liechtenstein"/>
- <entry key="LK" value="Sri Lanka"/>
- <entry key="LR" value="Liberia"/>
- <entry key="LS" value="Lesotho"/>
- <entry key="LT" value="Lithuania"/>
- <entry key="LU" value="Luxembourg"/>
- <entry key="LV" value="Latvia"/>
- <entry key="LY" value="Libya"/>
- <entry key="MA" value="Morocco"/>
- <entry key="MC" value="Monaco"/>
- <entry key="MD" value="Moldova"/>
- <entry key="ME" value="Montenegro"/>
- <entry key="MF" value="Saint Martin (French part)"/>
- <entry key="MG" value="Madagascar"/>
- <entry key="MH" value="Marshall Islands"/>
- <entry key="MK" value="Macedonia"/>
- <entry key="ML" value="Mali"/>
- <entry key="MM" value="Myanmar"/>
- <entry key="MN" value="Mongolia"/>
- <entry key="MO" value="Macao"/>
- <entry key="MP" value="Northern Mariana Islands"/>
- <entry key="MQ" value="Martinique"/>
- <entry key="MR" value="Mauritania"/>
- <entry key="MS" value="Montserrat"/>
- <entry key="MT" value="Malta"/>
- <entry key="MU" value="Mauritius"/>
- <entry key="MV" value="Maldives"/>
- <entry key="MW" value="Malawi"/>
- <entry key="MX" value="Mexico"/>
- <entry key="MY" value="Malaysia"/>
- <entry key="MZ" value="Mozambique"/>
- <entry key="NA" value="Namibia"/>
- <entry key="NC" value="New Caledonia"/>
- <entry key="NE" value="Niger"/>
- <entry key="NF" value="Norfolk Island"/>
- <entry key="NG" value="Nigeria"/>
- <entry key="NI" value="Nicaragua"/>
- <entry key="NL" value="Netherlands"/>
- <entry key="NO" value="Norway"/>
- <entry key="NP" value="Nepal"/>
- <entry key="NR" value="Nauru"/>
- <entry key="NU" value="Niue"/>
- <entry key="NZ" value="New Zealand"/>
- <entry key="OM" value="Oman"/>
- <entry key="PA" value="Panama"/>
- <entry key="PE" value="Peru"/>
- <entry key="PF" value="French Polynesia"/>
- <entry key="PG" value="Papua New Guinea"/>
- <entry key="PH" value="Philippines"/>
- <entry key="PK" value="Pakistan"/>
- <entry key="PL" value="Poland"/>
- <entry key="PM" value="Saint Pierre and Miquelon"/>
- <entry key="PN" value="Pitcairn"/>
- <entry key="PR" value="Puerto Rico"/>
- <entry key="PS" value="State of Palestine"/>
- <entry key="PT" value="Portugal"/>
- <entry key="PW" value="Palau"/>
- <entry key="PY" value="Paraguay"/>
- <entry key="QA" value="Qatar"/>
- <entry key="RO" value="Romania"/>
- <entry key="RS" value="Serbia"/>
- <entry key="RU" value="Russian Federation"/>
- <entry key="RW" value="Rwanda"/>
- <entry key="SA" value="Saudi Arabia"/>
- <entry key="SB" value="Solomon Islands"/>
- <entry key="SC" value="Seychelles"/>
- <entry key="SD" value="Sudan"/>
- <entry key="SE" value="Sweden"/>
- <entry key="SG" value="Singapore"/>
- <entry key="SH" value="Saint Helena, Ascension and Tristan da Cunha"/>
- <entry key="SI" value="Slovenia"/>
- <entry key="SJ" value="Svalbard and Jan Mayen"/>
- <entry key="SK" value="Slovakia"/>
- <entry key="SL" value="Sierra Leone"/>
- <entry key="SM" value="San Marino"/>
- <entry key="SN" value="Senegal"/>
- <entry key="SO" value="Somalia"/>
- <entry key="SR" value="Suriname"/>
- <entry key="SS" value="South Sudan"/>
- <entry key="ST" value="Sao Tome and Principe"/>
- <entry key="SV" value="El Salvador"/>
- <entry key="SX" value="Sint Maarten (Dutch part)"/>
- <entry key="SY" value="Syrian Arab Republic"/>
- <entry key="SZ" value="Swaziland"/>
- <entry key="TA" value="Tristan da Cunha"/>
- <entry key="TC" value="Turks and Caicos Islands"/>
- <entry key="TD" value="Chad"/>
- <entry key="TF" value="French Southern Territories"/>
- <entry key="TG" value="Togo"/>
- <entry key="TH" value="Thailand"/>
- <entry key="TJ" value="Tajikistan"/>
- <entry key="TK" value="Tokelau"/>
- <entry key="TL" value="Timor-Leste"/>
- <entry key="TM" value="Turkmenistan"/>
- <entry key="TN" value="Tunisia"/>
- <entry key="TO" value="Tonga"/>
- <entry key="TR" value="Turkey"/>
- <entry key="TT" value="Trinidad and Tobago"/>
- <entry key="TV" value="Tuvalu"/>
- <entry key="TW" value="Taiwan, Province of China"/>
- <entry key="TZ" value="Tanzania"/>
- <entry key="UA" value="Ukraine"/>
- <entry key="UG" value="Uganda"/>
- <entry key="US" value="United States"/>
- <entry key="UY" value="Uruguay"/>
- <entry key="UZ" value="Uzbekistan"/>
- <entry key="VA" value="Holy See (Vatican City State)"/>
- <entry key="VC" value="Saint Vincent and the Grenadines"/>
- <entry key="VE" value="Venezuela"/>
- <entry key="VG" value="British Virgin Islands"/>
- <entry key="VI" value="U.S. Virgin Islands"/>
- <entry key="VN" value="Viet Nam"/>
- <entry key="VU" value="Vanuatu"/>
- <entry key="WF" value="Wallis and Futuna"/>
- <entry key="WS" value="Samoa"/>
- <entry key="YE" value="Yemen"/>
- <entry key="YT" value="Mayotte"/>
- <entry key="ZA" value="South Africa"/>
- <entry key="ZM" value="Zambia"/>
- <entry key="ZW" value="Zimbabwe"/>
- </util:map>
<!-- Security import -->
<import resource="security.xml" />
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/security/login.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/security/login.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/security/login.js 2013-10-04 16:25:27 +0000
@@ -0,0 +1,14 @@
+$( document ).ready( function()
+{
+ $( '#j_username' ).focus();
+
+ $( '#loginForm').bind( 'submit', function()
+ {
+ $( '#submit' ).attr( 'disabled', 'disabled' );
+ $( '#reset' ).attr( 'disabled', 'disabled' );
+
+ sessionStorage.removeItem( 'orgUnitSelected' );
+ } );
+} );
+
+var login = {};
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/security/login.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/security/login.vm 2013-10-01 16:44:42 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/security/login.vm 2013-10-04 16:25:27 +0000
@@ -1,23 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
- <title>$!encoder.htmlEncode( ${applicationTitle} )</title>
+ <title>$!encoder.htmlEncode( ${applicationTitle} )</title>
+ <meta name="description" content="DHIS 2">
+ <meta name="keywords" content="DHIS 2">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="../javascripts/jQuery/jquery.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $('#j_username').focus();
-
- $('#loginForm').bind('submit', function() {
- $('#submit').attr('disabled', 'disabled');
- $('#reset').attr('disabled', 'disabled');
-
- sessionStorage.removeItem( 'orgUnitSelected' );
- });
- });
- </script>
+ <script type="text/javascript" src="login.js"></script>
<link type="text/css" rel="stylesheet" href="../css/widgets.css">
<link type="text/css" rel="stylesheet" href="../css/login.css">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<h1 style="display:none">$!encoder.htmlEncode( ${applicationTitle} )</h1>
@@ -35,7 +26,7 @@
</div>
#if ( $keyConfig.selfRegistrationAllowed() )
<div id="accountArea">
- <a class="greenButtonLink" href="account.action">$i18n.getString( "create_an_account" )</a>
+ <a id="createAccountButton" class="greenButtonLink" href="account.action">$i18n.getString( "create_an_account" )</a>
</div>
#end
<div id="loginField">
@@ -44,11 +35,11 @@
<form id="loginForm" action="../../dhis-web-commons-security/login.action" method="post">
<table>
<tr>
- <td><label for="j_username">$i18n.getString( "login_username" )</label></td>
+ <td><label id="usernameLabel" for="j_username">$i18n.getString( "login_username" )</label></td>
<td><input type="text" id="j_username" name="j_username"></td>
</tr>
<tr>
- <td><label for="j_password">$i18n.getString( "login_password" )</label></td>
+ <td><label id="passwordLabel" for="j_password">$i18n.getString( "login_password" )</label></td>
<td><input type="password" id="j_password" name="j_password" autocomplete="off"></td>
</tr>
<tr>
@@ -63,10 +54,10 @@
<td style="padding-top:8px">
<span id="loginFormFooter">
#if( $keyAccountRecovery )
- <a href="recovery.action">$i18n.getString( "forgot_password" )</a>
+ <a id="forgotPasswordLink" href="recovery.action">$i18n.getString( "forgot_password" )</a>
#end
#if( $keyConfig.selfRegistrationAllowed() )
- <a href="account.action">$i18n.getString( "create_an_account" )</a>
+ <a id="createAccountLink" href="account.action">$i18n.getString( "create_an_account" )</a>
#end
</span>
</td>
@@ -80,6 +71,10 @@
<div id="notificationArea">$!{keyApplicationNotification}</div>
#end
</div>
- <div id="footerArea"><span>$i18n.getString( "powered_by" ) <a href="http://www.dhis2.org">DHIS 2</a> $!{keyApplicationFooter}</div>
+ <div id="footerArea">
+ <span id="poweredByLabel">$i18n.getString( "powered_by" )</span>
+ <a href="http://www.dhis2.org">DHIS 2</a>
+ $!{keyApplicationFooter}
+ </div>
</body>
</html>
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm 2013-08-16 12:29:21 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm 2013-10-04 16:25:27 +0000
@@ -2,6 +2,9 @@
<html#if( $manifest ) manifest="$manifest"#end>
<head>
<title>$encoder.htmlEncode( $applicationTitle )</title>
+ <meta name="description" content="DHIS 2">
+ <meta name="keywords" content="DHIS 2">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" media="screen" href="../dhis-web-commons/javascripts/jQuery/ui/css/redmond/jquery-ui-1.9.1.custom.css" />
<link type="text/css" rel="stylesheet" media="screen,print" href="../dhis-web-commons/css/${stylesheet}" />
<link type="text/css" rel="stylesheet" media="screen,print" href="../dhis-web-commons/css/widgets.css" />
@@ -10,7 +13,6 @@
<link type="text/css" rel="stylesheet" href="$style">
#end
<link rel="shortcut icon" href="../favicon.ico" />
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
var dateFormat = 'yy-mm-dd';
@@ -51,7 +53,7 @@
<script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.ls.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.idb.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.memory.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.js"></script>
+ <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.js"></script>
<script type="text/javascript" src="../dhis-web-commons/i18nJavaScript.action"></script>
<script type="text/javascript" src="../main.js"></script>
<script type="text/javascript" src="../request.js"></script>
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2013-10-02 17:28:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2013-10-04 16:25:27 +0000
@@ -741,6 +741,7 @@
login_password=Password
login_username=Username
forgot_password=Forgot password?
-create_an_account=Create an account
wrong_username_or_password=Wrong username or password
-powered_by=Powered by
\ No newline at end of file
+powered_by=Powered by
+login=Login
+clear=Clear
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_fr.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_fr.properties 2013-07-02 15:58:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_fr.properties 2013-10-04 16:25:27 +0000
@@ -610,3 +610,11 @@
nationality=Nationalit\u00E9
update_access_denied_message=Vous n'avez pas de droit de mise \u00E0 jour sur cet objet
please_enter_at_least_n_words=Veuillez saisir au moins {0} mots.
+create_an_account=Cr� un compte
+login_password=Mot de passe
+login_username=Identifiant
+forgot_password=Mot de passe oubli�+wrong_username_or_password=Identifiant ou mot de passe incorrect
+powered_by=Propuls�ar
+login=Entrer
+clear=Clair
\ No newline at end of file