-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/modular-2' into develop
- Loading branch information
Showing
24 changed files
with
470 additions
and
136 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,62 @@ | ||
<?php | ||
|
||
namespace Factories; | ||
|
||
use Contracts\Factories\FactoryContract; | ||
use Faker\Factory; | ||
|
||
class Spotlight implements FactoryContract | ||
{ | ||
/** | ||
* Construct the factory. | ||
*/ | ||
public function __construct(Factory $faker) | ||
{ | ||
$this->faker = $faker->create(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function create($limit = 1, $flatten = false, $options = []) | ||
{ | ||
$promo_group_id = $this->faker->randomNumber(5); | ||
|
||
for ($i = 0; $i <= $limit - 1; $i++) { | ||
$data[$i] = [ | ||
'title' => $this->faker->name, | ||
'excerpt' => $this->faker->jobTitle, | ||
'description' => '<p>“' . $this->faker->text(200) . '”</p>', | ||
'link' => 'https://wayne.edu', | ||
'promo_item_id' => $i, | ||
'promo_group_id' => strval($promo_group_id), | ||
'relative_url' => '/styleguide/image/600x600?text=600x600:'.$i, | ||
'filename_url' => '/styleguide/image/600x600?text=600x600:'.$i, | ||
'filename_alt_text' => 'Placeholder image '.$i, | ||
'secondary_image' => '', | ||
'secondary_relative_url' => '/styleguide/image/150x150?text=150x150:'.$i, // 4:3 | ||
'secondary_filename_url' => '', | ||
'secondary_alt_text' => 'Secondary placeholder image '.$i, | ||
'option' => '', | ||
//'option' => $this->faker->randomElement(['Gold', 'Green', '']), | ||
'start_date' => $this->faker->dateTimeThisMonth('now')->format('Y-m-d H:i:s'), | ||
'end_date' => '', | ||
'display_start_date' => '0000-00-00 00:00:00', | ||
'display_end_date' => '0000-00-00 00:00:00', | ||
'start_time_hide' => '0', | ||
'end_time_hide' => '0', | ||
'group' => [ | ||
'title' => 'Promo group title', | ||
], | ||
]; | ||
|
||
$data[$i] = array_replace_recursive($data[$i], $options); | ||
} | ||
|
||
if ($limit === 1 && $flatten === true) { | ||
return current($data); | ||
} | ||
|
||
return $data; | ||
} | ||
} |
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,61 @@ | ||
{{-- | ||
$item => single // ['title', 'excerpt', 'description', 'link', 'filename_url', 'filename_alt_text'] | ||
--}} | ||
|
||
<div class="col-span-2"> | ||
@if(!empty($data[0]['component']['heading']))<h2 class="mt-0">{{ $data[0]['component']['heading'] }}</h2>@endif | ||
|
||
@if(!empty($data[0]['component']['columns']) && $data[0]['component']['columns'] == 1) | ||
<div class="grid gap-4"> | ||
@foreach($data as $item) | ||
<{{ !empty($item['link']) ? 'a href='.$item['link'] : 'div' }} class="flex items-start space-x-3 md:space-x-6 mb-8 {{ !empty($item['link']) ? 'group' : '' }}"> | ||
@if(!empty($item['filename_url'])) | ||
@image($item['filename_url'], $item['filename_alt_text'], 'w-1/4 shrink-0') | ||
@endif | ||
|
||
<div class="md:mt-0 content"> | ||
<div class="font-bold text-xl group-hover:underline group-focus:underline">{{ $item['title'] }}</div> | ||
@if(!empty($item['excerpt'])) | ||
<div class="text-black mt-1"> | ||
{!! strip_tags($item['excerpt'], ['em', 'strong']) !!} | ||
</div> | ||
@endif | ||
@if(!empty($item['description'])) | ||
@if (!empty($item['link'])) | ||
<div class="text-black mt-1">{!! preg_replace(array('"<a href(.*?)>"', '"</a>"'), array('',''), $item['description']) !!}</div> | ||
@else | ||
<div class="text-black mt-1">{!! $item['description'] !!}</div> | ||
@endif | ||
@endif | ||
</div> | ||
<{{ !empty($item['link']) ? '/a' : '/div' }}> | ||
@endforeach | ||
</div> | ||
@else | ||
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-{{ !empty($data[0]['component']['columns']) && $data[0]['component']['columns'] >= 3 ? '3' : '2' }} xl:grid-cols-{{ !empty($data[0]['component']['columns']) ? $data[0]['component']['columns'] : '3' }}"> | ||
@foreach($data as $item) | ||
<{{ !empty($item['link']) ? 'a href='.$item['link'] : 'div' }} class="flex items-start space-x-3 md:space-x-0 md:block {{ !empty($item['link']) ? 'group' : '' }}"> | ||
@if(!empty($item['filename_url'])) | ||
@image($item['filename_url'], $item['filename_alt_text'], 'w-1/4 shrink-0 md:shrink md:w-full') | ||
@endif | ||
|
||
<div class=> | ||
<div class="w-full relative md:pt-2"> | ||
<div class="font-bold text-xl group-hover:underline group-focus:underline">{{ $item['title'] }}</div> | ||
@if(!empty($item['excerpt'])) | ||
<div class="block mt-1 font-normal text-black">{!! strip_tags($item['excerpt'], ['em','strong']) !!}</div> | ||
@endif | ||
@if(!empty($item['description'])) | ||
@if (!empty($item['link'])) | ||
<div class="text-black mt-1">{!! preg_replace(array('"<a href(.*?)>"', '"</a>"'), array('',''), $item['description']) !!}</div> | ||
@else | ||
<div class="text-black mt-1">{!! $item['description'] !!}</div> | ||
@endif | ||
@endif | ||
</div> | ||
</div> | ||
<{{ !empty($item['link']) ? '/a' : '/div' }}> | ||
@endforeach | ||
</div> | ||
@endif | ||
</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
Oops, something went wrong.