From 7dab5367c43d1244f84c6905c75c842cfa52cee4 Mon Sep 17 00:00:00 2001 From: Joe Bivins Date: Sat, 14 Jan 2012 11:49:48 -0500 Subject: [PATCH 1/2] Left-align comment text on mobile devices [ci skip] --- public/stylesheets/sass/mobile.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/public/stylesheets/sass/mobile.scss b/public/stylesheets/sass/mobile.scss index 807311005..5fb8c2165 100644 --- a/public/stylesheets/sass/mobile.scss +++ b/public/stylesheets/sass/mobile.scss @@ -248,6 +248,7 @@ body { .comments { overflow: auto; position: relative; + text-align: left; * { max-width: 100%; } min-height: 34px; From ca7632776fd704558481ced6c0623329fcc73519 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Sat, 14 Jan 2012 11:52:24 -0800 Subject: [PATCH 2/2] prevent mobile comments from 500ing --- app/controllers/comments_controller.rb | 5 +++++ app/views/comments/new.mobile.haml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 16b5a249a..79b73cc61 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -57,6 +57,10 @@ class CommentsController < ApplicationController end end + def new + render :layout => false + end + def index if user_signed_in? @post = current_user.find_visible_shareable_by_id(Post, params[:post_id]) @@ -68,6 +72,7 @@ class CommentsController < ApplicationController @comments = @post.comments.includes(:author => :profile).order('created_at ASC') respond_with do |format| format.json { render :json => @post.comments.as_api_response(:backbone), :status => 200 } + format.mobile{render :layout => false} end else raise ActiveRecord::RecordNotFound.new diff --git a/app/views/comments/new.mobile.haml b/app/views/comments/new.mobile.haml index c34cdf84a..453a092c9 100644 --- a/app/views/comments/new.mobile.haml +++ b/app/views/comments/new.mobile.haml @@ -1 +1 @@ -= new_comment_form(params[:post_id], current_user) += render :partial => 'new_comment', :locals =>{:post_id => params[:post_id]}