Skip to content

Commit

Permalink
Merge pull request #684 from publishpress/features/#672_add_tabs_for_…
Browse files Browse the repository at this point in the history
…different_types_of_requirement

feature/#672_add_tabs_for_different_types_of_requirement
  • Loading branch information
richaferry authored Jul 30, 2024
2 parents 730fb56 + 03e3891 commit 1f9af47
Show file tree
Hide file tree
Showing 22 changed files with 373 additions and 55 deletions.
7 changes: 7 additions & 0 deletions core/Requirement/Approved_by.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class Approved_by extends Base_multiple implements Interface_required
*/
public $name = 'approved_by';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'content';

protected $field_name = 'roles';

const POST_META_PREFIX = 'pp_checklist_custom_item';
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Categories_count.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ class Categories_count extends Base_counter
*/
public $name = 'categories_count';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'categories';

/**
* @var int
*/
Expand Down
2 changes: 2 additions & 0 deletions core/Requirement/Custom_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Custom_item extends Base_multiple implements Interface_required
*/
protected $title;


/**
* The constructor. It adds the action to load the requirement.
*
Expand All @@ -38,6 +39,7 @@ public function __construct($name, $module, $post_type)
$this->name = trim((string)$name);
$this->is_custom = true;
$this->field_name = 'editable_by';
$this->group = 'custom';

parent::__construct($module, $post_type);
}
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/External_links.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class External_links extends Base_counter
*/
public $name = 'external_links';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'links';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Featured_image.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ class Featured_image extends Base_simple
*/
public $name = 'featured_image';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'images';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Featured_image_alt.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ class Featured_image_alt extends Base_simple
*/
public $name = 'featured_image_alt';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'images';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Filled_excerpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ class Filled_excerpt extends Base_counter
*/
public $name = 'filled_excerpt';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'content';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Image_alt.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class Image_alt extends Base_simple
*/
public $name = 'image_alt';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'images';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Internal_links.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class Internal_links extends Base_counter
*/
public $name = 'internal_links';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'links';

/**
* @var int
*/
Expand Down
1 change: 1 addition & 0 deletions core/Requirement/Openai_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function __construct($name, $module, $post_type)
$this->name = trim((string)$name);
$this->require_button = true;
$this->is_custom = false;
$this->group = 'custom';

parent::__construct($module, $post_type);

Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Prohibited_categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class Prohibited_categories extends Base_multiple
*/
public $name = 'prohibited_categories';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'categories';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Prohibited_tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class Prohibited_tags extends Base_multiple
*/
public $name = 'prohibited_tags';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'tags';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Required_categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class Required_categories extends Base_multiple
*/
public $name = 'required_categories';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'categories';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Required_tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class Required_tags extends Base_multiple
*/
public $name = 'required_tags';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'tags';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Tags_count.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ class Tags_count extends Base_counter
*/
public $name = 'tags_count';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'tags';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Title_count.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class Title_count extends Base_counter
*/
public $name = 'title_count';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'title';

public $position = 10;

/**
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Validate_links.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ class Validate_links extends Base_simple
*/
public $name = 'validate_links';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'links';

/**
* @var int
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Requirement/Words_count.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class Words_count extends Base_counter
*/
public $name = 'words_count';

/**
* The name of the group, used for the tabs
*
* @var string
*/
public $group = 'content';

/**
* @var int
*/
Expand Down
90 changes: 90 additions & 0 deletions modules/checklists/assets/css/admin-pages.css
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,94 @@ textarea.pp-checklists-custom-item-title {
.submit-top {
display: flex;
justify-content: end;
}

.pp-checklists-tabs-wrapper .pp-checklists-tabs ul {
padding-top: 0;
margin-top: 0;
}

.pp-checklists-tabs-wrapper .pp-checklists-tabs ul li a {
margin: 0;
padding: 10px;
display: block;
box-shadow: none;
text-decoration: none;
line-height: 20px !important;
border-bottom: 1px solid #eee;
}

.pp-checklists-tabs-wrapper .pp-checklists-tabs ul li {
margin: 0;
padding: 0;
display: block;
position: relative;
}

.pp-checklists-tabs-wrapper .pp-checklists-tabs ul li a.active {
color: #555;
position: relative;
background-color: #eee;
}

.pp-checklists-tabs-wrapper .pp-checklists-tabs ul li a span {
margin-right: 0.618em;
}

.pp-checklists-tabs-wrapper .pp-checklists-tabs ul li a span.dashicons {
margin-left: 0;
font-size: 15px;
vertical-align: sub;
}

.pp-checklists-tabs-wrapper .pp-checklists-tabs {
min-width: 150px;
margin: 0;
line-height: 1em;
padding: 0 0 10px;
position: relative;
background-color: #fafafa;
border-right: 1px solid #eee;
box-sizing: border-box;
}

.pp-checklists-content-wrapper {
width: 100%;
min-width: 320px;
padding: 10px;
margin-top: 0;
padding-top: 0;
}

@media only screen and (max-width: 1270px) {
.pp-checklists-content-table input[type=text],
.pp-checklists-content-table input[type=number],
.pp-checklists-content-table select{
width: 95%;
}
.pp-checklists-content-wrapper {
min-width: unset;
}
}

@media only screen and (max-width: 1100px) {
.pp-checklists-content-wrapper {
min-width: unset;
}
.pp-checklists-content-table input[type=text],
.pp-checklists-content-table input[type=number],
.pp-checklists-content-table select,
.pp-checklists-content-table textarea,
.ppma-boxes-editor-tab-content.ppma-profile_fields-tab.profile_header .input {
max-width: 95% !important;
width: 95% !important;
}
.pp-checklists-tabs-wrapper {
display: block;
}
}

.pp-checklists-tabs-wrapper {
display: flex;
background: #fff;
}
Loading

0 comments on commit 1f9af47

Please sign in to comment.