Skip to content

Commit

Permalink
Endless event loading for dsahboard
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Jul 21, 2012
1 parent 860fa11 commit a69fc5d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
3 changes: 0 additions & 3 deletions app/assets/stylesheets/header.scss
Expand Up @@ -125,9 +125,6 @@ header {
display: block;
cursor: pointer;
img {
-moz-box-shadow: 0 0 5px #ccc;
-webkit-box-shadow: 0 0 5px #ccc;
box-shadow: 0 0 5px #ccc;
border-radius: 4px;
right: 5px;
position: absolute;
Expand Down
3 changes: 1 addition & 2 deletions app/assets/stylesheets/themes/ui_mars.scss
Expand Up @@ -70,8 +70,7 @@
}
}
.separator {
border-color:#444;
background:#31363E;
display:none;
}

}
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/dashboard_controller.rb
Expand Up @@ -3,11 +3,12 @@ class DashboardController < ApplicationController

def index
@projects = current_user.projects_with_events.page(params[:page]).per(40)
@events = Event.recent_for_user(current_user).limit(20)
@events = Event.recent_for_user(current_user).limit(20).offset(params[:offset] || 0)
@last_push = current_user.recent_push

respond_to do |format|
format.html
format.js
format.atom { render :layout => false }
end
end
Expand Down
7 changes: 6 additions & 1 deletion app/views/dashboard/index.html.haml
Expand Up @@ -10,9 +10,10 @@
add new key
to your profile
- if @events.any?
= render @events
.content_list= render @events
- else
%h4.nothing_here_message Projects activity will be displayed here
.loading.hide
.side
= render "events/event_last_push", :event => @last_push
.projects_box
Expand Down Expand Up @@ -54,3 +55,7 @@
New Project »
- else
If you will be added to project - it will be displayed here


:javascript
$(function(){ Pager.init(20); });
2 changes: 1 addition & 1 deletion app/views/dashboard/index.js.haml
@@ -1,2 +1,2 @@
:plain
$(".projects .activities").append("#{escape_javascript(render(@events))}");
Pager.append(#{@events.count}, "#{escape_javascript(render(@events))}");

0 comments on commit a69fc5d

Please sign in to comment.