Skip to content

Commit

Permalink
Problem with registration was solved. A few products with thumbnails …
Browse files Browse the repository at this point in the history
…and images to gallery was added
  • Loading branch information
vilgefortzz committed Jun 15, 2017
1 parent f371906 commit 685e002
Show file tree
Hide file tree
Showing 67 changed files with 36 additions and 61 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class RegisterController extends Controller
*
* @var string
*/
protected $redirectTo = '/home';
protected $redirectTo = '/';

/**
* Create a new controller instance.
Expand All @@ -49,7 +49,7 @@ public function __construct()
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'username' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|min:6|confirmed',
]);
Expand All @@ -68,7 +68,7 @@ protected function create(array $data)
* Create new user
*/
$user = new User();
$user->name = $data['name'];
$user->username = $data['username'];
$user->email = $data['email'];
$user->password = bcrypt($data['password']);
$user->save();
Expand Down
2 changes: 1 addition & 1 deletion database/factories/ModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
'subcategory_id' => rand(1, 7),
'name' => $faker->unique()->word,
'description' => $faker->text(800),
'price' => $faker->randomFloat(2, 150, 900),
'price' => $faker->randomFloat(2, 340, 8000),
'quantity' => rand(0, 15)
];
});
Expand Down
66 changes: 20 additions & 46 deletions database/seeds/ProductsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,63 +16,44 @@ public function run()

$productsToSwords = [
'FINE AND RARE BOLIVIAN OFFICER’S SWORD',
'miecz jednoręczny - dekoracyjny2', 'miecz jednoręczny - dekoracyjny3',
'miecz jednoręczny - dekoracyjny4', 'miecz jednoręczny - dekoracyjny5', 'miecz jednoręczny - dekoracyjny6', 'miecz jednoręczny - szczerbiec'
'US M.1852 NAVAL OFFICER’S SWORD',
'ITALIAN 1888 MODEL CAVALRY OFFICER’S SWORD',
'OTTOMAN SHAMSHIR',
'BRITISH DIPLOMAT’S SWORD',
'KNIGHTS TEMPLAR SWORD',
'FRENCH INFANTRY SWORD',
'US MILITARY ACADEMY CADET SWORD',
'INDOPERSIAN HORSEMAN\'S SWORD C.1750'
];

$productsToAxes = ['axe'];
$productsToShields = ['legion shield'];
$productsToHelmets = ['helmet'];
$productsToDaggers = [];

$productsToShields = [];

$productsToHelmets = [];

$productsToArmors = [];

$swordsThumbnails = [
'/images/thumbnails/swords/1.jpg', '/images/thumbnails/swords/2.jpg', '/images/thumbnails/swords/3.jpg',
'/images/thumbnails/swords/4.jpg', '/images/thumbnails/swords/5.jpg', '/images/thumbnails/swords/6.jpg', '/images/thumbnails/swords/7.jpg'
'/images/thumbnails/swords/4.jpg', '/images/thumbnails/swords/5.jpg', '/images/thumbnails/swords/6.jpg',
'/images/thumbnails/swords/7.jpg', '/images/thumbnails/swords/8.jpg', '/images/thumbnails/swords/9.jpg',
];

$axesThumbnails = ['/images/thumbnails/axes/axe.jpg'];
$shieldsThumbnails = ['/images/thumbnails/shields/legion_shield.jpg'];
$helmetsThumbnails = ['/images/thumbnails/helmets/helmet.jpg'];

$subcategories = Subcategory::all();

$subcategorySwords = $subcategories->where('name', 'swords')->first();
$subcategoryAxes = $subcategories->where('name', 'axes')->first();
$subcategoryDaggers = $subcategories->where('name', 'daggers')->first();
$subcategoryShields = $subcategories->where('name', 'shields')->first();
$subcategoryHelmets = $subcategories->where('name', 'helmets')->first();
$subcategoryArmors = $subcategories->where('name', 'armors')->first();

for ($i = 0; $i < count($productsToSwords); $i++) {
factory(Product::class)->create([
'subcategory_id' => $subcategorySwords->id,
'name' => $productsToSwords[$i],
'path_to_thumbnail' => $swordsThumbnails[$i],
'quantity' => 5
]);
}

for ($i = 0; $i < count($productsToAxes); $i++) {
factory(Product::class)->create([
'subcategory_id' => $subcategoryAxes->id,
'name' => $productsToAxes[$i],
'path_to_thumbnail' => $axesThumbnails[$i],
'quantity' => 8
]);
}

for ($i = 0; $i < count($productsToShields); $i++) {
factory(Product::class)->create([
'subcategory_id' => $subcategoryShields->id,
'name' => $productsToShields[$i],
'path_to_thumbnail' => $shieldsThumbnails[$i],
'quantity' => 14
]);
}

for ($i = 0; $i < count($productsToHelmets); $i++) {
factory(Product::class)->create([
'subcategory_id' => $subcategoryHelmets->id,
'name' => $productsToHelmets[$i],
'path_to_thumbnail' => $helmetsThumbnails[$i],
'quantity' => 3
'quantity' => 9
]);
}

Expand All @@ -81,13 +62,6 @@ public function run()
// factory(Product::class, 120)->create([
// 'subcategory_id' => $subcategory->id
// ]);
// }

