Skip to content

Commit

Permalink
Merge pull request #4 from freddylimpens/master
Browse files Browse the repository at this point in the history
march progress
  • Loading branch information
freddylimpens committed Apr 28, 2014
2 parents 69d52ab + b03feb9 commit d3b47d1
Show file tree
Hide file tree
Showing 19 changed files with 667 additions and 182 deletions.
Binary file added img/login/close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/login/connected_ico.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/login/facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/login/gplus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/login/inscription.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/login/login_bt.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/login/password_bt.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
116 changes: 86 additions & 30 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,113 @@
<link href='http://fonts.googleapis.com/css?family=Raleway:400,500,600,700' rel='stylesheet' type='text/css'>
<link href='styles/css/screen.css' rel='stylesheet' type='text/css'>
<link href='scripts/vendor/angucomplete/angucomplete.css' rel='stylesheet' type='text/css'>



<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body ng-file-drop ng-file-over="ng-file-over">
<body ng-file-drop ng-file-over="ng-file-over">
<div id="wrap-page" ng-controller="LoginCtrl">
<!-- overlay when dragndropping -->
<div id="filedrop-overlay"><div class="center">&nbsp;</div></div>


<!-- left toolbar -->
<div id="toolbar" ng-controller="ToolbarCtrl">
<ul>
<li class="open"><button>Déplier</button></li>
<li class="search"><button ng-click="panel = 'search'">Rechercher</a></li>
<li class="add"><button ng-click="panel = 'upload'">Ajouter</button></li>
<li class="files"><button>Fichiers</button></li>
<li class="recent" ng-click="panel = 'recent'"><button>Récents</button></li>
<li class="fav" ng-click="panel = 'favorite'"><button>Favoris</button></li>
<!--
FIXME <li class="open"><button ng-click="$root.panel = ''">Déplier</button></li>
-->
<!--
FIXME <li class="search"><button ng-click="$root.panel = 'search'">Rechercher</a></li>
-->
<li class="add"><button ng-click="$root.panel = ($root.panel=='upload') ? '' : 'upload'">Ajouter</button></li>
<!--
FIXME <li class="files"><button>Fichiers</button></li>
-->
<!--
FIXME <li class="recent" ng-click="$root.panel = 'recent'"><button>Récents</button></li>
-->
<!--
FIXME <li class="fav" ng-click="$root.panel = 'favorite'"><button>Favoris</button></li>
-->
<li class="connected"><a ng-click="$root.panel = 'logout'"><img src="img/login/connected_ico.png" alt="" /></a></li>
</ul>

<ng-switch on="panel">
<div ng-switch-when="search">
<ng-switch on="$root.panel">
<div ng-switch-when="search">
<ng-include src="'views/sidebar-search.html'"/>
</div>
<div ng-switch-when="upload">
</div>
<div ng-switch-when="upload">
<ng-include src="'views/sidebar-upload.html'"/>
</div>
<div ng-switch-when="recents">
<ng-include src="'views/sidebar-recents.html'"/>
</div>
<div ng-switch-when="favs">
<ng-include src="'views/sidebar-favs.html'"/>
</div>
</div>
<div ng-switch-when="recents">
<ng-include src="'views/sidebar-recents.html'"/>
</div>
<div ng-switch-when="favs">
<ng-include src="'views/sidebar-favs.html'"/>
</div>
<!-- Logout panel -->
<div ng-switch-when="logout">
<div id="connected-user-block">
<strong>{{ authVars.username }}</strong>
<button ng-click="logout()">Déconnexion</button>
<span class="little-arrow">&nbsp;</span>
</div>
</div>
</ng-switch>
</div>
</div>



<!-- right placeholder -->
<div ui-view="filelist"></div>

<div ui-view="filelist"></div>

<!-- login box -->
<div id="wrap-login" class="ng-cloak" ng-show="authVars.loginrequired">
<div id="inner-login">
<div class="left">
<div class="title">Entrez votre identifiant pour vous connecter</div>
<form name="loginForm">
<p>
<label for="login-field">Email</label>
<input id="login-field" type="text" ng-model="authVars.username" placeholder="Votre nom d'utilisateur..." required>
</p>
<p>
<label for="pass-field">Password</label>
<input id="pass-field" type="password" ng-model="authVars.password" placeholder="Votre mot de passe..." required>
</p>
<button ng-click="submit()" ng-disabled="form.$invalid" class="submit">Login</button>
<a class="forgotten" href="#">Mot de passe oublié ?</a>
</form>
</div>
<div class="right">
<ul>
<li><button class="account">S'inscrire</button></li>
<li><button ng-click="authenticateGoogle()" class="gplus">Google +</button></li>
<li><button class="facebook">Facebook</button></li>
</ul>
</div>
<a href="javascript:void(0)" ng-click="authVars.loginrequired=false" class="close">Fermer</a>
<!-- TODO: changer cette méthode de fermeture de l'overlay -->
</div>
</div>
</div>
</body>

<!-- vendor includes -->

