-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 64472b1 🚀
- Loading branch information
Showing
745 changed files
with
500,476 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
test/apps/EmberApps/AnmeldedetailsEinlesen/App/Controllers/application.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define([ | ||
'ember', | ||
'application' | ||
], function (ember, app) { | ||
app.ApplicationController = ember.Controller.extend({ | ||
subscriptionDetails: null, // allow all Routes to access the subscriptionDetails | ||
resetInputTextarea: false, // let the result Route reset the textArea when the details get sent | ||
}); | ||
}); |
79 changes: 79 additions & 0 deletions
79
test/apps/EmberApps/AnmeldedetailsEinlesen/App/Controllers/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
define([ | ||
'ember', | ||
'application' | ||
], function (ember, app) { | ||
|
||
// Dependencies of the computed properties: | ||
// | ||
// +-------------+ | ||
// |TextareaValue| | ||
// +-----+-------+ | ||
// | | ||
// +-----v----------------+ | ||
// | strippedTextareaValue| | ||
// +-----+-------------+--+ | ||
// | | | ||
// +-----v---------+ +-v-----------------+ | ||
// |textareaIsEmpty| |subscriptionDetails| | ||
// +-----+---------+ +-+-----------------+ | ||
// | | | ||
// +-----v---+ | | ||
// |showError<---------+ | ||
// +---------+ | ||
app.InputController = ember.Controller.extend({ | ||
|
||
// the content of the textarea | ||
textareaValue: '', | ||
|
||
// textareaValue without whitespace | ||
strippedTextareaValue: ember.computed('textareaValue', function () { | ||
var textareaValue = this.get('textareaValue'); | ||
|
||
// remove empty lines | ||
textareaValue = textareaValue.replace(/(?:(?:^|\n)[\t ]*)+(?:$|\n)/g, '\n'); | ||
|
||
// remove first and last newline (if they exist) | ||
textareaValue = textareaValue.replace(/^\n|\n$/g, ''); | ||
|
||
return textareaValue; | ||
}), | ||
|
||
// this property is true when the textarea is empty | ||
textareaIsEmpty: ember.computed('strippedTextareaValue', function () { | ||
return this.get('strippedTextareaValue') === ''; | ||
}), | ||
|
||
// this property contains the parsed subscriptionDetails of the textarea | ||
subscriptionDetails: ember.computed('strippedTextareaValue', function () { | ||
var rows = this.get('strippedTextareaValue').split('\n'); | ||
var subscriptionDetails = []; | ||
|
||
for (var i = 0; i < rows.length; i++) { | ||
var result = rows[i].match(/^(\d+)\t(\d+)\t(\d+)\t([^\t]+)$/); | ||
|
||
if (result === null) { | ||
return null; | ||
} | ||
|
||
subscriptionDetails.push(ember.Object.create({ | ||
eventId: result[1], | ||
personId: result[2], | ||
subscriptionDetailId: result[3], | ||
newValue: result[4] | ||
})); | ||
} | ||
|
||
return subscriptionDetails; | ||
}), | ||
|
||
// the textarea is not empty and cannot be parsed | ||
showError: ember.computed('textareaIsEmpty', 'subscriptionDetails', function () { | ||
return this.get('textareaIsEmpty') === false && this.get('subscriptionDetails') === null; | ||
}), | ||
|
||
// it's not possible to go to the next step when no subscriptionDetail can be parsed | ||
cannotContinue: ember.computed('subscriptionDetails', function () { | ||
return this.get('subscriptionDetails') === null; | ||
}) | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
test/apps/EmberApps/AnmeldedetailsEinlesen/App/Controllers/validation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
define([ | ||
'ember', | ||
'application' | ||
], function (ember, app) { | ||
app.ValidationController = ember.Controller.extend({ | ||
|
||
cannotGoBack: ember.computed.not('model.everythingIsChecked'), | ||
|
||
cannotContinue: ember.computed('model.everythingIsChecked', 'model.thereAreOnlyErrors', function () { | ||
return !this.get('model.everythingIsChecked') || this.get('model.thereAreOnlyErrors'); | ||
}), | ||
}); | ||
}); |
Binary file added
BIN
+187 Bytes
test/apps/EmberApps/AnmeldedetailsEinlesen/App/Controllers/vssver2.scc
Binary file not shown.
3 changes: 3 additions & 0 deletions
3
test/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/application.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="dialog readSubscriptionDetails"> | ||
{{outlet}} | ||
</div> |
17 changes: 17 additions & 0 deletions
17
test/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/input.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div class="dialogBody"> | ||
{{outlet "navigation"}} | ||
<div class="dialogBlockFixed"> | ||
<p>{{translate "readSubscriptionDetailsInfo"}}<br><pre>{{translate "readSubscriptionDetailsFields"}}</pre></p> | ||
{{textarea value=textareaValue rows=27 spellcheck=false class=(if showError "textarea--error")}} | ||
</div> | ||
</div> | ||
<div class="dialogFooter"> | ||
{{#if showError}} | ||
<span class="text-danger">{{translate "incorrectFormat"}}</span> | ||
{{/if}} | ||
<div> | ||
{{#link-to "validation" tagName="button" class="btn btn-primary float-right" disabledWhen=cannotContinue}} | ||
<div>{{translate "validate"}}</div> | ||
{{/link-to}} | ||
</div> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
test/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/navigation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="dialogBlockFixed"> | ||
<h2> | ||
{{#link-to "input" disabled=true}}{{translate "input"}}{{/link-to}} | ||
› | ||
{{#link-to "validation" disabled=true}}{{translate "validation"}}{{/link-to}} | ||
› | ||
{{#link-to "result" disabled=true}}{{translate "result"}}{{/link-to}} | ||
</h2> | ||
</div> |
60 changes: 60 additions & 0 deletions
60
test/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/result.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<div class="dialogBody"> | ||
{{outlet "navigation"}} | ||
<table class="borderTable"> | ||
<thead> | ||
<tr> | ||
<th>{{translate "event"}}</th> | ||
<th>{{translate "name"}}</th> | ||
<th>{{translate "subscriptionDetail"}}</th> | ||
<th>{{translate "oldValue"}}</th> | ||
<th>{{translate "newValue"}}</th> | ||
<th>{{translate "status"}}</th> | ||
<th>{{translate "fehler"}}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{{#each model.subscriptionDetails as |subscriptionDetail|}} | ||
{{#unless subscriptionDetail.error}} | ||
<tr> | ||
<td>{{subscriptionDetail.event}}</td> | ||
<td>{{subscriptionDetail.name}}</td> | ||
<td>{{subscriptionDetail.subscriptionDetail}}</td> | ||
<td>{{subscriptionDetail.oldValue}}</td> | ||
<td>{{subscriptionDetail.newValue}}</td> | ||
<td> | ||
<div> | ||
{{#if subscriptionDetail.loading}} | ||
<div class="spinner-border spinner-border-sm" role="status"> | ||
</div> | ||
{{else}} | ||
{{#if subscriptionDetail.uploaded}} | ||
<i class="material-icons text-success">check_circle</i> | ||
{{else}} | ||
<i class="material-icons text-danger">cancel</i> <br> | ||
{{/if}} | ||
{{/if}} | ||
</div> | ||
</td> | ||
<td>{{subscriptionDetail.errorUpload}}</td> | ||
</tr> | ||
{{/unless}} | ||
{{/each}} | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="dialogFooter"> | ||
{{#if model.error}} | ||
<span class="text-danger"> | ||
{{translate "goBackToStartError"}} | ||
</span> | ||
{{else}} | ||
<div> | ||
{{translate "goBackToStart"}} | ||
</div> | ||
{{/if}} | ||
<div> | ||
{{#link-to "input" tagName="button" class="btn btn-primary float-right" disabledWhen=(if model.everythingHasBeenSent false true)}} | ||
<div>{{translate "input"}}</div> | ||
{{/link-to}} | ||
</div> | ||
</div> |
65 changes: 65 additions & 0 deletions
65
test/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/validation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<div class="dialogBody"> | ||
{{outlet "navigation"}} | ||
<table class="borderTable"> | ||
<thead> | ||
<tr> | ||
<th>{{translate "event"}}</th> | ||
<th>{{translate "name"}}</th> | ||
<th>{{translate "subscriptionDetail"}}</th> | ||
<th>{{translate "oldValue"}}</th> | ||
<th>{{translate "newValue"}}</th> | ||
<th>{{translate "status"}}</th> | ||
<th>{{translate "fehler"}}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{{#each model.subscriptionDetails as |subscriptionDetail|}} | ||
<tr> | ||
{{#if subscriptionDetail.checked}} | ||
<td>{{subscriptionDetail.event}}</td> | ||
<td>{{subscriptionDetail.name}}</td> | ||
<td>{{subscriptionDetail.subscriptionDetail}}</td> | ||
<td>{{subscriptionDetail.oldValue}}</td> | ||
<td>{{subscriptionDetail.newValue}}</td> | ||
<td> | ||
<div> | ||
{{#if subscriptionDetail.error}} | ||
<i class="material-icons text-danger">cancel</i> | ||
{{else}} | ||
<i class="material-icons text-success">check_circle</i> | ||
{{/if}} | ||
</div> | ||
</td> | ||
<td>{{subscriptionDetail.error}}</td> | ||
{{else}} | ||
{{! we don't yet know the values of the other fields }} | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td colspan="6"> | ||
<div class="spinner-border spinner-border-sm" role="status"> | ||
</div> | ||
</td> | ||
{{/if}} | ||
</tr> | ||
{{/each}} | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="dialogFooter"> | ||
<div class=""> | ||
{{#link-to "input" tagName="button" class="btn btn-outline-secondary" disabledWhen=cannotGoBack}} | ||
<div>{{translate "correct"}}</div> | ||
{{/link-to}} | ||
</div> | ||
<div> | ||
{{translate "continueWithErrors"}} | ||
</div> | ||
<div> | ||
{{#link-to "result" tagName="button" class="btn btn-primary" disabledWhen=cannotContinue}} | ||
<div>{{translate "submit"}}</div> | ||
{{/link-to}} | ||
</div> | ||
</div> |
Binary file added
BIN
+255 Bytes
test/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/vssver2.scc
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
test/apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
define([ | ||
'ember', | ||
'application', | ||
'translate' | ||
], function (ember, app, translate) { | ||
app.IndexRoute = ember.Route.extend({ | ||
beforeModel: function (transition) { | ||
// always transition to input | ||
this.transitionTo('input'); | ||
} | ||
}); | ||
}); |
48 changes: 48 additions & 0 deletions
48
test/apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
define([ | ||
'ember', | ||
'application', | ||
'translate', | ||
'App/Templates/input', | ||
'App/Controllers/input' | ||
], function (ember, app, translate) { | ||
app.InputRoute = ember.Route.extend({ | ||
renderTemplate: function () { | ||
this.render(); | ||
|
||
// render the navigation | ||
this.render('navigation', { | ||
into: 'input', | ||
outlet: 'navigation' | ||
}); | ||
}, | ||
|
||
actions: { | ||
didTransition: function () { | ||
var applicationController = this.controllerFor('application'); | ||
|
||
if (applicationController.get('resetInputTextarea') === true) { | ||
applicationController.set('resetInputTextarea', false); | ||
this.controller.set('textareaValue', ''); | ||
} | ||
}, | ||
|
||
willTransition: function (transition) { | ||
if (transition.targetName === 'result') { | ||
// it's not possible to go directly to the result route | ||
transition.abort(); | ||
return; | ||
} | ||
|
||
if (this.controller.get('cannotContinue')) { | ||
transition.abort(); | ||
return; | ||
} | ||
|
||
// put the subScriptiondetails to the application controller so it can be accessed | ||
// by the other routes | ||
var subscriptionDetails = this.controller.get('subscriptionDetails'); | ||
this.controllerFor('application').set('subscriptionDetails', subscriptionDetails); | ||
} | ||
} | ||
}); | ||
}); |
Oops, something went wrong.