toggle mobile site, when mobile device
This commit is contained in:
parent
35bc4e3aad
commit
ee02a073cd
6 changed files with 19 additions and 5 deletions
|
|
@ -95,12 +95,10 @@ class AspectsController < ApplicationController
|
|||
end
|
||||
|
||||
def manage
|
||||
Rails.logger.info("Controller time")
|
||||
@aspect = :manage
|
||||
@contacts = current_user.contacts.includes(:person => :profile).where(:pending => false)
|
||||
@remote_requests = Request.where(:recipient_id => current_user.person.id).includes(:sender => :profile)
|
||||
@aspects = @all_aspects.includes(:contacts => {:person => :profile})
|
||||
Rails.logger.info("VIEW TIME!!!!!!")
|
||||
end
|
||||
|
||||
def update
|
||||
|
|
|
|||
|
|
@ -18,4 +18,13 @@ class HomeController < ApplicationController
|
|||
render :show
|
||||
end
|
||||
end
|
||||
|
||||
def toggle_mobile
|
||||
if session[:mobile_view]
|
||||
session[:mobile_view] = false
|
||||
else
|
||||
session[:mobile_view] = true
|
||||
end
|
||||
redirect_to :back
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@
|
|||
%li= link_to t('layouts.header.blog'), "http://blog.joindiaspora.com"
|
||||
%li= link_to t('layouts.header.code'), "#{root_url.chomp('/')}/source.tar.gz" unless request.url.match(/joindiaspora.com/)
|
||||
%li= link_to t('.whats_new'), 'https://github.com/diaspora/diaspora/wiki/Changelog'
|
||||
%li= link_to(t('layouts.application.toggle'), toggle_mobile_path) if is_mobile_device?
|
||||
= image_tag 'powered_by_diaspora.png', :height => "11px", :width => "145px"
|
||||
%br
|
||||
= link_to t('.have_a_problem'), 'http://diaspora.shapado.com/'
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@
|
|||
%br
|
||||
= link_to t('layouts.header.logout'), destroy_user_session_path
|
||||
|
||||
%br
|
||||
%br
|
||||
= link_to t('layouts.application.toggle'), toggle_mobile_path
|
||||
|
||||
-if current_user
|
||||
#menu{:data => {:role => 'page'}}
|
||||
|
|
@ -102,6 +105,8 @@
|
|||
= link_to aspect, aspects_path('a_ids[]' => aspect.id)
|
||||
|
|
||||
%br
|
||||
|
||||
%br
|
||||
= link_to t('layouts.header.logout'), destroy_user_session_path
|
||||
%br
|
||||
%br
|
||||
= link_to t('layouts.application.toggle'), toggle_mobile_path
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ en:
|
|||
have_a_problem: "Have a problem? Find an answer here"
|
||||
your_aspects: "your aspects"
|
||||
logged_in_as: "logged in as %{name}"
|
||||
toggle: 'toggle mobile site'
|
||||
shared:
|
||||
publisher:
|
||||
posting: "Posting..."
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ Diaspora::Application.routes.draw do
|
|||
match 'hub', :to => 'publics#hub'
|
||||
|
||||
match'localize', :to => "localize#show"
|
||||
|
||||
match 'mobile/toggle', :to => 'home#toggle_mobile', :as => 'toggle_mobile'
|
||||
#root
|
||||
root :to => 'home#show'
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue