From 9585a1877b7b10600f2f8ca92139da15e4180697 Mon Sep 17 00:00:00 2001 From: JesseWeinstein Date: Mon, 10 Nov 2014 23:16:31 -0800 Subject: [PATCH 001/866] Split bookmarklet_url literal string into lines To improve the readabilit of diffs that modify it, per https://github.com/diaspora/diaspora/pull/5384#issuecomment-62443426 --- app/helpers/application_helper.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2a8999d3b..a51b99a53 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -22,7 +22,24 @@ module ApplicationHelper end def bookmarklet_url( height = 400, width = 620) - "javascript:(function(){f='#{AppConfig.pod_uri.to_s}bookmarklet?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'¬es='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=1&';a=function(){if(!window.open(f+'noui=1&jump=doclose','diasporav1','location=yes,links=no,scrollbars=yes,toolbar=no,width=#{width},height=#{height}'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()" + "javascript:(function(){" \ + "f='#{AppConfig.pod_uri.to_s}bookmarklet" \ + "?url='+encodeURIComponent(window.location.href)" \ + "+'&title='+encodeURIComponent(document.title)" \ + "+'¬es='+encodeURIComponent(''+" \ + "(window.getSelection?window.getSelection():" \ + "document.getSelection?document.getSelection():" \ + "document.selection.createRange().text))" \ + "+'&v=1&';" \ + "a=function(){" \ + "if(!window.open(f+'noui=1&jump=doclose'," \ + "'diasporav1'," \ + "'location=yes,links=no,scrollbars=yes,toolbar=no,width=#{width},height=#{height}'))" \ + "location.href=f+'jump=yes'};" \ + "if(/Firefox/.test(navigator.userAgent)){" \ + "setTimeout(a,0)" \ + "}else{a()}" \ + "})()" end def contacts_link From ea33ef9e0b37d759523744e72ea7ee3c00c18f04 Mon Sep 17 00:00:00 2001 From: JesseWeinstein Date: Mon, 10 Nov 2014 23:24:23 -0800 Subject: [PATCH 002/866] Add Markdown to generated post Switch to using content parameter, which doesn't alter its value, unlike the other ones. Use a H2 header for the document.title, quote the selected text, and put the URL at the bottom, in a separate paragraph. --- app/helpers/application_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a51b99a53..1197a0e3d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -24,12 +24,12 @@ module ApplicationHelper def bookmarklet_url( height = 400, width = 620) "javascript:(function(){" \ "f='#{AppConfig.pod_uri.to_s}bookmarklet" \ - "?url='+encodeURIComponent(window.location.href)" \ - "+'&title='+encodeURIComponent(document.title)" \ - "+'¬es='+encodeURIComponent(''+" \ + "?content='+encodeURIComponent('##%20'+document.title+" \ + "'\n>%20'+" "(window.getSelection?window.getSelection():" \ "document.getSelection?document.getSelection():" \ - "document.selection.createRange().text))" \ + "document.selection.createRange().text)" \ + "+'\n\n'+window.location.href)" \ "+'&v=1&';" \ "a=function(){" \ "if(!window.open(f+'noui=1&jump=doclose'," \ From fb51e9aa43246a174661f7b0e1fee4494aedcade Mon Sep 17 00:00:00 2001 From: JesseWeinstein Date: Mon, 10 Nov 2014 23:41:34 -0800 Subject: [PATCH 003/866] Only include the quote markdown if needed Intentionally do a converting-comparison against the empty string, to see if text is selected. --- app/helpers/application_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1197a0e3d..cb7d284c0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -23,12 +23,12 @@ module ApplicationHelper def bookmarklet_url( height = 400, width = 620) "javascript:(function(){" \ + "t=(window.getSelection?window.getSelection():" \ + "document.getSelection?document.getSelection():" \ + "document.selection.createRange().text);" \ "f='#{AppConfig.pod_uri.to_s}bookmarklet" \ "?content='+encodeURIComponent('##%20'+document.title+" \ - "'\n>%20'+" - "(window.getSelection?window.getSelection():" \ - "document.getSelection?document.getSelection():" \ - "document.selection.createRange().text)" \ + "(t!=''?('\n>%20'+t):'')" \ "+'\n\n'+window.location.href)" \ "+'&v=1&';" \ "a=function(){" \ From 0bb316e893d58853b920e84a4d140dfa4b7bb89b Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Fri, 1 May 2015 15:59:09 +0200 Subject: [PATCH 004/866] update bookmarklet * snippet now in a separate JS file - compiled and uglified with the other assets * popup gets centered in opening browser window * publisher gets pre-filled with markdown-styled content --- .../javascripts/app/views/bookmarklet_view.js | 10 ++-- app/assets/javascripts/bookmarklet.js | 45 ++++++++++++++++ app/helpers/application_helper.rb | 23 ++------ app/views/shared/_right_sections.html.haml | 2 +- lib/bookmarklet_renderer.rb | 27 ++++++++++ lib/error_page_renderer.rb | 47 +++++++++++++++++ lib/tasks/assets.rake | 52 +++---------------- 7 files changed, 137 insertions(+), 69 deletions(-) create mode 100644 app/assets/javascripts/bookmarklet.js create mode 100644 lib/bookmarklet_renderer.rb create mode 100644 lib/error_page_renderer.rb diff --git a/app/assets/javascripts/app/views/bookmarklet_view.js b/app/assets/javascripts/app/views/bookmarklet_view.js index c8e982fc3..71b505edd 100644 --- a/app/assets/javascripts/app/views/bookmarklet_view.js +++ b/app/assets/javascripts/app/views/bookmarklet_view.js @@ -1,7 +1,7 @@ // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later app.views.Bookmarklet = Backbone.View.extend({ - separator: ' - ', + separator: "\n\n", initialize: function(opts) { // init a standalone publisher @@ -25,8 +25,12 @@ app.views.Bookmarklet = Backbone.View.extend({ var p = this.param_contents; if( p.content ) return p.content; - var contents = p.title + this.separator + p.url; - if( p.notes ) contents += this.separator + p.notes; + var contents = "### " + p.title + this.separator; + if( p.notes ) { + var notes = p.notes.toString().replace(/(?:\r\n|\r|\n)/g, "\n> "); + contents += "> " + notes + this.separator; + } + contents += p.url; return contents; }, diff --git a/app/assets/javascripts/bookmarklet.js b/app/assets/javascripts/bookmarklet.js new file mode 100644 index 000000000..1a9ac7117 --- /dev/null +++ b/app/assets/javascripts/bookmarklet.js @@ -0,0 +1,45 @@ +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later + +var bookmarklet = function(url, width, height, opts) { + // calculate popup dimensions & placement + var dim = function() { + var w = window, + winTop = (w.screenTop ? w.screenTop : w.screenY), + winLeft = (w.screenLeft ? w.screenLeft : w.screenX), + top = (winTop + (w.innerHeight / 2) - (height / 2)), + left = (winLeft + (w.innerWidth / 2) - (width / 2)); + return "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left; + }; + + // prepare url parameters + var params = function() { + var w = window, + d = document, + href = w.location.href, + title = d.title, + sel = w.getSelection ? w.getSelection() : + d.getSelection ? d.getSelection() : + d.selection.createRange().text, + notes = sel.toString(); + return "url=" + encodeURIComponent(href) + + "&title=" + encodeURIComponent(title) + + "¬es=" + encodeURIComponent(notes); + }; + + // popup (or redirect) action + var act = function() { + var popupOpts = (opts || "location=yes,links=no,scrollbars=yes,toolbar=no"), + jumpUrl = url + "?jump=yes"; + + (window.open(url + "?" + params(), "diaspora_bookmarklet", popupOpts + "," + dim()) || + (window.location.href = jumpUrl + "&" + params())); + }; + + if( /Firefox/.test(navigator.userAgent) ) { + setTimeout(act, 0); + } else { + act(); + } +}; + +// @license-end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3e315b93a..2e55122e4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -25,25 +25,10 @@ module ApplicationHelper timeago_tag(time, options.merge(:class => 'timeago', :title => time.iso8601, :force => true)) if time end - def bookmarklet_url( height = 400, width = 620) - "javascript:(function(){" \ - "t=(window.getSelection?window.getSelection():" \ - "document.getSelection?document.getSelection():" \ - "document.selection.createRange().text);" \ - "f='#{AppConfig.pod_uri.to_s}bookmarklet" \ - "?content='+encodeURIComponent('##%20'+document.title+" \ - "(t!=''?('\n>%20'+t):'')" \ - "+'\n\n'+window.location.href)" \ - "+'&v=1&';" \ - "a=function(){" \ - "if(!window.open(f+'noui=1&jump=doclose'," \ - "'diasporav1'," \ - "'location=yes,links=no,scrollbars=yes,toolbar=no,width=#{width},height=#{height}'))" \ - "location.href=f+'jump=yes'};" \ - "if(/Firefox/.test(navigator.userAgent)){" \ - "setTimeout(a,0)" \ - "}else{a()}" \ - "})()" + def bookmarklet_code(height=400, width=620) + "javascript:" + + BookmarkletRenderer.body + + "bookmarklet('#{bookmarklet_url}', #{width}, #{height});" end def contacts_link diff --git a/app/views/shared/_right_sections.html.haml b/app/views/shared/_right_sections.html.haml index fb64a3e83..b57e7fc62 100644 --- a/app/views/shared/_right_sections.html.haml +++ b/app/views/shared/_right_sections.html.haml @@ -66,7 +66,7 @@ %i.entypo.bookmark = t('bookmarklet.heading') .content - != t('bookmarklet.explanation', :link => link_to(t('bookmarklet.post_something'), bookmarklet_url)) + != t('bookmarklet.explanation', :link => link_to(t('bookmarklet.post_something'), bookmarklet_code)) - if AppConfig.settings.paypal_donations.enable? || AppConfig.bitcoin_donation_address .section diff --git a/lib/bookmarklet_renderer.rb b/lib/bookmarklet_renderer.rb new file mode 100644 index 000000000..b45fb7dbf --- /dev/null +++ b/lib/bookmarklet_renderer.rb @@ -0,0 +1,27 @@ + +class BookmarkletRenderer + class << self + def cached_name + @cached ||= File.join(Rails.application.config.paths["tmp"].first, "cache", "bookmarklet.cached") + end + + def source_name + @source ||= Rails.application.assets["bookmarklet.js"].pathname.to_s + end + + def body + if !File.exist?(cached_name) && Rails.env.production? + raise "please run the Rake task to compile the bookmarklet: `bundle exec rake assets:uglify_bookmarklet`" + end + + compile unless Rails.env.production? # don't make me re-run rake in development + @body ||= File.read(cached_name) + end + + def compile + src = File.read(source_name) + @body = Uglifier.compile(src) + File.open(cached_name, "w") {|f| f.write(@body) } + end + end +end diff --git a/lib/error_page_renderer.rb b/lib/error_page_renderer.rb new file mode 100644 index 000000000..dae92f419 --- /dev/null +++ b/lib/error_page_renderer.rb @@ -0,0 +1,47 @@ + +# Inspired by https://github.com/route/errgent/blob/master/lib/errgent/renderer.rb +class ErrorPageRenderer + def initialize options={} + @codes = options.fetch :codes, [404, 500] + @output = options.fetch :output, "public/%s.html" + @vars = options.fetch :vars, {} + @template = options.fetch :template, "errors/error_%s" + @layout = options.fetch :layout, "layouts/error_page" + end + + def render + @codes.each do |code| + view = build_action_view + view.assign @vars.merge(code: code) + path = Rails.root.join(@output % code) + File.write path, view.render(template: @template % code, layout: @layout) + end + end + + def helpers(&block) + @helpers = block + end + + private + + def build_action_view + paths = ::ActionController::Base.view_paths + ::ActionView::Base.new(paths).tap do |view| + view.class_eval do + include Rails.application.helpers + include Rails.application.routes.url_helpers + end + view.assets_manifest = build_manifest(Rails.application) + view.class_eval(&@helpers) if @helpers + end + end + + # Internal API from the sprocket-rails railtie, if somebody finds a way to + # call it, please replace it. Might need to be updated on sprocket-rails + # updates. + def build_manifest(app) + config = app.config + path = File.join(config.paths['public'].first, config.assets.prefix) + Sprockets::Manifest.new(app.assets, path, config.assets.manifest) + end +end diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index cc84fbf97..efee85b60 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -1,49 +1,3 @@ -# Inspired by https://github.com/route/errgent/blob/master/lib/errgent/renderer.rb -class ErrorPageRenderer - def initialize options={} - @codes = options.fetch :codes, [404, 500] - @output = options.fetch :output, "public/%s.html" - @vars = options.fetch :vars, {} - @template = options.fetch :template, "errors/error_%s" - @layout = options.fetch :layout, "layouts/error_page" - end - - def render - @codes.each do |code| - view = build_action_view - view.assign @vars.merge(code: code) - path = Rails.root.join(@output % code) - File.write path, view.render(template: @template % code, layout: @layout) - end - end - - def helpers(&block) - @helpers = block - end - - private - - def build_action_view - paths = ::ActionController::Base.view_paths - ::ActionView::Base.new(paths).tap do |view| - view.class_eval do - include Rails.application.helpers - include Rails.application.routes.url_helpers - end - view.assets_manifest = build_manifest(Rails.application) - view.class_eval(&@helpers) if @helpers - end - end - - # Internal API from the sprocket-rails railtie, if somebody finds a way to - # call it, please replace it. Might need to be updated on sprocket-rails - # updates. - def build_manifest(app) - config = app.config - path = File.join(config.paths['public'].first, config.assets.prefix) - Sprockets::Manifest.new(app.assets, path, config.assets.manifest) - end -end namespace :assets do desc "Generate error pages" @@ -52,8 +6,14 @@ namespace :assets do renderer.render end + desc "Uglify bookmarklet snippet" + task :uglify_bookmarklet => :environment do + BookmarkletRenderer.compile + end + # Augment precompile with error page generation task :precompile do Rake::Task['assets:generate_error_pages'].invoke + Rake::Task['assets:uglify_bookmarklet'].invoke end end From 19a19919bb0da825585509183388eb945cdecde9 Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Sat, 2 May 2015 16:46:30 +0200 Subject: [PATCH 005/866] Update jasmine --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 5727347e9..cf9ff04da 100644 --- a/Gemfile +++ b/Gemfile @@ -274,7 +274,7 @@ group :development, :test do gem "cucumber-rails", "1.4.2", require: false # Jasmine (client side application tests (JS)) - gem "jasmine", "2.2.0" + gem "jasmine", "2.3.0" gem "jasmine-jquery-rails", "2.0.3" gem "rails-assets-jasmine-ajax", "3.1.0", source: "https://rails-assets.org" gem "sinon-rails", "1.10.3" diff --git a/Gemfile.lock b/Gemfile.lock index 3a3e50dd6..8f761bd1d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -345,12 +345,12 @@ GEM ice_cube (0.11.1) inflecto (0.0.2) ipaddress (0.8.0) - jasmine (2.2.0) - jasmine-core (~> 2.2) + jasmine (2.3.0) + jasmine-core (~> 2.3) phantomjs rack (>= 1.2.1) rake - jasmine-core (2.2.0) + jasmine-core (2.3.0) jasmine-jquery-rails (2.0.3) jquery-rails (3.1.2) railties (>= 3.0, < 5.0) @@ -488,7 +488,7 @@ GEM rails-assets-jquery-fullscreen (~> 1.1.4) rails-assets-jquery-ui (~> 1.10.4) rails-assets-jquery.slimscroll (~> 1.3.3) - rails-assets-jasmine (2.2.1) + rails-assets-jasmine (2.3.0) rails-assets-jasmine-ajax (3.1.0) rails-assets-jasmine (~> 2.0) rails-assets-jeresig--jquery.hotkeys (0.2.0) @@ -739,7 +739,7 @@ DEPENDENCIES handlebars_assets (= 0.20.1) http_accept_language (= 2.0.5) i18n-inflector-rails (= 1.0.7) - jasmine (= 2.2.0) + jasmine (= 2.3.0) jasmine-jquery-rails (= 2.0.3) jquery-rails (= 3.1.2) jquery-ui-rails (= 5.0.3) From f257658e46cc6882cdf022d20de1775f57edcc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Mon, 4 May 2015 00:43:41 +0200 Subject: [PATCH 006/866] Revert "Revert "Merge pull request #5852 from margori/3393-activity-stream-keeping-retracted-participations"" This reverts commit 2c7848e3cbcb072e91d8faa652cc6cc9d14f1d97. --- Changelog.md | 1 + app/models/comment.rb | 2 + app/models/like.rb | 2 + app/models/participation.rb | 8 ++ app/models/user.rb | 8 +- app/models/user/social_actions.rb | 17 ++- .../20150404193023_participation_counter.rb | 29 +++++ db/schema.rb | 9 +- features/desktop/activity_stream.feature | 104 ++++++++++++++++++ features/step_definitions/stream_steps.rb | 4 + .../status_messages_controller_spec.rb | 7 ++ spec/models/comment_spec.rb | 23 ++++ spec/models/like_spec.rb | 17 +++ spec/models/participation_spec.rb | 28 +++++ spec/models/user/social_actions_spec.rb | 23 +++- 15 files changed, 264 insertions(+), 18 deletions(-) create mode 100644 db/migrate/20150404193023_participation_counter.rb create mode 100644 features/desktop/activity_stream.feature diff --git a/Changelog.md b/Changelog.md index 465547322..55a5dd4e5 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,6 +10,7 @@ * Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846) * Fix only sharing flag for contacts that are receiving [#5848](https://github.com/diaspora/diaspora/pull/5848) * Return 406 when requesting a JSON representation of people/:guid/contacts [#5849](https://github.com/diaspora/diaspora/pull/5849) +* Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852) * Hide manage services link in the publisher on certain pages [#5854](https://github.com/diaspora/diaspora/pull/5854) * Fix notification mails for limited posts [#5877](https://github.com/diaspora/diaspora/pull/5877) * Fix medium and small avatar URLs when using Camo [#5883](https://github.com/diaspora/diaspora/pull/5883) diff --git a/app/models/comment.rb b/app/models/comment.rb index aa86daedb..f6cd6f353 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -47,6 +47,8 @@ class Comment < ActiveRecord::Base after_destroy do self.parent.update_comments_counter + participation = author.participations.where(target_id: post.id).first + participation.unparticipate! if participation.present? end def diaspora_handle diff --git a/app/models/like.rb b/app/models/like.rb index 530fa2aa5..946c1d2ba 100644 --- a/app/models/like.rb +++ b/app/models/like.rb @@ -19,6 +19,8 @@ class Like < Federated::Relayable after_destroy do self.parent.update_likes_counter + participation = author.participations.where(target_id: target.id).first + participation.unparticipate! if participation.present? end xml_attr :positive diff --git a/app/models/participation.rb b/app/models/participation.rb index b36083428..7a1f0d180 100644 --- a/app/models/participation.rb +++ b/app/models/participation.rb @@ -9,6 +9,14 @@ class Participation < Federated::Relayable end end + def unparticipate! + if count == 1 + destroy + else + update!(count: count.pred) + end + end + # NOTE API V1 to be extracted acts_as_api api_accessible :backbone do |t| diff --git a/app/models/user.rb b/app/models/user.rb index de6cc79df..b318465a2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -377,10 +377,10 @@ class User < ActiveRecord::Base retraction = Retraction.for(target) end - if target.is_a?(Post) - opts[:additional_subscribers] = target.resharers - opts[:services] = self.services - end + if target.is_a?(Post) + opts[:additional_subscribers] = target.resharers + opts[:services] = services + end mailman = Postzord::Dispatcher.build(self, retraction, opts) mailman.post diff --git a/app/models/user/social_actions.rb b/app/models/user/social_actions.rb index ccc30b484..2b3ff4a4a 100644 --- a/app/models/user/social_actions.rb +++ b/app/models/user/social_actions.rb @@ -1,6 +1,6 @@ module User::SocialActions def comment!(target, text, opts={}) - find_or_create_participation!(target) + update_or_create_participation!(target) Comment::Generator.new(self, target, text).create!(opts) end @@ -9,17 +9,17 @@ module User::SocialActions end def like!(target, opts={}) - find_or_create_participation!(target) + update_or_create_participation!(target) Like::Generator.new(self, target).create!(opts) end def participate_in_poll!(target, answer, opts={}) - find_or_create_participation!(target) + update_or_create_participation!(target) PollParticipation::Generator.new(self, target, answer).create!(opts) end def reshare!(target, opts={}) - find_or_create_participation!(target) + update_or_create_participation!(target) reshare = build_post(:reshare, :root_guid => target.guid) reshare.save! Postzord::Dispatcher.defer_build_and_post(self, reshare) @@ -48,7 +48,12 @@ module User::SocialActions ) end - def find_or_create_participation!(target) - participations.where(:target_id => target).first || participate!(target) + def update_or_create_participation!(target) + participation = participations.where(target_id: target).first + if participation.present? + participation.update!(count: participation.count.next) + else + participate!(target) + end end end diff --git a/db/migrate/20150404193023_participation_counter.rb b/db/migrate/20150404193023_participation_counter.rb new file mode 100644 index 000000000..a13d075b8 --- /dev/null +++ b/db/migrate/20150404193023_participation_counter.rb @@ -0,0 +1,29 @@ +class ParticipationCounter < ActiveRecord::Migration + def up + add_column :participations, :count, :int, null: false, default: 1 + + posts_count = Post.select("COUNT(posts.id)") + .where("posts.id = participations.target_id") + .where("posts.author_id = participations.author_id") + .to_sql + likes_count = Like.select("COUNT(likes.id)") + .where("likes.target_id = participations.target_id") + .where("likes.author_id = participations.author_id") + .to_sql + comments_count = Comment.select("COUNT(comments.id)") + .where("comments.commentable_id = participations.target_id") + .where("comments.author_id = participations.author_id") + .to_sql + polls_count = PollParticipation.select("COUNT(*)") + .where("poll_participations.author_id = participations.author_id") + .joins(:poll) + .where("polls.status_message_id = participations.target_id") + .to_sql + Participation.update_all("count = (#{posts_count}) + (#{likes_count}) + (#{comments_count}) + (#{polls_count})") + Participation.where(count: 0).delete_all + end + + def down + remove_column :participations, :count + end +end diff --git a/db/schema.rb b/db/schema.rb index 07f4db16c..40ffa940f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150403212139) do +ActiveRecord::Schema.define(version: 20150404193023) do create_table "account_deletions", force: :cascade do |t| t.string "diaspora_handle", limit: 255 @@ -254,12 +254,13 @@ ActiveRecord::Schema.define(version: 20150403212139) do create_table "participations", force: :cascade do |t| t.string "guid", limit: 255 t.integer "target_id", limit: 4 - t.string "target_type", limit: 60, null: false + t.string "target_type", limit: 60, null: false t.integer "author_id", limit: 4 t.text "author_signature", limit: 65535 t.text "parent_author_signature", limit: 65535 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "count", limit: 4, default: 1, null: false end add_index "participations", ["guid"], name: "index_participations_on_guid", length: {"guid"=>191}, using: :btree diff --git a/features/desktop/activity_stream.feature b/features/desktop/activity_stream.feature new file mode 100644 index 000000000..81d0d72f8 --- /dev/null +++ b/features/desktop/activity_stream.feature @@ -0,0 +1,104 @@ +@javascript +Feature: The activity stream + Background: + Given following users exist: + | username | email | + | Bob Jones | bob@bob.bob | + | Alice Smith | alice@alice.alice | + And a user with email "bob@bob.bob" is connected with "alice@alice.alice" + When "alice@alice.alice" has posted a status message with a photo + + Scenario: Sorting + When I sign in as "bob@bob.bob" + + Given I expand the publisher + When I write the status message "A- I like turtles" + And I submit the publisher + + Given I expand the publisher + When I write the status message "B- barack obama is your new bicycle" + And I submit the publisher + + Given I expand the publisher + When I write the status message "C- barack obama is a square" + And I submit the publisher + + When I go to the activity stream page + Then "C- barack obama is a square" should be post 1 + And "B- barack obama is your new bicycle" should be post 2 + And "A- I like turtles" should be post 3 + + When I like the post "A- I like turtles" in the stream + And I comment "Sassy sawfish" on "C- barack obama is a square" + And I like the post "B- barack obama is your new bicycle" in the stream + + When I go to the activity stream page + Then "B- barack obama is your new bicycle" should be post 1 + And "C- barack obama is a square" should be post 2 + And "A- I like turtles" should be post 3 + + Scenario: delete a comment + When I sign in as "bob@bob.bob" + And I am on "alice@alice.alice"'s page + Then I should see "Look at this dog" + When I focus the comment field + And I fill in the following: + | text | is that a poodle? | + And I press "Comment" + + When I go to the activity stream page + Then I should see "Look at this dog" + And I should see "is that a poodle?" + + When I am on "alice@alice.alice"'s page + And I click to delete the first comment + And I confirm the alert + + And I go to the activity stream page + Then I should not see "Look at this dog" + + Scenario: unliking a post + When I sign in as "bob@bob.bob" + And I am on "alice@alice.alice"'s page + Then I should see "Look at this dog" + + When I like the post "Look at this dog" in the stream + And I go to the activity stream page + Then I should see "Look at this dog" + + When I am on "alice@alice.alice"'s page + And I unlike the post "Look at this dog" in the stream + And I go to the activity stream page + Then I should not see "Look at this dog" + + Scenario: multiple participations + When I sign in as "bob@bob.bob" + And I am on "alice@alice.alice"'s page + Then I should see "Look at this dog" + + When I like the post "Look at this dog" in the stream + And I go to the activity stream page + Then I should see "Look at this dog" + + When I am on "alice@alice.alice"'s page + Then I should see "Look at this dog" + + When I focus the comment field + And I fill in the following: + | text | is that a poodle? | + And I press "Comment" + + And I go to the activity stream page + Then I should see "Look at this dog" + + When I am on "alice@alice.alice"'s page + And I unlike the post "Look at this dog" in the stream + And I go to the activity stream page + Then I should see "Look at this dog" + + When I am on "alice@alice.alice"'s page + And I click to delete the first comment + And I confirm the alert + + And I go to the activity stream page + Then I should not see "Look at this dog" diff --git a/features/step_definitions/stream_steps.rb b/features/step_definitions/stream_steps.rb index 901f4da3d..9e38191e5 100644 --- a/features/step_definitions/stream_steps.rb +++ b/features/step_definitions/stream_steps.rb @@ -2,6 +2,10 @@ When /^I (?:like|unlike) the post "([^"]*)" in the stream$/ do |post_text| like_stream_post(post_text) end +Then /^I should see an image in the publisher$/ do + photo_in_publisher.should be_present +end + Then /^"([^"]*)" should be post (\d+)$/ do |post_text, position| stream_element_numbers_content(position).should have_content(post_text) end diff --git a/spec/controllers/status_messages_controller_spec.rb b/spec/controllers/status_messages_controller_spec.rb index 24b8787b8..5fc8ea7ea 100644 --- a/spec/controllers/status_messages_controller_spec.rb +++ b/spec/controllers/status_messages_controller_spec.rb @@ -158,6 +158,13 @@ describe StatusMessagesController, :type => :controller do # response.body.should include('Status message requires a message or at least one photo') # end + it "has one participation" do + post :create, status_message_hash + new_message = StatusMessage.find_by_text(status_message_hash[:status_message][:text]) + expect(new_message.participations.count).to eq(1) + expect(new_message.participations.first.count).to eq(1) + end + context 'with photos' do before do @photo1 = alice.build_post(:photo, :pending => true, :user_file=> File.open(photo_fixture_name), :to => @aspect1.id) diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index 2e2a91205..33dc00e6f 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -11,6 +11,23 @@ describe Comment, :type => :model do @status = bob.post(:status_message, :text => "hello", :to => bob.aspects.first.id) end + describe "#destroy" do + before do + @comment = alice.comment!(@status, "why so formal?") + end + + it "should delete a participation" do + expect { @comment.destroy }.to change { Participation.count }.by(-1) + end + + it "should decrease count participation" do + alice.comment!(@status, "Are you there?") + @comment.destroy + participations = Participation.where(target_id: @comment.commentable_id, author_id: @comment.author_id) + expect(participations.first.count).to eq(1) + end + end + describe 'comment#notification_type' do let (:comment) { alice.comment!(@status, "why so formal?") } @@ -60,6 +77,12 @@ describe Comment, :type => :model do alice.comment!(@status, 'hello') }.to change { Comment.count }.by(1) end + + it "should create a participation" do + comment = bob.comment!(@status, "sup dog") + participations = Participation.where(target_id: comment.commentable_id, author_id: comment.author_id) + expect(participations.count).to eq(1) + end end describe 'counter cache' do diff --git a/spec/models/like_spec.rb b/spec/models/like_spec.rb index 11532bff6..9015d09d3 100644 --- a/spec/models/like_spec.rb +++ b/spec/models/like_spec.rb @@ -14,6 +14,23 @@ describe Like, :type => :model do expect(FactoryGirl.build(:like)).to be_valid end + describe "#destroy" do + before do + @like = alice.like!(@status) + end + + it "should delete a participation" do + expect { @like.destroy }.to change { Participation.count }.by(-1) + end + + it "should decrease count participation" do + alice.comment!(@status, "Are you there?") + @like.destroy + participations = Participation.where(target_id: @like.target_id, author_id: @like.author_id) + expect(participations.first.count).to eq(1) + end + end + describe '#notification_type' do before do @like = alice.like!(@status) diff --git a/spec/models/participation_spec.rb b/spec/models/participation_spec.rb index 658c0cc8e..5c681185d 100644 --- a/spec/models/participation_spec.rb +++ b/spec/models/participation_spec.rb @@ -20,4 +20,32 @@ describe Participation, :type => :model do it_should_behave_like 'it is relayable' end + + describe "#unparticipate" do + before do + @status = bob.post(:status_message, text: "hello", to: bob.aspects.first.id) + @like = alice.like!(@status) + end + + it "retract participation" do + @like.author.participations.first.unparticipate! + participations = Participation.where(target_id: @like.target_id, author_id: @like.author_id) + expect(participations.count).to eq(0) + end + + it "retract one of multiple participations" do + comment = alice.comment!(@status, "bro") + comment.author.participations.first.unparticipate! + participations = Participation.where(target_id: @like.target_id, author_id: @like.author_id) + expect(participations.count).to eq(1) + expect(participations.first.count).to eq(1) + end + + it "retract all of multiple participations" do + alice.comment!(@status, "bro") + alice.participations.first.unparticipate! + alice.participations.first.unparticipate! + expect(Participation.where(target_id: @like.target_id, author_id: @like.author_id).count).to eq(0) + end + end end diff --git a/spec/models/user/social_actions_spec.rb b/spec/models/user/social_actions_spec.rb index 74a67608b..ed3041b0f 100644 --- a/spec/models/user/social_actions_spec.rb +++ b/spec/models/user/social_actions_spec.rb @@ -11,9 +11,10 @@ describe User::SocialActions, :type => :model do expect(alice.comment!(@status, "unicorn_mountain").text).to eq("unicorn_mountain") end - it "creates a partcipation" do + it "creates a participation" do expect{ alice.comment!(@status, "bro") }.to change(Participation, :count).by(1) expect(alice.participations.last.target).to eq(@status) + expect(alice.participations.last.count).to eq(1) end it "creates the comment" do @@ -28,7 +29,7 @@ describe User::SocialActions, :type => :model do end describe 'User#like!' do - it "creates a partcipation" do + it "creates a participation" do expect{ alice.like!(@status) }.to change(Participation, :count).by(1) expect(alice.participations.last.target).to eq(@status) end @@ -51,7 +52,7 @@ describe User::SocialActions, :type => :model do @status = bob.post(:status_message, :text => "hello", :to => @bobs_aspect.id) end - it "creates a partcipation" do + it "creates a participation" do expect{ alice.like!(@status) }.to change(Participation, :count).by(1) end @@ -110,4 +111,18 @@ describe User::SocialActions, :type => :model do expect(alice.participate_in_poll!(@status, @answer).poll_answer).to eq(@answer) end end -end \ No newline at end of file + + describe "many actions" do + it "two coments" do + alice.comment!(@status, "bro...") + alice.comment!(@status, "...ther") + expect(alice.participations.last.count).to eq(2) + end + + it "like and comment" do + alice.comment!(@status, "bro...") + alice.like!(@status) + expect(alice.participations.last.count).to eq(2) + end + end +end From 4fad5041cf4d6792a8e13f8e2ee6b07eb6b44fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Mon, 4 May 2015 00:47:36 +0200 Subject: [PATCH 007/866] update changelog and version for 0.6.0.0 --- Changelog.md | 10 +++++++++- config/defaults.yml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 55a5dd4e5..14d08a121 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,12 @@ +# 0.6.0.0 + +## Refactor + +## Bug fixes +* Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852) + +## Features + # 0.5.1.0 ## Refactor @@ -10,7 +19,6 @@ * Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846) * Fix only sharing flag for contacts that are receiving [#5848](https://github.com/diaspora/diaspora/pull/5848) * Return 406 when requesting a JSON representation of people/:guid/contacts [#5849](https://github.com/diaspora/diaspora/pull/5849) -* Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852) * Hide manage services link in the publisher on certain pages [#5854](https://github.com/diaspora/diaspora/pull/5854) * Fix notification mails for limited posts [#5877](https://github.com/diaspora/diaspora/pull/5877) * Fix medium and small avatar URLs when using Camo [#5883](https://github.com/diaspora/diaspora/pull/5883) diff --git a/config/defaults.yml b/config/defaults.yml index 10ba80504..2b7883626 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -4,7 +4,7 @@ defaults: version: - number: "0.5.0.99" # Do not touch unless doing a release, do not backport the version number that's in master but keep develop to always say "head" + number: "0.5.99.0" # Do not touch unless doing a release, do not backport the version number that's in master but keep develop to always say "head" heroku: false environment: url: "http://localhost:3000/" From a365d802c71470035c3b14b70df06c9c6904f01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Mon, 4 May 2015 00:54:55 +0200 Subject: [PATCH 008/866] Recommend Ruby 2.2, drop Ruby 2.0 support As per https://www.loomio.org/d/VuwvXWU7/ruby-versions?proposal=DM8zidhc --- .ruby-version | 2 +- .travis.yml | 2 +- Changelog.md | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.ruby-version b/.ruby-version index 879b416e6..8bbe6cf74 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.1 +2.2 diff --git a/.travis.yml b/.travis.yml index a32d9e8d7..4a4e53d79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: ruby rvm: + - 2.2 - 2.1 - - 2.0 env: - DB=postgres BUILD_TYPE=other diff --git a/Changelog.md b/Changelog.md index 14d08a121..52ae5cd08 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,10 @@ # 0.6.0.0 +## Supported Ruby versions + +This release recommends using Ruby 2.2, while retaining Ruby 2.1 as an officially supported version. +Ruby 2.0 is no longer officially supported. + ## Refactor ## Bug fixes From 7060840d0ffdd4ffc2f8a21972b47c47e523cd2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Mon, 4 May 2015 04:16:31 +0200 Subject: [PATCH 009/866] use stdlib logger for FEDERATION_LOGGER, closes #5657 --- lib/federation_logger.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/federation_logger.rb b/lib/federation_logger.rb index aa6097d15..25c5be454 100644 --- a/lib/federation_logger.rb +++ b/lib/federation_logger.rb @@ -1,11 +1,3 @@ -#custom_logger.rb - -class ActiveSupport::BufferedLogger - def formatter=(formatter) - @log.formatter = formatter - end -end - class Formatter COLORS = { 'FG' => { @@ -104,14 +96,11 @@ class Formatter end -class FederationLogger < ActiveSupport::BufferedLogger -end - if Rails.env.match(/integration/) puts "using federation logger" logfile = File.open(Rails.root.join("log", "federation_logger.log"), 'a') #create log file logfile.sync = true #automatically flushes data to file - FEDERATION_LOGGER = FederationLogger.new(logfile) #constant accessible anywhere + FEDERATION_LOGGER = Logger.new(logfile) #constant accessible anywhere FEDERATION_LOGGER.formatter = Formatter.new else FEDERATION_LOGGER = Rails.logger From 5c012e787187171fe873676f936eaa1db2754fb7 Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Tue, 5 May 2015 18:11:36 +0200 Subject: [PATCH 010/866] limit the parameter length for the GET request to the bookmarklet to ~2000 chars --- app/assets/javascripts/bookmarklet.js | 13 ++++++++++++- spec/javascripts/bookmarklet-spec.js | 26 ++++++++++++++++++++++++++ spec/javascripts/support/jasmine.yml | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 spec/javascripts/bookmarklet-spec.js diff --git a/app/assets/javascripts/bookmarklet.js b/app/assets/javascripts/bookmarklet.js index 1a9ac7117..4755490e4 100644 --- a/app/assets/javascripts/bookmarklet.js +++ b/app/assets/javascripts/bookmarklet.js @@ -1,6 +1,9 @@ // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later var bookmarklet = function(url, width, height, opts) { + var maxLen = 1900; // max GET request length, see #3076 + var maxTitleLen = 128; // cut title after this length, if too long + // calculate popup dimensions & placement var dim = function() { var w = window, @@ -20,7 +23,15 @@ var bookmarklet = function(url, width, height, opts) { sel = w.getSelection ? w.getSelection() : d.getSelection ? d.getSelection() : d.selection.createRange().text, - notes = sel.toString(); + notes = sel.toString(), + len = maxLen - href.length; + + if( (title+notes).length > len ) { + // shorten the text to fit in a GET request + if( title.length > maxTitleLen ) title = title.substr(0, maxTitleLen) + " ..."; + if( notes.length > (len-maxTitleLen) ) notes = notes.substr(0, len-maxTitleLen) + " ..."; + } + return "url=" + encodeURIComponent(href) + "&title=" + encodeURIComponent(title) + "¬es=" + encodeURIComponent(notes); diff --git a/spec/javascripts/bookmarklet-spec.js b/spec/javascripts/bookmarklet-spec.js new file mode 100644 index 000000000..4964e975e --- /dev/null +++ b/spec/javascripts/bookmarklet-spec.js @@ -0,0 +1,26 @@ + +describe("bookmarklet", function(){ + var fakeUrl = "http://pod.example.com/bookmarklet"; + + it("opens a popup window", function(){ + spyOn(window, "open").and.returnValue(true); + bookmarklet(fakeUrl, 800, 600); + jasmine.clock().tick(1); + expect(window.open).toHaveBeenCalled(); + }); + + it("shortens the GET string to less than 2000 characters", function(){ + var url, + selTxt = new Array(1000).join("abcdefghijklmnopqrstuvwxyz1234567890"); + + spyOn(window, "open").and.callFake(function(_url){ + url = _url; + return true; + }); + spyOn(window, "getSelection").and.returnValue(selTxt); + + bookmarklet(fakeUrl, 800, 600); + jasmine.clock().tick(1); + expect(url.length).toBeLessThan(2000); + }); +}); diff --git a/spec/javascripts/support/jasmine.yml b/spec/javascripts/support/jasmine.yml index 50f11c159..c4e49f511 100644 --- a/spec/javascripts/support/jasmine.yml +++ b/spec/javascripts/support/jasmine.yml @@ -13,6 +13,7 @@ src_files: # Precompile all scripts together for the test environment - assets/jasmine-load-all.js - assets/jasmine-jquery.js + - assets/bookmarklet.js # stylesheets # From 898e8d591291e194985a01ec24584bbbfb0d33e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Tue, 19 May 2015 11:06:37 +0200 Subject: [PATCH 011/866] Remove deprecated port setting --- config/defaults.yml | 1 - config/diaspora.yml.example | 4 ---- script/server | 9 +-------- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/config/defaults.yml b/config/defaults.yml index 9fc684211..dcd103413 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -32,7 +32,6 @@ defaults: host: pubsub_server: 'https://pubsubhubbub.appspot.com/' server: - port: listen: '0.0.0.0:3000' rails_environment: 'development' stderr_log: diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example index 378e0d6d3..6f5558fad 100644 --- a/config/diaspora.yml.example +++ b/config/diaspora.yml.example @@ -145,10 +145,6 @@ configuration: ## Section #listen: 'unix:tmp/diaspora.sock' #listen: 'unix:/run/diaspora/diaspora.sock' - ## The port on which the appserver should listen (default=none). - ## Note: this setting is deprecated, use listen instead. - #port: 3000 - ## Rails environment (default='development'). ## The environment in which the server should be started by default. ## Change this to 'production' if you wish to run a production environment. diff --git a/script/server b/script/server index 466b4ef0f..0144e244f 100755 --- a/script/server +++ b/script/server @@ -103,7 +103,6 @@ fi os=$(uname -s) vars=$(bin/bundle exec ruby ./script/get_config.rb \ - port=server.port \ single_process_mode=environment.single_process_mode? \ embed_sidekiq_worker=server.embed_sidekiq_worker \ workers=server.sidekiq_workers \ @@ -119,12 +118,6 @@ then export DB fi -if [ -z "$PORT" -a -n "$port" ] -then - warning "Setting port via configuration is deprecated, set listen instead. See the updated config/diaspora.yml.example." - PORT="$port" -fi - args="$@" for arg in $(echo $args | awk '{ for (i = 1; i <= NF; i++) print $i}') do @@ -139,7 +132,7 @@ then services=$(chk_service $PORT) if [ -n "$services" ] then - fatal "Port $port is already in use.\n\t$services" + fatal "Port $PORT is already in use.\n\t$services" fi fi From ebe0c76040e706c0fe73c8bc9673e486134f5d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Tue, 19 May 2015 11:08:41 +0200 Subject: [PATCH 012/866] Listen to unix socket in production by default --- config/defaults.yml | 2 +- config/diaspora.yml.example | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/defaults.yml b/config/defaults.yml index dcd103413..856319891 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -192,7 +192,7 @@ development: autofollow_on_join: false autofollow_on_join_user: '' production: - i_am_a_dummy: # Remove if you add an actual override + listen: 'unix:tmp/diaspora.sock' test: environment: url: 'http://localhost:9887/' diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example index 6f5558fad..ba11d78e9 100644 --- a/config/diaspora.yml.example +++ b/config/diaspora.yml.example @@ -140,10 +140,10 @@ configuration: ## Section ## Settings affecting how ./script/server behaves. server: ## Section - ## Where the appserver should listen to (default=0.0.0.0:3000) - #listen: '127.0.0.1:3000' + ## Where the appserver should listen to (default=unix:tmp/diaspora.sock) #listen: 'unix:tmp/diaspora.sock' #listen: 'unix:/run/diaspora/diaspora.sock' + #listen: '127.0.0.1:3000' ## Rails environment (default='development'). ## The environment in which the server should be started by default. From 4093a1bdd3a0dee35739512a253ebdedfb3402f1 Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Fri, 22 May 2015 03:11:55 +0200 Subject: [PATCH 013/866] Add Changelog entry for #5974 --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index 6709cde32..18ddbc69d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,7 @@ Ruby 2.0 is no longer officially supported. ## Refactor * Improve bookmarklet [#5904](https://github.com/diaspora/diaspora/pull/5904) +* Update listen configuration to listen on unix sockets by default [#5974](https://github.com/diaspora/diaspora/pull/5974) ## Bug fixes * Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852) From c85fe3872e519d83030d766321ece024bc3e2273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Fri, 29 May 2015 01:11:51 +0200 Subject: [PATCH 014/866] Replace DB environment variable with optional bundler groups See the changes to the changelog for more details --- .travis.yml | 6 +++--- Changelog.md | 14 ++++++++++++++ Gemfile | 10 ++++++---- Gemfile.lock | 5 +++++ config/database.yml.example | 22 ++++++++++------------ config/eye.rb | 2 +- script/ci/build.sh | 4 ++-- script/server | 5 ----- 8 files changed, 41 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4a4e53d79..8f8a9134e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,9 @@ rvm: - 2.1 env: - - DB=postgres BUILD_TYPE=other + - DB=postgresql BUILD_TYPE=other - DB=mysql BUILD_TYPE=other - - DB=postgres BUILD_TYPE=cucumber + - DB=postgresql BUILD_TYPE=cucumber - DB=mysql BUILD_TYPE=cucumber sudo: false @@ -23,7 +23,7 @@ branches: - 'develop' before_install: gem install bundler -bundler_args: "--without development production heroku --jobs 3 --retry 3" +bundler_args: "--deployment --without development production --with mysql postgresql --jobs 3 --retry 3" script: "./script/ci/build.sh" diff --git a/Changelog.md b/Changelog.md index f8066b7d3..88529e448 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,19 @@ # 0.6.0.0 +## The DB environment variable is gone + +With Bundler 1.10 supporting optional groups, we removed the DB environment variable. When updating to this release, please update +bundler and select the database support you want: + +```sh +gem install bundler +bundle install --with mysql # For MySQL and MariaDB +bundle install --with postgresql # For PostgreSQL +``` + +For production setups we now additionally recommend adding the `--deployment` flag. +If you set the DB environment variable anywhere, that's no longer necessary. + ## Supported Ruby versions This release recommends using Ruby 2.2, while retaining Ruby 2.1 as an officially supported version. diff --git a/Gemfile b/Gemfile index 9bf54f75a..aed112db7 100644 --- a/Gemfile +++ b/Gemfile @@ -60,10 +60,12 @@ gem "autoprefixer-rails", "5.1.11" # Database -ENV["DB"] ||= "mysql" - -gem "mysql2", "0.3.18" if ENV["DB"] == "all" || ENV["DB"] == "mysql" -gem "pg", "0.18.1" if ENV["DB"] == "all" || ENV["DB"] == "postgres" +group :mysql, optional: true do + gem "mysql2", "0.3.18" +end +group :postgresql, optional: true do + gem "pg", "0.18.1" +end gem "activerecord-import", "0.7.0" diff --git a/Gemfile.lock b/Gemfile.lock index d48ab4f3a..aa78d13bc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -463,6 +463,7 @@ GEM orm_adapter (0.5.0) parser (2.2.2.2) ast (>= 1.1, < 3.0) + pg (0.18.1) phantomjs (1.9.8.0) powerpack (0.1.1) pry (0.10.1) @@ -785,6 +786,7 @@ DEPENDENCIES omniauth-twitter (= 1.0.1) omniauth-wordpress (= 0.2.1) open_graph_reader (= 0.6.1) + pg (= 0.18.1) pry pry-byebug pry-debundle @@ -850,3 +852,6 @@ DEPENDENCIES uuid (= 2.3.7) webmock (= 1.21.0) will_paginate (= 3.0.7) + +BUNDLED WITH + 1.10.0 diff --git a/config/database.yml.example b/config/database.yml.example index f5a1e08cd..879572d36 100644 --- a/config/database.yml.example +++ b/config/database.yml.example @@ -1,3 +1,11 @@ +postgresql: &postgresql + adapter: postgresql + host: localhost + port: 5432 + username: postgres + password: + encoding: unicode + mysql: &mysql adapter: mysql2 host: "localhost" @@ -8,20 +16,13 @@ mysql: &mysql encoding: utf8mb4 collation: utf8mb4_bin -postgres: &postgres - adapter: postgresql - host: localhost - port: 5432 - username: postgres - password: - encoding: unicode # Comment the the mysql line and uncomment the postgres line # if you want to use postgres common: &common # Choose one of the following - <<: *mysql - #<<: *postgres + <<: *postgresql + #<<: *mysql # Should match environment.sidekiq.concurrency #pool: 25 @@ -32,9 +33,6 @@ common: &common # Normally you don't need to touch anything here -postgres_travis: &postgres_travis - adapter: postgresql - username: postgres combined: &combined <<: *common development: diff --git a/config/eye.rb b/config/eye.rb index 52d25aea4..2dc55f38b 100644 --- a/config/eye.rb +++ b/config/eye.rb @@ -7,7 +7,7 @@ end Eye.application("diaspora") do working_dir Rails.root.to_s - env "DB" => ENV["DB"], "RAILS_ENV" => rails_env + env "RAILS_ENV" => rails_env stdout "log/eye_processes_stdout.log" unless rails_env == "development" stderr "log/eye_processes_stderr.log" diff --git a/script/ci/build.sh b/script/ci/build.sh index 127874287..7a129f211 100755 --- a/script/ci/build.sh +++ b/script/ci/build.sh @@ -4,8 +4,8 @@ # Create a database.yml for the right database echo "Setting up database.yml for $DB" cp config/database.yml.example config/database.yml -if [ "$DB" = "postgres" ]; then - sed -i 's/*common/*postgres_travis/' config/database.yml +if [ "$DB" = "mysql" ]; then + sed -i 's/*common/*mysql/' config/database.yml fi command="bundle exec rake --trace ci:travis:${BUILD_TYPE}" diff --git a/script/server b/script/server index 0144e244f..2f63e2a64 100755 --- a/script/server +++ b/script/server @@ -113,11 +113,6 @@ vars=$(bin/bundle exec ruby ./script/get_config.rb \ on_failure "Couldn't parse config/diaspora.yml!" eval "$vars" -if [ -n "$DB" ] -then - export DB -fi - args="$@" for arg in $(echo $args | awk '{ for (i = 1; i <= NF; i++) print $i}') do From 207b6c61537fc96528f7cd29e80a27401f49be18 Mon Sep 17 00:00:00 2001 From: Augier Date: Thu, 16 Apr 2015 19:19:41 +0200 Subject: [PATCH 015/866] Port to Bootstrap 3 correcting images display on stream sidebar Corrections on profile page --- Gemfile | 2 +- Gemfile.lock | 9 +- app/assets/images/ajax-loader.gif | Bin 1737 -> 0 bytes app/assets/images/mobile/deletelabel.png | Bin 203 -> 0 bytes app/assets/images/static-loader.png | Bin 306 -> 0 bytes app/assets/javascripts/app/app.js | 2 +- .../app/helpers/handlebars-helpers.js | 8 +- .../javascripts/app/helpers/modal_helper.js | 12 + app/assets/javascripts/app/pages/contacts.js | 4 +- app/assets/javascripts/app/router.js | 20 +- .../app/views/aspect_create_view.js | 2 +- .../app/views/aspect_membership_view.js | 7 +- .../app/views/aspects_dropdown_view.js | 4 +- .../javascripts/app/views/location_view.js | 14 +- .../app/views/notification_dropdown_view.js | 2 +- .../app/views/notifications_view.js | 38 +-- .../app/views/profile_header_view.js | 13 + .../views/publisher/getting_started_view.js | 44 +-- .../javascripts/app/views/publisher_view.js | 2 +- app/assets/javascripts/main.js | 5 +- app/assets/javascripts/view.js | 1 + .../javascripts/widgets/infinite-scroll.js | 2 +- app/assets/stylesheets/admin.scss | 16 +- app/assets/stylesheets/aspects.scss | 6 +- app/assets/stylesheets/autocomplete.scss | 4 +- .../stylesheets/bootstrap-complete.scss | 10 +- .../stylesheets/bootstrap-headerfix.scss | 2 +- app/assets/stylesheets/chat.scss | 4 +- app/assets/stylesheets/comments.scss | 10 +- app/assets/stylesheets/conversations.scss | 21 +- app/assets/stylesheets/entypo.scss | 2 +- app/assets/stylesheets/getting-started.scss | 5 +- app/assets/stylesheets/header.scss | 2 +- app/assets/stylesheets/hovercard.scss | 1 - app/assets/stylesheets/invitations.scss | 1 - app/assets/stylesheets/leftnavbar.scss | 3 +- app/assets/stylesheets/mobile/header.scss | 28 +- app/assets/stylesheets/mobile/mobile.scss | 237 ++++++---------- .../stylesheets/new_styles/_buttons.scss | 19 +- app/assets/stylesheets/new_styles/_poll.scss | 4 +- .../stylesheets/new_styles/_settings.scss | 21 +- .../stylesheets/new_styles/_spinner.scss | 8 +- .../stylesheets/new_styles/_statistics.scss | 6 +- app/assets/stylesheets/notifications.scss | 2 +- app/assets/stylesheets/profile.scss | 8 + app/assets/stylesheets/publisher.scss | 34 +-- app/assets/stylesheets/sidebar.scss | 1 + app/assets/stylesheets/single-post-view.scss | 4 +- app/assets/stylesheets/stream_element.scss | 1 - app/assets/stylesheets/tag.scss | 6 +- app/assets/stylesheets/vendor/autoSuggest.css | 227 ++++++++-------- .../templates/aspect_create_modal_tpl.jst.hbs | 75 ++--- .../templates/comment-stream_tpl.jst.hbs | 5 +- app/assets/templates/contact_tpl.jst.hbs | 2 +- app/assets/templates/header_tpl.jst.hbs | 2 +- app/assets/templates/help_tpl.jst.hbs | 6 +- app/assets/templates/photo_tpl.jst.hbs | 4 +- app/assets/templates/poll_creator_tpl.jst.hbs | 22 +- app/assets/templates/poll_tpl.jst.hbs | 24 +- .../templates/profile_header_tpl.jst.hbs | 6 +- .../single-post-content_tpl.jst.hbs | 19 +- .../templates/single-post-viewer_tpl.jst.hbs | 6 +- .../templates/stream-element_tpl.jst.hbs | 1 - .../templates/tag_following_list_tpl.jst.hbs | 2 +- app/helpers/invitation_codes_helper.rb | 4 +- app/views/admins/_user_entry.haml | 26 +- app/views/admins/correlations.haml | 2 +- app/views/admins/stats.html.haml | 6 +- app/views/admins/user_search.html.haml | 59 ++-- .../_aspect_membership_dropdown.haml | 13 +- .../_aspect_membership_dropdown.mobile.haml | 10 +- app/views/comments/_comment.mobile.haml | 28 +- app/views/comments/_new_comment.mobile.haml | 9 +- app/views/contacts/_aspect_listings.haml | 52 ++-- app/views/contacts/_header.html.haml | 20 +- app/views/contacts/_sidebar.html.haml | 8 +- app/views/contacts/index.html.haml | 8 +- app/views/contacts/spotlight.haml | 8 +- .../{messages => conversations}/_message.haml | 4 +- app/views/conversations/_messages.haml | 15 + app/views/conversations/_new.haml | 32 +-- app/views/conversations/_show.haml | 12 +- app/views/conversations/_show.mobile.haml | 20 +- app/views/conversations/index.haml | 23 +- app/views/conversations/index.mobile.haml | 14 +- app/views/conversations/new.mobile.haml | 25 +- app/views/devise/passwords/edit.haml | 6 +- app/views/devise/passwords/edit.mobile.haml | 8 +- app/views/devise/passwords/new.haml | 4 +- app/views/home/default.haml | 8 +- app/views/invitations/new.html.haml | 43 +-- app/views/layouts/application.html.haml | 23 +- app/views/layouts/application.mobile.haml | 4 +- app/views/likes/_likes.haml | 3 +- app/views/notifications/index.html.haml | 74 +++-- app/views/notifications/index.mobile.haml | 47 ++-- app/views/people/_person.html.haml | 9 +- app/views/people/_person.mobile.haml | 6 +- app/views/people/contacts.haml | 24 +- app/views/people/index.html.haml | 16 +- app/views/people/show.html.haml | 20 +- app/views/people/show.mobile.haml | 37 ++- app/views/photos/_new_profile_photo.haml | 3 +- .../photos/_new_profile_photo.mobile.haml | 5 +- app/views/photos/_photo.haml | 5 +- app/views/photos/edit.html.haml | 4 +- app/views/posts/_photo.html.haml | 2 +- app/views/profiles/_edit.haml | 40 +-- app/views/profiles/_edit.mobile.haml | 53 ++-- app/views/profiles/_edit_public.haml | 14 +- app/views/profiles/_edit_public.mobile.haml | 21 +- app/views/profiles/edit.haml | 16 +- app/views/profiles/edit.mobile.haml | 10 +- .../publisher/_aspect_dropdown.html.haml | 16 +- app/views/publisher/_publisher.html.haml | 48 ++-- app/views/publisher/_publisher.mobile.haml | 24 +- app/views/registrations/_form.haml | 4 +- app/views/registrations/new.haml | 10 +- app/views/registrations/new.mobile.haml | 20 +- app/views/report/index.html.haml | 2 +- app/views/services/index.html.haml | 10 +- app/views/sessions/new.html.haml | 4 +- app/views/sessions/new.mobile.haml | 18 +- app/views/shared/_invitations.haml | 14 +- app/views/shared/_modal.haml | 27 +- app/views/shared/_post_info.mobile.haml | 45 +-- app/views/shared/_post_stats.mobile.haml | 2 +- app/views/statistics/_statistic.haml | 11 +- app/views/statistics/_statistics.haml | 6 +- app/views/statistics/statistics.html.haml | 3 +- .../status_messages/bookmarklet.html.haml | 6 +- app/views/streams/main_stream.html.haml | 44 +-- app/views/streams/main_stream.mobile.haml | 6 +- app/views/tags/show.haml | 16 +- app/views/terms/default.haml | 20 +- app/views/users/_edit.haml | 256 ++++++++++++++++++ app/views/users/edit.html.haml | 208 +------------- app/views/users/edit.mobile.haml | 197 +------------- app/views/users/getting_started.haml | 18 +- app/views/users/getting_started.mobile.haml | 22 +- app/views/users/privacy_settings.html.haml | 27 +- config/application.rb | 2 - config/initializers/will_paginate.rb | 4 +- features/desktop/accepts_invitation.feature | 4 +- features/desktop/connects_users.feature | 2 +- features/desktop/manages_aspects.feature | 8 +- features/step_definitions/aspects_steps.rb | 4 +- features/step_definitions/custom_web_steps.rb | 9 +- .../step_definitions/notifications_steps.rb | 4 +- features/support/publishing_cuke_helpers.rb | 6 +- .../app/views/aspect_create_view_spec.js | 8 +- .../app/views/aspects_dropdown_view_spec.js | 28 +- .../app/views/notifications_view_spec.js | 4 +- .../app/views/publisher_view_spec.js | 64 ++--- 154 files changed, 1521 insertions(+), 1671 deletions(-) delete mode 100644 app/assets/images/ajax-loader.gif delete mode 100644 app/assets/images/mobile/deletelabel.png delete mode 100644 app/assets/images/static-loader.png create mode 100644 app/assets/javascripts/app/helpers/modal_helper.js rename app/views/{messages => conversations}/_message.haml (94%) create mode 100644 app/views/conversations/_messages.haml create mode 100644 app/views/users/_edit.haml diff --git a/Gemfile b/Gemfile index 8ee81010b..ce9880224 100644 --- a/Gemfile +++ b/Gemfile @@ -53,7 +53,7 @@ gem "rack-cors", "0.4.0", require: "rack/cors" # CSS -gem "bootstrap-sass", "2.3.2.2" +gem "bootstrap-sass", "3.3.4.1" gem "compass-rails", "2.0.4" gem "sass-rails", "5.0.1" gem "autoprefixer-rails", "5.1.11" diff --git a/Gemfile.lock b/Gemfile.lock index bb5fe80bc..dbf214036 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,8 +70,9 @@ GEM jquery-rails railties bcrypt (3.1.10) - bootstrap-sass (2.3.2.2) - sass (~> 3.2) + bootstrap-sass (3.3.4.1) + autoprefixer-rails (>= 5.0.0.1) + sass (>= 3.2.19) builder (3.2.2) byebug (4.0.5) columnize (= 0.9.0) @@ -629,7 +630,7 @@ GEM ruby-progressbar (1.7.5) rubyzip (1.1.7) safe_yaml (1.0.4) - sass (3.4.13) + sass (3.4.14) sass-rails (5.0.1) railties (>= 4.0.0, < 5.0) sass (~> 3.1) @@ -735,7 +736,7 @@ DEPENDENCIES asset_sync (= 1.1.0) autoprefixer-rails (= 5.1.11) backbone-on-rails (= 1.1.2.1) - bootstrap-sass (= 2.3.2.2) + bootstrap-sass (= 3.3.4.1) capybara (= 2.4.4) carrierwave (= 0.10.0) compass-rails (= 2.0.4) diff --git a/app/assets/images/ajax-loader.gif b/app/assets/images/ajax-loader.gif deleted file mode 100644 index e40f19a2818e4c81726bf965fc8dc108d52dc599..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1737 zcmaLXX;2eq7{Kv0&>Vn}$SzS*LjVQjj4a)RTx3buK+piXQbnW$OoR{;K?KiH-(^=F z(X3ZJ7!}8BR6qf1)S^^W>NTR)t6t+ZUgK4-@tWG&+HXvskMBJ5&Tr;F^O&*-WvW#O z38A+T^!f8=yWM{8-n~PI4sF=5p`oE+$&w}8wr%U_>3Q_%(edNQXU?2Cd-iMq0K+hg z7A@McWy{5j7i(*4ckI~l>eZ{)uU}uidUfBveJfY4T)%$(<;$1v+_|%0!GbAMrtIIp z|J12d>(;H?y?gi5r%(6p-Rp9>HgDd1L+4f8OKqR8&;-_V#vlb=B0=l$V#k zc=6)hyLT-uEqnItdH?=>M@PrWlP5oZ{P^k9rz=;k+`M`7!-o&|@83Uj=FFQnZ|>f` z`|R1X$B!T1zJ2@p_3M`|U3&85$%6+E-oAbN@ZrNdM)KG1+*4QS>>dI@%WLAfDn$vBam{{(zyP@#+z5>6$x8lG2 z@FgO|TRay6R6R{gB8Md~H2>Qnv55dvDQG|c!9(McfI_atC=Pdkl)+&5N65!NxB=3p zX@PHms14Ppfp7Z5ZIC(xa08Jx1+D|UppZ5=T@CnLahuLy1Onl}Fh(60LQtYXvM7lh z6)5?d8}*^#(Y)a)(s+%aAtHA-dwV0Xq_}$km(!Q9;j2*X^ZnR>@e?Erq!~EIe_TT0 zkRPIGbI#~Y5lotkVhig{zPXKbGVRBWWPyUp%+Bk8R2c9bp*=tlAbRA{4j2Jq3*MnB zIR#}2`5mPGFq9@970M)Wj0Zt#a!Qs!rAo>umi$KHQTg!&VP=DsWXaSlN3(Dl#I#Zn zr(a*dg5^^P=RA^@* zVdVr6AFT75T@H|(Dfg0z2|${Hdg<@PrnB|MHiH*aQE-^Oi&klSDbsghIH^#`;Uom3 z^@bQjIX=0#MF)w=1r11`mnZ_eCof1Nu zJ|QSaLy=L*O2+=f2sKE}k71$A03TqE7kEV#-vg&z<%I`~0dD87EIGIuglI~<=E`hf ziqUy3v5|l%Rz|Rs`{PtnacYDdC|*NVG@QW^M37n(b3JO35dq%}?B^c#EzIxB_+Mh! z>b6OvL}?5ph^w-RQ!;~-LujMMFGP=`9KWH$P>N7$)QnjctOxp12@BcAJAqC~dea?K zfi+#>MS`+B@n2aaklVqLdkwWk01%RdR+4s+mW~_7p->V=skrDV{(dw@$WQVRwCKe1e&8WShNVFn^`WvMxgU*)Hx5lOL$#8eTX`T017>2*m=dWx+C zXay~-dz1)}MwEqgyt1F$yNDtlKs-Goqk)`Ibfu4&2r%?Fc7nr6DX!5`K^7C^8%L6* z!$;?snc6y6VZylTff^Q%EcXvMv*PzZcHV00Gx372i51#3wN4!&XCM`66mal#WnKi0 zAxQ`dDG+r`mcCxDRWYV8GXfN7Gn;3}+c6dx<29W$DzzQ1M^mJLoA?XM86E|aV~aWq zcp@MPEEF>u%dAFFP?0dL6h=bwXA~)Ee$Mpj+Q1;kOhd12P!KmzmRWpytgNrLi~hwi z3KfAM1jbMpO28#Xqn3_hRB(nGrttoW9un7~ATrkCfdnB&kUb=>6*i;-|3b1AGnayZ zghL)x*j{MTxR_RBfe6_Ar?!gXalpwQTg8Nk`8|+3w<>&kwIhlyK9ydW*;8&D|1)5S4F<9u?0#3qL+jg5)=%*@SV zlV<2KGauGlA>+4UdSl~5dmu-91zW7fZ~G8Fb%(GYT)k_(PwYG~t1v4`>C*dp&yBq* q%O}ZNYT*#*rzteyCe yYGdD($%>5ElYGC')({ - 'src': avatar[size], - 'img_class': imageClass, - 'title': _.escape(name) + return _.template('<%= title %>')({ + src: avatar[size], + img_class: imageClass + " avatar img-responsive center-block", + title: _.escape(name) }); }); diff --git a/app/assets/javascripts/app/helpers/modal_helper.js b/app/assets/javascripts/app/helpers/modal_helper.js new file mode 100644 index 000000000..77e84034e --- /dev/null +++ b/app/assets/javascripts/app/helpers/modal_helper.js @@ -0,0 +1,12 @@ +(function(){ + app.helpers.showModal = function(id){ + $(id).modal(); + var modalBody = $(id).find(".modal-body"); + + var url = $(id).attr("href"); + + modalBody.load(url, function(){ + $(id).find("#modalWaiter").remove(); + }); + }; +})(); diff --git a/app/assets/javascripts/app/pages/contacts.js b/app/assets/javascripts/app/pages/contacts.js index 782120b22..a0d01c8e6 100644 --- a/app/assets/javascripts/app/pages/contacts.js +++ b/app/assets/javascripts/app/pages/contacts.js @@ -78,8 +78,8 @@ app.pages.Contacts = Backbone.View.extend({ }, setupAspectSorting: function() { - $("#aspect_nav .nav").sortable({ - items: "li.aspect[data-aspect-id]", + $("#aspect_nav .list-group").sortable({ + items: "a.aspect[data-aspect-id]", update: function() { $("#aspect_nav .ui-sortable").removeClass("synced"); var data = JSON.stringify({ ordered_aspect_ids: $(this).sortable("toArray", { attribute: "data-aspect-id" }) }); diff --git a/app/assets/javascripts/app/router.js b/app/assets/javascripts/app/router.js index 8cefd3f1a..0a9958bcf 100644 --- a/app/assets/javascripts/app/router.js +++ b/app/assets/javascripts/app/router.js @@ -48,11 +48,11 @@ app.Router = Backbone.Router.extend({ contacts: function() { app.aspect = new app.models.Aspect(gon.preloads.aspect); - app.contacts = new app.collections.Contacts(app.parsePreload('contacts')); + app.contacts = new app.collections.Contacts(app.parsePreload("contacts")); var stream = new app.views.ContactStream({ collection: app.contacts, - el: $('.stream.contacts #contact_stream'), + el: $(".stream.contacts #contact_stream"), }); app.page = new app.pages.Contacts({stream: stream}); @@ -80,7 +80,7 @@ app.Router = Backbone.Router.extend({ app.page.render(); if( !$.contains(document, app.page.el) ) { - // view element isn't already attached to the DOM, insert it + // view element isn"t already attached to the DOM, insert it $("#container").empty().append(app.page.el); } }, @@ -96,7 +96,7 @@ app.Router = Backbone.Router.extend({ var streamFacesView = new app.views.StreamFaces({collection : app.stream.items}); $("#main_stream").html(app.page.render().el); - $('#selected_aspect_contacts .content').html(streamFacesView.render().el); + $("#selected_aspect_contacts .content").html(streamFacesView.render().el); this._hideInactiveStreamLists(); }, @@ -104,7 +104,7 @@ app.Router = Backbone.Router.extend({ this.renderPage(function() { return new app.pages.Profile({ person_id: guid, - el: $('body > .container-fluid'), + el: $("body > #profile_container"), streamCollection: app.collections.Photos, streamView: app.views.Photos }); @@ -132,14 +132,14 @@ app.Router = Backbone.Router.extend({ }, aspects : function(){ - app.aspects = new app.collections.Aspects(app.currentUser.get('aspects')); + app.aspects = new app.collections.Aspects(app.currentUser.get("aspects")); this.aspects_list = new app.views.AspectsList({ collection: app.aspects }); this.aspects_list.render(); this.aspects_stream(); }, aspects_stream : function(){ - var ids = app.aspects.selectedAspects('id'); + var ids = app.aspects.selectedAspects("id"); app.stream = new app.models.StreamAspects([], { aspects_ids: ids }); app.stream.fetch(); @@ -150,7 +150,7 @@ app.Router = Backbone.Router.extend({ var streamFacesView = new app.views.StreamFaces({collection : app.stream.items}); $("#main_stream").html(app.page.render().el); - $('#selected_aspect_contacts .content').html(streamFacesView.render().el); + $("#selected_aspect_contacts .content").html(streamFacesView.render().el); this._hideInactiveStreamLists(); }, @@ -165,13 +165,13 @@ app.Router = Backbone.Router.extend({ bookmarklet: function() { var contents = (window.gon) ? gon.preloads.bookmarklet : {}; app.bookmarklet = new app.views.Bookmarklet( - _.extend({}, {el: $('#bookmarklet')}, contents) + _.extend({}, {el: $("#bookmarklet")}, contents) ).render(); }, profile: function() { this.renderPage(function() { return new app.pages.Profile({ - el: $('body > .container-fluid') + el: $("body > #profile_container") }); }); } }); diff --git a/app/assets/javascripts/app/views/aspect_create_view.js b/app/assets/javascripts/app/views/aspect_create_view.js index 4ef77c808..0ec50afa2 100644 --- a/app/assets/javascripts/app/views/aspect_create_view.js +++ b/app/assets/javascripts/app/views/aspect_create_view.js @@ -4,7 +4,7 @@ app.views.AspectCreate = app.views.Base.extend({ templateName: "aspect_create_modal", events: { - "click .btn.creation": "createAspect" + "click .btn.btn-primary": "createAspect" }, initialize: function(opts) { diff --git a/app/assets/javascripts/app/views/aspect_membership_view.js b/app/assets/javascripts/app/views/aspect_membership_view.js index 4d8d52367..b15d9bbc4 100644 --- a/app/assets/javascripts/app/views/aspect_membership_view.js +++ b/app/assets/javascripts/app/views/aspect_membership_view.js @@ -13,8 +13,7 @@ app.views.AspectMembership = app.views.AspectsDropdown.extend({ events: { "click ul.aspect_membership.dropdown-menu > li.aspect_selector": "_clickHandler", - "keypress ul.aspect_membership.dropdown-menu > li.aspect_selector": "_clickHandler", - "click ul.aspect_membership.dropdown-menu > li.newItem": "showModal" + "keypress ul.aspect_membership.dropdown-menu > li.aspect_selector": "_clickHandler" }, initialize: function() { @@ -147,10 +146,6 @@ app.views.AspectMembership = app.views.AspectsDropdown.extend({ updateSummary: function(target) { this._toggleCheckbox(target); this._updateButton('green'); - }, - - showModal: function() { - this.$("#newAspectModal").modal("show"); } }); // @license-end diff --git a/app/assets/javascripts/app/views/aspects_dropdown_view.js b/app/assets/javascripts/app/views/aspects_dropdown_view.js index 70e446704..ae9d7d897 100644 --- a/app/assets/javascripts/app/views/aspects_dropdown_view.js +++ b/app/assets/javascripts/app/views/aspects_dropdown_view.js @@ -1,6 +1,6 @@ // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later -/* +/* * Aspects view for the publishers aspect dropdown and the aspect membership dropdown. */ app.views.AspectsDropdown = app.views.Base.extend({ @@ -31,7 +31,7 @@ app.views.AspectsDropdown = app.views.Base.extend({ var button = this.$('.btn.dropdown-toggle'), selectedAspects = this.$(".dropdown-menu > li.selected").length, buttonText; - + if (selectedAspects === 0) { button.removeClass(inAspectClass).addClass('btn-default'); buttonText = Diaspora.I18n.t("aspect_dropdown.select_aspects"); diff --git a/app/assets/javascripts/app/views/location_view.js b/app/assets/javascripts/app/views/location_view.js index 0fe6be15d..362f66fbb 100644 --- a/app/assets/javascripts/app/views/location_view.js +++ b/app/assets/javascripts/app/views/location_view.js @@ -10,18 +10,20 @@ app.views.Location = Backbone.View.extend({ }, render: function(){ - $(this.el).append('ajax-loader'); + $("", { alt: 'ajax-loader', src: ImagePaths.get('ajax-loader2.gif') }).appendTo(this.el); }, getLocation: function(){ - var element = this.el; + var element = this.el ; var locator = new OSM.Locator(); locator.getAddress(function(address, latlng){ - $(element).html(''); - $('#location_coords').val(latlng.latitude + "," + latlng.longitude); + $(element).empty(); + $("", { id: "location_address", value: address, + type: "text", class: "input-block-level form-control"}).appendTo($(element)); + + $("#location_coords").val(latlng.latitude + "," + latlng.longitude); }); - }, + } }); // @license-end - diff --git a/app/assets/javascripts/app/views/notification_dropdown_view.js b/app/assets/javascripts/app/views/notification_dropdown_view.js index 36de9c954..3b373a169 100644 --- a/app/assets/javascripts/app/views/notification_dropdown_view.js +++ b/app/assets/javascripts/app/views/notification_dropdown_view.js @@ -86,7 +86,7 @@ app.views.NotificationDropdown = app.views.Base.extend({ hideAjaxLoader: function(){ var self = this; this.ajaxLoader.find('img').fadeTo(200, 0, function(){ - self.ajaxLoader.hide(300, function(){ + self.ajaxLoader.hide(200, function(){ self.ajaxLoader.find('img').css('opacity', 1); }); }); diff --git a/app/assets/javascripts/app/views/notifications_view.js b/app/assets/javascripts/app/views/notifications_view.js index 808ce6749..5d33edc47 100644 --- a/app/assets/javascripts/app/views/notifications_view.js +++ b/app/assets/javascripts/app/views/notifications_view.js @@ -20,7 +20,7 @@ app.views.Notifications = Backbone.View.extend({ else { this.setUnread(note.data("guid")); } }, - getAllUnread: function(){ return $('.media.stream_element.unread'); }, + getAllUnread: function(){ return $(".media.stream_element.unread"); }, setRead: function(guid) { this.setUnreadStatus(guid, false); }, @@ -37,7 +37,7 @@ app.views.Notifications = Backbone.View.extend({ }, clickSuccess: function(data) { - var type = $('.stream_element[data-guid=' + data["guid"] + ']').data('type'); + var type = $(".stream_element[data-guid=" + data["guid"] + "]").data("type"); this.updateView(data["guid"], type, data["unread"]); }, @@ -51,43 +51,43 @@ app.views.Notifications = Backbone.View.extend({ updateView: function(guid, type, unread) { var change = unread ? 1 : -1, - all_notes = $('ul.nav > li:eq(0) .badge'), - type_notes = $('ul.nav > li[data-type=' + type + '] .badge'), - header_badge = $('#notification_badge .badge_count'), - note = $('.stream_element[data-guid=' + guid + ']'), - markAllReadLink = $('a#mark_all_read_link'), - translationKey = unread ? 'notifications.mark_read' : 'notifications.mark_unread'; + allNotes = $("ul.list-group > a:eq(0) .badge"), + typeNotes = $("ul.list-group > a[data-type=" + type + "] .badge"), + headerBadge = $("#notification_badge .badge_count"), + note = $(".stream_element[data-guid=" + guid + "]"), + markAllReadLink = $("a#mark_all_read_link"), + translationKey = unread ? "notifications.mark_read" : "notifications.mark_unread"; if(unread){ note.removeClass("read").addClass("unread"); } else { note.removeClass("unread").addClass("read"); } $(".unread-toggle .entypo", note) - .tooltip('destroy') + .tooltip("destroy") .removeAttr("data-original-title") - .attr('title',Diaspora.I18n.t(translationKey)) + .attr("title",Diaspora.I18n.t(translationKey)) .tooltip(); - [all_notes, type_notes, header_badge].forEach(function(element){ + [allNotes, typeNotes, headerBadge].forEach(function(element){ element.text(function(i, text){ return parseInt(text) + change }); }); - [all_notes, type_notes].forEach(function(badge) { + [allNotes, typeNotes].forEach(function(badge) { if(badge.text() > 0) { - badge.addClass('badge-important').removeClass('badge-default'); + badge.addClass("badge-important").removeClass("badge-default"); } else { - badge.removeClass('badge-important').addClass('badge-default'); + badge.removeClass("badge-important").addClass("badge-default"); } }); - if(header_badge.text() > 0){ - header_badge.removeClass('hidden'); - markAllReadLink.removeClass('disabled'); + if(headerBadge.text() > 0){ + headerBadge.removeClass("hidden"); + markAllReadLink.removeClass("disabled"); } else{ - header_badge.addClass('hidden'); - markAllReadLink.addClass('disabled'); + headerBadge.addClass("hidden"); + markAllReadLink.addClass("disabled"); } } }); diff --git a/app/assets/javascripts/app/views/profile_header_view.js b/app/assets/javascripts/app/views/profile_header_view.js index 7a460e182..322f81bf8 100644 --- a/app/assets/javascripts/app/views/profile_header_view.js +++ b/app/assets/javascripts/app/views/profile_header_view.js @@ -3,6 +3,11 @@ app.views.ProfileHeader = app.views.Base.extend({ templateName: 'profile_header', + events: { + "click #mention_button": "showMentionModal", + "click #message_button": "showMessageModal" + }, + initialize: function(opts) { app.events.on('aspect:create', this.postRenderTemplate, this); this.photos = _.has(opts, 'photos') ? opts.photos : null; @@ -40,6 +45,14 @@ app.views.ProfileHeader = app.views.Base.extend({ return (this.contacts && this.contacts.count > 0); }, + showMentionModal: function(){ + app.helpers.showModal("#mentionModal"); + }, + + showMessageModal: function(){ + app.helpers.showModal("#conversationModal"); + }, + postRenderTemplate: function() { var self = this; var dropdownEl = this.$('.aspect_membership_dropdown.placeholder'); diff --git a/app/assets/javascripts/app/views/publisher/getting_started_view.js b/app/assets/javascripts/app/views/publisher/getting_started_view.js index 6d36a83a7..1ca796ca5 100644 --- a/app/assets/javascripts/app/views/publisher/getting_started_view.js +++ b/app/assets/javascripts/app/views/publisher/getting_started_view.js @@ -19,58 +19,58 @@ app.views.PublisherGettingStarted = Backbone.View.extend({ // initiate all the popover message boxes show: function() { this._addPopover(this.el_first_msg, { - trigger: 'manual', + trigger: "manual", offset: 30, - id: 'first_message_explain', - placement: 'right', + id: "first_message_explain", + placement: "right", html: true, - container: 'body' + container: "body" }, 600); this._addPopover(this.el_visibility, { - trigger: 'manual', + trigger: "manual", offset: 10, - id: 'message_visibility_explain', - placement: 'bottom', + id: "message_visibility_explain", + placement: "bottom", html: true, - container: 'body' + container: "body" }, 1000); this._addPopover(this.el_stream, { - trigger: 'manual', + trigger: "manual", offset: -5, - id: 'stream_explain', - placement: 'left', + id: "stream_explain", + placement: "left", html: true, - container: 'body' + container: "body" }, 1400); // hide some popovers when a post is created - this.$('.button.creation').click(function() { - this.el_visibility.popover('hide'); - this.el_first_msg.popover('hide'); + this.$("#submit").click(function() { + this.el_visibility.popover("hide"); + this.el_first_msg.popover("hide"); }); }, _addPopover: function(el, opts, timeout) { el.popover(opts); el.click(function() { - el.popover('hide'); + el.popover("hide"); }); // show the popover after the given timeout setTimeout(function() { - el.popover('show'); + el.popover("show"); // disable 'getting started' when the last popover is closed - var popup = el.data('popover').$tip[0]; - var close = $(popup).find('.close'); + var popup = el.data("bs.popover").$tip[0]; + var close = $(popup).find(".close"); close.click(function() { - if( $('.popover').length === 1 ) { - $.get('/getting_started_completed', {success: function() { + if( $(".popover").length <= 1 ) { + $.get("/getting_started_completed", {success: function() { $("#welcome-to-diaspora, #welcome-to-diaspora~br").remove(); }}); } - el.popover('hide'); + el.popover("hide"); return false; }); }, timeout); diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index fece5dd08..dd2bf7077 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -324,7 +324,7 @@ app.views.Publisher = Backbone.View.extend({ "title" : serializedForm["status_message[text]"], "address" : $("#location_address").val(), "interactions" : {"likes":[],"reshares":[],"comments_count":0,"likes_count":0,"reshares_count":0}, - 'poll': poll, + 'poll': poll }; if(app.stream) { this.removePostPreview(); diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 58f9db688..deaf9217a 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -45,8 +45,5 @@ //= require view //= require aspects-dropdown //= require mentions -//= require bootstrap-tooltip -//= require bootstrap-popover -//= require bootstrap-dropdown -//= require bootstrap-modal +//= require bootstrap //= require osmlocator diff --git a/app/assets/javascripts/view.js b/app/assets/javascripts/view.js index 508da666d..32c14d325 100644 --- a/app/assets/javascripts/view.js +++ b/app/assets/javascripts/view.js @@ -37,6 +37,7 @@ var View = { Diaspora.page.directionDetector.updateBinds(); }); + $("a.new_aspect").click(function(){ $("input#aspect_name").focus(); }); diff --git a/app/assets/javascripts/widgets/infinite-scroll.js b/app/assets/javascripts/widgets/infinite-scroll.js index d3fa5be01..4e0c745b9 100644 --- a/app/assets/javascripts/widgets/infinite-scroll.js +++ b/app/assets/javascripts/widgets/infinite-scroll.js @@ -13,7 +13,7 @@ debug: false, donetext: Diaspora.I18n.t("infinite_scroll.no_more"), loadingText: "", - loadingImg: ImagePaths.get("ajax-loader.gif"), + loadingImg: ImagePaths.get("ajax-loader2.gif"), navSelector: "#pagination", nextSelector: ".paginate", itemSelector: ".stream_element", diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 2084f5e3d..f8caef389 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -40,12 +40,20 @@ body > div.container { height: 50px; } - .actions li { - margin-top: .3em; - } + .actions{ width: 150px; } + + .pull-right .label{ display: inline-block; } + } +} + +/** Invites panel **/ +.more_invites{ + #add-invites-section{ + line-height: 34px; + margin-bottom: 15px; } } /** reported posts **/ -@import 'report' +@import 'report'; diff --git a/app/assets/stylesheets/aspects.scss b/app/assets/stylesheets/aspects.scss index 3c9b1ac22..1295f6cb5 100644 --- a/app/assets/stylesheets/aspects.scss +++ b/app/assets/stylesheets/aspects.scss @@ -6,17 +6,17 @@ height: 14px; display: inline-block; } - .icon-ok, .icon-refresh { + .glyphicon-ok, .icon-refresh { padding-right: 5px; display: none; } &.selected { - .icon-ok { display: inline-block;} + .glyphicon-ok { display: inline-block;} .icon-refresh { display: none;} } &.loading { .icon-refresh { display: inline-block;} - .icon-ok { display: none;} + .glyphicon-ok { display: none;} } a { .text { diff --git a/app/assets/stylesheets/autocomplete.scss b/app/assets/stylesheets/autocomplete.scss index c23205248..4f3394ae6 100644 --- a/app/assets/stylesheets/autocomplete.scss +++ b/app/assets/stylesheets/autocomplete.scss @@ -26,7 +26,7 @@ } cursor: default; display: block; - height: 37px; + height: 45px; position: relative; // if width will be 100% horizontal scrollbar will apear // when scroll mode will be used @@ -42,7 +42,7 @@ } .ac_loading { - background: white image-url('ajax-loader.gif') right center no-repeat; + background: white image-url('ajax-loader2.gif') right center no-repeat; } .ac_odd { diff --git a/app/assets/stylesheets/bootstrap-complete.scss b/app/assets/stylesheets/bootstrap-complete.scss index 7e36e3854..6ccbe0b82 100644 --- a/app/assets/stylesheets/bootstrap-complete.scss +++ b/app/assets/stylesheets/bootstrap-complete.scss @@ -1,9 +1,3 @@ // Calling this file bootstrap would cause an infinite recursion during asset compilation. -@import 'bootstrap'; -@import 'bootstrap-responsive'; - - -// according to the docs, this is part of bootstrap 2.3.x -.text-left { text-align: left; } -.text-center { text-align: center; } -.text-right { text-align: right; } +@import "bootstrap-sprockets"; +@import "bootstrap"; diff --git a/app/assets/stylesheets/bootstrap-headerfix.scss b/app/assets/stylesheets/bootstrap-headerfix.scss index 53f4919dc..792b44c6c 100644 --- a/app/assets/stylesheets/bootstrap-headerfix.scss +++ b/app/assets/stylesheets/bootstrap-headerfix.scss @@ -26,8 +26,8 @@ header { } #global_search { form { + top: -3px; input { - height: 15px; color: black; } } diff --git a/app/assets/stylesheets/chat.scss b/app/assets/stylesheets/chat.scss index 3be259038..88232bcf4 100644 --- a/app/assets/stylesheets/chat.scss +++ b/app/assets/stylesheets/chat.scss @@ -1,7 +1,7 @@ -body > .container-fluid.chat-roster-shown { +body > .container.chat-roster-shown { padding-right: 224px; #back-to-top { right: 244px; } } -body > .container-fluid.chat-roster-hidden { +body > .container.chat-roster-hidden { #back-to-top { right: 54px; } } diff --git a/app/assets/stylesheets/comments.scss b/app/assets/stylesheets/comments.scss index d21f77fde..6a8551eb9 100644 --- a/app/assets/stylesheets/comments.scss +++ b/app/assets/stylesheets/comments.scss @@ -10,9 +10,8 @@ } .comments > .comment, .comment.new_comment_form_wrapper { .avatar { - margin-top: 5px; - height: 30px; - width: 30px; + height: 35px; + width: 35px; } margin: 0; border-top: 1px dotted $border-grey; @@ -30,6 +29,7 @@ } } .submit_button { + margin-top: 10px; input { float: right; } @@ -39,10 +39,12 @@ } .comment_box { width: 95%; - height: 30px; + height: 35px; } textarea.comment_box:focus, textarea.comment_box:valid, textarea.comment_box:active { border-color: $border-dark-grey; & + .submit_button { display: block; } + min-height: 35px; + box-shadow: none; } } diff --git a/app/assets/stylesheets/conversations.scss b/app/assets/stylesheets/conversations.scss index f37a0d3c1..aeca3bec6 100644 --- a/app/assets/stylesheets/conversations.scss +++ b/app/assets/stylesheets/conversations.scss @@ -18,7 +18,15 @@ margin: 0 0 1em 0; &:last-child { margin-bottom: 0; } } - &.new_message { border-bottom: none; } + &.new_message { + border-bottom: none; + + #new_message #message_text{ + width: 100%; + max-width: 100%; + min-width: 100%; + } + } .timestamp { font-size: 11px; } } @@ -191,6 +199,10 @@ background: $background-grey; } } + div.pagination{ + text-align: center; + width: 100%; + } } } @@ -202,6 +214,12 @@ #conversation_new { label { font-weight: bold; } + + #new_conversation #conversation_text{ + width: 100%; + max-width: 100%; + min-width: 100%; + } } #no_conversations, @@ -226,3 +244,4 @@ input#contact_ids { box-shadow: none; } label { font-weight: bold; } } + diff --git a/app/assets/stylesheets/entypo.scss b/app/assets/stylesheets/entypo.scss index a2d2a3774..50f3f8b22 100644 --- a/app/assets/stylesheets/entypo.scss +++ b/app/assets/stylesheets/entypo.scss @@ -25,7 +25,7 @@ } &.small { - font-size: 1.2em; + font-size: 1em; } /* main icon map */ diff --git a/app/assets/stylesheets/getting-started.scss b/app/assets/stylesheets/getting-started.scss index 57b4d0a6f..a8453f0e9 100644 --- a/app/assets/stylesheets/getting-started.scss +++ b/app/assets/stylesheets/getting-started.scss @@ -10,10 +10,6 @@ .awesome { text-align: center; - - .btn.creation { - text-shadow: none; - } } .hero-unit { @@ -33,6 +29,7 @@ width: 100%; li.as-original { + width: 100%; input { margin-bottom: 15px; } diff --git a/app/assets/stylesheets/header.scss b/app/assets/stylesheets/header.scss index 7e4757ae8..e2e1185eb 100644 --- a/app/assets/stylesheets/header.scss +++ b/app/assets/stylesheets/header.scss @@ -9,7 +9,7 @@ body > header { z-index: 1001; padding: 6px 0; color: #CCC; - height: 26px; + height: 39px; position: fixed; width: 100%; min-width: 620px; diff --git a/app/assets/stylesheets/hovercard.scss b/app/assets/stylesheets/hovercard.scss index eb5ae9518..f7b69b378 100644 --- a/app/assets/stylesheets/hovercard.scss +++ b/app/assets/stylesheets/hovercard.scss @@ -8,7 +8,6 @@ max-width: 400px; background-color: $background-white; - height: 70px; border: 1px solid $border-dark-grey; font-size: small; diff --git a/app/assets/stylesheets/invitations.scss b/app/assets/stylesheets/invitations.scss index 366b0caf4..2c7629687 100644 --- a/app/assets/stylesheets/invitations.scss +++ b/app/assets/stylesheets/invitations.scss @@ -14,7 +14,6 @@ #paste_link { font-weight: 700; } #invite_code { margin-top: 10px; } #codes_left { color: $text-grey; } - .control-label { width: 120px; } .controls { margin-left: 140px; } #email_invitation { padding-top: 10px; diff --git a/app/assets/stylesheets/leftnavbar.scss b/app/assets/stylesheets/leftnavbar.scss index 6bee6e8d6..a803f58e7 100644 --- a/app/assets/stylesheets/leftnavbar.scss +++ b/app/assets/stylesheets/leftnavbar.scss @@ -90,7 +90,8 @@ } /* ---- override app/stylesheets/vendor/autoSuggest.css ---- */ - ul.as-selections { padding: 1px 5px 4px 5px; } + ul.as-selections { padding: 4px 5px; } + .as-original{ width: 100%; } .tag_input { line-height: $font-size-text; vertical-align: top; diff --git a/app/assets/stylesheets/mobile/header.scss b/app/assets/stylesheets/mobile/header.scss index 3c887aa8d..0bea56be3 100644 --- a/app/assets/stylesheets/mobile/header.scss +++ b/app/assets/stylesheets/mobile/header.scss @@ -15,28 +15,23 @@ header { #header_title { display: inline-block; - width: 30px; - height: 30px; + width: 45px; + height: 100%; padding: 7px; } #nav_badges { float: right; - margin: 7px 0px; + margin: 7px 0; display: inline-block; .badge { display: inline; - margin: 0px 4px; + margin: 0 4px; padding: 10px 6px; font-weight: bold; font-size: smaller; background-color: transparent; - - img { - height: 30px; - width: 30px; - } } .badge_count { @@ -53,6 +48,12 @@ header { height: 18px; } } + #nav_badges, #header_title{ + img { + height: 30px; + width: 30px; + } + } } #drawer { @@ -62,7 +63,7 @@ header { width: 100%; left: 100%; background-color: #444; - box-shadow: -2px 0px 2px 1px #333; + box-shadow: none; header { position: static; @@ -74,22 +75,21 @@ header { form { position: absolute; - left: 5px; + left: 15px; right: 22%; input { box-shadow: 0 1px 1px #444; border-radius: 15px; width: 100%; - margin-top: 7px; + margin-top: 5px; background-color: #444; border: 1px solid #222; font-size: 13px; - padding: 4px; + padding: 6px; color: black; &.active { - background-color: $highlight-white; background-color: rgba(160,160,160,0.6); } diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index d6d056beb..b2ac8de9d 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -1,13 +1,20 @@ -@import "bootstrap"; -@import "bootstrap-responsive"; +@import "bootstrap-complete"; @import "colors"; @import "_mixins"; @import "vendor/autoSuggest"; @import "_flash_messages"; +@import 'entypo-fonts'; +@import 'entypo'; @import "header"; @import "mobile/tags"; +.col-xs-1{ + width: 50px; + padding-right: 0; +} +.col-xs-11{ width: calc(100% - 50px); } + a { color: #2489ce; text-decoration: none; @@ -21,51 +28,38 @@ code { body { background: { image: image-url("mobile/hatched-light.jpg"); - position: fixed; /* scale background image down for iOS retina display */ size: 200px; } - padding: 0px; + padding: 0; } -h3 { - margin-top: 0px; -} - -.clear { - clear: both; -} - -#app > * { - transition: all 0.25s ease; -} - -#main { - padding: 55px 10px 0px 10px; -} +h3 { margin-top: 0; } +.clear { clear: both; } +#app > * { transition: all 0.25s ease; } +#main { padding: 55px 10px 0 10px; } .message { padding-left: 2px; } .stream_element, -.comments { +.comments{ overflow: auto; position: relative; text-align: left; - padding: 10px 0; min-height: 34px; + padding: 10px 0 0 0; + list-style: none; * { max-width: 100%; } .avatar { border-radius: 4px; - float: left; - height: 35px; - width: 35px; - margin: { - right: 10px; }; } + margin-top: 0; + max-width: 35px; + } .from { a { @@ -82,25 +76,15 @@ h3 { } } - > .content, - .reshare > .content { - padding: 5px; - } - .info { - margin: { - top: 0; }; } - .photo_attachments { - margin: { - top: 6px; }; } - .timeago { - font: { - weight: normal; }; } - padding: 0 !important; + > .content, .reshare > .content { padding: 6px; } + .info{ margin-top: 0; } + .photo_attachments{ margin-top: 6px; } + .timeago{ font-weight: normal; } } .shield{ padding: 10px; font-size: larger; - } +} .shield_wrapper{ height: 100%; @@ -117,7 +101,6 @@ h3 { .stream_element .comments { width: 100%; - padding: 0; margin: 0; top: 3px; .content { @@ -168,8 +151,7 @@ h3 { margin-bottom: 10px; border: 1px solid #bbb; - border-top: 1px solid $border-grey; - border-bottom: 1px solid #aaa; + border-bottom-color: #aaa; } .stream_element div.img img.avatar { @@ -202,18 +184,23 @@ h3 { .more-link, .no-more-posts { display: block; text-align: center; - padding: 0 10px; - margin: 0 10px; + padding: 0; + margin: 20px 0; border-radius: 5px; + border: 1px solid $text-grey; - background: { - color: rgba(220,220,220,0.8); - } + background: { color: rgba(220,220,220,0.8); } h1, h2 { color: $text-grey; padding: 20px; text-shadow: 0 2px 0 #fff; + margin: 0; + } + + &:hover, &:active{ + text-decoration: none; + border: 1px solid $text-dark-grey; } } .no-more-posts { @@ -279,7 +266,7 @@ h3 { } &.photos { - border-bottom: 0px !important; + border-bottom: 0 !important; } } @@ -470,15 +457,13 @@ h3 { background: { size: 20px; repeat: no-repeat; - position: center; }; - - height: 13px; + position: center; + }; + height: 20px; width: 20px; - padding: 5px; - - margin: { - left: 5px; }; + padding: 0; + margin-left: 5px; &.loading { background-image: image-url("mobile-spinner.gif"); @@ -507,7 +492,7 @@ h3 { } #new_status_message { - margin: 0px; + margin: 0; fieldset { padding: 10px; @@ -526,14 +511,8 @@ h3 { } textarea { - border-radius: 0; - box-shadow: 0 2px 3px #999; - border: none; - border-bottom: 1px solid $border-dark-grey; - width: 96%; - padding: 2%; - margin: 0px; - font-size: 14px; + min-width: 100%; + max-width: 100%; } } @@ -623,10 +602,14 @@ select { overflow: hidden; } +.stream_element{ padding: 0; } + .notifications { list-style: none; - margin: 0px; + margin: 0; clear: right; + + &, & ul{ padding: 0; } } .notifications_for_day { @@ -689,11 +672,6 @@ select { color: #3F8FBA; } -form#new_conversation.new_message input.button.creation{ - float: right; - margin: 0 5px 5px; -} - h3.ltr { font-size: 18px; line-height: 27px; @@ -712,10 +690,6 @@ h3.ltr { word-wrap: break-word; } -textarea#message_text { - margin: 10px 0 10px; -} - form#new_conversation.new_conversation { background-color: #FFFFFF; border-bottom: 1px solid $border-dark-grey; @@ -742,74 +716,10 @@ form#new_conversation.new_conversation { } 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; - padding-bottom: 5px; -} - -.button.creation { - display: inline-block; - padding: 4px 12px; - margin-bottom: 0; - font-size: 14px; - line-height: 20px; - color: #333333; - text-align: center; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); - vertical-align: middle; - cursor: pointer; - background-color: #f5f5f5; - background-image: gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); - background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); - background-repeat: repeat-x; - border: 1px solid #cccccc; - border-color: #e6e6e6 #e6e6e6 #bfbfbf; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - border-bottom-color: #b3b3b3; - border-radius: 4px; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -} - -.button.creation:hover, -.button.creation:focus, -.button.creation:active { - color: #333333; - background-color: #e6e6e6; -} - -.button.creation:active { - background-color: #cccccc \9; -} - -.button.creation:first-child { - margin-left: 0; -} - -.button.creation:hover, -.button.creation:focus { - color: #333333; - text-decoration: none; - background-position: 0 -15px; - transition: background-position 0.1s linear; -} - -.button.creation:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; + width: 100%; + min-width: 100%; + max-width: 100%; } .registrations_error, @@ -839,6 +749,8 @@ form#new_user.new_user input.btn { } } +.media{ padding: 12px 0 } + .conversation_error { color: #DF0101; text-shadow: 1px 1px 5px #666; @@ -899,7 +811,6 @@ h1.session { padding: 20px; margin: -10px -20px 10px -20px; background-color:#4b4b4b; - box-shadow: 0 3px 40px rgba(0,0,0,0.8); z-index: 10; position: relative; text-align: center; @@ -923,6 +834,7 @@ form p.checkbox_select { margin-top: 5px; min-height: 100px; position: relative; + margin-bottom: 20px; img { border-radius: 5px; @@ -930,8 +842,8 @@ form p.checkbox_select { position: absolute; left: 0; - height: 100px; - width: 100px; + height: auto; + width: auto; &.avatar { @include transition(opacity, 0.5s); @@ -990,6 +902,8 @@ form#update_profile_form { select { padding: 3px; } + + .submit_block{ margin-bottom: 20px; } } select#user_language, #user_auto_follow_back_aspect_id, #aspect_ids_ { @@ -1003,10 +917,6 @@ select#user_language, #user_auto_follow_back_aspect_id, #aspect_ids_ { color: inherit; background-color: $background-grey; border-radius: 10px; - .img .avatar { - width: 50px; - height: 50px; - } } .search-mobile { @@ -1168,16 +1078,8 @@ select#aspect_ids_ { } } -.remove_post { - position: absolute; - top: 2px; - right: 5px; - opacity: 0.5; -} - -.remove_comment { - opacity: 0.5; -} +.remove_post { opacity: 0.5; } +.remove_comment{ opacity: 0.5; } .center { text-align: center; @@ -1202,6 +1104,11 @@ select#aspect_ids_ { margin: 0 10px 0 0; padding: 3px; + &, &:focus, &:active{ + box-shadow: none; + border-color: #CCCCCC; + } + &.has_connection { background-color: $light-green; } @@ -1212,4 +1119,14 @@ select#aspect_ids_ { word-wrap: break-word; } +#email_prefs{ + .checkbox{ + margin: 15px 0; + } +} +.small-horizontal-spacer{ margin: 15px 0; } + +.form-control, .form-control:active, .form-control:focus{ box-shadow: none; } +.form-control:active, .form-control:focus{ border-color: #999999; } + .tag_following_action { margin: 5px 0 10px 0; } diff --git a/app/assets/stylesheets/new_styles/_buttons.scss b/app/assets/stylesheets/new_styles/_buttons.scss index 732f98af3..4b8b2dcdb 100644 --- a/app/assets/stylesheets/new_styles/_buttons.scss +++ b/app/assets/stylesheets/new_styles/_buttons.scss @@ -1,26 +1,27 @@ -.btn.creation { +.btn.btn-primary { $button-border-color: #aaa; - @include button-gradient($creation-blue); + background: $dark-blue; color: #fff; - border: 1px solid darken($button-border-color,20%); + border: 1px solid darken($button-border-color, 20%); text-shadow: none; - &:hover { - background: $creation-blue; + &:hover, &:active { + background: lighten($dark-blue, 10%); border: 1px solid darken($button-border-color,35%); } } -.btn-group.open > .btn.creation { +.btn-group.open > .btn.btn-primary { background: $creation-blue; + &:hover, &:active { background: lighten($dark-blue, 10%); } } .btn.green { $button-border-color: #aaa; - @include button-gradient($green); + background: $green; color: $grey; - border: 1px solid darken($button-border-color,20%); + border: 1px solid darken($button-border-color, 20% ); &:hover { - background: $green; + background: $light-green; border: 1px solid darken($button-border-color,35%); } } diff --git a/app/assets/stylesheets/new_styles/_poll.scss b/app/assets/stylesheets/new_styles/_poll.scss index c7eba90ce..2b98d3959 100644 --- a/app/assets/stylesheets/new_styles/_poll.scss +++ b/app/assets/stylesheets/new_styles/_poll.scss @@ -22,10 +22,10 @@ height: 10px !important; .bar { - background-image: none; - background-color: $border-dark-grey; + background: $border-dark-grey none; color: $text-dark-grey; text-align: left; + height: 100%; } } .submit[disabled] { diff --git a/app/assets/stylesheets/new_styles/_settings.scss b/app/assets/stylesheets/new_styles/_settings.scss index 88e181e88..2d8eef75f 100644 --- a/app/assets/stylesheets/new_styles/_settings.scss +++ b/app/assets/stylesheets/new_styles/_settings.scss @@ -4,7 +4,6 @@ } .as-selections #tags { - border: none; box-shadow: none; } @@ -12,11 +11,21 @@ margin-bottom: 0; } -#profile_photo_upload .avatar { - height: auto; - width: auto; - max-width: 200px; - margin-bottom: 10px; +#profile_photo_upload { + text-align: center; + + .avatar { + height: auto; + width: auto; + max-width: 200px; + margin-bottom: 20px; + } } .settings_visibilty { margin-left: 10px; } + +#profile_bio{ + width: 100%; + max-width: 100%; + min-width: 100%; +} diff --git a/app/assets/stylesheets/new_styles/_spinner.scss b/app/assets/stylesheets/new_styles/_spinner.scss index 49086f97e..2876c8eae 100644 --- a/app/assets/stylesheets/new_styles/_spinner.scss +++ b/app/assets/stylesheets/new_styles/_spinner.scss @@ -17,15 +17,11 @@ clear: both; } -.loaded { - animation: fade-in 0.16s linear; -} - .loader { - mask-image: image-url('static-loader.png'); + mask-image: image-url('ajax-loader2.gif'); animation: spin 1s infinite ease-in-out, fade-in 0.2s ease-in; - background-image : image-url("static-loader.png"); + background-image : image-url("ajax-loader2.gif"); display: inline-block; width : 14px; diff --git a/app/assets/stylesheets/new_styles/_statistics.scss b/app/assets/stylesheets/new_styles/_statistics.scss index 30a9a871b..446b19a4d 100644 --- a/app/assets/stylesheets/new_styles/_statistics.scss +++ b/app/assets/stylesheets/new_styles/_statistics.scss @@ -7,8 +7,8 @@ background-color: $green; } - .span-3 { - width: 30%; + .span-3 { + width: 100%; height: 150px; text-align: center; border: 1px solid $border-grey; @@ -25,4 +25,4 @@ background-color: $background-grey; } } -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/notifications.scss b/app/assets/stylesheets/notifications.scss index d784105c7..0cc1460f6 100644 --- a/app/assets/stylesheets/notifications.scss +++ b/app/assets/stylesheets/notifications.scss @@ -9,7 +9,7 @@ .header { border-bottom: 1px solid $border-grey; .btn-toolbar, h4 { - margin-bottom: 10px; + margin: 11px 0; line-height: 40px; } margin-bottom: 10px; diff --git a/app/assets/stylesheets/profile.scss b/app/assets/stylesheets/profile.scss index 7c868ff55..19d440b66 100644 --- a/app/assets/stylesheets/profile.scss +++ b/app/assets/stylesheets/profile.scss @@ -128,3 +128,11 @@ .stream_container > .pagination { text-align: center; } } + +#email-form{ + padding: 0; + .form-group{ + margin-left: 0; + margin-right: 0; + } +} diff --git a/app/assets/stylesheets/publisher.scss b/app/assets/stylesheets/publisher.scss index 8df3350b3..d6700163c 100644 --- a/app/assets/stylesheets/publisher.scss +++ b/app/assets/stylesheets/publisher.scss @@ -1,6 +1,9 @@ #publisher { z-index: 1; color: $text-grey; + margin: 0; + + & * { font-size: 13px; } &.closed { #button_container, @@ -15,30 +18,27 @@ #publisher_textarea_wrapper { border: 1px solid $border-grey !important; } } + .container-fluid{ padding: 0; } .mentions-autocomplete-list ul { width: 100% !important; } form { margin: 0; #fileInfo { display: none !important; } - #hide_publisher { - margin-top: 10px; - } #publisher_spinner { text-align: center; } .options_and_submit { + padding: 10px 0 ; #publisher_service_icons { - margin-right: 10px; - .btn-link { + .btn-link{ text-decoration: none; } + .btn-link.question_mark .entypo { color: $text-grey; } + .btn-link.question_mark:hover.entypo { color: $black; } + .btn-link.service_icon { padding-left: 5px; padding-right: 5px; - text-decoration: none; } - .btn-link.question_mark { margin-left: 5px; } - .btn-link.question_mark .entypo { color: $text-grey; } - .btn-link.question_mark:hover .entypo { color: $black; } .dim { opacity: 0.3; } .social_media_logos-wordpress-16x16 { display: inline-block; @@ -71,7 +71,7 @@ min-height: 70px; } - .help-block { + .markdownIndications { font-size: 13px; line-height: 30px; padding-left: 10px; @@ -84,11 +84,11 @@ line-height: $line-height !important; } - &.with_attachments .row-fluid#photodropzone_container { + &.with_attachments #photodropzone_container { border-top: 1px dashed $border-grey; } - .row-fluid#poll_creator_container { + #poll_creator_container { display: none; border-top: 1px dashed $border-grey; padding:4px 6px 4px 6px; @@ -104,7 +104,7 @@ } } - &.with_location .row-fluid#location_container { + &.with_location #location_container { height: 30px; border-top: 1px dashed $border-grey; input[type='text'] { @@ -112,7 +112,7 @@ color: $text-grey; } } - &.active .row-fluid#button_container { + &.active #button_container { border-top: 1px solid $border-grey; } @@ -232,8 +232,10 @@ .aspect_dropdown { .radio { - min-height: 0px; - padding-left: 0px; + min-height: 0; + padding-left: 0; + margin-top: 0; + margin-bottom: 0; } } } diff --git a/app/assets/stylesheets/sidebar.scss b/app/assets/stylesheets/sidebar.scss index 28d012ceb..6098e39b6 100644 --- a/app/assets/stylesheets/sidebar.scss +++ b/app/assets/stylesheets/sidebar.scss @@ -56,6 +56,7 @@ display: inline-block; } } + .stream-faces img{ display: inline-flex; } } } } diff --git a/app/assets/stylesheets/single-post-view.scss b/app/assets/stylesheets/single-post-view.scss index 7ddcb9576..40a465267 100644 --- a/app/assets/stylesheets/single-post-view.scss +++ b/app/assets/stylesheets/single-post-view.scss @@ -24,7 +24,7 @@ padding-left: 10px; } } - .row-fluid.reshare { + .row.reshare { border-top: 1px solid lighten($border-grey,5%); padding-top: 10px; margin-top: 10px; @@ -150,5 +150,7 @@ #reshares, #likes, #comments-meta { margin-left: 7px; margin-bottom: 8px; + img{ display: inline; } } + } diff --git a/app/assets/stylesheets/stream_element.scss b/app/assets/stylesheets/stream_element.scss index 0041de0da..e18880c54 100644 --- a/app/assets/stylesheets/stream_element.scss +++ b/app/assets/stylesheets/stream_element.scss @@ -27,7 +27,6 @@ &:hover > .bd > .control-icons { background: #fff; } } .thumbnail { - height: 200px; padding: 10px; margin: 0 5px 10px; text-align: center; diff --git a/app/assets/stylesheets/tag.scss b/app/assets/stylesheets/tag.scss index aa49a815d..fc4098d57 100644 --- a/app/assets/stylesheets/tag.scss +++ b/app/assets/stylesheets/tag.scss @@ -24,7 +24,7 @@ h1.tag { } #tags_show { - .span3 { + .col-md-3 { h4 { margin: 25px 0 15px; } .side_stream #people_stream { .name { display: block; } @@ -35,14 +35,14 @@ h1.tag { } } } - .span7 { + .col-md-7 { .tag-following-action { max-width: 100%; input[type="submit"] { overflow: hidden; text-overflow: ellipsis; max-width: 100%; - } + } } } } diff --git a/app/assets/stylesheets/vendor/autoSuggest.css b/app/assets/stylesheets/vendor/autoSuggest.css index 760365e3c..cf87b15e1 100644 --- a/app/assets/stylesheets/vendor/autoSuggest.css +++ b/app/assets/stylesheets/vendor/autoSuggest.css @@ -1,212 +1,203 @@ /* AutoSuggest CSS - Version 1.2 */ ul.as-selections { - list-style-type: none; - border: 1px solid #ccc; - margin: 0; - overflow: auto; - background-color: #fff; - border-radius: 3px; - /* 1% padding (all sides) + 98% width = 100% */ - padding: 1%; - width: 98%; + list-style-type: none; + margin: 0; + overflow: auto; + background-color: #fff; + border-radius: 3px; + width: 100%; + padding: 0; } ul.as-selections.loading { - background: asset_path("ajax-loader.gif") right center no-repeat; + background: asset_path("ajax-loader2.gif") right center no-repeat; } ul.as-selections li { - float: left; - margin: 1px 4px 1px 0; - cursor: pointer; + float: left; + margin: 1px 4px 1px 0; + cursor: pointer; } ul.as-selections li.as-selection-item { - color: #2b3840; - font-size: 13px; - text-shadow: 0 1px 1px #fff; - background-color: #ddeefe; - background-image: gradient(linear, 0% 0%, 0% 100%, from(#ddeefe), to(#bfe0f1)); - border: 1px solid #acc3ec; - padding: 0; + color: #2b3840; + font-size: 13px; + text-shadow: 0 1px 1px #fff; + background-color: #ddeefe; + background-image: gradient(linear, 0% 0%, 0% 100%, from(#ddeefe), to(#bfe0f1)); + border: 1px solid #acc3ec; + padding: 0; padding-top: 6px; padding-bottom: 6px; padding-left: 6px; - border-radius: 5px; - box-shadow: 0 1px 1px #e4edf2; + border-radius: 5px; + box-shadow: 0 1px 1px #e4edf2; line-height: 10px; - margin-top: -1px; margin-bottom: 10px; } ul.as-selections li.as-selection-item:last-child { - margin-left: 30px; + margin-left: 30px; } ul.as-selections li.as-selection-item a.as-close { - float: right; - margin: 0px 3px 0 0px; - padding: 0 3px; - cursor: pointer; - color: #5491be; - font-family: "Helvetica", helvetica, arial, sans-serif; - font-size: 14px; - font-weight: bold; - text-shadow: 0 1px 1px #fff; - transition: color .1s ease-in; + float: right; + margin: 0px 3px 0 0px; + padding: 0 3px; + cursor: pointer; + color: #5491be; + font-family: "Helvetica", helvetica, arial, sans-serif; + font-size: 14px; + font-weight: bold; + text-shadow: 0 1px 1px #fff; + transition: color .1s ease-in; } ul.as-selections li.as-selection-item.blur { - color: #666666; - background-color: #f4f4f4; - background-image: gradient(linear, 0% 0%, 0% 100%, from(#f4f4f4), to(#d5d5d5)); - border-color: #bbb; - border-top-color: #ccc; - box-shadow: 0 1px 1px #e9e9e9; + color: #666666; + background-color: #f4f4f4; + background-image: gradient(linear, 0% 0%, 0% 100%, from(#f4f4f4), to(#d5d5d5)); + border-color: #bbb; + border-top-color: #ccc; + box-shadow: 0 1px 1px #e9e9e9; } ul.as-selections li.as-selection-item.blur a.as-close { - color: #999; + color: #999; } ul.as-selections li:hover.as-selection-item { - color: #2b3840; - background-color: #bbd4f1; - background-image: gradient(linear, 0% 0%, 0% 100%, from(#bbd4f1), to(#a3c2e5)); - border-color: #6da0e0; - border-top-color: #8bb7ed; + color: #2b3840; + background-color: #bbd4f1; + background-image: gradient(linear, 0% 0%, 0% 100%, from(#bbd4f1), to(#a3c2e5)); + border-color: #6da0e0; + border-top-color: #8bb7ed; } ul.as-selections li:hover.as-selection-item a.as-close { - color: #4d70b0; + color: #4d70b0; } ul.as-selections li.as-selection-item.selected { - border-color: #1f30e4; + border-color: #1f30e4; } ul.as-selections li.as-selection-item a:hover.as-close { - color: #1b3c65; + color: #1b3c65; } ul.as-selections li.as-selection-item a:active.as-close { - color: #4d70b0; + color: #4d70b0; } ul.as-selections li.as-original { - margin-left: 0; + width: 100%; + margin: 0; list-style: none; + padding: 0; } ul.as-selections li.as-original input { - border: none; - outline: none; - font-size: 13px; - width: auto; - padding: 0; - margin: 0; - height: 20px; - line-height: 20px; - width: 300px; -} - -ul.as-selections li.as-original.as-original{ - width: auto; + outline: none; + font-size: 13px; + margin: 0; + line-height: 20px; + width: 100%; } ul.as-list { - position: absolute; - list-style-type: none; + position: absolute; + list-style-type: none; list-style: none; - margin: 2px 0 0 0; - padding: 0; - font-size: 13px; - color: #000; - background-color: #fff; - background-color: rgba(255,255,255,0.95); - z-index: 2; - box-shadow: 0 2px 12px #222; - border-radius: 5px; + margin: 2px 0 0 0; + padding: 0; + font-size: 13px; + color: #000; + background-color: #fff; + background-color: rgba(255,255,255,0.95); + z-index: 2; + box-shadow: 0 2px 12px #222; + border-radius: 5px; } li.as-result-item, li.as-message { - margin: 0 0 0 0; - padding: 5px; - background-color: transparent; - border: 1px solid #fff; - border-bottom: 1px solid #ddd; - cursor: pointer; - border-radius: 3px; + margin: 0 0 0 0; + padding: 5px; + background-color: transparent; + border: 1px solid #fff; + border-bottom: 1px solid #ddd; + cursor: pointer; + border-radius: 3px; } li:first-child.as-result-item { - margin: 0; + margin: 0; } li.as-message { - margin: 0; - cursor: default; + margin: 0; + cursor: default; } li.as-result-item.active { - background-color: #3668d9; - background-image: gradient(linear, 0% 0%, 0% 64%, from(rgb(110, 129, 245)), to(rgb(62, 82, 242))); - border-color: #3342e8; - color: #fff; - text-shadow: 0 1px 2px #122042; + background-color: #3668d9; + background-image: gradient(linear, 0% 0%, 0% 64%, from(rgb(110, 129, 245)), to(rgb(62, 82, 242))); + border-color: #3342e8; + color: #fff; + text-shadow: 0 1px 2px #122042; } li.as-result-item em { - font-style: normal; - background: #444; - padding: 0 2px; - color: #fff; + font-style: normal; + background: #444; + padding: 0 2px; + color: #fff; } li.as-result-item.active em { - background: #253f7a; - color: #fff; + background: #253f7a; + color: #fff; } /* Webkit Hacks */ @media screen and (-webkit-min-device-pixel-ratio:0) { - ul.as-selections li.as-selection-item { - padding-top: 6px; - padding-bottom: 6px; - } - ul.as-selections li.as-selection-item a.as-close { - margin-top: -1px; - } - ul.as-selections li.as-original input { - height: 20px; - } + ul.as-selections li.as-selection-item { + padding-top: 6px; + padding-bottom: 6px; + } + ul.as-selections li.as-selection-item a.as-close { + margin-top: -1px; + } + ul.as-selections li.as-original input { + height: 20px; + } } /* Opera Hacks */ @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { - ul.as-list { - border: 1px solid #ccc; - } - ul.as-selections li.as-selection-item a.as-close { - margin-left: 4px; - margin-top: 0; - } + ul.as-list { + border: 1px solid #ccc; + } + ul.as-selections li.as-selection-item a.as-close { + margin-left: 4px; + margin-top: 0; + } } /* IE Hacks */ ul.as-list { - border: 1px solid #ccc\9; + border: 1px solid #ccc\9; } ul.as-selections li.as-selection-item a.as-close { - margin-left: 4px\9; - margin-top: 0\9; + margin-left: 4px\9; + margin-top: 0\9; } /* Firefox 3.0 Hacks */ ul.as-list, x:-moz-any-link, x:default { - border: 1px solid #ccc; + border: 1px solid #ccc; } BODY:first-of-type ul.as-list, x:-moz-any-link, x:default { /* Target FF 3.5+ */ - border: none; + border: none; } diff --git a/app/assets/templates/aspect_create_modal_tpl.jst.hbs b/app/assets/templates/aspect_create_modal_tpl.jst.hbs index bcb326553..b91216e0d 100644 --- a/app/assets/templates/aspect_create_modal_tpl.jst.hbs +++ b/app/assets/templates/aspect_create_modal_tpl.jst.hbs @@ -1,40 +1,51 @@ -