- Fixes issue where the served path for the favicon was incorrect (included relative path when one was not needed)
- Also fixes issue where favicons were just plain not served for subfolder installations
- Fixed unsemantic HTML in ACP/General regarding Site Logo and Favicon fieldsets
v1.18.x
Julian Lam 10 years ago
parent c70267bd23
commit 08fb30378a

@ -38,7 +38,7 @@ uploadsController.uploadFavicon = function(req, res, next) {
return next(err); return next(err);
} }
res.json([{name: uploadedFile.name, url: nconf.get('relative_path') + image.url}]); res.json([{name: uploadedFile.name, url: image.url}]);
}); });
} }
}; };

@ -22,7 +22,7 @@ var middleware = {};
function setupFavicon(app) { function setupFavicon(app) {
var faviconPath = path.join(__dirname, '../../', 'public', meta.config['brand:favicon'] ? meta.config['brand:favicon'] : 'favicon.ico'); var faviconPath = path.join(__dirname, '../../', 'public', meta.config['brand:favicon'] ? meta.config['brand:favicon'] : 'favicon.ico');
if (fs.existsSync(faviconPath)) { if (fs.existsSync(faviconPath)) {
app.use(favicon(faviconPath)); app.use(nconf.get('relative_path'), favicon(faviconPath));
} }
} }

@ -31,25 +31,36 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Site Logo</div> <div class="panel-heading">Site Logo</div>
<div class="panel-body"> <div class="panel-body">
<form> <div class="form-group">
<label>Image</label> <label for="logoUrl">Image</label>
<input id="logoUrl" type="text" class="form-control" placeholder="Path to a logo to display on forum header" data-field="brand:logo" /><br /> <div class="input-group">
<input data-action="upload" data-target="logoUrl" data-route="{config.relative_path}/api/admin/uploadlogo" type="button" class="btn btn-default" value="Upload"></input> <input id="logoUrl" type="text" class="form-control" placeholder="Path to a logo to display on forum header" data-field="brand:logo" data-action="upload" data-target="logoUrl" data-route="{config.relative_path}/api/admin/uploadlogo" readonly />
<br/><br/> <span class="input-group-btn">
<label>URL</label> <input data-action="upload" data-target="logoUrl" data-route="{config.relative_path}/api/admin/uploadlogo" type="button" class="btn btn-default" value="Upload"></input>
<input type="text" class="form-control" placeholder="The URL of the site logo" data-field="brand:logo:url" /><br /> </span>
</form> </div>
</div>
<div class="form-group">
<label for="brand:logo:url">URL</label>
<input id ="brand:logo:url" type="text" class="form-control" placeholder="The URL of the site logo" data-field="brand:logo:url" />
<p class="help-block">
When the logo is clicked, send users to this address. If left blank, user will be sent to the forum index.
</p>
</div>
</div> </div>
</div> </div>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Favicon</div> <div class="panel-heading">Favicon</div>
<div class="panel-body"> <div class="panel-body">
<form> <div class="form-group">
<label>Favicon</label><br /> <div class="input-group">
<input id="faviconUrl" type="text" class="form-control" placeholder="favicon.ico" data-field="brand:favicon" /><br /> <input id="faviconUrl" type="text" class="form-control" placeholder="favicon.ico" data-field="brand:favicon" data-action="upload" data-target="faviconUrl" data-route="{config.relative_path}/api/admin/uploadfavicon" readonly />
<input data-action="upload" data-target="faviconUrl" data-route="{config.relative_path}/api/admin/uploadfavicon" type="button" class="btn btn-default" value="Upload"></input> <span class="input-group-btn">
</form> <input data-action="upload" data-target="faviconUrl" data-route="{config.relative_path}/api/admin/uploadfavicon" type="button" class="btn btn-default" value="Upload"></input>
</span>
</div>
</div>
</div> </div>
</div> </div>

Loading…
Cancel
Save