Mercurial > hg > soundsoftware-site
comparison app/helpers/application_helper.rb @ 503:5d608412b003 feature_212
Pull out font name specifications from stylesheets and serve differently to different platforms (falling back to our usual web fonts). Fixes #212
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Thu, 14 Jul 2011 10:14:03 +0100 |
parents | 753f1380d6bc |
children | 5e80956cc792 |
comparison
equal
deleted
inserted
replaced
502:b9f81065a8e1 | 503:5d608412b003 |
---|---|
911 | 911 |
912 def robot_exclusion_tag | 912 def robot_exclusion_tag |
913 '<meta name="robots" content="noindex,follow,noarchive" />' | 913 '<meta name="robots" content="noindex,follow,noarchive" />' |
914 end | 914 end |
915 | 915 |
916 def stylesheet_platform_font_tag | |
917 agent = request.env['HTTP_USER_AGENT'] | |
918 name = 'fonts-generic' | |
919 if agent and agent =~ %r{Windows} | |
920 name = 'fonts-ms' | |
921 elsif agent and agent =~ %r{Macintosh} | |
922 name = 'fonts-mac' | |
923 end | |
924 stylesheet_link_tag name, :media => 'all' | |
925 end | |
926 | |
916 # Returns true if arg is expected in the API response | 927 # Returns true if arg is expected in the API response |
917 def include_in_api_response?(arg) | 928 def include_in_api_response?(arg) |
918 unless @included_in_api_response | 929 unless @included_in_api_response |
919 param = params[:include] | 930 param = params[:include] |
920 @included_in_api_response = param.is_a?(Array) ? param.collect(&:to_s) : param.to_s.split(',') | 931 @included_in_api_response = param.is_a?(Array) ? param.collect(&:to_s) : param.to_s.split(',') |