post command, cammie

This commit is contained in:
Lorin Werthen 2016-08-14 10:12:19 +02:00
parent 31bd17f760
commit 55c9184d35
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
7 changed files with 120 additions and 20 deletions

View file

@ -22,4 +22,5 @@ gem 'autoprefixer-rails'
group :development do
gem 'adsf'
gem 'guard-nanoc'
gem 'highline'
end

View file

@ -34,6 +34,7 @@ GEM
nanoc (~> 4.0)
hamster (3.0.0)
concurrent-ruby (~> 1.0)
highline (1.7.8)
icalendar (2.4.0)
json (2.0.2)
kramdown (1.11.1)
@ -83,6 +84,7 @@ DEPENDENCIES
builder
coffee-script
guard-nanoc
highline
icalendar
kramdown
nanoc (= 4.2.4)

3
Rules
View file

@ -129,9 +129,6 @@ passthrough '/assets/images/*.{png}'
#
#
#
# HOMEPAGE
#
#
# ASSETS
#

49
commands/post.rb Normal file
View file

@ -0,0 +1,49 @@
require 'highline/import'
require 'yaml'
usage 'post [options]'
aliases :p
summary 'Add a new post'
description 'Adds a new post, filling in and validating metadata.'
def bold_say(str)
say "<%= color %(#{str}), :bold %>"
end
def bold_ask(str, *args)
ask "<%= color %(#{str}), :bold %>", *args
end
run do |_opts, _args, _cmd|
result_hash = {}
bold_say "Let's make a new post, shall we?"
bold_say('-' * 20)
puts
bold_say 'What kind of post will it be?'
type = choose do |menu|
default = :event
menu.prompt = "(default #{default})"
menu.choice :blog
menu.choice :event
menu.default = default
end
puts
result_hash['title'] = bold_ask 'What will the title be?'
puts
result_hash['time'] = bold_ask 'When will the event take place?', Date
puts
result_hash['banner'] = bold_ask 'Supply a link to the banner of the event, please' if type == :event
puts result_hash.to_yaml
end

View file

@ -1,7 +1,10 @@
#cammie {
object-fit: contain;
max-width: 100%;
height: auto;
#cammie-container {
display: flex;
justify-content: center;
position: relative;
width: 100%;
}
.fullpage {

View file

@ -1,3 +1,7 @@
html, body {
height: 100%;
width: 100%;
}
.fa-ul {
list-style: none !important;

View file

@ -3,22 +3,66 @@ navigable: true
title: Cammie
---
<img id="cammie" src="https://kelder.zeus.ugent.be/webcam/video/mjpg.cgi?profileid=2" alt="" />
<section class="hero is-fullheight">
<!-- Hero header: will stick at the top -->
<div class="hero-head">
<%= render '/partials/_navbar.*' %>
</div>
<div id="left" class="ctrl">
<%= fa 'chevron-left', size: '2x' %>
</div>
<!-- Hero content: will be in the middle -->
<div class="hero-body">
<!--
<div id="cammie-container">
<img id="cammie" src="https://kelder.zeus.ugent.be/webcam/video/mjpg.cgi?profileid=2" alt="" />
</div>
-->
<div id="right" class="ctrl">
<%= fa 'chevron-right', size: '2x' %>
</div>
<div class="columns">
<div class="column">top</div>
<div class="column">top</div>
<div class="column">top</div>
</div>
<div class="columns">
<div class="column">mid</div>
<div class="column">mid</div>
<div class="column">mid</div>
</div>
<div class="columns">
<div class="column">bot</div>
<div class="column">bot</div>
<div class="column">bot</div>
</div>
<div id="up" class="ctrl">
<%= fa 'chevron-up', size: '2x' %>
</div>
<div id="left" class="ctrl">
<%= fa 'chevron-left', size: '2x' %>
</div>
<div id="right" class="ctrl">
<%= fa 'chevron-right', size: '2x' %>
</div>
<div id="up" class="ctrl">
<%= fa 'chevron-up', size: '2x' %>
</div>
<div id="down" class="ctrl">
<%= fa 'chevron-down', size: '2x' %>
</div>
</div>
<!-- Hero footer: will stick at the bottom -->
<div class="hero-foot">
<nav class="tabs is-boxed is-fullwidth">
<div class="container">
<ul>
<li><a>Kleine Tafel</a></li>
<li><a>Grote Tafel</a></li>
<li><a>Zetel</a></li>
</ul>
</div>
</nav>
</div>
</section>
<div id="down" class="ctrl">
<%= fa 'chevron-down', size: '2x' %>
</div>
<%= asset :js, :cammie %>