<!-- jquery and plugins -->
<!-- jquery and plugins -->
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>

<!-- Angular -->
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular-animate.min.js"></script>
<script type="text/javascript" src="//underscorejs.org/underscore-min.js"></script>


<!-- bower includes -->
<script src="scripts/vendor/angular-cookies/angular-cookies.min.js"></script>
<script type="text/javascript" src="scripts/vendor/restangular/dist/restangular.min.js"></script>
Expand All @@ -73,16 +127,18 @@
<script src="scripts/vendor/angular-file-upload/angular-file-upload.min.js"></script>
<script src="scripts/vendor/angucomplete/angucomplete.js"></script>

<!-- no auth for now
<script src="scripts/vendor/http-auth-interceptor.js"></script>
<script src="scripts/vendor/angularOauth.js"></script>
<script src="scripts/vendor/googleOauth.js"></script>
-->

<script src="scripts/config.js"></script>

<!-- auth -->
<script src="scripts/vendor/angular-http-auth/src/http-auth-interceptor.js"></script>
<script src="scripts/vendor/angular-image-upload/angular-imageupload.js"></script>
<script src="scripts/vendor/angular-oauth/src/js/angularOauth.js"></script>
<script src="scripts/vendor/angular-oauth/src/js/googleOauth.js"></script>
<script src="scripts/vendor/angular-unisson-auth/angular-unisson-auth.js"></script>

<!-- app files -->
<script src="scripts/config.js"></script>
<script src="scripts/lib/filer/services.js"></script>
<script src="scripts/lib/filer/controllers.js"></script>
<script src="scripts/lib/app.js"></script>


</html>
13 changes: 13 additions & 0 deletions oauth2callback.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en" ng-app="angularOauth" ng-controller="CallbackCtrl">
<head>
<meta charset="utf-8">
<title>Receiving authentication</title>
</head>
<body>
<p>Finishing authentication...</p>

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.min.js"></script>
<script src="scripts/vendor/angularOauth.js"></script>
</body>
</html>
8 changes: 6 additions & 2 deletions scripts/config.js.sample
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
config = {
templateBaseUrl: '/views/',
cliendId: 'AUTH_CLIENT_ID',
bucket_uri: 'http://BUCKET_SERVER_URI/bucket/upload/',
useHtml5Mode: false,
bucket_preview_uri: 'http://localhost:8000',
bucket_preview_uri: 'BUCKET_SERVER_URI',
media_uri: 'http://MEDIA_SERVER/',
rest_uri: "http://REST_API_SERVER/api/v0"
rest_uri: "http://REST_API_SERVER/api/v0",
rootUrl: 'APP_SERVER_URI',
homeStateName: 'bucket',
loginBaseUrl: 'LOGIN_API_SERVER/api/v0'
}
20 changes: 16 additions & 4 deletions scripts/src/app.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
angular.element(document).on('ready page:load', ->
angular.module('filer', ['filer.controllers', 'filer.services'])

angular.module('unisson_filer', ['filer', 'ui.router', 'ngAnimate', 'restangular', 'angularFileUpload', 'angucomplete'])

angular.module('unisson_filer', ['filer', 'ui.router', 'ngAnimate', 'restangular', 'angularFileUpload', 'angucomplete', 'angular-unisson-auth'])

.config(['TokenProvider', '$locationProvider', (TokenProvider, $locationProvider) ->
TokenProvider.extendConfig({
clientId: 'config.cliend_id', #FIXME: does not let me load this from config
redirectUri: config.rootUrl+'oauth2callback.html',
scopes: ["https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile"],
});
])

# CORS
.config(['$httpProvider', ($httpProvider) ->
$httpProvider.defaults.useXDomain = true
Expand All @@ -12,7 +21,7 @@ angular.element(document).on('ready page:load', ->
# Tastypie
.config((RestangularProvider) ->
RestangularProvider.setBaseUrl(config.rest_uri)
RestangularProvider.setDefaultHeaders({"Authorization": "ApiKey pipo:46fbf0f29a849563ebd36176e1352169fd486787"});
#RestangularProvider.setDefaultHeaders({"Authorization": "ApiKey pipo:46fbf0f29a849563ebd36176e1352169fd486787"});
# Tastypie patch
RestangularProvider.setResponseExtractor((response, operation, what, url) ->
newResponse = null;
Expand Down Expand Up @@ -48,14 +57,17 @@ angular.element(document).on('ready page:load', ->
url: '/upload'
)
.state('bucket.labellisation',
url: '/labellisation'
url: '/labellisation/:filesIds'
templateUrl: 'views/labellisation-overlay.html'
controller: 'FileLabellisationCtrl'
)
])

.run(['$rootScope', ($rootScope) ->
$rootScope.config = config;
$rootScope.loginBaseUrl = config.loginBaseUrl
$rootScope.homeStateName = config.homeStateName

])

console.debug("running angular app...")
Expand Down
Loading

0 comments on commit d3b47d1

Please sign in to comment.