Skip to content

Commit

Permalink
Merge pull request #41 from wceu/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
AleksandarPredic authored Apr 15, 2019
2 parents 8327cdb + a1b816a commit 56f954f
Show file tree
Hide file tree
Showing 17 changed files with 972 additions and 42 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ Workflow for adding new features is as follows:
* Checkout to develop branch
* Fetch upstream [more info](https://help.github.com/en/articles/syncing-a-fork)

## Local Development environment setup

For local development please use [VVV](https://github.com/Varying-Vagrant-Vagrants/VVV) or Docker

* Clone repository outside your WordPress installation plugins folder
* Sync dist/contributor-orientation-tool to your instalation wp-content/plugins folder
* Run npm run watch to start development
* Note: Don't make changes to dist folder as it is regenerated on every compile

## Changing plugin version

Please note: If changing version of the plugin you need to modify version in this files:
Expand Down
14 changes: 13 additions & 1 deletion dist/contributor-orientation-tool/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tags:
Requires at least: 5.0
Tested up to: 5.1
Requires PHP: 7.0
Stable tag: 1.1.1
Stable tag: 1.1.2
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

Expand Down Expand Up @@ -51,3 +51,15 @@ UPDATE 10th April 2019
- Changed team config and shortcode section rendering
- Major change to js form logic
- Small fixes

UPDATE 12th April 2019
+ Version 1.1.1
- Fixed fatal error in plugin options
- Design change
- Small fixes

UPDATE 15th April 2019
+ Version 1.1.2
- Design change
- Small fixes
- Readme file change
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* Plugin Name: Contributor orientation tool
* Plugin URI: https://github.com/wceu/contributor-orientation-tool
* Description: A WordPress plugin aiming to help new contributors decide which make team/s to contribute to or join at Contributor Day.
* Version: 1.1.1
* Version: 1.1.2
* Author: Aleksandar Predic
* Author URI: https://www.acapredic.com/
* Tags: comments, spam
* Requires at least: 5.0
* Tested up to: 5.1
* Requires PHP: 7.0
* Stable tag: 0.0.1
* Stable tag: 1.1.2
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: contributor-orientation-tool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function fields() {

foreach ( $teams as $id => $team ) {

$team = new Team( $id, $team['name'], $team['description'], $team['icon'], $team['url'] );
$team = new Team( $id, $team['name'] );
$team_id = $team->get_id();

printf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ class Shortcode {
*/
private $number_of_sections = 4;

/**
* Steps for form header
* @var array
*/
private $steps = array();

/**
* Shortcode constructor.
*
Expand All @@ -58,6 +64,13 @@ public function __construct( string $version, string $prefix ) {
add_action( 'wp_enqueue_scripts', array( $this, 'scripts' ) );
add_shortcode( $this->shortcode_tag, array( $this, 'output' ) );

$this->steps = array(
1 => esc_html__( 'Use of WordPress', 'contributor-orientation-tool' ),
2 => esc_html__( 'Passionate', 'contributor-orientation-tool' ),
3 => esc_html__( 'Experience', 'contributor-orientation-tool' ),
4 => esc_html__( 'Done!', 'contributor-orientation-tool' )
);

}

/**
Expand Down Expand Up @@ -361,16 +374,27 @@ private function get_checkbox_field_class() {
*/
private function get_form_header() {

if ( empty( $this->steps ) ) {
return '';
}

$number = $this->number_of_sections;
$steps = array();
for( $i = 1; $i <= $number; $i++ ) {

$steps[] = sprintf(
'<li%1$s><span class="%2$s">%3$s</span><span>%4$d</span></li>',
'<li%1$s>
<span class="%2$s">%3$s
<span>%6$s</span>
</span>
<span class="%5$s">%4$d</span>
</li>',
$i === 1 ? sprintf( ' class="%s"', sprintf( '%s__steps--active', $this->prefix ) ) : '', // %1$s
sprintf( '%s__steps-text', $this->prefix ), // %2$s
esc_html__( 'Step', 'contributor-orientation-tool' ), // %3$s
$i // %4$d
sprintf( esc_html__( 'Step %d :', 'contributor-orientation-tool' ), $i ), // %3$s
$i, // %4$d
sprintf( '%s__steps-responsive', $this->prefix ), // %5$d
$this->steps[ $i ] // %6$d
);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Team {
* @param string $icon Team icon (dashicons)
* @param string $url Url to the team page on WordPress.org
*/
public function __construct( string $id, string $name, string $description, string $icon, string $url ) {
public function __construct( string $id, string $name, string $description = '', string $icon = '', string $url = '' ) {

$this->id = sanitize_text_field( $id );
$this->name = sanitize_text_field( $name );
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 56f954f

Please sign in to comment.