Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 208
- Log:
First attempt at Gullery configured for the ROOL site. Unfroze the
Rails revision by deleting vendor/rails; Hub integration by a veneer
in the lib/authenticated_system.rb (Acts As Authenticated) plug-in,
plus some view changes and protection for the Account controller;
rewrote the default layout in .rhtml rather than .mab; plus the
usual set of configuration changes to work from a subdirectory and
with the ROOL database server.
- Author:
- rool
- Date:
- Sun May 20 19:12:33 +0100 2007
- Size:
- 1210 Bytes
1 | class ProjectsController < ApplicationController |
2 | include AuthenticatedSystem |
3 | |
4 | before_filter :login_required, :only => [:create, :update_description, :destroy, :sort] |
5 | |
6 | def index |
7 | if User.count == 0 |
8 | redirect_to signup_url |
9 | return |
10 | end |
11 | @logged_in = logged_in? |
12 | @user = User.find_first |
13 | @projects = Project.find :all, :order => 'position, created_at' |
14 | end |
15 | |
16 | def show |
17 | @logged_in = logged_in? |
18 | @project = Project.find @params[:id] |
19 | end |
20 | |
21 | def create |
22 | @project = Project.new @params[:project] |
23 | @project.user_id = current_user.id |
24 | if @project.save |
25 | redirect_to projects_url |
26 | else |
27 | render :action => 'error' |
28 | end |
29 | end |
30 | |
31 | def update_description |
32 | @project = Project.find @params[:id] |
33 | @project.description = @params[:value] |
34 | if @project.save |
35 | render :text => textilize(@project.description) |
36 | end |
37 | end |
38 | |
39 | def destroy |
40 | @project = Project.find @params[:id] |
41 | @project.destroy |
42 | end |
43 | |
44 | def sort |
45 | project_ids = @params[:project_list] |
46 | project_ids.each_with_index do |project_id, index| |
47 | project = Project.find project_id |
48 | project.update_attribute(:position, index) |
49 | end |
50 | render :nothing => true |
51 | end |
52 | |
53 | end |