Skip to content

Commit

Permalink
menu: make layout more compact
Browse files Browse the repository at this point in the history
  • Loading branch information
mswart committed Jul 2, 2015
1 parent fd9d48e commit eefc7f8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 39 deletions.
3 changes: 2 additions & 1 deletion app/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ de:
feedbacks: Nutzerrückmeldungen
data_proposals: Änderungsvorschläge
about: Die Mensa
more: "Mehr zu %{name}"
more: "Mehr zur Mensa"
more_with_name: "Mehr zu %{name}"

menu:
more_actions: "Auch für Fehlerberichte, Korrekturvorschläge ..."
Expand Down
22 changes: 22 additions & 0 deletions app/views/menu/_canteen.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
section
#remote-canteens-show
header.page-header
h2.centered = canteen.name
ul.meals
= render partial: "canteens/day", locals: { day: canteen.days.find_by_date(@date) }
.content
p.action
i class=canteen_state_icon(canteen.fetch_state)
=t :canteen, canteen.fetch_state
'
= '(' + t(:canteen, :last_update_at)
'
= timeago_tag canteen.last_fetched_at
' )
br
- if @date.to_date == Time.zone.now.to_date
= link_to t(:canteen, :more, name: canteen.name), canteen_path(canteen), title: t(:canteen, :more_with_name, name: canteen.name), class: "btn btn-secondary"
- else
= link_to t(:canteen, :more, name: canteen.name), canteen_path(canteen, date: @date), title: t(:canteen, :more_with_name, name: canteen.name), class: "btn btn-secondary"
br
= t :menu, :more_actions
49 changes: 11 additions & 38 deletions app/views/menu/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,14 @@ section
= t :today
- else
= l @date.to_date, format: :with_weekday

- @canteens.each do |canteen|
.row
.span8
section
#remote-canteens-show
header.page-header
h2.centered = canteen.name
ul.meals
= render partial: "canteens/day", locals: { day: canteen.days.find_by_date(@date) }

aside.span4
section
header
h2=t(:canteen, :about)
.content
address= canteen.address
- if canteen.phone.present?
p.icon-phone#phone
=canteen.phone
- if canteen.email.present?
p.icon-envelope#email
=link_to canteen.email, "mailto:#{obj[:canteen].email}"
h4
i class=canteen_state_icon(canteen.fetch_state)
=t :canteen, canteen.fetch_state
- unless canteen.fetch_state == :no_fetch_ever_message
p
=t :canteen, :last_update_at
br
= timeago_tag canteen.last_fetched_at
p.action
- if @date.to_date == Time.zone.now.to_date
= link_to t(:canteen, :more, name: canteen.name), canteen_path(canteen), class: "btn btn-secondary"
- else
= link_to t(:canteen, :more, name: canteen.name), canteen_path(canteen, date: @date), class: "btn btn-secondary"
br
= t :menu, :more_actions
.row
.span6
- pos = 0
- while pos < @canteens.size
= render partial: "canteen", locals: { canteen: @canteens[pos] }
- pos += 2
.span6
- pos = 1
- while pos < @canteens.size
= render partial: "canteen", locals: { canteen: @canteens[pos] }
- pos += 2

0 comments on commit eefc7f8

Please sign in to comment.