Clean up planning + markdown

master
aeris 5 years ago
parent 114234247f
commit 8079e8d75e
  1. 1
      Gemfile
  2. 2
      Gemfile.lock
  3. 9
      source/index.html.erb
  4. 8
      source/javascripts/site.js.coffee

@ -11,6 +11,7 @@ gem 'pry-byebug'
gem 'actionmailer'
gem 'icalendar'
gem 'redcarpet'
gem 'tzinfo-data', platforms: %i[mswin mingw jruby]
gem 'wdm', platforms: %i[mswin mingw]

@ -157,6 +157,7 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
redcarpet (3.4.0)
sass (3.4.25)
servolux (0.13.0)
sprockets (3.7.1)
@ -185,6 +186,7 @@ DEPENDENCIES
middleman-livereload
middleman-sprockets
pry-byebug
redcarpet
tzinfo-data
wdm

@ -1,4 +1,8 @@
<%
require 'redcarpet'
render = Redcarpet::Render::HTML
markdown = Redcarpet::Markdown.new render, autolink: true
planning = YAML.load File.read File.join Middleman::Application.root, 'config/current.yml'
def parse_time(time)
@ -62,7 +66,10 @@
<%= event[:author] %>
</div>
<div class="description">
<%= event[:description] %>
<%=
description = event[:description]
markdown.render description if description
%>
</div>
<% end %>
<% end %>

@ -130,8 +130,8 @@ class Modal
@header.querySelector('.title').textContent = title
author = @event.querySelector('.author').textContent
@header.querySelector('.author').textContent = author
description = @event.querySelector('.description').textContent
@body.textContent = ''
description = @event.querySelector('.description').innerHTML
@body.innerHTML = ''
@modal.classList.remove 'transition'
@act [
@ -144,7 +144,7 @@ class Modal
],
[20, =>
@transition @modal, null, =>
@body.textContent = description
@body.innerHTML = description
@modal.style.top = "#{modal.top}px"
@modal.style.left = "#{modal.left}px"
@ -163,7 +163,7 @@ class Modal
@transition @modal, null, =>
@modal.classList.add 'hidden'
@body.textContent = ''
@body.innerHTML = ''
@start()
]
]

Loading…
Cancel
Save