Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.18)
multi_json (1.3.1)
multi_json (1.3.2)
orm_adapter (0.0.7)
paperclip (3.0.2)
activemodel (>= 3.0.0)
Expand Down Expand Up @@ -95,7 +95,7 @@ GEM
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
sass (3.1.15)
sass (3.1.16)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
Expand All @@ -104,7 +104,7 @@ GEM
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.5)
sqlite3 (1.3.6)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
Expand Down
3 changes: 2 additions & 1 deletion app/assets/stylesheets/planet.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@
float: left;
padding-top: 1em;
padding-left: 1em;
padding-right: 1em;
padding-bottom: 1em;
width: 8em; /* Ajuste de borde izquierdo */
width: 14em; /* Ajuste de borde izquierdo */
background: #446;
}

Expand Down
6 changes: 5 additions & 1 deletion app/controllers/planet_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ def contact
# Método que define una acción vacía del controlador
def ejemplo
end

# Acción vacía para la búsqueda
def search
end
def doc_app_index_html
end
end
10 changes: 9 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@
<%= link_to "Viajes", trips_path %><br />
<%= link_to "Contact", planet_contact_path %><br />
<%= link_to "Sign up", new_user_registration_path unless current_user %>
<%= link_to "Documentation", "http://localhost:3000/doc/app/index.html" %><br />
<div id="search">
<%= form_tag("/planet/search", :method => "get") do %>
<%= label_tag(:q, "Search for:") %>
<%= text_field_tag(:q) %>
<%= submit_tag("Search") %>
<% end %>
</div>
</div>
<div id="main">
<p class="notice"><%= notice %></p> <p class="alert"><%= alert %></p>
<%= yield %>
</div>
</div>
</body>
</html>
</html>
Expand Down
73 changes: 73 additions & 0 deletions app/views/planet/search.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<style type="text/css">
#search-1 {
float:left;
width:400px;
margin-left:50px;
}
#search-2 {
float:right;
width:400px;
margin-right:50px;
}
</style>

<div id="site_list">
<h1>Listing Sites and Trips</h1>

<div id="search-1">
<h2>Sitios</h2>
<table>
<% Site.where("name like ? or description like ?" , "%"+params[:q]+"%" , "%"+params[:q]+"%" ).each do |site| %>
<tr class="<%= cycle('list_line_odd', 'list_line_even') %>">

<td>
<%= link_to image_tag(site.image.url, :class => 'list_image'), site %>
</td>

<td class="list_description">
<dl>
<dt><%= link_to site.name, site %></dt>
<dd><%= truncate(strip_tags(site.description),
:length => 50) %></dd>
</dl>
</td>

<td class="list_actions">
<%= link_to 'Show', site %><br/>
<% if site.user == current_user %> <%= link_to 'Edit', edit_site_path(site) %><br/>
<%= link_to 'Destroy', site,
:confirm => 'Are you sure?',
:method => :delete %>
<% end %> </td>
</tr>
<% end %>
</table>
</div>

<div id="search-2">
<h2>Viajes</h2>
<table>
<% Trip.where("name like ? or description like ?" , "%"+params[:q]+"%" , "%"+params[:q]+"%" ).each do |trip| %>
<tr class="<%= cycle('list_line_odd', 'list_line_even') %>">
<td class="list_description">
<dl>
<dt><%= link_to trip.name, trip_path(trip) %></dt>
<dd><%= truncate(strip_tags(trip.description),
:length => 80) + ', ' + trip.date.to_s %></dd>
</dl>
</td>
<td class="list_actions">
<%= link_to 'Show', trip %><br/>
<% if trip.user == current_user %>
<%= link_to 'Edit', edit_trip_path(trip) %><br/>
<%= link_to 'Destroy', trip,
:confirm => 'Are you sure?',
:method => :delete %>
<% end %>
</td>
</tr>
<% end %>
</table>
</div> <br />
</div>

Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

get "planet/ejemplo"

get "planet/search"

# The priority is based upon order of creation:
# first created -> highest priority.

Expand Down
13 changes: 12 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20120411160519) do
ActiveRecord::Schema.define(:version => 20120421170806) do

create_table "comments", :force => true do |t|
t.string "comment"
t.integer "user_id"
t.integer "site_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "sites", :force => true do |t|
t.string "name"
Expand All @@ -26,6 +34,9 @@
t.string "image_file_size"
t.datetime "image_updated_at"
t.integer "visitas", :default => 0
t.float "lat"
t.float "long"
t.float "zoom"
end

create_table "trips", :force => true do |t|
Expand Down
37 changes: 34 additions & 3 deletions doc/app/PlanetController.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ <h3 class="section-header">Methods</h3>

<li><a href="#method-i-index">#index</a>

<li><a href="#method-i-search">#search</a>

</ul>
</nav>

Expand Down Expand Up @@ -214,7 +216,7 @@ <h3 class="section-header">Public Instance Methods</h3>


