-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditableData
executable file
·340 lines (296 loc) · 15.3 KB
/
editableData
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{asset('css/app.css')}}">
<title>{{config('app.name','E-Provost')}}</title>
</head>
<body>
@include('inc.navbar')
<div class="container">
@include('inc.messages')
@yield('content')
</div>
<script src="{{ asset('ckeditor/ckeditor.js') }}"></script>
<script>
CKEDITOR.replace( 'article-ckeditor' );
</script>
</body>
</html>
//navbar
<nav class="navbar navbar-expand-md navbar-dark bg-dark ">
<a class="navbar-brand" href="/">{{config('app.name','E-Provost')}}</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<ul class="nav navbar-nav navbar-right">
<li class="nav-item"><a class="nav-link" href="/posts/create">Create Post</a></li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-secondary my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
<form method="POST" action="{{ route('comments.storeWithId',['post_id' => $post->id])}}">
<div class="form-group">
@csrf
<textarea class="form-control" name="commentsBody" cols="30" rows="2" placeholder="Write something..."></textarea>
<button type="submit" class="btn btn-default">Submit</button>
</div>
</form>
<div class="card-block">
<h5 class="card-title"> <a href ="/posts/{{$notification->data['post_id']}}">{{$notification->data['commentator_id'] }} has commented on post:{{$notification->data['post_id'] }}</a></h5>
<small>{{$notification->created_at->diffForHumans()}}</small>
</div>
<a class="dropdown-item" href="/">Notify</a>
<a class="dropdown-item" href="#">
@foreach(Auth::user()->notifications as $notification)
<div class="card bg-light mb-3">
<div class="card-header">
<h5 class="card-title"><a href ="/posts/{{$notification->data['post_id']}}">{{$notification->data['commentator_id'] }} has commented on post:{{$notification->data['post_id'] }}</a></h5>
<h6 class="card-subtitle mb-2 text-muted">{{$notification->created_at->diffForHumans()}}</h6>
</div>
</div>
@endforeach
</a>
@if(count($services) > 0)
<ul class="list-group">
@foreach($services as $service)
<li class="list-group-item">{{$service}}</li>
@endforeach
</ul>
@endif
<!-- Edit Button -->
<a href = "/posts/{{$post->id}}/edit" class ="btn btn-primary btn-sm" style = "margin-left:420px;">Edit</a>
<!-- Delete Button -->
<button type="submit" class="btn btn-danger float-right btn-sm">Delete</button>
@if(AUTH::guest())
<p><a class="btn btn-primary btn-lg" href="/login" role="button">Login</a><a class="btn btn-success btn-lg" href="/register" role="button">Register</a></p>
@endif
<div class="jumbotron text-center">
<h1>{{$title}}</h1>
<p>This is a website of Submitting Problem regarding Hall</p>
</div>
//comment
<!-- Edit Button -->
<a href = "/comments/{{$comment->id}}/edit" class ="btn btn-primary">Edit</a>
<!-- Delete Button -->
<button type="submit" class="btn btn-danger float">Delete</button>
<!-- navbar -->
<div class="navbar-wrapper">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container"><link href="css/LandingAdded/style.css" rel="stylesheet">
<!-- Responsive navbar -->
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
</a>
<h1 class="brand"><a href="index.html">Maxim</a></h1>
<!-- navigation -->
<nav class="pull-right nav-collapse collapse">
<ul id="menu-main" class="nav">
<li><a title="team" href="#about">About</a></li>
<li><a title="services" href="#services">Services</a></li>
<li><a title="works" href="#works">Works</a></li>
<li><a title="blog" href="#blog">Blog</a></li>
<li><a title="contact" href="#contact">Contact</a></li>
<li><a href="page.html">Page</a></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<!--endofNavbar-->
//Previous navbar
<nav class="navbar navbar-expand-md navbar-dark bg-dark shadow-sm">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left Side Of Navbar
<ul class="navbar-nav mr-auto">
</ul>-->
<!-- Own code Navbar -->
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="/about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/services">Notices</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/posts">Newsfeed</a>
</li>
<!--<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
<div class="dropdown-menu" aria-labelledby="dropdown01">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>-->
</ul>
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
@guest
<li class="nav-item">
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
</li>
@if (Route::has('register'))
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
</li>
@endif
@else
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
<i class="fa fa-bell"></i><span class=""></span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/">Notifications</a>
@if(Auth::user()->user_type == 1)
@foreach(Auth::user()->notifications as $notification)
<a class="dropdown-item" href="/posts/{{$notification->data['post_id']}}" onMouseOver="this.style.color='#0F0'" onMouseOut="this.style.color='#000'"><h5>{{$notification->data['commentator_name'] }} has created a post</h5>
<small>{{$notification->created_at->diffForHumans()}}</small>
</a>
@endforeach
@else
@foreach(Auth::user()->notifications as $notification)
<a class="dropdown-item" href="/posts/{{$notification->data['post_id']}}" onMouseOver="this.style.color='#0F0'" onMouseOut="this.style.color='#000'"><h5>{{$notification->data['commentator_name'] }} has commented on your post</h5>
<small>{{$notification->created_at->diffForHumans()}}</small>
</a>
@endforeach
@endif
</a>
</div>
</li>
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
{{ Auth::user()->name }} <span class="caret"></span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/profile">Profile</a>
<a class="dropdown-item" href="/dashboard">Dashboard</a>
<a class="dropdown-item" href="/posts/create">Create Post</a>
<a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
{{ __('Logout') }}
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</div>
</li>
@endguest
</ul>
</div>
</div>
</nav>
/////
////Posts index
@if(count($posts) > 0)
@foreach($posts as $post)
<div class="card card-inverse" style="background-color: #89ABE3FF; border-color: #89ABE5FF;">
<div class="card-block">
<div class ="row">
<div class="col-md-3 col-sm-3">
<img style ="width:100%" src="/storage/cover_image/{{$post->cover_image}}">
</div>
<div class="col-md-9 col-sm-9">
<h3 class="card-title"><a href = "/posts/{{$post->id}}">{{$post->title}}</a></h3>
<small>Written on {{$post->created_at}} By {{$post->user->name}}</small>
</div>
</div>
</div>
</div>
<br>
@endforeach
{{$posts->links()}}
@else
<p>No posts found</p>
@endif
///endofPost index
//post onMouseOver
<div class="card" style="width: 18rem; margin:auto;">
<img class="card-img-top" src="/storage/cover_image/{{$post->cover_image}}" alt="Card image cap">
<div class="card-body">
<h5 class="card-title"><img src="https://mdbootstrap.com/img/Photos/Avatars/avatar-8.jpg" class="rounded-circle mr-3" height="50px" width="50px" alt="avatar"> {{$post->user->name}}</h5>
<p class="card-text"><h3 class="card-title"><a href = "/posts/{{$post->id}}">{{$post->title}}</a></h3>
<small>Written on {{$post->created_at}} By {{$post->user->name}}</small></p>
<a href="/posts/{{$post->id}}" class="btn btn-primary">Detailes</a>
</div>
</div>
///
<div class="row">
<!-- my php code which uses x-path to get results from xml query. -->
<?php foreach ( $notices as $notice) : ?>
<div class="col-sm-4 ">
<div class="card-columns-fluid" style = "width: 22rem; height:22rem;" >
<div class="card bg-light d-flex flex-column" >
<div class="view overlay" style = "width: 22rem; height:18rem;">
<img class="card-img-top img-fluid" src="/storage/notice_image/{{$notice->notice_image}}" alt="Card image cap">
</div>
<div class="card-body">
<div class="collapse-content">
<h5 class="card-title"><b>{{$notice->title}}</b></h5>
<!-- Subtitle -->
<p class="card-text"><i class="fa fa-clock-o"></i>{{$notice->created_at->diffForHumans()}}</p>
<br><br>
<a href="#" class="btn btn-secondary">Full Details</a>
</div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
//post.index.card
<div class="row justify-content-center">
@foreach($posts as $post)
<div class="col-sm-4 ">
<div class="card-columns-fluid">
<div class="card" style="width: 18rem; margin:auto; margin-top:50px; min-height:28rem; max-height:28rem;">
<div class="card-body d-flex flex-row">
<a href="/profile/{{$post->user->id}}"><img src="/storage/profile_image/{{$post->user->profile->profile_image}}" class="rounded-circle mr-3" height="50px" width="50px" alt="avatar"></a>
<div>
<!-- Title -->
<h5 class="card-title font-weight-bold mb-2">{{$post->user->name}}</h5>
<!-- Subtitle -->
<p class="card-text"><i class="fa fa-clock-o"></i>{{$post->created_at->diffForHumans()}}</p>
</div>
</div>
<!-- Card image -->
<div class="view overlay">
<img class="card-img-top rounded-0" src="/storage/cover_image/{{$post->cover_image}}" alt="Card image cap">
<a href="#!">
<div class="mask rgba-white-slight"></div>
</a>
</div>
<div class="card-body ">
<div class="collapse-content">
<h5 style="text-align:center"><b>{{$post->title}}</b></h5>
<!-- Text -->
<p class="card-text collapse" >{!!str_limit($post->body,71,'...')!!}</p>
<a href="/posts/{{$post->id}}" class="btn btn-primary">Detailes</a>
</div>
</div>
</div>
</div>
<br>
</div>
@endforeach
</div>