diff --git a/static/js/base.js b/static/js/base.js index ce86c33..42cbe4d 100644 --- a/static/js/base.js +++ b/static/js/base.js @@ -157,6 +157,25 @@ function isPublishedSpan (isPublished) { return span; }; +function projectCodeButtonSpan (project) { + var span = document.createElement('span'); + var tooltip = 'See Code'; + + span.classList.add('project-code-button'); + span.innerHTML = '' + + ''; + span.title = localizer.localize(tooltip); + return span; +}; + function projectURL (author, project, devVersion) { return (devVersion ? snapDevURL : snapURL) + '#present:Username=' + encodeURIComponent(author) + diff --git a/static/js/project.js b/static/js/project.js index 4e9ca0a..13f48e9 100644 --- a/static/js/project.js +++ b/static/js/project.js @@ -35,8 +35,12 @@ function itemDiv (item, itemType, ownerUsernamePath, nameField, if (extraFields) { Object.keys(extraFields).forEach(function (fieldName) { var attribute = extraFields[fieldName]; + var item_access = 'item'; + if (attribute) { + item_access += '.' + attribute; + } div.appendChild( - window[fieldName + 'Span'](eval('item.' + attribute)) + window[fieldName + 'Span'](eval(item_access)) ); }); } diff --git a/static/style/classes.css b/static/style/classes.css index 0eeb28d..38522a2 100644 --- a/static/style/classes.css +++ b/static/style/classes.css @@ -159,6 +159,11 @@ pre.in-place { background: url('../img/octagon.png'); } +/* img filler because we don't have octagon in FA free edition */ +.fa-lambda:before { + content: '\03BB'; /* Unicode for Lambda */ +} + /* Hide Discourse's meta info on images */ .lightbox > .meta { display: none; diff --git a/static/style/project.css b/static/style/project.css index 76cd65a..bf995d3 100644 --- a/static/style/project.css +++ b/static/style/project.css @@ -203,7 +203,9 @@ img.collection-thumbnail { } .collection.small span.is-public, -.project.small span.is-public { +.project.small span.is-public, +.collection.small span.is-published, +.project.small span.is-published { margin-right: 0.5em; } diff --git a/templates/collection.tmp b/templates/collection.tmp index 21aadaf..244780b 100644 --- a/templates/collection.tmp +++ b/templates/collection.tmp @@ -88,6 +88,7 @@ extraFields: { isPublic: 'ispublic', isPublished: 'ispublished', + projectCodeButton: '', author: 'username' }, withCollectionControls: true diff --git a/templates/examples.tmp b/templates/examples.tmp index 7095033..6adb2c8 100644 --- a/templates/examples.tmp +++ b/templates/examples.tmp @@ -32,6 +32,7 @@ extraFields: { isPublic: 'ispublic', isPublished: 'ispublished', + projectCodeButton: '', author: 'username' } } diff --git a/templates/my_collections.tmp b/templates/my_collections.tmp index e69905f..00d3570 100644 --- a/templates/my_collections.tmp +++ b/templates/my_collections.tmp @@ -34,6 +34,7 @@ extraFields: { isPublic: 'shared', isPublished: 'published', + projectCodeButton: '', author: 'username' } } diff --git a/templates/my_projects.tmp b/templates/my_projects.tmp index 847eb2b..fb75fc1 100644 --- a/templates/my_projects.tmp +++ b/templates/my_projects.tmp @@ -29,7 +29,8 @@ gridSize: 5, extraFields: { isPublic: 'ispublic', - isPublished: 'ispublished' + isPublished: 'ispublished', + projectCodeButton: '' } } ) diff --git a/templates/project_collections.tmp b/templates/project_collections.tmp index 9071e97..cc26d02 100644 --- a/templates/project_collections.tmp +++ b/templates/project_collections.tmp @@ -29,6 +29,7 @@ extraFields: { isPublic: 'shared', isPublished: 'published', + projectCodeButton: '', author: 'username' } } diff --git a/templates/project_remixes.tmp b/templates/project_remixes.tmp index 62d026d..6981682 100644 --- a/templates/project_remixes.tmp +++ b/templates/project_remixes.tmp @@ -27,6 +27,7 @@ extraFields: { isPublic: 'ispublic', isPublished: 'ispublished', + projectCodeButton: '', author: 'username' } } diff --git a/templates/search.tmp b/templates/search.tmp index 8770976..3c2134c 100644 --- a/templates/search.tmp +++ b/templates/search.tmp @@ -35,6 +35,7 @@ extraFields: { isPublic: 'ispublic', isPublished: 'ispublished', + projectCodeButton: '', author: 'username' } } @@ -74,6 +75,7 @@ extraFields: { isPublic: 'shared', isPublished: 'published', + projectCodeButton: '', author: 'username' } } diff --git a/templates/welcome.tmp b/templates/welcome.tmp index 5fee200..2a86496 100644 --- a/templates/welcome.tmp +++ b/templates/welcome.tmp @@ -53,6 +53,7 @@ if (username) { extraFields: { isPublic: 'ispublic', isPublished: 'ispublished', + projectCodeButton: '', author: 'username' } }