Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entrega 5 Arturo Romero y David Maroto #21

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
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
Binary file added app/assets/images/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/auto1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/auto2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@
*= require_self
*= require_tree .
*/


#container{}
#enla1{}
#enla1 a{color:blue;}
#cuerpo{}
#enla2{}
#enla2 a{color:blue;}


4 changes: 4 additions & 0 deletions app/assets/stylesheets/author.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#espa{background-color:green;color:green;}
.autor1{}
#espacio{background-color:blue;color:blue;}
.autor2{}
4 changes: 4 additions & 0 deletions app/controllers/planet_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ def contact

def ejemplo
end

def author
end


end
11 changes: 11 additions & 0 deletions app/controllers/types_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
class TypesController < ApplicationController

# GET /types/ordered_index
# GET /types.json
def ordered_index
@types = Type.find(:all, :order => :name)
respond_to do |format|
format.html # ordered_index.html.erb
format.json { render json: @types }
end
end

# GET /types
# GET /types.json
def index
Expand Down
10 changes: 10 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@
<%= csrf_meta_tags %>
</head>
<body>
<div id='container'>
<div id='enla1'>
<%= link_to('Index', planet_index_path) + " " + link_to('Contact', planet_contact_path) + " " + link_to('Ejemplo', planet_ejemplo_path) + " " + link_to('Authors', planet_author_path) + " " + link_to('Index', types_path) + " " + link_to('ordered_index', types_ordered_index_path)%>
</div>

<div id='cuerpo'>
<%= yield %>
</div>

<div id='enla2'>
<%= link_to('Index', planet_index_path) + " " + link_to('Contact', planet_contact_path) + " " + link_to('Ejemplo', planet_ejemplo_path) + " " + link_to('Authors', planet_author_path) + " " + link_to('Index', types_path) + " " + link_to('ordered_index', types_ordered_index_path)%>
</div>
</div>
</body>
</html>
4 changes: 4 additions & 0 deletions app/views/planet/author.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

.autor1{color:red;clear:both;float:left; margin:300;background-color:#fc0;text-align:center;}
.autor2{float:right;margin-left:600;background-color:#0cf;padding: 5px}
.container{ margin-left:30;}
43 changes: 43 additions & 0 deletions app/views/planet/author.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<html>
<head>
<!--<link rel='stylesheet' type='text/css' href='author.css'>-->
<!--<%= stylesheet_link_tag "author", :media => "author" %>-->
</head>
<body>
<div class='container'>
<div id='cabecera'> <h1> Autores </h1></div>
<div id='espa'><p>sepa</p>
</div>
<div class='autor1'>
<form>
<p>Nombre: <input type="text" name='nombre' size='25' value="Arturo Romero Blanco"></input></p><BR>
<p>Direccion postal: <input type="text" name='post' size='25' value='C/Holanda,6'></input></p><BR>
<p>Direccion electronica: <input type="text" name='elec' size='25' value='[email protected]'></input></p><BR>

<%= image_tag('auto1.jpeg') %>

<p> Curriculum:</p>
<textarea name="cur" rows=5 cols=73>
Estudiante de Ingenieria de telecomunicaciones y actualmente cursando SWCM
</textarea>
</form>
</div><br>
<div id='espacio'>
<p>separacion</p>
</div><br>
<div class='autor2'>
<form>
<p>Nombre: <input type="text" name='nombre' size='25' value="David Maroto Sadau"></input></p><BR>
<p>Direccion postal: <input type="text" name='post' size='25' value='C/Realeza,25'></input></p><BR>
<p>Direccion electronica: <input type="text" name='elec' size='25' value='[email protected]'></input></p><BR>

<%= image_tag('auto2.jpg') %>

<p> Curriculum:</p>
<textarea name="cur" rows=5 cols=73>
Estudiante de Ingenieria de telecomunicaciones y actualmente cursando SWCM
</textarea>
</div>
</div>
</body>
</html>
10 changes: 9 additions & 1 deletion app/views/types/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
<h1>Listing types</h1>


<table>

<tr>
<th>Name</th>
<th>Description</th>
<th></th>
<th></th>
<th></th>
</tr>

<% @types.each do |type| %>
<tr>
<td><%= type.name %></td>
<td><%= type.description %></td>
<td></td>
<td><%= link_to 'Show', type %></td>
<td><%= link_to 'Edit', edit_type_path(type) %></td>
<td><%= link_to 'Destroy', type, confirm: 'Are you sure?', method: :delete %></td>
<td></td>
<td><%= type.updated_at%></td>
</tr>

<% end %>

</table>


<br />

<%= link_to 'New Type', new_type_path %>

26 changes: 26 additions & 0 deletions app/views/types/ordered_index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<h1>Ordering types</h1>

<table>
<tr>
<th>Name</th>
<th>Description</th>
<th></th>
<th></th>
<th></th>
</tr>

<% @types.each do |type| %>
<tr>
<td><%= type.name %></td>
<td><%= type.description %></td>
<td><%= link_to 'Show', type %></td>
<td><%= link_to 'Edit', edit_type_path(type) %></td>
<td><%= link_to 'Destroy', type, confirm: 'Are you sure?', method: :delete %></td>
</tr>
<% end %>
</table>

<br />

<%= link_to 'New Type', new_type_path %>

2 changes: 1 addition & 1 deletion app/views/types/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<%= @type.description %>
</p>


<%= @type.updated_at%><br>
<%= link_to 'Edit', edit_type_path(@type) %> |
<%= link_to 'Back', types_path %>
10 changes: 9 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
Planet::Application.routes.draw do
resources :types

get "types/ordered_index"
resources :types



get "planet/index"

get "planet/contact"

get "planet/ejemplo"

get "planet/author"



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

Expand Down
10 changes: 10 additions & 0 deletions test/functional/planet_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,14 @@ class PlanetControllerTest < ActionController::TestCase
assert_response :success
end

test "should get ejemplo" do
get :ejemplo
assert_response :success
end

test "should get author" do
get :author
assert_response :success
end

end