diff --git a/README b/README deleted file mode 100644 index 4faa7886e..000000000 --- a/README +++ /dev/null @@ -1,13 +0,0 @@ -Some things that need doing: - -Rename relations: - post.person needs to be post.owner - group.people might want to be group.members - person.owner should probably be person.user - -Refactor receive: - user.receive is a little horrifying right now. - Maybe make a model.import or model.perform function which can be called on all the classes. - Definitely move the varied signature verification methods into a unified object.signature_valid? - or signatures_valid? - diff --git a/README.md b/README.md new file mode 100644 index 000000000..2b03d914f --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +Diaspora +======== + +The privacy aware, personally controlled, do-it-all, open source social network. + + +Getting started +--------------- + +In order to run Diaspora for development, there are a few external dependencies in getting your environment set up: + +- [MongoDB](http://www.mongodb.org/downloads) - noSQL data layer. +- [OpenSSL](http://www.openssl.org/source/) - Used in the current encryption implementation. +- [ImageMagick](http://www.imagemagick.org/script/binary-releases.php?ImageMagick=0nfesabhe916b9afjc4qiikv03) - Image processing library used to resize uploaded photos. +- [Bundler](http://gembundler.com/) - Gem management tool for Ruby projects. + + +After installing the above, run + sudo bin/mongod + +from where mongo is installed to start mongo. Diaspora will **not run** until mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. It is highly recommended you alias the command to start the database in your .bashrc file. + +In order to start the app server for the first time, bundler needs to grab Diaspora's gem depencencies. To allow this, run + bundle install + +from Diaspora's root directory. It is important to run a bundle install every so often, in the event of a new gem dependency. We will make sure to make an announcement in the event of a gem change. + +Once mongo is running and bundler has finished, run + bundle exec thin start +to begin the app server in development mode. + +Diaspora's test suite uses [rspec](http://rspec.info/), a behavior driven testing framework. In order to run the tests, run + bundle exec rspec spec + + +Getting Help +------------ + +There are multiple outlets of ongoing discussion on the development of Diaspora. + +- [Diaspora Developer Google Group](http://groups.google.com/group/diaspora-dev) +- [Diaspora Discussion Google Group](http://groups.google.com/group/diaspora-discuss) +- [#diaspora-dev](irc://irc.freenode.net/#diaspora-dev) + +More general info and updates about the project can be found on our [blog](http://joindiaspora.com), [twitter](http://twitter.com/joindiaspora). Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). + diff --git a/app/models/user.rb b/app/models/user.rb index c767e3b91..6f53be3c6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -204,6 +204,7 @@ class User Rails.logger.info("Received a salmon: #{cleartext}") salmon = Salmon::SalmonSlap.parse cleartext if salmon.verified_for_key?(salmon.author.public_key) + Rails.logger.info("data in salmon: #{salmon.data}") self.receive(salmon.data) end end diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index d3c7e06fa..de54600d3 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -58,12 +58,16 @@ #group_header .container .span-5.last - - if @group == :all + - if @person %h1 - = link_to "All Relations", root_path + = @person.real_name - else - %h1 - = link_to @group.name, @group + - if @group == :all + %h1 + = link_to "All Relations", root_path + - else + %h1 + = link_to @group.name, @group .page_title = yield :page_title @@ -81,3 +85,6 @@ .span-19.prepend-5.last = render "posts/debug" + #notification_badge.requests + = link_to "requests (#{@request_count})", requests_path + diff --git a/app/views/shared/_group_nav.haml b/app/views/shared/_group_nav.haml index 5c07b6e83..dbf531eb0 100644 --- a/app/views/shared/_group_nav.haml +++ b/app/views/shared/_group_nav.haml @@ -2,17 +2,17 @@ %ul - for group in @groups %li{:id => group.id, :class => ("selected" if current_group?(group))} - %span.group_name - = link_for_group group + = link_for_group group - %li.new_group= link_to("+", "#add_group_pane", :id => "add_group_button") + %li.new_group= link_to("+", "#add_group_pane", :id => "add_group_button", :title => "Add a new relation") #group_manage_button - = link_to "manage", edit_group_path(Group.first), :class => "edit_group_button", :title => "Manage your facets." %ul{ :style => "position:absolute;right:0;bottom:0;"} %li{:class => ("selected" if @group == :all)} = link_to "All Relations", root_url + %li{ :style => "margin-right:0;" } + = link_to "manage", edit_group_path(Group.first), :class => "edit_group_button", :title => "Manage your relations" .yo{ :style => "display:none;"} #add_group_pane diff --git a/public/javascripts/group-edit.js b/public/javascripts/group-edit.js index 5c136ebff..e5c995bed 100644 --- a/public/javascripts/group-edit.js +++ b/public/javascripts/group-edit.js @@ -1,41 +1,66 @@ -$('#move_friends_link').live( 'click', - function(){ - $.post('/groups/move_friends', - {'moves' : $('#group_list').data()}, - function(){ $('#group_title').html("Groups edited successfully!");}); - $(".person").css('background-color','white'); - $('#group_list').removeData(); - $(".person").attr('from_group_id', function(){return $(this).parent().attr('id')}) - }); +$('#move_friends_link').live( 'click', function(){ + $.post('/groups/move_friends', + { 'moves' : $('#group_list').data() }, + function(){ $('#group_title').html("Groups edited successfully!");}); + + $(".person").css('background-color','white'); + $('#group_list').removeData(); + $(".person").attr('from_group_id', function(){return $(this).parent().attr('id')}) + +}); $(function() { - $("li .person").draggable({ - revert: true - }); - - $("li .person").draggable({ - revert: true - }); - - $(".group ul").droppable({ - - drop: function(event, ui) { - - var move = {}; - move[ 'friend_id' ] = ui.draggable[0].id - move[ 'to' ] = $(this)[0].id; - move[ 'from' ] = ui.draggable[0].getAttribute('from_group_id'); - if (move['to'] == move['from']){ - $('#group_list').data( ui.draggable[0].id, []); - ui.draggable.css('background-color','white'); - } else{ - $('#group_list').data( ui.draggable[0].id, move); - ui.draggable.css('background-color','orange'); - } - $(this).closest("ul").append(ui.draggable); + $("li .person").draggable({ + revert: true + }); + + $(".group ul").droppable({ + drop: function(event, ui) { + if (ui.draggable[0].getAttribute('request_id') != null){ + $.ajax({ + type: "DELETE", + url: "/requests/" + ui.draggable[0].getAttribute('request_id') , + data: {"accept" : true , "group_id" : $(this)[0].id } + }); + alert("Sent the ajax, check it out!") } - }); + var move = {}; + move[ 'friend_id' ] = ui.draggable[0].id + move[ 'to' ] = $(this)[0].id; + move[ 'from' ] = ui.draggable[0].getAttribute('from_group_id'); + if (move['to'] == move['from']){ + $('#group_list').data( ui.draggable[0].id, []); + ui.draggable.css('background-color','white'); + } else { + $('#group_list').data( ui.draggable[0].id, move); + ui.draggable.css('background-color','orange'); + } + $(this).closest("ul").append(ui.draggable); + } + }); +}); - +$(".group h3").live( 'click', function() { - }); + var $this = $(this); + var id = $this.closest("li").children("ul").attr("id"); + var link = "/groups/"+ id; + + $this.keypress(function(e) { + if (e.which == 13) { + e.preventDefault(); + $this.blur(); + + //save changes + $.ajax({ + type: "PUT", + url: link, + data: {"group" : {"name" : $this.text() }} + }); + } + //update all other group links + $this.keyup(function(e) { + $("a[href='"+link+"']").text($this.text()); + }); + }); +}); diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index d1d91351a..ba442a831 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -46,6 +46,6 @@ $(".comment_box").live('blur', function(evt){ }); $(".comment_submit").live('click', function(evt){ - $this.parents("p").parents("form").children("p").children(".comment_box").attr("rows", 1); + $(this).closest("form").children("p .comment_box").attr("rows", 1); }); diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 8b4c44134..9881c9c57 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -16,7 +16,7 @@ $(document).ready(function(){ }); //buttons////// - $("#add_group_button").fancybox(); + $("#add_group_button").fancybox({ 'titleShow' : false }); $("#add_request_button").fancybox({ 'titleShow': false }); $("input[type='submit']").addClass("button"); @@ -25,59 +25,31 @@ $(document).ready(function(){ $(this).fadeIn("slow"); }); -});//end document ready - -$(".group h3").live( 'click', function() { - - var $this = $(this); - var id = $this.closest("li").children("ul").attr("id"); - var link = "/groups/"+ id; - - $this.keypress(function(e) { - if (e.which == 13) { - e.preventDefault(); - $this.blur(); - - //save changes - $.ajax({ - type: "PUT", - url: link, - data: {"group" : {"name" : $this.text() }} - }); - } - //update all other group links - $this.keyup(function(e) { - $("a[href='"+link+"']").text($this.text()); - }); - }); -}); - - -function pane_toggler_button( name ) { - - $("#add_" + name + "_button").toggle( - function(evt){ - evt.preventDefault(); - $("#add_" + name + "_pane").fadeIn(300); - },function(evt){ - evt.preventDefault(); - $("#add_" + name +"_pane").fadeOut(200); + $("#global_search").hover( + function() { + $(this).fadeTo('fast', '1'); + }, + function() { + $(this).fadeTo('fast', '0.5'); } ); -} + +});//end document ready + //Called with $(selector).clearForm() - $.fn.clearForm = function() { - return this.each(function() { - var type = this.type, tag = this.tagName.toLowerCase(); - if (tag == 'form') - return $(':input',this).clearForm(); - if (type == 'text' || type == 'password' || tag == 'textarea') - this.value = ''; - //else if (type == 'checkbox' || type == 'radio') - //this.checked = false; - else if (tag == 'select') - this.selectedIndex = -1; - $(this).blur(); - }); - }; +$.fn.clearForm = function() { + return this.each(function() { + var type = this.type, tag = this.tagName.toLowerCase(); + if (tag == 'form') + return $(':input',this).clearForm(); + if (type == 'text' || type == 'password' || tag == 'textarea') + this.value = ''; + //else if (type == 'checkbox' || type == 'radio') + //this.checked = false; + else if (tag == 'select') + this.selectedIndex = -1; + $(this).blur(); + }); +}; + diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 029ccad0d..60f00d037 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -12,10 +12,13 @@ body { a { color: #556270; + color: #107fc9; + color: #019dbe; text-decoration: none; } a:hover { color: white; - background-color: #556270; } + background-color: #556270; + background-color: #019dbe; } .avatar { width: 50px; @@ -73,18 +76,17 @@ header { margin: -2em; margin-bottom: 2em; color: black; - background-color: #333333; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#333333), to(black)); padding: 0; + padding-top: 5px; border-bottom: 1px solid #cccccc; } header #diaspora_text { z-index: 6; - position: absolute; display: inline; font-family: "BrandonGrotesqueLightRegular"; font-size: 16px; border: none; - color: white; - top: 3px; } + color: white; } header #diaspora_text a { color: #999999; } header #diaspora_text a:hover { @@ -236,22 +238,25 @@ ul.comment_set { padding: 0.6em; border-bottom: 1px solid #cccccc; } ul.comment_set li.comment .from { - font-weight: normal; } - ul.comment_set li.comment .from a { - font-weight: bold; } + font-size: 1em; } ul.comment_set li.comment div.time { color: #666666; font-size: 70%; } ul.comment_set li.comment form { margin-top: -5px; - margin-bottom: 0; } + margin-bottom: 0; + font-size: 1em; } + ul.comment_set li.comment form textarea { + font-size: 1em; } -.profile_photo { - float: left; - margin-right: 10px; } +.profile_photo img { + height: 150px; + width: 150px; } #profile ul { - list-style-type: none; } + list-style-type: none; + margin: 0; + padding: 0; } #stream img.person_picture, #profile img.person_picture, .comments img.person_picture { @@ -452,49 +457,44 @@ h1.big_text { #group_nav { position: relative; - color: black; } + color: black; + margin-top: 8px; + margin-bottom: 1px; } #group_nav #group_manage_button { - display: inline; - margin-top: 1px; - font-size: 12px; } + display: inline; } #group_nav #group_manage_button a { color: #999999; } #group_nav ul { - margin-bottom: 0; - margin-right: 0; + margin: 0; padding: 0; - padding-bottom: 0px; - padding-top: 35px; - padding-right: 0; - display: inline-block; - list-style: none; - font-size: 14px; } + list-style: none; } #group_nav ul > li { - background-color: #444444; + padding: 0; display: inline; - margin-right: 0.5em; - padding: 3px 8px; - border: 1px solid #555555; } - #group_nav ul > li.last-child { - margin-right: 0; } + margin-right: 0.5em; } #group_nav ul > li a { + background-color: #444444; + border: 1px solid #555555; + -webkit-border-radius: 3; + position: relative; + padding: 3px 8px; color: #999999; } #group_nav ul > li a:hover { background: none; } - #group_nav ul > li a.editable:hover { - background: yellow; } - #group_nav ul > li:hover { - background-color: #444444; } - #group_nav ul > li:hover a { - color: #999999; } - #group_nav ul > li.selected { + #group_nav ul > li:hover a { + background-color: #555555; + color: #cccccc; } + #group_nav ul > li.selected a { + padding-top: 5px; + padding-bottom: 3px; + line-height: 18px; font-weight: bold; background-color: #eeeeee; border-bottom: 1px solid #eeeeee; color: black; } - #group_nav ul > li.selected:hover { + #group_nav ul > li.selected a:hover { background-color: #efefef; } - #group_nav ul > li.selected a { + #group_nav ul > li.selected a a { color: black; } #add_photo_loader { @@ -562,6 +562,7 @@ h1.big_text { #global_search { display: inline; position: relative; + opacity: 0.5; padding-right: 167px; } #global_search form { display: inline; } @@ -627,3 +628,13 @@ h1.big_text { .requests .person .grey { font-style: italic; color: #666666; } + +#notification_badge { + position: fixed; + bottom: 0; + margin-left: 854px; } + #notification_badge a { + background-color: #eeeeee; + border: 1px solid #cccccc; + border-bottom: none; + padding: 3px 10px; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 887af39ae..5cf70a6bd 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -11,12 +11,15 @@ body :margin 0 a :color #556270 + :color #107FC9 + :color #019DBE :text :decoration none &:hover :color #fff :background :color #556270 + :color #019DBE .avatar :width 50px @@ -78,22 +81,20 @@ header :margin -2em :bottom 2em :color #000 - :background - :color #333 + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#333333), to(#000000)) :padding 0 + :top 5px :border :bottom 1px solid #ccc #diaspora_text :z-index 6 - :position absolute :display inline :font :family 'BrandonGrotesqueLightRegular' :size 16px :border none :color #fff - :top 3px a :color #999 @@ -299,10 +300,7 @@ ul.comment_set .from :font - :weight normal - a - :font - :weight bold + :size 1em div.time :color #666 @@ -312,13 +310,22 @@ ul.comment_set :margin :top -5px :bottom 0 + :font + :size 1em + textarea + :font + :size 1em .profile_photo - :float left - :margin-right 10px + img + :height 150px + :width 150px + #profile ul :list-style-type none + :margin 0 + :padding 0 #stream, #profile, @@ -577,59 +584,54 @@ h1.big_text #group_nav :position relative :color #000 + :margin + :top 8px + :bottom 1px #group_manage_button :display inline - :margin - :top 1px - :font - :size 12px a :color #999 ul - :margin - :bottom 0 - :right 0 + :margin 0 :padding 0 - :bottom 0px - :top 35px - :right 0 - :display inline-block :list :style none - :font - :size 14px + > li - :background - :color #444 + :padding 0 :display inline :margin :right 0.5em - :padding 3px 8px - :border 1px solid #555 - - &.last-child - :margin - :right 0 a + :background + :color #444 + :border 1px solid #555 + + :-webkit-border-radius 3 + + :position relative + :padding 3px 8px :color #999 &:hover :background none - &.editable:hover - :background yellow - &:hover + &:hover a :background - :color #444 - a - :color #999 + :color #555 + :color #ccc - &.selected + &.selected a + :padding + :top 5px + :bottom 3px + :line + :height 18px :font :weight bold :background @@ -731,6 +733,7 @@ h1.big_text #global_search :display inline :position relative + :opacity 0.5 :padding :right 167px @@ -822,4 +825,17 @@ h1.big_text :style italic :color #666 +#notification_badge + :position fixed + :bottom 0 + :margin + :left 854px + a + :background + :color #eee + + :border 1px solid #ccc + :bottom none + + :padding 3px 10px