Browse Source

started user zone, post new event started, needs more implementation

master
arnaucode 7 years ago
parent
commit
c41f5e016d
7 changed files with 127 additions and 1 deletions
  1. +2
    -0
      www/index.html
  2. +21
    -1
      www/js/app.js
  3. +21
    -0
      www/js/newEvent.js
  4. +8
    -0
      www/js/userZone.js
  5. +3
    -0
      www/templates/menu.html
  6. +36
    -0
      www/templates/newEvent.html
  7. +36
    -0
      www/templates/userZone.html

+ 2
- 0
www/index.html

@ -54,6 +54,8 @@
<script src="js/users.js"></script>
<script src="js/user.js"></script>
<script src="js/login.js"></script>
<script src="js/userZone.js"></script>
<script src="js/newEvent.js"></script>
</head>

+ 21
- 1
www/js/app.js

@ -16,7 +16,9 @@ angular.module('app', [
'app.byCategories',
'app.users',
'app.user',
'app.login'
'app.login',
'app.userZone',
'app.newEvent'
])
.run(function($ionicPlatform) {
@ -126,6 +128,24 @@ angular.module('app', [
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

+ 21
- 0
www/js/newEvent.js

@ -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
- 0
www/js/userZone.js

@ -0,0 +1,8 @@
angular.module('app.userZone', ['pascalprecht.translate'])
.controller('UserZoneCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
});

+ 3
- 0
www/templates/menu.html

@ -45,6 +45,9 @@
<a class="item item-icon-left" menu-close href="#/app/settings">
<i class="icon ion-ios-gear"></i> Settings
</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"
ng-show="!storageuser">
<i class="icon ion-log-in"></i> Login

+ 36
- 0
www/templates/newEvent.html

@ -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
- 0
www/templates/userZone.html

@ -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>

Loading…
Cancel
Save