Update welcome screen to show video and links
This commit is contained in:
@@ -6,7 +6,9 @@
|
||||
.sportspress-message a.button-primary,
|
||||
.sportspress-message a.button-secondary,
|
||||
p.sportspress-actions input.button-primary,
|
||||
p.sportspress-actions input.button-primary:active {
|
||||
p.sportspress-actions input.button-primary:active,
|
||||
p.sportspress-actions a.button-primary,
|
||||
p.sportspress-actions a.button-primary:active {
|
||||
background: #3bbab3;
|
||||
border-color: #15a29a;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1);
|
||||
@@ -18,7 +20,9 @@ p.sportspress-actions input.button-primary:active {
|
||||
.sportspress-message a.button-primary:hover,
|
||||
.sportspress-message a.button-secondary:hover,
|
||||
p.sportspress-actions input.button-primary:hover,
|
||||
p.sportspress-actions input.button-primary:focus {
|
||||
p.sportspress-actions input.button-primary:focus,
|
||||
p.sportspress-actions a.button-primary:hover,
|
||||
p.sportspress-actions a.button-primary:focus {
|
||||
background: #00a69c;
|
||||
border-color: #009187;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1);
|
||||
@@ -61,8 +65,29 @@ p.sportspress-actions input.button-primary:focus {
|
||||
background: transparent!important;
|
||||
}
|
||||
|
||||
.sportspress-steps:before,
|
||||
.sportspress-steps:after {
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
|
||||
.sportspress-steps:after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.sportspress-steps {
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.sportspress-steps ul {
|
||||
width: 45%;
|
||||
margin-right: 5%;
|
||||
float: left;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.sportspress-steps .welcome-icon:before {
|
||||
font: 400 20px/1 "sportspress";
|
||||
font: 400 20px/1 dashicons;
|
||||
speak: none;
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 0;
|
||||
@@ -75,14 +100,6 @@ p.sportspress-actions input.button-primary:focus {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.sportspress-steps .welcome-add-team:before {
|
||||
content: "\f334";
|
||||
}
|
||||
|
||||
.sportspress-steps .welcome-add-player:before {
|
||||
content: "\f307";
|
||||
}
|
||||
|
||||
.sportspress-steps .welcome-add-event:before {
|
||||
content: "\f145";
|
||||
.sportspress-steps .sp-welcome-icon:before {
|
||||
font-family: sportspress;
|
||||
}
|
||||
Binary file not shown.
@@ -7,14 +7,15 @@
|
||||
<font-face units-per-em="512" ascent="480" descent="-32" />
|
||||
<missing-glyph horiz-adv-x="512" />
|
||||
<glyph unicode=" " d="" horiz-adv-x="256" />
|
||||
<glyph unicode="" d="M384 286v149.2h25.6c14.16 0 25.6-11.44 25.6-25.6v-51.2c0-33.44-21.36-61.84-51.2-72.4zM153.6 51.52h204.8v-51.52h-204.8v51.52zM179.2 76.8l25.6 25.6h25.6v25.6l25.6 25.6 25.6-25.6v-25.6h25.6l25.6-25.6h-153.6zM256 179.2c-56.56 0-102.4 45.84-102.4 102.4v179.2h204.8v-179.2c0-56.56-45.84-102.4-102.4-102.4zM76.8 358.4v51.2c0 14.16 11.44 25.6 25.6 25.6h25.6v-149.2c-29.84 10.56-51.2 38.96-51.2 72.4z" />
|
||||
<glyph unicode="" d="M448 480h-384c-17.688 0-32-14.312-32-32v-448c0-17.688 14.312-32 32-32h384c17.688 0 32 14.312 32 32v448c0 17.688-14.312 32-32 32zM160 32h-64v64h64v-64zM160 128h-64v64h64v-64zM160 224h-64v64h64v-64zM288 32h-64v64h64v-64zM288 128h-64v64h64v-64zM288 224h-64v64h64v-64zM416 32h-64v64h64v-64zM416 128h-64v64h64v-64zM416 224h-64v64h64v-64zM416 352h-320v64h320v-64z" />
|
||||
<glyph unicode="" d="M484.88 328.96l-30.72-222.64c-7.68-54.32-36.72-80.64-92.72-80.64h-264.32c-55.92 0-77.84 26.32-70.16 80.64l30.72 222.64c8.24 54.32 37.28 80.64 93.2 80.64h264.32c56-0.080 77.92-26.4 69.68-80.64zM206.88 359.040c-42.88 0-67.44-30.080-73.28-74.48l-4.88-36c-6.32-44.4 10.4-69.68 53.36-69.68h100.16c13.52 0 11.2-11.84 11.2-11.84-1.44-8.8-6.32-13.2-15.12-13.2h-166.96l-10.080-76.96h201.6c42.88 0 65.84 20.48 72.16 64.88l7.28 49.6c6.32 44.4-10.72 64.88-53.6 64.88h-100.72c-8.8 0-12.64 4.4-11.68 13.2 0 0-0.56 11.84 14.8 11.84h166.4l10.88 77.76h-201.52z" />
|
||||
<glyph unicode="" d="M384 435.2h-51.2v-51.2h51.2v51.2zM435.2 435.2h-25.6v-76.8h-102.4v76.8h-102.4v-76.8h-102.4v76.8h-25.6c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 76.8h-307.2v230.4h307.2v-230.4zM179.2 435.2h-51.2v-51.2h51.2v51.2zM281.6 256h-51.2v-51.2h51.2v51.2zM358.4 256h-51.2v-51.2h51.2v51.2zM204.8 179.2h-51.2v-51.2h51.2v51.2zM204.8 256h-51.2v-51.2h51.2v51.2zM281.6 179.2h-51.2v-51.2h51.2v51.2zM358.4 179.2h-51.2v-51.2h51.2v51.2z" />
|
||||
<glyph unicode="" d="M256 426.667c-92.805 0-185.597-66.375-256-199.111 70.403-132.736 163.195-199.111 256-199.111s185.597 66.375 256 199.111c-70.403 132.736-163.195 199.111-256 199.111zM256 85.334c-67.486 0-135.945 51.43-190.667 142.222 54.722 90.792 123.18 142.222 190.667 142.222s135.945-51.43 190.667-142.222c-54.722-90.792-123.18-142.222-190.667-142.222zM312.889 227.556c0-31.417-25.472-56.889-56.889-56.889s-56.889 25.472-56.889 56.889 25.472 56.889 56.889 56.889 56.889-25.472 56.889-56.889z" />
|
||||
<glyph unicode="" d="M153.6 332.8h51.2v-51.2h-51.2v51.2zM153.6 256h51.2v-51.2h-51.2v51.2zM153.6 179.2h51.2v-51.2h-51.2v51.2zM256 179.2h102.4v-51.2h-102.4v51.2zM435.2 435.2h-358.4c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 76.8h-307.2v307.2h307.2v-307.2zM256 256h102.4v-51.2h-102.4v51.2zM256 332.8h102.4v-51.2h-102.4v51.2z" />
|
||||
<glyph unicode="" d="M153.6 179.2h204.8v-51.2h-204.8v51.2zM153.6 256h204.8v-51.2h-204.8v51.2zM435.2 435.2h-358.4c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 76.8h-307.2v307.2h307.2v-307.2zM153.6 332.8h204.8v-51.2h-204.8v51.2z" />
|
||||
<glyph unicode="" d="M434.8 26h-358.4c-14.16 0-25.6 11.44-25.6 25.6v358.4c0 14.16 11.44 25.6 25.6 25.6h358.4c14.16 0 25.6-11.44 25.6-25.6v-358.4c0-14.16-11.44-25.6-25.6-25.6zM409.2 384.4h-307.2v-307.2h307.2v307.2zM204.4 282h-51.2v51.2h51.2v-51.2zM204.4 205.2h-51.2v51.2h51.2v-51.2zM204.4 128.4h-51.2v51.2h51.2v-51.2zM281.2 128.4h-51.2v51.2h51.2v-51.2zM358 282h-51.2v51.2h51.2v-51.2zM358 205.2h-51.2v51.2h51.2v-51.2zM358 128.4h-51.2v51.2h51.2v-51.2zM230 333.2h51.2v-51.2h-51.2v51.2z" />
|
||||
<glyph unicode="" d="M288 256h64v-160h-64zM480 384h-128v64c0 17.688-14.312 32-32 32h-128c-17.688 0-32-14.312-32-32v-64h-128c-17.688 0-32-14.312-32-32v-32h32v-320c0-17.688 14.312-32 32-32h384c17.688 0 32 14.312 32 32v320h32v32c0 17.688-14.312 32-32 32zM224 416h64v-32h-64v32zM416 32h-320v288h320v-288zM160 256h64v-160h-64z" />
|
||||
<glyph unicode="" d="M76.8 102.4h102.4v204.8h-102.4v-204.8zM204.8 102.4h102.4v307.2h-102.4v-307.2zM332.8 307.2v-204.8h102.4v204.8h-102.4z" />
|
||||
<glyph unicode="" d="M384 286v149.2h25.6c14.16 0 25.6-11.44 25.6-25.6v-51.2c0-33.44-21.36-61.84-51.2-72.4zM153.6 51.52h204.8v-51.52h-204.8v51.52zM179.2 76.8l25.6 25.6h25.6v25.6l25.6 25.6 25.6-25.6v-25.6h25.6l25.6-25.6h-153.6zM256 179.2c-56.56 0-102.4 45.84-102.4 102.4v179.2h204.8v-179.2c0-56.56-45.84-102.4-102.4-102.4zM76.8 358.4v51.2c0 14.16 11.44 25.6 25.6 25.6h25.6v-149.2c-29.84 10.56-51.2 38.96-51.2 72.4z" />
|
||||
<glyph unicode="" d="M301.84 256c3.44-12.24 5.36-25.12 5.36-38.4 0-77.76-63.040-140.8-140.8-140.8s-140.8 63.040-140.8 140.8 63.040 140.8 140.8 140.8h89.6v-25.6c0-14.16 11.44-25.6 25.6-25.6s25.6 11.44 25.6 25.6v25.6h179.2v-102.4h-184.56z" />
|
||||
<glyph unicode="" d="M459.6 307.2h-76.8v-179.2h-256v179.2h-76.8v102.4h132.4c10.56-29.84 38.96-51.2 72.4-51.2s61.84 21.36 72.4 51.2h132.4v-102.4zM382.8 102.4v-51.2h-256v51.2h256z" />
|
||||
<glyph unicode="" d="M435.2 332.8h-0.8l0.8-177.6v-1.6c0-6.96-2.56-12.96-7.6-18s-11.040-7.6-18-7.6h-307.2c-7.2 0-13.28 2.56-18.24 7.6s-7.36 11.040-7.36 18v1.6l0.8 177.6h-0.8c-7.2 0-13.28 2.48-18.24 7.36s-7.36 11.040-7.36 18.24 2.48 13.28 7.36 18.24 10.96 7.36 18.080 7.36 13.12-2.48 18.24-7.36 7.52-11.040 7.52-18.24c0-8.8-3.6-15.76-10.8-20.8l87.6-124 66.4 147.2c-4.56 1.84-8.16 4.96-11.040 9.2s-4.16 8.96-4.16 14c0 7.2 2.48 13.28 7.36 18.24s10.96 7.36 18 7.36 13.12-2.48 18.24-7.36 7.6-11.040 7.6-18.24c0-5.040-1.44-9.76-4.16-14s-6.48-7.36-11.040-9.2l66.4-147.2 87.6 124c-7.2 5.040-10.8 12-10.8 20.8 0 7.2 2.48 13.28 7.36 18.24s10.96 7.36 18 7.36 13.12-2.48 18.24-7.36 7.6-11.040 7.6-18.24-2.56-13.28-7.6-18.24-11.040-7.36-18-7.36zM76.8 102.4h358.4c6.96 0 12.96-2.48 18-7.36s7.6-10.96 7.6-18-2.56-13.12-7.6-18.24-11.040-7.6-18-7.6h-358.4c-6.96 0-12.96 2.56-18 7.6s-7.6 11.12-7.6 18.16 2.48 13.040 7.36 18 11.040 7.44 18.24 7.44z" />
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
Binary file not shown.
Binary file not shown.
@@ -517,4 +517,7 @@ jQuery(document).ready(function($){
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Fitvids
|
||||
$(".sp-fitvids").fitVids();
|
||||
});
|
||||
83
assets/js/jquery.fitvids.js
Normal file
83
assets/js/jquery.fitvids.js
Normal file
@@ -0,0 +1,83 @@
|
||||
/*global jQuery */
|
||||
/*jshint browser:true */
|
||||
/*!
|
||||
* FitVids 1.1
|
||||
*
|
||||
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
|
||||
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
|
||||
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
||||
*
|
||||
*/
|
||||
|
||||
(function( $ ){
|
||||
|
||||
'use strict';
|
||||
|
||||
$.fn.fitVids = function( options ) {
|
||||
var settings = {
|
||||
customSelector: null,
|
||||
ignore: null
|
||||
};
|
||||
|
||||
if(!document.getElementById('fit-vids-style')) {
|
||||
// appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
|
||||
var head = document.head || document.getElementsByTagName('head')[0];
|
||||
var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
|
||||
var div = document.createElement("div");
|
||||
div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
|
||||
head.appendChild(div.childNodes[1]);
|
||||
}
|
||||
|
||||
if ( options ) {
|
||||
$.extend( settings, options );
|
||||
}
|
||||
|
||||
return this.each(function(){
|
||||
var selectors = [
|
||||
'iframe[src*="player.vimeo.com"]',
|
||||
'iframe[src*="youtube.com"]',
|
||||
'iframe[src*="youtube-nocookie.com"]',
|
||||
'iframe[src*="kickstarter.com"][src*="video.html"]',
|
||||
'object',
|
||||
'embed'
|
||||
];
|
||||
|
||||
if (settings.customSelector) {
|
||||
selectors.push(settings.customSelector);
|
||||
}
|
||||
|
||||
var ignoreList = '.fitvidsignore';
|
||||
|
||||
if(settings.ignore) {
|
||||
ignoreList = ignoreList + ', ' + settings.ignore;
|
||||
}
|
||||
|
||||
var $allVideos = $(this).find(selectors.join(','));
|
||||
$allVideos = $allVideos.not('object object'); // SwfObj conflict patch
|
||||
$allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
|
||||
|
||||
$allVideos.each(function(){
|
||||
var $this = $(this);
|
||||
if($this.parents(ignoreList).length > 0) {
|
||||
return; // Disable FitVids on this video.
|
||||
}
|
||||
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
|
||||
if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))
|
||||
{
|
||||
$this.attr('height', 9);
|
||||
$this.attr('width', 16);
|
||||
}
|
||||
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
|
||||
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
|
||||
aspectRatio = height / width;
|
||||
if(!$this.attr('id')){
|
||||
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
|
||||
$this.attr('id', videoID);
|
||||
}
|
||||
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');
|
||||
$this.removeAttr('height').removeAttr('width');
|
||||
});
|
||||
});
|
||||
};
|
||||
// Works with either jQuery or Zepto
|
||||
})( window.jQuery || window.Zepto );
|
||||
@@ -42,12 +42,27 @@ class SP_Admin_Welcome {
|
||||
* @return void
|
||||
*/
|
||||
public function admin_menus() {
|
||||
if ( empty( $_GET['page'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$welcome_page_name = __( 'About SportsPress', 'sportspress' );
|
||||
$welcome_page_title = __( 'Welcome to SportsPress', 'sportspress' );
|
||||
|
||||
// About
|
||||
$about = add_dashboard_page( $welcome_page_title, $welcome_page_title, 'manage_options', 'sp-about', array( $this, 'about_screen' ) );
|
||||
|
||||
add_action( 'admin_print_styles-'. $about, array( $this, 'admin_css' ) );
|
||||
switch ( $_GET['page'] ) {
|
||||
case 'sp-about' :
|
||||
$page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-about', array( $this, 'about_screen' ) );
|
||||
add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) );
|
||||
break;
|
||||
case 'sp-credits' :
|
||||
$page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-credits', array( $this, 'credits_screen' ) );
|
||||
add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) );
|
||||
break;
|
||||
case 'sp-translators' :
|
||||
$page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-translators', array( $this, 'translators_screen' ) );
|
||||
add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,6 +83,7 @@ class SP_Admin_Welcome {
|
||||
*/
|
||||
public function admin_head() {
|
||||
remove_submenu_page( 'index.php', 'sp-about' );
|
||||
remove_submenu_page( 'index.php', 'sp-credits' );
|
||||
remove_submenu_page( 'index.php', 'sp-translators' );
|
||||
|
||||
// Badge for welcome page
|
||||
@@ -96,9 +112,10 @@ class SP_Admin_Welcome {
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,.2);
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.2);
|
||||
}
|
||||
.about-sportspress-wrap .sp-actions {
|
||||
text-align: right;
|
||||
margin-right: 200px;
|
||||
.about-sportspress-wrap .sportspress-actions .twitter-share-button {
|
||||
margin-top: -3px;
|
||||
margin-left: 3px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.about-sportspress-wrap .sp-feature {
|
||||
overflow: visible !important;
|
||||
@@ -112,6 +129,30 @@ class SP_Admin_Welcome {
|
||||
.about-sportspress-wrap .sp-feature:after {
|
||||
clear: both;
|
||||
}
|
||||
.about-sportspress-wrap div.icon {
|
||||
width: 0 !important;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.about-sportspress-wrap .sp-feature div.icon:before {
|
||||
font-family: sportspress !important;
|
||||
font-weight: normal;
|
||||
width: 100%;
|
||||
font-size: 170px;
|
||||
line-height: 125px;
|
||||
color: #9c5d90;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
speak: none;
|
||||
margin: <?php echo is_rtl() ? '0 -100px 0 0' : '0 0 0 -100px'; ?>;
|
||||
content: "\f111";
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
.about-sportspress-wrap .form-table th {
|
||||
width: auto;
|
||||
}
|
||||
@media only screen and (max-width: 500px) {
|
||||
.about-sportspress-wrap h1 {
|
||||
padding-top: 240px;
|
||||
@@ -137,7 +178,7 @@ class SP_Admin_Welcome {
|
||||
// Drop minor version if 0
|
||||
$major_version = substr( SP()->version, 0, 3 );
|
||||
?>
|
||||
<h1><?php printf( __( 'Welcome to SportsPress!', 'sportspress' ), $major_version ); ?></h1>
|
||||
<h1><?php printf( __( 'Welcome to SportsPress %s', 'sportspress' ), $major_version ); ?></h1>
|
||||
|
||||
<div class="about-text sp-about-text">
|
||||
<?php
|
||||
@@ -154,7 +195,9 @@ class SP_Admin_Welcome {
|
||||
|
||||
<div class="sp-badge"><?php printf( __( 'Version %s', 'sportspress' ), SP()->version ); ?></div>
|
||||
|
||||
<p class="sp-actions">
|
||||
<p class="sportspress-actions">
|
||||
<a href="<?php echo admin_url('admin.php?page=sportspress'); ?>" class="button button-primary"><?php _e( 'Settings', 'sportspress' ); ?></a>
|
||||
<a href="<?php echo esc_url( apply_filters( 'sportspress_docs_url', 'http://sportspresspro.com/docs/', 'sportspress' ) ); ?>" class="docs button button-primary"><?php _e( 'Docs', 'sportspress' ); ?></a>
|
||||
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://wordpress.org/plugins/sportspress" data-text="An open-source (free) #WordPress plugin that helps you build professional league websites." data-via="ThemeBoy" data-size="large" data-hashtags="SportsPress">Tweet</a>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
||||
</p>
|
||||
@@ -162,6 +205,10 @@ class SP_Admin_Welcome {
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a class="nav-tab <?php if ( $_GET['page'] == 'sp-about' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sp-about' ), 'index.php' ) ) ); ?>">
|
||||
<?php _e( 'Get Started', 'sportspress' ); ?>
|
||||
</a><a class="nav-tab <?php if ( $_GET['page'] == 'sp-credits' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sp-credits' ), 'index.php' ) ) ); ?>">
|
||||
<?php _e( 'Credits', 'sportspress' ); ?>
|
||||
</a><a class="nav-tab <?php if ( $_GET['page'] == 'sp-translators' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sp-translators' ), 'index.php' ) ) ); ?>">
|
||||
<?php _e( 'Translators', 'sportspress' ); ?>
|
||||
</a>
|
||||
</h2>
|
||||
<?php
|
||||
@@ -178,14 +225,11 @@ class SP_Admin_Welcome {
|
||||
|
||||
<?php $this->intro(); ?>
|
||||
|
||||
<!--<div class="changelog point-releases"></div>-->
|
||||
|
||||
<div class="changelog">
|
||||
|
||||
<?php
|
||||
// Save settings
|
||||
if ( isset( $_POST['timezone_string'] ) ):
|
||||
update_option( 'timezone_string', $_POST['timezone_string'] );
|
||||
update_option( 'sportspress_basic_setup', 1 );
|
||||
endif;
|
||||
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) ):
|
||||
$sport = $_POST['sportspress_sport'];
|
||||
@@ -197,10 +241,52 @@ class SP_Admin_Welcome {
|
||||
<p><strong><?php _e( 'Your settings have been saved.', 'sportspress' ); ?></strong></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="sp-feature feature-section col three-col">
|
||||
<div class="sp-feature feature-section col two-col">
|
||||
<div>
|
||||
<?php if ( get_option( 'sportspress_basic_setup' ) ) { ?>
|
||||
<h4><?php _e( 'Sport', 'sportspress' ); ?></h4>
|
||||
<?php
|
||||
$sport = get_option( 'sportspress_sport' );
|
||||
$sport_options = SP_Admin_Sports::get_preset_options();
|
||||
foreach ( $sport_options as $options ):
|
||||
foreach ( $options as $slug => $name ):
|
||||
if ( $sport === $slug ):
|
||||
$sport = $name;
|
||||
continue;
|
||||
endif;
|
||||
endforeach;
|
||||
endforeach;
|
||||
echo $sport;
|
||||
?>
|
||||
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress' ), 'admin.php' ) ) ); ?>"><div class="dashicons dashicons-edit"></div><?php _e( 'Change', 'sportspress' ); ?></a>
|
||||
<h4><?php _e( 'Next Steps', 'sportspress' ); ?></h4>
|
||||
<p><?php _e( 'We’ve assembled some links to get you started:', 'sportspress' ); ?></p>
|
||||
<div class="sportspress-steps">
|
||||
<ul>
|
||||
<li><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'sp_team' ), 'post-new.php' ) ) ); ?>" class="welcome-icon sp-welcome-icon dashicons-shield-alt"><?php _e( 'Add New Team', 'sportspress' ); ?></a></li>
|
||||
<li><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'sp_player' ), 'post-new.php' ) ) ); ?>" class="welcome-icon sp-welcome-icon dashicons-groups"><?php _e( 'Add New Player', 'sportspress' ); ?></a></li>
|
||||
<li><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'sp_event' ), 'post-new.php' ) ) ); ?>" class="welcome-icon sp-welcome-icon dashicons-calendar"><?php _e( 'Add New Event', 'sportspress' ); ?></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sp-overview' ), 'admin.php' ) ) ); ?>" class="welcome-icon dashicons-networking"><?php _e( 'Overview', 'sportspress' ); ?></a></li>
|
||||
<li><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sp-config' ), 'admin.php' ) ) ); ?>" class="welcome-icon dashicons-performance"><?php _e( 'Configure', 'sportspress' ); ?></a></li>
|
||||
<li><a href="<?php echo esc_url( admin_url( 'widgets.php' ) ); ?>" class="welcome-icon dashicons-welcome-widgets-menus"><?php _e( 'Widgets', 'sportspress' ); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="return-to-dashboard">
|
||||
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to SportsPress Settings', 'sportspress' ); ?></a>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<form method="post" id="mainform" action="" enctype="multipart/form-data">
|
||||
<h4><?php _e( 'Timezone', 'sportspress' ); ?></h4>
|
||||
<h4><?php _e( 'Basic Setup', 'sportspress' ); ?></h4>
|
||||
<p><?php _e( 'Select your timezone and sport to get started.', 'sportspress' ); ?></p>
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr valign="top">
|
||||
<th scope="row" class="titledesc">
|
||||
<label for="timezone_string"><?php _e( 'Timezone', 'sportspress' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select id="timezone_string" name="timezone_string" class="<?php echo $class; ?>">
|
||||
<?php
|
||||
$current_offset = get_option('gmt_offset');
|
||||
@@ -224,39 +310,67 @@ class SP_Admin_Welcome {
|
||||
echo wp_timezone_choice($tzstring);
|
||||
?>
|
||||
</select>
|
||||
<h4><?php _e( 'Sport', 'sportspress' ); ?></h4>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$sport_options = SP_Admin_Sports::get_preset_options();
|
||||
$settings = array( array(
|
||||
'id' => 'sportspress_sport',
|
||||
'default' => 'soccer',
|
||||
'default' => 'custom',
|
||||
'type' => 'groupselect',
|
||||
'title' => __( 'Sport', 'sportspress' ),
|
||||
'class' => $class,
|
||||
'options' => $sport_options,
|
||||
));
|
||||
SP_Admin_Settings::output_fields( $settings );
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="submit sportspress-actions">
|
||||
<input name="save" class="button-primary" type="submit" value="<?php _e( 'Save changes', 'sportspress' ); ?>" />
|
||||
<input type="hidden" name="subtab" id="last_tab" />
|
||||
<?php wp_nonce_field( 'sportspress-settings' ); ?>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<h4><?php _e( 'Next Steps', 'sportspress' ); ?></h4>
|
||||
<p><?php _e( 'We’ve assembled some links to get you started:', 'sportspress' ); ?></p>
|
||||
<ul class="sportspress-steps">
|
||||
<li><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'sp_team' ), 'post-new.php' ) ) ); ?>" class="welcome-icon welcome-add-team"><?php _e( 'Add New Team', 'sportspress' ); ?></a></li>
|
||||
<li><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'sp_player' ), 'post-new.php' ) ) ); ?>" class="welcome-icon welcome-add-player"><?php _e( 'Add New Player', 'sportspress' ); ?></a></li>
|
||||
<li><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'sp_event' ), 'post-new.php' ) ) ); ?>" class="welcome-icon welcome-add-event"><?php _e( 'Add New Event', 'sportspress' ); ?></a></li>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="last-feature">
|
||||
<h4><?php _e( 'Translators', 'sportspress' ); ?></h4>
|
||||
<p><?php _e( 'SportsPress has been kindly translated into several other languages thanks to our translation team. Want to see your name? <a href="https://www.transifex.com/projects/p/sportspress/">Translate SportsPress</a>.', 'sportspress' ); ?></p>
|
||||
<h4><?php _e( 'What is SportsPress?', 'sportspress' ); ?></h4>
|
||||
<div class="sp-welcome-video sp-fitvids"><iframe width="500" height="281" src="//www.youtube.com/embed/_9jeSkXs5Hc?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$translator_handles = array( 'Abdulelah', 'albertone', 'Andrew_Melim', 'ArtakEVN', 'aylaview', 'Bhelpful2', 'bizover', 'BOCo', 'den_zlateva', 'dic_2008', 'doncer', 'Ferenan', 'fredodq', 'hanro', 'hushiea', 'i__k', 'JensZ', 'joegalaxy66', 'JuKi', 'karimjarro', 'King3R', 'krisop', 'latixns', 'massimo.marra', 'MohamedZ', 'poelie', 'rochester', 'Selskei', 'sijo', 'SilverXp', 'Spirossmil', 'Taurus', 'ThemeBoy', 'tyby94', 'valentijnreza', 'Xyteton' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the credits.
|
||||
*/
|
||||
public function credits_screen() {
|
||||
?>
|
||||
<div class="wrap about-wrap about-sportspress-wrap">
|
||||
|
||||
<?php $this->intro(); ?>
|
||||
|
||||
<p class="about-description"><?php printf( __( 'SportsPress is developed and maintained by a worldwide team of passionate individuals and backed by an awesome developer community. Want to see your name? <a href="%s">Contribute to SportsPress</a>.', 'sportspress' ), 'https://github.com/ThemeBoy/SportsPress/blob/master/CONTRIBUTING.md' ); ?></p>
|
||||
|
||||
<?php echo $this->contributors(); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the translators screen
|
||||
*/
|
||||
public function translators_screen() {
|
||||
?>
|
||||
<div class="wrap about-wrap about-sportspress-wrap">
|
||||
|
||||
<?php $this->intro(); ?>
|
||||
|
||||
<p class="about-description"><?php printf( __( 'SportsPress has been kindly translated into several other languages thanks to our translation team. Want to see your name? <a href="%s">Translate SportsPress</a>.', 'sportspress' ), 'https://www.transifex.com/projects/p/sportspress/' ); ?></p>
|
||||
<?php
|
||||
$translator_handles = array( 'Abdulelah', 'albertone', 'Andrew_Melim', 'ArtakEVN', 'aylaview', 'Bhelpful2', 'bizover', 'BOCo', 'den_zlateva', 'dic_2008', 'doncer', 'etcloki', 'Ferenan', 'fredodq', 'GhiMax', 'GuneshGamza95', 'hanro', 'hushiea', 'i__k', 'JensZ', 'jenymoen', 'joegalaxy66', 'JuKi', 'karimjarro', 'King3R', 'krisop', 'latixns', 'massimo.marra', 'MohamedZ', 'overbite', 'poelie', 'popeosorio', 'rochester', 'sashaCZ', 'Selskei', 'sijo', 'SilverXp', 'SmilyCarrot', 'Spirossmil', 'Taurus', 'ThemeBoy', 'tyby94', 'valentijnreza', 'vlinicx', 'Xyteton', 'zzcs' );
|
||||
$translator_links = array();
|
||||
foreach ( $translator_handles as $handle ):
|
||||
$translator_links[] = '<a href="https://www.transifex.com/accounts/profile/' . $handle . '">' . $handle . '</a>';
|
||||
@@ -266,16 +380,72 @@ class SP_Admin_Welcome {
|
||||
<?php echo implode( ', ', $translator_links ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="return-to-dashboard">
|
||||
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to SportsPress Settings', 'sportspress' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render Contributors List
|
||||
*
|
||||
* @access public
|
||||
* @return string $contributor_list HTML formatted list of contributors.
|
||||
*/
|
||||
public function contributors() {
|
||||
$contributors = $this->get_contributors();
|
||||
|
||||
if ( empty( $contributors ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$contributor_list = '<ul class="wp-people-group">';
|
||||
|
||||
foreach ( $contributors as $contributor ) {
|
||||
$contributor_list .= '<li class="wp-person">';
|
||||
$contributor_list .= sprintf( '<a href="%s" title="%s">',
|
||||
esc_url( 'https://github.com/' . $contributor->login ),
|
||||
esc_html( sprintf( __( 'View %s', 'sportspress' ), $contributor->login ) )
|
||||
);
|
||||
$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
|
||||
$contributor_list .= '</a>';
|
||||
$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
|
||||
$contributor_list .= '</a>';
|
||||
$contributor_list .= '</li>';
|
||||
}
|
||||
|
||||
$contributor_list .= '</ul>';
|
||||
|
||||
return $contributor_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve list of contributors from GitHub.
|
||||
*
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_contributors() {
|
||||
$contributors = get_transient( 'sportspress_contributors' );
|
||||
|
||||
if ( false !== $contributors ) {
|
||||
return $contributors;
|
||||
}
|
||||
|
||||
$response = wp_remote_get( 'https://api.github.com/repos/ThemeBoy/SportsPress/contributors', array( 'sslverify' => false ) );
|
||||
|
||||
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$contributors = json_decode( wp_remote_retrieve_body( $response ) );
|
||||
|
||||
if ( ! is_array( $contributors ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
set_transient( 'sportspress_contributors', $contributors, HOUR_IN_SECONDS );
|
||||
|
||||
return $contributors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends user to the welcome page on first activation
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user