diff options
-rw-r--r-- | index.html | 20 | ||||
-rw-r--r-- | js/codeq/login.js | 1 | ||||
-rw-r--r-- | js/codeq/profile.js | 15 | ||||
-rw-r--r-- | res/en.json | 10 | ||||
-rw-r--r-- | res/sl.json | 10 |
5 files changed, 37 insertions, 19 deletions
@@ -42,7 +42,7 @@ <li style="display: none;" id="navigation-prolog"><a href="" data-tkey="prolog">Prolog</a></li> <li style="display: none;" id="navigation-robot"><a href="" data-tkey="robot">Robot</a></li> </ul> - <ul class="nav navbar-nav navbar-right"> + <ul class="nav navbar-nav navbar-right" style="display: none;"> <p class="navbar-text"><span data-tkey="signed_in_as">Signed in as </span><span id="signed-in-title">Janez</span></p> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true"> @@ -70,7 +70,7 @@ <div class="form-group"> <span class="small" data-tkey="robot_address">Robot’s address</span> <a class="text-muted" data-container="body" data-toggle="popover" data-trigger="hover" data-placement="left" data-html="true" data-content="<span class='small'>Set the robot's IP address.</span>" data-original-title="" title=""><i class="glyphicon glyphicon-question-sign"></i></a><br> - <input type="text" class="form-control" id="robot_address_input" /> + <input type="text" class="form-control" id="robot_address_input" data-tkey-placeholder="password_verify_placeholder" placeholder="Repeat the password again" pattern="(((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$)|(((^|:)([0-9a-fA-F]{0,4})){1,8}$)" data-tkey-title="ip_title" title="Choose a valid IPv4 address"> </div> <div class="form-group"> <div class="text-right"> @@ -367,10 +367,10 @@ <!-- profile screen --> <div class="container" id="screen_profile" style="display: none;"> <h2> - Profile - <div class="btn-group btn-group-xs hidden-md pull-right"> + <span data-tkey="profile">Profile</span> + <div class="btn-group pull-right"> <a href="" data-toggle="modal" data-target="#modalChangePassword" class="btn btn-default" data-tkey="change_pass" id="change_pass_profile">Change Password</a> - <a href="#" class="btn btn-default" id="btnProfileGoBack" onclick="history.back()">Go back</a> + <a href="#" class="btn btn-default" id="btnProfileGoBack" onclick="history.back()" data-tkey="go_back">Go back</a> </div> </h2> <hr> @@ -381,14 +381,14 @@ Overview </div> <ul class="list-group small"> - <li class="list-group-item text-right"><span class="pull-left"><strong>Username</strong></span><span id="profileUsername">janezk</span></li> - <li class="list-group-item text-right"><span class="pull-left"><strong>Real name</strong></span><span id="profileName">Janez Kranjski</span></li> - <li class="list-group-item text-right"><span class="pull-left"><strong>Joined</strong></span><span id="profileJoined">Sep 29, 2015</span></li> - <li class="list-group-item text-right"><span class="pull-left"><strong>Last seen</strong></span><span id="profileLastLogin">1 hour ago</span></li> + <li class="list-group-item text-right"><span class="pull-left"><strong data-tkey="username">Username</strong></span><span id="profileUsername">janezk</span></li> + <li class="list-group-item text-right"><span class="pull-left"><strong data-tkey="name">Display name</strong></span><span id="profileName">Janez Kranjski</span></li> + <li class="list-group-item text-right"><span class="pull-left"><strong data-tkey="joined">Joined</strong></span><span id="profileJoined">Sep 29, 2015</span></li> + <li class="list-group-item text-right"><span class="pull-left"><strong data-tkey="last_login">Last seen</strong></span><span id="profileLastLogin">1 hour ago</span></li> </ul> </div> <div class="panel panel-default"> - <div class="panel-heading">Statistics</div> + <div class="panel-heading" data-tkey="statistics">Statistics</div> <table id="table1" class="table table-bordered table-striped small"></table> </div> </div><!--/col-12--> diff --git a/js/codeq/login.js b/js/codeq/login.js index 961b708..97bb44b 100644 --- a/js/codeq/login.js +++ b/js/codeq/login.js @@ -87,7 +87,6 @@ jqAAILoginBtn.off('click'); $("#screen_login").css('display', 'none'); - $('#signed-in-title').html($('#username').val()); $("#password").val(''); //re-enable the click listener jqNavigationHomeBtn.on('click', function(e){ diff --git a/js/codeq/profile.js b/js/codeq/profile.js index 3f4a274..133c947 100644 --- a/js/codeq/profile.js +++ b/js/codeq/profile.js @@ -16,17 +16,20 @@ codeq.comms.getUserStat()
.then(function (data) {
if (data.code !== 0) throw new Error('GetUserStat failed, code: ' + data.code + ', message: ' + data.message);
- console.log(data);
- var data = data.stat;
+ data = data.stat;
var columns = ['language', 'problem_group', 'problems_count', 'done', 'in_progress'],
- labels = ['Language', 'Problem group', 'All', 'Done', 'In progress'];
+ labels = ['Language', 'Problem group', 'All', 'Done', 'In progress'],
+ items='<thead><tr>',
+ tr_gui = codeq.tr.getDictionary('gui');
- var items='<thead><tr>';
- $.each(labels, function( key, val ) {
- items+='<th>'+val+'</th>';
+ console.log(tr_gui);
+
+ $.each(columns, function( key, val ) {
+ items+='<th data-tkey="'+ val + '">'+tr_gui[val][codeq.settings['gui_lang']]+'</th>';
});
items+='</tr></thead>';
+
$.each( data, function( object, row ) {
items+='<tr>';
if(row['problem_group']) {
diff --git a/res/en.json b/res/en.json index 0eade46..c721548 100644 --- a/res/en.json +++ b/res/en.json @@ -39,5 +39,13 @@ "password_new": "New Password", "password_new_placeholder": "Enter a new password", "change_password_button": "Change password", - "signed_in_as": "Signed in as " + "signed_in_as": "Signed in as ", + "go_back": "Go back", + "joined": "Joined", + "last_login": "Last seen", + "statistics": "Statistics", + "problem_group": "Problem group", + "problems_count": "All", + "done": "Done", + "in_progress": "In progress" } diff --git a/res/sl.json b/res/sl.json index dc29ebb..7745fd7 100644 --- a/res/sl.json +++ b/res/sl.json @@ -39,5 +39,13 @@ "password_new": "Novo geslo", "password_new_placeholder": "Vnesite novo geslo", "change_password_button": "Spremeni geslo", - "signed_in_as": "Prijavljeni ste kot " + "signed_in_as": "Prijavljeni ste kot ", + "go_back": "Nazaj", + "joined": "Registriran", + "last_login": "Zadnjič prijavljen", + "statistics": "Statistika", + "problem_group": "Poglavje", + "problems_count": "Vse naloge", + "done": "Narejeno", + "in_progress": "V delu" } |