Merge branch 'hotfix/0.0.3.1'

This commit is contained in:
Jonne Haß 2013-02-24 17:25:39 +01:00
commit 4a92508281
18 changed files with 65 additions and 39 deletions

View file

@ -1,3 +1,12 @@
# 0.0.3.1
* exec foreman in ./script/server to replace the process so that we can Ctrl+C it again.
* Include our custom fileuploader on the mobile site too. [#3994](https://github.com/diaspora/diaspora/pull/3994)
* Move custom splash page logic into the controller [#3991](https://github.com/diaspora/diaspora/issues/3991)
* Fixed removing images from publisher on the profile and tags pages. [#3995](https://github.com/diaspora/diaspora/pull/3995)
* Wrap text if too long in mobile notifications. [#3990](https://github.com/diaspora/diaspora/pull/3990)
* Sort tag followings alphabetically, not in reverse [#3986](https://github.com/diaspora/diaspora/issues/3986)
# 0.0.3.0 # 0.0.3.0
## Refactor ## Refactor

View file

@ -1,8 +1,10 @@
app.collections.TagFollowings = Backbone.Collection.extend({ app.collections.TagFollowings = Backbone.Collection.extend({
model: app.models.TagFollowing, model: app.models.TagFollowing,
url : "/tag_followings", url : "/tag_followings",
comparator: function(first_tf, second_tf) {
return first_tf.get("name") < second_tf.get("name");
},
create : function(model) { create : function(model) {
var name = model.name || model.get("name"); var name = model.name || model.get("name");

View file

@ -73,7 +73,7 @@ app.Router = Backbone.Router.extend({
$("#tags_list").replaceWith(followedTagsView.render().el); $("#tags_list").replaceWith(followedTagsView.render().el);
followedTagsView.setupAutoSuggest(); followedTagsView.setupAutoSuggest();
app.tagFollowings.add(preloads.tagFollowings); app.tagFollowings.reset(preloads.tagFollowings);
if(name) { if(name) {
var followedTagsAction = new app.views.TagFollowingAction( var followedTagsAction = new app.views.TagFollowingAction(

View file

@ -14,7 +14,8 @@ app.views.TagFollowingList = app.views.Base.extend({
}, },
initialize : function(){ initialize : function(){
this.collection.bind("add", this.appendTagFollowing, this); this.collection.on("add", this.appendTagFollowing, this);
this.collection.on("reset", this.postRenderTemplate, this);
}, },
postRenderTemplate : function() { postRenderTemplate : function() {
@ -72,4 +73,4 @@ app.views.TagFollowingList = app.views.Base.extend({
}).render().el); }).render().el);
} }
}); });

View file

@ -7,6 +7,7 @@
//= require mbp-respond.min //= require mbp-respond.min
//= require mbp-helper //= require mbp-helper
//= require jquery.autoSuggest.custom //= require jquery.autoSuggest.custom
//= require fileuploader-custom
$(document).ready(function(){ $(document).ready(function(){

View file

@ -50,9 +50,13 @@ body {
font-weight: bold; font-weight: bold;
} }
margin-bottom: 2px; margin-bottom: 2px;
height: 45px; word-wrap: break-word;
white-space: nowrap;
overflow: hidden; overflow: hidden;
.time_notif {
font-weight: normal;
float: right;
padding-right: 5px;
}
} }
> .content, > .content,
@ -165,6 +169,10 @@ body {
#main_stream { #main_stream {
margin-left: -10px; margin-left: -10px;
margin-right: -10px; margin-right: -10px;
.from {
white-space: nowrap;
overflow: hidden;
}
} }
.more-link { .more-link {

View file

@ -2,4 +2,4 @@
<form accept-charset="UTF-8" action="/tag_followings" id="new_tag_following" method="post"> <form accept-charset="UTF-8" action="/tag_followings" id="new_tag_following" method="post">
<input class="tag_input" type="text" name="name" placeholder="{{t "stream.followed_tag.add_a_tag"}}" /> <input class="tag_input" type="text" name="name" placeholder="{{t "stream.followed_tag.add_a_tag"}}" />
</form> </form>
</li> </li>

View file

@ -4,16 +4,22 @@
class HomeController < ApplicationController class HomeController < ApplicationController
def show def show
partial_dir = Rails.root.join('app', 'views', 'home')
if user_signed_in? if user_signed_in?
redirect_to stream_path redirect_to stream_path
elsif is_mobile_device? elsif is_mobile_device?
unless(File.exist?(Rails.root.join('app', 'views', 'home', '_show.mobile.erb'))) if partial_dir.join('_show.mobile.haml').exist? ||
redirect_to user_session_path partial_dir.join('_show.mobile.erb').exist?
render :show, layout: 'post'
else else
render :show, :layout => 'post' redirect_to user_session_path
end end
elsif partial_dir.join("_show.html.haml").exist? ||
partial_dir.join("_show.html.erb").exist?
render :show, layout: 'post'
else else
render :show, :layout => 'post' render file: Rails.root.join("public", "default.html"),
layout: 'post'
end end
end end

View file

@ -6,9 +6,4 @@
- content_for :page_title do - content_for :page_title do
= pod_name = pod_name
- begin = render :partial => 'home/show'
= render :partial => 'home/show'
- rescue
:erb
<%= File.open(Rails.root.join('public', 'default.html')).read %>

View file

@ -13,12 +13,11 @@
%ul.notifications_for_day %ul.notifications_for_day
- notes.each do |note| - notes.each do |note|
.stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : 'read'}"} .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : 'read'}"}
.content .content
=person_image_link(note.actors.last) =person_image_link(note.actors.last)
%span.from .from
= notification_message_for(note) = notification_message_for(note)
.time .time_notif
= time_ago_in_words(note.created_at) = time_ago_in_words(note.created_at)
= will_paginate @notifications, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer = will_paginate @notifications, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer

View file

@ -65,7 +65,7 @@
$('.x').bind('click', function(){ $('.x').bind('click', function(){
var photo = $(this).closest('.publisher_photo'); var photo = $(this).closest('.publisher_photo');
photo.addClass("dim"); photo.addClass("dim");
$.ajax({url: "photos/" + photo.children('img').attr('data-id'), $.ajax({url: "/photos/" + photo.children('img').attr('data-id'),
dataType: 'json', dataType: 'json',
type: 'DELETE', type: 'DELETE',
success: function() { success: function() {

View file

@ -4,7 +4,6 @@
- content_for :head do - content_for :head do
= javascript_include_tag :jquery = javascript_include_tag :jquery
= javascript_include_tag :home
:javascript :javascript
$(document).ready(function () { $(document).ready(function () {

View file

@ -4,8 +4,7 @@
defaults: defaults:
version: version:
number: "0.0.3.0" number: "0.0.3.1"
release: true # Do not touch unless in a merge conflict on doing a release, master should have a commit setting this to true which is not backported to the develop branch.
heroku: false heroku: false
environment: environment:
url: "http://localhost:3000/" url: "http://localhost:3000/"

View file

@ -7,13 +7,13 @@ Feature: posting from own profile page
Given I am on the home page Given I am on the home page
And a user with username "alice" And a user with username "alice"
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
Given I have following aspects: Given I have following aspects:
| Family | | Family |
| Work | | Work |
Given I am on "alice@alice.alice"'s page
Scenario: posting some text Scenario: posting some text
Given I am on "alice@alice.alice"'s page Given I expand the publisher
And I have turned off jQuery effects And I have turned off jQuery effects
And I append "I want to understand people" to the publisher And I append "I want to understand people" to the publisher
And I select "Family" on the aspect dropdown And I select "Family" on the aspect dropdown
@ -45,3 +45,12 @@ Feature: posting from own profile page
When I am on the home page When I am on the home page
Then I should see a "img" within ".stream_element div.photo_attachments" Then I should see a "img" within ".stream_element div.photo_attachments"
And I should see "who am I?" within ".stream_element" And I should see "who am I?" within ".stream_element"
Scenario: back out of posting a photo-only post
Given I expand the publisher
And I have turned off jQuery effects
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload"
And I wait for the ajax to finish
And I click to delete the first uploaded photo
And I wait for the ajax to finish
Then I should not see an uploaded image within the photo drop zone

View file

@ -42,7 +42,6 @@ module Configuration
def version_string def version_string
return @version_string unless @version_string.nil? return @version_string unless @version_string.nil?
@version_string = version.number.to_s @version_string = version.number.to_s
@version_string << "pre" unless version.release?
@version_string << "-p#{git_revision[0..7]}" if git_available? @version_string << "-p#{git_revision[0..7]}" if git_available?
@version_string @version_string
end end
@ -54,6 +53,7 @@ module Configuration
@git_available = false @git_available = false
else else
`which git` `which git`
`git status 2> /dev/null` if $?.success?
@git_available = $?.success? @git_available = $?.success?
end end
end end

View file

@ -115,4 +115,4 @@ else
fi fi
echo "" echo ""
bundle exec foreman start -m "web=1,worker=$workers" -p $port exec bundle exec foreman start -m "web=1,worker=$workers" -p $port

View file

@ -3,6 +3,14 @@ describe("app.collections.TagFollowings", function(){
this.collection = new app.collections.TagFollowings(); this.collection = new app.collections.TagFollowings();
}) })
describe("comparator", function() {
it("should compare in reverse order", function() {
var a = new app.models.TagFollowing({name: "aaa"}),
b = new app.models.TagFollowing({name: "zzz"})
expect(this.collection.comparator(a, b)).toBe(true)
})
})
describe("create", function(){ describe("create", function(){
it("should not allow duplicates", function(){ it("should not allow duplicates", function(){
this.collection.create({"name":"name"}) this.collection.create({"name":"name"})

View file

@ -82,16 +82,6 @@ describe Configuration::Methods do
@settings.version_string.should include @version.number @settings.version_string.should include @version.number
end end
context "on a non release" do
before do
@version.stub(:release?).and_return(false)
end
it "includes pre" do
@settings.version_string.should include "pre"
end
end
context "with git available" do context "with git available" do
before do before do
@settings.stub(:git_available?).and_return(true) @settings.stub(:git_available?).and_return(true)