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

added layout 4 #146

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
134 changes: 133 additions & 1 deletion assets/css/import-eventbrite-events.css
Original file line number Diff line number Diff line change
Expand Up @@ -1070,4 +1070,136 @@
font-size: 12px;
width: calc( 100% - 55px );
}
}
}

/*new layout style 4 start*/

.iee-style4-main-div{
margin: 10px 0;
}
.iee-style4-main-div > div {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #fff;
border: 5px solid #f5f6f6;
padding: 0 5px 0 10px;
transition: all 500ms ease;
z-index: 1;
}

.iee-style4-main-div > div::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0.1;
transition: transform 0.5s ease, opacity 0.1s ease;
transform-origin: bottom right;
transform: scale(1, 0);
z-index: -1;
}

.iee-style4-main-div > div:hover::before {
transform: scale(1, 1);
transform-origin: top center;
opacity: 0.1;
}

.iee-style4-main-div > div + div {
margin-top: 30px;
}

.iee-style4-event-box .iee-style4-te-title {
font-size: 24px;
font-weight: 600;
line-height: 34px;
}

.iee-style4-event-box .iee-style4-te-meta {
font-size: 14px;
letter-spacing: 0.1em;
}

.iee-style4-event-dt {
position: relative;
display: block;
}

.iee-style4-event-dt .iee-style4-te-title {
font-size: 24px;
font-weight: 600;
line-height: 34px;
}

.iee-style4-event-dt .iee-style4-te-meta {
font-size: 14px;
letter-spacing: 0.1em;
display: flex;
align-items: center;
gap: 5px;
}

.iee-style4-event-image-img {
width: 125px;
height: 125px;
margin: 10px 0;
}

.iee-style4-event-image-img img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
}

.iee-style4-child-div {
display: flex;
justify-content: space-between;
width: 100%;
padding: 10px;
}

.iee-style4-event-box {
flex: 0 0 70%;
padding: 0 0 0 15px;
}

.iee-style4-event-dt {
flex: 0 0 18%;
padding-right: 10px;
}

.iee-style4-event-image {
flex: 0 0 12%;
display: flex;
align-items: center;
justify-content: center;
}

@media only screen and ( min-width: 768px ) and ( max-width: 1200px ) {
.iee-style4-main-div > div {
flex-direction: column;
text-align: center;
gap: 10px;
padding: 10px 0;
}
}
@media only screen and ( min-width: 1199px ) and ( max-width: 1400px ) {
.iee-style4-main-div > div {
padding: 10px 15px 10px;
}
}
@media only screen and ( max-width: 767px ) {
.iee-style4-main-div > div {
flex-direction: column;
text-align: center;
padding: 10px 0;
gap: 10px;
}
}

