From 2835d727791b462182885a5a4522d9aed7e38a8f Mon Sep 17 00:00:00 2001 From: arnaucode Date: Sat, 3 Feb 2018 03:50:14 +0100 Subject: [PATCH] added post page, and added write page, with text editor --- README.md | 5 ++ webapp/app.js | 9 +-- webapp/css/own.css | 18 +++-- webapp/fake_data.js | 72 +++++++++++++++++++ webapp/index.html | 12 +++- webapp/package.json | 3 +- webapp/views/main/main.html | 26 +++++++ webapp/views/main/main.js | 5 +- webapp/views/navbar.html | 15 ++-- webapp/views/post/post.html | 52 ++++++++++++++ webapp/views/post/post.js | 25 +++++++ .../views/templates/post-thumb-template.html | 22 ++++++ webapp/views/user/user.html | 33 ++------- webapp/views/user/user.js | 38 +--------- webapp/views/write/write.html | 55 ++++++++++++++ webapp/views/write/write.js | 42 +++++++++++ 16 files changed, 353 insertions(+), 79 deletions(-) create mode 100644 webapp/fake_data.js create mode 100644 webapp/views/post/post.html create mode 100644 webapp/views/post/post.js create mode 100644 webapp/views/templates/post-thumb-template.html create mode 100644 webapp/views/write/write.html create mode 100644 webapp/views/write/write.js diff --git a/README.md b/README.md index fe80d31..583cb2e 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,8 @@ in order to allow access to IPFS from the app. ``` ipfs daemon ``` + + +## Third party tools + +- For the WYSIWYG editor, is used the medium-editor clone: https://github.com/yabwe/medium-editor diff --git a/webapp/app.js b/webapp/app.js index b52cf35..223b490 100644 --- a/webapp/app.js +++ b/webapp/app.js @@ -12,17 +12,18 @@ angular.module('app', [ 'app.login', 'app.main', 'app.newmodel', - 'app.user' + 'app.user', + 'app.post', + 'app.write' ]). config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) { $locationProvider.hashPrefix('!'); /*$routeProvider.otherwise({ redirectTo: '/main' });*/ - +console.log("window", window.location.hash); if((localStorage.getItem('dblog_user'))) { - console.log(window.location.hash); if((window.location.hash==='#!/login')||(window.location.hash==='#!/signup')) { window.location='#!/main'; @@ -30,7 +31,7 @@ config(['$locationProvider', '$routeProvider', function($locationProvider, $rout $routeProvider.otherwise({redirectTo: '/main'}); }else{ - if((window.location!=='#!/login')||(window.location!=='#!/signup')||(window.location!=='#!/main')) + if((window.location.hash!=='#!/login')||(window.location.hash!=='#!/signup')||(window.location.hash!=='#!/main')||(window.location.hash!=='#!/user')) { console.log('app, user no logged'); diff --git a/webapp/css/own.css b/webapp/css/own.css index 614ac60..587b0d3 100644 --- a/webapp/css/own.css +++ b/webapp/css/own.css @@ -7,7 +7,10 @@ body { background: #f5f8fa; } - +a, a:hover { + text-decoration: none; + color: #000000; +} .o_userProfileBackground { min-height: 30% !important; width: 100%; @@ -29,12 +32,17 @@ body { } .o_userImgCircular { - margin-top: -100px; - margin-left: 25%; + width: 60px; background: #ffffff; - width: 50%; - border: 4px #ffffff solid; border-radius: 150px; -webkit-border-radius: 150px; -moz-border-radius: 150px; } + +.o_profilePageImage { + border: 4px #ffffff solid; + margin-top: -100px; + margin-left: 25%; + width: 50%; + width: 50%; +} diff --git a/webapp/fake_data.js b/webapp/fake_data.js new file mode 100644 index 0000000..b1ad494 --- /dev/null +++ b/webapp/fake_data.js @@ -0,0 +1,72 @@ +var user = { + username: "mark_zuckerberg", + name: "Mark", + lastname: "Zuckerberg", + description: "Hi all, I'm here to write decentralized blog posts.", + twitter: "arnaucode", + github: "arnaucode", + posts: [{ + title: "This is the second post", + subtitle: "this is the subtitle of the second post", + img: "https://cdn-images-1.medium.com/fit/t/800/240/1*4_E6m7J0112DBi1Lmdniiw.png", + content: "Some quick example text to build on the card title and make up the bulk of the card's content." + }, + { + title: "This is the first post", + subtitle: "this is the subtitle of the first post", + img: "https://bootstrap-themes.github.io/application/assets/img/unsplash_1.jpg", + content: "Some quick example text to build on the card title and make up the bulk of the card's content." + }, + { + title: "Thinking about python development", + subtitle: "this is the subtitle of the second post", + img: "https://cdn.static-economist.com/sites/default/files/images/2015/09/blogs/economist-explains/code2.png", + content: "Some quick example text to build on the card title and make up the bulk of the card's content." + }, + { + title: "Thinking about G", + subtitle: "this is the subtitle of the first post", + img: "https://cdn-images-1.medium.com/max/1600/1*RNkyx-Zq7w61eR74nMYgnA.jpeg", + content: "Some quick example text to build on the card title and make up the bulk of the card's content." + } + ] +}; +var featured_posts = [{ + title: "Thinking about python development", + subtitle: "this is the subtitle of the second post", + img: "https://cdn.static-economist.com/sites/default/files/images/2015/09/blogs/economist-explains/code2.png", + content: "Some quick example text to build on the card title and make up the bulk of the card's content." + }, + { + title: "Thinking about G", + subtitle: "this is the subtitle of the first post", + img: "https://cdn-images-1.medium.com/max/1600/1*RNkyx-Zq7w61eR74nMYgnA.jpeg", + content: "Some quick example text to build on the card title and make up the bulk of the card's content." + } +]; + +var posts = [{ + title: "This is the second post", + subtitle: "this is the subtitle of the second post", + img: "https://cdn-images-1.medium.com/fit/t/800/240/1*4_E6m7J0112DBi1Lmdniiw.png", + content: "Some quick example text to build on the card title and make up the bulk of the card's content." + }, + { + title: "This is the first post", + subtitle: "this is the subtitle of the first post", + img: "https://bootstrap-themes.github.io/application/assets/img/unsplash_1.jpg", + content: "Some quick example text to build on the card title and make up the bulk of the card's content." + }, + { + title: "Thinking about python development", + subtitle: "this is the subtitle of the second post", + img: "https://cdn.static-economist.com/sites/default/files/images/2015/09/blogs/economist-explains/code2.png", + content: "Some quick example text to build on the card title and make up the bulk of the card's content." + }, + { + title: "Thinking about G", + subtitle: "this is the subtitle of the first post", + img: "https://cdn-images-1.medium.com/max/1600/1*RNkyx-Zq7w61eR74nMYgnA.jpeg", + content: "Some quick example text to build on the card title and make up the bulk of the card's content." + } +]; diff --git a/webapp/index.html b/webapp/index.html index 51be385..e50ea14 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -20,6 +20,7 @@ + @@ -42,8 +43,8 @@ Works for both browser and electron with the same code --> - + @@ -54,7 +55,13 @@ Works for both browser and electron with the same code --> + + + + + + @@ -62,6 +69,9 @@ Works for both browser and electron with the same code --> + + +