Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiltri committed Jan 27, 2025
2 parents 85e0e45 + 6166264 commit 287b3cc
Show file tree
Hide file tree
Showing 110 changed files with 1,541 additions and 2,090 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ docker-compose.override.yml
/public/assets/vendor
/public/mix-manifest.json
/public/sitemap.xml
/public/virtual-tours/tour.js
studio.json
.php_cs.cache
.php-cs-fixer.cache
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Portions of the website rely heavily on our [API](https://api.artic.edu). Check
* NPM 6.13.0
* PostgreSQL 15
* Homestead stable `release` branch
* krpano 1.12.* (for virtual tour blocks)



Expand Down Expand Up @@ -56,9 +55,6 @@ Once Homestead is set up, then install the website code itself:
* Access the frontend at http://{your_dev_domain}.
* Access the CMS at http://admin.{your_dev_domain}.

### krpano
In order to use the virtual tour blocks, you will need to put the `tour.js` file in place from the krpano library. To do so, [download krpano](https://krpano.com/download/). Follow the instructions to install the package, and look for `viewer/krpano.js` among the files. Copy `krpano.js` to the `public/virtual-tours` directory in this project and rename it to `tour.js`.

## Developing

### Frontend
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.49
6.52
16 changes: 8 additions & 8 deletions app/Console/Commands/MigrateOSCIPublicationOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,28 +307,28 @@ private function configureFigureBlock($block, $figure)
switch (true) {
// Non-video embeds (HTML, mostly) become media_embed
case $figure->figure_type === 'html_figure'
&& !isset($figure->html_content_src):
&& !isset($figure->html_content_src):
$this->configureHTMLFigure($block, $figure);
return;

// HTML embeds with a src are videos
// HTML embeds with a src are videos
case $figure->figure_type === 'html_figure'
&& isset($figure->html_content_src):
&& isset($figure->html_content_src):
$this->configureVideoFigure($block, $figure);
return;

// OSCI's layered_image with only one layer should just be an image
// OSCI's layered_image with only one layer should just be an image
case $figure->figure_type === 'layered_image'
&& count($layers) === 1:
&& count($layers) === 1:
$this->configureImageFigure($block, $figure, $layers);
return;

// Layered images are just that
// Layered images are just that
case $figure->figure_type === 'layered_image':
$this->configureLayeredImageFigure($block, $figure, $layers);
return;

// IIP Asset images are also images
// IIP Asset images are also images
case $figure->figure_type === 'iip_asset':
$this->configureImageFigure($block, $figure, $layers);
return;
Expand All @@ -337,7 +337,7 @@ private function configureFigureBlock($block, $figure)
$this->configure360EmbedFigure($block, $figure);
return;

// RTI_Viewers will need other handling, so leave a placeholder..
// RTI_Viewers will need other handling, so leave a placeholder..
case $figure->figure_type === 'rti_viewer':
// TODO: insert reader_url, figure # for this text + figure
$block->type = 'video';
Expand Down
37 changes: 0 additions & 37 deletions app/Http/Controllers/Admin/VirtualTourController.php

This file was deleted.

15 changes: 15 additions & 0 deletions app/Http/Controllers/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,21 @@ public function index()
);
}

if (request('category') || request('type')) {
$cat = $page->articlesCategories->first(function ($value) {
return $value->id == request('category');
});
$titles = array_filter([
'Articles',
$cat?->name,
Str::title(request('type')),
request('page') ? 'Page ' . request('page') : null,
]);
$this->seo->setTitle(implode(', ', $titles));
} else {
$this->seo->setTitle('Articles');
}

return view('site.articles', [
'primaryNavCurrent' => 'collection',
'page' => $page,
Expand Down
7 changes: 5 additions & 2 deletions app/Http/Controllers/AuthorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public function index(Request $request)
$items = $this->repository->published()->ordered()->paginate();

$title = 'Authors';
$titles = array_filter([
$title,
request('page') ? 'Page ' . request('page') : null,
]);
$this->seo->setTitle(implode(', ', $titles));

$subNav = [
['label' => $title, 'href' => route('authors.index'), 'active' => true]
Expand All @@ -30,8 +35,6 @@ public function index(Request $request)
['label' => 'Publications', 'href' => route('articles_publications'), 'links' => $subNav]
];

$this->seo->setTitle($title);

$view_data = [
'title' => $title,
'subNav' => $subNav,
Expand Down
11 changes: 9 additions & 2 deletions app/Http/Controllers/CollectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,16 @@ public function index()
$activeFilters = $this->collection()->activeFilters();

if ($activeFilters->count()) {
$this->seo->setTitle(implode(', ', $activeFilters->pluck('label')->all()));
$titles = $activeFilters->pluck('label')->all();
$titles[] = request('page') ? 'Page ' . request('page') : null;
$titles = array_filter($titles);
$this->seo->setTitle(implode(', ', $titles));
} else {
$this->seo->setTitle('Discover Art & Artists');
$titles = array_filter([
'Discover Art & Artists',
request('page') ? 'Page ' . request('page') : null,
]);
$this->seo->setTitle(implode(', ', $titles));
}

if ($collection->count()) {
Expand Down
8 changes: 7 additions & 1 deletion app/Http/Controllers/EducatorResourcesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ public function index(Request $request)
$items = $this->collection()->orderByDate()->paginate();

$title = 'Educator Resources';
$cat = ResourceCategory::where('id', request('category'))->first();
$titles = array_filter([
$title,
$cat?->name,
request('page') ? 'Page ' . request('page') : null,
]);

$this->seo->setTitle($title);
$this->seo->setTitle(implode(', ', $titles));

$subNav = [
['label' => $title, 'href' => route('collection.resources.educator-resources'), 'active' => true]
Expand Down
24 changes: 23 additions & 1 deletion app/Http/Controllers/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Models\EventProgram;
use App\Repositories\EventRepository;
use Carbon\Carbon;
use Illuminate\Support\Str;
use View;

class EventsController extends FrontController
Expand Down Expand Up @@ -39,9 +40,30 @@ public function index()
$ongoing = null;
$eventsByDay = $this->repository->groupByDate($collection);

$programName = null;
if (request('program')) {
$subtitle = 'These are events related to ' . EventProgram::find(request('program'))->name . '.';
$programName = EventProgram::find(request('program'))->name;
$subtitle = 'These are events related to ' . $programName . '.';
}

$type = collect(Event::$eventTypes)->first(function ($value, $key) {
return $key == request('type');
});
$audience = collect(Event::$eventAudiences)->first(function ($value, $key) {
return $key == request('audience');
});
$titles = array_filter([
'Events',
request('start') ? Carbon::parse(request('start'))->toFormattedDateString() : null,
request('end') ? Carbon::parse(request('end'))->toFormattedDateString() : null,
Str::title(request('time')),
$type,
$audience,
$programName,
request('page') ? 'Page ' . request('page') : null,
]);

$this->seo->setTitle(implode(', ', $titles));
} else {
// Divide the collection by normal events and ongoing ones
$ongoing = $collection->filter(function ($item) {
Expand Down
8 changes: 8 additions & 0 deletions app/Http/Controllers/ExhibitionHistoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ public function index(Request $request, ExhibitionHistoryService $service)
$extraResults = $this->apiRepository->searchApi(request('q'), self::PER_PAGE);
}

$titles = array_filter([
'Exhibition History',
request('year'),
request('page') ? 'Page ' . request('page') : null,
]);

$this->seo->setTitle(implode(', ', $titles));

$viewData = [
'page' => $page,
'years' => $years,
Expand Down
37 changes: 20 additions & 17 deletions app/Http/Controllers/Forms/EmailSubscriptionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,32 @@ public function index(Request $request)
$exactTarget = new ExactTargetService($email);
$response = $exactTarget->get();

if ($response->status && $response->code == 200 && count($response->results)) {
if (isset($response['items']) && count($response['items'])) {
// When a new property gets added to the data extension,
// even if it is given a default value, existing records
// will not be updated with that value. We need to assume
// some true/false defaults here.
foreach ($response->results[0]->Properties->Property as $item) {
switch ($item->Name) {
case 'Email':
$this->old->email = $item->Value;
foreach ($response['items'][0]['keys'] as $key => $value) {
switch ($key) {
case 'email':
$this->old->email = $value;
break;
case 'FirstName':
$this->old->first_name = $item->Value;
break;
case 'LastName':
$this->old->last_name = $item->Value;
}
}
foreach ($response['items'][0]['values'] as $key => $value) {
switch ($key) {
case 'firstname':
$this->old->first_name = $value;
break;
case 'OptMuseum':
$this->old->OptMuseum = empty($item->Value)
|| strtolower($item->Value) == 'true';
case 'lastname':
$this->old->last_name = $value;
break;
default:
$this->old->{$item->Name} = !empty($item->Value)
&& strtolower($item->Value) == 'true';
}
}
foreach (ExactTargetList::getList() as $sub => $name) {
if (isset($response['items'][0]['values'][Str::lower($sub)])) {
$value = $response['items'][0]['values'][Str::lower($sub)];
$this->old->{$sub} = !empty($value) && strtolower($value) == 'true';
}
}
} else {
Expand Down Expand Up @@ -396,7 +399,7 @@ private function getDecryptedEmail($encryptedEmail)
{
return trim(openssl_decrypt(
base64_decode($encryptedEmail),
'des-ecb',
'des-ede3-ecb',
hex2bin(config('exact-target.encryption_key')),
OPENSSL_ZERO_PADDING,
''
Expand Down
52 changes: 11 additions & 41 deletions app/Http/Controllers/LandingPagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Models\Hour;
use App\Models\Lightbox;
use App\Models\LandingPage;
use App\Models\PrintedPublication;
use App\Repositories\LandingPageRepository;
use Carbon\Carbon;
use Illuminate\Support\Str;
Expand Down Expand Up @@ -61,12 +62,6 @@ public function show($id, $slug = null)
$this->seo->setImage($item->imageFront('hero') ?? $item->imageFront('visit_mobile'));
break;

case $types->search('Research and Resources'):
$this->seo->setTitle($item->meta_title ?: $item->title ?: 'Research & Resources');
$this->seo->setDescription($item->resources_landing_intro);
$this->seo->setImage($item->imageFront('research_landing_image'));
break;

case $types->search('My Museum Tour'):
$this->seo->setTitle($item->meta_title ?: $item->title);
$this->seo->setDescription($item->meta_description);
Expand Down Expand Up @@ -162,19 +157,10 @@ public function viewData($item)
];

$title = '';

switch ($item->type_id) {
case $types->search('Visit'):
$title = __('Visit');
break;

case $types->search('Research and Resources'):
$title = 'The Collection';
break;

default:
$title = $item->title;
break;
if ($item->type_id === $types->search('Visit')) {
$title = __('Visit');
} else {
$title = $item->title;
}

$commonViewData = [
Expand Down Expand Up @@ -250,28 +236,6 @@ public function viewData($item)
];
break;

case $types->search('Research and Resources'):
$viewData = [
'primaryNavCurrent' => 'collection',
'intro' => $item->labels->get('resources_landing_intro'),
'linksBar' => [
[
'href' => route('collection'),
'label' => 'Artworks',
],
[
'href' => route('articles_publications'),
'label' => 'Publications',
],
[
'href' => route('collection.research_resources'),
'label' => 'Research',
'active' => true,
],
],
];
break;

case $types->search('RLC'):
$viewData = [
'contrastHeader' => true,
Expand All @@ -290,6 +254,12 @@ public function viewData($item)
];
break;

case $types->search('Publications'):
$viewData = [
'publications' => PrintedPublication::all(),
];
break;

default:
$viewData = array();
break;
Expand Down
Loading

0 comments on commit 287b3cc

Please sign in to comment.