RS, DG; There is now a add friend box on the front page that passes group idto the app
This commit is contained in:
parent
838fec4921
commit
744693e7fb
6 changed files with 24 additions and 9 deletions
|
|
@ -19,6 +19,7 @@ class ApplicationController < ActionController::Base
|
|||
@groups = current_user.groups
|
||||
@friends = current_user.friends if current_user
|
||||
@latest_status_message = StatusMessage.newest_for(current_user) if current_user
|
||||
@group = params[:group] ? Group.first(:id => params[:group]) : Group.first
|
||||
end
|
||||
|
||||
def count_requests
|
||||
|
|
|
|||
|
|
@ -3,6 +3,12 @@ class DashboardsController < ApplicationController
|
|||
include ApplicationHelper
|
||||
|
||||
def index
|
||||
@posts = Post.paginate :page => params[:page], :order => 'created_at DESC'
|
||||
if params[:group]
|
||||
@people_ids = @group.people.map {|p| p.id}
|
||||
|
||||
@posts = Post.paginate :person_id => @people_ids, :order => 'created_at DESC'
|
||||
else
|
||||
@posts = Post.paginate :page => params[:page], :order => 'created_at DESC'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
= person_image_tag(post.person)
|
||||
|
||||
%span.from
|
||||
= link_to_person post.person
|
||||
= link_to post.person.real_name, post.person
|
||||
%b wrote a new blog post
|
||||
%br
|
||||
%b= post.title
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
= form_for @request do |f|
|
||||
= form_for Request.new do |f|
|
||||
= f.error_messages
|
||||
|
||||
|
||||
Enter a Diaspora URL, Diaspora username, or random email address:
|
||||
.field_with_submit
|
||||
= f.text_field :destination_url
|
||||
= f.hidden_field :group, :value => @group.id
|
||||
= f.submit
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#group
|
||||
%ul
|
||||
- for group in @groups
|
||||
%li= link_to group.name, group_path(group)
|
||||
%li= link_to group.name, root_path(:group =>group.id)
|
||||
|
||||
%li#add_group_button.new_group= link_to "NEW GROUP", "#"
|
||||
|
||||
|
|
@ -9,8 +9,11 @@
|
|||
= render "groups/new_group"
|
||||
|
||||
#friend_pictures
|
||||
- for friend in @friends
|
||||
- for friend in @group.people
|
||||
= person_image_link(friend)
|
||||
|
||||
.add_new
|
||||
= link_to "+", requests_path
|
||||
#add_request_button.add_new
|
||||
= link_to "+", "#"
|
||||
|
||||
#add_request_pane.contextual_pane
|
||||
= render "requests/new_request"
|
||||
|
|
|
|||
|
|
@ -83,9 +83,11 @@ $(document).ready(function(){
|
|||
//buttons//////
|
||||
function pane_toggler_button( name ) {
|
||||
$("#add_" + name + "_button").toggle(
|
||||
function(){
|
||||
function(evt){
|
||||
evt.preventDefault();
|
||||
$("#add_" + name + "_pane").fadeIn(300);
|
||||
},function(){
|
||||
},function(evt){
|
||||
evt.preventDefault();
|
||||
$("#add_" + name +"_pane").fadeOut(200);
|
||||
}
|
||||
);
|
||||
|
|
@ -94,6 +96,7 @@ $(document).ready(function(){
|
|||
pane_toggler_button("album");
|
||||
pane_toggler_button("group");
|
||||
pane_toggler_button("photo");
|
||||
pane_toggler_button("request");
|
||||
|
||||
$("input[type='submit']").addClass("button");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue