mirror of
https://github.com/arnaucube/openEventsPlatformApp.git
synced 2026-02-07 03:36:44 +01:00
started user zone, post new event started, needs more implementation
This commit is contained in:
@@ -54,6 +54,8 @@
|
|||||||
<script src="js/users.js"></script>
|
<script src="js/users.js"></script>
|
||||||
<script src="js/user.js"></script>
|
<script src="js/user.js"></script>
|
||||||
<script src="js/login.js"></script>
|
<script src="js/login.js"></script>
|
||||||
|
<script src="js/userZone.js"></script>
|
||||||
|
<script src="js/newEvent.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ angular.module('app', [
|
|||||||
'app.byCategories',
|
'app.byCategories',
|
||||||
'app.users',
|
'app.users',
|
||||||
'app.user',
|
'app.user',
|
||||||
'app.login'
|
'app.login',
|
||||||
|
'app.userZone',
|
||||||
|
'app.newEvent'
|
||||||
])
|
])
|
||||||
|
|
||||||
.run(function($ionicPlatform) {
|
.run(function($ionicPlatform) {
|
||||||
@@ -126,6 +128,24 @@ angular.module('app', [
|
|||||||
controller: 'LoginCtrl'
|
controller: 'LoginCtrl'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.state('app.userZone', {
|
||||||
|
url: '/userZone',
|
||||||
|
views: {
|
||||||
|
'menuContent': {
|
||||||
|
templateUrl: 'templates/userZone.html',
|
||||||
|
controller: 'UserZoneCtrl'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('app.newEvent', {
|
||||||
|
url: '/newEvent',
|
||||||
|
views: {
|
||||||
|
'menuContent': {
|
||||||
|
templateUrl: 'templates/newEvent.html',
|
||||||
|
controller: 'NewEventCtrl'
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// if none of the above states are matched, use this as the fallback
|
// if none of the above states are matched, use this as the fallback
|
||||||
|
|||||||
21
www/js/newEvent.js
Normal file
21
www/js/newEvent.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
angular.module('app.newEvent', ['pascalprecht.translate'])
|
||||||
|
|
||||||
|
.controller('NewEventCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
|
||||||
|
|
||||||
|
$scope.event={};
|
||||||
|
$scope.event.categories=[{name: "prova"}];
|
||||||
|
$scope.postEvent = function(){
|
||||||
|
$http({
|
||||||
|
url: urlapi + 'events',
|
||||||
|
method: "POST",
|
||||||
|
data: $scope.event
|
||||||
|
})
|
||||||
|
.then(function(data) {
|
||||||
|
window.location.href="#/app/events";
|
||||||
|
},
|
||||||
|
function(response) { // optional
|
||||||
|
// failed
|
||||||
|
console.log(response);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
8
www/js/userZone.js
Normal file
8
www/js/userZone.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
angular.module('app.userZone', ['pascalprecht.translate'])
|
||||||
|
|
||||||
|
.controller('UserZoneCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
@@ -45,6 +45,9 @@
|
|||||||
<a class="item item-icon-left" menu-close href="#/app/settings">
|
<a class="item item-icon-left" menu-close href="#/app/settings">
|
||||||
<i class="icon ion-ios-gear"></i> Settings
|
<i class="icon ion-ios-gear"></i> Settings
|
||||||
</a>
|
</a>
|
||||||
|
<a class="item item-icon-left" menu-close href="#/app/userZone">
|
||||||
|
<i class="icon ion-compose"></i> User zone
|
||||||
|
</a>
|
||||||
<a class="item item-icon-left" menu-close href="#/app/login"
|
<a class="item item-icon-left" menu-close href="#/app/login"
|
||||||
ng-show="!storageuser">
|
ng-show="!storageuser">
|
||||||
<i class="icon ion-log-in"></i> Login
|
<i class="icon ion-log-in"></i> Login
|
||||||
|
|||||||
36
www/templates/newEvent.html
Normal file
36
www/templates/newEvent.html
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<ion-view view-title="New Event">
|
||||||
|
<ion-content>
|
||||||
|
<div class="list">
|
||||||
|
<label class="item item-input">
|
||||||
|
<input type="text" ng-model="event.title" placeholder="Title">
|
||||||
|
</label>
|
||||||
|
<label class="item item-input">
|
||||||
|
<textarea ng-model="event.description" placeholder="Description"></textarea>
|
||||||
|
</label>
|
||||||
|
<label class="item-input">
|
||||||
|
<span class="input-label">{{'Date' | translate}}</span>
|
||||||
|
<input ng-model="event.date" type="date" placeholder="">
|
||||||
|
</label>
|
||||||
|
<label class="item-input">
|
||||||
|
<span class="input-label">{{'Hour' | translate}}</span>
|
||||||
|
<input ng-model="event.date" type="time" placeholder="">
|
||||||
|
</label>
|
||||||
|
<!--<label class="item item-input item-select">
|
||||||
|
<div class="input-label">
|
||||||
|
Categories
|
||||||
|
</div>
|
||||||
|
<select>
|
||||||
|
<option>Xerrada</option>
|
||||||
|
<option>Esport</option>
|
||||||
|
<option>Debat</option>
|
||||||
|
<option>Taller</option>
|
||||||
|
</select>
|
||||||
|
</label>-->
|
||||||
|
<div class="item">
|
||||||
|
<div ng-click="postEvent()" class="button c_indigo400 item-note">
|
||||||
|
Post new event!
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
|
</ion-view>
|
||||||
36
www/templates/userZone.html
Normal file
36
www/templates/userZone.html
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<ion-view view-title="User zone">
|
||||||
|
<ion-content>
|
||||||
|
<div class="row o_mainOptionRow">
|
||||||
|
<a class="col c_pink400" ng-href="#/app/newEvent">
|
||||||
|
<i class="icon ion-compose"></i><!--events-->
|
||||||
|
</a>
|
||||||
|
<a class="col" ng-href="#/app/users">
|
||||||
|
<i class="icon ion-person-stalker"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="row o_mainOptionRow">
|
||||||
|
<a class="col" ng-href="#/app/savedEvents">
|
||||||
|
<i class="icon ion-heart"></i>
|
||||||
|
</a>
|
||||||
|
<a class="col" ng-href="#/app/byplace">
|
||||||
|
<i class="icon ion-ios-location"></i><!--by place-->
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="row o_mainOptionRow">
|
||||||
|
<a class="col" ng-href="#/app/search">
|
||||||
|
<i class="icon ion-search"></i>
|
||||||
|
</a>
|
||||||
|
<a class="col" ng-href="#/app/byCategories">
|
||||||
|
<i class="icon ion-pound"></i><!--by categories-->
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="row o_mainOptionRow">
|
||||||
|
<a class="col" ng-href="#/app/bydate">
|
||||||
|
<i class="icon ion-calendar"></i><!--by date-->
|
||||||
|
</a>
|
||||||
|
<a class="col" ng-href="#/app/settings">
|
||||||
|
<i class="icon ion-ios-gear"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
|
</ion-view>
|
||||||
Reference in New Issue
Block a user