Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add statistics page #25

Closed
wants to merge 2 commits into from
Closed

Conversation

selamanse
Copy link
Contributor

add statistics page with top25 posts (worktime)
add new resource: minified Chart.js

add statistics page with top25 posts (worktime)
add new resource: minified Chart.js
remove nonsense else statement
@blackus3r blackus3r changed the base branch from master to swimlane/1.4.0 October 23, 2016 12:02
@blackus3r blackus3r added this to the 1.4.0 milestone Oct 23, 2016
Copy link
Owner

@blackus3r blackus3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, some small fixes are needed. Thanks :)


return;
}
echo 'no data.';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use echo __("no data.", "post-worktime-logger");

}

echo '<div class="wrap">';
echo '<h1>Post Worktime Logger - Statistics</h1>';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use echo __();

}

// Register menu entry for pwlStatsPage
add_action( 'admin_menu', function(){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix this, so it fits with my settings page menu options, which I will implement in v1.3.0 (Remember, this feature is planned for v1.4.0)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forget it with v1.3.0 and v1.4.0.

This feature will also available in v1.3.0

// Register menu entry for pwlStatsPage
add_action( 'admin_menu', function(){
//TODO: this is a submenu of plugins but doesnt quite make sense...better move it to a separate menu
add_submenu_page( 'plugins.php', 'pwlStats', 'pwl-Statistics', 'manage_options', 'pwlStats', 'pwlStatsPage' );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. I will fix it.

data: {
labels: ['" . implode('\', \'', $posts_titles) . "'],
datasets: [{
label: 'worktime in seconds',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use


foreach($tPosts as $tPost){
$posts_titles[] = $tPost->post_title;
$posts_worktimes[] = get_post_meta($tPost->ID, "post-worktime", true);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you should use round($worktime/3600, 0), so we have the hours instead of the seconds.


echo "<script>
var ctx = document.getElementById('pwlTopFiveWorktimePosts');
var pwlTopFiveWorktimePosts = new Chart(ctx, {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way, to make the bars a little bit thinner?

@blackus3r blackus3r modified the milestones: 1.3.0, 1.4.0 Oct 23, 2016
@blackus3r blackus3r changed the base branch from swimlane/1.4.0 to swimlane/1.3.0 October 25, 2016 07:59
@blackus3r
Copy link
Owner

I have created a new pull request with the fixes.
#40

@blackus3r blackus3r closed this Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants