Translate infoscreen admin page

This commit is contained in:
Jan Tuomi
2017-02-10 18:50:54 +02:00
parent 7ee3f69740
commit 236d080b53
7 changed files with 264 additions and 81 deletions
@@ -1,55 +0,0 @@
<div class="row" ng-controller="infoadmin_ctrl">
<div class="col-xs-12 col-md-6">
<h2>Info items</h2>
<div>Infoitems available for rotations:</div>
<table class="table table-striped">
<tr><th>Item</th><th>Set duration</th><th>Add to rotation</th><th>Delete</th></tr>
<tr ng-repeat="i in infoitems">
<td>{{i.name}}</td>
<td><input type="text" class="form-control" ng-model="i.duration"></input></td>
<td><input type="button" class="btn btn-success" ng-click="createInstance(selected_rot.id, i.id, i.item_type, i.duration);" value="add"></input></td>
<td><input type="button" class="btn btn-danger" ng-click="deleteItem(i.item_type, i.id);" value="delete"></input></td>
</tr>
</table>
<h2>Create new item</h2>
<table class="table table-striped">
<tr><td>Item type</td>
<td><select class="form-control form-control-sm" ng-model="createtype", ng-options="t.name for t in infotypes">
<option value=""></option>
</select></td>
</tr>
</table>
<div ng-include="createtype.create_template_url"></div>
</div>
<div class="col-xs-12 col-md-6">
<h2>Rotations</h2>
<div>
Select rotation to edit:
</div>
<table class="table table-striped">
<tr><th>Rotation</th>
<th>Select</th>
<th>Delete</th></tr>
<tr ng-repeat="r in rotations">
<td>{{r.name}}</td>
<td><input type="button" class="btn btn-info" ng-click="selectRotation(r.id)" value="select"></td>
<td><input type="button" class="btn btn-danger" ng-click="deleteRotation(r.id)" value="delete"></input></td>
</tr>
<tr>
<td><input type="text" class="form-control" ng-model="r.name" placeholder="Name"></input></td>
<td><input type="button" class="btn btn-success" ng-click="createRotation(r.name)" value="create new"></input></td>
<td></td>
</tr>
</table>
<h2>Rotation: {{selected_rot.name}}</h2>
<div>Instances in currently selected rotation:</div>
<table class="table table-striped">
<tr><th>Instance</th><th>Duration</th><th>Delete</th></tr>
<tr ng-repeat="i in selected_rot.instances">
<td>{{i.item.name}}</td><td>{{i.duration}}s</td>
<td><input type="button" ng-click="deleteInstance(i.id);" value="delete" class="btn btn-danger"></input></td>
</tr>
</div>
</div
@@ -1,8 +1,15 @@
var app = angular.module('infoAdmin',['ngFileUpload']);
app.config(['$httpProvider', function ($httpProvider) {
$httpProvider.defaults.xsrfCookieName = 'csrftoken';
$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
}]);
app.config(function($interpolateProvider) {
$interpolateProvider.startSymbol('{$');
$interpolateProvider.endSymbol('$}');
});
app.service("InstanceList", ["$http", function($http){
var self = this;
this.selected_rot = {}
+85 -6
View File
@@ -1,3 +1,5 @@
{% load i18n %}
{% load static %}
<!DOCTYPE html>
<html ng-app="infoAdmin">
<head>
@@ -13,13 +15,90 @@
</head>
<body>
<div id="header" class="row">
<div class="col-xs-1 col-xs-offset-11 col-sm-1 col-lg-1">
<form action="/logout" method="post"> {% csrf_token %}
<input type="Submit" value="Logout" name="Logout" class="btn btn-danger"/>
</form>
</div>
<div class="col-xs-1 col-xs-offset-11 col-sm-1 col-lg-1">
<form action="/logout" method="post"> {% csrf_token %}
<input type="Submit" value="{% trans "Log out" %}" name="Logout" class="btn btn-danger"/>
</form>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>{% trans "Infoscreen Admin Pane" %}</h1>
</div>
</div>
<div class="row" ng-controller="infoadmin_ctrl">
<div class="col-xs-12 col-md-6">
<h2>{% trans "Info items" %}</h2>
<div>{% trans "Infoitems available for rotations" %}</div>
<table class="table table-striped">
<tr>
<th>{% trans "Item" %}</th>
<th>{% trans "Set duration" %}</th>
<th>{% trans "Add to rotation" %}</th>
<th>{% trans "Delete" %}</th>
</tr>
<tr ng-repeat="i in infoitems">
<td>{$ i.name $}</td>
<td><input type="text" class="form-control" ng-model="i.duration"></input></td>
<td><input type="button" class="btn btn-success" ng-click="createInstance(selected_rot.id, i.id, i.item_type, i.duration);" value="add"></input></td>
<td><input type="button" class="btn btn-danger" ng-click="deleteItem(i.item_type, i.id);" value="delete"></input></td>
</tr>
</table>
<h2>{% trans "Create new item" %}</h2>
<table class="table table-striped">
<tr>
<td>{% trans "Item type" %}</td>
<td>
<select class="form-control form-control-sm" ng-model="createtype", ng-options="t.name for t in infotypes">
<option value=""></option>
</select>
</td>
</tr>
</table>
<div ng-include="createtype.create_template_url"></div>
</div>
<div class="col-xs-12 col-md-6">
<h2>{% trans "Rotations" %}</h2>
<div>
{% trans "Select rotation to edit" %}:
</div>
<table class="table table-striped">
<tr>
<th>{% trans "Rotation" %}</th>
<th>{% trans "Select" %}</th>
<th>{% trans "Delete" %}</th>
</tr>
<tr ng-repeat="r in rotations">
<td>{$ r.name $}</td>
<td><input type="button" class="btn btn-info" ng-click="selectRotation(r.id)" value="{% trans "Select" %}"></td>
<td><input type="button" class="btn btn-danger" ng-click="deleteRotation(r.id)" value="{% trans "Delete" %}"></input></td>
</tr>
<tr>
<td><input type="text" class="form-control" ng-model="r.name" placeholder="{% trans "Name" %}"></input></td>
<td><input type="button" class="btn btn-success" ng-click="createRotation(r.name)" value="{% trans "Create new" %}"></input></td>
<td></td>
</tr>
</table>
<div class="container" ng-include="'/static/html/infoscreen_admin.html'"></div>
<h2>{% trans "Rotation" %}: {$ selected_rot.name $}</h2>
<div>{% trans "Instances in currently selected rotation" %}:</div>
<table class="table table-striped">
<tr>
<th>{% trans "Instance" %}</th>
<th>{% trans "Duration" %}</th>
<th>{% trans "Delete" %}</th>
</tr>
<tr ng-repeat="i in selected_rot.instances">
<td>{$ i.item.name $}</td><td>{$ i.duration $} s</td>
<td><input type="button" ng-click="deleteInstance(i.id);" value="{% trans "Delete" %}" class="btn btn-danger"></input></td>
</tr>
</table>
</div>
</div>
<div style="margin-top: 100px;">
{% include "footer.html" %}
</div>
</div>
</body>
</html>
Binary file not shown.
+85 -9
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-06 01:08+0200\n"
"POT-Creation-Date: 2017-02-06 19:51+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,6 +17,90 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: infoscreen/templates/infoscreen_admin.html:20
#: members/templates/members_base.html:67
msgid "Log out"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:27
msgid "Infoscreen Admin Pane"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:32
msgid "Info items"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:33
msgid "Infoitems available for rotations"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:36
msgid "Item"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:37
msgid "Set duration"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:38
msgid "Add to rotation"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:39
#: infoscreen/templates/infoscreen_admin.html:70
#: infoscreen/templates/infoscreen_admin.html:75
#: infoscreen/templates/infoscreen_admin.html:90
#: infoscreen/templates/infoscreen_admin.html:94
#: members/templates/member_list.html:63
msgid "Delete"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:48
msgid "Create new item"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:51
msgid "Item type"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:62
msgid "Rotations"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:64
msgid "Select rotation to edit"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:68
#: infoscreen/templates/infoscreen_admin.html:84
msgid "Rotation"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:69
#: infoscreen/templates/infoscreen_admin.html:74
msgid "Select"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:78
msgid "Name"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:79
msgid "Create new"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:85
msgid "Instances in currently selected rotation"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:88
msgid "Instance"
msgstr ""
#: infoscreen/templates/infoscreen_admin.html:89
msgid "Duration"
msgstr ""
#: members/templates/member_list.html:13 members/templates/member_list.html:45
msgid "Added"
msgstr ""
@@ -97,10 +181,6 @@ msgstr ""
msgid "Edit"
msgstr ""
#: members/templates/member_list.html:63
msgid "Delete"
msgstr ""
#: members/templates/member_list.html:63
msgid "Are you sure?"
msgstr ""
@@ -125,10 +205,6 @@ msgstr ""
msgid "Member register of SIK ry"
msgstr ""
#: members/templates/members_base.html:67
msgid "Log out"
msgstr ""
#: sikweb/settings-sample.py:141 sikweb/settings.py:146
msgid "English"
msgstr ""
Binary file not shown.
+87 -11
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-06 01:08+0200\n"
"POT-Creation-Date: 2017-02-06 19:51+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,6 +18,90 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: infoscreen/templates/infoscreen_admin.html:20
#: members/templates/members_base.html:67
msgid "Log out"
msgstr "Kirjaudu ulos"
#: infoscreen/templates/infoscreen_admin.html:27
msgid "Infoscreen Admin Pane"
msgstr "Infonäyttöjen hallintapaneeli"
#: infoscreen/templates/infoscreen_admin.html:32
msgid "Info items"
msgstr "Diat"
#: infoscreen/templates/infoscreen_admin.html:33
msgid "Infoitems available for rotations"
msgstr "Rotaatioon lisättävät diat"
#: infoscreen/templates/infoscreen_admin.html:36
msgid "Item"
msgstr "Dia"
#: infoscreen/templates/infoscreen_admin.html:37
msgid "Set duration"
msgstr "Aseta kesto"
#: infoscreen/templates/infoscreen_admin.html:38
msgid "Add to rotation"
msgstr "Lisää rotaatioon"
#: infoscreen/templates/infoscreen_admin.html:39
#: infoscreen/templates/infoscreen_admin.html:70
#: infoscreen/templates/infoscreen_admin.html:75
#: infoscreen/templates/infoscreen_admin.html:90
#: infoscreen/templates/infoscreen_admin.html:94
#: members/templates/member_list.html:63
msgid "Delete"
msgstr "Poista"
#: infoscreen/templates/infoscreen_admin.html:48
msgid "Create new item"
msgstr "Luo uusi dia"
#: infoscreen/templates/infoscreen_admin.html:51
msgid "Item type"
msgstr "Diatyyppi"
#: infoscreen/templates/infoscreen_admin.html:62
msgid "Rotations"
msgstr "Rotaatiot"
#: infoscreen/templates/infoscreen_admin.html:64
msgid "Select rotation to edit"
msgstr "Valitse muokattava rotaatio"
#: infoscreen/templates/infoscreen_admin.html:68
#: infoscreen/templates/infoscreen_admin.html:84
msgid "Rotation"
msgstr "Rotaatio"
#: infoscreen/templates/infoscreen_admin.html:69
#: infoscreen/templates/infoscreen_admin.html:74
msgid "Select"
msgstr "Valitse"
#: infoscreen/templates/infoscreen_admin.html:78
msgid "Name"
msgstr "Nimi"
#: infoscreen/templates/infoscreen_admin.html:79
msgid "Create new"
msgstr "Luo uusi"
#: infoscreen/templates/infoscreen_admin.html:85
msgid "Instances in currently selected rotation"
msgstr "Nykyisen rotaation diat"
#: infoscreen/templates/infoscreen_admin.html:88
msgid "Instance"
msgstr "Dia"
#: infoscreen/templates/infoscreen_admin.html:89
msgid "Duration"
msgstr "Kesto"
#: members/templates/member_list.html:13 members/templates/member_list.html:45
msgid "Added"
msgstr "Lisätty"
@@ -60,7 +144,7 @@ msgstr "Jäsenrekisteri"
#: members/templates/member_list.html:33
msgid "Download CSV"
msgstr ""
msgstr "Lataa CSV"
#: members/templates/member_list.html:39
msgid "Last name"
@@ -98,10 +182,6 @@ msgstr "Päivitä maksu"
msgid "Edit"
msgstr "Muokkaa"
#: members/templates/member_list.html:63
msgid "Delete"
msgstr "Poista"
#: members/templates/member_list.html:63
msgid "Are you sure?"
msgstr "Oletko varma?"
@@ -126,10 +206,6 @@ msgstr "Jäsenhakemus"
msgid "Member register of SIK ry"
msgstr "Aalto-yliopiston Sähköinsinöörikilta ry:n jäsenrekisteri"
#: members/templates/members_base.html:67
msgid "Log out"
msgstr "Kirjaudu ulos"
#: sikweb/settings-sample.py:141 sikweb/settings.py:146
msgid "English"
msgstr "englanti"
@@ -140,7 +216,7 @@ msgstr "suomi"
#: templates/footer.html:11
msgid "Copyright Aalto-yliopiston Sähköinsinöörikilta ry"
msgstr ""
msgstr "Copyright Aalto-yliopiston Sähköinsinöörikilta ry"
#~ msgid "Change language"
#~ msgstr "Vaihda kieli"