emails
2 years ago
form-fields
1 month ago
access-denied-browse-job_listings.php
4 years ago
access-denied-single-job_listing.php
3 years ago
account-signin.php
4 years ago
content-job_listing.php
2 months ago
content-no-jobs-found.php
7 years ago
content-single-job_listing-company.php
3 years ago
content-single-job_listing-meta.php
4 years ago
content-single-job_listing.php
4 years ago
content-summary-job_listing.php
2 months ago
content-widget-job_listing.php
2 months ago
content-widget-no-jobs-found.php
7 years ago
job-application-email.php
4 years ago
job-application-url.php
7 years ago
job-application.php
7 years ago
job-dashboard-login.php
7 years ago
job-dashboard-overlay.php
2 years ago
job-dashboard.php
2 years ago
job-filter-job-types.php
2 years ago
job-filters.php
2 years ago
job-listings-end.php
7 years ago
job-listings-start.php
7 years ago
job-pagination.php
7 years ago
job-preview.php
2 years ago
job-stats.php
2 months ago
job-submit.php
2 years ago
job-submitted.php
2 years ago
notice.php
2 years ago
pagination.php
6 years ago
job-dashboard.php
110 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Job dashboard shortcode content. |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/job_manager/job-dashboard.php. |
| 6 | * |
| 7 | * @see https://wpjobmanager.com/document/template-overrides/ |
| 8 | * @author Automattic |
| 9 | * @package wp-job-manager |
| 10 | * @category Template |
| 11 | * @version 2.3.0 |
| 12 | * |
| 13 | * @since 2.3.0 Switched to a responsive layout. job_manager_job_dashboard_column_{$key} action is called for all columns. |
| 14 | * @since 1.34.4 Available job actions are passed in an array (`$job_actions`, keyed by job ID) and not generated in the template. |
| 15 | * @since 1.35.0 Switched to new date functions. |
| 16 | * |
| 17 | * @var array $job_dashboard_columns Array of the columns to show on the job dashboard page. |
| 18 | * @var int $max_num_pages Maximum number of pages |
| 19 | * @var WP_Post[] $jobs Array of job post results. |
| 20 | * @var array $job_actions Array of actions available for each job. |
| 21 | * @var string $search_input Search input. |
| 22 | */ |
| 23 | |
| 24 | use WP_Job_Manager\Job_Overlay; |
| 25 | use WP_Job_Manager\UI\Notice; |
| 26 | use WP_Job_Manager\UI\UI_Elements; |
| 27 | |
| 28 | if ( ! defined( 'ABSPATH' ) ) { |
| 29 | exit; // Exit if accessed directly. |
| 30 | } |
| 31 | |
| 32 | $submit_job_form_page_id = get_option( 'job_manager_submit_job_form_page_id' ); |
| 33 | |
| 34 | ?> |
| 35 | |
| 36 | <div id="job-manager-job-dashboard" class="alignwide jm-dashboard jm-ui"> |
| 37 | <div class="jm-dashboard__intro"> |
| 38 | <div class="jm-dashboard__filters"> |
| 39 | <form method="GET" action="" class="jm-form"> |
| 40 | <div style="display: flex; gap: 12px;"> |
| 41 | <input type="search" name="search" class="jm-ui-input--search-icon" |
| 42 | placeholder="<?php esc_attr_e( 'Search', 'wp-job-manager' ); ?>" |
| 43 | value="<?php echo esc_attr( $search_input ); ?>" |
| 44 | aria-label="<?php esc_attr_e( 'Search', 'wp-job-manager' ); ?>" /> |
| 45 | </div> |
| 46 | </form> |
| 47 | </div> |
| 48 | <div class="jm-dashboard__actions"> |
| 49 | <?php if ( job_manager_user_can_submit_job_listing() ) : ?> |
| 50 | <a class="jm-ui-button" |
| 51 | href="<?php echo esc_url( get_permalink( $submit_job_form_page_id ) ); ?>"><span><?php esc_html_e( 'Add Job', 'wp-job-manager' ); ?></span></a> |
| 52 | <?php endif; ?> |
| 53 | </div> |
| 54 | </div> |
| 55 | <?php $table_class = count( $job_dashboard_columns ) > 4 ? 'jm-dashboard-table--large' : ''; ?> |
| 56 | <div class="job-manager-jobs jm-dashboard-table <?php echo esc_attr( $table_class ); ?>"> |
| 57 | <?php if ( ! $jobs ) : ?> |
| 58 | <div |
| 59 | class="jm-dashboard-empty"> |
| 60 | <?php echo Notice::dialog( |
| 61 | [ |
| 62 | 'message' => $search_input |
| 63 | // translators: Placeholder is the search term. |
| 64 | ? sprintf( __( 'No results found for "%s".', 'wp-job-manager' ), $search_input ) |
| 65 | : __( 'You do not have any active listings.', 'wp-job-manager' ) |
| 66 | ] |
| 67 | ); ?> |
| 68 | </div> |
| 69 | <?php else : ?> |
| 70 | <div class="jm-dashboard-header"> |
| 71 | <?php foreach ( $job_dashboard_columns as $key => $column ) : ?> |
| 72 | <div class="jm-dashboard-job-column jm-dashboard-job-column-label <?php echo esc_attr( $key ); ?>"> |
| 73 | <?php echo esc_html( $column ); ?> |
| 74 | </div> |
| 75 | <?php endforeach; ?> |
| 76 | <div class="jm-dashboard-job-column jm-dashboard-job-column-label actions"> |
| 77 | <?php esc_html_e( 'Actions', 'wp-job-manager' ); ?> |
| 78 | </div> |
| 79 | </div> |
| 80 | <div class="jm-dashboard-rows"> |
| 81 | <?php foreach ( $jobs as $job ) : ?> |
| 82 | <div class="jm-dashboard-job"> |
| 83 | <?php foreach ( $job_dashboard_columns as $key => $column ) : ?> |
| 84 | <div class="jm-dashboard-job-column <?php echo esc_attr( $key ); ?>" |
| 85 | aria-label="<?php echo esc_attr( $column ); ?>"> |
| 86 | <div class="jm-dashboard-job-column-label"><?php echo esc_html( $column ); ?></div> |
| 87 | <?php do_action( 'job_manager_job_dashboard_column_' . $key, $job ); ?> |
| 88 | </div> |
| 89 | <?php endforeach; ?> |
| 90 | <div class="jm-dashboard-job-column actions job-dashboard-job-actions"> |
| 91 | <?php do_action( 'job_manager_job_dashboard_column_actions', $job, $job_actions[ $job->ID ] ?? [] ); ?> |
| 92 | <?php |
| 93 | $actions_html = ''; |
| 94 | if ( ! empty( $job_actions[ $job->ID ] ) ) { |
| 95 | foreach ( $job_actions[ $job->ID ] as $action ) { |
| 96 | $actions_html .= '<a href="' . esc_url( $action['url'] ) . '" class=" jm-dashboard-action jm-ui-button--link job-dashboard-action-' . esc_attr( $action['name'] ) . '">' . esc_html( $action['label'] ) . '</a>' . "\n"; |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | echo UI_Elements::actions_menu( $actions_html ); |
| 101 | ?> |
| 102 | </div> |
| 103 | </div> |
| 104 | <?php endforeach; ?> |
| 105 | </div> |
| 106 | <?php endif; ?> |
| 107 | </div> |
| 108 | <?php get_job_manager_template( 'pagination.php', [ 'max_num_pages' => $max_num_pages ] ); ?> |
| 109 | </div> |
| 110 |