Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class Items < Application | ||
|
||
def index | ||
@current_page = params[:page] ? params[:page].to_i : 1 | ||
@page_count, @items = Item.paginated :page => @current_page, :per_page => 20, :order => [:created_at.desc] | ||
display @items | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Merb | ||
module ItemsHelper | ||
|
||
end | ||
end # Merb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<% for item in @items %> | ||
<div id="item-<%= item.id %>" class="item"> | ||
<div class="item-header"> | ||
<h1><a href="<%= item.permalink %>"><%=h item.title %></a></h1> | ||
<h2>par <%= item.author %> sur <a href="<%= item.feed.url %>"><%= item.feed.name %></a></h2> | ||
</div> | ||
<div class="item-content"> | ||
<%= item.content %> | ||
</div> | ||
</div> | ||
<% end %> | ||
<%= paginate(@current_page, @page_count, :inner_window => 5, :default_css => true, :prev_label => '« Précédent', :next_label => ' Suivant »') %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us"> | ||
<head> | ||
<title>Fresh Merb App</title> | ||
<title>planet-mashpit</title> | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
<link rel="stylesheet" href="/stylesheets/master.css" type="text/css" media="screen" charset="utf-8" /> | ||
<link rel="stylesheet" href="/stylesheets/planet.css" type="text/css" media="screen" charset="utf-8" /> | ||
</head> | ||
<body> | ||
<%#= message[:notice] %> | ||
<%= catch_content :for_layout %> | ||
<h1>planet-mashpit</h1> | ||
<div id="content"> | ||
<div class="notice"><%= message[:notice] %></div> | ||
<%= catch_content :for_layout %> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
body { | ||
font-family: Arial, Verdana, sans-serif; | ||
font-size: 12px; | ||
background-color: #fff; | ||
} | ||
h1 { | ||
font-size: 40px; | ||
font-weight: normal; | ||
} | ||
#content { | ||
margin-left: 20px; | ||
} | ||
#content h1 { | ||
font-size: 30px; | ||
} | ||
|
||
#content .item { | ||
margin-bottom: 40px; | ||
} | ||
|
||
#content .item-content h1 { | ||
font-size: 115%; | ||
} | ||
|
||
#content .item-content h2 { | ||
font-size: 110%; | ||
} | ||
|
||
#content .item-content h3 { | ||
font-size: 105%; | ||
} | ||
|
||
#content .item-header h1,h2 { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
#content .item-header h2 { | ||
font-weight: normal; | ||
font-size: 120%; | ||
} | ||
|
||
#content .item-header h1 a { | ||
color: black; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb') | ||
|
||
describe "/items" do | ||
before(:each) do | ||
@response = request("/items") | ||
end | ||
end |