diff --git a/blogproject/bower.json b/blogproject/bower.json
index 7ee4c03..6ae0b0a 100644
--- a/blogproject/bower.json
+++ b/blogproject/bower.json
@@ -49,6 +49,10 @@
"paper-dialog": "PolymerElements/paper-dialog#^1.0.0",
"paper-button": "PolymerElements/paper-button#^1.0.0",
"paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0",
- "paper-input": "PolymerElements/paper-input#^1.0.0"
+ "paper-input": "PolymerElements/paper-input#^1.0.0",
+ "angular-material": "~0.10.0"
+ },
+ "resolutions": {
+ "angular": "1.4.3"
}
}
diff --git a/blogproject/gulpfile.js b/blogproject/gulpfile.js
index bebd4d1..43dcd57 100644
--- a/blogproject/gulpfile.js
+++ b/blogproject/gulpfile.js
@@ -44,4 +44,4 @@ gulp.task('start-client', ['start-server'], function() {
gulp.watch(['./web/**/*.css'], browserSync.reload);
});
-gulp.task('default', ['start-client']);
\ No newline at end of file
+gulp.task('default', ['start-client']);
diff --git a/blogproject/web/core/app.js b/blogproject/web/core/app.js
index 31e6af3..951a3ff 100644
--- a/blogproject/web/core/app.js
+++ b/blogproject/web/core/app.js
@@ -4,6 +4,8 @@ angular.module( 'polymerblog', [
'polymerblog.home',
'polymerblog.login',
'polymerblog.posts',
+ 'polymerblog.services',
+ 'ngMaterial',
'angular-storage',
'angular-jwt',
'pascalprecht.translate'
@@ -72,4 +74,3 @@ angular.module( 'polymerblog', [
})
;
-
diff --git a/blogproject/web/core/services.js b/blogproject/web/core/services.js
new file mode 100644
index 0000000..dd0c328
--- /dev/null
+++ b/blogproject/web/core/services.js
@@ -0,0 +1,58 @@
+var Post = function ($resource, $http) {
+ var actions = {
+ save: {
+ // method: 'POST',
+ // transformRequest: [function(data) {
+ // var newData = _.extend({}, data);
+ // if (newData.query_id === undefined) {
+ // newData.query_id = newData.query.id;
+ // delete newData.query;
+ // }
+ //
+ // return newData;
+ // }].concat($http.defaults.transformRequest)
+ },
+
+ getAll: {
+
+ }
+
+ };
+
+ // var resource = $resource('/api/alerts/:id', {id: '@id'}, actions);
+
+ return resource;
+};
+
+AuthService = function(auth, $location, $filter, store){
+
+ var all = {
+ auth: auth,
+
+ login: function(){
+ auth.signin({}, function(profile, token) {
+ store.set('profile', profile);
+ store.set('token', token);
+ $location.path("/");
+ }, function(error) {
+ console.log($filter('translate')('login.loginFail'), error);
+ });
+
+ },
+
+ logout: function() {
+ auth.signout();
+ store.remove('profile');
+ store.remove('token');
+ $location.path('/login');
+ }
+
+ };
+
+ return all;
+};
+
+angular.module('polymerblog.services', ['auth0'])
+ // .factory('Post', ['$resource', '$timeout', '$q', '$http', Post])
+ .service('AuthService', ['auth', '$location', '$filter', 'store', AuthService])
+ ;
diff --git a/blogproject/web/elements/post-list.html b/blogproject/web/elements/post-list.html
index 2820fff..872f754 100644
--- a/blogproject/web/elements/post-list.html
+++ b/blogproject/web/elements/post-list.html
@@ -1,22 +1,23 @@
-
-
-
-
-
-
- {{item.title}}
- {{item.author}}
- {{item.post}}
-
+
+
+
+
+
+ {{item.title}}
+ {{item.author}}
+ {{item.post}}
+
+
+
-
+
+
diff --git a/blogproject/web/home/home.css b/blogproject/web/home/home.css
index aaceaa9..80dc53d 100644
--- a/blogproject/web/home/home.css
+++ b/blogproject/web/home/home.css
@@ -1,7 +1,5 @@
body{
font-family: "proxima-nova",sans-serif;
- text-align: center;
- font-size: 300%;
font-weight: 100;
}
@@ -39,7 +37,7 @@ input[type=checkbox]:focus + label:before {
outline: 0;
}
-.btn{
+/*.btn{
font-size: 140%;
text-transform: uppercase;
letter-spacing: 1px;
@@ -64,9 +62,40 @@ input[type=checkbox]:focus + label:before {
color: #666;
}
}
-
+*/
h1,h2,h3{
font-weight: 100;
+ margin: 0;
+}
+.post-card > div{
+ padding: 0 0 0 10px;
+}
+
+.post-card.card-title{
+ border-bottom: 1px dotted #ddd;
+ margin-bottom: 0.3em;
+}
+.post-card.card-title h2{
+ font-size: 2em;
+ font-weight: normal;
+}
+.post-card.card-author h3{
+ font-size: 0.8em;
+ font-weight: bold;
+ text-transform: uppercase;
+}
+.post-card.card-post{
+
+}
+.card-post.post-card p {
+ font-size: 1.7em;
+ font-weight: normal;
+}
+.sidebar{
+ padding: 150px 0 0 0;
+}
+.cover {
+ margin: 60px;
}
#logo img{
diff --git a/blogproject/web/home/home.html b/blogproject/web/home/home.html
index c00d067..df01a5e 100644
--- a/blogproject/web/home/home.html
+++ b/blogproject/web/home/home.html
@@ -1,7 +1,13 @@
-
-
-
{{'home.wellcome' | translate}} {{auth.profile.nickname}}
-
-
-
-
+
+
+
{{'home.wellcome' | translate}} {{auth.profile.nickname}}
+
+
+
+
+
+
diff --git a/blogproject/web/home/home.js b/blogproject/web/home/home.js
index 3f03db7..84ce31c 100644
--- a/blogproject/web/home/home.js
+++ b/blogproject/web/home/home.js
@@ -50,7 +50,7 @@ angular.module( 'polymerblog.home', [
store.remove('token');
$location.path('/login');
}
-
+
$scope.redirectPosts = function() {
$location.path('/posts');
}
diff --git a/blogproject/web/index.html b/blogproject/web/index.html
index 6711059..96c957b 100644
--- a/blogproject/web/index.html
+++ b/blogproject/web/index.html
@@ -1,91 +1,102 @@
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Polymer HTML5 Blog
-
-
-
-
-
-
- -
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
diff --git a/blogproject/web/login/login.css b/blogproject/web/login/login.css
index a3dcd3a..aac5966 100644
--- a/blogproject/web/login/login.css
+++ b/blogproject/web/login/login.css
@@ -1,3 +1,3 @@
-.login-page .login-box {
+/*.login-page .login-box {
padding: 100px 0;
-}
+}*/
diff --git a/blogproject/web/login/login.html b/blogproject/web/login/login.html
index 0766a3c..a70496b 100644
--- a/blogproject/web/login/login.html
+++ b/blogproject/web/login/login.html
@@ -1,7 +1,20 @@
-
+
+
+
+
+
{{'login.wellcome' | translate}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/blogproject/web/login/login.js b/blogproject/web/login/login.js
index 9a0c73b..bbb3082 100644
--- a/blogproject/web/login/login.js
+++ b/blogproject/web/login/login.js
@@ -1,34 +1,22 @@
-angular.module( 'polymerblog.login', [
- 'auth0',
- 'pascalprecht.translate'
-])
-.config(function ($translateProvider) {
- $translateProvider.translations('pt-br', {
- login: {
- loginFail: 'Houve um erro ao logar, veja o console.',
- wellcome: 'Bem vindo ao Polymer Blog, faça login para continuar.',
- makeLogin: 'Fazer Login'
- }
- });
+angular.module( 'polymerblog.login', ['pascalprecht.translate'])
+ .config(function ($translateProvider) {
+ $translateProvider.translations('pt-br', {
+ login: {
+ loginFail: 'Houve um erro ao logar, veja o console.',
+ wellcome: 'Bem vindo ao Polymer Blog, faça login para continuar.',
+ makeLogin: 'Fazer Login'
+ }
+ });
- $translateProvider.translations('en', {
- login: {
- loginFail: 'There was error on login, see the console',
- wellcome: 'Wellcome the Polymer Blog, make login to continue.',
- makeLogin: 'Make Login'
- }
- });
-})
-.controller( 'LoginCtrl', function HomeController( $scope, auth, $location, store, $filter) {
-
- $scope.login = function() {
- auth.signin({}, function(profile, token) {
- store.set('profile', profile);
- store.set('token', token);
- $location.path("/");
- }, function(error) {
- console.log($filter('translate')('login.loginFail'), error);
- });
- }
-
-});
+ $translateProvider.translations('en', {
+ login: {
+ loginFail: 'There was error on login, see the console',
+ wellcome: 'Wellcome the Polymer Blog, make login to continue.',
+ makeLogin: 'Make Login'
+ }
+ });
+ })
+ .controller( 'LoginCtrl', function HomeController( $scope, AuthService) {
+ $scope.login = AuthService.login;
+ })
+ ;
diff --git a/blogproject/web/posts/posts.html b/blogproject/web/posts/posts.html
index 2fae364..5545852 100644
--- a/blogproject/web/posts/posts.html
+++ b/blogproject/web/posts/posts.html
@@ -1,6 +1,14 @@
-
-
{{'posts.viewPosts' | translate}} {{auth.profile.nickname}}
-
-
-
+
diff --git a/blogproject/web/posts/posts.js b/blogproject/web/posts/posts.js
index cb78231..f8bfb4c 100644
--- a/blogproject/web/posts/posts.js
+++ b/blogproject/web/posts/posts.js
@@ -15,13 +15,8 @@ angular.module( 'polymerblog.posts', [
}
});
})
-.controller( 'PostsCtrl', function PostsController( $scope, auth, $http, $location, store ) {
- $scope.auth = auth;
+.controller( 'PostsCtrl', function PostsController( $scope, auth, $http, $location, store, AuthService ) {
+ $scope.auth = AuthService.auth;
- $scope.logout = function() {
- auth.signout();
- store.remove('profile');
- store.remove('token');
- $location.path('/login');
- }
+ $scope.logout = AuthService.logout;
});