-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc5d732
commit 0ed5590
Showing
12 changed files
with
217 additions
and
33 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/composer.lock | ||
/vendor | ||
/vendor | ||
/node_modules |
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,7 @@ | ||
var elixir = require('laravel-elixir'); | ||
|
||
require('laravel-elixir-vueify'); | ||
|
||
elixir(function(mix) { | ||
mix.browserify('app.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,17 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"prod": "gulp --production", | ||
"dev": "gulp watch" | ||
}, | ||
"devDependencies": { | ||
"babel-polyfill": "^6.13.0", | ||
"email-addresses": "^2.0.2", | ||
"gulp": "^3.9.1", | ||
"js-cookie": "^2.1.2", | ||
"laravel-elixir": "^5.0.0", | ||
"laravel-elixir-vueify": "^1.0.3", | ||
"vue": "^1.0.26", | ||
"vue-resource": "^0.9.3" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
import Vue from 'vue'; | ||
import './bootstrap'; | ||
import 'babel-polyfill' | ||
|
||
import AddManyMembers from './components/AddManyMembers.vue'; | ||
import AddMembersFile from './components/AddMembersFile.vue'; | ||
|
||
Vue.component('addManyMembers', AddManyMembers); | ||
Vue.component('addMembersFile', AddMembersFile); | ||
|
||
new Vue({ | ||
el: 'body' | ||
}); |
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,10 @@ | ||
import Cookies from 'js-cookie'; | ||
import Vue from 'vue'; | ||
import VueResource from 'vue-resource'; | ||
|
||
Vue.use(VueResource); | ||
|
||
Vue.http.interceptors.push(function (request, next) { | ||
request.headers['X-XSRF-TOKEN'] = Cookies.get('XSRF-TOKEN'); | ||
next(); | ||
}); |
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,105 @@ | ||
<template> | ||
<div> | ||
<div v-if="adding"> | ||
<p v-if="canAddMore">Klaar! <button class="btn btn-xs btn-success" @click="addMore">Meer leden toevoegen</button></p> | ||
<p v-else><strong>Toevoegen van addressen...</strong></p> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>E-mailadres</th> | ||
<th>Naam</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr v-for="address in addressesToAdd"> | ||
<td>{{ address.email }}</td> | ||
<td>{{ address.name }}</td> | ||
<td> | ||
<span v-show="address.status == 'pending'"> | ||
<i class="fa fa-spinner fa-pulse fa-fw"></i> | ||
</span> | ||
<span v-show="address.status == 'ok'" class="text-success"> | ||
<i class="fa fa-check fa-fw"></i> | ||
</span> | ||
<span v-show="address.status == 'invalid'" class="text-danger"> | ||
<i class="fa fa-times fa-fw"></i> | ||
</span> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="add-form" v-else> | ||
<p>Voer een door komma's gescheiden lijst met e-mailadressen in, eventueel met namen. Extra spaties zijn | ||
toegestaan.</p> | ||
<p>Voorbeelden van geldige invoeren:</p> | ||
<ul> | ||
<li><code>[email protected], [email protected], [email protected]</code></li> | ||
<li><code>Jan Smit <[email protected]>, Piet Jansen<[email protected]>, "Company Example.com" | ||
<[email protected]></code> | ||
</li> | ||
<li><code>[email protected], Piet <[email protected]>,[email protected]</code></li> | ||
</ul> | ||
<div class="form-group"> | ||
<textarea class="form-control" rows="5" placeholder="" | ||
style="font-family: Menlo,Monaco,Consolas,'Courier New',monospace" | ||
v-model="addressList"></textarea> | ||
<div class="alert alert-danger" v-show="invalid">Ongeldige invoer</div> | ||
</div> | ||
<button type="button" class="btn btn-success" @click="add">Lijst toevoegen</button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import emailAddresses from 'email-addresses'; | ||
export default { | ||
props: ['listId'], | ||
data() { | ||
return { | ||
addressList: '', | ||
invalid: false, | ||
adding: false, | ||
addressesToAdd: [], | ||
canAddMore: false, | ||
}; | ||
}, | ||
methods: { | ||
add() { | ||
let addresses = emailAddresses.parseAddressList(this.addressList); | ||
if (!addresses) { | ||
this.invalid = true; | ||
} else { | ||
this.adding = true; | ||
this.invalid = false; | ||
this.addressesToAdd = []; | ||
this.canAddMore = false; | ||
Promise.all(addresses.map(this.submitAddress)).then(() => { | ||
this.canAddMore = true; | ||
}); | ||
} | ||
}, | ||
submitAddress(address) { | ||
let addressToAdd = { | ||
email: address.address, | ||
name: address.name, | ||
status: 'pending' | ||
}; | ||
this.addressesToAdd.push(addressToAdd); | ||
return this.$http.post(`${this.listId}/members`, { | ||
email: address.address, | ||
name: address.name | ||
}).then(response => { | ||
addressToAdd.status = response.json().status; | ||
}); | ||
}, | ||
addMore() { | ||
this.addressList = ''; | ||
this.adding = false; | ||
} | ||
} | ||
} | ||
</script> |
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,5 @@ | ||
<template> | ||
<div> | ||
|
||
</div> | ||
</template> |
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
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
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