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

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

@section ('content')

<div class="text-center container">

<div class="container row text-white text-lg">
	<ul class="list-inline">
	@foreach ($letters as $letter)
		<li class="list-inline-item">
		<a href="#{{$letter->name}}" class="text-white">{{$letter->name}}</a>
		</li>
	@endforeach
	</ul>
</div>

@php ($curLetter = "")
@foreach ($topics->get() as $topic)
	@if ( "" != $topic->name )
		@php ( $firstLetter = strtoupper(substr($topic->name, 0, 1)) )
		@if ( $curLetter != $firstLetter )
			<div class="container row">
				<h2 id="{{$firstLetter}}">
					<a class="text-white" href="#{{$firstLetter}}">
					{{ $firstLetter }}
					</a>
				</h2>
			</div>
			<hr>

			@php ($curLetter = $firstLetter)

		@endif
		<a href="{{ route('topic', $topic->name) }}" class="btn btn-lg btn-outline-primary">{{ ucwords($topic->name) }}</a>
	@endif
@endforeach

</div>
@endsection

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