Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Improvements #149

Open
wants to merge 5 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
18 changes: 13 additions & 5 deletions assets/stylesheets/aqpb.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ a:hover, a:active, a:focus { color: #d54e21; }
#manage-templates .add-new-template-action {
float: left;
}

#manage-templates .add-new-template-action i.fa {
margin-right: 5px;
}
#manage-templates label {
padding-right: 5px;
}
Expand Down Expand Up @@ -157,6 +159,9 @@ a:hover, a:active, a:focus { color: #d54e21; }
#page-builder .major-publishing-actions {
clear: both;
padding: 3px 0 6px;
}
#page-builder .major-publishing-actions i.fa {
margin-right: 5px;
}
#page-builder .major-publishing-actions .open-label {
color: #666;
Expand All @@ -178,11 +183,10 @@ a:hover, a:active, a:focus { color: #d54e21; }
float: left;
}
#template-shortcode input {
width: 120px;
width: 200px;
height: 2em;
}


#page-builder .publishing-action {
text-align: right;
float: right;
Expand All @@ -195,7 +199,6 @@ a:hover, a:active, a:focus { color: #d54e21; }
float: left;
padding-right: 15px;
margin-top: 6px;

}
#page-builder .delete-action .submitdelete {
display: block;
Expand All @@ -217,7 +220,6 @@ a:hover, a:active, a:focus { color: #d54e21; }
float: left;
margin: 4px 0;
line-height: 15px;
text-decoration: none;
}

