Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support a preparing status for meetups. #80

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end
desc "Generate a page for your city!"
task :city do
unless name = ENV["NAME"]
abort "Usage: rake city NAME='YOUR_CITY_NAME, STATE' [ADDRESS='number street city state zip']"
abort "Usage: rake city NAME='YOUR_CITY_NAME, STATE' [ADDRESS='number street city state zip'] [PREPARING=true]"
end

require 'fileutils'
Expand All @@ -29,11 +29,12 @@ task :city do
# 'Banana City, NY' => 'banana_city'
directory = name.split(',')[0].downcase.gsub(/\s+/, '_')
FileUtils.mkdir_p(directory)
preparing = "\nstatus: preparing" if ENV["PREPARING"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary? why wouldn't all new open hacks be preparing by default?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, updated my branch.

File.open(File.join(directory, "index.markdown"), "w") do |file|
file.write <<-EOF
---
layout: default
title: OpenHack - #{name}
title: OpenHack - #{name}#{preparing}
---

## #{name}
Expand Down Expand Up @@ -61,12 +62,14 @@ Put down how many people came, maybe some photos or other fun stuff down here!
end
config = YAML.load_file("_config.yml")
cities = config["cities"]
cities << {directory => {
city = {
"name" => name,
"latitude" => results.first.latitude,
"longitude" => results.first.longitude
}}
config["cities"] = cities.map(&:to_a).sort.map { |city| Hash[city] }
}
city["status"] = "preparing" if ENV["PREPARING"]
cities << {directory => city}
config["cities"] = cities.sort_by { |city| city.keys.first }

File.open("_config.yml", "w") do |file|
file.write config.to_yaml
Expand Down
Empty file removed _includes/cities.html
Empty file.
46 changes: 33 additions & 13 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</head>

<body>

<header class="jumbotron">
<div class="container">
<h1><a href="/">OpenHack</a></h1>
Expand All @@ -31,24 +31,44 @@ <h1><a href="/">OpenHack</a></h1>
<div class="wrapper">
<div class="row-fluid">
<div class="cities span3" id="menu_wrapper">
<h2 id="menu_header">Cities</h2>
<div id="menu">
<ul id="cities">
{% for city in site.cities %}
<li class="city" id="{{city.first.first}}" data-latitude="{{city.first.last.latitude}}" data-longitude="{{city.first.last.longitude}}">
<a href="/{{ city.first.first }}">{{ city.first.last.name }}</a>
</li>
{% endfor %}
<li><a href="/yours">Yours?</a></li>
</ul>
</div>
<h2>Cities</h2>
<div class="menu">
<ul id="cities">
{% for city in site.cities %}
{% if city.first.last.status != "preparing" %}
<li class="city" id="{{city.first.first}}" data-latitude="{{city.first.last.latitude}}" data-longitude="{{city.first.last.longitude}}">
<a href="/{{ city.first.first }}">{{ city.first.last.name }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>

<h2>Coming Soon</h2>
<div class="menu">
<ul id="cities">
<li><a href="/yours">Yours?</a></li>

{% for city in site.cities %}
{% if city.first.last.status == "preparing" %}
<li class="city" id="{{city.first.first}}" data-latitude="{{city.first.last.latitude}}" data-longitude="{{city.first.last.longitude}}">
<a href="/{{ city.first.first }}">{{ city.first.last.name }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
<div class="main span8 offset1">
{% if page.status && page.status == "preparing %}
<p class="preparing">This meetup is still working out the details.</p>
{% endif %}

{{ content }}
</div>
</div>
</div>

<div class="footer">
<ul>
<li>Made in Buffalo, NY.</li>
Expand Down
Loading