Skip to content
Permalink
Browse files
Merge pull request #100 from getnikola/portal-enhancements
Portal enhancements
  • Loading branch information
Kwpolska committed Aug 6, 2015
2 parents 508572a + 5548ed1 commit 740e9091638abfb02943908efda4c718c969bff1
Showing 2 changed files with 14 additions and 1 deletion.
@@ -279,25 +279,34 @@ <h2>Plugins for Nikola <small>version
// DEFAULT VERSION SET HERE
var current_version = 7;
var already_initialized = false;
var canonical = 'https://plugins.getnikola.com/';
fetch(current_version);
already_initialized = true;
function hash_handler() {
if (location.hash) {
plugin = location.hash.slice(1);
canonical = canonical + '#' + plugin;
}
else {
plugin = null;
}
document.querySelector('link[rel="canonical"]').href=canonical;
// Show plugin data
container = $('#rightside');
container.html('');
if (plugin === null) {
var title = $('<h2/>').text("Choose a plugin…").appendTo(container);
$('</p>').text("Pick a plugin from the list on the left to display more information.").appendTo(container);
} else {
var title = $('<h2/>').text(plugin).appendTo(container);
var small = $('<small/>').appendTo(title);
$('<span/>').html('&nbsp;v'+data[plugin]['version']).appendTo(small)
$('<span/>').html('&nbsp;|&nbsp;by '+data[plugin]['author']).appendTo(small)
if (['website'] in data[plugin]) {
author_str = '<a href="' + data[plugin]['website'] + '">' + data[plugin]['author'] + '</a>';
} else {
author_str = data[plugin]['author'];
}
$('<span/>').html('&nbsp;|&nbsp;by ' + author_str).appendTo(small)
if (data[plugin]['tests']) {
$('<span/>').html('&nbsp;|&nbsp;Tests exist (' +
data[plugin]['tests'] + ')').appendTo(small)
@@ -88,6 +88,10 @@ def get_data(path):
data['author'] = c.get('Documentation', 'Author')
data['version'] = c.get('Documentation', 'Version')
data['description'] = c.get('Documentation', 'Description')
try:
data['website'] = c.get('Documentation', 'Website')
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
data['website'] = None
try:
data['minver'] = c.get('Nikola', 'MinVersion')
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):

0 comments on commit 740e909

Please sign in to comment.