all repos — h3rald @ 96397c35f1399a301e24994d8fefe218c7ae3bdf

The sources of https://h3rald.com

Added sharing buttons.
* Closes #39.
h3rald h3rald@h3rald.com
Sun, 06 Sep 2009 13:14:59 +0200
commit

96397c35f1399a301e24994d8fefe218c7ae3bdf

parent

689e9ba46b9841466abaf44cb41dda4a66535750

4 files changed, 64 insertions(+), 16 deletions(-)

jump to
M content/css/_elements.sasscontent/css/_elements.sass

@@ -139,19 +139,26 @@ ul

overflow: hidden &.article-meta + float: left list-style-type: none border-left: 3px solid #ccc padding-left: 1em margin-left: 0.5em + &.article-buttons + text-align: center + list-style-type: none + display: block + margin: auto + +.article-buttons li + display: inline -.date - font-style: italic - - -#content .article-meta li +.article-meta li margin-left: 0 +.date + font-style: italic .inner-border img margin-top: 7px
M content/css/_layout.sasscontent/css/_layout.sass

@@ -66,7 +66,14 @@ background: #fff

#content text-align: justify - padding: 0 10px + padding: 0 1em + +#content-body + clear: both + +#content-footer + text-align: center + margin: auto #wrapper min-height: 100%

@@ -74,6 +81,7 @@ margin-bottom: -40px

background: #000 #border-bottom + clear: both background: #000 height: auto padding: 0

@@ -115,7 +123,8 @@ clear: both

font-size: 95% color: #CACACA -#share +.share + clear: both margin: auto padding: 5px text-align: center
A layouts/article_buttons.erb

@@ -0,0 +1,19 @@

+----- +filter: erb +----- +<script type="text/javascript"> + var dzone_url = '<%= url_for @item %>'; + var dzone_title = '<%= @item[:title]%>'; + var dzone_blurb = '<%= @item[:summary] if @item[:summary] %>'; + var dzone_style = '2'; + var digg_url = 'WEBSITE_URL'; + var digg_skin = 'compact'; + var digg_window = 'new'; + var tweetmeme_style = 'compact'; +</script> +<ul class="article-buttons"> + <li><script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></li> + <li><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></li> + <li><script type="text/javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script> </li> + <li><script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></li> +</ul>
M layouts/default.erblayouts/default.erb

@@ -58,12 +58,32 @@ <div id="content" class="clearfix<%= (@item[:permalink] == 'home') ? ' home' : ' standard' %>">

<h2><%= @item[:title] %></h2> <% case @item[:type] when 'article' then%> + <div id="content-header"> <%= render 'article_meta', :article => @item %> + <div class="share"> + <a class="a2a_dd" href="http://www.addtoany.com/share_save"><img src="http://static.addtoany.com/buttons/share_save_120_16.gif" width="120" height="16" alt="Share/Save/Bookmark"/></a><script type="text/javascript">a2a_linkname=document.title;a2a_linkurl=location.href;a2a_onclick=1;a2a_prioritize=["delicious","stumbleupon","friendfeed","twitter","dzone","digg","reddit","slashdot","facebook","newsvine","sphere","ping"];</script> + <% if @item[:feed] then %> + <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script> + <a class="a2a_dd" href="http://www.addtoany.com/subscribe?linkname=&amp;linkurl=http%3A%2F%2Fwww.h3rald.com%2Frss%2F"><img src="http://static.addtoany.com/buttons/subscribe_120_16.gif" width="120" height="16" alt="Subscribe"/></a><script type="text/javascript">a2a_linkname=document.title;a2a_linkurl="http://www.h3rald.com<%= @item[:feed] %>rss/";a2a_onclick=1;</script><script type="text/javascript" src="http://static.addtoany.com/menu/feed.js"></script> + <% end %> + </div> + <%= render 'article_buttons' %> + </div> <% end %> <hr /> - <div class="content-body"> + <div id="content-body"> <%= yield %> </div> + <div id="content-footer"> + <div class="share"> + <a class="a2a_dd" href="http://www.addtoany.com/share_save"><img src="http://static.addtoany.com/buttons/share_save_120_16.gif" width="120" height="16" alt="Share/Save/Bookmark"/></a><script type="text/javascript">a2a_linkname=document.title;a2a_linkurl=location.href;a2a_onclick=1;a2a_prioritize=["delicious","stumbleupon","friendfeed","twitter","dzone","digg","reddit","slashdot","facebook","newsvine","sphere","ping"];</script> + <% if @item[:feed] then %> + <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script> + <a class="a2a_dd" href="http://www.addtoany.com/subscribe?linkname=&amp;linkurl=http%3A%2F%2Fwww.h3rald.com%2Frss%2F"><img src="http://static.addtoany.com/buttons/subscribe_120_16.gif" width="120" height="16" alt="Subscribe"/></a><script type="text/javascript">a2a_linkname=document.title;a2a_linkurl="http://www.h3rald.com<%= @item[:feed] %>rss/";a2a_onclick=1;</script><script type="text/javascript" src="http://static.addtoany.com/menu/feed.js"></script> + <% end %> + </div> + <%= render 'article_buttons' if @item[:type] == 'article' %> + </div> </div> <!-- CONTENT END --> </div>

@@ -71,14 +91,7 @@ <!-- CONTAINER END -->

</div> <!-- MAIN END --> <div id="border-bottom"> - <div id="share"> - <a class="a2a_dd" href="http://www.addtoany.com/share_save"><img src="http://static.addtoany.com/buttons/share_save_120_16.gif" width="120" height="16" alt="Share/Save/Bookmark"/></a><script type="text/javascript">a2a_linkname=document.title;a2a_linkurl=location.href;a2a_onclick=1;a2a_prioritize=["delicious","stumbleupon","friendfeed","twitter","dzone","digg","reddit","slashdot","facebook","newsvine","sphere","ping"];</script> - <% if @item[:feed] then %> - <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script> - <a class="a2a_dd" href="http://www.addtoany.com/subscribe?linkname=&amp;linkurl=http%3A%2F%2Fwww.h3rald.com%2Frss%2F"><img src="http://static.addtoany.com/buttons/subscribe_120_16.gif" width="120" height="16" alt="Subscribe"/></a><script type="text/javascript">a2a_linkname=document.title;a2a_linkurl="http://www.h3rald.com<%= @item[:feed] %>rss/";a2a_onclick=1;</script><script type="text/javascript" src="http://static.addtoany.com/menu/feed.js"></script> - <% end %> - </div> - <% if @item[:type] == 'article' then %> + <% if @item[:type] == 'article' then %> <%= render 'comments' %> <% else %> <%= render 'services' %>