Skip to content
This repository has been archived by the owner on Jun 26, 2022. It is now read-only.

Commit

Permalink
Update to release announcements display
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Byrne authored and Alan Byrne committed Dec 1, 2020
1 parent ed67fb8 commit 91bede9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/Controller/System/CoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ public function SystemAboutInformation(Request $request, ReleaseInfo $releaseinf
$servicestatus = $releaseinfo->ServiceStatus();
$devstage = $releaseinfo->DevStage();

$announcements = $releaseinfo->Announcements();



return $this->render('system/sysinfo.html.twig',
Expand All @@ -267,6 +269,7 @@ public function SystemAboutInformation(Request $request, ReleaseInfo $releaseinf
'servicestatus' => $servicestatus,
'devstage' => $devstage,
'uscron' => $uscron,
'announcements' => $announcements,
]
);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Service/ReleaseInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ public function UpdateCheck()
public function Announcements()
{
try{
$announcements = file_get_contents('https://update.stormdevelopers.com/get/details/2/announcements');
$url = 'https://update.stormdevelopers.com/api/announcements/2';
$json = file_get_contents($url);
$announcements = json_decode($json, TRUE);
}
catch(\Exception $e){
$announcements = 'Announcements are offline or no new announcements been sent, They will be some very soon';
}

return $announcements;
}

Expand Down
12 changes: 6 additions & 6 deletions templates/system/sysinfo.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -130,27 +130,27 @@
</div>


<noscript>
<div class="row">
<div class="col-md-12">
{% for a in announcements %}
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h3 class="card-title">
<i class="fas fa-users-cog"></i>
Change Log
<i class="fas fa-bullhorn"></i>
{{ a.title }}
</h3>
</div>
<!-- /.card-header -->
<div class="card-body">
Changes being recorded soon
{{ a.announcement }}
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- ./col -->
{% endfor %}
</div>
</noscript>
{% endblock %}
{% block pageJS %}
<!-- Additional Javascript or Jquery -->
Expand Down

0 comments on commit 91bede9

Please sign in to comment.