<div class="method-source-code" id="contact-source">
<pre><span class="ruby-comment"># File app/controllers/planet_controller.rb, line 28</span>
<pre><span class="ruby-comment"># File app/controllers/planet_controller.rb, line 27</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">contact</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- contact-source -->
Expand Down Expand Up @@ -243,7 +245,7 @@ <h3 class="section-header">Public Instance Methods</h3>


<div class="method-source-code" id="ejemplo-source">
<pre><span class="ruby-comment"># File app/controllers/planet_controller.rb, line 31</span>
<pre><span class="ruby-comment"># File app/controllers/planet_controller.rb, line 30</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">ejemplo</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- ejemplo-source -->
Expand Down Expand Up @@ -272,7 +274,7 @@ <h3 class="section-header">Public Instance Methods</h3>


<div class="method-source-code" id="index-source">
<pre><span class="ruby-comment"># File app/controllers/planet_controller.rb, line 25</span>
<pre><span class="ruby-comment"># File app/controllers/planet_controller.rb, line 24</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">index</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- index-source -->
Expand All @@ -285,6 +287,35 @@ <h3 class="section-header">Public Instance Methods</h3>
</div><!-- index-method -->


<div id="method-i-search" class="method-detail ">

<div class="method-heading">
<span class="method-name">search</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>


<div class="method-description">

<p>Acción vacía para la búsqueda</p>



<div class="method-source-code" id="search-source">
<pre><span class="ruby-comment"># File app/controllers/planet_controller.rb, line 33</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">search</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- search-source -->

</div>




</div><!-- search-method -->


</section><!-- public-instance-method-details -->

</section><!-- 5Buntitled-5D -->
Expand Down
38 changes: 19 additions & 19 deletions doc/app/created.rid
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
Mon, 16 Apr 2012 08:53:15 +0200
doc/README_FOR_APP Sat, 17 Mar 2012 23:42:41 +0100
app/controllers/application_controller.rb Sat, 17 Mar 2012 23:42:41 +0100
app/controllers/planet_controller.rb Mon, 16 Apr 2012 08:53:07 +0200
app/controllers/sites_controller.rb Thu, 12 Apr 2012 11:23:00 +0200
app/controllers/trips_controller.rb Mon, 09 Apr 2012 17:09:15 +0200
app/controllers/types_controller.rb Sun, 18 Mar 2012 00:15:37 +0100
app/controllers/visits_controller.rb Tue, 10 Apr 2012 18:45:27 +0200
app/helpers/application_helper.rb Sat, 17 Mar 2012 23:42:41 +0100
app/helpers/planet_helper.rb Sat, 17 Mar 2012 23:48:05 +0100
app/helpers/sites_helper.rb Tue, 20 Mar 2012 11:01:45 +0100
app/helpers/trips_helper.rb Mon, 09 Apr 2012 10:57:40 +0200
app/helpers/types_helper.rb Sun, 18 Mar 2012 00:15:37 +0100
app/helpers/visits_helper.rb Mon, 09 Apr 2012 17:09:15 +0200
app/models/site.rb Wed, 11 Apr 2012 13:04:49 +0200
app/models/trip.rb Mon, 09 Apr 2012 17:09:15 +0200
app/models/type.rb Wed, 28 Mar 2012 18:02:57 +0200
app/models/user.rb Mon, 09 Apr 2012 17:09:15 +0200
app/models/visit.rb Mon, 09 Apr 2012 17:09:15 +0200
Tue, 24 Apr 2012 21:49:20 +0200
doc/README_FOR_APP Sun, 22 Apr 2012 16:23:15 +0200
app/models/type.rb Sun, 22 Apr 2012 16:23:15 +0200
app/models/visit.rb Sun, 22 Apr 2012 16:23:15 +0200
app/models/trip.rb Sun, 22 Apr 2012 16:23:15 +0200
app/models/site.rb Sun, 22 Apr 2012 16:23:15 +0200
app/models/user.rb Sun, 22 Apr 2012 16:23:15 +0200
app/controllers/planet_controller.rb Sun, 22 Apr 2012 20:17:01 +0200
app/controllers/application_controller.rb Sun, 22 Apr 2012 16:23:15 +0200
app/controllers/sites_controller.rb Sun, 22 Apr 2012 16:52:49 +0200
app/controllers/visits_controller.rb Sun, 22 Apr 2012 16:23:15 +0200
app/controllers/trips_controller.rb Sun, 22 Apr 2012 16:23:15 +0200
app/controllers/types_controller.rb Sun, 22 Apr 2012 16:23:15 +0200
app/helpers/trips_helper.rb Sun, 22 Apr 2012 16:23:15 +0200
app/helpers/application_helper.rb Sun, 22 Apr 2012 16:23:15 +0200
app/helpers/types_helper.rb Sun, 22 Apr 2012 16:23:15 +0200
app/helpers/visits_helper.rb Sun, 22 Apr 2012 16:23:15 +0200
app/helpers/planet_helper.rb Sun, 22 Apr 2012 16:23:15 +0200
app/helpers/sites_helper.rb Sun, 22 Apr 2012 16:23:15 +0200
Empty file modified doc/app/images/add.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/app/images/delete.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/app/images/tag_blue.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading