Skip to content

Commit cb0a749

Browse files
committed
genero planet_b
1 parent fec6b93 commit cb0a749

18 files changed

+313
-112
lines changed

.DS_Store

0 Bytes
Binary file not shown.

app/controllers/planet_controller.rb

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class PlanetController < ApplicationController
2+
def index
3+
end
4+
5+
def contact
6+
end
7+
8+
end

app/helpers/planet_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module PlanetHelper
2+
end

app/views/.DS_Store

0 Bytes
Binary file not shown.

app/views/layouts/.DS_Store

6 KB
Binary file not shown.
+28-18
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>Planet</title>
5-
<%= stylesheet_link_tag :all %>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Planet Travel Site</title>
5+
<!-- START:stylesheet -->
6+
<%= stylesheet_link_tag "scaffold" %>
7+
<%= stylesheet_link_tag "planet", :media => "all" %><!-- <label id="code.slt"/> -->
8+
<!-- END:stylesheet -->
69
<%= javascript_include_tag :defaults %>
7-
<%= csrf_meta_tag %>
8-
</head>
9-
<body>
10-
11-
<div>
12-
<%= link_to "Sitios", sites_path %>
13-
<%= link_to "Tipos", types_path %>
14-
</div>
15-
16-
<%= yield %>
17-
18-
</body>
19-
</html>
10+
<%= csrf_meta_tag %><!-- <label id="code.csrf"/> -->
11+
</head>
12+
<body id="planet">
13+
<div id="banner">
14+
<%= image_tag("logo3.png") %>
15+
<%= @page_title || "Planet Travel Site" %><!-- <label id="code.depot.e.title"/> -->
16+
</div>
17+
<div id="columns">
18+
<div id="side">
19+
<%= link_to "Home", planet_index_path %><br />
20+
<%= link_to "Tipos", types_path %><br />
21+
<%= link_to "Sitios", sites_path %><br />
22+
<%= link_to "Contact", planet_contact_path %>
23+
</div>
24+
<div id="main">
25+
<%= yield %><!-- <label id="code.depot.e.include"/> -->
26+
</div>
27+
</div>
28+
</body>
29+
</html>

app/views/planet/contact.html.erb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h1>Contacting the Planet Travel Site</h1>
2+
<p>Please send an email to:</p>
3+
4+
<p><a href="mailto:[email protected]"> [email protected]</a></p>

app/views/planet/index.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<h1>Wecome to the Planet Travel Site</h1>
2+
<p>This site gathers information from all yes of touristic sites from all over the world and should help you to organize your trips and your holidays.</p>
3+
4+
<%= image_tag('pedriza2-m.png') %>
5+
6+
<p>Feel free to use it for your convenience and pleasure.</p>

app/views/sites/index.html.erb

+34-35
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
1-
<h1>Listing sites</h1>
2-
3-
<table>
4-
<tr>
5-
<th>Name</th>
6-
<th>Description</th>
7-
<th>Type</th>
8-
<th>Latitude</th>
9-
<th>Longitude</th>
10-
<th>Zoom</th>
11-
<th>Image url</th>
12-
<th></th>
13-
<th></th>
14-
<th></th>
15-
</tr>
16-
17-
<% @sites.each do |site| %>
18-
<tr>
19-
<td><%= site.name %></td>
20-
<td><%= site.description %></td>
21-
<td><%= site.type.name if site.type %></td>
22-
<td><%= site.latitude %></td>
23-
<td><%= site.longitude %></td>
24-
<td><%= site.zoom %></td>
25-
<td><%= site.image_url %></td>
26-
<td><%= link_to 'Show', site %></td>
27-
<td><%= link_to 'Edit', edit_site_path(site) %></td>
28-
<td><%= link_to 'Destroy', site, :confirm => 'Are you sure?', :method => :delete %></td>
29-
</tr>
30-
<% end %>
31-
</table>
32-
33-
<br />
34-
35-
<%= link_to 'New Site', new_site_path %>
1+
<div id="site_list">
2+
<h1>Listing Sites</h1>
3+
4+
<table>
5+
<% @sites.each do |site| %>
6+
<tr class="<%= cycle('list_line_odd', 'list_line_even') %>">
7+
8+
<td>
9+
<%= link_to image_tag(site.image_url, :class => 'list_image'), site %>
10+
</td>
11+
12+
<td class="list_description">
13+
<dl>
14+
<dt><%= link_to site.name, site %></dt>
15+
<dd><%= truncate(strip_tags(site.description),
16+
:length => 80) %></dd>
17+
</dl>
18+
</td>
19+
20+
<td class="list_actions">
21+
<%= link_to 'Show', site %><br/>
22+
<%= link_to 'Edit', edit_site_path(site) %><br/>
23+
<%= link_to 'Destroy', site,
24+
:confirm => 'Are you sure?',
25+
:method => :delete %>
26+
</td>
27+
</tr>
28+
<% end %>
29+
</table>
30+
</div>
31+
32+
<br />
33+
34+
<%= link_to 'New site', new_site_path %>

