Skip to content

Commit 0434b7a

Browse files
committed
Merge branch 'develop' into phoenix
2 parents 4e0aed0 + 2b05f49 commit 0434b7a

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

etc/config.sample.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"bnetdocs": {
3+
"asset_versioning": true,
34
"btc_donate_address": "",
45
"campaigns": {
56
"battleforthenet": "",

src/static/a/main-mobile.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ header.main-page {
5858
-ms-user-select: none;
5959
user-select: none;
6060
}
61+
header.main-page img#vultr-campaign {
62+
float: right;
63+
margin-right: 16px;
64+
height: 32px;
65+
}
6166
header.main-page #mobile-nav {
6267
cursor: pointer;
6368
display: block;

src/static/a/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ header.main-page {
5858
-ms-user-select: none;
5959
user-select: none;
6060
}
61+
header.main-page img#vultr-campaign {
62+
float: right;
63+
height: 32px;
64+
}
6165
header.main-page #mobile-nav {
6266
display: none;
6367
}

src/templates/header.inc.phtml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace BNETDocs\Templates;
55
use \BNETDocs\Libraries\Authentication;
66
use \BNETDocs\Libraries\Logger;
77
use \BNETDocs\Libraries\User;
8+
use \BNETDocs\Libraries\VersionInfo;
89

910
use \CarlBennett\MVC\Libraries\Common;
1011

@@ -18,6 +19,14 @@ if ( isset( Authentication::$user )) {
1819
$_header_staff = null;
1920
}
2021

22+
if ( Common::$config->bnetdocs->asset_versioning ) {
23+
if ( !is_null( VersionInfo::$version->bnetdocs )) {
24+
$_unique_css = '?v=' . VersionInfo::$version->bnetdocs[1];
25+
} else {
26+
$_unique_css = '?v=' . date('YmdHis');
27+
}
28+
}
29+
2130
$_campaign_battleforthenet = (
2231
!empty( Common::$config->bnetdocs->campaigns->battleforthenet ) ?
2332
'<script type="text/javascript" src="' .
@@ -29,9 +38,9 @@ $_campaign_vultr = (
2938
!empty( Common::$config->bnetdocs->campaigns->vultr ) ?
3039
'<a href="' . Common::relativeUrlToAbsolute(
3140
Common::$config->bnetdocs->campaigns->vultr
32-
) . '"><img src="' . Common::relativeUrlToAbsolute(
41+
) . '"><img id="vultr-campaign" src="' . Common::relativeUrlToAbsolute(
3342
'/a/vultr_badge_ondark.svg'
34-
) . '" style="float:right;margin-right:16px;height:32px;"/></a>' : ''
43+
) . '"/></a>' : ''
3544
);
3645

3746
?><!DOCTYPE html>
@@ -44,13 +53,13 @@ $_campaign_vultr = (
4453
<?php } ?>
4554
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
4655
<?php if (Common::$config->bnetdocs->mobile_site_enabled) { ?>
47-
<link rel="stylesheet" href="<?php echo Common::relativeUrlToAbsolute("/a/main.css"); ?>" type="text/css" media="(min-width:1000px)"/>
48-
<link rel="stylesheet" href="<?php echo Common::relativeUrlToAbsolute("/a/main-mobile.css"); ?>" type="text/css" media="(max-width:999px)"/>
56+
<link rel="stylesheet" href="<?php echo Common::relativeUrlToAbsolute('/a/main.css' . $_unique_css); ?>" type="text/css" media="(min-width:1000px)"/>
57+
<link rel="stylesheet" href="<?php echo Common::relativeUrlToAbsolute('/a/main-mobile.css' . $_unique_css); ?>" type="text/css" media="(max-width:999px)"/>
4958
<?php } else { ?>
50-
<link rel="stylesheet" href="<?php echo Common::relativeUrlToAbsolute("/a/main.css"); ?>" type="text/css" media="all"/>
59+
<link rel="stylesheet" href="<?php echo Common::relativeUrlToAbsolute('/a/main.css' . $_unique_css); ?>" type="text/css" media="all"/>
5160
<?php }
5261
foreach ($this->additional_css as $path) { ?>
53-
<link rel="stylesheet" type="text/css" href="<?php echo Common::relativeUrlToAbsolute($path); ?>" media="all"/>
62+
<link rel="stylesheet" type="text/css" href="<?php echo Common::relativeUrlToAbsolute($path . $_unique_css); ?>" media="all"/>
5463
<?php } ?>
5564
<link rel="icon" href="<?php echo Common::relativeUrlToAbsolute("/a/VSZX0bJ.png"); ?>" type="image/png" sizes="156x174"/>
5665
<link rel="stylesheet" type="text/css" href="<?php echo Common::relativeUrlToAbsolute("/a/font/SourceSansPro-Regular-201508251844.css"); ?>"/>

0 commit comments

Comments
 (0)