// foreach ($subcategories as $subcategory) {
// factory(Product::class, 2)->create([
// 'subcategory_id' => $subcategory->id,
// 'recommended' => true
// ]);
// }
}
}
4 changes: 2 additions & 2 deletions database/seeds/SubcategoriesTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class SubcategoriesTableSeeder extends Seeder
*/
public function run()
{
$subcategoryNamesToAttack = ['swords', 'axes', 'katanas'];
$subcategoryNamesToDefend = ['armours', 'helmets', 'shields'];
$subcategoryNamesToAttack = ['swords', 'daggers'];
$subcategoryNamesToDefend = ['armors', 'helmets', 'shields'];

$categories = Category::all();

Expand Down
Binary file added public/images/galleries/swords/2/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/2/1_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/2/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/2/2_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/2/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/2/3_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/3/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/3/1_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/3/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/3/2_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/3/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/3/3_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/4/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/4/1_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/4/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/4/2_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/4/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/4/3_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/5/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/5/1_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/5/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/5/2_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/5/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/5/3_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/6/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/galleries/swords/6/1_tb.jpg
Binary file added public/images/galleries/swords/6/2.jpg
Binary file added public/images/galleries/swords/6/2_tb.jpg
Binary file added public/images/galleries/swords/6/3.jpg
Binary file added public/images/galleries/swords/6/3_tb.jpg
Binary file added public/images/galleries/swords/7/1.jpg
Binary file added public/images/galleries/swords/7/1_tb.jpg
Binary file added public/images/galleries/swords/7/2.jpg
Binary file added public/images/galleries/swords/7/2_tb.jpg
Binary file added public/images/galleries/swords/7/3.jpg
Binary file added public/images/galleries/swords/7/3_tb.jpg
Binary file added public/images/galleries/swords/8/1.jpg
Binary file added public/images/galleries/swords/8/1_tb.jpg
Binary file added public/images/galleries/swords/8/2.jpg
Binary file added public/images/galleries/swords/8/2_tb.jpg
Binary file added public/images/galleries/swords/8/3.jpg
Binary file added public/images/galleries/swords/8/3_tb.jpg
Binary file added public/images/galleries/swords/9/1.jpg
Binary file added public/images/galleries/swords/9/1_tb.jpg
Binary file added public/images/galleries/swords/9/2.jpg
Binary file added public/images/galleries/swords/9/2_tb.jpg
Binary file added public/images/galleries/swords/9/3.jpg
Binary file added public/images/galleries/swords/9/3_tb.jpg
Binary file removed public/images/thumbnails/axes/axe.jpg
Diff not rendered.
Binary file removed public/images/thumbnails/helmets/helmet.jpg
Diff not rendered.
Binary file removed public/images/thumbnails/shields/legion_shield.jpg
Diff not rendered.
Binary file modified public/images/thumbnails/swords/2.jpg
Binary file modified public/images/thumbnails/swords/3.jpg
Binary file modified public/images/thumbnails/swords/4.jpg
Binary file modified public/images/thumbnails/swords/5.jpg
Binary file modified public/images/thumbnails/swords/6.jpg
Binary file modified public/images/thumbnails/swords/7.jpg
Binary file added public/images/thumbnails/swords/8.jpg
Binary file added public/images/thumbnails/swords/9.jpg
10 changes: 5 additions & 5 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<form class="form-horizontal" role="form" method="POST" action="{{ route('register') }}">
{{ csrf_field() }}

<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-4 control-label">Name</label>
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
<label for="username" class="col-md-4 control-label">Username</label>

<div class="col-md-6">
<input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus>
<input id="username" type="text" class="form-control" name="username" value="{{ old('username') }}" required autofocus>

@if ($errors->has('name'))
@if ($errors->has('username'))
<span class="help-block">
<strong>{{ $errors->first('name') }}</strong>
<strong>{{ $errors->first('username') }}</strong>
</span>
@endif
</div>
Expand Down
6 changes: 3 additions & 3 deletions resources/views/main_page.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@foreach($categories as $category)
<ul id="sub_cat_{{$category->id}}" class="sub_cat_menu" hidden>
@foreach($category->subcategories as $subcategory)
<li id="sub_link_{{$subcategory->id}}"><a href="{{ url('/subcategories/'.$subcategory->id.'/products') }}"><b>{{$subcategory->name}}</b></a></li>
<li id="sub_link_{{$subcategory->id}}" class="sub_cat_li"><a href="{{ url('/subcategories/'.$subcategory->id.'/products') }}"><b>{{$subcategory->name}}</b></a></li>
@endforeach
</ul>
@endforeach
Expand Down Expand Up @@ -130,9 +130,9 @@
$('#sub_cat_' + id).fadeIn();
});
$('.sub_cat_menu').on('click', function () {
$('.sub_cat_li').on('click', function () {
var id = $(this).find('li').attr('id');
var id = $(this).attr('id');
localStorage.setItem('active_link', id);
});
Expand Down
2 changes: 1 addition & 1 deletion resources/views/products/products_list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@foreach($products as $product)
<div class="item col-xs-4 col-lg-4">
<div class="thumbnail">
<img class="group list-group-image" src="{{$product->path_to_thumbnail}}" width="200" height="200"/>
<img class="group list-group-image" src="{{$product->path_to_thumbnail}}" width="150" height="150"/>
<div class="caption">
<h2 class="group inner list-group-item-heading">
<b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
$('.subcategory_links').on('click', function () {
var id = $(this).attr('id');
console.log("Dupa tam : " + id);
localStorage.setItem('active_link', id);
localStorage.removeItem('sort_id');
Expand Down

0 comments on commit 685e002

Please sign in to comment.