Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Nick Mealey
@nickmealey
I'm upstairs
Kate Fleming
@KateFleming
Okay, just opened gitter I'm downstairs, Ill head up there
Nick Mealey
@nickmealey
Is the front end implemented yet? I'd like to get going on implemented the UI.
Joe Teo
@joekteo
tried really hard to try to implement the get api, but its just not working, gonna keep trying...
Joe Teo
@joekteo
gonna try again tmr; if it doesnt work we'll need to make the api with only a small sample of the bible
Joe Teo
@joekteo
simon, im gonna pass on that part to will. i'll be finishing up the jwt and adding the comments with you. try to get there asap
Nick Mealey
@nickmealey
Are there any views we can be working on?
Kate Fleming
@KateFleming
Im downstairs btw, it's like 10 degrees warmer
Nick Mealey
@nickmealey
Ok, I'll head down there
Joe Teo
@joekteo
you coming in soon simon?
William Huang
@thewillhuang
Kate Fleming
@KateFleming
hey guys, still cant get the server up I have no idea why. Is there any workaround to this?
Simon Kim
@simon-kim
are you guys still up by any chance?
Nick Mealey
@nickmealey
Yeah
Simon Kim
@simon-kim
we're actually working with another guy for the angular side because it keeps crashing for some reason
that means its really hard for you guys to work with anything..
and we're presenting at 10 :/
is there anything you can do right now?
like cleaning up the divs that have random information and stuff
or helping add a form for the login button using angluar?
Nick Mealey
@nickmealey
Ok, keep me updated. I'll be able to work on any views in the morning. I'll be pretty early.
There's not really much to be done, and creating a form is pretty easy. Just make the raw bits now and I can style them tomorrow morning.
Simon Kim
@simon-kim
we're trying to get the raw bits out right now but shit keeps breaking everytime we introduce something new
which is why we brought in another guy
Nick Mealey
@nickmealey
What's breaking?
Everything? :)
William Huang
@thewillhuang
lmao
fk angular?
Simon Kim
@simon-kim
it SHOULDNT be breaking but it is
is there a reason why the login/profile/search
is at the footer
Nick Mealey
@nickmealey
I just threw it in there as a link, their just placeholders
they're*
Simon Kim
@simon-kim
okay just wondering!
Nick Mealey
@nickmealey
We can put whatever link you guys want in either the header or footer, you'll notice that it becomes a mobile menu small.
I'd be happy to pitch in, if you have a view, send my way and I'll make it look good.
Like I said, I'll be up early tomorrow, so hopefully things will pan out
by then*
Simon Kim
@simon-kim
uhh for now just change up the main page's view i guess?
like it'd be nice if clicking "ripple" could redirect back to a homepage
and the placeholders could have actual information or images or something?
like if one of those divs is for the comments
write comments so we can have a better "idea"?
i dunno
Joe Teo
@joekteo
require('./controllers/bibleCtrl')(bibleApp);
// require('./controllers/userCtrl')(bibleApp);

// bibleApp.config(['$routeProvider', function($routeProvider) {
//   $routeProvider
//   .when('/', {
//     templateUrl: 'assets/templates/home.html',
//     controller: 'bibleCtrl'
//   })
//   .when('/login', {
//     templateUrl: 'assets/templates/login.html',
//     controller: 'userCtrl'
//   });
// //   .otherwise({
// //     redirectTo: '/'
// //   });
// }]);
Joe Teo
@joekteo
<div data-ng-controller="userCtrl">
  <section id='buttons'data-ng-hide='signUp || signIn'>
    <button id='signin' data-ng-click='signIn = true'>Log In</button>
    <p>Or <a id='signup' href data-ng-click='signUp = true'>Sign Up</a></p>
  </section>
  <section id='signUp' class='form' data-ng-show='signUp'>
    <i>{{errors}}</i><br>
    <form>
      <label>Username: </label><br>
      <label>Email: </label><br>
      <input type='text' data-ng-model='newUser.email'><br>
      <label>Password: </label><br>
      <input type='password' data-ng-model='newUser.password'><br>
      <label>Password Confirmation: </label><br>
      <input type='password' data-ng-model='newUser.passwordConfirmation'><br>
      <button id='submit' class='submit' data-ng-click='signUp()'>Sign Up</button>
    </form>
    <a id='signin' href data-ng-click='signIn = true; signUp = false; errors = null;'>Log In</a>
  </section>
  <section id='signIn' class='form' data-ng-show='signIn'>
    <i>{{errors}}</i><br>
    <form>
      <label>Email:</label><br>
      <input type='text' data-ng-model='user.email'><br>
      <label>Password:</label><br>
      <input type='password' data-ng-model='user.password'><br>
      <button id='login' class='submit' data-ng-click='logIn()'>Log In</button>
    </form>
    <a id='signin' href data-ng-click='signUp = true; signIn = false; errors = null;'>Sign Up</a>
  </section>
</div>
'use strict';

module.exports = function(app) {
  app.controller('userCtrl', ['$scope', '$http', '$base64', '$cookies', '$location', function($scope, $http, $base64, $cookies, $location) {
    $scope.signUp = false;
    $scope.signIn = false;
    if ($cookies.jwt) {
      console.log('redirecting');
      $location.path('/');
    }

    $scope.logIn = function() {
      $scope.errors = null;
      $http.defaults.headers.common.Authorization = 'Basic ' + $base64.encode($scope.user.email + ':' + $scope.user.password);
      $http({
        method: 'GET',
        url: '/api/users'
      })
      .success(function(data) {
        $cookies.jwt = data.jwt;
        $location.path('/');
      })
      .error(function(data) {
        console.log('err', data);
        $scope.errors = data;
      });
    };

    $scope.signUp = function() {
      $scope.errors = null;
      if ($scope.newUser.password !== $scope.newUser.passwordConfirmation) $scope.errors = 'passwords did not match';
      if (!$scope.newUser.email) $scope.errors = 'please specify an email';
      if (!$scope.newUser.password) $scope.errors = 'invalid password';
      if ($scope.errors !== null) return;

      $http({
        method: 'POST',
        url: '/api/users',
        data: $scope.newUser
      })
      .success(function(data) {
        $cookies.jwt = data.jwt;
        $location.path('/');
      })
      .error(function(data) {
        console.log('err', data);
        $scope.errors = data;
      });
    };
  }]);
};
Simon Kim
@simon-kim
2 fucking am and I got templates/angular/modularization to work
i'll try to get to Code Fellows at like 8 or 9
Nick Mealey
@nickmealey
I'm at CodeFellows, I'll be on the middle floor.