-
Notifications
You must be signed in to change notification settings - Fork 2
/
profile2.html
210 lines (193 loc) · 12.7 KB
/
profile2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Social Network</title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/fonts/ionicons.min.css">
<link rel="stylesheet" href="assets/css/Footer-Dark.css">
<link rel="stylesheet" href="assets/css/Highlight-Clean.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/aos/2.1.1/aos.css">
<link rel="stylesheet" href="assets/css/Login-Form-Clean.css">
<link rel="stylesheet" href="assets/css/Navigation-Clean1.css">
<link rel="stylesheet" href="assets/css/styles.css">
<link rel="stylesheet" href="assets/css/untitled.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Cookie">
<link rel="stylesheet" href="assets/css/Pretty-Header.css">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/Footer-Dark.css">
</head>
<body>
<nav class="navbar navbar-light navbar-expand-md custom-header">
<div class="container-fluid"><a class="navbar-brand" href="#">Sushi<span>Network</span> </a>
<input type="search" name="search" placeholder="Search person or post">
<button class="navbar-toggler" data-toggle="collapse" data-target="#navbar-collapse"><span class="sr-only">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav links">
<li class="nav-item" role="presentation"><a class="nav-link" href="#">Timeline</a></li>
<li class="nav-item" role="presentation"><a class="nav-link" href="#">Messages</a></li>
<li class="nav-item" role="presentation"><a class="nav-link" href="#"> Notifications</a></li>
</ul>
<ul class="nav navbar-nav ml-auto">
<li class="dropdown">
<a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#"> <img src="assets/img/avatar.jpg" class="dropdown-image"></a>
<div class="dropdown-menu dropdown-menu-right" role="menu"><a class="dropdown-item" role="presentation" href="#">Profile </a><a class="dropdown-item" role="presentation" href="#">Settings </a><a class="dropdown-item" role="presentation" href="#">Logout </a></div>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<h1>Username's Profile <i class="glyphicon glyphicon-ok-sign verified" data-toggle="tooltip" title="Verified User" style="font-size:28px;color:#da052b;"></i></h1></div>
<div>
<div class="container">
<div class="row">
<div class="col-md-3">
<ul class="list-group">
<li class="list-group-item"><span><strong>About Me</strong></span>
<p>Welcome to my profile bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla </p>
</li>
</ul>
</div>
<div class="col-md-6">
<ul class="list-group">
<li class="list-group-item">
<blockquote>
<p>@Francis Hello World</p>
<footer>Posted by howCode on 12/11/17
<button class="btn btn-default" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;"> <i class="glyphicon glyphicon-heart" data-aos="flip-right"></i><span> 5 Likes</span></button>
<button class="btn btn-default comment" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;">
<i class="glyphicon glyphicon-flash" style="color:#f9d616;"></i><span style="color:#f9d616;"> 2 Comments</span></button>
</footer>
</blockquote>
</li>
<li class="list-group-item">
<blockquote>
<p>@Francis Hello World</p>
<footer>Posted by howCode on 12/11/17
<button class="btn btn-default" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;"> <i class="glyphicon glyphicon-heart" data-aos="flip-right"></i><span> 5 Likes</span></button>
<button class="btn btn-default comment" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;">
<i class="glyphicon glyphicon-flash" style="color:#f9d616;"></i><span style="color:#f9d616;"> 2 Comments</span></button>
</footer>
</blockquote>
</li>
<li class="list-group-item">
<blockquote>
<p>@Francis Hello World</p>
<footer>Posted by howCode on 12/11/17
<button class="btn btn-default" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;"> <i class="glyphicon glyphicon-heart" data-aos="flip-right"></i><span> 5 Likes</span></button>
<button class="btn btn-default comment" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;">
<i class="glyphicon glyphicon-flash" style="color:#f9d616;"></i><span style="color:#f9d616;"> 2 Comments</span></button>
</footer>
</blockquote>
</li>
<li class="list-group-item">
<blockquote>
<p>@Francis Hello World</p>
<footer>Posted by howCode on 12/11/17
<button class="btn btn-default" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;"> <i class="glyphicon glyphicon-heart" data-aos="flip-right"></i><span> 5 Likes</span></button>
<button class="btn btn-default comment" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;">
<i class="glyphicon glyphicon-flash" style="color:#f9d616;"></i><span style="color:#f9d616;"> 2 Comments</span></button>
</footer>
</blockquote>
</li>
<li class="list-group-item">
<blockquote>
<p>@Francis Hello World</p>
<footer>Posted by howCode on 12/11/17
<button class="btn btn-default" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;"> <i class="glyphicon glyphicon-heart" data-aos="flip-right"></i><span> 5 Likes</span></button>
<button class="btn btn-default comment" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;">
<i class="glyphicon glyphicon-flash" style="color:#f9d616;"></i><span style="color:#f9d616;"> 2 Comments</span></button>
</footer>
</blockquote>
</li>
</ul>
</div>
<div class="col-md-3">
<button class="btn btn-default" type="button" style="width:100%;background-image:url("none");background-color:#da052b;color:#fff;padding:16px 32px;margin:0px 0px 6px;border:none;box-shadow:none;text-shadow:none;opacity:0.9;text-transform:uppercase;font-weight:bold;font-size:13px;letter-spacing:0.4px;line-height:1;outline:none;">NEW POST</button>
<ul class="list-group"></ul>
</div>
</div>
</div>
</div>
<div class="footer-dark">
<footer>
<div class="container">
<p class="copyright">Social Network© 2018</p>
</div>
</footer>
</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/bs-animation.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/aos/2.1.1/aos.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
type: "GET",
url: "api/profileposts",
processData: false,
contentType: "application/json",
data: '',
success: function(r) {
var posts = JSON.parse(r)
$.each(posts, function(index) {
$('.timelineposts').html(
$('.timelineposts').html() + '<blockquote><p>' + posts[index].PostBody + '</p><footer>Posted by ' + posts[index].PostedBy + ' on ' + posts[index].PostDate + '<button class="btn btn-default" data-id="' + posts[index].PostId + '" type="button" style="color:#eb3b60;background-image:url("none");background-color:transparent;"> <i class="glyphicon glyphicon-heart" data-aos="flip-right"></i><span> ' + posts[index].Likes + ' Likes</span></button><button class="btn btn-default comment" type="button" data-postid="' + posts[index].PostId + '" style="color:#eb3b60;background-image:url("none");background-color:transparent;"><i class="glyphicon glyphicon-flash" style="color:#f9d616;"></i><span style="color:#f9d616;"> Comments</span></button></footer></blockquote>'
)
$('[data-postid]').click(function() {
var buttonid = $(this).attr('data-postid');
$.ajax({
type: "GET",
url: "api/comments?postid=" + $(this).attr('data-postid'),
processData: false,
contentType: "application/json",
data: '',
success: function(r) {
var res = JSON.parse(r)
showCommentsModal(res);
},
error: function(r) {
console.log(r)
}
});
});
$('[data-id]').click(function() {
var buttonid = $(this).attr('data-id');
$.ajax({
type: "POST",
url: "api/likes?id=" + $(this).attr('data-id'),
processData: false,
contentType: "application/json",
data: '',
success: function(r) {
var res = JSON.parse(r)
$("[data-id='" + buttonid + "']").html(' <i class="glyphicon glyphicon-heart" data-aos="flip-right"></i><span> ' + res.Likes + ' Likes</span>')
},
error: function(r) {
console.log(r)
}
});
})
})
},
error: function(r) {
console.log(r)
}
});
});
function showCommentsModal(res) {
$('.modal').modal('show')
var output = "";
for (var i = 0; i < res.length; i++) {
output += res[i].Comment;
output += " ~ ";
output += res[i].CommentedBy;
output += "<hr />";
}
$('.modal-body').html(output)
}
</script>
</body>
</html>