1
0

Improved ExtendedGitGraph Design in /about

This commit is contained in:
2014-06-08 15:31:44 +02:00
parent 02aa4a2cf4
commit 2f5c31b696
4 changed files with 213 additions and 94 deletions

View File

@@ -440,4 +440,72 @@ ul.nav li.dropdown-append:hover > ul.dropdown-menu {
text-decoration: none;
color: #2C3E50;
text-shadow: 0px 0px 8px #00F;
}
}
/* About/Gitbox
-------------------------------------------------- */
.gitbox-container {
border: 2px solid #CAECEC;
border-radius: 6px;
text-align: center;
margin-bottom: 10px;
}
.gitbox-header {
background-color: #F5F5F5;
border-bottom: 2px solid #CAECEC;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
padding: 5px;
margin-bottom: 10px;
font-size: 13px;
font-weight: bold;
color: gray;
}
.gitbox-footer {
background-color: #F5F5F5;
border-top: 2px solid #CAECEC;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
margin-top: 10px;
}
.gitbox-footer-box {
width: 385px;
display: table-cell;
}
.gitbox-footer-box:not(:first-child) {
border-left: 2px solid #CAECEC;
}
.gitbox-footer-box-header {
display: block;
color: #777;
font-size: 11px;
}
.gitbox-footer-box-number {
display: block;
font-weight: 300;
line-height: 1.3em;
font-size: 24px;
}
.gitbox-footer-box-footer {
display: block;
color: #777;
font-size: 11px;
}

View File

@@ -27,8 +27,44 @@ $this->selectedNav = 'about';
<p>If you want you can look <?php echo MsHtml::link('here', '/programs'); ?> at the things I programd </p>
</div>
<?php echo (new ExtendedGitGraph('Mikescher'))->loadFinished(); ?>
<br />
<?php $egh = (new ExtendedGitGraph('Mikescher'))->loadFinishedData(); ?>
<div class="gitbox-container">
<div class="gitbox-header">My Github Commits</div>
<?php echo $egh['content']; ?>
<div class="gitbox-footer">
<div class="gitbox-footer-box">
<span class="gitbox-footer-box-header">Last Update</span>
<span class="gitbox-footer-box-number"><?php echo $egh['creation']->diff(new DateTime())->format('%d'); ?> day<?php echo (($egh['creation']->diff(new DateTime())->format('d') == 1) ? '' : 's')?> ago</span>
<span class="gitbox-footer-box-footer"><?php echo $egh['creation']->format('M d Y'); ?></span>
</div>
<div class="gitbox-footer-box">
<span class="gitbox-footer-box-header">Total commits</span>
<span class="gitbox-footer-box-number"><?php echo $egh['total'] ?></span>
<span class="gitbox-footer-box-footer"><?php echo $egh['start']->format('M d Y') . ' - ' . $egh['end']->format('M d Y'); ?></span>
</div>
<div class="gitbox-footer-box">
<span class="gitbox-footer-box-header">Longest streak</span>
<span class="gitbox-footer-box-number"><?php echo $egh['streak']; ?> day<?php echo (($egh['streak'] == 1) ? '' : 's'); ?></span>
<span class="gitbox-footer-box-footer"><?php echo $egh['streak_start']->format('M d Y') . ' - ' . $egh['streak_end']->format('M d Y'); ?></span>
</div>
<div class="gitbox-footer-box">
<span class="gitbox-footer-box-header">Max commits</span>
<span class="gitbox-footer-box-number"><?php echo $egh['max_commits']; ?> / day</span>
<span class="gitbox-footer-box-footer"><?php echo $egh['max_commits_date']->format('M d Y'); ?></span>
</div>
<div class="gitbox-footer-box">
<span class="gitbox-footer-box-header">Avg commits</span>
<span class="gitbox-footer-box-number"><?php echo number_format($egh['avg_commits'],1); ?> / day</span>
<span class="gitbox-footer-box-footer"><?php echo $egh['start']->format('M d Y') . ' - ' . $egh['end']->format('M d Y'); ?></span>
</div>
</div>
</div>
<div class="well cstm-well-light">
<?php

View File

@@ -15,7 +15,7 @@
<div class="row">
<div class="span3">
<?php
echo MsHtml::lead('Programs');
echo MsHtml::lead('Logs');
echo MsHtml::stackedTabs(
[
@@ -28,7 +28,7 @@
<div class="span3">
<?php
echo MsHtml::lead('Logs');
echo MsHtml::lead('Programs');
echo MsHtml::stackedTabs(
[
@@ -68,16 +68,15 @@
<div class="well well-small">
<?php
$egh = new ExtendedGitGraph('Mikescher');
$egh->loadData();
$egh = $egh = (new ExtendedGitGraph('Mikescher'))->loadFinishedData();
?>
<h2>ExtendedGitGraph</h2>
<hr>
<strong>Last Update: </strong> <?php echo $egh->getFinishedDate()->format('d.m.Y H:i'); ?> <br>
<strong>Repositories: </strong> <?php echo count($egh->repositories); ?> <br>
<strong>Commits: </strong> <?php echo count($egh->commits); ?> <br>
<strong>Last Update: </strong> <?php echo $egh['creation']->format('d.m.Y H:i'); ?> <br>
<strong>Repositories: </strong> <?php echo $egh['repos']; ?> <br>
<strong>Commits: </strong> <?php echo $egh['total']; ?> <br>
<br><br>