Browse Source

route to show all tweets imported by the system

master
Aaron Parecki 7 years ago
parent
commit
f9b94c8ef9
No known key found for this signature in database GPG Key ID: 276C2817346D6056
5 changed files with 33 additions and 0 deletions
  1. +10
    -0
      app/Http/Controllers/ShowTweetsController.php
  2. +13
    -0
      resources/views/all-tweets.blade.php
  3. +8
    -0
      resources/views/import.blade.php
  4. +1
    -0
      resources/views/layouts/app.blade.php
  5. +1
    -0
      routes/web.php

+ 10
- 0
app/Http/Controllers/ShowTweetsController.php View File

@ -32,4 +32,14 @@ class ShowTweetsController extends Controller
]); ]);
} }
public function all() {
$tweets = Tweet::where('mission_id', 0)
->orderBy('tweet_date', 'desc')
->get();
return view('all-tweets', [
'tweets' => $tweets
]);
}
} }

+ 13
- 0
resources/views/all-tweets.blade.php View File

@ -0,0 +1,13 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3 tweet-list">
@each('components.tweet', $tweets, 'tweet')
</div>
</div>
</div>
@endsection

+ 8
- 0
resources/views/import.blade.php View File

@ -1,5 +1,13 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="container">
<div class="row">
<div class="col-xs-8 col-md-8 panel" style="padding: 8px;">
<a href="{{ route('tweets') }}" class="btn btn-default">Show Tweets</a>
<p>See all tweets from players, even ones that don't match a hashtag. Only tweets that have been imported into the system are shown.</p>
</div>
</div>
</div>
<import-tweet></import-tweet> <import-tweet></import-tweet>
@endsection @endsection

+ 1
- 0
resources/views/layouts/app.blade.php View File

@ -41,6 +41,7 @@
@endif @endif
<li><a href="{{ route('teams') }}">Teams</a></li> <li><a href="{{ route('teams') }}">Teams</a></li>
@can('admin') @can('admin')
<li><a href="{{ route('import') }}">Import Tweet</a></li>
<li><a href="{{ route('sms') }}">SMS</a></li> <li><a href="{{ route('sms') }}">SMS</a></li>
@endcan @endcan
<li><a href="{{ route('slideshow') }}">Slideshow</a></li> <li><a href="{{ route('slideshow') }}">Slideshow</a></li>

+ 1
- 0
routes/web.php View File

@ -43,6 +43,7 @@ Route::post('/twitter/stream', 'TwitterController@input');
Route::get('/mission/{mission}', 'ShowTweetsController@mission')->name('mission'); Route::get('/mission/{mission}', 'ShowTweetsController@mission')->name('mission');
Route::get('/team/{team}', 'ShowTweetsController@team')->name('team'); Route::get('/team/{team}', 'ShowTweetsController@team')->name('team');
Route::get('/tweets', 'ShowTweetsController@all')->name('tweets');
Route::get('/sms', 'SMSController@index')->name('sms'); Route::get('/sms', 'SMSController@index')->name('sms');
Route::post('/sms/save-numbers', 'SMSController@save')->name('sms-save'); Route::post('/sms/save-numbers', 'SMSController@save')->name('sms-save');

Loading…
Cancel
Save