Merge branch 'master' of github.com:diaspora/diaspora into salmon
This commit is contained in:
commit
c170726f6c
14 changed files with 148 additions and 97 deletions
|
|
@ -34,6 +34,7 @@ class GroupsController < ApplicationController
|
|||
|
||||
def edit
|
||||
@groups = current_user.groups
|
||||
@remote_requests = Request.for_user current_user
|
||||
end
|
||||
|
||||
def update
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@
|
|||
= content_for :page_title do
|
||||
= link_to "Albums", albums_path
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/group_friends"
|
||||
|
||||
%h1.big_text
|
||||
Albums
|
||||
.right
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@
|
|||
= content_for :page_title do
|
||||
= link_to @album.name, @album
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/group_friends"
|
||||
|
||||
|
||||
.album_id{:id => @album.id, :style => "display:hidden;"}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,27 @@
|
|||
= javascript_include_tag 'jquery-ui-1.8.4.custom.min.js'
|
||||
= javascript_include_tag 'group-edit.js'
|
||||
|
||||
%h1{:class => 'big_text', :id => 'group_title'}
|
||||
= "Editing Groups"
|
||||
- content_for :left_pane do
|
||||
%h1{:id => 'group_title'}
|
||||
Requests
|
||||
|
||||
%li.requests
|
||||
%ul
|
||||
- for request in @remote_requests
|
||||
%li.person{:id => request.person.id, :request_id => request.id}
|
||||
= image_tag(request.person.profile.image_url(:thumb_small)) unless request.person.profile.image_url.nil?
|
||||
.name
|
||||
= request.person.real_name
|
||||
|
||||
%h1{:id => 'group_title'}
|
||||
Relations
|
||||
|
||||
%ul#group_list
|
||||
|
||||
- for group in @groups
|
||||
|
||||
%li.group
|
||||
%h3= group.name
|
||||
%h3{:contenteditable => true}= group.name
|
||||
|
||||
%ul{:id => group.id}
|
||||
-if group.people.size < 1
|
||||
|
|
@ -20,8 +32,9 @@
|
|||
-for person in group.people
|
||||
|
||||
%li.person{:id => person.id, :from_group_id => group.id}
|
||||
= image_tag(person.profile.image_url(:thumb_small),:size => "30x30") unless person.profile.image_url.nil?
|
||||
= person.real_name
|
||||
= image_tag(person.profile.image_url(:thumb_small)) unless person.profile.image_url.nil?
|
||||
.name
|
||||
= person.real_name
|
||||
%p
|
||||
%br
|
||||
= link_to 'Update Groups', '#', :class => 'button', :id => "move_friends_link"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
- content_for :page_title do
|
||||
Home
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/group_friends"
|
||||
|
||||
%ul#stream
|
||||
- for post in @posts
|
||||
= render type_partial(post), :post => post unless post.class == Album
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
- content_for :page_title do
|
||||
Home
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/group_friends"
|
||||
|
||||
%ul#stream
|
||||
- for post in @posts
|
||||
= render type_partial(post), :post => post
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
.span-5.last
|
||||
- if @group == :all
|
||||
%h1
|
||||
= link_to "All Groups", root_path
|
||||
= link_to "All Relations", root_path
|
||||
- else
|
||||
%h1
|
||||
= link_to @group.name, @group
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
.container
|
||||
.span-5.last
|
||||
= render "shared/group_friends"
|
||||
= yield :left_pane
|
||||
|
||||
.span-19.last
|
||||
= yield
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
.span-20.last
|
||||
#profile.span-19.last
|
||||
- content_for :page_title do
|
||||
= @person.real_name
|
||||
|
||||
- content_for :left_pane do
|
||||
#profile
|
||||
.profile_photo
|
||||
= person_image_link(@person)
|
||||
|
||||
%h1
|
||||
= @person.real_name
|
||||
- if @person != current_user.person && current_user.friends.include?(@person)
|
||||
.right
|
||||
= link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete, :class => "button"
|
||||
|
||||
%ul
|
||||
-unless @posts.first.nil?
|
||||
%li
|
||||
|
|
@ -22,19 +18,14 @@
|
|||
= hidden_field_tag :from, :from, :value => @groups_with_person.first.id
|
||||
= hidden_field_tag :friend_id, :friend_id, :value => @person.id
|
||||
= submit_tag "save"
|
||||
%li
|
||||
url:
|
||||
= @person.url
|
||||
|
||||
- unless @latest_status_message.nil?
|
||||
%h1.pinched
|
||||
%span
|
||||
= "\"#{@latest_status_message.message}\""
|
||||
%span="posted: #{how_long_ago(@latest_status_message)}"
|
||||
|
||||
- if @person != current_user.person && current_user.friends.include?(@person)
|
||||
= link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete, :class => "button"
|
||||
|
||||
.span-20.last
|
||||
|
||||
.span-20.last
|
||||
.span-19.last
|
||||
- if @posts
|
||||
%h3= "stream - #{@post_count} item(s)"
|
||||
%ul#stream
|
||||
- for post in @posts
|
||||
= render type_partial(post), :post => post unless post.class == Album
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@
|
|||
= content_for :page_title do
|
||||
= link_to "Photo", @photo
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/group_friends"
|
||||
|
||||
|
||||
%h1.big_text
|
||||
= @photo.image
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
|
||||
%li.new_group= link_to("+", "#add_group_pane", :id => "add_group_button")
|
||||
|
||||
#group_edit_button
|
||||
= link_to "edit", edit_group_path(Group.first), :class => "edit_group_button", :title => "Manage your facets."
|
||||
#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 Groups", root_url
|
||||
= link_to "All Relations", root_url
|
||||
|
||||
.yo{ :style => "display:none;"}
|
||||
#add_group_pane
|
||||
|
|
|
|||
|
|
@ -9,12 +9,18 @@ $('#move_friends_link').live( 'click',
|
|||
});
|
||||
|
||||
$(function() {
|
||||
$("li .person").draggable({
|
||||
$("li .person").draggable({
|
||||
revert: true
|
||||
});
|
||||
$(".group ul").droppable({
|
||||
|
||||
$("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;
|
||||
|
|
|
|||
|
|
@ -25,51 +25,32 @@ $(document).ready(function(){
|
|||
$(this).fadeIn("slow");
|
||||
});
|
||||
|
||||
|
||||
$(".edit_group_button").click(function() {
|
||||
|
||||
var element = $(this).closest("li").children(".group_name").children("a");
|
||||
var oldHTML = element.html();
|
||||
|
||||
var link = element.attr("href");
|
||||
|
||||
element.toggleClass("editing");
|
||||
|
||||
if( element.hasClass("editing") ) {
|
||||
element.attr("contentEditable", true);
|
||||
element.focus();
|
||||
|
||||
//remove newline action
|
||||
$(element).keypress(function(e) {
|
||||
if (e.which == 13) {
|
||||
e.preventDefault();
|
||||
element.attr("contentEditable", false);
|
||||
element.toggleClass("editing");
|
||||
element.blur();
|
||||
|
||||
//save changes
|
||||
$.ajax({
|
||||
type: "PUT",
|
||||
url: link,
|
||||
data: {"group" : {"name" : element.text() }}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//update all other group links
|
||||
$(element).keyup(function(e) {
|
||||
$("a[href='"+link+"']").not(element).text(element.text());
|
||||
});
|
||||
|
||||
} else {
|
||||
element.attr("contentEditable", false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
});//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 ) {
|
||||
|
|
|
|||
|
|
@ -453,11 +453,11 @@ h1.big_text {
|
|||
#group_nav {
|
||||
position: relative;
|
||||
color: black; }
|
||||
#group_nav #group_edit_button {
|
||||
#group_nav #group_manage_button {
|
||||
display: inline;
|
||||
margin-top: 1px;
|
||||
font-size: 12px; }
|
||||
#group_nav #group_edit_button a {
|
||||
#group_nav #group_manage_button a {
|
||||
color: #999999; }
|
||||
#group_nav ul {
|
||||
margin-bottom: 0;
|
||||
|
|
@ -582,13 +582,19 @@ h1.big_text {
|
|||
font-size: 12px;
|
||||
margin-top: -3px; }
|
||||
|
||||
.editing, .editing:hover {
|
||||
.editing,
|
||||
.editing:hover {
|
||||
background-color: yellow;
|
||||
border: 1px #666666 solid; }
|
||||
|
||||
.group {
|
||||
.group,
|
||||
.requests {
|
||||
list-style: none; }
|
||||
.group ul {
|
||||
.group h3,
|
||||
.requests h3 {
|
||||
display: inline-block; }
|
||||
.group ul,
|
||||
.requests ul {
|
||||
min-height: 20px;
|
||||
margin: 0;
|
||||
margin-left: 1em;
|
||||
|
|
@ -598,12 +604,26 @@ h1.big_text {
|
|||
border-radius: 3px;
|
||||
list-style: none;
|
||||
padding: 15px; }
|
||||
.group ul li {
|
||||
margin-left: 0;
|
||||
padding: 5px;
|
||||
cursor: move; }
|
||||
.group ul li img {
|
||||
display: inline-block; }
|
||||
.group ul .grey {
|
||||
.group .person,
|
||||
.requests .person {
|
||||
display: inline-block;
|
||||
margin-left: 0;
|
||||
padding: 5px;
|
||||
cursor: move;
|
||||
margin: 5px;
|
||||
background-color: #cccccc;
|
||||
-webkit-border-radius: 3px;
|
||||
text-align: center;
|
||||
width: 75px;
|
||||
height: 75px;
|
||||
padding: 5px;
|
||||
border: 1px solid #999999; }
|
||||
.group .person img,
|
||||
.requests .person img {
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
display: inline-block; }
|
||||
.group .person .grey,
|
||||
.requests .person .grey {
|
||||
font-style: italic;
|
||||
color: #666666; }
|
||||
|
|
|
|||
|
|
@ -579,7 +579,7 @@ h1.big_text
|
|||
:color #000
|
||||
|
||||
|
||||
#group_edit_button
|
||||
#group_manage_button
|
||||
:display inline
|
||||
:margin
|
||||
:top 1px
|
||||
|
|
@ -761,15 +761,21 @@ h1.big_text
|
|||
:margin
|
||||
:top -3px
|
||||
|
||||
.editing, .editing:hover
|
||||
.editing,
|
||||
.editing:hover
|
||||
:background
|
||||
:color yellow
|
||||
:border 1px #666 solid
|
||||
|
||||
|
||||
.group
|
||||
.group,
|
||||
.requests
|
||||
:list
|
||||
:style none
|
||||
|
||||
h3
|
||||
:display inline-block
|
||||
|
||||
ul
|
||||
:min-height 20px
|
||||
:margin 0
|
||||
|
|
@ -784,14 +790,32 @@ h1.big_text
|
|||
:style none
|
||||
:padding 15px
|
||||
|
||||
li
|
||||
:margin
|
||||
:left 0
|
||||
:padding 5px
|
||||
:cursor move
|
||||
.person
|
||||
:display inline-block
|
||||
:margin
|
||||
:left 0
|
||||
:padding 5px
|
||||
:cursor move
|
||||
:margin 5px
|
||||
|
||||
:background
|
||||
:color #ccc
|
||||
:-webkit-border-radius 3px
|
||||
|
||||
:text
|
||||
:align center
|
||||
|
||||
:width 75px
|
||||
:height 75px
|
||||
:padding 5px
|
||||
|
||||
:border 1px solid #999
|
||||
|
||||
img
|
||||
:height 50px
|
||||
:width 50px
|
||||
:display inline-block
|
||||
|
||||
img
|
||||
:display inline-block
|
||||
|
||||
.grey
|
||||
:font
|
||||
|
|
|
|||
Loading…
Reference in a new issue