Skip to content

Commit

Permalink
Joke format
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Johansson committed Jun 18, 2011
1 parent 7027e80 commit 8762ee1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 26 deletions.
47 changes: 25 additions & 22 deletions app/views/jokes/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@

<% if @friends %>
<% form_tag 'update' do %>
<%= hidden_field_tag(:joke_id, @joke.id) %>
<label for="name">Välj vän</label>
<select name="screen_name" id="name">
<% @friends.each do |friend| %>
<option value="<%= friend[1] %>"><%= friend[0] %> (@<%= friend[1] %>)</option>
<% end %>
</select>
<div class="actions">
<%= submit_tag("Skicka",:class => "primary") %>
</div>
<h1 id="fittext" class="<%=jokes_class_name(@joke.joke)%>"><%= @joke.joke %></h1>
<div class="actions">
<%= link_to("Logga ut från Twitter", logout_path, :class => "button") %>
</div>
<% end %>
<% else %>
<h1 id="fittext" class="<%=jokes_class_name(@joke.joke)%>"><%= @joke.joke %></h1>
<% if @friends %>
<% form_tag 'update' do %>
<%= hidden_field_tag(:joke_id, @joke.id) %>
<label for="name">Välj vän</label>
<select name="screen_name" id="name">
<% @friends.each do |friend| %>
<option value="<%= friend[1] %>"><%= friend[0] %> (@<%= friend[1] %>)</option>
<% end %>
</select>
<div class="actions">
<%= submit_tag("Skicka",:class => "primary") %>
</div>

<h1 id="fittext" class="<%=jokes_class_name(@joke.joke)%>"><%= joke_format(@joke.joke) %></h1>

<div class="actions">
<a href="/" class="primary">Få nytt skämt!</a>
<%= link_to("Skicka skämt!", "/auth/twitter", :class => "button") %>
<%= link_to("Logga ut från Twitter", logout_path, :class => "button") %>
</div>
<% end %>
<% else %>

<h1 id="fittext" class="<%=jokes_class_name(@joke.joke)%>"><%= simple_format(@joke.joke) %></h1>

<div class="actions">
<a href="/new" data-pjax="#main" class="primary">Få nytt skämt!</a>
<%= link_to("Skicka skämt!", "/auth/twitter", :class => "button") %>
</div>
<% end %>

<div class="facebook_like">
<iframe src="http://www.facebook.com/plugins/like.php?app_id=225510640812214&amp;href=<%= url_encode(joke_url(@joke)) %>&amp;send=false&amp;layout=standard&amp;width=300&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:80px;" allowTransparency="true"></iframe>
Expand Down
10 changes: 6 additions & 4 deletions public/stylesheets/tc1.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ article{
article h1{
font-style:italic;
font-weight:bold;
text-shadow:#f5f5ed 5px 5px 0;
text-shadow:#f5f5ed 3px 3px 0;
margin-bottom: 30px;
padding:0 1em;
}
Expand All @@ -124,7 +124,6 @@ article h1.jokes-short{
}
article p{
font-size:22px;
text-align:right;
}
div.actions{
text-align:center;
Expand Down Expand Up @@ -226,10 +225,13 @@ input[type="submit"].primary:hover;{

.notice{
padding: 10px;
margin-bottom: 10px;
margin-bottom: 20px;
text-align: center;
color: #fff;
font-weight:bold;
}
.message{
background-color:#693;
background-color:#70A71D;
}
.warning{
background-color:#d63939;
Expand Down

0 comments on commit 8762ee1

Please sign in to comment.