-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infinite scrolling to reviews was added
- Loading branch information
vilgefortzz
committed
May 1, 2017
1 parent
dd9f48f
commit be85757
Showing
16 changed files
with
167 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
use App\Review; | ||
use Illuminate\Database\Seeder; | ||
|
||
class ReviewsTableSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
* | ||
* @return void | ||
*/ | ||
public function run() | ||
{ | ||
factory(Review::class, 40)->create(); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,50 @@ | ||
{{-- Pagination links --}} | ||
{{ $products->links() }} | ||
|
||
<div id="load" style="position: relative;"> | ||
@foreach($products as $product) | ||
@foreach($products as $product) | ||
<div class="item col-xs-4 col-lg-4"> | ||
<div class="thumbnail"> | ||
<img class="group list-group-image" src="{{$product->image}}" width="200" height="200"/> | ||
<div class="caption"> | ||
<h2 class="group inner list-group-item-heading"> | ||
<b> | ||
{{$product->name}} | ||
<a href="{{ url('/products/'.$product->id) }}" style="font-size: 12px"> | ||
<span class="glyphicon glyphicon-triangle-right"></span>See details | ||
</a> | ||
</b> | ||
</h2> | ||
|
||
<div class="item col-xs-4 col-lg-4"> | ||
<div class="thumbnail"> | ||
<img class="group list-group-image" src="/images/{{$product->image}}" width="200" height="200"/> | ||
<div class="caption"> | ||
<h2 class="group inner list-group-item-heading"> | ||
<b> | ||
{{$product->name}} | ||
<a href="{{ url('/products/'.$product->id) }}" style="font-size: 12px"> | ||
<span class="glyphicon glyphicon-triangle-right"></span>See details | ||
</a> | ||
</b> | ||
</h2> | ||
<div class="row" style="margin-top: 50px"> | ||
<div class="col-xs-12 col-md-4 group_div"> | ||
<p><b>Buy now:</b></p> | ||
<p class="lead_sub"><b>{{$product->price}}$</b></p> | ||
</div> | ||
<div class="col-xs-12 col-md-6 group_div"> | ||
<a id="add_{{$product->id}}" class="add_to_cart" href="{{ url('/cart/add/'.$product->id) }}"> | ||
<div id="add_to_cart_btn{{$product->id}}"> | ||
<span class="glyphicon glyphicon-shopping-cart"></span><b>Add to cart</b> | ||
</div> | ||
</a> | ||
|
||
<div class="row" style="margin-top: 50px"> | ||
<div class="col-xs-12 col-md-4 group_div"> | ||
<p><b>Buy now:</b></p> | ||
<p class="lead_sub"><b>{{$product->price}}$</b></p> | ||
</div> | ||
<div class="col-xs-12 col-md-6 group_div"> | ||
<a id="add_{{$product->id}}" class="add_to_cart" href="{{ url('/cart/add/'.$product->id) }}"> | ||
<div id="add_to_cart_btn{{$product->id}}"> | ||
<span class="glyphicon glyphicon-shopping-cart"></span><b>Add to cart</b> | ||
</div> | ||
</a> | ||
{{-- Hidden link - dynamically change--}} | ||
<a id="remove_{{$product->id}}" class="remove_from_cart" href="{{ url('/cart/delete/'.$product->id) }}" hidden> | ||
<div id="remove_from_cart_btn{{$product->id}}"> | ||
<span class="glyphicon glyphicon-remove"></span><b>Remove</b> | ||
</div> | ||
</a> | ||
|
||
{{-- Hidden link - dynamically change--}} | ||
<a id="remove_{{$product->id}}" class="remove_from_cart" href="{{ url('/cart/delete/'.$product->id) }}" hidden> | ||
<div id="remove_from_cart_btn{{$product->id}}"> | ||
<span class="glyphicon glyphicon-remove"></span><b>Remove</b> | ||
{{--For autheniticated users--}} | ||
@if(Auth::check()) | ||
<a class="give_review" href="{{ url('/products/'.$product->id) }}"> | ||
<div id="give_review_btn"> | ||
<span class="glyphicon glyphicon-comment"></span><b>Give a review</b> | ||
</div> | ||
</a> | ||
|
||
{{--For autheniticated users--}} | ||
@if(Auth::check()) | ||
<a class="give_review" href="{{ url('/products/'.$product->id) }}"> | ||
<div id="give_review_btn"> | ||
<span class="glyphicon glyphicon-comment"></span><b>Give a review</b> | ||
</div> | ||
</a> | ||
@endif | ||
</div> | ||
@endif | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@endforeach | ||
</div> | ||
</div> | ||
@endforeach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="infinite-scroll"> | ||
@foreach($reviews as $review) | ||
<div class="row"> | ||
<div class="col-sm-8"> | ||
<div class="panel panel-review panel-default"> | ||
<div class="panel-heading panel-heading-review"> | ||
<span class="glyphicon glyphicon-user"></span><span class="text-muted" style="margin-right: 10px"><u><b>{{$review->user->name}}</b></u></span> | ||
<span class="glyphicon glyphicon-time"></span><span class="text-muted"><u><b>{{$review->created_at->toDateString()}}</b></u></span> | ||
</div> | ||
<div class="panel-body"> | ||
{{$review->review}} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@endforeach | ||
|
||
{{ $reviews->links() }} | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters