diff --git a/app/static/css/partials/_ascroll.scss b/app/static/css/partials/_ascroll.scss index 745a11f..b68d100 100644 --- a/app/static/css/partials/_ascroll.scss +++ b/app/static/css/partials/_ascroll.scss @@ -7,11 +7,17 @@ h1 { margin: 4px; margin-top: 32px; - margin-bottom: 64px; font-size: 24px; letter-spacing: 1px; font-weight: bold; } + h2 { + margin: 4px; + } + .intro { + margin: 4px; + margin-bottom: 64px; + } .player { position: absolute; display: none; diff --git a/app/static/js/ascroll.js b/app/static/js/ascroll.js index cacb33c..e939b16 100644 --- a/app/static/js/ascroll.js +++ b/app/static/js/ascroll.js @@ -105,6 +105,19 @@ function timeupdate(event) { } } +function formatInfo(config, ascroll) { + var h1 = document.createElement('h1') + h1.innerHTML = config.title + ascroll.appendChild(h1) + var h2 = document.createElement('h2') + h2.innerHTML = config.byline + ascroll.appendChild(h2) + var div = document.createElement('div') + div.classList.add('intro') + div.innerHTML = config.body + ascroll.appendChild(div) +} + function loadItem(config) { pandoraAPI('get', {id: config.item, keys: [ 'id', 'title', 'layers', 'hue', 'saturation', 'lightness' @@ -122,10 +135,8 @@ function loadItem(config) { video.addEventListener('timeupdate', timeupdate) ascroll.appendChild(video) - var h1 = document.createElement('h1') var first - h1.innerHTML = response.data.title - ascroll.appendChild(h1) + formatInfo(config, ascroll) response.data.layers[layer].forEach(annotation => { if (config.user && annotation.user != config.user) { @@ -168,10 +179,8 @@ function loadEdit(config) { video.addEventListener('timeupdate', timeupdate) ascroll.appendChild(video) - var h1 = document.createElement('h1') var first - h1.innerHTML = response.data.name - ascroll.appendChild(h1) + formatInfo(config, ascroll) response.data.clips.forEach(clip => { clip.layers[layer].forEach(annotation => { diff --git a/app/text/models.py b/app/text/models.py index 9f67998..81c540b 100644 --- a/app/text/models.py +++ b/app/text/models.py @@ -52,5 +52,7 @@ class Text(models.Model): def json(self): data = {} data['title'] = self.title + data['byline'] = self.byline + data['body'] = self.body data.update(self.data) return json.dumps(data)