/*blocks*/
Expand Down Expand Up @@ -259,6 +261,12 @@ a:hover, a:active, a:focus { color: #d54e21; }
font-weight: bold;
display: block;
margin-right: 20px;
}
#page-builder .block-title i.fa,
#blocks-archive .block-title i.fa {
margin-right: 10px;
font-size: 16px;
color: #999999;
}
#page-builder .block-title {overflow: hidden;}
.in-block-title { color: #666; }
Expand Down
1 change: 1 addition & 0 deletions blocks/aq-alert-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function __construct() {
$block_options = array(
'name' => __('Alerts', 'aqpb-l10n'),
'size' => 'span6',
'icon' => 'fa-exclamation-circle',
);

//create the block
Expand Down
1 change: 1 addition & 0 deletions blocks/aq-clear-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function __construct() {
$block_options = array(
'name' => __('Clear', 'aqpb-l10n'),
'size' => 'span12',
'icon' => 'fa-minus',
);

//create the block
Expand Down
9 changes: 6 additions & 3 deletions blocks/aq-column-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function __construct() {
$block_options = array(
'name' => __('Column', 'aqpb-l10n'),
'size' => 'span6',
'icon' => 'fa-columns',
);

//create the widget
Expand All @@ -22,13 +23,14 @@ function before_form($instance) {
extract($instance);

$title = $title ? '<span class="in-block-title"> : '.$title.'</span>' : '';
$fa_icon = $icon ? '<i class="fa '.$icon.'"></i>' : '';
$resizable = $resizable ? '' : 'not-resizable';

echo '<li id="template-block-'.$number.'" class="block block-container block-'.$id_base.' '. $size .' '.$resizable.'">',
'<dl class="block-bar">',
'<dt class="block-handle">',
'<div class="block-title">',
$name , $title,
$fa_icon, $name , $title,
'</div>',
'<span class="block-controls">',
'<a class="block-edit" id="edit-'.$number.'" title="Edit Block" href="#block-settings-'.$number.'">Edit Block</a>',
Expand All @@ -55,7 +57,8 @@ function form_callback($instance = array()) {
extract($instance);

$col_order = $order;

$self = $id_base;

//column block header
if(isset($template_id)) {
echo '<li id="template-block-'.$number.'" class="block block-container block-aq_column_block '.$size.'">',
Expand All @@ -77,7 +80,7 @@ function form_callback($instance = array()) {
//get the block object
$block = $aq_registered_blocks[$id_base];

if($parent == $col_order) {
if($parent == $col_order && ($id_base != $self) ) { // prevents self as child block
$block->form_callback($child);
}
}
Expand Down
1 change: 1 addition & 0 deletions blocks/aq-editor-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function __construct() {
$block_options = array(
'name' => __('Visual Editor', 'aqpb-l10n'),
'size' => 'span6',
'icon' => 'fa-file-text',
);

//create the block
Expand Down
1 change: 1 addition & 0 deletions blocks/aq-tabs-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function __construct() {
$block_options = array(
'name' => __('Tabs &amp; Toggles', 'aqpb-l10n'),
'size' => 'span6',
'icon' => 'fa-list-alt',
);

//create the widget
Expand Down
1 change: 1 addition & 0 deletions blocks/aq-text-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function __construct() {
$block_options = array(
'name' => __('Text', 'aqpb-l10n'),
'size' => 'span6',
'icon' => 'fa-font',
);

//create the block
Expand Down
1 change: 1 addition & 0 deletions blocks/aq-upload-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function __construct() {
$block_options = array(
'name' => __('Media', 'aqpb-l10n'),
'size' => 'span6',
'icon' => 'fa-upload', //Font awesome icon class
);

//create the block
Expand Down
1 change: 1 addition & 0 deletions blocks/aq-widgets-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function __construct() {
$block_options = array(
'name' => __('Widgets', 'aqpb-l10n'),
'size' => 'span4',
'icon' => 'fa-th-large',
);

parent::__construct('AQ_Widgets_Block', $block_options);
Expand Down
4 changes: 3 additions & 1 deletion classes/class-aq-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ function parse_block($block_options) {
'number' => '__i__', //block consecutive numbering
'first' => false, //column first
'resizable' => 1, //whether block is resizable/not
'icon' => '', //font-awesome icon class e.g: fa-cog http://fontawesome.io/icons/
);

$block_options = is_array($block_options) ? wp_parse_args($block_options, $defaults) : $defaults;
Expand All @@ -124,13 +125,14 @@ function before_form($instance) {
extract($instance);

$title = $title ? '<span class="in-block-title"> : '.$title.'</span>' : '';
$fa_icon = $icon ? '<i class=" fa '.$icon.'"></i>' : '';
$resizable = $resizable ? '' : 'not-resizable';

echo '<li id="template-block-'.$number.'" class="block block-'.$id_base.' '. $size .' '.$resizable.'">',
'<dl class="block-bar">',
'<dt class="block-handle">',
'<div class="block-title">',
$name , $title,
$fa_icon, $name , $title,
'</div>',
'<span class="block-controls">',
'<a class="block-edit" id="edit-'.$number.'" title="'. __('Edit Block', 'aqpb-l10n') .'" href="#block-settings-'.$number.'">'. __('Edit Block', 'aqpb-l10n') .'</a>',
Expand Down
5 changes: 4 additions & 1 deletion classes/class-aq-page-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ function admin_enqueue() {
// Register 'em
wp_register_style( 'aqpb-css', $this->url.'assets/stylesheets/aqpb.css', array(), time(), 'all');
wp_register_style( 'aqpb-blocks-css', $this->url.'assets/stylesheets/aqpb_blocks.css', array(), time(), 'all');
wp_register_style( 'font-awesome-css', $this->url.'assets/stylesheets/font-awesome.min.css', array(), time(), 'all');
wp_register_script('aqpb-js', $this->url . 'assets/javascripts/aqpb.js', array('jquery'), time(), true);
wp_register_script('aqpb-fields-js', $this->url . 'assets/javascripts/aqpb-fields.js', array('jquery'), time(), true);

// Enqueue 'em
wp_enqueue_style('aqpb-css');
wp_enqueue_style('aqpb-blocks-css');
wp_enqueue_style('font-awesome-css');
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-sortable');
Expand Down Expand Up @@ -705,6 +707,7 @@ function add_media_display() {
<script type="text/javascript">
function insertTemplate() {
var id = jQuery( '#select-aqpb-template' ).val();
var name = jQuery( '#select-aqpb-template' ).text();

/** Alert user if there is no template selected */
if ( '' == id ) {
Expand All @@ -713,7 +716,7 @@ function insertTemplate() {
}

/** Send shortcode to editor */
window.send_to_editor('[template id="' + id + '"]');
window.send_to_editor('[template id="' + id + '" name="' + name + '"]');
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Here are some guidelines:
Please feel free to add yourself on this list :)

* [Syamil MJ](http://aquagraphite.com) (author)
* [Saroj] (Contributor)
* [Saroj](https://github.com/sarojlakra)
10 changes: 5 additions & 5 deletions view/view-builder-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
admin_url( 'themes.php' )
));
?>
"><?php _e('Create a new template', 'aqpb-l10n') ?></a>
"><i class="fa fa-plus"></i><?php _e('Create a new template', 'aqpb-l10n') ?></a>
</span>

</form>
Expand Down Expand Up @@ -234,7 +234,7 @@
</label>

<div id="template-shortcode">
<input type="text" readonly="readonly" value='[template id="<?php echo $selected_template_id ?>"]' onclick="select()"/>
<input type="text" readonly="readonly" value='[template id="<?php echo $selected_template_id ?>" name="<?php echo is_object($selected_template_object) ? $selected_template_object->post_title : ''; ?>"]' onclick="select()"/>
</div>

<div class="publishing-action">
Expand Down Expand Up @@ -294,12 +294,12 @@
'_wpnonce' => wp_create_nonce('delete-template'),
),
admin_url( 'themes.php' )
)) . '">'. __('Delete Template', 'aqpb-l10n') .'</a>';
)) . '"><i class="fa fa-trash-o"></i>'. __('Delete Template', 'aqpb-l10n') .'</a>';
?>
</div><!-- END .delete-action -->

<div class="clone-action">
<?php
<?php
echo '<a class="submitclone cloning template-clone" href="' . esc_url(add_query_arg(
array(
'page' => $this->args['page_slug'],
Expand All @@ -309,7 +309,7 @@
'_wpnonce' => wp_create_nonce('clone-template'),
),
admin_url( 'themes.php' )
)) . '">'. __('Clone Template', 'aqpb-l10n') .'</a>';
)) . '"><i class="fa fa-copy"></i>'. __('Clone Template', 'aqpb-l10n') .'</a>';
?>
</div><!-- END .clone-action -->

Expand Down