Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TMS-1070: Lobby display changes #48

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

- TMS-1070: Change lobby-display images, allow single exhibition to be in two spaces

## [1.3.9] - 2024-09-25

- TMS-1067: Show price-info for event in listing if it's free
Expand Down
Binary file modified assets/images/aula/map_2nd_floor.png
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 assets/images/aula/map_2nd_floor_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/aula/map_3rd_floor.png
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 assets/images/aula/map_3rd_floor_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/aula/map_basement.png
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 assets/images/aula/map_basement_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/aula/map_groundfloor.png
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 assets/images/aula/map_groundfloor_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 34 additions & 26 deletions models/page-lobby-display.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @return string
*/
public function font() {
return get_stylesheet_directory_uri() . '/assets/fonts/BebasNeue-Regular.ttf';
return \get_stylesheet_directory_uri() . '/assets/fonts/BebasNeue-Regular.ttf';
}

/**
Expand All @@ -25,19 +25,19 @@
*/
public function lobby_images() {
$images = [
'map_3rd_floor' => get_stylesheet_directory_uri() . '/assets/images/aula/map_3rd_floor.png',
'third' => get_stylesheet_directory_uri() . '/assets/images/aula/3rd.png',
'map_2nd_floor' => get_stylesheet_directory_uri() . '/assets/images/aula/map_2nd_floor.png',
'second' => get_stylesheet_directory_uri() . '/assets/images/aula/2nd.png',
'map_groundfloor' => get_stylesheet_directory_uri() . '/assets/images/aula/map_groundfloor.png',
'first' => get_stylesheet_directory_uri() . '/assets/images/aula/1st.png',
'map_basement' => get_stylesheet_directory_uri() . '/assets/images/aula/map_basement.png',
'basement' => get_stylesheet_directory_uri() . '/assets/images/aula/basement.png',
'hallway' => get_stylesheet_directory_uri() . '/assets/images/aula/hallway.png',
'food' => get_stylesheet_directory_uri() . '/assets/images/aula/food.png',
'shop' => get_stylesheet_directory_uri() . '/assets/images/aula/shop.png',
'loc_white' => get_stylesheet_directory_uri() . '/assets/images/aula/loc_white.png',
'press' => get_stylesheet_directory_uri() . '/assets/images/aula/press.png',
'map_3rd_floor' => \get_stylesheet_directory_uri() . '/assets/images/aula/map_3rd_floor.png',
'third' => \get_stylesheet_directory_uri() . '/assets/images/aula/3rd.png',
'map_2nd_floor' => \get_stylesheet_directory_uri() . '/assets/images/aula/map_2nd_floor.png',
'second' => \get_stylesheet_directory_uri() . '/assets/images/aula/2nd.png',
'map_groundfloor' => \get_stylesheet_directory_uri() . '/assets/images/aula/map_groundfloor.png',
'first' => \get_stylesheet_directory_uri() . '/assets/images/aula/1st.png',
'map_basement' => \get_stylesheet_directory_uri() . '/assets/images/aula/map_basement.png',
'basement' => \get_stylesheet_directory_uri() . '/assets/images/aula/basement.png',
'hallway' => \get_stylesheet_directory_uri() . '/assets/images/aula/hallway.png',
'food' => \get_stylesheet_directory_uri() . '/assets/images/aula/food.png',
'shop' => \get_stylesheet_directory_uri() . '/assets/images/aula/shop.png',
'loc_white' => \get_stylesheet_directory_uri() . '/assets/images/aula/loc_white.png',
'press' => \get_stylesheet_directory_uri() . '/assets/images/aula/press.png',
];

return $images;
Expand All @@ -50,10 +50,10 @@
*/
public function language_versions() {
$language_versions = [
'en_url' => get_the_permalink( pll_get_post( get_the_ID(), 'en' ) ),
'fi_url' => get_the_permalink( pll_get_post( get_the_ID(), 'fi' ) ),
'current_fi' => pll_current_language() === 'fi' ? 'active' : '',
'current_en' => pll_current_language() === 'en' ? 'active' : '',
'en_url' => \get_the_permalink( \pll_get_post( get_the_ID(), 'en' ) ),
'fi_url' => \get_the_permalink( \pll_get_post( get_the_ID(), 'fi' ) ),
'current_fi' => \pll_current_language() === 'fi' ? 'active' : '',
'current_en' => \pll_current_language() === 'en' ? 'active' : '',
];

return $language_versions;
Expand Down Expand Up @@ -87,14 +87,22 @@
$query = new WP_Query( $args );

return array_map( function ( $post ) {
$exhibition = (object) get_fields( $post->ID );
$exhibition->title = get_the_title( $post->ID );
$exhibition->image = has_post_thumbnail( $post->ID ) ? get_the_post_thumbnail_url( $post->ID, 'medium_large' ) : null;
$exhibition->upcoming = has_term( 'tulossa', 'exhibition-status', $post );
$exhibition->upcoming_text = __( 'Upcoming', 'tms-theme-vapriikki' );
$term_obj_list = get_the_terms( $post->ID, 'exhibition-status' );
$terms_string = join( '', wp_list_pluck( $term_obj_list, 'slug' ) );
$exhibition->terms_string = str_replace( [ 'tulossa', 'arkisto', 'vaihtuvat', 'pysyvat' ], '', $terms_string );
$exhibition = (object) \get_fields( $post->ID );
$exhibition->title = \get_the_title( $post->ID );
$exhibition->image = \has_post_thumbnail( $post->ID ) ? get_the_post_thumbnail_url( $post->ID, 'medium_large' ) : null;

Check warning on line 92 in models/page-lobby-display.php

View workflow job for this annotation

GitHub Actions / phpcs-check

Line exceeds 120 characters; contains 139 characters
$exhibition->upcoming = \has_term( 'tulossa', 'exhibition-status', $post );
$exhibition->upcoming_text = \__( 'Upcoming', 'tms-theme-vapriikki' );
$term_obj_list = \get_the_terms( $post->ID, 'exhibition-status' );
$terms_strings = join( '_', \wp_list_pluck( $term_obj_list, 'slug' ) );
$terms_string = str_replace( [ 'tulossa', 'arkisto', 'vaihtuvat', 'pysyvat' ], '', $terms_strings );

Check warning on line 97 in models/page-lobby-display.php

View workflow job for this annotation

GitHub Actions / phpcs-check

Line exceeds 120 characters; contains 125 characters
// Remove leading and trailing underscores
if ( str_starts_with( $terms_string, '_' ) ) {
$terms_string = substr( $terms_string, 1 );
}
if ( str_ends_with( $terms_string, '_' ) ) {
$terms_string = substr( $terms_string, 0, -1 );
}
$exhibition->terms_string = $terms_string;

Check warning on line 105 in models/page-lobby-display.php

View workflow job for this annotation

GitHub Actions / phpcs-check

Equals sign not aligned correctly; expected 1 space but found 2 spaces

return $exhibition;

Expand Down
Loading
Loading