draft of CSV import

This commit is contained in:
Davide Alberani 2015-03-29 00:46:42 +01:00
parent 9e86711e22
commit 9b43e27d8f
6 changed files with 42 additions and 5 deletions

View file

@ -1,7 +1,10 @@
<!-- show details of a single Event (editing also take place here) -->
<div class="container">
<form name="eventForm" ng-model="eventdetails" ng-submit="save()">
<alert><button type="button" class="btn btn-default" ng-click="save($event)" ng-disabled="!eventForm.$dirty">save</button></alert>
<alert class="clearfix">
<span>{{event.title}}</span>
<button type="button" class="btn btn-default pull-right" ng-click="save($event)" ng-disabled="!eventForm.$dirty">save</button>
</alert>
<div class="input-group input-group-lg">
<span class="input-group-addon">Title</span>

View file

@ -0,0 +1,18 @@
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{'Import from eventbrite CSV'}}</h3>
</div>
<div class="panel-body">
<form name="ebCSVForm" ng-model="importpersons" class="well" ng-submit="ebCSVimport()">
<div class="form-group">
<label for="eb-csv-import">{{'CSV file' | translate}}</label>
<input name="csvFile" type="file" id="eb-csv-import" ng-model="ebCSVfile" ng-required="true">
<p class="help-block">{{'CSV exported from eventbrite' | translate}}</p>
</div>
<input type="submit" value="{{'Import' | translate}}"/>
</form>
</div>
</div>
</div>

View file

@ -39,9 +39,10 @@
<body>
<div class="main-header" ng-controller="NavigationCtrl as n">
<input type="button" id="events-button" ng-click="n.go('/events')" class="btn btn-link" value="{{'Events' | translate}}" />
<input type="button" id="new-event-button" ng-click="n.go('/new-event')" class="btn btn-link" value="{{'Add Event' | translate}}" />
<input type="button" id="new-event-button" ng-click="n.go('/new-event')" class="btn btn-link" value="{{'Add event' | translate}}" />
<input type="button" id="persons-button" ng-click="n.go('/persons')" class="btn btn-link" value="{{'Persons' | translate}}" />
<input type="button" id="persons-button" ng-click="n.go('/new-person')" class="btn btn-link" value="{{'Add Person' | translate}}" />
<input type="button" id="new-person-button" ng-click="n.go('/new-person')" class="btn btn-link" value="{{'Add person' | translate}}" />
<input type="button" id="import-persons-button" ng-click="n.go('/import-persons')" class="btn btn-link" value="{{'Import persons' | translate}}" />
</div>
<!-- all the magic takes place here: the content inside the next div

View file

@ -67,6 +67,10 @@ eventManApp.config(['$routeProvider',
templateUrl: 'person-detail.html',
controller: 'PersonDetailsCtrl'
}).
when('/import-persons', {
templateUrl: 'import-persons.html',
controller: 'ImportPersonsCtrl'
}).
otherwise({
redirectTo: '/events'
});

View file

@ -90,3 +90,13 @@ eventManControllers.controller('PersonDetailsCtrl', ['$scope', 'Person', '$route
}]
);
eventManControllers.controller('ImportPersonsCtrl', ['$scope', '$log',
function ($scope, $log) {
$scope.ebCSVimport = function() {
$log.info("ImportPersonsCtrl");
$log.info($scope);
};
}]
);

View file

@ -1,9 +1,10 @@
eventManApp.config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('it_IT', {
'Events': 'Eventi',
'Add Event': 'Nuovo evento',
'Add event': 'Nuovo evento',
'Persons': 'Persone',
'Add Person': 'Nuova persona',
'Add person': 'Nuova persona',
'Import persons': 'Importa persone',
});
$translateProvider.preferredLanguage('it_IT');