3 articles before and after in the menu
This commit is contained in:
parent
32bd61fd68
commit
d1790ce781
5 changed files with 92 additions and 27 deletions
|
@ -452,6 +452,9 @@ table.impact tr td
|
|||
:width 100%
|
||||
:text-align center
|
||||
|
||||
#choixrss
|
||||
width: 100%
|
||||
clear: both
|
||||
#choix
|
||||
padding: 1em
|
||||
text-align: left
|
||||
|
@ -473,3 +476,18 @@ table.impact tr td
|
|||
line-heigh: 2em
|
||||
.date
|
||||
font-size: .8em
|
||||
#next_before_articles
|
||||
clear: both
|
||||
width: 100%
|
||||
:font-size 1.2em
|
||||
:padding
|
||||
:top 1em
|
||||
:bottom 1em
|
||||
#previous_articles
|
||||
float: left
|
||||
width: 45%
|
||||
text-align: left
|
||||
#next_articles
|
||||
float: right
|
||||
width: 45%
|
||||
text-align: right
|
||||
|
|
|
@ -452,7 +452,7 @@ newcorps
|
|||
<p>
|
||||
|
||||
I've done some
|
||||
<a href="/YBlog/Softwares.html" >Mac sofwares</a>.
|
||||
<a href="http://yannesposito.com/YBlog/Softwares.html" >Mac sofwares</a>.
|
||||
Such as screen saver using Quartz Composer, Dashboard widgets and
|
||||
Objective-C.
|
||||
|
||||
|
@ -461,6 +461,6 @@ newcorps
|
|||
<h4> Web </h4>
|
||||
<p>
|
||||
|
||||
<%= lnkto("You can see details on how I did this website","/blog/nanoc"); %>.
|
||||
<%= lnkto("You can see details on how I did this website","/about/technical_details"); %>.
|
||||
</p>
|
||||
|
||||
|
|
|
@ -453,7 +453,7 @@ newcorps
|
|||
</h4>
|
||||
<p>
|
||||
Parmis les
|
||||
<a href="/YBlog/Softwares.html" >programmes pour Mac</a> que j'ai
|
||||
<a href="http://yannesposito.com/YBlog/Softwares.html" >programmes pour Mac</a> que j'ai
|
||||
réalisé ; certains sont disponibles au public.
|
||||
|
||||
|
||||
|
@ -461,7 +461,6 @@ newcorps
|
|||
|
||||
<h4> Web </h4>
|
||||
<p>
|
||||
<%= lnkto("Vous pouvez voir ici les détails sur la création de ce site web","/blog/nanoc"); %>.
|
||||
|
||||
<%= lnkto("Vous pouvez voir ici les détails sur la création de ce site web","/about/technical_details"); %>.
|
||||
</p>
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ self.instance_variable_set(:@conf, conf)
|
|||
|
||||
<div id="content">
|
||||
<div id="entete">
|
||||
<div id="choixrss">
|
||||
<div id="rss">
|
||||
<span>
|
||||
<a href="http://feeds.feedburner.com/yannespositocom<%= language %>">
|
||||
|
@ -102,6 +103,35 @@ self.instance_variable_set(:@conf, conf)
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if article %>
|
||||
<div id="next_before_articles">
|
||||
<div id="previous_articles">
|
||||
<%
|
||||
(1..3).each do |n|
|
||||
a=article_brother(-n)
|
||||
if not a.nil?
|
||||
%>
|
||||
<div class="previous_article">
|
||||
<%= link_to('← ' + a[:title], a) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div id="next_articles">
|
||||
<%
|
||||
(1..3).each do |n|
|
||||
a=article_brother(n)
|
||||
if not a.nil?
|
||||
%>
|
||||
<div class="next_article">
|
||||
<%= link_to(a[:title] + '→ ', a) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="liens">
|
||||
<%= generateMenu %>
|
||||
</div>
|
||||
|
|
|
@ -136,3 +136,21 @@ def previousFor(page)
|
|||
end
|
||||
link_to(tradOf(:previous)+" ←", target)
|
||||
end
|
||||
|
||||
def brother_for_at(page,n)
|
||||
brothers=getSortedChildren(page.parent)
|
||||
i=brothers.index(page)
|
||||
if i.nil?
|
||||
return nil
|
||||
end
|
||||
brothers[ brothers.index(page) + n ]
|
||||
end
|
||||
|
||||
def article_brother(n)
|
||||
if depthOf(@item) > 3
|
||||
page=@item.parent
|
||||
else
|
||||
page=@item
|
||||
end
|
||||
brother_for_at(page,n)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue