Skip to content

Commit

Permalink
Merge pull request #733 from templaza/v3
Browse files Browse the repository at this point in the history
v3.1.1
  • Loading branch information
sonvnn authored Jul 25, 2024
2 parents 5ef54b8 + a8ba7d7 commit f9fc6bb
Show file tree
Hide file tree
Showing 47 changed files with 465 additions and 88 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* Bootstrap 5 Compatible
* Built for Joomla 4 and Joomla 5
* Drag and Drop Layout Builder
* Article Layout Builder
* Sub-layouts Builder
* Advanced Responsive Control
* Advanced Mega Menu
* Off-Canvas Menu
Expand Down Expand Up @@ -48,6 +50,11 @@
* Slideshow Widget
* Text Widget
* Video Button Widget
* Video Widget
* FormBuilder Wiget
* List Widget
* Testimonials Widget
* Map Widget

## Requirements
* Joomla: 4.x, 5.x
Expand Down
2 changes: 1 addition & 1 deletion assets/json/article_layouts/default.json

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion assets/vendor/astroid/scss/utilities/_carousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,22 @@
content: "\f053";
}
}
&.nav-outside {
.slick-next {
right: auto;
left: 100%;
}
.slick-prev {
left: auto;
right: 100%;
}
}

.slick-dots {
display: block;
width: 100%;
padding: 0;
margin: 10px 0 0;
margin: 10px -6px 0;
list-style: none;
text-align: center;
li {
Expand Down
8 changes: 0 additions & 8 deletions assets/vendor/selectsublayout/dist/.vite/manifest.json

This file was deleted.

2 changes: 1 addition & 1 deletion astroid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<libraryname>astroid</libraryname>
<author>Astroid Framework Team</author>
<creationDate>July 2024</creationDate>
<version>3.1.0</version>
<version>3.1.1</version>
<url>https://astroidframe.work/</url>
<copyright>Copyright (C) 2024 TemPlaza, Inc. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
Expand Down
4 changes: 2 additions & 2 deletions astroid_framework.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<updates>
<update>
<name>Astroid Framework</name>
<version>3.1.0</version>
<version>3.1.1</version>
<infourl title="Astroid Framework">https://astroidframe.work/</infourl>
<element>astroid</element>
<type>library</type>
<client>0</client>
<downloads>
<downloadurl type="full" format="zip">https://github.com/templaza/astroid-framework/releases/download/v3.1.0/astroid-framework-3.1.0.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/templaza/astroid-framework/releases/download/v3.1.1/astroid-framework-3.1.1.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down
3 changes: 2 additions & 1 deletion framework/elements/article_content/article_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
extract($displayData);
$item = $options['article'];
if ($item->article->params->get('access-view')) {
$item->render('');
$position = $params->get('position', 'above-title');
$item->render($position);
}
13 changes: 12 additions & 1 deletion framework/elements/article_content/article_content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@
<icon>fa-solid fa-photo-film</icon>
<category>ASTROID_ELEMENT_CATEGORY_SYSTEM</category>
<element_type>article</element_type>
<multiple>false</multiple>
<multiple>true</multiple>
<form>
<fields>
<fieldset name="general-settings" label="TPL_ASTROID_GENERAL_SETTINGS_LABEL" addfieldpath="/libraries/astroid/framework/fields">
<field astroidgroup="general" type="astroidlist" name="position" label="ASTROID_POSITION" default="above-title">
<option value="above-title">ASTROID_ARTICLE_POSTION_ABOVE_TITLE</option>
<option value="before-content">ASTROID_ARTICLE_POSTION_BEFORE_CONTENT</option>
<option value="after-content">ASTROID_ARTICLE_POSTION_AFTER_CONTENT</option>
</field>
</fieldset>
</fields>
</form>
</element>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
defined('_JEXEC') or die;
extract($displayData);
$item = $options['article'];
if ($item->other_params->get('show_page_heading')) {
if (isset($item->other_params) && $item->other_params->get('show_page_heading')) {
echo '<h1>'.$item->other_params->get('page_heading').'</h1>';
}
2 changes: 1 addition & 1 deletion framework/elements/formbuilder/formbuilder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
<option value="number">Number</option>
</field>
<field type="astroidtext" name="field_label" label="ASTROID_WIDGET_FORM_FIELDLABEL_LABEL"/>
<field type="astroidtext" name="field_name" label="ASTROID_WIDGET_FORM_FIELDNAME_LABEL" description="COM_TZ_PORTFOLIO_PLUS_FORMBUILDER_FIELDNAME_DESC" />
<field type="astroidtext" name="field_name" label="ASTROID_WIDGET_FORM_FIELDNAME_LABEL" description="ASTROID_WIDGET_FORM_FIELDNAME_DESC" />
<field type="astroidtext" ngShow="[type]=='text' OR [type]=='email' OR [type]=='phone' OR [type]=='textarea'" name="field_placeholder" label="ASTROID_WIDGET_FORM_FIELDPLACEHOLDER_LABEL" />
<field type="astroidtext" name="field_min" label="ASTROID_WIDGET_FORM_FIELDMIN_LABEL" ngShow="[type]=='range' OR [type]=='number'" />
<field type="astroidtext" name="field_max" label="ASTROID_WIDGET_FORM_FIELDMAX_LABEL" ngShow="[type]=='range' OR [type]=='number'" />
Expand Down
3 changes: 2 additions & 1 deletion framework/elements/grid/grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
$min_height = $params->get('min_height', 0);
$overlay_type = $params->get('overlay_type', '');
$enable_grid_match = $params->get('enable_grid_match', 0);
$vertical_middle = $params->get('vertical_middle', 0);

$box_shadow = $params->get('card_box_shadow', '');
$box_shadow = $box_shadow ? ' ' . $box_shadow : '';
Expand Down Expand Up @@ -180,7 +181,7 @@

echo '<div id="grid-'. $grid -> id .'" class="as-grid"><div class="card' . $card_style . $box_shadow . $box_shadow_hover .$bd_radius . $card_hover_transition . ($enable_grid_match ? ' h-100' : '') . '">';
if ($media_position == 'left' || $media_position == 'right') {
echo '<div class="row g-0">';
echo '<div class="row g-0'.($vertical_middle ? ' align-items-center' : '').'">';
echo '<div class="'.$media_width_cls.'">';
}
if ($media_position != 'inside') {
Expand Down
1 change: 1 addition & 0 deletions framework/elements/grid/grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@
<option value="5">5/12</option>
<option value="7">7/12</option>
</field>
<field astroidgroup="card_options" ngShow="[media_position]=='left' OR [media_position]=='right'" name="vertical_middle" type="astroidradio" astroid-switch="true" default="0" label="ASTROID_WIDGET_VERTICAL_MIDDLE"/>
<field astroidgroup="card_options" name="enable_grid_match" type="astroidradio" astroid-switch="true" default="0" label="ASTROID_WIDGET_ENABLE_GRID_MATCH"/>
<field astroidgroup="card_options" name="card_hover_transition" type="astroidlist" label="ASTROID_WIDGET_HOVER_TRANSITION_LABEL" default="">
<option value="">TPL_ASTROID_DEFAULT</option>
Expand Down
2 changes: 1 addition & 1 deletion framework/elements/list/list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<option value="list-group-flush">List Group Flush</option>
<option value="list-group-numbered">List Group Numbered</option>
</field>
<field astroidgroup="misc_options" ngShow="[list_style]=='list-description'" name="title_width" type="astroidrange" min="1" max="12" step="1" default="3" label="ASTROID_WIDGET_HEIGHT_LABEL" postfix="cols" />
<field astroidgroup="misc_options" ngShow="[list_style]=='list-description'" name="title_width" type="astroidrange" min="1" max="12" step="1" default="3" label="ASTROID_WIDGET_LIST_TITLE_WIDTH" postfix="cols" />

<field astroidgroup="title_options" name="title_html_element" type="astroidlist" label="ASTROID_WIDGET_HTML_ELEMENT_LABEL" default="h6">
<option value="h1">h1</option>
Expand Down
58 changes: 32 additions & 26 deletions framework/elements/testimonials/testimonials.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Astroid\Helper\Style;
use Astroid\Helper;

extract($displayData);
$testimonials = $params->get('testimonials', '');
Expand All @@ -28,14 +29,14 @@
$enable_slider = $params->get('enable_slider', 0);
$slider_autoplay = $params->get('slider_autoplay', 0);
$slider_nav = $params->get('slider_nav', 1);
$nav_position = $params->get('nav_position', '');
$nav_position = $nav_position !== '' ? ' ' . $nav_position : $nav_position;
$slider_dotnav = $params->get('slider_dotnav', 0);
$dot_alignment = $params->get('dot_alignment', '');
$interval = $params->get('interval', 3);
$slide_settings = array();
$slide_responsive = array();

$style = new Style('#'. $element->id);
$style_dark = new Style('#'. $element->id, 'dark');

$row_column_cls = 'row';

$xxl_column = $params->get('xxl_column', '');
Expand Down Expand Up @@ -206,12 +207,17 @@

$overlay_text_color = $params->get('overlay_text_color', '');
$overlay_text_color = $overlay_text_color !== '' ? ' ' . $overlay_text_color : '';
echo '<div class="astroid-grid '.($enable_slider ? 'astroid-slick opacity-0' : $row_column_cls).$gutter_cls.$overlay_text_color.'">';
echo '<div class="astroid-grid '.($enable_slider ? 'astroid-slick opacity-0' . $nav_position : $row_column_cls).$gutter_cls.$overlay_text_color.'">';
foreach ($testimonials as $key => $testimonial) {
$testimonial_params = Style::getSubFormParams($testimonial->params);
$media = '<div class="as-author-avatar d-inline-block position-relative overflow-hidden' . $image_border_radius . $box_shadow . $hover_effect . $transition . '">';
$media .= '<img class="' . ($avatar_position == 'left' || $avatar_position == 'right' ? 'object-fit-cover w-100 h-100 ' : '') .'" src="'. Astroid\Helper\Media::getPath() . '/' . $testimonial_params['avatar'].'" alt="'.$testimonial_params['title'].'">';
$media .= '</div>';
$testimonial_params = Helper::loadParams($testimonial->params);
$avatar = $testimonial_params->get('avatar', '');
$media = '';
if ($avatar) {
$media = '<div class="as-author-avatar d-inline-block position-relative overflow-hidden' . $image_border_radius . $box_shadow . $hover_effect . $transition . '">';
$media .= '<img class="' . ($avatar_position == 'left' || $avatar_position == 'right' ? 'object-fit-cover w-100 h-100 ' : '') .'" src="'. Astroid\Helper\Media::getPath() . '/' . $avatar .'" alt="'.$testimonial_params->get('title', '').'">';
$media .= '</div>';
}


echo '<div id="testimonial-'. $testimonial -> id .'"><div class="card' . $card_style . $box_shadow . $box_shadow_hover .$bd_radius . $card_hover_transition . ($enable_grid_match ? ' h-100' : '') . '">';
if ($avatar_position == 'left' || $avatar_position == 'right') {
Expand All @@ -231,23 +237,23 @@
if ($avatar_position == 'top') {
echo $media;
}
if (!empty($testimonial_params['message'])) {
echo '<div class="as-author-message">' . $testimonial_params['message'] . '</div>';
if (!empty($testimonial_params->get('message', ''))) {
echo '<div class="as-author-message">' . $testimonial_params->get('message', '') . '</div>';
}
if ($avatar_position == 'bottom') {
echo $media;
}
if (!empty($testimonial_params['designation']) && $designation_position == 'before') {
echo '<div class="as-author-designation">' . $testimonial_params['designation'] . '</div>';
if (!empty($testimonial_params->get('designation', '')) && $designation_position == 'before') {
echo '<div class="as-author-designation">' . $testimonial_params->get('designation', '') . '</div>';
}
if (!empty($testimonial_params['title'])) {
echo '<'.$title_html_element.' class="as-author-name">'. $testimonial_params['title'] . '</'.$title_html_element.'>';
if (!empty($testimonial_params->get('title', ''))) {
echo '<'.$title_html_element.' class="as-author-name">'. $testimonial_params->get('title', '') . '</'.$title_html_element.'>';
}
if (!empty($testimonial_params['designation']) && $designation_position == 'after') {
echo '<div class="as-author-designation">' . $testimonial_params['designation'] . '</div>';
if (!empty($testimonial_params->get('designation', '')) && $designation_position == 'after') {
echo '<div class="as-author-designation">' . $testimonial_params->get('designation', '') . '</div>';
}
if (!empty($testimonial_params['link']) && !empty($testimonial_params['link_title'])) {
echo '<a class="as-author-url" href="'.$testimonial_params['link'].'" target="_blank">' . $testimonial_params['link_title'] . '</a>';
if (!empty($testimonial_params->get('link', '')) && !empty($testimonial_params->get('link_title', ''))) {
echo '<a class="as-author-url" href="'.$testimonial_params->get('link', '').'" target="_blank">' . $testimonial_params->get('link_title', '') . '</a>';
}

echo '</div>'; // End Card-Body
Expand All @@ -269,39 +275,39 @@
echo '<script type="text/javascript">jQuery(document).ready(function(){jQuery(\'#'.$element->id.' .astroid-slick\').slick({'.implode(',', $slide_settings).'})});</script>';
}

$style->child('.astroid-icon')->addCss('font-size', $icon_size.'px');
if ($params->get('card_size', '') == 'custom') {
$card_padding = $params->get('card_padding', '');
if (!empty($card_padding)) {
$padding = \json_decode($card_padding, false);
foreach ($padding as $device => $props) {
$style->child('.card-size-custom')->addStyle(Style::spacingValue($props, "padding"), $device);
$element->style->child('.card-size-custom')->addStyle(Style::spacingValue($props, "padding"), $device);
}
}
}
if (!empty($image_max_width)) {
$style->child('.as-author-avatar > img')->addCss('max-width', $image_max_width . 'px');
$element->style->child('.as-author-avatar > img')->addCss('max-width', $image_max_width . 'px');
}
if (!empty($title_heading_margin)) {
$margin = \json_decode($title_heading_margin, false);
foreach ($margin as $device => $props) {
$style->child('.as-author-name')->addStyle(Style::spacingValue($props, "margin"), $device);
$element->style->child('.as-author-name')->addStyle(Style::spacingValue($props, "margin"), $device);
}
}
if (!empty($designation_heading_margin)) {
$margin = \json_decode($designation_heading_margin, false);
foreach ($margin as $device => $props) {
$style->child('.as-author-designation')->addStyle(Style::spacingValue($props, "margin"), $device);
$element->style->child('.as-author-designation')->addStyle(Style::spacingValue($props, "margin"), $device);
}
}
if (!empty($content_margin)) {
$margin = \json_decode($content_margin, false);
foreach ($margin as $device => $props) {
$style->child('.as-author-message')->addStyle(Style::spacingValue($props, "margin"), $device);
$element->style->child('.as-author-message')->addStyle(Style::spacingValue($props, "margin"), $device);
}
}
if (!empty($image_border)) {
Style::addBorderStyle('#'. $element->id . ' .as-author-avatar', $image_border);
}
$style->render();
$style_dark->render();
if (!empty($dot_alignment)) {
$element->style->child('.astroid-slick .slick-dots')->addCss('text-align', $dot_alignment);
}
10 changes: 10 additions & 0 deletions framework/elements/testimonials/testimonials.xml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,17 @@
<field astroidgroup="slider_options" ngShow="[enable_slider]==1" name="slider_autoplay" type="astroidradio" astroid-switch="true" default="0" label="ASTROID_WIDGET_AUTOPLAY"/>
<field astroidgroup="slider_options" ngShow="[enable_slider]==1 AND [slider_autoplay]==1" name="interval" type="astroidrange" min="1" max="10" step="1" default="3" label="ASTROID_WIDGET_INTERVAL" postfix="seconds" />
<field astroidgroup="slider_options" ngShow="[enable_slider]==1" name="slider_nav" type="astroidradio" astroid-switch="true" default="1" label="ASTROID_WIDGET_NAVIGATION"/>
<field astroidgroup="slider_options" ngShow="[enable_slider]==1 AND [slider_nav]==1" type="astroidlist" name="nav_position" label="ASTROID_WIDGET_NAV_POSITION" default="">
<option value="">ASTROID_WIDGET_NAV_POSITION_INSIDE</option>
<option value="nav-outside">ASTROID_WIDGET_NAV_POSITION_OUTSIDE</option>
</field>
<field astroidgroup="slider_options" ngShow="[enable_slider]==1" name="slider_dotnav" type="astroidradio" astroid-switch="true" default="0" label="ASTROID_WIDGET_DOT_NAVIGATION"/>
<field astroidgroup="slider_options" ngShow="[enable_slider]==1 AND [slider_dotnav]==1" type="astroidlist" name="dot_alignment" label="ASTROID_WIDGET_DOT_ALIGNMENT" default="">
<option value="">JGLOBAL_INHERIT</option>
<option value="left">JGLOBAL_LEFT</option>
<option value="center">JGLOBAL_CENTER</option>
<option value="right">JGLOBAL_RIGHT</option>
</field>

<field astroidgroup="avatar_options" type="astroidlist" name="avatar_position" label="ASTROID_WIDGET_TESTIMONIALS_AVATAR_POSITION_LABEL" default="top">
<option value="top">ASTROID_TOP</option>
Expand Down
Loading

0 comments on commit f9fc6bb

Please sign in to comment.