Skip to content

Commit

Permalink
Merge pull request #1214 from kevinwhoffman/issue/826
Browse files Browse the repository at this point in the history
Issue/826
  • Loading branch information
Devin Walker committed Nov 9, 2016
2 parents 10f17f1 + db28f1a commit 9908644
Show file tree
Hide file tree
Showing 12 changed files with 1,168 additions and 53 deletions.
67 changes: 67 additions & 0 deletions assets/css/give-admin-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -2502,3 +2502,70 @@ div.sc-shortcode {
#mce-modal-block.mce-reset.mce-fade.mce-in {
opacity: 0.7;
filter: alpha(opacity=70); }

/**
* Give System Info SCSS
*
* @description System Info Styles
* @package Give
* @subpackage SCSS/Admin
* @copyright Copyright (c) 2016, WordImpress
* @license https://opensource.org/licenses/gpl-3.0/ GNU Public License
*
* The following code is a derivative work of the code from the WooCommerce
* plugin, which is licensed GPLv3. This code therefore is also licensed under
* the terms of the GNU Public License, version 3.
*
* Copyright (c) 2015 WooThemes
* Copyright (c) 2016 WordImpress, LLC
*/
.give-status-table {
margin-bottom: 1em; }
.give-status-table h2 {
font-size: 14px;
margin: 0; }
.give-status-table tr:nth-child(2n) th,
.give-status-table tr:nth-child(2n) td {
background: #fcfcfc; }
.give-status-table th {
font-weight: 700;
padding: 9px; }
.give-status-table td:first-child {
width: 33%; }
.give-status-table td.help {
width: 1em; }
.give-status-table td {
padding: 9px;
font-size: 1.1em; }
.give-status-table td mark {
background: transparent none; }
.give-status-table td mark.yes {
color: #7ad03a; }
.give-status-table td mark.no {
color: #999; }
.give-status-table td mark.error {
color: #a00; }
.give-status-table td ul {
margin: 0; }

.wrap div.give-debug-report-wrapper {
margin-top: 1em; }

.give-debug-report {
display: none;
margin: 10px 0;
padding: 0;
position: relative; }
.give-debug-report textarea {
font-family: monospace;
width: 100%;
margin: 0;
height: 300px;
padding: 20px;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
resize: none;
font-size: 12px;
line-height: 20px;
outline: 0; }
2 changes: 1 addition & 1 deletion assets/css/give-admin-rtl.min.css

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions assets/css/give-admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/give-admin.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/scss/admin/give-admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
@import 'donors';
@import 'buttons';
@import 'shortcodes';
@import 'system-info';
98 changes: 98 additions & 0 deletions assets/scss/admin/system-info.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/**
* Give System Info SCSS
*
* @description System Info Styles
* @package Give
* @subpackage SCSS/Admin
* @copyright Copyright (c) 2016, WordImpress
* @license https://opensource.org/licenses/gpl-3.0/ GNU Public License
*
* The following code is a derivative work of the code from the WooCommerce
* plugin, which is licensed GPLv3. This code therefore is also licensed under
* the terms of the GNU Public License, version 3.
*
* Copyright (c) 2015 WooThemes
* Copyright (c) 2016 WordImpress, LLC
*/

.give-status-table {
margin-bottom: 1em;

h2 {
font-size: 14px;
margin: 0;
}

tr {
&:nth-child(2n) {
th,
td {
background: #fcfcfc;
}
}
}

th {
font-weight: 700;
padding: 9px;
}

td:first-child {
width: 33%;
}

td.help {
width: 1em;
}

td {
padding: 9px;
font-size: 1.1em;

mark {
background: transparent none;
}

mark.yes {
color: $green;
}

mark.no {
color: #999;
}

mark.error {
color: $red;
}

ul {
margin: 0;
}
}
}

.wrap div.give-debug-report-wrapper {
margin-top: 1em;
}

.give-debug-report {
display: none;
margin: 10px 0;
padding: 0;
position: relative;

textarea {
font-family: monospace;
width: 100%;
margin: 0;
height: 300px;
padding: 20px;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
resize: none;
font-size: 12px;
line-height: 20px;
outline: 0;
}
}
2 changes: 1 addition & 1 deletion assets/sourcemaps/give-admin.css.map

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions includes/admin/admin-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,18 +372,17 @@ function give_settings_page_pages( $settings ) {
*/
function give_tools_page_pages( $settings ) {
$settings = array(
// System Info.
include( 'tools/class-setting-system-info.php' ),

// Logs.
include( 'tools/class-settings-logs.php' ),

// API.
include( 'tools/class-settings-api.php' ),

// Tools.
// Data.
include( 'tools/class-settings-data.php' ),

// System Info.
include( 'tools/class-setting-system-info.php' )
);

// Output.
Expand All @@ -399,6 +398,6 @@ function give_tools_page_pages( $settings ) {
* @return string
*/
function give_set_default_tab_form_tools_page( $default_tab ) {
return 'logs';
return 'system-info';
}
add_filter( 'give_default_setting_tab_give-tools', 'give_set_default_tab_form_tools_page', 10, 1 );
47 changes: 3 additions & 44 deletions includes/admin/tools/class-setting-system-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Give_Settings_System_Info {
* Constructor.
*/
public function __construct() {
$this->id = 'general';
$this->id = 'system-info';
$this->label = esc_html__( 'System Info', 'give' );

add_filter( 'give-tools_tabs_array', array( $this, 'add_settings_page' ), 20 );
Expand All @@ -68,56 +68,15 @@ public function add_settings_page( $pages ) {
return $pages;
}

/**
* Get settings array.
*
* @since 1.8
* @return array
*/
public function get_settings() {
// Hide save button.
$GLOBALS['give_hide_save_button'] = true;

// Get settings.
$settings = apply_filters( 'give_settings_system', array(
array(
'id' => 'give_totls_system_info',
'type' => 'title'
),
array(
'id' => 'system-info-textarea',
'name' => esc_html__( 'System Info', 'give' ),
'desc' => esc_html__( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
'type' => 'system_info'
),
array(
'id' => 'give_totls_system_info',
'type' => 'sectionend'
)
));

/**
* Filter the settings.
*
* @since 1.8
* @param array $settings
*/
$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );

// Output.
return $settings;
}

/**
* Output the settings.
*
* @since 1.8
* @return void
*/
public function output() {
$settings = $this->get_settings();

Give_Admin_Settings::output_fields( $settings, 'give_settings' );
$GLOBALS['give_hide_save_button'] = true;
include_once( 'views/html-admin-page-system-info.php' );
}
}

Expand Down
Loading

0 comments on commit 9908644

Please sign in to comment.