From 4bd0cbfdc8e8363669f22454b609196c08d0d367 Mon Sep 17 00:00:00 2001 From: maxwell <maxwell@joindiaspora.com> Date: Fri, 1 Apr 2011 01:18:01 -0700 Subject: [PATCH] publisher now can handle services, and is on seperate page --- app/controllers/status_messages_controller.rb | 2 +- app/views/aspects/index.mobile.haml | 7 +-- app/views/aspects/show.mobile.haml | 2 + app/views/layouts/application.mobile.haml | 3 ++ app/views/shared/_publisher.mobile.haml | 43 ++++++++++++++----- public/javascripts/custom-mobile-scripting.js | 2 + 6 files changed, 45 insertions(+), 14 deletions(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 547fbe3725..1eae974487 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -72,7 +72,7 @@ class StatusMessagesController < ApplicationController respond_to do |format| format.js { render :create, :status => 201} format.html { redirect_to :back} - format.mobile{ redirect_to :back} + format.mobile{ redirect_to root_url} end else if !photos.empty? diff --git a/app/views/aspects/index.mobile.haml b/app/views/aspects/index.mobile.haml index da3c6a4537..94a60e396a 100644 --- a/app/views/aspects/index.mobile.haml +++ b/app/views/aspects/index.mobile.haml @@ -8,11 +8,12 @@ - else = @aspect -.grey_back - = render 'shared/publisher', :aspect_ids => @aspect_ids - +%h1 + = link_to 'post a message >> ', '#publisher_page', :id => 'publisher_button' #main_stream.stream = render 'shared/stream', :posts => @fakes %a.more-link.paginate{:href => '#'} %h2= t("more") = will_paginate @posts +- content_for :subpages do + = render 'shared/publisher', :aspect_ids => @aspect_ids diff --git a/app/views/aspects/show.mobile.haml b/app/views/aspects/show.mobile.haml index 91ddc6dbad..77a9be5de8 100644 --- a/app/views/aspects/show.mobile.haml +++ b/app/views/aspects/show.mobile.haml @@ -9,3 +9,5 @@ #pagination = will_paginate @posts +- content_for :subpages do + = render 'shared/publisher', :aspect_ids => @aspect_ids diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 67ff5313ef..85ffedfa93 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -89,3 +89,6 @@ = render :partial =>'shared/footer' + + = yield :subpages + diff --git a/app/views/shared/_publisher.mobile.haml b/app/views/shared/_publisher.mobile.haml index eeedb044a8..f78d8a524f 100644 --- a/app/views/shared/_publisher.mobile.haml +++ b/app/views/shared/_publisher.mobile.haml @@ -9,22 +9,45 @@ }); }); -#publisher - = form_for StatusMessage.new do |status| - #publisher_text - = t('.whats_on_your_mind') +#publisher_page{:data => {:role => 'page', :theme => 'c'}} + #header + - if current_user + .left + = link_to(image_tag('icons/list_white.png'), '/aspects/#menu', :id => "menu_button") - = status.text_area :text + .right + = link_to(image_tag('icons/search_white.png'), people_path) + = link_to(image_tag('white.png'), aspects_path) + %div{:data => {:role => 'content'}} + = form_for StatusMessage.new, {:data => {:ajax => false}} do |status| + #publisher_text + = t('.whats_on_your_mind') - - for aspect_id in @aspect_ids - = hidden_field_tag 'aspect_ids[]', aspect_id.to_s + = status.text_area :text + - for aspect_id in @aspect_ids + = hidden_field_tag 'aspect_ids[]', aspect_id.to_s - %fieldset.hidden{:style => 'text-align:right;'} - %fieldset{:data => {:role => 'controlgroup', :type=>'horizontal'}} + + %fieldset - unless params[:a_ids] %input{:type => 'checkbox', :name => 'status_message[public]', :id => 'public', :class => 'custom', :value => 'true'} %label{:for => 'public'} = t('.make_public') - = status.submit t('.share'), 'data-inline' => 'true', 'data-theme' => 'b' + - unless current_user.services.empty? + %div{:data => {:role => 'fieldcontain'}} + %label{:for => 'services', :class => 'select'} + choose services + + - current_user.services.each do |service| + %input{:type => 'checkbox', :name => "services[]", :id => "#{service.provider}", :class => 'custom', :value => "#{service.provider}"} + %label{:for => "#{service.provider}"} + = "#{service.provider}" + -#%select{:name => 'services', :multiple => 'multiple', :id => "services"} + -#%option + -#Choose a Service + -#- current_user.services.each do |service| + -#%option{:value => "#{service.provider}"} + -#= service.provider.titleize + = status.submit t('.share'), 'data-theme' => 'c' diff --git a/public/javascripts/custom-mobile-scripting.js b/public/javascripts/custom-mobile-scripting.js index 1ee6cbcf9f..4c47c3c6d3 100644 --- a/public/javascripts/custom-mobile-scripting.js +++ b/public/javascripts/custom-mobile-scripting.js @@ -7,5 +7,7 @@ $(document).bind("mobileinit", function() { $.extend($.mobile, { ajaxLinksEnabled: false, ajaxFormsEnabled: false + }); + $.mobile.selectmenu.prototype.options.nativeMenu = false; }); -- GitLab