Skip to content

Commit

Permalink
add doctor image to doctor extension
Browse files Browse the repository at this point in the history
  • Loading branch information
jmercedes committed Mar 14, 2013
1 parent 46d8b01 commit 1331427
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 40 deletions.
5 changes: 0 additions & 5 deletions db/migrate/20130313215811_add_position_to_refinery_doctors.rb

This file was deleted.

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

ActiveRecord::Schema.define(:version => 20130313154119) do
ActiveRecord::Schema.define(:version => 20130313215042) do

create_table "refinery_blog_categories", :force => true do |t|
t.string "title"
Expand Down Expand Up @@ -78,6 +78,7 @@
t.datetime "updated_at", :null => false
t.string "dr_img"
t.string "name"
t.integer "dr_img_id"
end

create_table "refinery_doctors_branches", :force => true do |t|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ module Doctors
class Doctor < Refinery::Core::BaseModel
self.table_name = 'refinery_doctors'

attr_accessible :prefix, :full_name, :bio, :specialty, :branch, :schedule, :location, :position, :dr_img
attr_accessible :prefix, :full_name, :bio, :specialty, :branch, :schedule, :location, :position, :dr_img, :dr_img_id

acts_as_indexed :fields => [:prefix, :full_name, :bio, :specialty, :branch, :schedule, :location, :dr_img]
acts_as_indexed :fields => [:prefix, :full_name, :bio, :specialty, :branch, :schedule, :location, :dr_img, :dr_img_id]

validates :prefix, :presence => true
belongs_to :dr_img, :class_name => '::Refinery::Image'
has_many :branches
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
:include_object_name => true %>


<div class='field'>
<%= f.label :dr_img -%>
<%= f.file_field :dr_img, :class => 'larger widest' -%>
</div>
<div class='field'>
<%= f.label :dr_img -%>
<%= render '/refinery/admin/image_picker',
:f => f,
:field => :dr_img_id,
:image => @doctor.dr_img,
:toggle_image_display => false %>

</div>


<div class='field'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,28 @@


<% content_for :side_body do %>

<%= raw @page.content_for(:side_body) %>

<%= raw @page.content_for(:side_body) %>
<% end %>



<% content_for :body do %>
<% @doctors.each do |doctor| %>

<p><strong><%= doctor.prefix + ' ' + doctor.full_name %></strong><br>
<%= doctor.specialty %></p>
<p><strong>Horario: </strong><%= doctor.schedule %><br>
<strong>Consultorio: </strong><%= doctor.location %></p>
<%= link_to "Biografía", refinery.doctors_doctor_path(doctor), class: "btn btn-primary" %>
<% @doctors.each do |doctor| %>

<div class="span3">
<p><%= image_fu doctor.dr_img, '120x120'%></p>
</div>

<div class="span8">
<p><strong><%= doctor.prefix + ' ' + doctor.full_name %></strong>
<br>
<%= doctor.specialty %>
</p>
<p><strong>Horario: </strong><%= doctor.schedule %> | <strong>Consultorio: </strong><%= doctor.location %><br><br>
<%= link_to "Biografía", refinery.doctors_doctor_path(doctor), class: "btn btn-mini btn-primary" %></p>
</div>
<div class="clearfix"></div>

<hr>

<%#= link_to doctor.prefix, refinery.doctors_doctor_path(doctor) %>

<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,29 @@
</aside>
<% end %>

</div>
</div>


<div class="clearfix">
<% content_for :body do %>
<section>
<p>
<div class="span3">
<p><%= image_fu @doctor.dr_img, '250x250'%></p>
</div>

<div class="span4">
<h1><%= @doctor.prefix + ' ' + @doctor.full_name %></h1>
<h2><%= @doctor.specialty %></h2>
</p>
</section>
<section>
<h1>Biografía</h1>
<p>
<%=raw @doctor.bio %>
</p>
</section>
<section>
<strong>Horario: </strong><%=raw @doctor.schedule %>
</section>
<section>
<strong>Consultorio: </strong><%=raw @doctor.location %>
<strong>Horario: </strong><%=raw @doctor.schedule %><br>
<strong>Consultorio: </strong><%=raw @doctor.location %>
<h3>Biografía:</h3>
<p>
<%=raw @doctor.bio %>
</p>


</div>

</section>
<% end %>

Expand Down

0 comments on commit 1331427

Please sign in to comment.