Commit 764b6717 by Aan Choesni Herlingga

front view detail information

parent 478ec034
......@@ -66,6 +66,7 @@ class InformationController extends Controller
$data = $request->except('_token');
array_key_exists('info_status', $data) ? $data['info_status'] = 1 : $data['info_status'] = 0;
$data['slug'] = str_slug($request->input('title'));
$save = $this->repo->store($data);
......@@ -133,6 +134,7 @@ class InformationController extends Controller
$dataEn = $request->except(['_token', 'id']);
array_key_exists('info_status', $data) ? $data['info_status'] = 1 : $data['info_status'] = 0;
$data['slug'] = str_slug($request->input('title'));
$information = $this->repo->findId($id, ['rEn']);
$edit = $this->repo->update($data, $information);
......
<?php
namespace App\Http\Controllers\Webprofile\Front;
use App\Http\Controllers\Controller;
use App\Models\Webprofile\Categories;
use App\Models\Webprofile\Design;
use App\Models\Webprofile\Information;
use App\Models\Webprofile\Menu;
use App\Models\Webprofile\Posts;
use Session;
class InformationController extends Controller
{
public function index($title)
{
$setting = webprofilesetting();
if (!Session::has('selected_language')) {
session(['selected_language' => 'id']);
}
if (Session::get('selected_language') == 'id') {
$data = $this->getDataId($setting, $title);
return view('webprofile.front.' . $setting['theme'] . '.information', $data);
} else if (Session::get('selected_language') == 'en') {
$data = $this->getDataEn($setting, $title);
return view('webprofile.front.' . $setting['theme'] . '.en.information', $data);
}
}
public function getDataId($setting, $title)
{
$setting = webprofilesetting();
$data = Information::where('slug', $title)->first();
$resend = Posts::where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get();
$hot = Posts::where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get();
$categories = Categories::where('is_active', '1')->get();
$menu = Menu::orderby('urutan', 'asc')->get();
$widget_right = Design::where('name_design', 'widget_right')->orderBy('urutan', 'ASC')->get();
$widget_left = Design::where('name_design', 'widget_left')->orderBy('urutan', 'ASC')->get();
$viewer['viewer'] = (int) $data->viewer + 1;
$data->update($viewer);
$data = [
'setting' => $setting,
'data' => $data,
'menu' => $menu,
'widget_right' => $widget_right,
'widget_left' => $widget_left,
'resend' => $resend,
'hot' => $hot,
'categories' => $categories,
];
return $data;
}
public function getDataEn($setting, $title)
{
$setting = webprofilesetting();
$data = Information::where('slug', $title)->first();
$resend = Posts::with(['rEn'])->where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get();
$hot = Posts::with(['rEn'])->where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get();
$categories = Categories::with(['rEn'])->where('is_active', '1')->get();
$menu = Menu::with(['rEn'])->orderby('urutan', 'asc')->get();
$widget_right = Design::where('name_design', 'widget_right')->orderBy('urutan', 'ASC')->get();
$widget_left = Design::where('name_design', 'widget_left')->orderBy('urutan', 'ASC')->get();
$viewer['viewer'] = (int) $data->viewer + 1;
$data->update($viewer);
$data = [
'setting' => $setting,
'data' => $data,
'menu' => $menu,
'widget_right' => $widget_right,
'widget_left' => $widget_left,
'resend' => $resend,
'hot' => $hot,
'categories' => $categories,
];
return $data;
}
}
......@@ -125,9 +125,9 @@
<a href="{!! url('post/'.$value->slug) !!}">
@if($value->thumbnail)
@if ($setting['external_storage'] == 1)
<img src="{{ $setting['url_static'] . '/' . $setting['directory'] . '/thumbnail/' . $value->thumbnail }}" alt="" class="img-responsive" style="height: 150px; width: auto;">
<img src="{{ $setting['url_static'] . '/' . $setting['directory'] . '/thumbnail/' . $value->thumbnail }}" alt="">
@else
<img src="{{ url('/storage/thumbnail/' . $value->thumbnail) }}" alt="" class="img-responsive" style="height: 150px; width: auto;">
<img src="{{ url('/storage/thumbnail/' . $value->thumbnail) }}" alt="">
@endif
@endif{!! $value->rEn->title !!}
</a>
......
@extends('webprofile.front.jollyany.master')
@section('content')
<section class="post-wrapper-top jt-shadow clearfix">
<div class="container">
<div class="col-lg-12">
<h2>Agenda - {!! $data->title !!}</h2>
</div>
</div>
</section><!-- end post-wrapper-top -->
<section class="blog-wrapper">
<div class="container">
<div class="row">
<div id="main-content" class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
<div class="row">
<div class="blog-masonry">
<div class="col-lg-12">
<div class="blog-carousel">
<div class="blog-carousel-header">
<h1>{!! $data->rEn->title !!}</h1>
<div class="blog-carousel-meta">
<span><i class="fa fa-eye"></i> <a href="#">{!! $data->viewer !!} Views</a></span>
{{-- <span><i class="fa fa-user"></i> <a href="#">Redaksi</a></span> --}}
</div><!-- end blog-carousel-meta -->
</div><!-- end blog-carousel-header -->
<div class="blog-carousel-desc">
{!! $data->rEn->content !!}
</div>
</div>
</div>
</div>
</div>
</div>
@include('webprofile.front.jollyany.en.widget')
</div>
</div><!-- end container -->
</section><!--end white-wrapper -->
@endsection
......@@ -103,7 +103,7 @@
<ul class="recent_posts_widget">
@foreach($info as $value)
<li>
<a href="{!! url('info/'.$value->slug) !!}"><img src="https://www.unesa.ac.id/assets/demos/logounesa.png" alt="">{!! $value->title !!}</a>
<a href="{!! url('information/'.$value->slug) !!}"><img src="https://www.unesa.ac.id/assets/demos/logounesa.png" alt="">{!! $value->title !!}</a>
<a class="readmore" href="#">{!! InseoHelper::tglbulanindo2($value->event_date) !!}</a>
</li>
@endforeach
......@@ -125,9 +125,9 @@
<a href="{!! url('post/'.$value->slug) !!}">
@if($value->thumbnail)
@if ($setting['external_storage'] == 1)
<img src="{{ $setting['url_static'] . '/' . $setting['directory'] . '/thumbnail/' . $value->thumbnail }}" alt="" class="img-responsive" style="height: 150px; width: auto;">
<img src="{{ $setting['url_static'] . '/' . $setting['directory'] . '/thumbnail/' . $value->thumbnail }}" alt="" class="img-responsive">
@else
<img src="{{ url('/storage/thumbnail/' . $value->thumbnail) }}" alt="" class="img-responsive" style="height: 150px; width: auto;">
<img src="{{ url('/storage/thumbnail/' . $value->thumbnail) }}" alt="" class="img-responsive">
@endif
@endif{!! $value->title !!}
</a>
......
@extends('webprofile.front.jollyany.master')
@section('content')
<section class="post-wrapper-top jt-shadow clearfix">
<div class="container">
<div class="col-lg-12">
<h2>Agenda - {!! $data->title !!}</h2>
</div>
</div>
</section><!-- end post-wrapper-top -->
<section class="blog-wrapper">
<div class="container">
<div class="row">
<div id="main-content" class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
<div class="row">
<div class="blog-masonry">
<div class="col-lg-12">
<div class="blog-carousel">
<div class="blog-carousel-header">
<h1>{!! $data->title !!}</h1>
<div class="blog-carousel-meta">
<span><i class="fa fa-eye"></i> <a href="#">{!! $data->viewer !!} Views</a></span>
{{-- <span><i class="fa fa-user"></i> <a href="#">Redaksi</a></span> --}}
</div><!-- end blog-carousel-meta -->
</div><!-- end blog-carousel-header -->
<div class="blog-carousel-desc">
{!! $data->content !!}
</div>
</div>
</div>
</div>
</div>
</div>
@include('webprofile.front.jollyany.widget')
</div>
</div><!-- end container -->
</section><!--end white-wrapper -->
@endsection
......@@ -5,7 +5,7 @@ Route::group(['namespace' => 'Webprofile\Front'], function () {
Route::get('post/{id}', 'PostController@index')->name('post');
Route::get('archive', 'ArchiveController@index')->name('archive');
Route::get('category/{id}','CategoryController@index')->name('category');
Route::get('info/{id}', 'FrontController@info')->name('infomation');
Route::get('information/{id}', 'InformationController@index')->name('infomation');
Route::get('agenda', 'FrontController@agenda')->name('agenda');
Route::get('error', 'FrontController@error')->name('error');
Route::get('download', 'FrontController@download')->name('download');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment