<%= link_to truncate(p.title, length: 60, omission: " …"), p %>
<%= link_to pluralize(p.comments.count, "Comment"), p %> @@ -11,7 +10,7 @@ by <%= link_to p.user.name, p.user %> on <%= p.created_at.strftime("%e. %b %Y") %> -<%= @post.title %>
-<%= link_to @post.author.name, @post.author %> on <%= @post.created_at.strftime("%e. %b %Y") %> - <% if current_user && current_user.rank >= rank_to_int("mod") %> - - <%= link_to "edit", edit_blogpost_path(@post.id) %> - <% end %> - -- <%= link_to "Register", register_path %> + <%= link_to "Log in", login_path, :action => "new" %> | <%= link_to "Sign up", signup_path %> <% end %>
| + | <%= image_tag avatar_url(@user.id, 128), :class => "user-avatar avatar", :alt => "avatar" %> | +||||||||||||||||||
| Display name | <%= f.input :name, :label => false %> | diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index a7d7fed..9a24f16 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -12,33 +12,63 @@ <% end %> - <%= image_tag avatar_url(@user.id, 128), :class => "user-avatar avatar", :alt => "avatar" %>
| IGN | +<%= @user.ign %> | +
| Rank | +<%= link_to int_to_rank(@user.rank), users_path(:rank => int_to_rank(@user.rank)) %> | +
| Skype | +<%= @user.skype %> | +
| YouTube | +<%= link_to @user.youtube_channelname, "https://youtube.com/user/#{CGI::escape(@user.youtube)}", :target => "_blank" %> | +
| <%= link_to @user.twitter, "https://twitter.com/#{CGI::escape(@user.twitter)}", :target => "_blank" %> | +|
| Joined | +<%= @user.created_at.strftime("%e. %b %Y") %> | +
| Last IP | +<%= @user.last_ip %> | +
| <%= mail_to @user.email, @user.email, :subject => "Redstoner" %> | +|
| Last login | +<%= @user.last_login.strftime("%e. %b %Y, %H:%M") %> | +
+ <%= @user.about.blank? ? "nothing".html_safe : h(@user.about).gsub("\n", "
").html_safe %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index d86c882..e3b8e08 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,15 +12,18 @@ Site::Application.routes.draw do end end + resources :forumgroups, :as => 'forums', :path => '/forums' do + + end + match '/serverstatus.png' => 'serverchecker#show' get "logout" => 'sessions#destroy' get 'login' => 'sessions#new' - get 'register' => 'users#new' + get 'signup' => 'users#new' post 'login' => 'sessions#create' post 'paypal' => 'paypal#create' - root :to => 'blogposts#index' end \ No newline at end of file diff --git a/db/migrate/20130802051129_add_forumgroups.rb b/db/migrate/20130802051129_add_forumgroups.rb new file mode 100644 index 0000000..565f5b0 --- /dev/null +++ b/db/migrate/20130802051129_add_forumgroups.rb @@ -0,0 +1,9 @@ +class AddForumgroups < ActiveRecord::Migration + def change + create_table :forumgroups do |t| + t.string :name + t.integer :position + t.timestamps + end + end +end \ No newline at end of file diff --git a/db/migrate/20130802051521_create_forums.rb b/db/migrate/20130802051521_create_forums.rb new file mode 100644 index 0000000..d7017ad --- /dev/null +++ b/db/migrate/20130802051521_create_forums.rb @@ -0,0 +1,11 @@ +class CreateForums < ActiveRecord::Migration + def change + create_table :forums do |t| + t.string "name" + t.integer "position" + t.references :forumgroup + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index a1f6757..26ec139 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130728003021) do +ActiveRecord::Schema.define(:version => 20130802051521) do create_table "blogposts", :force => true do |t| t.string "title" @@ -29,6 +29,21 @@ ActiveRecord::Schema.define(:version => 20130728003021) do t.datetime "updated_at", :null => false end + create_table "forumgroups", :force => true do |t| + t.string "name" + t.integer "position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "forums", :force => true do |t| + t.string "name" + t.integer "position" + t.integer "forumgroup_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "users", :force => true do |t| t.string "name", :null => false t.string "ign", :null => false diff --git a/db/seeds.rb b/db/seeds.rb index d61c4a8..3b8c43a 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,24 +1,6 @@ # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # -deleted_user = User.new({ - name: "Deleted user", - ign: "Steve", - email: "example@example.com", - about: "Hey, apparently, I do no longer exist. This is just a placeholder profile", - password: "D6^w,:A})@/y>@$18u%D2,_@Se{%>$=,14Nc>#Oz4.[eP$X0p'1fW'%=60H{7]i'H);
<%= @post.title %>
+").html_safe %>
").html_safe %>