diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-10-01 17:33:44 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-10-01 17:33:44 -0400 |
| commit | 11c3fdd0edf43a05e3b5c169b699a08b814dd3f6 (patch) | |
| tree | f392ca4f5d4ae529d71ab760e1b482146d53453b /views/projects | |
| parent | 38789b1e41fc6f62ca19753ead514e1f5df29283 (diff) | |
get rid of iframes, show a few pix instead
Diffstat (limited to 'views/projects')
| -rw-r--r-- | views/projects/list-projects.ejs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/views/projects/list-projects.ejs b/views/projects/list-projects.ejs index 537d409..c110934 100644 --- a/views/projects/list-projects.ejs +++ b/views/projects/list-projects.ejs @@ -5,7 +5,14 @@ [[ projects.forEach(function(project, i) { ]] <span class="room"> - <iframe src="/project/[[- project.slug ]]/view?noui=1&mute=1" class="embed"></iframe> + <span class="images"> + [[ mediaCount = 0 ]] + [[ project.media.some(function(media){ ]] + [[ if (media.media.type != "image") { return false } ]] + [[ if (++mediaCount > 3) { return true } ]] + <img src="[[- media.media.url ]]"> + [[ }) ]] + </span> [[ if (String(user._id) == String(project.user_id)) { ]] <a href="/project/[[- project.slug ]]/edit"><div class="editBtn">edit</div></a> [[ } ]] @@ -21,3 +28,19 @@ </div> [[ } ]] + +<style> +.room .images { + position: absolute; + top: 0; left: 0; + z-index: -1; + width: 100%; + height: 100%; + text-align: center; + overflow: hidden; +} +.room .images img { + max-height: 100%; + max-width: 100%; +} +</style> |
