Merge branch 'release/1.5' into develop

This commit is contained in:
Tobi Schäfer 2015-02-15 20:28:20 +01:00
commit 720b988af6
11 changed files with 256 additions and 58 deletions

View file

@ -158,6 +158,7 @@ $(function() {
<th><% gettext Created %></th>
<th><% gettext Reference %></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@ -288,6 +289,9 @@ $(function() {
<a href='<% param.href %>'><% param.reference %></a>
<% if <% param.linkCount %> is 0 then '' else <% param.linkCount prefix="<span class='uk-text-muted uk-text-nowrap'><i class='uk-icon uk-icon-link'></i> " suffix=</span> %> %>
</td>
<td class='uk-text-right uk-text-muted'>
<% if <% param.alert %> is true then "<i class='uk-ionc uk-icon-warning'></i>" %>
</td>
<td class='uk-text-nowrap uk-text-right'>
<% admin.link delete "<i class='uk-icon-trash-o'></i>" <% param.item %> %>
<% admin.link block "<i class='uk-icon-ban'></i>" <% param.item %> %>
@ -339,6 +343,7 @@ $(function() {
</td>
<td class='uk-text-right uk-text-nowrap;'>
<% item.link delete "<i class='uk-icon-trash-o'></i>" %>
<% admin.link block "<i class='uk-icon-ban'></i>" <% item.self %> %>
<% item.link edit "<i class='uk-icon-pencil'></i>" %>
</td>
</tr>

View file

@ -545,36 +545,6 @@ Admin.prototype.users_action = function() {
return;
}
Admin.prototype.update_action = function () {
var action = req.data.action;
switch (req.data.type) {
case 'site':
var site = Site.getById(req.data.id);
if (site && site.getPermission(action)) {
switch (action) {
case 'delete':
req.postParams.proceed = true;
Site.prototype.delete_action.call(site);
break;
}
}
break;
case 'user':
var user = User.getById(req.data.id);
if (user) {
switch (action) {
case 'block':
if (user.status !== User.PRIVILEGED) {
user.status = User.BLOCKED;
}
break;
}
}
break;
}
res.redirect(req.data.http_referer);
};
/**
*
* @param {Object} data
@ -709,6 +679,7 @@ Admin.prototype.renderActivity = function (item) {
user: item.creator ? item.creator.name : item.name,
href: item.href(item.constructor === User ? 'edit' : ''),
linkCount: getLinkCount(item),
alert: getAlert(item)
//site: item.site && item.site.name
};
param.warn = param.linkCount > 2 ? true : false;
@ -724,7 +695,7 @@ Admin.prototype.renderActivity = function (item) {
return item.getAbstract();
case File:
case User:
return item.name;
return item.email
case Image:
res.push();
item.thumbnail_macro({'class': 'uk-thumbnail'}, 'thumbnail');
@ -740,7 +711,7 @@ Admin.prototype.renderActivity = function (item) {
case Root:
case Site:
res.push();
image_macro({}, '/ant-icon.png');
html.tag('i', {'class': 'av-ant'});
return res.pop();
case Comment:
name = 'comment-o';
@ -764,6 +735,15 @@ Admin.prototype.renderActivity = function (item) {
return "<i class='uk-icon uk-icon-" + name + "'></i>";
}
function getAlert(item) {
switch (item.constructor) {
case User:
return item.status !== User.BLOCKED && item.created - item.modified < 1;
case Site:
return item.status !== Site.DELETED && item.created - item.modified < 1;
}
return false;
}
};
/**
@ -794,21 +774,6 @@ Admin.prototype.href = function (action, id) {
switch (action) {
case 'main':
action = '.';
case 'delete':
case 'edit':
if (id) {
if (req.action === 'users' && (id === session.user._id)) {
return;
}
if (req.action === 'sites' && (id === root._id)) {
return;
}
action = req.action + '?action=' + action + '&id=' + id;
if (req.queryParams.page) {
action += '&page=' + req.queryParams.page;
}
action += '#' + id;
}
break;
}
return root.href('admin') + '/' + action;
@ -869,7 +834,7 @@ Admin.prototype.link_macro = function (param, action, text, target) {
case 'block':
var user = target.creator || target;
if (user.status !== User.PRIVILEGED && user.status !== User.BLOCKED) {
var url = this.href('update') + '?action=block&type=user&id=' + user._id;
var url = user.href('block');
return renderLink.call(global, param, url, text || String.EMPTY, this);
}
break;
@ -877,11 +842,11 @@ Admin.prototype.link_macro = function (param, action, text, target) {
case 'delete':
var site = target.constructor === Site ? target : target.site;
if (site && site.getPermission(action) && site.mode !== Site.DELETED) {
var url = this.href('update') + '?action=delete&type=site&id=' + site._id;
var url = site.href('delete') + '?safemode';
return renderLink.call(global, param, url, text || String.EMPTY, this);
}
}
return;
}
return HopObject.prototype.link_macro.call(this, param, action, text);
}
};

View file

@ -182,7 +182,13 @@ HopObject.prototype.delete_action = function() {
text: this.getConfirmText(req.action),
extra: this.getConfirmExtra(req.action) || String.EMPTY
});
res.handlers.site.renderSkin('Site#page');
if (req.data.http_get_remainder === 'safemode') {
res.skinpath = root.layout.getSkinPath();
res.handlers.site.renderSkin('$Site#page');
} else {
res.handlers.site.renderSkin('Site#page');
}
return;
};

View file

@ -167,6 +167,7 @@ Images.Default = new function() {
function isSprite(name) {
return !{
'favicon.png': true,
'big.gif': true,
'dot.gif': true,
'marquee.gif': true,
@ -179,8 +180,9 @@ Images.Default = new function() {
add('ant.png', 'Ant');
add('ant-icon.png', 'Tiny Ant');
add('big.gif', String.EMPTY);
add('bullet.gif', '*');
add('bullet.gif', '');
add('dot.gif', String.EMPTY);
add('favicon.png', String.EMPTY);
add('headbg.gif', String.EMPTY);
add('helma.png', 'Helma Object Publisher');
add('hop.gif', 'Helma Object Publisher');
@ -197,7 +199,7 @@ Images.Default = new function() {
add('spritesheet.png', 'Antville Sprite Sheet');
add('status.gif', 'status');
add('webloghead.gif', 'Antville');
add('xmlbutton.gif', 'XML version of this page');
add('xmlbutton.gif', 'RSS Feed');
return images;
}

View file

@ -245,11 +245,57 @@
<ShortName><% site.title %></ShortName>
<Description>Search the site <% site.href %></Description>
<Tags>antville search</Tags>
<Image height="16" width="16" type="image/vnd.microsoft.icon"><% image /ant-icon.png url %></Image>
<Image height="16" width="16" type="image/vnd.microsoft.icon"><% image /favicon.png url %></Image>
<Url type="text/html" template="<% site.href search %>?q={searchTerms}" />
<Query role="example" searchTerms="cat" />
</OpenSearchDescription>
<% #page %>
<!DOCTYPE html>
<html <% site.locale prefix='lang=' %>>
<head>
<meta charset='utf-8'>
<title><% response.title %></title>
<link rel='icon' type='image/x-icon' href='<% image /favicon.png url %>'>
<link rel='shortcut icon' type='image/x-icon' href='<% image /favicon.png url %>'>
<link rel='search' type='application/opensearchdescription+xml' href='<% site.href search.xml %>' title='<% site.title %>'>
<link rel='alternate' type='application/rss+xml' title='Stories and comments of <% site.title %>' href='<% site.href rss.xml %>'>
<link rel='alternate' type='application/rss+xml' title='Stories of <% site.title %>' href='<% site.href stories.xml %>'>
<link rel='alternate' type='application/rss+xml' title='Comments of <% site.title %>' href='<% site.href comments.xml %>'>
<link rel='alternate' type='application/rss+xml' title='Sites of <% root.title %>' href='<% root.href updates.xml %>'>
<link rel='stylesheet' type='text/css' href='<% root.href main.css %>'>
<script type='text/javascript' src='<% root.href main.js %>'></script>
</head>
<body class='uk-container-center av-page'>
<body class='uk-container-center av-page'>
<% site.skin $Site#header %>
<div class='uk-grid'>
<div class='uk-width-7-10'>
<% response.message prefix="<div class='uk-alert' data-uk-alert>" suffix=</div> %>
<% response.body %>
</div>
<div class='uk-width-3-10'>
<div class='uk-margin-large-left av-border-left'>
<% membership.status %>
<ul class='uk-nav uk-nav-side'>
<li class='uk-nav-divider'/>
<% site.skin Site#navigation %>
<li class='uk-nav-divider'/>
<li class='uk-margin-left'>
<% site.skin Site#search %>
</li>
<li class='uk-nav-header'/>
<li class='uk-margin-left uk-text-small'>
<% site.calendar %>
</li>
</ul>
</div>
</div>
</div>
<% site.skin $Site#footer %>
</body>
</html>
<% #header %>
<header class='av-header'>
<div class='av-header-bg'>
@ -523,6 +569,15 @@ h1 a, .uk-table a {
vertical-align: middle;
}
.av-ant {
display: inline-block;
margin: 0 0 -2px -2px;
width: 15px;
height: 15px;
background: url(/static/img/ant.svg);
background-size: 15px 15px;
}
.av-border-left {
border-left: 1px solid @muted-background;
}

View file

@ -52,8 +52,8 @@ prefix="Last update: " default="None so far" %>)</span></li>
<head>
<meta charset='utf-8'>
<title><% response.title %></title>
<link rel='icon' type='image/x-icon' href='<% image /ant-icon.png url %>'>
<link rel='shortcut icon' type='image/x-icon' href='<% image /ant-icon.png url %>'>
<link rel='icon' type='image/x-icon' href='<% image /favicon.png url %>'>
<link rel='shortcut icon' type='image/x-icon' href='<% image /favicon.png url %>'>
<link rel='search' type='application/opensearchdescription+xml' href='<% site.href search.xml %>' title='<% site.title %>'>
<link rel='alternate' type='application/rss+xml' title='Stories and comments of <% site.title %>' href='<% site.href rss.xml %>'>
<link rel='alternate' type='application/rss+xml' title='Stories of <% site.title %>' href='<% site.href stories.xml %>'>

View file

@ -1,6 +1,6 @@
<% #page %>
<!DOCTYPE html>
<html>
<html <% site.locale prefix='lang=' %>>
<head>
<meta charset='utf-8'>
<title><% response.title %></title>

View file

@ -17,7 +17,7 @@
<% gettext 'Have a lot of fun!' %>
</p>
<p>
<% image /ant.png %>
<% image /favicon.png width=50 height=auto %>
</p>
<% #subscriptions %>

View file

@ -401,6 +401,11 @@ User.prototype.edit_action = function () {
res.handlers.site.renderSkin('Site#page');
};
User.prototype.block_action = function () {
this.status = User.BLOCKED;
res.redirect(req.data.http_referer);
};
User.prototype.getConfirmText = function () {
return gettext('You are about to delete the account {0}.',
this.getTitle());

160
static/img/ant.svg Normal file
View file

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:cc="http://web.resource.org/cc/"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:ns1="http://sozi.baierouge.fr"
id="ant"
sodipodi:docname="Andy_-_ant.svg"
sodipodi:modified="true"
viewBox="0 0 128 128"
sodipodi:version="0.32"
version="1.0"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:version="0.44+devel"
sodipodi:docbase="/home/rejon/Documents/projects/openclipartlibrary/art"
>
<sodipodi:namedview
id="base"
bordercolor="#666666"
inkscape:pageshadow="2"
guidetolerance="10.0"
pagecolor="#ffffff"
gridtolerance="10.0"
inkscape:zoom="2.9609375"
objecttolerance="10.0"
borderopacity="1.0"
inkscape:current-layer="ant"
inkscape:cx="64"
inkscape:cy="63.358311"
inkscape:window-y="382"
inkscape:window-x="424"
inkscape:window-height="577"
inkscape:pageopacity="0.0"
inkscape:window-width="852"
/>
<g transform="translate(65,-28) rotate(45)">
<path
id="ant-shape"
style="fill:#222"
d="m17.177 23.931c-1.026 0.841 7.226 11.285 7.735 11.893 7.05 8.436 14.029 8.726 14.892 9.985 0.87 1.251 5.028 5.437 12.424 6.668 0.028 1.923 0.134 3.74 0.332 5.466-4.546-1.252-9.666-2.327-12.53-2.32-3.019-0.007-13.244 2.85-15.075 3.706-0.644 0.304-12.325 0.007-12.325 1.279 0 1.287 11.632 1.761 12.113 1.111 4.221 0.671 16.178-1.514 17.451-1.287 1.273 0.24 11.066 3.09 11.137 3.104 0.735 3.38 1.803 5.225 3.069 7.481-4.865-0.141-13.598 4.674-18.47 9.546-4.044 4.045-10.783 10.585-11.801 12.028-3.805 5.374-2.101 22.179 0.007 22.179 1.654 0-2.306-15.044 1.499-20.418 1.096-1.549 13.35-9.914 14.778-11.555 1.429-1.64 9.023-3.988 12.205-6.364-3.203 2.072-5.395 5.311-5.395 9.766 0 16.541 8.633 23.211 15.118 23.291 0 0 0.007 0.02 0.021 0.02h0.042 0.043 0.042c6.477-0.08 15.069-6.77 15.069-23.283 0.007-4.151-1.91-7.269-4.752-9.348 3.458 2.213 10.239 4.384 11.582 5.926 1.436 1.633 13.632 9.998 14.732 11.554 3.82 5.367-0.14 20.431 1.53 20.431 2.09 0 3.81-16.811 0-22.185-1.02-1.435-7.755-7.969-11.8-12.014-4.879-4.879-13.598-9.694-18.47-9.546 1.266-2.255 2.327-4.15 3.069-7.537 0.064-0.008 9.857-2.815 11.137-3.048s13.23 1.959 17.454 1.28c0.48 0.657 12.12 0.177 12.11-1.103 0.01-1.28-11.71-1.004-12.35-1.308-1.83-0.863-12.002-3.713-15.029-3.713-2.864 0.007-8.025 1.082-12.572 2.32 0.198-1.712 0.346-3.529 0.375-5.452 7.396-1.245 11.561-5.424 12.416-6.675 0.87-1.252 7.849-1.542 14.9-9.992 0.5-0.601 8.76-11.052 7.73-11.886-1.21-0.983-8.78 8.761-9.08 9.616-2.05 1.019-11.796 7.51-12.97 7.977-1.181 0.459-7.12 2.581-13.435 6.364-0.969-3.699-3.408-6.209-6.392-7.538 4.122-0.007 7.121-0.813 7.121-5.353 0-4.964-0.955-9.539-2.56-13.209 4.391-2.284 7.573-4.73 8.527-5.077 0.955-0.36 1.323-1.676-0.487-4.999-2.984-5.4589-6.216-10.189-6.916-9.9278-0.7 0.2758 2.567 10.911 5.367 13.202-3.316 0.587-5.494 1.662-8.259 3.578-2.178-3.295-4.978-5.275-8.068-5.325-0.007-0.007-0.014-0.028-0.021-0.021-0.029 0-0.064-0.007-0.092-0.007-3.097 0.042-5.954 2.051-8.125 5.353-2.772-1.909-4.935-3.012-8.245-3.606 2.8-2.277 6.088-12.905 5.388-13.167-0.7-0.2614-3.952 4.4338-6.936 9.893-1.818 3.33-1.422 4.674-0.467 5.02 0.962 0.354 4.144 2.8 8.535 5.084-1.612 3.663-2.567 8.252-2.567 13.216 0 4.526 2.998 5.346 7.113 5.346-2.976 1.336-5.416 3.846-6.385 7.531-6.314-3.784-12.282-5.877-13.456-6.343-1.181-0.46-10.918-7.001-12.968-8.019-0.297-0.848-7.849-10.578-9.065-9.588z"
/>
</g>
<metadata
>
<rdf:RDF
>
<cc:Work
>
<dc:format
>image/svg+xml</dc:format
>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage"
/>
<cc:license
rdf:resource="http://creativecommons.org/licenses/publicdomain/"
/>
<dc:publisher
>
<cc:Agent
rdf:about="http://openclipart.org/"
>
<dc:title
>Openclipart</dc:title
>
</cc:Agent
>
</dc:publisher
>
<dc:title
>Ant Icon</dc:title
>
<dc:date
>2006-08-29T21:35:51</dc:date
>
<dc:description
>This is a lame flat version of Andy's ant ready for use as a solid element in a logo or on a poster.</dc:description
>
<dc:source
>https://openclipart.org/detail/69/ant-icon-by-rejon</dc:source
>
<dc:creator
>
<cc:Agent
>
<dc:title
>rejon</dc:title
>
</cc:Agent
>
</dc:creator
>
<dc:subject
>
<rdf:Bag
>
<rdf:li
>animal</rdf:li
>
<rdf:li
>ant</rdf:li
>
<rdf:li
>black</rdf:li
>
<rdf:li
>bug</rdf:li
>
<rdf:li
>flat</rdf:li
>
<rdf:li
>insect</rdf:li
>
<rdf:li
>monochrome</rdf:li
>
<rdf:li
>no contour</rdf:li
>
<rdf:li
>poster</rdf:li
>
<rdf:li
>silhouette</rdf:li
>
<rdf:li
>solid</rdf:li
>
</rdf:Bag
>
</dc:subject
>
</cc:Work
>
<cc:License
rdf:about="http://creativecommons.org/licenses/publicdomain/"
>
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction"
/>
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution"
/>
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks"
/>
</cc:License
>
</rdf:RDF
>
</metadata
>
</svg
>

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
static/img/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB