} .unread-topics.unread { background-color: #A1D490; } table { width: 100%; } @stop @section('dashboard-content') <?php $user = Auth::user(); $topics = ForumTopicReminder::where('user_id', $user->id)->get(); ?> <div class="row left"> <div class="small-12 columns"> <h2>To-do List</h2> <p> You have {{$topics->count()}} topic{{$topics->count() == 1 ? '' : 's'}} on your to-do list. </p> <table> <thead> <tr> <td></td> <td>Thread</td> <td>Last Post</td> <td>Last Updated</td> </tr>
<?php $unread = Auth::user()->unreadMail()->count(); ?> @if($unread > 0) <label class="label round radius success">{{$unread}}</label> @endif <i class="icon-mail"></i> <label class="hide-for-small">Mail</label> </a> <a class="item" data-bind="css: { 'active': $root.activeTab() == 'characters' }" href="/dashboard/characters"> <i class="icon-users"></i> <label class="hide-for-small">Characters</label> </a> <a class="item" data-bind="css: { 'active': $root.activeTab() == 'todo' }" href="/dashboard/todo"> <?php $todo = ForumTopicReminder::where('user_id', Auth::user()->id)->count(); ?> @if($todo > 0) <label class="label round radius warning">{{$todo}}</label> @endif <i class="icon-list"></i> <label class="hide-for-small">To-do List</label> </a> @if(Auth::user()->isStoryteller()) <a class="item" data-bind="css: { 'active': $root.activeTab() == 'storyteller' }" href="/dashboard/storyteller"> <i class="icon-tools"></i> <label class="hide-for-small">Storyteller<br>Tools</label> </a> @endif <a class="item" data-bind="css: { 'active': $root.activeTab() == 'settings' }" href="/dashboard/settings"> <i class="icon-cog"></i>
function toggleReminder(ForumTopic $topic) { $user = Auth::user(); if ($user) { if ($user->canAccessTopic($topic->id)) { if (ForumTopicReminder::where(['user_id' => $user->id, 'topic_id' => $topic->id])->exists()) { ForumTopicReminder::where(['user_id' => $user->id, 'topic_id' => $topic->id])->delete(); } else { $reminder = new ForumTopicReminder(); $reminder->user_id = $user->id; $reminder->topic_id = $topic->id; $reminder->save(); } return Redirect::to("/forums/topic/{$topic->id}"); } else { return Response::json(["success" => false, "message" => "Access denied."]); } } else { return Response::json(["success" => false, "message" => "Not logged in."]); } }