Description:
add remark and enable for user
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r476:4ff0dd0be8a1 - - 3 files changed: 11 inserted, 1 deleted
@@ -0,0 +1,6 | |||
|
1 | + class AddMoreToUsers < ActiveRecord::Migration | |
|
2 | + def change | |
|
3 | + add_column :users, :enabled, :boolean, default: 1 | |
|
4 | + add_column :users, :remark, :string | |
|
5 | + end | |
|
6 | + end |
@@ -25,33 +25,35 | |||
|
25 | 25 | %h3 Max score |
|
26 | 26 | = link_to '[Show only latest submissions]', controller: :user_admin, action: :user_stat |
|
27 | 27 | = link_to '[download csv with all problems]', controller: :user_admin, action: :user_stat_max, commit: 'download csv' |
|
28 | 28 | |
|
29 | 29 | %table.tablesorter-cafe#my_table |
|
30 | 30 | %thead |
|
31 | 31 | %tr |
|
32 | 32 | %th User |
|
33 | 33 | %th Name |
|
34 | 34 | %th Activated? |
|
35 | 35 | %th Logged in |
|
36 | 36 | %th Contest(s) |
|
37 | + %th Remark | |
|
37 | 38 | - @problems.each do |p| |
|
38 | 39 | %th= p.name |
|
39 | 40 | %th Total |
|
40 | 41 | %th Passed |
|
41 | 42 | %tbody |
|
42 | 43 | - @scorearray.each do |sc| |
|
43 | 44 | %tr{class: cycle('info-even','info-odd')} |
|
44 | 45 | - total,num_passed = 0,0 |
|
45 | 46 | - sc.each_index do |i| |
|
46 | 47 | - if i == 0 |
|
47 | 48 | %td= link_to sc[i].login, controller: 'users', action: 'profile', id: sc[i] |
|
48 | 49 | %td= sc[i].full_name |
|
49 | 50 | %td= sc[i].activated |
|
50 | 51 | %td= sc[i].try(:contest_stat).try(:started_at)!=nil ? 'yes' : 'no' |
|
51 | 52 | %td= sc[i].contests.collect {|c| c.name}.join(', ') |
|
53 | + %td= sc[i].remark | |
|
52 | 54 | - else |
|
53 | 55 | %td= sc[i][0] |
|
54 | 56 | - total += sc[i][0] |
|
55 | 57 | - num_passed += 1 if sc[i][1] |
|
56 | 58 | %td= total |
|
57 | 59 | %td= num_passed |
@@ -2,25 +2,25 | |||
|
2 | 2 | # This file is auto-generated from the current state of the database. Instead |
|
3 | 3 | # of editing this file, please use the migrations feature of Active Record to |
|
4 | 4 | # incrementally modify your database, and then regenerate this schema definition. |
|
5 | 5 | # |
|
6 | 6 | # Note that this schema.rb definition is the authoritative source for your |
|
7 | 7 | # database schema. If you need to create the application database on another |
|
8 | 8 | # system, you should be using db:schema:load, not running all the migrations |
|
9 | 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
10 | 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
11 | 11 | # |
|
12 | 12 | # It's strongly recommended to check this file into your version control system. |
|
13 | 13 | |
|
14 |
- ActiveRecord::Schema.define(:version => 201 |
|
|
14 | + ActiveRecord::Schema.define(:version => 20150203153534) do | |
|
15 | 15 | |
|
16 | 16 | create_table "announcements", :force => true do |t| |
|
17 | 17 | t.string "author" |
|
18 | 18 | t.text "body" |
|
19 | 19 | t.boolean "published" |
|
20 | 20 | t.datetime "created_at", :null => false |
|
21 | 21 | t.datetime "updated_at", :null => false |
|
22 | 22 | t.boolean "frontpage", :default => false |
|
23 | 23 | t.boolean "contest_only", :default => false |
|
24 | 24 | t.string "title" |
|
25 | 25 | t.string "notes" |
|
26 | 26 | end |
@@ -230,17 +230,19 | |||
|
230 | 230 | create_table "users", :force => true do |t| |
|
231 | 231 | t.string "login", :limit => 50 |
|
232 | 232 | t.string "full_name" |
|
233 | 233 | t.string "hashed_password" |
|
234 | 234 | t.string "salt", :limit => 5 |
|
235 | 235 | t.string "alias" |
|
236 | 236 | t.string "email" |
|
237 | 237 | t.integer "site_id" |
|
238 | 238 | t.integer "country_id" |
|
239 | 239 | t.boolean "activated", :default => false |
|
240 | 240 | t.datetime "created_at" |
|
241 | 241 | t.datetime "updated_at" |
|
242 | + t.boolean "enabled", :default => true | |
|
243 | + t.string "remark" | |
|
242 | 244 | end |
|
243 | 245 | |
|
244 | 246 | add_index "users", ["login"], :name => "index_users_on_login", :unique => true |
|
245 | 247 | |
|
246 | 248 | end |
You need to be logged in to leave comments.
Login now