diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 905952665..997fe55f2 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -27,6 +27,10 @@ class PostsController < ApplicationController notification.save end + if is_mobile_device? + @comments = @post.comments + end + respond_to do |format| format.xml{ render :xml => @post.to_diaspora_xml } format.mobile{render 'posts/show.mobile.haml'} diff --git a/app/views/aspects/index.mobile.haml b/app/views/aspects/index.mobile.haml index 0d7ebde86..806b88d18 100644 --- a/app/views/aspects/index.mobile.haml +++ b/app/views/aspects/index.mobile.haml @@ -2,12 +2,11 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%h2 +%h2{:style => "padding:0 10px;display:none;"} - if @stream.for_all_aspects? = t('all_aspects') - else = @stream.aspect - = link_to 'Post', new_status_message_path, :id => 'publisher_button' #main_stream.stream = render 'shared/stream', :posts => @stream.posts diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 26423f0e3..1cb5fd64d 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -13,7 +13,7 @@ %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ / Viewport scale - %meta{:name =>'viewport', :content => "width=device-width, initial-scale=1"} + %meta{:name =>'viewport', :content => "width=device-width, minimum-scale=1 maximum-scale=1"} %meta{:name => "HandheldFriendly", :content => "True"} %meta{:name => "MobileOptimized", :content => "320"} / Force cleartype on WP7 @@ -25,8 +25,8 @@ %link{:rel => 'shortcut icon', :href => '/apple-touch-icon.png'} / iOS mobile web app indicator - /%meta{:name => "apple-mobile-web-app-capable", :content => "yes"} - /%link{:rel => "apple-touch-startup-image", :href => "/images/apple-splash.png"} + %meta{:name => "apple-mobile-web-app-capable", :content => "yes"} + %link{:rel => "apple-touch-startup-image", :href => "/images/apple-splash.png"} / Stylesheets = include_stylesheets :mobile @@ -45,7 +45,8 @@ %body %header - = link_to(image_tag('white@2x.png', :height => 22, :width => 136, :id => 'header_title'), aspects_path) + = link_to(image_tag('icons/compose_mobile2.png', :height => 28, :width => 28), new_status_message_path, :class => 'compose_icon') + = link_to(image_tag('white@2x.png', :height => 20, :width => 127, :id => 'header_title'), aspects_path) - if flash.present? %p diff --git a/app/views/posts/show.mobile.haml b/app/views/posts/show.mobile.haml index 198a6cd58..fcaaf3331 100644 --- a/app/views/posts/show.mobile.haml +++ b/app/views/posts/show.mobile.haml @@ -6,5 +6,5 @@ :locals => {:post => @post, :commenting_disabled => defined?(@commenting_disabled), :expanded_info => true} -.stream.show{:data=>{:guid=>@post.id}} - = render "comments/comments", :post => @post, :comments => @post.comments, :comments_expanded => true +/.stream.show{:data=>{:guid=>@post.id}} +/ = render "comments/comments", :post => @post, :comments => @post.comments, :comments_expanded => true diff --git a/app/views/shared/_stream_element.mobile.haml b/app/views/shared/_stream_element.mobile.haml index 25ef1f082..8737a0d75 100644 --- a/app/views/shared/_stream_element.mobile.haml +++ b/app/views/shared/_stream_element.mobile.haml @@ -49,10 +49,13 @@ = link_to '', '#', :class => "image_link like_action active", 'data-post-id' => post.id, 'data-like-id' => current_user.like_for(post).id - else = link_to '', '#', :class => "image_link like_action inactive", 'data-post-id' => post.id - - .reshare_count.tab - = post.comments.size - = link_to '', post_path(post), :class => "image_link comment_action" + + /.reshare_count.tab + / = post.comments.size + / = link_to '', post_path(post), :class => "image_link comment_action" + + = render "comments/comments", :post => post, :comments => post.comments, :comments_expanded => true + - else .floater diff --git a/public/images/icons/compose_mobile.png b/public/images/icons/compose_mobile.png new file mode 100644 index 000000000..b3284d33b Binary files /dev/null and b/public/images/icons/compose_mobile.png differ diff --git a/public/images/icons/compose_mobile2.png b/public/images/icons/compose_mobile2.png new file mode 100644 index 000000000..90c0db535 Binary files /dev/null and b/public/images/icons/compose_mobile2.png differ diff --git a/public/stylesheets/sass/mobile.scss b/public/stylesheets/sass/mobile.scss index 9ccecaf5b..3fa89d1d8 100644 --- a/public/stylesheets/sass/mobile.scss +++ b/public/stylesheets/sass/mobile.scss @@ -21,6 +21,7 @@ a { body { background: #555555; max-width: 100%; + margin-top: 55px; } #login_form { @@ -83,20 +84,22 @@ body { bottom: 0; }; padding: 0 !important; } -.comments { - color: #cccccc; - .from { - a { - color: #888888 !important; } } } - .new_comment { padding: 10px; } +.comments { + padding: 0; + margin: 0; + .content { + padding: 0; + } +} + .comment { padding: 4px 0; border: { - bottom: 1px dotted #444444; }; + bottom: 1px dotted #ccc; }; } .stream_element { @@ -106,7 +109,10 @@ body { color: white; }; border: { top: 1px solid black; - bottom: 1px solid black; }; } + bottom: 1px solid black; }; + + max-width: 700px; +} .photo_attachments { position: relative; @@ -208,6 +214,11 @@ body { header { @include linear-gradient(#444444, black); @include box-shadow(0,1px,1px,rgba(0,0,0,0.7)); + width: 100%; + position: fixed; + z-index: 10; + top: 0; + border: { bottom: 1px solid #222; } @@ -216,7 +227,6 @@ header { float: right; } } footer { - font-size: larger; text-align: center; a, a:visited { @@ -236,9 +246,7 @@ footer { top: 10px; }; border: { top: 1px solid #dddddd; }; - height: 24px; - font: { - size: larger; }; + min-height: 24px; a { color: #999999 !important; font-weight: bold !important; } @@ -249,12 +257,18 @@ footer { text: { align: center; } + border: { + bottom: 1px solid #ccc; + } font: { size: 28px; } color: #ccc; + .tab { display: table-cell; + position:relative; + top: -5px; border: { right: 1px solid #ccc; @@ -309,3 +323,9 @@ form { input { font: { size: larger; }; } } + +.compose_icon { + position: absolute; + top: 6px; + right: 15px; +}