Permalink
Browse files

Finish english version

  • Loading branch information...
1 parent 60245e2 commit 69bb1faa8428c4ad0f6f6c5732499485a400beb3 @ebeigarts committed Mar 28, 2013
Showing with 128 additions and 60 deletions.
  1. +0 −1 Gemfile
  2. +0 −2 Gemfile.lock
  3. +0 −18 Rakefile
  4. +19 −0 bin/astro-compile
  5. +13 −0 bin/astro-preview
  6. +30 −16 en.html
  7. BIN images/astro-shop.jpg
  8. +21 −8 lv.html
  9. +0 −7 preview.rb
  10. +45 −8 template.html
View
@@ -1,5 +1,4 @@
source "https://rubygems.org"
-gem "rake"
gem "sinatra"
gem "liquid"
View
@@ -5,7 +5,6 @@ GEM
rack (1.5.2)
rack-protection (1.5.0)
rack
- rake (10.0.3)
sinatra (1.4.2)
rack (~> 1.5, >= 1.5.2)
rack-protection (~> 1.4)
@@ -17,5 +16,4 @@ PLATFORMS
DEPENDENCIES
liquid
- rake
sinatra
View
@@ -1,18 +0,0 @@
-task :default do
- require 'yaml'
- require 'liquid'
-
- views = {}
- Dir["*.yml"].each do |path|
- views.merge!(YAML.load_file(path))
- end
-
- views.each do |locale, view|
- view["locale"] = locale
- template = Liquid::Template.parse(File.read("template.html"))
- result = template.render(view)
- File.open("#{locale}.html", "wb") do |f|
- f.write result
- end
- end
-end
View
@@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+
+require 'yaml'
+require 'liquid'
+
+views = {}
+Dir["*.yml"].each do |path|
+ views.merge!(YAML.load_file(path))
+end
+
+views.each do |locale, view|
+ puts "Rendering #{locale}.html"
+ view["locale"] = locale
+ template = Liquid::Template.parse(File.read("template.html"))
+ result = template.render(view)
+ File.open("#{locale}.html", "wb") do |f|
+ f.write result
+ end
+end
View
@@ -0,0 +1,13 @@
+#!/usr/bin/env ruby
+
+require 'sinatra'
+
+get '/*' do
+ path = File.join(File.dirname(__FILE__), '..', *params[:splat])
+ if path =~ /.html$/
+ load File.join(File.dirname(__FILE__), 'astro-compile')
+ File.read(path).gsub(/\{\/?[a-z\:]+[^\}]*\}/i, '')
+ else
+ File.read(path)
+ end
+end
View
46 en.html
@@ -23,9 +23,13 @@
.pull-right { float: right; }
/* #top-bar */
#top-bar { background: #000; overflow: hidden; height: 34px; }
- #social { float: right; padding-right: 15px }
+ #locales { float: left; padding-left: 20px; }
+ #locales a { font-size: 14px; display: inline-block; margin: 7px 0; }
+ #locales a.active { color: #fff; }
+ #locales .sep { color: #555; }
+ #social { float: right; padding-right: 20px }
#social iframe { float: left; border:none; margin: 7px; width: 120px; height: 20px; }
- #social a { display: block; float: left; margin: 7px; height: 20px; overflow: hidden; opacity: 0.9; }
+ #social a { display: block; float: left; margin: 7px 0 7px 14px; height: 20px; overflow: hidden; opacity: 0.9; }
#social a:hover { opacity: 1.0; }
#tumblr_controls { top: 34px !important; }
/* #nav-bar */
@@ -88,6 +92,11 @@
<body>
<div id="top-bar">
<div class="container">
+ <div id="locales">
+ <a href="http://astronout.lv/">Latviski</a>
+ <span class="sep">|</span>
+ <a href="http://en.astronout.lv/" class="active">English</a>
+ </div>
<div id="social">
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fastronout.lv%2F&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=dark&amp;font=arial&amp;height=21&amp;appId=348126495249042" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
<a href="http://www.facebook.com/astronout" target="_blank">
@@ -239,7 +248,13 @@ <h2>Gigs</h2>
</a>
</div>
-
+ <div id="ad-store">
+
+ <a href="https://www.ekase.lv/en/merchandise/astro-n-out/">
+ <img src="http://static.tumblr.com/qtngqf7/ceYmkd0qj/astro-shop.jpg" alt="Astro Shop" />
+ </a>
+
+ </div>
</div>
</div>
</div>
@@ -301,7 +316,7 @@ <h3>Contacts</h3>
<a href="[[url]]">[[title]]</a>
</div>
<div class="body">
- <iframe width="500" height="281" src="[[embed_url]]" frameborder="0" allowfullscreen></iframe>
+ <iframe width="500" height="281" src="[[embed_url]]" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>
</div>
</div>
</script>
@@ -379,30 +394,29 @@ <h3>Contacts</h3>
});
})();
- // YouTube Videos
+
+
+
+ // Vimeo videos
(function() {
if (window.location.pathname == "/videos") {
var template = $('#video-template').html();
- var url = 'http://gdata.youtube.com/feeds/base/users/astronoutTV/uploads?alt=json&v=2&orderby=published&callback=?';
- $.getJSON(url, function(data) {
+ var url = 'http://vimeo.com/api/v2/astronout/videos.json?callback=?';
+ $.getJSON(url, function(items) {
$("#posts .body").remove();
- var items = data.feed.entry;
- $.each(data.feed.entry, function(i, item) {
- var item = items[i];
- var feedURL = item.link[1].href;
- var fragments = feedURL.split("/");
- var videoID = fragments[fragments.length - 1].replace("?v=2", "");
+ $.each(items, function(i, item) {
var view = {
- title: item.title.$t,
- url: "http://www.youtube.com/watch?v="+ videoID,
- embed_url: "http://www.youtube.com/embed/"+ videoID +"?wmode=transparent"
+ title: item.title,
+ url: item.url,
+ embed_url: "http://player.vimeo.com/video/"+ item.id
};
var html = Mustache.render(template, view);
$("#posts").append(html);
});
});
}
})();
+
// Facebook photo albums
(function() {
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
29 lv.html
@@ -23,9 +23,13 @@
.pull-right { float: right; }
/* #top-bar */
#top-bar { background: #000; overflow: hidden; height: 34px; }
- #social { float: right; padding-right: 15px }
+ #locales { float: left; padding-left: 20px; }
+ #locales a { font-size: 14px; display: inline-block; margin: 7px 0; }
+ #locales a.active { color: #fff; }
+ #locales .sep { color: #555; }
+ #social { float: right; padding-right: 20px }
#social iframe { float: left; border:none; margin: 7px; width: 120px; height: 20px; }
- #social a { display: block; float: left; margin: 7px; height: 20px; overflow: hidden; opacity: 0.9; }
+ #social a { display: block; float: left; margin: 7px 0 7px 14px; height: 20px; overflow: hidden; opacity: 0.9; }
#social a:hover { opacity: 1.0; }
#tumblr_controls { top: 34px !important; }
/* #nav-bar */
@@ -88,6 +92,11 @@
<body>
<div id="top-bar">
<div class="container">
+ <div id="locales">
+ <a href="http://astronout.lv/" class="active">Latviski</a>
+ <span class="sep">|</span>
+ <a href="http://en.astronout.lv/">English</a>
+ </div>
<div id="social">
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fastronout.lv%2F&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=dark&amp;font=arial&amp;height=21&amp;appId=348126495249042" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
<a href="http://www.facebook.com/astronout" target="_blank">
@@ -239,13 +248,13 @@ <h2>Koncerti</h2>
</a>
</div>
-
<div id="ad-store">
- <a href="https://www.ekase.lv/lv/suveniri/astro-n-out/">
- <img src="http://static.tumblr.com/qtngqf7/6O3mk41u0/astro-veikals.jpg" alt="Astro Veikals" />
- </a>
+
+ <a href="https://www.ekase.lv/lv/suveniri/astro-n-out/">
+ <img src="http://static.tumblr.com/qtngqf7/6O3mk41u0/astro-veikals.jpg" alt="Astro Veikals" />
+ </a>
+
</div>
-
</div>
</div>
</div>
@@ -307,7 +316,7 @@ <h3>Kontakti</h3>
<a href="[[url]]">[[title]]</a>
</div>
<div class="body">
- <iframe width="500" height="281" src="[[embed_url]]" frameborder="0" allowfullscreen></iframe>
+ <iframe width="500" height="281" src="[[embed_url]]" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>
</div>
</div>
</script>
@@ -385,6 +394,7 @@ <h3>Kontakti</h3>
});
})();
+
// YouTube Videos
(function() {
if (window.location.pathname == "/videos") {
@@ -409,6 +419,9 @@ <h3>Kontakti</h3>
});
}
})();
+
+
+
// Facebook photo albums
(function() {
View
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-
-require "sinatra"
-
-get "/*" do
- File.read(File.join(File.dirname(__FILE__), *params[:splat])).gsub(/\{\/?[a-z\:]+[^\}]*\}/i, '')
-end
View
@@ -23,9 +23,13 @@
.pull-right { float: right; }
/* #top-bar */
#top-bar { background: #000; overflow: hidden; height: 34px; }
- #social { float: right; padding-right: 15px }
+ #locales { float: left; padding-left: 20px; }
+ #locales a { font-size: 14px; display: inline-block; margin: 7px 0; }
+ #locales a.active { color: #fff; }
+ #locales .sep { color: #555; }
+ #social { float: right; padding-right: 20px }
#social iframe { float: left; border:none; margin: 7px; width: 120px; height: 20px; }
- #social a { display: block; float: left; margin: 7px; height: 20px; overflow: hidden; opacity: 0.9; }
+ #social a { display: block; float: left; margin: 7px 0 7px 14px; height: 20px; overflow: hidden; opacity: 0.9; }
#social a:hover { opacity: 1.0; }
#tumblr_controls { top: 34px !important; }
/* #nav-bar */
@@ -88,6 +92,11 @@
<body>
<div id="top-bar">
<div class="container">
+ <div id="locales">
+ <a href="http://astronout.lv/"{% if locale == 'lv' %} class="active"{% endif %}>Latviski</a>
+ <span class="sep">|</span>
+ <a href="http://en.astronout.lv/"{% if locale == 'en' %} class="active"{% endif %}>English</a>
+ </div>
<div id="social">
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fastronout.lv%2F&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=dark&amp;font=arial&amp;height=21&amp;appId=348126495249042" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
<a href="http://www.facebook.com/astronout" target="_blank">
@@ -239,13 +248,17 @@ <h2>{{events}}</h2>
</a>
</div>
- {% if locale == 'lv' %}
<div id="ad-store">
- <a href="https://www.ekase.lv/lv/suveniri/astro-n-out/">
- <img src="http://static.tumblr.com/qtngqf7/6O3mk41u0/astro-veikals.jpg" alt="Astro Veikals" />
- </a>
+ {% if locale == 'lv' %}
+ <a href="https://www.ekase.lv/lv/suveniri/astro-n-out/">
+ <img src="http://static.tumblr.com/qtngqf7/6O3mk41u0/astro-veikals.jpg" alt="Astro Veikals" />
+ </a>
+ {% elsif locale == 'en' %}
+ <a href="https://www.ekase.lv/en/merchandise/astro-n-out/">
+ <img src="http://static.tumblr.com/qtngqf7/ceYmkd0qj/astro-shop.jpg" alt="Astro Shop" />
+ </a>
+ {% endif %}
</div>
- {% endif %}
</div>
</div>
</div>
@@ -307,7 +320,7 @@ <h3>{{contacts}}</h3>
<a href="[[url]]">[[title]]</a>
</div>
<div class="body">
- <iframe width="500" height="281" src="[[embed_url]]" frameborder="0" allowfullscreen></iframe>
+ <iframe width="500" height="281" src="[[embed_url]]" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>
</div>
</div>
</script>
@@ -385,6 +398,7 @@ <h3>{{contacts}}</h3>
});
})();
+ {% if locale == 'lv' %}
// YouTube Videos
(function() {
if (window.location.pathname == "/videos") {
@@ -409,6 +423,29 @@ <h3>{{contacts}}</h3>
});
}
})();
+ {% endif %}
+
+ {% if locale == 'en' %}
+ // Vimeo videos
+ (function() {
+ if (window.location.pathname == "/videos") {
+ var template = $('#video-template').html();
+ var url = 'http://vimeo.com/api/v2/astronout/videos.json?callback=?';
+ $.getJSON(url, function(items) {
+ $("#posts .body").remove();
+ $.each(items, function(i, item) {
+ var view = {
+ title: item.title,
+ url: item.url,
+ embed_url: "http://player.vimeo.com/video/"+ item.id
+ };
+ var html = Mustache.render(template, view);
+ $("#posts").append(html);
+ });
+ });
+ }
+ })();
+ {% endif %}
// Facebook photo albums
(function() {

0 comments on commit 69bb1fa

Please sign in to comment.