Changesets can be listed by changeset number.
The Git repository is here.
Changeset 181
Updated to work with Rails 1.2. Small bug fix in the
account controller (missing quotes around name of the
Tasks controller in a method call).
- Comitted by: rool
- Date: Sunday March 25 13:46:07 2007 (over 17 years ago)
Affected files:
- rool/rails/hub/trunk/VERSION (diff)
- rool/rails/hub/trunk/app/controllers/account_controller.rb (diff)
- rool/rails/hub/trunk/app/views/account/enumerate.rhtml (diff)
- rool/rails/hub/trunk/app/views/account/list.rhtml (diff)
- rool/rails/hub/trunk/config/boot.rb (diff)
rool/rails/hub/trunk/VERSION:
prev. | current | |
1 | ||
1 | 0.2.0 (25-Mar-2007) |
rool/rails/hub/trunk/app/controllers/account_controller.rb:
prev. | current | |
@all = false | ||
end | ||
263 | | |
264 | | |
265 | | |
266 | ||
267 | | |
263 | @pager = Paginator.new self, count, limit, params[:page] | |
264 | @page = @pager.current | |
265 | @users = User.find :all, | |
266 | :limit => @pager.items_per_page, | |
267 | :offset => @page.offset | |
end | ||
# Enumerate active users (those users known to the DRb server). | ||
... | ... | |
@all = false | ||
end | ||
298 | | |
299 | | |
300 | | |
298 | @pager = Paginator.new self, count, limit, params[:page] | |
299 | @page = @pager.current | |
300 | @users = @users[@page.offset..(@page.offset + @pager.items_per_page - 1)] | |
302 | | |
303 | ||
else | ||
@pager = false | ||
... | ... | |
# We must have a valid ID | ||
unless (request.post?) and (params[:id]) and (@user = User.find(params[:id])) | ||
326 | | |
324 | redirect_to :controller => 'tasks', :action => nil | |
return | ||
end | ||
rool/rails/hub/trunk/app/views/account/enumerate.rhtml:
prev. | current | |
<th>Actions</th> | ||
</tr> | ||
12 | | |
12 | <% @users.each do |user| -%><tr class="<%= cycle('even', 'odd') %>"> | |
<td> | ||
<%= h(user.real_name) %><br /> | ||
<a href="mailto:<%= h(user.email) %>"><%= h(user.email) %></a> | ||
... | ... | |
</table> | ||
<p align="center" class="paginator"> | ||
26 | | |
27 | ||
26 | Page <%= @page.number %> of <%= @pager.page_count %> | |
27 | <% if !@page.first? -%> | |
| <%= link_to("First", :page => 1) %> | ||
29 | | |
29 | | <%= link_to("Previous", :page => @page.previous.number) %> | |
<% else -%> | ||
| <span class="disabled">First</span> | ||
| <span class="disabled">Previous</span> | ||
<% end -%> | ||
34 | ||
34 | <% if !@page.last? -%> | |
| <%= link_to("Next", :page => @page.next.number) %> | ||
36 | | |
36 | | <%= link_to("Last", :page => @pager.page_count) %> | |
<% else -%> | ||
| <span class="disabled">Next</span> | ||
| <span class="disabled">Last</span> | ||
<% end -%> | ||
41 | ||
41 | <% if @pager.page_count > 1 -%> | |
| <%= link_to("All", :page => 0) %> | ||
<% else -%><% if @all -%> | ||
| <%= link_to("Paged", :page => 1) %> |
rool/rails/hub/trunk/app/views/account/list.rhtml:
prev. | current | |
<th>Actions</th> | ||
</tr> | ||
15 | | |
15 | <% @users.each do |user| -%><tr class="<%= cycle('even', 'odd') %>"> | |
<td> | ||
<%= h(user.real_name) %><br /> | ||
<a href="mailto:<%= h(user.email) %>"><%= h(user.email) %></a> | ||
... | ... | |
</table> | ||
<p align="center" class="paginator"> | ||
29 | | |
30 | ||
29 | Page <%= @page.number %> of <%= @pager.page_count %> | |
30 | <% if !@page.first? -%> | |
| <%= link_to("First", :page => 1) %> | ||
32 | | |
32 | | <%= link_to("Previous", :page => @page.previous.number) %> | |
<% else -%> | ||
| <span class="disabled">First</span> | ||
| <span class="disabled">Previous</span> | ||
<% end -%> | ||
37 | ||
37 | <% if !@page.last? -%> | |
| <%= link_to("Next", :page => @page.next.number) %> | ||
39 | | |
39 | | <%= link_to("Last", :page => @pager.page_count) %> | |
<% else -%> | ||
| <span class="disabled">Next</span> | ||
| <span class="disabled">Last</span> | ||
<% end -%> | ||
44 | ||
44 | <% if @pager.page_count > 1 -%> | |
| <%= link_to("All", :page => 0) %> | ||
<% else -%><% if @all -%> | ||
| <%= link_to("Paged", :page => 1) %> |
rool/rails/hub/trunk/config/boot.rb:
prev. | current | |
rails_gem = Gem.cache.search('rails', "=#{version}").first | ||
if rails_gem | ||
28 | | |
28 | gem "rails", "=#{version}" | |
require rails_gem.full_gem_path + '/lib/initializer' | ||
else | ||
STDERR.puts %(Cannot find gem for Rails =#{version}: | ||
... | ... | |
exit 1 | ||
end | ||
else | ||
38 | | |
38 | gem "rails" | |
require 'initializer' | ||
end | ||
end | ||
Rails::Initializer.run(:set_load_path) | ||
44 | ||
45 | end |