added the post to services icon on every page added a manage icon and moved the RSS link to the public explain
This commit is contained in:
parent
adfcc59631
commit
ec93faa2c4
6 changed files with 55 additions and 22 deletions
|
|
@ -10,7 +10,6 @@ class StatusMessagesController < ApplicationController
|
||||||
respond_to :json, :only => :show
|
respond_to :json, :only => :show
|
||||||
|
|
||||||
def create
|
def create
|
||||||
pp params
|
|
||||||
params[:status_message][:aspect_ids] = params[:aspect_ids]
|
params[:status_message][:aspect_ids] = params[:aspect_ids]
|
||||||
|
|
||||||
photos = Photo.where(:id => [*params[:photos]], :diaspora_handle => current_user.person.diaspora_handle)
|
photos = Photo.where(:id => [*params[:photos]], :diaspora_handle => current_user.person.diaspora_handle)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@
|
||||||
=t('.outside')
|
=t('.outside')
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
|
= link_to "RSS", current_user.public_url
|
||||||
|
%br
|
||||||
- if current_user.services
|
- if current_user.services
|
||||||
- for service in current_user.services
|
- for service in current_user.services
|
||||||
= t('.logged_in', :service => service.provider)
|
= t('.logged_in', :service => service.provider)
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
$(function() {
|
||||||
|
$(".question_mark").tipsy({trigger: 'hover', gravity: 'w'});
|
||||||
|
});
|
||||||
|
|
||||||
#publisher
|
#publisher
|
||||||
|
|
||||||
|
|
@ -41,18 +45,16 @@
|
||||||
= image_tag 'ajax-loader.gif', :class => 'hidden', :id => "publisher_spinner"
|
= image_tag 'ajax-loader.gif', :class => 'hidden', :id => "publisher_spinner"
|
||||||
= status.submit t('.share'), :disable_with => t('.posting'), :class => 'button'
|
= status.submit t('.share'), :disable_with => t('.posting'), :class => 'button'
|
||||||
|
|
||||||
- if aspect == :all
|
|
||||||
.public_toggle
|
.public_toggle
|
||||||
%p.checkbox_select
|
|
||||||
= status.check_box( :public, {:title => t('.make_public')}, true, false)
|
|
||||||
|
|
||||||
%span#publisher_service_icons
|
%span#publisher_service_icons
|
||||||
= link_to (image_tag "social_media_logos/feed-16x16.png", :title => "RSS"), current_user.public_url, :class => 'public_icon dim'
|
- if aspect == :all
|
||||||
|
= status.hidden_field( :public)
|
||||||
|
= image_tag "social_media_logos/feed-16x16.png", :title => "RSS", :class => 'public_icon dim'
|
||||||
- if current_user.services
|
- if current_user.services
|
||||||
- for service in current_user.services
|
- for service in current_user.services
|
||||||
= image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider, :class => "service_icon dim", :id =>"#{service.provider}"
|
= image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider, :class => "service_icon dim", :id =>"#{service.provider}"
|
||||||
|
= link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage')#, :style=>"display:none;"
|
||||||
|
|
||||||
= link_to '(?)', "#question_mark_pane", :class => 'question_mark', :style=>"display:none;", :rel => 'facebox'
|
|
||||||
|
|
||||||
.facebox_content
|
.facebox_content
|
||||||
#question_mark_pane
|
#question_mark_pane
|
||||||
|
|
|
||||||
BIN
public/images/icons/monotone_wrench_settings.png
Normal file
BIN
public/images/icons/monotone_wrench_settings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 265 B |
|
|
@ -289,6 +289,14 @@ var Publisher = {
|
||||||
Publisher.toggleServiceField($(this).attr('id'));
|
Publisher.toggleServiceField($(this).attr('id'));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
bindPublicIcon: function(){
|
||||||
|
$(".public_icon").bind("click", function(evt){
|
||||||
|
$(this).toggleClass("dim");
|
||||||
|
var public_field= $("#publisher #status_message_public");
|
||||||
|
|
||||||
|
(public_field.val() == 'false')?(public_field.val('true')):(public_field.val('false'));
|
||||||
|
});
|
||||||
|
},
|
||||||
toggleServiceField: function(service){
|
toggleServiceField: function(service){
|
||||||
var hidden_field = $('#publisher [name="services[]"][value="'+service+'"]')
|
var hidden_field = $('#publisher [name="services[]"][value="'+service+'"]')
|
||||||
if(hidden_field.length > 0){
|
if(hidden_field.length > 0){
|
||||||
|
|
@ -305,12 +313,7 @@ var Publisher = {
|
||||||
Publisher.cachedSubmit = false;
|
Publisher.cachedSubmit = false;
|
||||||
|
|
||||||
Publisher.bindServiceIcons();
|
Publisher.bindServiceIcons();
|
||||||
$("div.public_toggle input").live("click", function(evt) {
|
Publisher.bindPublicIcon();
|
||||||
$(".public_icon").toggleClass("dim");
|
|
||||||
if ($(this).attr('checked') == true) {
|
|
||||||
$(".question_mark").click();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if ($("#status_message_fake_message").val() == "") {
|
if ($("#status_message_fake_message").val() == "") {
|
||||||
Publisher.close();
|
Publisher.close();
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,34 @@ describe("Publisher", function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("bindPublicIcon", function() {
|
||||||
|
beforeEach( function(){
|
||||||
|
spec.loadFixture('aspects_index_services');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('gets called on initialize', function(){
|
||||||
|
spyOn(Publisher, 'bindPublicIcon');
|
||||||
|
Publisher.initialize();
|
||||||
|
expect(Publisher.bindPublicIcon).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
it('toggles dim only on the clicked icon', function(){
|
||||||
|
expect($(".public_icon").hasClass("dim")).toBeTruthy();
|
||||||
|
|
||||||
|
Publisher.bindPublicIcon();
|
||||||
|
$(".public_icon").click();
|
||||||
|
|
||||||
|
expect($(".public_icon").hasClass("dim")).toBeFalsy();
|
||||||
|
});
|
||||||
|
it('toggles the hidden field', function(){
|
||||||
|
Publisher.bindPublicIcon();
|
||||||
|
expect($('#publisher #status_message_public').val()).toBe('false');
|
||||||
|
|
||||||
|
$(".public_icon").click();
|
||||||
|
expect($('#publisher #status_message_public').val()).toBe('true');
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
describe("bindServiceIcons", function() {
|
describe("bindServiceIcons", function() {
|
||||||
beforeEach( function(){
|
beforeEach( function(){
|
||||||
spec.loadFixture('aspects_index_services');
|
spec.loadFixture('aspects_index_services');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue