added reset, plausibility check, onlyNumbers input, !intervall1 > inervall2...

added reset, plausibility check, onlyNumbers input, !intervall1 > inervall2 check, profile in frontend is now responsive, new english- german translations. TODO code formatting,color,bigger pokal
parent 07daed8b
......@@ -3,4 +3,4 @@ settings-staging.json
npm-debug.log
.idea/
.DS_Store
node_modules
node_modules/
......@@ -233,7 +233,10 @@
"yesterday": "Gestern",
"month": "Wochen",
"threemonth": "Monate",
"default1" : "Standard 7 Tage",
"default2" : "Standard 30 Tage",
"default3" : "Standard 90 Tage",
"reset" : "Zurücksetzen",
"lastredeem": "Zuletzt für: "
},
"panel-body-last": {
......
......@@ -227,8 +227,12 @@
"total": "Total",
"today": "Today",
"yesterday": "Yesterday",
"twoDaysAgo": "Day before yesterday",
"days": "7 days",
"twoDaysAgo": "Two days ago",
"days": "days",
"reset" : "reset",
"default1" : "default 7 days",
"default2" : "default 30 days",
"default3" : "default 90 days",
"lastredeem": "At last for: "
},
"panel-body-last": {
......
......@@ -14,7 +14,6 @@ Meteor.methods({
updateIntervall: function (inv1, inv2, inv3) {
if (!Roles.userIsInRole(this.userId, ["admin", "editor"])) {
throw new Meteor.Error("not-authorized");
}
AdminSettings.update(
{
......
......@@ -8,7 +8,7 @@ Meteor.startup(function() {
var badges = initBadges();
if(!AdminSettings.findOne({name: "seqSettings"})){
AdminSettings.insert({// TODO wegen insecure erlauben
AdminSettings.insert({
name: "seqSettings",
seqOne:7,
seqTwo: 30,
......
......@@ -269,29 +269,38 @@
</div>
<div class="panel-body panel-body-experience">
<div class="row" style="margin-bottom:10px; margin-left: 5px">
<div class="panel-body">
<form class="form-inline">
<form class="form-inline" role="form">
<div class="form-group" style="margin-right: 20px; margin-bottom: 5px">
<label for="intervall1">Intervall 1 </label>
<input type="number" class="form-control" id="inv1" placeholder="Standard 1 Tag">
<label for="intervall1">Tag(e) </label>
<input type="number" min="0" data-bind="value:replyNumber"
onkeypress="return (event.charCode == 8 || event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57"
class="form-control" id="inv1" placeholder="{{_ "panel-body-experience.default1"}}">
<label for="intervall1">{{_ "panel-body-experience.days"}}</label>
</div>
<div class="form-group" style="margin-right: 20px; margin-bottom: 5px">
<label for="intervall2">Intervall 2 </label>
<input type="number" class="form-control" id="inv2" placeholder="Standard 30 Tage">
<label for="intervall2">Tage </label>
<input type="number" min="0" data-bind="value:replyNumber"
onkeypress="return (event.charCode == 8 || event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57"
class="form-control" id="inv2" placeholder="{{_ "panel-body-experience.default2"}}">
<label for="intervall2">{{_ "panel-body-experience.days"}}</label>
</div>
<div class="form-group" style="margin-right: 20px; margin-bottom: 5px">
<label for="intervall3">Intervall 3 </label>
<input type="number" class="form-control" id="inv3" placeholder="Standard 90 Tage">
<label for="intervall3">Tage </label>
<input type="number" min="0" data-bind="value:replyNumber"
onkeypress="return (event.charCode == 8 || event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57"
class="form-control" id="inv3" placeholder="{{_ "panel-body-experience.default3"}}">
<label for="intervall3">{{_ "panel-body-experience.days"}}</label>
</div>
<div class="btn-group pull-right">
<button id="resetIntervall" type="button" class="btn btn-warning">{{_ "panel-body-experience.reset"}}</button>
<button id="saveIntervall" type="button" class="btn btn-success pull-right">{{startXp}} {{_ "profile.save"}}</button>
</div>
<button type="button" class="btn btn-success" id="saveIntervall">Speichern</button>
</form>
</div>
</div>
</div>
......@@ -308,9 +317,9 @@
</div>
<div class="panel-body panel-body-experience">
<div class="row" style="margin-bottom:15px">
{{startXp}}
<!-- Secquencer 1 -->
<div class="col-md-4">
<div class="col-md-4 col-xs-4">
<div class="well well-sm" style="margin:0; text-align:center">
<div class="row" style="height:50px;">
<span style="display:inline-block; font-size:20px; margin-top:22px; height:20px">
......@@ -318,13 +327,13 @@
</div>
<div class="row">
<span class="text-muted" style="font-size:12px">
{{_ "panel-body-experience.days"}}
{{getDays1}} {{_ "panel-body-experience.days"}}
</span>
</div>
</div>
</div>
<!-- Secquencer 2 -->
<div class="col-md-4">
<div class="col-md-4 col-xs-4">
<div class="well well-sm" style="margin:0; text-align:center">
<div class="row" style="height:50px;">
<span style="display:inline-block; font-size:20px; margin-top:22px; height:20px">
......@@ -332,13 +341,13 @@
</div>
<div class="row">
<span class="text-muted" style="font-size:12px">
{{_ "panel-body-experience.days"}}
{{getDays2}} {{_ "panel-body-experience.days"}}
</span>
</div>
</div>
</div>
<!-- Secquencer 3 -->
<div class="col-md-4">
<div class="col-md-4 col-xs-4">
<div class="well well-sm" style="margin:0; text-align:center">
<div class="row" style="height:50px;">
<span style="display:inline-block; font-size:20px; margin-top:22px; height:20px">
......@@ -346,7 +355,7 @@
</div>
<div class="row">
<span class="text-muted" style="font-size:12px">
{{_ "panel-body-experience.days"}}
{{getDays3}} {{_ "panel-body-experience.days"}}
</span>
</div>
</div>
......
......@@ -167,9 +167,9 @@ Template.admin_settings.events({
var inv1 = document.getElementById('inv1').value;
var inv2 = document.getElementById('inv2').value;
var inv3 = document.getElementById('inv3').value;
console.log(inv1);
if(inv1 == 0){
inv1 = 1;
inv1 = 7;
}
if(inv2 == 0){
......@@ -178,11 +178,22 @@ Template.admin_settings.events({
if(inv3 == 0){
inv3 = 90;
}
Meteor.call('updateIntervall', inv1,inv2,inv3);
console.log(inv1);
console.log(inv2);
console.log(inv3);
if(inv1 == 0 || inv2 == 0 || inv3 == 0){
//Bitte alle Felder ausfüllen
}else{
if (inv1 < inv2 && inv2 < inv3 && inv1 < inv3) {
Meteor.call('updateIntervall', inv1, inv2, inv3);
console.log(inv1);
console.log(inv2);
console.log(inv3);
} else {
//Intervall muss 1 größer als 2 sein & 2 muss größer 3 sein.
}
}
},
'click #resetIntervall': function() {
Meteor.call('updateIntervall', 7, 30, 90);
}
});
......@@ -341,3 +352,31 @@ Template.cardsetConfirmFormUserAdmin.events({
}).modal('hide');
}
});
var seqOne = 7; //7 tag
var seqTwo = 29; //30 tag
var seqThree = 90; //90 tag
Template.preview.helpers({
startXp: function () {
var seq = AdminSettings.findOne({name: "seqSettings"});
if(seq){
seqOne = seq.seqOne; //7 tag
seqTwo = seq.seqTwo; //30 tag
seqThree = seq.seqThree; //90 tag
} else {
//console.log("error could not find adminSettings");
}
},
getDays1: function (){
return seqOne;
},
getDays2: function(){
return seqTwo;
},
getDays3: function(){
return seqThree;
}
});
\ No newline at end of file
......@@ -228,7 +228,7 @@
</div>
</div>
</div>
<div class="col-md-3">
<div class="col-md-2 col-xs-2">
<div class="well well-sm" style="margin:0; text-align:center">
<div class="row" style="height:50px;">
<span style="display:inline-block; font-size:30px; margin-top:12px">
......@@ -242,7 +242,8 @@
</div>
</div>
</div>
<div class="col-md-3">
<div class="col-md-2 col-xs-2">
<div class="well well-sm" style="margin:0; text-align:center">
<div class="row" style="height:50px;">
<span style="display:inline-block; font-size:25px; margin-top:17px; height:25px;">
......@@ -257,7 +258,7 @@
</div>
</div>
<!-- vorgestern 1 -->
<div class="col-md-2">
<div class="col-md-2 col-xs-2">
<div class="well well-sm" style="margin:0; text-align:center">
<div class="row" style="height:50px;">
<span style="display:inline-block; font-size:20px; margin-top:22px; height:20px">
......@@ -272,7 +273,7 @@
</div>
</div>
<!-- Secquencer 1 -->
<div class="col-md-2">
<div class="col-md-2 col-xs-2">
<div class="well well-sm" style="margin:0; text-align:center">
<div class="row" style="height:50px;">
<span style="display:inline-block; font-size:20px; margin-top:22px; height:20px">
......@@ -287,7 +288,7 @@
</div>
</div>
<!-- Secquencer 2 -->
<div class="col-md-2">
<div class="col-md-2 col-xs-2">
<div class="well well-sm" style="margin:0; text-align:center">
<div class="row" style="height:50px;">
<span style="display:inline-block; font-size:20px; margin-top:22px; height:20px">
......@@ -302,7 +303,7 @@
</div>
</div>
<!-- Secquencer 3 -->
<div class="col-md-2">
<div class="col-md-2 col-xs-2">
<div class="well well-sm" style="margin:0; text-align:center">
<div class="row" style="height:50px;">
<span style="display:inline-block; font-size:20px; margin-top:22px; height:20px">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment