This commit is contained in:
j 2016-11-29 22:02:48 +00:00
parent 1411440b97
commit fd74784672
7 changed files with 63 additions and 44 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.pyc

View file

@ -202,14 +202,6 @@
"sort": true, "sort": true,
"sortType": "title" "sortType": "title"
}, },
{
"id": "archiveid",
"title": "Archive ID",
"type": "string",
"columnWidth": 120,
"find": true,
"sort": true
},
{ {
"id": "location", "id": "location",
"title": "Location", "title": "Location",
@ -369,6 +361,13 @@
"type": "text", "type": "text",
"find": true "find": true
}, },
{
"id": "links",
"title": "Links",
"type": ["string"],
"columnWidth": 180,
"find": true
},
{ {
"id": "comments", "id": "comments",
"title": "Comments", "title": "Comments",
@ -637,7 +636,7 @@
displayed at the top of the screen. This title can be customized by adding displayed at the top of the screen. This title can be customized by adding
"/static/js/getItemTitle.SITENAME.js". "/static/js/getItemTitle.SITENAME.js".
*/ */
"itemTitleKeys": ["title", "director", "date"], "itemTitleKeys": ["title", "director", "year"],
/* /*
"itemViews" is an ordered list of available item views. Implemented views "itemViews" is an ordered list of available item views. Implemented views
are "info", "documents", "player", "editor", "timeline", "clips", "map", are "info", "documents", "player", "editor", "timeline", "clips", "map",
@ -807,20 +806,20 @@
the system (from). the system (from).
*/ */
"site": { "site": {
"description": "undercover research group video archive", "description": "Activist Media Proxy",
"email": { "email": {
// E-mail address in contact form (to) // E-mail address in contact form (to)
"contact": "contact@undercoverresearch.net", "contact": "amp@spc.org",
"footer": "-- \nundercover research group - http://undercoverresearch.net", "footer": "-- \nActivist Media Proxy - http://amp.0x2620.org",
"prefix": "undercover research group -", "prefix": "Activist Media Proxy -",
// E-mail address uses by the system (from) // E-mail address uses by the system (from)
"system": "system@undercoverresearch.net" "system": "system@amp.0x2620.org"
}, },
"https": false, "https": false,
"id": "urg", "id": "amp",
"name": "undercover research group", "name": "Activist Media Proxy",
"sendReferrer": true, "sendReferrer": true,
"url": "urg.0x2620.org" "url": "amp.0x2620.org"
}, },
/* /*
"sitePages" defines the sections of the main site dialog. If "news" is "sitePages" defines the sections of the main site dialog. If "news" is
@ -913,7 +912,7 @@
"clipColumns": 2, "clipColumns": 2,
"columns": { "columns": {
"Colors": { "Colors": {
"columns": ["title", "depositor", "collection", "language", "hue", "saturation", "brightness"], "columns": ["title", "depositor", "themes", "language", "hue", "saturation", "brightness"],
"columnWidth": {} "columnWidth": {}
} }
}, },
@ -947,13 +946,13 @@
"find": {"conditions": [], "operator": "&"}, "find": {"conditions": [], "operator": "&"},
"followPlayer": true, "followPlayer": true,
"help": "", "help": "",
"icons": "posters", "icons": "frames",
"infoIconSize": 256, "infoIconSize": 256,
"item": "", "item": "",
"itemFind": "", "itemFind": "",
"itemSort": [{"key": "position", "operator": "+"}], "itemSort": [{"key": "position", "operator": "+"}],
"itemView": "info", "itemView": "info",
"listColumns": ["title", "depositor", "collection", "topic", "language", "duration"], "listColumns": ["title", "depositor", "themes", "topic", "language", "duration"],
"listColumnWidth": {}, "listColumnWidth": {},
"listSelection": [], "listSelection": [],
"listSort": [{"key": "title", "operator": "+"}], "listSort": [{"key": "title", "operator": "+"}],
@ -1021,7 +1020,7 @@
"sidebarSize": 256, "sidebarSize": 256,
"text": "", "text": "",
"texts": {}, "texts": {},
"theme": "oxmedium", "theme": "oxlight",
"updateAdvancedFindResults": false, "updateAdvancedFindResults": false,
"videoLoop": false, "videoLoop": false,
"videoMuted": false, "videoMuted": false,

View file

@ -3,7 +3,7 @@
import os import os
from os.path import join, abspath, basename, dirname from os.path import join, abspath, basename, dirname
name = 'indymediauk' name = 'amp'
base = abspath(dirname(__file__)) base = abspath(dirname(__file__))
os.chdir(base) os.chdir(base)
@ -12,7 +12,7 @@ for root, folders, files in os.walk(join(base, 'static')):
src = join(root, f) src = join(root, f)
target = src.replace(base, '/srv/pandora') target = src.replace(base, '/srv/pandora')
rel_src = os.path.relpath(src, dirname(target)) rel_src = os.path.relpath(src, dirname(target))
if os.path.exists(target): if os.path.exists(target) or os.path.islink(target):
os.unlink(target) os.unlink(target)
os.symlink(rel_src, target) os.symlink(rel_src, target)
@ -48,7 +48,7 @@ for root, folders, files in os.walk(join(base, 'scripts')):
src = join(root, f) src = join(root, f)
target = src.replace(base, '/srv/pandora') target = src.replace(base, '/srv/pandora')
rel_src = os.path.relpath(src, dirname(target)) rel_src = os.path.relpath(src, dirname(target))
if os.path.exists(target): if os.path.exists(target) or os.path.islink(target):
os.unlink(target) os.unlink(target)
os.symlink(rel_src, target) os.symlink(rel_src, target)

View file

@ -24,7 +24,7 @@ pandora.ui.home = function() {
left: 0, left: 0,
top: 0, top: 0,
right: 0, right: 0,
bottom: '80px', bottom: '160px',
width: window.innerWidth + 'px', width: window.innerWidth + 'px',
margin: 'auto', margin: 'auto',
cursor: 'pointer' cursor: 'pointer'
@ -180,7 +180,7 @@ pandora.ui.home = function() {
} }
}), }),
$aboutButton = Ox.Button({ $aboutButton = Ox.Button({
title: Ox._('About {0}', [pandora.site.site.name]), title: Ox._('{0}', [pandora.site.site.name]),
width: 156 width: 156
}) })
.css({ .css({

View file

@ -18,11 +18,16 @@ pandora.ui.infoView = function(data) {
iconLeft = iconSize == 256 ? Math.floor((iconSize - iconWidth) / 2) : 0, iconLeft = iconSize == 256 ? Math.floor((iconSize - iconWidth) / 2) : 0,
borderRadius = ui.icons == 'posters' ? 0 : iconSize / 8, borderRadius = ui.icons == 'posters' ? 0 : iconSize / 8,
margin = 16, margin = 16,
nameKeys = [ nameKeys = pandora.site.itemKeys.filter(function(key) {
'director', 'cinematographer', 'editor', return key.sortType == 'person';
'writer', 'producer', 'featuring' }).map(function(key) {
], return key.id;
listKeys = nameKeys.concat(['language', 'themes', 'groups']), }),
listKeys = pandora.site.itemKeys.filter(function(key) {
return Ox.isArray(key.type);
}).map(function(key){
return key.id;
}),
posterKeys = nameKeys.concat(['title', 'date', 'collection']), posterKeys = nameKeys.concat(['title', 'date', 'collection']),
statisticsWidth = 128, statisticsWidth = 128,
@ -231,7 +236,7 @@ pandora.ui.infoView = function(data) {
// Groups ------------------------------------------------------------------ // Groups ------------------------------------------------------------------
renderGroup(['location', 'date', 'language', 'format', 'archiveid']); renderGroup(['location', 'date', 'language', 'format']);
renderGroup([ renderGroup([
'director', 'cinematographer', 'editor', 'director', 'cinematographer', 'editor',
@ -240,6 +245,8 @@ pandora.ui.infoView = function(data) {
renderGroup(['themes']); renderGroup(['themes']);
renderGroup(['links']);
// Summary ------------------------------------------------------------- // Summary -------------------------------------------------------------
if (canEdit || data.summary) { if (canEdit || data.summary) {
@ -253,12 +260,7 @@ pandora.ui.infoView = function(data) {
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
collapseToEnd: false, collapseToEnd: false,
editable: canEdit, editable: canEdit,
format: function(value) { format: imageCSS,
return value.replace(
/<img src=/g,
'<img style="float: left; max-width: 256px; max-height: 256px; margin: 0 16px 16px 0" src='
);
},
maxHeight: Infinity, maxHeight: Infinity,
placeholder: formatLight(Ox._('No Summary')), placeholder: formatLight(Ox._('No Summary')),
tooltip: canEdit ? pandora.getEditTooltip() : '', tooltip: canEdit ? pandora.getEditTooltip() : '',
@ -319,12 +321,7 @@ pandora.ui.infoView = function(data) {
descriptions[key] = Ox.EditableContent({ descriptions[key] = Ox.EditableContent({
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
editable: canEdit, editable: canEdit,
format: function(value) { format: imageCSS,
return value.replace(
/<img src=/g,
'<img style="float: left; max-width: 256px; max-height: 256px; margin: 0 16px 16px 0" src='
);
},
placeholder: formatLight(Ox._('No {0} Description', [Ox._(Ox.toTitleCase(key))])), placeholder: formatLight(Ox._('No {0} Description', [Ox._(Ox.toTitleCase(key))])),
tooltip: canEdit ? pandora.getEditTooltip() : '', tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea', type: 'textarea',
@ -577,6 +574,11 @@ pandora.ui.infoView = function(data) {
ret = value ? Ox.formatDate(value, ret = value ? Ox.formatDate(value,
['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length] ['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length]
) : ''; ) : '';
} else if (key == 'links') {
ret = value.split(', ').map(function(link) {
return '<a href="' + link + '">' + Ox.parseURL(link).host + '</a>';
}).join(', ');
return ret;
} else if (listKeys.indexOf(key) > -1) { } else if (listKeys.indexOf(key) > -1) {
ret = value.split(', '); ret = value.split(', ');
} else { } else {
@ -682,6 +684,23 @@ pandora.ui.infoView = function(data) {
}); });
} }
function imageCSS(value) {
var $html = $('<div>').html(value);
$html.find('img').each(function(i, img) {
var $img = $(img),
css = {
'max-width': '256px',
'max-height': '256px',
'margin': '0 16px 16px 0'
};
if (!$img.parents('figure').length) {
css['float'] = 'left';
}
$img.css(css);
});
return $html.html();
}
function renderGroup(keys) { function renderGroup(keys) {
var $element; var $element;
if (canEdit || keys.filter(function(key) { if (canEdit || keys.filter(function(key) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 7 KiB