Browse Source

filter

master
sipp11 10 years ago
parent
commit
8e36e70bc2
  1. 18
      index.html
  2. 37
      js/app.js

18
index.html

@ -41,7 +41,6 @@
<div class="row"> <div class="row">
<div class="col-lg-8 col-lg-offset-2"> <div class="col-lg-8 col-lg-offset-2">
<h1 class="text-center">Movies <small><a href="//showtimes.everyday.in.th">#ShowtimesTH</a></small></h1> <h1 class="text-center">Movies <small><a href="//showtimes.everyday.in.th">#ShowtimesTH</a></small></h1>
{{#if controller.loginState }} You are in {{ else }} {{#link-to 'login'}}login{{/link-to}}{{/if}}
<ul class="nav nav-pills nav-justified"> <ul class="nav nav-pills nav-justified">
{{#link-to 'movies.nowshowing'}}<li role="presentation"> {{#link-to 'movies.nowshowing'}}<li role="presentation">
Now Showing</li>{{/link-to}} Now Showing</li>{{/link-to}}
@ -68,18 +67,6 @@
</div> </div>
</script> </script>
<script type="text/x-handlebars" data-template-name="login">
<form class="form-inline" {{action login on="submit"}}>
<h2>Log in</h2>
{{#if errorMessage}}
<div class="alert alert-error">{{errorMessage}}</div>
{{/if}}
{{input value=username type="text" placeholder="Username"}}
{{input value=password type="password" placeholder="Password"}}
{{input value=csrfToken type="text" placeholder="token"}}
{{input class="btn" type="submit" value="Login"}}
</form>
</script>
<script type="text/x-handlebars" data-template-name="movies/index"> <script type="text/x-handlebars" data-template-name="movies/index">
<ul id="container" class="col-lg-12"> <ul id="container" class="col-lg-12">
@ -88,11 +75,6 @@
</script> </script>
<script type="text/x-handlebars" data-template-name="movies/nowshowing"> <script type="text/x-handlebars" data-template-name="movies/nowshowing">
{{input type="text" class="new-movie" placeholder="New Movie" value=newName}}
<button class="btn btn-primary btn-sm new-movie-button" {{action "createMovie"}}
{{bind-attr disabled=disabled}}>Add</button>
<ul id="container" class="col-lg-12"> <ul id="container" class="col-lg-12">
{{#each model}} {{#each model}}
<li class="thumbnail"> <li class="thumbnail">

37
js/app.js

@ -45,35 +45,6 @@ App.Router.map(function() {
this.route('comingsoon'); this.route('comingsoon');
this.route('older'); this.route('older');
}); });
/* this.resource('nowshowing', { path: 'm/nowshowing' });
this.resource('comingsoon', { path: 'm/comingsoon' });
this.resource('older', { path: 'm/older' });*/
this.resource('login');
});
App.LoginRoute = Ember.Route.extend({
renderTemplate: function() {
console.log("rendering!!");
this.render('login', { controller: 'login' });
}
});
// Controllers
App.LoginController = Ember.Controller.extend({
login: function() {
var self = this, data = this.getProperties('username', 'password');
self.set('errorMessage', null);
Ember.$.post(restUrl+'/login/', data).then(function(response) {
self.set('errorMessage', response.message);
if (response.success) {
self.set('token', request.token);
console.log(request);
}
});
}
}); });
@ -195,11 +166,11 @@ App.MoviesComingsoonView = Ember.View.extend({
transitionDuration: '0.7s', transitionDuration: '0.7s',
isResizeBound: true isResizeBound: true
}); });
/*echo.init({ echo.init({
offset: 100, offset: 100,
throttle: 250, throttle: 250,
unload: false unload: false
});*/ });
}); });
} }
}); });
@ -243,11 +214,11 @@ App.MoviesOlderView = Ember.View.extend({
transitionDuration: '0.7s', transitionDuration: '0.7s',
isResizeBound: true isResizeBound: true
}); });
/*echo.init({ echo.init({
offset: 100, offset: 100,
throttle: 250, throttle: 250,
unload: false unload: false
});*/ });
}); });
} }
}); });

Loading…
Cancel
Save