Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Schedule popups at mobile devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvislov committed Apr 4, 2013
1 parent b2c4cbf commit daf0989
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 21 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ gem 'platidoma', '>= 0.0.4'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
gem 'mobylette'


# Gems used only for assets and not required
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ GEM
mini_magick (3.5.0)
subexec (~> 0.2.1)
minitest (4.3.3)
mobylette (3.3.2)
actionpack (>= 3.0)
mocha (0.13.3)
metaclass (~> 0.0.1)
modernizr-rails (2.6.2)
Expand Down Expand Up @@ -368,6 +370,7 @@ DEPENDENCIES
less-rails
mini_magick
minitest
mobylette
mocha
modernizr-rails
multi_json (~> 1.3.0)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class ApplicationController < ActionController::Base
include AuthHelper
include Mobylette::RespondToMobileRequests
end

67 changes: 46 additions & 21 deletions app/views/web/schedules/_lecture.html.haml
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
.modal.hide.fade{id: dom_id(slot), "aria-hidden" => "true", "aria-labelledby" => "#{dom_id(slot)}myModalLabel", :role => "dialog", :tabindex => "-1"}
.modal-header
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} ×
%h3{id: "#{dom_id(slot)}myModalLabel"}
= slot.event.user.full_name
.modal-body
%p= nl2br(slot.event.thesises)

.modal.hide.fade{id: "#{dom_id(slot)}__author_info", "aria-hidden" => "true", "aria-labelledby" => "#{dom_id(slot)}myModalLabel__author_info", :role => "dialog", :tabindex => "-1"}
.modal-header
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} ×
%h3{id: "#{dom_id(slot)}myModalLabel__author_info"}
= slot.event.user.full_name
.modal-body
.userinfo
- if slot.event.user.photo?
.pull-left.userpic
= image_tag(slot.event.user.photo.url)
%p.userabout= slot.event.user.about
.clearfix
- if is_mobile_request?
.modal.hide.fade{id: dom_id(slot), "aria-hidden" => "true", "aria-labelledby" => "#{dom_id(slot)}myModalLabel", :role => "dialog", :tabindex => "-1"}
.modal-header
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} ×
%h3{id: "#{dom_id(slot)}myModalLabel__author_info"}
= slot.event.user.full_name
.modal-body
.userinfo
- if slot.event.user.photo?
.pull-left.userpic
= image_tag(slot.event.user.photo.url)
%p.userabout= slot.event.user.about
.clearfix
.modal-header
%h3{id: "#{dom_id(slot)}myModalLabel"}
= slot.event.title
.modal-body
%p= nl2br(slot.event.thesises)

- else
.modal.hide.fade{id: dom_id(slot), "aria-hidden" => "true", "aria-labelledby" => "#{dom_id(slot)}myModalLabel", :role => "dialog", :tabindex => "-1"}
.modal-header
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} ×
%h3{id: "#{dom_id(slot)}myModalLabel"}
= slot.event.user.full_name
.modal-body
%p= nl2br(slot.event.thesises)

.modal.hide.fade{id: "#{dom_id(slot)}__author_info", "aria-hidden" => "true", "aria-labelledby" => "#{dom_id(slot)}myModalLabel__author_info", :role => "dialog", :tabindex => "-1"}
.modal-header
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} ×
%h3{id: "#{dom_id(slot)}myModalLabel__author_info"}
= slot.event.user.full_name
.modal-body
.userinfo
- if slot.event.user.photo?
.pull-left.userpic
= image_tag(slot.event.user.photo.url)
%p.userabout= slot.event.user.about
.clearfix


.event{ class: "area-#{index} start-#{slot.start_hour} offset-#{slot.start_offset} long-#{slot.duration}", style: "background-color: #{slot.event.workshop.try(:color)}"}
%span.summary
Expand Down Expand Up @@ -47,7 +68,11 @@
%a.caption{data: {toggle: 'modal'}, href: "##{dom_id(slot)}", role: "button"}
= slot.event.title
- if slot.event.user.about?
%a.author{data: {toggle: 'modal'}, href: "##{dom_id(slot)}__author_info", role: "button"}
- if is_mobile_request?
%a.author{data: {toggle: 'modal'}, href: "##{dom_id(slot)}", role: "button"}
= slot.event.user.full_name
- else
%a.author{data: {toggle: 'modal'}, href: "##{dom_id(slot)}__author_info", role: "button"}
= slot.event.user.full_name
- else
.author= slot.event.user.full_name
Expand Down

0 comments on commit daf0989

Please sign in to comment.