Permalink
Browse files

Adding description on photo stories, some CSS fixes

  • Loading branch information...
1 parent d3f5112 commit c00be84c8fb3448cfaa8dce793961e42fe5ca924 @penso committed Jan 20, 2013
@@ -1,5 +1,5 @@
#slider {margin: 0 0 10px!important; overflow: hidden;}
-#carousel {overflow:hidden;}
+#carousel {overflow:hidden; margin-bottom: 10px;}
#carousel li {margin-right: 5px;}
#carousel img {display: block; opacity: .8; cursor: pointer;}
#carousel img:hover {opacity: 1;}
@@ -196,3 +196,18 @@ a:hover,a:active {
font-size: 14px;
color: #666;
}
+#story_description {
+ font-size: 14px;
+ color: #666;
+ padding: 10px;
+}
+#story_description h3 {
+ font-family: 'Titillium Web', sans-serif;
+ font-weight: 200;
+ font-style: normal;
+ font-weight: bold;
+ line-height: 30px;
+ margin: 0;
+ padding: 0;
+ font-size: 18px;
+}
@@ -25,6 +25,10 @@ def set_photographer
:include => [:stories])
end
+ @markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
+ :autolink => true,
+ :space_after_headers => true)
+
# use request.host ? raise ActiveRecord::RecordNotFound ?
end
@@ -64,9 +64,6 @@ def get_photographer
end
def set_title
- @markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
- :autolink => true,
- :space_after_headers => true)
@title ||= @photographer.name if @photographer
end
end
@@ -11,6 +11,12 @@ def full_image_link(url)
request.protocol + request.host_with_port + url
end
+ def user_description_text(user)
+ return unless user.description
+
+ @markdown.render(user.description)
+ end
+
def user_avatar_url(user)
if user.user_avatar && !user.user_avatar.new_record?
user.user_avatar.image_url(:thumb)
@@ -49,7 +49,7 @@
</li>
<li class="divider"></li>
<% @stories.each do |story| %>
- <li><%= link_to story.title, edit_story_path(story) %></li>
+ <li><%= link_to "#{story.title} (#{story.photos.count})", edit_story_path(story) %></li>
<% end %>
</ul>
@@ -3,7 +3,7 @@
<meta property="og:url" content="<%= root_url %>" />
<meta property="og:image" content="<%= full_image_link @photographer.stories.first.photos.first.image_url(:web) %>" />
<meta property="og:title" content="<%= @photographer.name %> - Photography" />
- <meta property="og:description" content="<%= @photographer.description %>" />
+ <meta property="og:description" content="<%= user_description_text(@photographer) %>" />
<meta property="og:site_name" content="<%= @photographer.name %>"/>
<% end %>
<% end %>
@@ -9,20 +9,22 @@
<%= content_for :head_script do %>
<script type="text/javascript">
$(document).ready(function() {
- <% if @story.photos.count > 8 %>
+ <% if @story.photos.count > 80 %>
$('#carousel').flexslider({
animation: "slide",
controlNav: false,
animationLoop: false,
slideshow: false,
itemWidth: 110,
itemMargin: 5,
+ keyboard: false,
asNavFor: '#slider'
});
<% end %>
$('#slider').flexslider({
animation: "slide",
controlNav: true,
+ keyboard: true,
animationLoop: false,
sync: "#carousel",
slideshow: false,
@@ -62,12 +64,12 @@
</ul>
</div>
- <% if @story.photos.count > 8 %>
+ <% if @story.photos.count > 80 %>
<div id="carousel" class="flexslider">
<ul class="slides">
<% @story.photos.each_with_index do |photo,i| %>
<li>
- <%= image_tag(photo.image_url(:thumb), :width => 300, :height => 300) if photo.image? %>
+ <%= image_tag(photo.image_url(:thumb), :width => 200, :height => 200) if photo.image? %>
</li>
<% end %>
</ul>
@@ -78,6 +80,11 @@
1/<%= @story.photos.count %>
</div>
+ <div id="story_description">
+ <h3><%= @story.title %></h3>
+ <%= @story.description %>
+ </div>
+
</div>
</div>
<% end %>

0 comments on commit c00be84

Please sign in to comment.