summaryrefslogtreecommitdiff
path: root/resources/views/topicindex.blade.php
blob: 9c5b9c477714c13fae2864782f0544d7b8df31ae (plain)
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
@extends('layouts.app')

@section('styles')
@include ('layouts.footer-style')
html {
		height: 100%;
}
@endsection

@section ('content')

<div class="text-center container">

<div class="container row" style="margin-top: 20px"></div>

<div class="card">
	<div class="card-header text-left">
	<h1>
		List of all Topics
	</h1>
	</div>
	<div class="card-body">
		<h3>
		<ul class="list-inline">
		@foreach ($letters as $letter)
			<li class="list-inline-item topics-list">
				<a href="#{{$letter->name}}" class="text-white">{{$letter->name}}</a>
			</li>
		@endforeach
		</ul>
		</h3>
	</div>
</div>

<div style="margin-bottom: 20px"></div>

<div class="card">
	<div class="card-body">
	@php ($curLetter = "")
	@foreach ($topics->get() as $topic)
		@if ( "" != $topic->name )
			@php ( $firstLetter = strtoupper(substr($topic->name, 0, 1)) )
			@if ( $curLetter != $firstLetter )
				<h3 id="{{$firstLetter}}">
					<a class="text-white" href="#{{$firstLetter}}">
						{{ $firstLetter }}
					</a>
				</h3>
				<hr>
			@endif
			@php ($curLetter = $firstLetter)
			<a href="{{ route('topic', $topic->name) }}" class="btn btn-lg btn-primary mx-1 my-1">{{ ucwords($topic->name) }}</a>
		@endif
	@endforeach
	</div>
</div>

</div>
@endsection

@section ('footer')
	@include ('layouts.footer')
@endsection