Skip to content

Commit

Permalink
youtube embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
stefl committed Jun 16, 2012
1 parent beb32c6 commit b6baa3d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 3 deletions.
13 changes: 12 additions & 1 deletion app/stylesheets/application.scss
Expand Up @@ -199,7 +199,18 @@ form {
@include leader;
}

.step_embed, .step_embed .embed, .step_embed .embed iframe {
.tale_embed, .tale_embed .embed, .tale_embed .embed iframe, .step_embed, .step_embed .embed, .step_embed .embed iframe {
@include clearfix();
@include box-sizing(border-box);
}

.tale_embed {
width: 100%;
.embed {
width: 100%;
text-align: center;
}
frame {
margin: auto !important;
}
}
4 changes: 4 additions & 0 deletions app/views/tales/_form.haml
Expand Up @@ -4,9 +4,13 @@
%div
= f.label "Where it is set, roughly (the town or city)"
= f.text_field :where
%div
= f.label "A URL to a video, photo, or audio file that summarises this tale"
= f.text_field :embed_url
%div
= f.label "Describe what happens in the story - why should someone experience it?"
~ f.text_area :description

%div
= f.label "What should the player do to start the game? Go to a particular place perhaps?"
~ f.text_area :start_the_game
3 changes: 3 additions & 0 deletions app/views/tales/show.haml
Expand Up @@ -12,6 +12,9 @@
- if @tale.account == current_account
= link_to "Manage the steps that make up this tale", url_for(:tales, :manage, :slug => @tale.slug), :class => "btn"
#description
- unless @tale.embed_url.blank?
.tale_embed
%a{:href=> @tale.embed_url}
= simple_format @tale.description

- if @tale.steps.blank?
Expand Down
1 change: 1 addition & 0 deletions models/tale.rb
Expand Up @@ -7,6 +7,7 @@ class Tale
field :where, :type => String
field :description, :type => String
field :start_the_game, :type => String
field :embed_url, :type => String

has_many :steps
belongs_to :account
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/app.js
@@ -1,3 +1,3 @@
$(function() {
$(".step_embed").embedly({key:':3ac13794740911e1ab094040d3dc5c07'});
$(".tale_embed, .step_embed").embedly({key:':3ac13794740911e1ab094040d3dc5c07'});
});
16 changes: 15 additions & 1 deletion public/stylesheets/application.css
Expand Up @@ -361,10 +361,24 @@ form button, form .btn {
}

/* line 202, ../../app/stylesheets/application.scss */
.step_embed, .step_embed .embed, .step_embed .embed iframe {
.tale_embed, .tale_embed .embed, .tale_embed .embed iframe, .step_embed, .step_embed .embed, .step_embed .embed iframe {
overflow: hidden;
*zoom: 1;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

/* line 207, ../../app/stylesheets/application.scss */
.tale_embed {
width: 100%;
}
/* line 209, ../../app/stylesheets/application.scss */
.tale_embed .embed {
width: 100%;
text-align: center;
}
/* line 213, ../../app/stylesheets/application.scss */
.tale_embed frame {
margin: auto !important;
}

0 comments on commit b6baa3d

Please sign in to comment.