Skip to content

Commit

Permalink
Sponsoring included
Browse files Browse the repository at this point in the history
  • Loading branch information
Toxantron committed Oct 27, 2018
1 parent 2d50757 commit 4667241
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/css/scrumonline.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

.container-fluid.main {
min-height: 900px;
min-height: 800px;
padding-top: 55px;
}

Expand Down Expand Up @@ -311,4 +311,32 @@ div.issue-list {
border-width: 1px 0;
border-style: dotted;
border-color: rgba(255, 255, 255, 0.7);
}

/* Styling of sponsors */
footer div.sponsors {
margin-left: 10%;
max-width: 80%;
}
div.sponsors a, span {
margin: 5px;
}
div.sponsors a img {
height: 40px;
}
/* Donors */
div.donors>div {
margin: 10px;
display: inline-block;
vertical-align: top;
}
div.message {
font-style: italic;
max-width: 200px;
margin-bottom: 5px;
}
div.donor {
width: 100;
text-align: center;
font-weight: bold;
}
7 changes: 7 additions & 0 deletions src/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
include "config.php";
include "templates/templates.php";
include "sponsors.php";

$templates = Template::getAll();

Expand Down Expand Up @@ -79,6 +80,12 @@
<?php $indexPage->render(false) ?>
</div>

<!-- Footer contains sponsors -->
<footer class="page-footer font-small">
<h3>Sponsored by</h3>
<?= Sponsor::renderFooter() ?>
</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-route.min.js"></script>
Expand Down
3 changes: 3 additions & 0 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ scrum.app.config(
controllerAs: 'member',
pageTrack: '/member'
})
.when('/sponsors', {
templateUrl: 'sponsors.html',
})
.when('/impressum', {
templateUrl: 'impressum.html',
})
Expand Down
74 changes: 74 additions & 0 deletions src/sponsors.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
// Defintion of a sponsor object. It contains the necessary information
// sponsors need to provide
class Sponsor
{
// Link url of the sponsor
private $linkURL;

// URL of the sponsors logo
private $logoURL;

function __construct($linkURL, $logoURL)
{
$this->linkURL = $linkURL;
$this->logoURL = $logoURL;
}

// Render this sponsor instance
public function render()
{
return "<a href=\"" . $this->linkURL . "\"><img src=\"" . $this->logoURL . "\"></a>";
}

public static function renderFooter()
{
$sponsors = [
// All sponsors for the footer
//new Sponsor("https://example.com", "https://example.com/logo.png"),
];

Sponsor::renderSponsors($sponsors);
}

public static function renderOthers()
{
$sponsors = [
// All sponsors for the sponsors tab
//new Sponsor("https://example.com", "https://example.com/logo.png"),
];

Sponsor::renderSponsors($sponsors);
}

private static function renderSponsors($sponsors)
{
echo "<div class=\"sponsors\">";

foreach($sponsors as $sponsor)
echo $sponsor->render();

echo "</div>";
}

private static $donors = [
//"Author" => "Message"
];

public static function donorCount()
{
return sizeof(Sponsor::$donors);
}

public static function renderDonors()
{
echo "<div class=\"donors\">";

foreach (Sponsor::$donors as $donorName => $message) {
echo "<div><div class=\"message\">\"" . $message ."\"</div><div class=\"donor\">" . $donorName . "</div></div>";
}

echo "</div>";
}
}

14 changes: 14 additions & 0 deletions src/templates/sponsors_view.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div>
<h1>Other Sponsors:</h1>

<?= Sponsor::renderOthers() ?>
</div>

<div>
<h1>Donors (<?= Sponsor::donorCount() ?> total):</h1>

<?= Sponsor::renderDonors() ?>
</div>



1 change: 1 addition & 0 deletions src/templates/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public static function getAll()
new Template("default_source.html", "templates/default_source.html"),
new Template("add_source.html", "templates/add_source.html"),
new Template("member.html", "templates/member.php"),
new Template("sponsors.html", "templates/sponsors_view.php", "Sponsors"),
new Template("impressum.html", "templates/impressum.html", "Impressum"),
new Template("removal.html", "templates/removal.html"),
new Template("404.html", "templates/404.html")
Expand Down

0 comments on commit 4667241

Please sign in to comment.