Skip to content

Commit

Permalink
Merge pull request #2713 from QuizandSurveyMaster/CU-86cx0597x-qsm-te…
Browse files Browse the repository at this point in the history
…n-result-page-template

Updated css and button related issue
  • Loading branch information
zubairraeen authored Nov 27, 2024
2 parents 6db32fb + 140d47d commit e16f476
Show file tree
Hide file tree
Showing 23 changed files with 174 additions and 112 deletions.
1 change: 1 addition & 0 deletions assets/arrow-down-s-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/arrow-up-down-fill.png
Binary file not shown.
1 change: 1 addition & 0 deletions assets/arrow-up-down-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/arrow-up-s-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/copy.png
Binary file not shown.
1 change: 1 addition & 0 deletions assets/copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/edit-pencil.png
Binary file not shown.
1 change: 1 addition & 0 deletions assets/edit-pencil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/gear.png
Binary file not shown.
1 change: 1 addition & 0 deletions assets/gear.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/mind-map.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/trash.png
Binary file not shown.
1 change: 1 addition & 0 deletions assets/trash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 changes: 80 additions & 35 deletions css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@ span.qsm-quiz-name {
padding: 15px;
min-width: 60%;
}
.results-page-show input[type="text"], .email-show input[type="text"],
.results-page-show input[type="url"], .email-show input[type="url"],
.results-page-show input[type="email"], .email-show input[type="email"] {
max-width: 25rem;
}
.results-page-when, .qsm-email-when {
margin-right: 15px;
border-right: 1px solid #dfd4d4;
Expand Down Expand Up @@ -552,18 +557,21 @@ span.qsm-quiz-name {
.qsm_tab_content .results-page-condition .qsm-result-condition-container input[type="text"],
.email-condition select,
.qsm_tab_content .email-condition .qsm-email-condition-container input[type="text"],
.results-page-show .qsm-result-page-common-section select,
.results-page-show .qsm-result-page-common-section input[type="text"],
.qsm_tab_content .results-page-show .qsm-result-page-common-section select,
.qsm_tab_content .results-page-show .qsm-result-page-common-section input[type="text"],
.qsm-email-content .qsm-email-page-common-section select,
.qsm-email-content .qsm-email-page-common-section input[type="text"]
{
.qsm-email-content .qsm-email-page-common-section input[type="text"],
.qsm-email-content .qsm-email-page-common-section input[type="email"] {
min-width: auto;
width: 100%;
border-radius: 5px;
border-color: #ccc;
border-color: #555555;
padding-top: 2px;
padding-bottom: 2px;
}
.results-page-show .mce-path.mce-flow-layout-item.mce-first{
display: none;
}
.results-page-condition .qsm-result-condition-container, .email-condition .qsm-email-condition-container, .qsm-result-condition-mode, .qsm-email-condition-mode {
display: flex;
flex-wrap: wrap;
Expand All @@ -584,6 +592,11 @@ span.qsm-quiz-name {
.results-page-content label, .results-page-content p, .qsm-email-content label, .qsm-email-content p {
color: #1E1E1E;
}
.qsm-common-svg-image-class {
height: 18px;
padding: 2px;
vertical-align: -webkit-baseline-middle;
}

.delete-condition-button {
background: none;
Expand All @@ -607,7 +620,7 @@ span.qsm-quiz-name {
.qsm_tab_content input[type="text"].qsm-email-subject,
.qsm_tab_content input[type="text"].results-page-redirect{
border-radius: 3px;
border-color: #8C8FAC;
border-color: #555555;
}
@media screen and (min-width: 760px) {
.results-page-content, .qsm-email-content {
Expand Down Expand Up @@ -2864,16 +2877,16 @@ input#duplicate_questions {
flex-wrap: nowrap;
border-radius: 5px;
margin: 0 5px;
border: 1px solid #dfd4d4;
border: 1px solid #1E1E1E;
}
.qsm-actions-link-box a:first-child {
border-radius: 5px 0 0 5px;
}
.qsm-actions-link-box a:last-child {
.qsm-actions-link-box a:last-child, .qsm-template-btn-group .qsm-actions-link-box a:last-child {
border-radius: 0 5px 5px 0;
}
.qsm-actions-link-box a {
padding: 4px 8px;
padding: 0 6px 4px 6px;
color: #3c434a;
cursor: pointer;
}
Expand All @@ -2888,18 +2901,16 @@ input#duplicate_questions {
.qsm-actions-link-box a:not(:first-child) {
border-left: 1px solid #d6d6d6;
}
a.qsm-toggle-result-page-button, a.qsm-toggle-email-template-button {
height: 35px;
display: flex;
align-items: center;
justify-content: center;
}
.qsm-actions-link-box a.qsm-settings-box-result-button:focus {
background-color: #ebf4fc;
}
.results-page-when .qsm-new-condition, .qsm-email-when .qsm-new-condition{
width: 121px;
font-weight: 600;
.results-page-when .qsm-new-condition, .qsm-email-when .qsm-new-condition,
.results-page-when .qsm-new-condition:active, .qsm-email-when .qsm-new-condition:active,
.results-page-when .qsm-new-condition:focus, .qsm-email-when .qsm-new-condition:focus {
width: auto;
padding: 0;
color: #2271B1;
font-size: 14px;
}
.qsm-actions-link-box a span {
font-size: 16px;
Expand Down Expand Up @@ -3011,6 +3022,9 @@ a.qsm-toggle-result-page-button, a.qsm-toggle-email-template-button {
box-sizing: border-box;
text-decoration: none;
}
.contact-form-builder-wrap a img{
vertical-align: -webkit-baseline-middle;
}
.contact-tab-content {
width: 750px;
max-width: 65%;
Expand Down Expand Up @@ -3795,29 +3809,35 @@ input#preferred-date-format-custom {
}
/* Extra shortcodes popup */
button.button.qsm-extra-shortcode-popup {
display: flex;
display: inline-flex;
align-items: center;
position: relative;
top: 30px;
left: 197px;
z-index: 10;
}

button.button.qsm-slashcommand-variables-button .qsm-slash-inside {
margin: 0 4px 0 -1px;
font-weight: 1000;
button.button.qsm-extra-shortcode-popup span.dashicons.dashicons-shortcode {
margin-right: 4px;
}

@media screen and (max-width: 782px) {
button.button.qsm-extra-shortcode-resultpage-button {
display: flex;
align-items: center;
position: relative;
top: 3px;
left: 0px;
z-index: 10;
}
.results-page-show .wp-media-buttons button.button {
border: 1px solid #2271B1;
font-weight: 500;
}

.qsm-quiz-result-tab button.add-new-page,
.qsm-quiz-email-tab button.add-new-email {
border: 1px solid #2271B1;
font-weight: 500;
}

.qsm-extra-shortcode-conditional-button img.qsm-common-svg-image-class {
vertical-align: text-top;
padding: 0 1px 0 0;
}

.contact-form-actions .contact-form-actions-box a.disabled {
opacity: 0.5;
}

@media screen and (max-width: 782px) {
.qsm-email-condition-container-inner, .qsm-result-condition-container-inner {
width: 100%;
}
Expand Down Expand Up @@ -3849,6 +3869,31 @@ button.button.qsm-slashcommand-variables-button .qsm-slash-inside {
width: calc(100% - 85px);
margin-left: 15px;
}
.qsm-result-page-content-buttons {
margin-top: 5px;
}

.results-page-show .qsm-result-page-content-buttons button.button:not(:first-child) {
margin-left: 7px;
}

.results-page-show .qsm-result-page-content-buttons button.button {
border-color: #2271B1;
font-weight: 500;
}
.results-page-show .quicktags-toolbar input[type="button"]{
border-color: #2271B1;
}
span.qsm-insert-template-variable-text {
line-height: 2;
margin-left: 7px;
color: #1E1E1E;
}

.qsm-quiz-result-tab p.qsm-result-redirect-text {
margin-bottom: 5px;
margin-top: 20px;
}

.qsm_page_mlw_quiz_results .widefat tbody td input[type="checkbox"],
.qsm_page_mlw_quiz_results .widefat thead th input[type="checkbox"] {
Expand Down
48 changes: 28 additions & 20 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1961,9 +1961,6 @@ var QSMContact;
event.preventDefault();
$(this).closest('.qsm-email').remove();
});
jQuery(document).on('click', '.qsm-toggle-email-template-button', function () {
jQuery(this).closest("header").next("main").slideToggle();
});
$('#qsm_emails').on('click', '.delete-condition-button', function (event) {
event.preventDefault();
let $parent = $(this).parents('.qsm-email-when');
Expand Down Expand Up @@ -4228,8 +4225,8 @@ var QSM_Quiz_Broadcast_Channel;
wp.editor.initialize('results-page-' + QSMAdminResults.total, settings);
jQuery(document).trigger('qsm_after_add_result_block', [conditions, page, redirect, QSMAdminResults.total, singlePage]);
const $resultsPage = jQuery(`#results-page-${QSMAdminResults.total}`).closest('.results-page-show');
const $slashCommandButton = $resultsPage.find('.qsm-slashcommand-variables-button');
$resultsPage.find('.wp-media-buttons .insert-media').after($slashCommandButton);
const $conditionalButton = $resultsPage.find('.qsm-extra-shortcode-conditional-button');
$resultsPage.find('.wp-media-buttons .insert-media').after($conditionalButton);
},
newResultsPage: function () {
var conditions = [{
Expand Down Expand Up @@ -4289,24 +4286,35 @@ var QSM_Quiz_Broadcast_Channel;
console.log($parent);
$(this).closest('.results-page-condition').remove();
QSMAdminResults.updateResultConditonCount($parent);
});
jQuery(document).on('click', '.qsm-toggle-result-page-button', function () {
jQuery(this).closest("header").next("main").slideToggle();
jQuery(this).find('.dashicons-arrow-up-alt2, .dashicons-arrow-down-alt2').toggleClass('dashicons-arrow-up-alt2 dashicons-arrow-down-alt2');
});
jQuery(document).on('click', '.qsm-settings-box-result-button', function () {
jQuery('.qsm-settings-box-details').not(jQuery(this).parents('.qsm-template-btn-group').find('.qsm-settings-box-details')).hide();
jQuery(this).parents('.qsm-template-btn-group').find('.qsm-settings-box-details').toggle();
});
jQuery(document).on('click', function (e) {
// Check if the click was outside .qsm-template-btn-group
if (!jQuery(e.target).closest('.qsm-template-btn-group').length) {
jQuery('.qsm-settings-box-details').hide();
}
});
});
});
}
}

jQuery(document).on('click', '.qsm-toggle-result-page-button, .qsm-toggle-email-template-button', function () {
jQuery(this).closest("header").next("main").slideToggle();
let $img = jQuery(this).find('img');
let currentSrc = $img.attr('src');
let arrowUpImage = qsm_admin_messages.arrow_up_image;
let arrowDownImage = qsm_admin_messages.arrow_down_image;

// Toggle the image
if (currentSrc === arrowUpImage) {
$img.attr('src', arrowDownImage);
} else {
$img.attr('src', arrowUpImage);
}
});
jQuery(document).on('click', '.qsm-settings-box-result-button', function () {
jQuery('.qsm-settings-box-details').not(jQuery(this).parents('.qsm-template-btn-group').find('.qsm-settings-box-details')).hide();
jQuery(this).parents('.qsm-template-btn-group').find('.qsm-settings-box-details').toggle();
});
jQuery(document).on('click', function (e) {
// Check if the click was outside .qsm-template-btn-group
if (!jQuery(e.target).closest('.qsm-template-btn-group').length) {
jQuery('.qsm-settings-box-details').hide();
}
});

$(document).on('click', '.qsm_global_settings .qsm-generate-api-key', function (event) {
event.preventDefault();
Expand Down
2 changes: 2 additions & 0 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ public function qsm_admin_scripts_style( $hook ) {
'select_all' => __("Select All", 'quiz-master-next'),
'select' => __("Select", 'quiz-master-next'),
'qsmQuizzesObject' => $qsm_quizzes,
'arrow_up_image' => esc_url(QSM_PLUGIN_URL . 'assets/arrow-up-s-line.svg'),
'arrow_down_image' => esc_url(QSM_PLUGIN_URL . 'assets/arrow-down-s-line.svg'),
);
$qsm_admin_messages = apply_filters( 'qsm_admin_messages_after', $qsm_admin_messages );
wp_localize_script( 'qsm_admin_js', 'qsm_admin_messages', $qsm_admin_messages );
Expand Down
22 changes: 11 additions & 11 deletions php/admin/admin-results-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ function qsm_results_overview_tab_content() {
global $wpdb;
global $mlwQuizMasterNext;
wp_enqueue_style( 'qsm_result_page_style', plugins_url( '../css/qsm-admin.css', __FILE__ ), array(), $mlwQuizMasterNext->version );
wp_enqueue_script( 'qsm_result_page_script', plugins_url( 'js/qsm-admin.js', __FILE__ ), array( 'jquery'), $mlwQuizMasterNext->version );
wp_enqueue_script( 'qsm_result_page_script', plugins_url( 'js/qsm-admin.js', __FILE__ ), array( 'jquery' ), $mlwQuizMasterNext->version );
wp_localize_script( 'qsm_result_page_script', 'qsm_result_page', array(
'delete_confirm' => esc_html__( 'Are you sure you want to delete?', 'quiz-master-next' ),
'delete_alert' => esc_html__( 'Please select a valid bulk action.', 'quiz-master-next' ),
'delete_confirm' => esc_html__( 'Are you sure you want to delete?', 'quiz-master-next' ),
'delete_alert' => esc_html__( 'Please select a valid bulk action.', 'quiz-master-next' ),
));
// If nonce is correct, delete results.
if ( isset( $_POST['delete_results_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['delete_results_nonce'] ) ), 'delete_results' ) ) {
Expand Down Expand Up @@ -654,8 +654,8 @@ function qsm_export_results_tabs_content() {
"upgrade_link" => qsm_get_plugin_link( 'pricing', 'result_page', 'export_results', 'result-exportresults-upsell_upgrade', 'qsm_plugin_upsell' ),
"addon_link" => qsm_get_plugin_link( 'downloads/export-results', 'result_page', 'export_results', 'result-exportresults-upsell_buy_addon', 'qsm_plugin_upsell' ),
"benefits" => array(
'briefing' => '',
'list_items' => array(
'briefing' => '',
'list_items' => array(
__( 'Export quiz results to CSV for detailed analysis.', 'quiz-master-next' ),
__( 'Generate personalized PDF reports for users.', 'quiz-master-next' ),
__( 'Filter exports by quizzes, dates, or data fields.', 'quiz-master-next' ),
Expand All @@ -666,8 +666,8 @@ function qsm_export_results_tabs_content() {
),
),
"use_cases" => array(
'briefing' => '',
'list_items' => array(
'briefing' => '',
'list_items' => array(
__( 'Track student performance in educational settings.', 'quiz-master-next' ),
__( 'Measure training effectiveness for employees.', 'quiz-master-next' ),
__( 'Gather insights from consumer surveys.', 'quiz-master-next' ),
Expand Down Expand Up @@ -708,8 +708,8 @@ function qsm_proctor_quiz_tabs_content() {
"upgrade_link" => qsm_get_plugin_link( 'pricing', 'quiz-documentation', 'plugin', 'quiz-proctor', 'qsm_plugin_upsell' ),
"addon_link" => qsm_get_plugin_link( 'downloads/quiz-proctor', 'quiz-documentation', 'plugin', 'quiz-proctor', 'qsm_plugin_upsell' ),
"benefits" => array(
'briefing' => '',
'list_items' => array(
'briefing' => '',
'list_items' => array(
__( 'Provides feedback using violation reports.', 'quiz-master-next' ),
__( 'Ensures fair results with controlled retakes.', 'quiz-master-next' ),
__( 'Improves quiz design by analyzing violations.', 'quiz-master-next' ),
Expand All @@ -718,8 +718,8 @@ function qsm_proctor_quiz_tabs_content() {
),
),
"use_cases" => array(
'briefing' => '',
'list_items' => array(
'briefing' => '',
'list_items' => array(
__( 'Ensures fair testing in online exams.', 'quiz-master-next' ),
__( 'Validates employee training assessments.', 'quiz-master-next' ),
__( 'Maintains credibility in certification tests.', 'quiz-master-next' ),
Expand Down
Loading

0 comments on commit e16f476

Please sign in to comment.