Commit 4c3941622b95417b41540e00028f09ac31f5c6a0

Fixed user registration

Commit diff

app/controllers/users_controller.rb

 
1616 end
1717
1818 def create
19 @user = User.new(params[:user])
20 @user.login = params[:user][:login]
19 @user = User.new
20 @user.login = params[:login]
21 @user.email = params[:email]
22 @user.password = params[:password]
23 @user.password_confirmation = params[:password_confirmation]
2124 @user.save!
2225 flash[:notice] = "Thanks for signing up! You will receive an account activation email soon"
2326 redirect_to root_path
toggle raw diff

app/helpers/articles_helper.rb

 
164164 out << apg_cell('#fff8ee', a[4], u)
165165 out << apg_cell('#eee', a[5], u)
166166 # total column
167 out << %Q{<td style='border-top: 1px solid #ccc;'>}
168 if @c.to_i > 0 then
169 out << %Q{<a href='/archives/}
170 # if sitename row, use a different slug
171 u == "" ? out << %Q{#{SITENAME}'>} : out << %Q{project/#{u}'>}
172 out << %Q{#{@c.to_s}</a>}
173 else
174 out << %Q{0}
175 end
167# out << %Q{<td style='border-top: 1px solid #ccc;'>}
168# if @c.to_i > 0 then
169# out << %Q{<a href='/archives/}
170# # if sitename row, use a different slug
171# u == "" ? out << %Q{#{SITENAME}'>} : out << %Q{project/#{u}'>}
172# out << %Q{#{@c.to_s}</a>}
173# else
174# out << %Q{0}
175# end
176176 out << %Q{</td></tr>}
177177 out
178178 end
203203 out << rapg_row("issue", "12", "42")
204204 out << rapg_row("howto", "12", "55")
205205 out << rapg_row("other", "13", "45")
206 out << %Q{<td style='padding-top: 4px'></td>}
206 #out << %Q{<td style='padding-top: 4px'></td>}
207207 out << %Q{</tr>}
208208 out << %Q{</table>}
209209 out
toggle raw diff

app/helpers/projects_helper.rb

 
191191 def format_member_accesslevel (al)
192192 case al
193193 when :readonly
194 "Read Only"
194 "read only"
195195 else
196 al.to_s.capitalize
196 al.to_s
197197 end
198198 end
199199
toggle raw diff

app/views/activities/ac_project_index.html.erb

 
2424 <strong><%= m.user.fullname %></strong>
2525 <% end %>
2626 <%= m.activity %>
27 <small>(<%= time_ago_in_words(m.created_at) %>)</small>
27 <small>(<%= time_ago_in_words(m.created_at) %> ago)</small>
2828 </li>
2929<% end %>
3030</ul>
toggle raw diff

app/views/projects/ac_list.html.erb

 
1717<tr>
1818 <th>Project</th>
1919 <th>Description</th>
20<% if logged_in? %>
2021 <th>Role</th>
21 <th>Date Created</th>
22<% end %>
23 <th>Created</th>
2224 <th>Members</th>
2325 <th>Activity</th>
2426</tr>
25 <% if @member_projects != nil and @member_projects.size > 0 then %>
27 <% if logged_in? && @member_projects && @member_projects.size > 0 then %>
2628 <% for project in @member_projects %>
2729 <tr>
2830 <td width=<%= STYLE_TABLE_COL_WIDTH_PROJECT_NAME %>><strong><%= link_to project.title, project_path(project.slug) %></strong></td>
4040 <tr>
4141 <td width=<%= STYLE_TABLE_COL_WIDTH_PROJECT_NAME %>><strong><%= link_to project.title, project_path(project.slug) %></strong></td>
4242 <td><%= project.description %></td>
43 <% if logged_in? %>
4344 <td></td>
45 <% end %>
4446 <td width=<%= STYLE_TABLE_COL_WIDTH_DDBBYY %>><%= format_date_ddbbyy(project.created_at) %></td>
4547 <td><%= project.members.count.to_s %></td>
4648 <td>0%</td>
toggle raw diff

app/views/users/new.html.erb

 
1<h1>Create new user</h1>
1<% title "Register" %>
2
3<%= div_breadcrumb_open %>
4<%= breadcrumb_home %>
5<%= breadcrumb_title("Register") %>
6<%= div_breadcrumb_close %>
7
8<%= div_content_open(STYLE_NORIGHTCOLUMN) %>
9
10<%= div_formattedtext_open %>
211
312<p>
413 Creating a user account allows you to create your own project or participate
1515</p>
1616
1717<%= error_messages_for :user %>
18<% form_for :user, :url => users_path do |f| -%>
18<% form_tag users_path, :id => 'input', :name => 'usersform' do -%>
1919 <p>
20 <%= f.label :login -%><br/>
21 <%= f.text_field :login, :class => "text" -%>
20 <label for="login">Login</label><br/>
21 <%= text_field_tag 'login', params[:login], :class => "text" %>
2222 </p>
2323
2424 <p>
25 <%= f.label :email -%><br/>
26 <%= f.text_field :email, :class => "text" -%>
25 <label for="email">Email</label><br/>
26 <%= text_field_tag 'email', params[:email], :class => "text" %>
2727 </p>
2828
2929 <p>
30 <%= f.label :password -%><br/>
31 <%= f.password_field :password, :class => "text" -%>
30 <label for="password">Password</label><br/>
31 <%= password_field_tag 'password', '', :class => "text" %>
3232 </p>
3333
3434 <p>
35 <%= f.label :password_confirmation -%><br/>
36 <%= f.password_field :password_confirmation, :class => "text" %>
35 <label for="password_confirmation">Password</label><br/>
36 <%= password_field_tag 'password_confirmation', '', :class => "text" %>
3737 </p>
3838
39 <p><%= f.submit 'Sign up' %></p>
39 <p><a href="javascript:document.usersform.submit();">Register</a></p>
40
4041<% end -%>
42
43<%= div_formattedtext_close %>
44
45<%= div_content_close %>
toggle raw diff

test/fixtures/projects.yml

 
22gitlab:
33 id: 2
44 title: "Gitlab"
5 description: 'Rails based source repository, like Sourceforge but with a blog, wiki etc. (as used by <%= SITENAME %>)'
5 description: 'Rails based dev team collaboration and source repository site, like GitHub or Gitorious but with a blog, wiki etc. (as used by <%= SITENAME %>)'
66 user_id: 1
77 slug: "gitlab"
88 license: "GNU Affero General Public License (AGPLv3)"
toggle raw diff

test/fixtures/wiki_pages/_gitlab_credits.txt

 
11Biggest credit is to Johan Sørensen of [Gitorious](http://www.gitorious.org), which
2this project is a fork of and Tom Preston-Werner who developed [Grit](http://grit.rubyforge.org) (the interface to [Git](http://git.or.cz)).
2this project is forked from and Tom Preston-Werner who developed [Grit](http://grit.rubyforge.org) (the Ruby interface to [Git](http://git.or.cz)).
33
44The credit list includes sources of code either directly used in the project, or read to help figure something out:
55
99* has_many_polymorphs
1010* paginating_find
1111* restful_authentication
12* Bluecloth
13* Coderay
12* bluecloth
13* coderay
1414
1515Also help appreciated from 'rsl' on #rubyonrails, 'krawek' on #gitorious and 'Ilari', 'Tv' on #git.
toggle raw diff