Skip to content

Commit

Permalink
Fixes #39, Fixes #48, Fixes #49, Fixes #50
Browse files Browse the repository at this point in the history
  • Loading branch information
stojankukrika committed Feb 18, 2015
1 parent 2f9201e commit 3bc7a59
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
8 changes: 4 additions & 4 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public function index()

$photoalbums = PhotoAlbum::select(array('photo_album.id', 'photo_album.name', 'photo_album.description',
'photo_album.folderid',
DB::raw('(select filename from photo WHERE album_cover=1 and photo.photo_album_id=photo_album.id) AS album_image'),
DB::raw('(select filename from photo WHERE photo.photo_album_id=photo_album.id ORDER BY position ASC, id ASC LIMIT 1) AS album_image_first')))->limit(8)->get();
DB::raw('(select ${tbpfx}filename from photo WHERE album_cover=1 and ${tbpfx}photo.photo_album_id=${tbpfx}photo_album.id) AS album_image'),
DB::raw('(select ${tbpfx}filename from photo WHERE ${tbpfx}photo.photo_album_id=${tbpfx}photo_album.id ORDER BY position ASC, id ASC LIMIT 1) AS album_image_first')))->limit(8)->get();

$videoalbums = VideoAlbum::select(array('video_album.id', 'video_album.name', 'video_album.description',
'video_album.folderid',
DB::raw('(select youtube from video as v WHERE album_cover=1 and v.video_album_id=video_album.id) AS album_image'),
DB::raw('(select youtube from video WHERE video.video_album_id=video_album.id ORDER BY position ASC, id ASC LIMIT 1) AS album_image_first')))->limit(8)->get();
DB::raw('(select ${tbpfx}youtube from video as v WHERE album_cover=1 and v.video_album_id=${tbpfx}video_album.id) AS album_image'),
DB::raw('(select ${tbpfx}youtube from video WHERE ${tbpfx}video.video_album_id=${tbpfx}video_album.id ORDER BY position ASC, id ASC LIMIT 1) AS album_image_first')))->limit(8)->get();

return view('site.home.index',compact('news','sliders','videoalbums','photoalbums'));
}
Expand Down
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ Demo is here http://l5start.mrakodol.info/
* View Video,Photos,News
* soon will be more...
* Packages included:
* JeffreyWay Laravel 4 Generators
* Datatables Bundle

-----
<a name="feature2"></a>
##Requirements

PHP >= 5.4.0 (Entrust requires 5.4, this is an increase over Laravel's 5.3.7 requirement)
PHP >= 5.4.0
MCrypt PHP Extension
Enable creating triger in database
SQL server(for example MySQL)
Expand Down
35 changes: 20 additions & 15 deletions resources/views/admin/video/create_edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<form class="form-horizontal" enctype="multipart/form-data"
method="post"
action="@if(isset($video)){{ URL::to('admin/video/'.$video->id.'/edit') }}
@else{{ URL::to('admin/video/create') }}@endif"
@else {{ URL::to('admin/video/create') }}
@endif"
autocomplete="off">
<input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
<div class="tab-content">
Expand All @@ -22,7 +23,9 @@ class="form-control"> @foreach($languages as $item)
<option value="{{$item->id}}"
@if(!empty($language))
@if($item->id==$language)
selected="selected" @endif @endif >{{$item->name}}</option>
selected="selected"
@endif
@endif >{{$item->name}}</option>
@endforeach
</select>
</div>
Expand All @@ -43,11 +46,14 @@ class="form-group {{{ $errors->has('photo_album_id') ? 'has-error' : '' }}}">
<label class="control-label" for="video_album_id">{{
Lang::get("admin/video.album") }}</label> <select
style="width: 100%" name="video_album_id" id="video_album_id"
class="form-control"> @foreach($videoalbums as $item)
class="form-control">
@foreach($videoalbums as $item)
<option value="{{$item->id}}"
@if(!empty($videoalbum))
@if($item->id==$videoalbum)
selected="selected" @endif @endif >{{$item->name}}</option>
selected="selected"
@endif
@endif >{{$item->name}}</option>
@endforeach
</select>
</div>
Expand All @@ -56,16 +62,16 @@ class="form-control"> @foreach($videoalbums as $item)
class="form-group {{{ $errors->has('album_cover') ? 'has-error' : '' }}}">
<div class="col-lg-12">
<label class="control-label" for="album_cover">{{{
Lang::get('admin/photo.album_cover') }}}</label> <label
class="radio"> {!! Form::radio('album_cover', 1,
(Input::old('album_cover') == '1' || (isset($video) &&
$video->video_album_cover == '1')) ? true : false,
array('id'=>'showtitle', 'class'=>'radio')) !!} {{{
Lang::get('admin/admin.yes') }}} </label> <label class="radio">
{!! Form::radio('album_cover', 0, (Input::old('album_cover') ==
'0' || (isset($video) && $video->video_album_cover == '0') ||
Lang::get('admin/photo.album_cover') }}}</label>
<label class="radio"> {!! Form::radio('album_cover', 1, (Input::old('album_cover') == '1' || (isset($video) &&
$video->video_album_cover == '1')) ? true : false,
array('id'=>'showtitle', 'class'=>'radio')) !!}
{{{ Lang::get('admin/admin.yes') }}} </label>
<label class="radio">
{!! Form::radio('album_cover', 0, (Input::old('album_cover') == '0' || (isset($video) && $video->video_album_cover == '0') ||
!isset($video)) ? true : false, array('id'=>'showtitle',
'class'=>'radio')) !!} {{{ Lang::get('admin/admin.no') }}} </label>
'class'=>'radio')) !!}
{{{ Lang::get('admin/admin.no') }}} </label>

</div>
</div>
Expand All @@ -76,8 +82,7 @@ class="form-group {{{ $errors->has('content') ? 'has-error' : '' }}}">
Lang::get("admin/photo.description") }}</label>
<textarea class="form-control full-width wysihtml5"
name="description" rows="10">{{{ Input::old('content', isset($video) ? $video->description : null) }}}</textarea>
{!! $errors->first('description', '<label class="control-label">:message</label>')
!!}
{!! $errors->first('description', '<label class="control-label">:message</label>')!!}
</div>
</div>
<div class="form-group">
Expand Down

0 comments on commit 3bc7a59

Please sign in to comment.