mirror of
https://github.com/arnaucube/decentralized-blogging-platform.git
synced 2026-02-07 03:16:41 +01:00
added post page, and added write page, with text editor
This commit is contained in:
55
webapp/views/write/write.html
Normal file
55
webapp/views/write/write.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="card">
|
||||
<div class="o_userProfileBackground">
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<img class="o_userImgCircular o_profilePageImage" ng-src="https://www.eyerys.com/sites/default/files/mark_zuckerberg.jpg" />
|
||||
<h4>
|
||||
{{user.name}} {{user.lastname}}
|
||||
</h4>
|
||||
<h6 class="card-subtitle mb-2 text-muted">@{{user.username}}</h6>
|
||||
<p>{{user.description}}</p>
|
||||
<p>
|
||||
<a ng-href="#!/userLikes/{{user._id}}">
|
||||
14 followers
|
||||
</a> |
|
||||
<a ng-href="#!/userLikes/{{user._id}}">
|
||||
20 following
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<b>About</b>
|
||||
<p>
|
||||
Twitter <a ng-href="https://twitter.com/{{user.twitter}}" target="_blank">{{user.twitter}}</a>
|
||||
</p>
|
||||
<p>
|
||||
Github <a ng-href="https://github.com/{{user.github}}" target="_blank">{{user.github}}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Title of the article..." style="font-weight:bold;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<div ng-click="save()" class="btn btn-raised btn-block c_o_blue300 pull-right">Publicate</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="editable" style="min-height: 500px; padding: 10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
42
webapp/views/write/write.js
Normal file
42
webapp/views/write/write.js
Normal file
@@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('app.write', ['ngRoute'])
|
||||
|
||||
.config(['$routeProvider', function($routeProvider) {
|
||||
$routeProvider.when('/write', {
|
||||
templateUrl: 'views/write/write.html',
|
||||
controller: 'WriteCtrl'
|
||||
});
|
||||
}])
|
||||
|
||||
.controller('WriteCtrl', function($scope, $rootScope, $http) {
|
||||
$scope.content = "";
|
||||
var editor = new MediumEditor('.editable', {
|
||||
toolbar: {
|
||||
/* These are the default options for the toolbar,
|
||||
if nothing is passed this is what is used */
|
||||
allowMultiParagraphSelection: true,
|
||||
buttons: ['bold', 'italic', 'underline', 'anchor', 'h2', 'h3', 'quote'],
|
||||
diffLeft: 0,
|
||||
diffTop: -10,
|
||||
firstButtonClass: 'medium-editor-button-first',
|
||||
lastButtonClass: 'medium-editor-button-last',
|
||||
relativeContainer: null,
|
||||
standardizeSelectionStart: false,
|
||||
static: false,
|
||||
/* options which only apply when static is true */
|
||||
align: 'center',
|
||||
sticky: false,
|
||||
updateOnEmptySelection: false
|
||||
},
|
||||
autoLink: true,
|
||||
placeholder: {
|
||||
text: 'Start to writting your decentralized blog post...'
|
||||
}
|
||||
}).subscribe('editableInput', function (event, editable) {
|
||||
// Do some work
|
||||
$scope.content = editable.innerHTML;
|
||||
console.log($scope.content);
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user