app/views/sites/show.html.erb

+24-38
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,26 @@
1-
<p id="notice"><%= notice %></p>
2-
3-
<p>
4-
<b>Name:</b>
5-
<%= @site.name %>
6-
</p>
7-
8-
<p>
9-
<b>Description:</b>
10-
<%= @site.description %>
11-
</p>
12-
13-
<p>
14-
<b>Type:</b>
15-
<%= @site.type.name if @site.type %>
16-
</p>
17-
18-
<p>
19-
<b>Latitude:</b>
20-
<%= @site.latitude %>
21-
</p>
22-
23-
<p>
24-
<b>Longitude:</b>
25-
<%= @site.longitude %>
26-
</p>
27-
28-
<p>
29-
<b>Zoom:</b>
30-
<%= @site.zoom %>
31-
</p>
32-
33-
<p>
34-
<b>Image url:</b>
35-
<%= @site.image_url %>
36-
</p>
37-
38-
1+
<div id="site">
2+
3+
<h1><%= @site.type.name if @site.type %></h1>
4+
5+
<%= image_tag(@site.image_url, :class => 'site_image') %>
6+
7+
<h3><%= @site.name %></h3>
8+
9+
<p><%=sanitize @site.description %></p>
10+
11+
<div class="position">
12+
<span>
13+
<b>Latitude:</b>
14+
<%= @site.latitude %>
15+
</span>
16+
17+
<span>
18+
<b>Longitude:</b>
19+
<%= @site.longitude %>
20+
</span>
21+
</div>
22+
</div>
23+
24+
<p />
3925
<%= link_to 'Edit', edit_site_path(@site) %> |
4026
<%= link_to 'Back', sites_path %>

app/views/types/index.html.erb

+26-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
<h1>Listing types</h1>
2-
3-
<table>
4-
<tr>
5-
<th>Name</th>
6-
<th>Description</th>
7-
<th></th>
8-
<th></th>
9-
<th></th>
10-
</tr>
11-
12-
<% @types.each do |type| %>
13-
<tr>
14-
<td><%= type.name %></td>
15-
<td><%= type.description %></td>
16-
<td><%= link_to 'Show', type %></td>
17-
<td><%= link_to 'Edit', edit_type_path(type) %></td>
18-
<td><%= link_to 'Destroy', type, :confirm => 'Are you sure?', :method => :delete %></td>
19-
</tr>
20-
<% end %>
21-
</table>
1+
<div id="site_list">
2+
<h1>Listing Types</h1>
3+
4+
<table>
5+
<% @types.each do |type| %>
6+
<tr class="<%= cycle('list_line_odd', 'list_line_even') %>">
7+
8+
<td class="list_description">
9+
<dl>
10+
<dt><%= link_to type.name, 'types/'+type.id.to_s+'/sites' %></dt>
11+
<dd><%= truncate(strip_tags(type.description),
12+
:length => 80) %></dd>
13+
</dl>
14+
</td>
15+
16+
<td class="list_actions">
17+
<%= link_to 'Show', type %><br/>
18+
<%= link_to 'Edit', edit_type_path(type) %><br/>
19+
<%= link_to 'Destroy', type,
20+
:confirm => 'Are you sure?',
21+
:method => :delete %>
22+
</td>
23+
</tr>
24+
<% end %>
25+
</table>
26+
</div>
2227

2328
<br />
2429

config/routes.rb

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Planet::Application.routes.draw do
22

3+
get "planet/index"
4+
5+
get "planet/contact"
6+
37
resources :types do
48
resources :sites
59
end
@@ -56,6 +60,8 @@
5660
# You can have the root of your site routed with "root"
5761
# just remember to delete public/index.html.
5862
# root :to => "welcome#index"
63+
64+
root :to => "planet#index"
5965

6066
# See how all your routes lay out with "rake routes"
6167

public/.DS_Store

0 Bytes
Binary file not shown.

public/stylesheets/.DS_Store

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)