/*new layout style 4 start*/
5 changes: 5 additions & 0 deletions includes/class-import-eventbrite-events-cpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,8 @@ public function eventbrite_events_archive( $atts = array() ) {

if( isset( $atts['layout'] ) && $atts['layout'] == 'style2' && iee_is_pro() ){
get_iee_template( 'iee-archive-content2.php', $template_args );
}elseif( isset( $atts['layout'] ) && $atts['layout'] == 'style4' && iee_is_pro() ){
get_iee_template( 'iee-archive-content4.php', $template_args );
}else{
get_iee_template( 'iee-archive-content.php', $template_args );
}
Expand Down Expand Up @@ -856,6 +858,9 @@ public function eventbrite_events_archive( $atts = array() ) {
.iee_archive .iee_event .event_desc .event_title{
color: <?php echo esc_attr( $accent_color ); ?>;
}
.iee-style4-main-div > div::before {
background-color: <?php echo esc_attr( $accent_color ); ?>;
}
</style>
<?php
do_action( 'iee_after_event_list', $eventbrite_events );
Expand Down
38 changes: 7 additions & 31 deletions languages/import-eventbrite-events.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GPL-2.0+.
msgid ""
msgstr ""
"Project-Id-Version: Import Eventbrite Events 1.7.2\n"
"Project-Id-Version: Import Eventbrite Events 1.7.3\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/import-eventbrite-events\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-09-05T10:43:24+00:00\n"
"POT-Creation-Date: 2024-10-21T07:39:02+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: import-eventbrite-events\n"
Expand Down Expand Up @@ -827,7 +827,7 @@ msgstr ""
msgid "Start Date"
msgstr ""

#: includes/class-import-eventbrite-events-cpt.php:848
#: includes/class-import-eventbrite-events-cpt.php:850
msgid "There are no upcoming Events at this time."
msgstr ""

Expand Down Expand Up @@ -1327,46 +1327,22 @@ msgstr ""
msgid "Plugins you should try"
msgstr ""

#: templates/admin/import-eventbrite-events-support.php:111
#: templates/admin/import-eventbrite-events-support.php:103
msgid "Active Installs: "
msgstr ""

#: templates/admin/import-eventbrite-events-support.php:117
#: templates/admin/import-eventbrite-events-support.php:109
msgid "Actived"
msgstr ""

#: templates/admin/import-eventbrite-events-support.php:120
#: templates/admin/import-eventbrite-events-support.php:112
msgid "Activate"
msgstr ""

#: templates/admin/import-eventbrite-events-support.php:124
#: templates/admin/import-eventbrite-events-support.php:116
msgid "Install Plugin"
msgstr ""

#: templates/admin/import-eventbrite-events-support.php:129
msgid "Version:"
msgstr ""

#: templates/admin/import-eventbrite-events-support.php:134
msgid "Requires:"
msgstr ""

#: templates/admin/import-eventbrite-events-support.php:134
msgid "WordPress "
msgstr ""

#: templates/admin/import-eventbrite-events-support.php:138
msgid "Active Installs:"
msgstr ""

#: templates/admin/import-eventbrite-events-support.php:143
msgid "Install Now"
msgstr ""

#: templates/admin/import-eventbrite-events-support.php:146
msgid "Buy Now"
msgstr ""

#: templates/iee-event-meta.php:38
msgid "Details"
msgstr ""
Expand Down
87 changes: 87 additions & 0 deletions templates/iee-archive-content4.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php
/**
* Template part for displaying posts
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
global $iee_events;
$start_date_str = get_post_meta( get_the_ID(), 'start_ts', true );
$end_date_str = get_post_meta( get_the_ID(), 'end_ts', true );
$event_address = get_post_meta( get_the_ID(), 'venue_name', true );
$venue_address = get_post_meta( get_the_ID(), 'venue_address', true );

//Date-Time
$start_date_formated = date_i18n( 'F j, Y ', $start_date_str );
$start_date_ymd = date_i18n( 'd-m-Y ', $start_date_str );
if ( $venue_address != '' ) {
$event_address .= ' - ' . $venue_address;
} elseif ( $venue_address != '' ) {
$event_address = $venue_address;
}

//Get Options
$iee_options = get_option( IEE_OPTIONS );
$accent_color = isset( $iee_options['accent_color'] ) ? $iee_options['accent_color'] : '#039ED7';
$time_format = isset( $iee_options['time_format'] ) ? $iee_options['time_format'] : '12hours';

if( $time_format === '12hours' ){
$start_time = date_i18n( 'h:i A', $start_date_str );
$end_time = date_i18n( 'h:i A', $end_date_str );
}elseif($time_format === '24hours' ){
$start_time = date_i18n( 'G:i', $start_date_str );
$end_time = date_i18n( 'G:i', $end_date_str );
}else{
$start_time = date_i18n( get_option( 'time_format' ), $start_date_str );
$end_time = date_i18n( get_option( 'time_format' ), $end_date_str );
}

//Image Url
$image_url = array();
if ( '' !== get_the_post_thumbnail() ) {
$image_url = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
} else {
$image_date = date_i18n( 'd', $start_date_str );
$image_url[] = 'https://dummyimage.com/420x210/ccc/969696.png&text=' . $image_date;
}

$event_url = get_permalink();
$target = '';
if ( 'yes' === $direct_link ){
$event_url = get_post_meta( get_the_ID(), 'iee_event_link', true );
$target = 'target="_blank"';
}

if( !empty( $accent_color ) ){
$color = "color:".$accent_color.";";
}

?>

<div class="iee-style4-main-div">
<div class="iee-style4-child-div">
<div class="iee-style4-event-box">
<div class="iee-style4-te-title">
<a style="<?php echo esc_attr( $color ); ?>" <?php echo esc_attr( $target ); ?>href="<?php echo esc_url( $event_url ); ?>" >
<?php the_title(); ?>
</a>
</div>
<div class="iee-style4-te-meta"><i class="fa fa-map-marker" style="<?php echo esc_attr( $color ); ?>" ></i><?php echo esc_attr( ' '.$event_address ); ?></div>
</div>
<div class="iee-style4-event-dt">
<div class="iee-style4-te-title" style="<?php echo esc_attr( $color ); ?>" ><?php esc_html_e( 'Date - Time' ); ?></div>
<div class="iee-style4-te-meta"><i class="fa fa-calendar" style="<?php echo esc_attr( $color ); ?>"></i> <?php echo esc_attr( $start_date_ymd ); ?></div>
<div class="iee-style4-te-meta"><i class="fa fa-clock-o" style="<?php echo esc_attr( $color ); ?>"></i> <?php echo esc_attr( $start_time . ' - ' . $end_time ); ?></div>
</div>

<div class="iee-style4-event-image">
<div class="iee-style4-event-image-img">
<img src="<?php echo esc_url( $image_url[0] ); ?>" alt="">
</div>
</div>
</div>
</div>