diff --git a/app/assets/javascripts/mobile.js b/app/assets/javascripts/mobile.js index 56fb00afd..0aadb6995 100644 --- a/app/assets/javascripts/mobile.js +++ b/app/assets/javascripts/mobile.js @@ -6,6 +6,7 @@ //= require mbp-modernizr-custom //= require mbp-respond.min //= require mbp-helper +//= require jquery.autoSuggest.custom $(document).ready(function(){ $('.shield a').click(function(){ diff --git a/app/assets/stylesheets/mobile.css.scss b/app/assets/stylesheets/mobile.css.scss index e011d20f0..f6b152e15 100644 --- a/app/assets/stylesheets/mobile.css.scss +++ b/app/assets/stylesheets/mobile.css.scss @@ -1,6 +1,7 @@ @import 'bootstrap'; @import 'bootstrap-responsive'; @import "_mixins.css.scss"; +@import 'vendor/autoSuggest'; $blue: #3f8fba; @@ -702,3 +703,52 @@ form#new_message.new_message input.button.creation{ float: right; margin: 0 5px 5px; } + +form#new_conversation.new_conversation { + background-color: #FFFFFF; + border-bottom: 1px solid #999999; + box-shadow: 0 2px 3px #999999; + margin: 5px 20px; + padding: 5px; +} + +.span-2 { + margin: 5px 5px; + text-transform: uppercase; +} + +.span-10 { + width: 100%; +} + +textarea#conversation_text { + border: 0.2s; + border-radius: 0 0 0 0; + font-size: larger; + left: 0; + margin: 10px 0; + width: 218px; + padding: 0; +} + +.bottom_submit_section { + display: block; + position: relative; + text-align: right; +} + +.button.creation { + color: #333; + text-decoration: none; + background-color: #E6E6E6; + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -webkit-transition-property: background-position; + -webkit-transition-duration: 0.1s; + -webkit-transition-timing-function: linear; + -webkit-transition-delay: initial; + -moz-transition: background-position 0.1s linear; + -ms-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} diff --git a/app/assets/stylesheets/vendor/autoSuggest.css b/app/assets/stylesheets/vendor/autoSuggest.css index 444db341a..93866e5c1 100644 --- a/app/assets/stylesheets/vendor/autoSuggest.css +++ b/app/assets/stylesheets/vendor/autoSuggest.css @@ -12,7 +12,7 @@ ul.as-selections { -webkit-border-radius: 3px; -moz-border-radius: 3px; - width: 383px; + width: 214px; } ul.as-selections.loading { diff --git a/app/controllers/conversations_controller.rb b/app/controllers/conversations_controller.rb index d5a81e0d7..998fddae6 100644 --- a/app/controllers/conversations_controller.rb +++ b/app/controllers/conversations_controller.rb @@ -1,7 +1,7 @@ class ConversationsController < ApplicationController before_filter :authenticate_user! - respond_to :html, :json, :js + respond_to :html, :mobile, :json, :js def index @conversations = Conversation.joins(:conversation_visibilities).where( @@ -82,7 +82,10 @@ class ConversationsController < ApplicationController elsif params[:aspect_id] @contact_ids = current_user.aspects.find(params[:aspect_id]).contacts.map{|c| c.id}.join(',') end + if session[:mobile_view] == true && request.format.html? + render :layout => true + elsif render :layout => false + end end - end diff --git a/app/views/conversations/new.haml b/app/views/conversations/new.haml index 426fc8ddd..afab424df 100644 --- a/app/views/conversations/new.haml +++ b/app/views/conversations/new.haml @@ -2,6 +2,10 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +- if in_mobile_view? + = javascript_include_tag :jquery + = javascript_include_tag :mobile + :javascript $(document).ready(function () { var data = $.parseJSON( "#{escape_javascript(@contacts_json)}" ), @@ -29,7 +33,6 @@ = t('conversations.index.new_message') = form_for Conversation.new do |conversation| - %br .span-2 %h4 @@ -37,17 +40,15 @@ .span-10.last = text_field_tag "contact_autocomplete" .clearfix - + %br .span-2 %h4 = t('.subject') .span-10.last = conversation.text_field :subject - + %br .span-10.prepend-2.last = text_area_tag "conversation[text]", '', :rows => 5 - .clearfix - .bottom_submit_section = conversation.submit t('.send'), 'data-disable-with' => t('.sending'), :class => 'button creation'