diff --git a/app/assets/images/economista.jpg b/app/assets/images/economista.jpg new file mode 100644 index 0000000..b629c4b Binary files /dev/null and b/app/assets/images/economista.jpg differ diff --git a/app/assets/images/english-teacher1.jpg b/app/assets/images/english-teacher1.jpg new file mode 100644 index 0000000..4167a83 Binary files /dev/null and b/app/assets/images/english-teacher1.jpg differ diff --git a/app/assets/images/estudianteArte.jpg b/app/assets/images/estudianteArte.jpg new file mode 100644 index 0000000..1d18f3f Binary files /dev/null and b/app/assets/images/estudianteArte.jpg differ diff --git a/app/assets/images/guitar-teacher1.jpg b/app/assets/images/guitar-teacher1.jpg new file mode 100644 index 0000000..5141a1d Binary files /dev/null and b/app/assets/images/guitar-teacher1.jpg differ diff --git a/app/assets/images/ingeniero.jpg b/app/assets/images/ingeniero.jpg new file mode 100644 index 0000000..475785d Binary files /dev/null and b/app/assets/images/ingeniero.jpg differ diff --git a/app/assets/images/jubilada.jpg b/app/assets/images/jubilada.jpg new file mode 100644 index 0000000..4dacd09 Binary files /dev/null and b/app/assets/images/jubilada.jpg differ diff --git a/app/assets/images/profesoraPiano.jpg b/app/assets/images/profesoraPiano.jpg new file mode 100644 index 0000000..2057bc3 Binary files /dev/null and b/app/assets/images/profesoraPiano.jpg differ diff --git a/app/assets/stylesheets/courses.css b/app/assets/stylesheets/courses.css index d36f104..a0f7fc4 100644 --- a/app/assets/stylesheets/courses.css +++ b/app/assets/stylesheets/courses.css @@ -45,7 +45,6 @@ thead th { .container-opinions { background-size: auto auto; width: auto; - height: 630px; position: relative; } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4e2ea3f..b0d5768 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -32,11 +32,13 @@ def is_logued_student_with_facebook_id? def get_profile_picture_for_user(user) unless user.nil? then puts "User: #{user}" - if user.facebook_id then - puts "http://graph.facebook.com/#{user.facebook_id}/picture?type=large" + if not user.facebook_id.nil? and user.facebook_id != 0 then + #puts "http://graph.facebook.com/#{user.facebook_id}/picture?type=large" return "http://graph.facebook.com/#{user.facebook_id}/picture?type=large" + else + return nil end - end + end return "http://sndt.ac.in/images/courses/courses-imgs.jpg" end diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index a8899ed..c7a6984 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -38,25 +38,10 @@ de vuelta para que se vean lindas pisando la config que toque arriba :P
  • @@ -181,24 +166,28 @@ de vuelta para que se vean lindas pisando la config que toque arriba :P
    <%= bootstrap_form_for [@course, Opinion.new] do |f| %> -
    -
    <%= bootstrap_form_for [@course, Consultation.new] do |f| %> - <% end %>
    diff --git a/app/views/students/show.html.erb b/app/views/students/show.html.erb index a8053ad..33b783f 100644 --- a/app/views/students/show.html.erb +++ b/app/views/students/show.html.erb @@ -11,7 +11,7 @@ <% end %>

    Email: <%= @student.email %>

    Descripción: <%= @student.description %>

    - + <%= image_tag @student.image , :size=>"200x200" %>
    diff --git a/db/seeds.rb b/db/seeds.rb index 3e8e823..f1df18c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -17,9 +17,10 @@ Subcategory.create(:name => "Tango", :category_id => 3) Subcategory.create(:name => "Capoeira", :category_id => 3) -Tag.create(:name => "Musica") -Tag.create(:name => "Idioma") -Tag.create(:name => "Baile") +Tag.create(:name => "Avanzado") +Tag.create(:name => "Intermedio") +Tag.create(:name => "Principiante") +Tag.create(:name => "Experiencia") Plan.create(:name => "Visitas Básico", :type => "VisitsPlan", :price => 100.00, :active => true) Plan.create(:name => "Visitas Full", :type => "VisitsPlan", :price => 300.00, :active => true) @@ -30,20 +31,53 @@ #PROFES User.create(:name => "Juan Perez", :description => "Profesor de guitarra. 12 años de experiencia", :image => "guitar-teacher1.jpg", :birthdate => "1966-07-08 00:00:00", :email => "juanperez@gmail.com", :role => User::ROLE_TEACHER, :password => "123123", :password_confirmation => "123123") -User.create(:name => "Carla Gomez", :description => "Profesora de ingles. 5 años viviendo en Inglaterra. Certificaciones internacionales", :image => "english-teacher1.jpg", :birthdate => "1978-04-19 00:00:00", :email => "carlagomez@gmail.com", :role => User::ROLE_TEACHER, :password => "123123", :password_confirmation => "123123") +User.create(:name => "Carla Gomez", :description => "Profesora de ingles y francés. 5 años viviendo en Europa. Certificaciones internacionales", :image => "english-teacher1.jpg", :birthdate => "1978-04-19 00:00:00", :email => "carlagomez@gmail.com", :role => User::ROLE_TEACHER, :password => "123123", :password_confirmation => "123123") +User.create(:name => "Amanda González", :description => "Profesora de piano. Reconocida internacionalmente.", :image => "profesoraPiano.jpg", :birthdate => "1950-04-19 00:00:00", :email => "amandaGonzalez@gmail.com", :role => User::ROLE_TEACHER, :password => "123123", :password_confirmation => "123123") + #ESTUDIANTES User.create(:name => "Mauro Icardi", :description => "Jugador del Inter de Milan", :image => nil, :birthdate => "1990-04-16 00:00:00", :email => "peliculasfinaldvd@gmail.com", :role => User::ROLE_STUDENT, :password => "123123", :password_confirmation => "123123", :facebook_id => 666474016767940) +User.create(:name => "Esteban Garcia", :description => "Economista", :image => "economista.jpg", :birthdate => "1974-06-20 00:00:00", :email => "estebanGarcia@gmail.com", :role => User::ROLE_STUDENT, :password => "123123", :password_confirmation => "123123") +User.create(:name => "Susana Rinaldi", :description => "Jubilada", :image => "jubilada.jpg", :birthdate => "1950-09-16 00:00:00", :email => "susanaRinaldi@gmail.com", :role => User::ROLE_STUDENT, :password => "123123", :password_confirmation => "123123") +User.create(:name => "Lucas Estevez", :description => "Ingeniero", :image => "ingeniero.jpg", :birthdate => "1985-02-07 00:00:00", :email => "lucasEstevez@gmail.com", :role => User::ROLE_STUDENT, :password => "123123", :password_confirmation => "123123") +User.create(:name => "Micaela Baez", :description => "Estudiante de arte", :image => "estudianteArte.jpg", :birthdate => "1993-05-03 00:00:00", :email => "micaelaBaez@gmail.com", :role => User::ROLE_STUDENT, :password => "123123", :password_confirmation => "123123") Course.create(name: "Guitarra para principiantes", description: "Curso de guitarra en zona sur", longitude: -58.3887, latitude: -34.8029, address: "Avenida Tomás Espora 1007, Adrogué, Buenos Aires Province, Argentina", subcategory_id: 1, price: 150) Course.create(name: "Super curso de guitarra", description: "Aprende las canciones que te gustan", longitude: -58.39121840000001, latitude: -34.7970765, address: "Mitre 1230, Adrogué, Buenos Aires Province, Argentina", subcategory_id: 1, price: 90) Course.create(name: "Curso de Piano clásico", description: "Curso de piano, nivel avanzado", longitude: -58.38872439999999, latitude: -34.8103353, address: "Avenida Tomás Espora 1507, Adrogué, Buenos Aires Province, Argentina", subcategory_id: 2, price: 350) Course.create(name: "Aprenda ingles con Miss Carla", description: "Clases de ingles para escolares", longitude: -58.3792534, latitude: -34.7678337, address: "Temperley, Buenos Aires Province, Argentina", subcategory_id: 4, price: 200) +Course.create(name: "Francés para todas las edades!", description: "Clases de francés en todos los niveles, para todas las edades. Más de 50 años de experiencia.", longitude: -58.3945, latitude: -34.7789, address: "Avenida Eva Perón, Temperley, Buenos Aires, Argentina 280", subcategory_id: 5, price: 300) #CourseStudent.create(:student_id => 1, :course_id => 1) CourseTeacher.create(:teacher_id => 1, :course_id => 1) +CourseTeacher.create(:teacher_id => 1, :course_id => 2) CourseTeacher.create(:teacher_id => 2, :course_id => 4) +CourseTeacher.create(:teacher_id => 2, :course_id => 5) +CourseTeacher.create(:teacher_id => 3, :course_id => 3) + +#Curso 1 - Guitarra +Opinion.create(description: "El profesor sabe mucho pero no explica bien", course_id: 1, date: Time.now - 1, rating: 2, user_id: 6) +Opinion.create(description: "El curso es muy interesante, se aprende un montón", course_id: 1, date: Time.now - 5, rating: 4, user_id: 4) +Consultation.create(description: "Buenas tardes, quería saber los días en los que se dicta el curso. Gracias!", course_id: 1, date: Time.now - 10, user_id: 7) +Consultation.create(description: "Buenas tardes Micaela, los cursos se dictan de lunes a viernes, en horarios acordados con el alumno. Saludos ", course_id: 1, date: Time.now - 3, user_id: 1) + +#Curso 2 - Guitarra +Opinion.create(description: "100% recomendado! El profe un genio!", course_id: 2, date: Time.now - 2, rating: 4, user_id: 7) +Opinion.create(description: "El profesor explica muy bien!", course_id: 2, date: Time.now - 3, rating: 5, user_id: 5) + +#Curso 4 - Ingles +Opinion.create(description: "Las profesoras son muy agradables, en la clase se habla todo el tiempo en inglés.", course_id: 4, date: Time.now - 10, rating: 4, user_id: 7) +Opinion.create(description: "Fue una buena experiencia, aunque hubiera preferido un curso más personalizado, con menos alumnos.", course_id: 4, date: Time.now - 5, rating: 3, user_id: 4) + -Opinion.create(description: "100% recomendado! El profe un genio!", course_id: 2, date: Time.now - 2, rating: 4) -Opinion.create(description: "El profesor explica muy bien!", course_id: 2, date: Time.now - 3, rating: 5) -Opinion.create(description: "El profesor sabe mucho pero no explica bien", course_id: 1, date: Time.now - 1, rating: 2) -Opinion.create(description: "El profesor es un ladrón!", course_id: 1, date: Time.now - 5, rating: 1) +#Imagenes curso +Upload.create(upload_file_name: "curso6.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 44974 ,upload_updated_at: "2014-08-03 19:43:22",course_id: 1 ,created_at: "2014-08-03 19:43:22" ,updated_at: "2014-08-03 19:43:22") +Upload.create(upload_file_name: "curso7.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 26901 ,upload_updated_at: "2014-08-03 19:43:22",course_id: 1 ,created_at: "2014-08-03 19:43:22" ,updated_at: "2014-08-03 19:43:22") +Upload.create(upload_file_name: "curso8.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 2729778 ,upload_updated_at: "2014-08-03 19:43:22",course_id: 1 ,created_at: "2014-08-03 19:43:22" ,updated_at: "2014-08-03 19:43:22") +Upload.create(upload_file_name: "curso3.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 16682 ,upload_updated_at: "2014-08-03 20:12:21",course_id: 4 ,created_at: "2014-08-03 20:12:21" ,updated_at: "2014-08-03 20:12:21") +Upload.create(upload_file_name: "curso4.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 29123 ,upload_updated_at: "2014-08-03 20:12:21",course_id: 4 ,created_at: "2014-08-03 20:12:21" ,updated_at: "2014-08-03 20:12:21") +Upload.create(upload_file_name: "curso1.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 577049 ,upload_updated_at: "2014-08-03 20:12:22",course_id: 4 ,created_at: "2014-08-03 20:12:22" ,updated_at: "2014-08-03 20:12:22") +Upload.create(upload_file_name: "curso_piano1.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 23420 ,upload_updated_at: "2014-08-03 20:15:39",course_id: 3 ,created_at: "2014-08-03 20:15:39" ,updated_at: "2014-08-03 20:15:39") +Upload.create(upload_file_name: "curso_piano2.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 48925 ,upload_updated_at: "2014-08-03 20:15:39",course_id: 3 ,created_at: "2014-08-03 20:15:39" ,updated_at: "2014-08-03 20:15:39") +Upload.create(upload_file_name: "curso_piano3.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 200566 ,upload_updated_at: "2014-08-03 20:15:39",course_id: 3 ,created_at: "2014-08-03 20:15:39" ,updated_at: "2014-08-03 20:15:39") +Upload.create(upload_file_name: "curso_piano4.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 72422 ,upload_updated_at: "2014-08-03 20:20:29",course_id: 2 ,created_at: "2014-08-03 20:20:30" ,updated_at: "2014-08-03 20:20:30") +Upload.create(upload_file_name: "curso_guitarra4.jpg" ,upload_content_type: "image/jpeg" ,upload_file_size: 3626228 ,upload_updated_at: "2014-08-03 20:20:30",course_id: 2 ,created_at: "2014-08-03 20:20:30" ,updated_at: "2014-08-03 20:20:30")