Created js controller for the mass import and changed style of the mass

import page
This commit is contained in:
HooVee
2016-08-25 19:20:40 +03:00
parent c635f009d8
commit 7ece10ff8a
2 changed files with 26 additions and 2 deletions
+11 -2
View File
@@ -1,5 +1,14 @@
<h1> Lisää useampi jäsen </h1>
<div>
<input id="fileUpload" type="file" accept=".csv" ></input>
<div class="container">
<div class="row">
<div class="col-sm-4">
<textarea ng-model="memberData" rows="20" cols="120"></textarea>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<button ng-click="sendCSV()" type="submit" class="btn btn-success" id="sendMembers">Lähetä</button>
</div>
</div>
</div>
+15
View File
@@ -146,3 +146,18 @@ app.controller("applController", function($scope, $http, $route, $routeParams, $
app.controller("editController",editor("/list"));
app.controller("appleditController", editor("/applications"));
app.controller("addManyController", function($scope, $http, $location) {
$scope.memberData = '';
$scope.sendCSV = function($scope.memberData){
$http.post("/members/api/csvimport").then(
function(response) {
notySuccess("Lähetys onnistui");
$location.path("/addmany");
},
function(response) {
notyError("Lähetys epäonnistui");
}
);
};
});