Skip to content

Commit

Permalink
b001
Browse files Browse the repository at this point in the history
  • Loading branch information
gwin committed May 6, 2022
1 parent b28006e commit 80fce62
Show file tree
Hide file tree
Showing 12 changed files with 886 additions and 17 deletions.
61 changes: 59 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,26 @@ module.exports = function(grunt) {
updateTimestamp: true, // Whether the POT-Creation-Date should be updated without other changes.
updatePoFiles: false // Whether to update PO files in the same directory as the POT file.
}
}
},
build: {
options: {
cwd: '<%= pkg.release_path %>', // Directory of files to internationalize.
domainPath: '/languages/', // Where to save the POT file.
exclude: [], // List of files or directories to ignore.
include: [], // List of files or directories to include.
mainFile: 'wpadverts.php', // Main project file.
potComments: '', // The copyright at the beginning of the POT file.
potFilename: 'wpadverts.pot', // Name of the POT file.
potHeaders: {
poedit: true, // Includes common Poedit headers.
'x-poedit-keywordslist': true // Include a list of all possible gettext functions.
}, // Headers to add to the generated POT file.
processPot: null, // A callback function for manipulating the POT file.
type: 'wp-plugin', // Type of project (wp-plugin or wp-theme).
updateTimestamp: true, // Whether the POT-Creation-Date should be updated without other changes.
updatePoFiles: false // Whether to update PO files in the same directory as the POT file.
}
},
},
copy: {
deploy: {
Expand All @@ -34,6 +53,21 @@ module.exports = function(grunt) {
dest: "<%= pkg.svn %>/trunk/"
}
]
},
build: {
files: [
{
expand: true,
cwd: './',
src: [
'**', '!node_modules/**', '!Gruntfile.js', '!package.json', '!.gitignore', '!nbproject/**',
'!tests/**', '!bin/**', '!.phpcs.xml.dist', '!.travis.yml', '!phpunit.xml.dist',
'!blocks.webpack.js', '!package-lock.json', '!postcss.config.js', '!tailwind.config.js',
'!blocks/*/src/*.js'
],
dest: "<%= pkg.release_path %>"
}
]
}
},
checktextdomain: {
Expand Down Expand Up @@ -63,14 +97,37 @@ module.exports = function(grunt) {
expand: true
}]
}
},
compress: {
build: {
options: {
archive: '<%= pkg.release_path %>/../wpadverts.zip',
mode: 'zip'
},
files: [
{
src: './wpadverts/**',
cwd: '<%= pkg.release_path %>/../',
expand: true
}
]
}
},
clean: {
options: {
force: true
},
build: [ '<%= pkg.release_path %>' ]
}
});

grunt.loadNpmTasks('grunt-wp-i18n');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-checktextdomain');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-clean');

grunt.registerTask('test', ['checktextdomain']);
grunt.registerTask('deploy', ['checktextdomain', 'copy', 'makepot']);

grunt.registerTask('build', ['checktextdomain', 'clean:build', 'copy:build', 'makepot:build', 'compress:build']);
};
12 changes: 4 additions & 8 deletions addons/payments/payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ function adext_payments_get_template( $file, $is_block ) {
* @return null
*/
function adext_payments_action_payment_block( $content, Adverts_Form $form ) {
adext_payments_action_payment( $content, $form, true );
return adext_payments_action_payment( $content, $form, true );
}

/**
Expand Down Expand Up @@ -681,14 +681,10 @@ function adext_payments_action_payment($content, Adverts_Form $form, $is_block =
$price = get_post_meta($payment_id, '_adverts_payment_total', true);

$tpl = adext_payments_get_template( "add-payment", $is_block );
if( $is_block ) {
include $tpl;
} else {
ob_start();
include $tpl;
return ob_get_clean();
}

ob_start();
include $tpl;
return ob_get_clean();
}

/**
Expand Down
6 changes: 6 additions & 0 deletions assets/js/block-manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,10 @@ jQuery(function($) {

return false;
});

$(".wpadverts-block-manage .wpa-block-list-results > .wpa-result-item").on("click", function(e) {
window.location = $(this).find(".wpa-result-link").attr("href");
});
$(".wpadverts-block-manage .wpa-block-list-results > .wpa-result-item").addClass("atw-cursor-pointer");

});
2 changes: 1 addition & 1 deletion assets/js/wpadverts-multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jQuery(function($) {
}

label.append(checkbox).append(" ").append(jQuery("<span></span>").text(o.text()));
options.append(label);
options.hide().append(label);
});

holder.append(input).append(options);
Expand Down
2 changes: 1 addition & 1 deletion blocks/categories/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function init() {
'editor_style' => 'wpadverts-blocks-categories',
'editor_script' => $js_handler,
'render_callback' => array( $this, "render" ),
'style' => 'wpadverts-blocks-common',
'style' => 'wpadverts-blocks',
'script' => 'wpadverts-block-categories'
)
);
Expand Down
18 changes: 18 additions & 0 deletions blocks/manage/class-manage-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ public function action_list( $atts ) {
}

public function action_edit( $atts ) {

wp_enqueue_style( 'adverts-frontend' );
wp_enqueue_style( 'adverts-icons' );
wp_enqueue_style( 'adverts-icons-animate' );

wp_enqueue_script( 'adverts-frontend' );
wp_enqueue_script( 'adverts-auto-numeric' );

$params = shortcode_atts(array(
'name' => 'default',
'moderate' => false
Expand Down Expand Up @@ -335,10 +343,20 @@ public function action_edit( $atts ) {
$buttons_manage = apply_filters( "wpadverts/block/manage/buttons-manage", $buttons_manage, $post_id );
uasort( $buttons_manage, array( $this, "sort_buttons" ) );

$_layouts = array(
"adverts-form-stacked" => "wpa-layout-stacked",
"adverts-form-aligned" => "wpa-layout-aligned"
);
$form_layout = $_layouts[$form->get_layout()];

// adverts/templates/manage-edit.php
ob_start();
include dirname( __FILE__ ) . '/templates/manage-edit.php';
$result = ob_get_clean();

remove_action( "wpadverts/tpl/partial/form/before-buttons", array( $this, "moderation_notice" ) );

return $result;
}

public function moderation_notice() {
Expand Down
2 changes: 1 addition & 1 deletion blocks/manage/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function init() {
'editor_style' => 'wpadverts-blocks-manage',
'editor_script' => $js_handler,
'render_callback' => array( $this, "render" ),
'style' => 'wpadverts-blocks-common',
'style' => 'wpadverts-blocks',
'script' => 'wpadverts-block-manage'
)
);
Expand Down
2 changes: 1 addition & 1 deletion blocks/publish/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function init() {
'editor_style' => 'wpadverts-blocks-editor-publish',
'editor_script' => $js_handler,
'render_callback' => array( $this, "render" ),
'style' => 'wpadverts-blocks-common',
'style' => 'wpadverts-blocks',
'script' => 'wpadverts-block-publish'
)
);
Expand Down
Binary file added languages/wpadverts-nl_NL.mo
Binary file not shown.
Loading

0 comments on commit 80fce62

Please sign in to comment.