Skip to content

Commit

Permalink
Merge branch 'TMS-1070' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
eebbi committed Oct 31, 2024
2 parents 2df6c5f + fb08871 commit d3149a4
Show file tree
Hide file tree
Showing 12 changed files with 299 additions and 95 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]

- TMS-1062: Increase menu-dropdown button size
- 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

## [1.3.8] - 2024-08-21
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 @@ class PageLobbyDisplay extends BaseModel {
* @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 font() {
*/
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 lobby_images() {
*/
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 @@ public function lobby_exhibitions() {
$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

0 comments on commit d3149a4

Please sign in to comment.