Description:
manage
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r877:93c4562b9761 - - The requested commit is too big and content was truncated. 14 files changed. Show full diff
new file 100644 |
@@ -35,6 +35,7 | |||
|
35 | 35 | def create |
|
36 | 36 | @user = User.new(user_params) |
|
37 | 37 | @user.activated = true |
|
38 | + byebug | |
|
38 | 39 | if @user.save |
|
39 | 40 | flash[:notice] = 'User was successfully created.' |
|
40 | 41 | redirect_to :action => 'index' |
@@ -44,6 +44,7 | |||
|
44 | 44 | /* */ |
|
45 | 45 | |
|
46 | 46 | import "select2" |
|
47 | + import "chart" | |
|
47 | 48 | |
|
48 | 49 | //my own customization |
|
49 | 50 | import 'custom' |
@@ -43,6 +43,3 | |||
|
43 | 43 | |
|
44 | 44 | //jQuery(".best_in_place").best_in_place(); |
|
45 | 45 | }); |
|
46 | - | |
|
47 | - // --- | |
|
48 | - // generated by coffee-script 1.9.2 |
@@ -26,8 +26,8 | |||
|
26 | 26 | |
|
27 | 27 | has_one :contest_stat, :class_name => "UserContestStat", :dependent => :destroy |
|
28 | 28 | |
|
29 | - belongs_to :site | |
|
30 | - belongs_to :country | |
|
29 | + belongs_to :site, optional: true | |
|
30 | + belongs_to :country, optional: true | |
|
31 | 31 | |
|
32 | 32 | has_and_belongs_to_many :contests, -> { order(:name)} |
|
33 | 33 |
@@ -10,10 +10,10 | |||
|
10 | 10 | .panel-heading |
|
11 | 11 | Grader control: |
|
12 | 12 | .panel-body |
|
13 |
- =link_to 'Start Graders in grading env', { action: 'start_grading'}, class: 'btn btn- |
|
|
14 |
- =link_to 'Start Graders in exam env', { action: 'start_exam'}, class: 'btn btn- |
|
|
15 |
- =link_to 'Stop all running Graders', { action: 'stop_all'}, class: 'btn btn- |
|
|
16 |
- =link_to 'Clear all data', { action: 'clear_all'}, class: 'btn btn- |
|
|
13 | + =link_to 'Start Graders in grading env', { action: 'start_grading'}, class: 'btn btn-secondary' | |
|
14 | + =link_to 'Start Graders in exam env', { action: 'start_exam'}, class: 'btn btn-secondary' | |
|
15 | + =link_to 'Stop all running Graders', { action: 'stop_all'}, class: 'btn btn-secondary' | |
|
16 | + =link_to 'Clear all data', { action: 'clear_all'}, class: 'btn btn-secondary' | |
|
17 | 17 | |
|
18 | 18 | .row |
|
19 | 19 | .col-md-6 |
@@ -1,27 +1,7 | |||
|
1 | - = form_for @group do |f| | |
|
2 | - - if @group.errors.any? | |
|
3 | - #error_explanation | |
|
4 | - %h2= "#{pluralize(@group.errors.count, "error")} prohibited this group from being saved:" | |
|
5 | - %ul | |
|
6 | - - @group.errors.full_messages.each do |msg| | |
|
7 | - %li= msg | |
|
8 | - .row | |
|
9 | - .col-md-6 | |
|
10 | - .form-group.field | |
|
11 | - = f.label :name | |
|
12 | - = f.text_field :name, class: 'form-control' | |
|
13 | 1 |
|
|
14 | 2 |
|
|
15 | - .form-group.field | |
|
16 | - = f.label :description | |
|
17 | - = f.text_field :description, class: 'form-control' | |
|
18 | - .row | |
|
19 | - .col-md-6 | |
|
20 | - .checkbox | |
|
21 | - = f.label :enabled do | |
|
22 | - = f.check_box :enabled | |
|
23 | - Enabled | |
|
24 | - .row | |
|
25 | - .col-md-6 | |
|
26 | - .form-group.actions | |
|
27 | - = f.submit 'Save', class: 'btn btn-primary' | |
|
3 | + = simple_form_for @group do |f| | |
|
4 | + = f.input :name | |
|
5 | + = f.input :description | |
|
6 | + = f.input :enabled | |
|
7 | + = f.button :submit, class: 'btn btn-primary' |
@@ -2,6 +2,8 | |||
|
2 | 2 | |
|
3 | 3 | = render 'form' |
|
4 | 4 | |
|
5 | - = link_to 'Show', @group | |
|
6 | - \| | |
|
7 | - = link_to 'Back', groups_path | |
|
5 | + .row.my-3 | |
|
6 | + .col-auto | |
|
7 | + = link_to 'Edit members and problems', @group, class: 'btn btn-info' | |
|
8 | + .col-auto | |
|
9 | + = link_to 'Back', groups_path, class: 'btn btn-secondary' |
@@ -1,7 +1,7 | |||
|
1 | 1 | %h1 Groups |
|
2 | 2 | |
|
3 | 3 | %p |
|
4 |
- = link_to 'New Group', new_group_path, class: 'btn btn- |
|
|
4 | + = link_to 'New Group', new_group_path, class: 'btn btn-success' | |
|
5 | 5 | %table.table.table-hover |
|
6 | 6 | %thead |
|
7 | 7 | %tr |
@@ -9,16 +9,15 | |||
|
9 | 9 | %th Description |
|
10 | 10 | %th Enabled? |
|
11 | 11 | %th |
|
12 | - %th | |
|
13 | - | |
|
14 | 12 | %tbody |
|
15 | 13 | - @groups.each do |group| |
|
16 | 14 | %tr{:class => "#{(group.enabled?) ? "success" : "danger"}", id: "group-#{group.id}"} |
|
17 | 15 | %td= group.name |
|
18 | 16 | %td= group.description |
|
19 |
- %td= toggle_button(group.enabled?, toggle_group_path(group), "group-enabled-#{group.id}", |
|
|
20 | - %td= link_to 'View', group, class: 'btn btn-default' | |
|
21 | - %td= link_to 'Destroy', group, :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger' | |
|
17 | + %td= toggle_button(group.enabled?, toggle_group_path(group), "group-enabled-#{group.id}", block: ' ') | |
|
18 | + %td | |
|
19 | + = link_to 'Edit members and problems', group, class: 'btn btn-secondary btn-sm' | |
|
20 | + = link_to 'Destroy', group, :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger btn-sm' | |
|
22 | 21 | |
|
23 | 22 | %br |
|
24 | 23 |
@@ -1,22 +1,26 | |||
|
1 | - .container-fluid | |
|
2 | - .row | |
|
1 | + .row.mb-3 | |
|
3 | 2 |
|
|
4 | - %h1 Group #{@group.name} | |
|
5 | - .row | |
|
3 | + %h1 Editing Group members and problems | |
|
4 | + .row.mb-3 | |
|
5 | + .col-md-6 | |
|
6 | + %b Name: | |
|
7 | + = @group.name | |
|
8 | + .row.mb-3 | |
|
6 | 9 |
|
|
7 | 10 |
|
|
8 | 11 |
|
|
9 | - %br | |
|
12 | + .row.mb-3 | |
|
13 | + .col-md-6 | |
|
10 | 14 |
|
|
11 | - .row | |
|
15 | + .row.mb-3 | |
|
12 | 16 |
|
|
13 | 17 |
|
|
14 | 18 |
|
|
15 | 19 |
|
|
16 | - .panel.panel-default | |
|
17 |
- |
|
|
18 |
- |
|
|
19 |
- |
|
|
20 | + .card | |
|
21 | + .card-header | |
|
22 | + Users in this group | |
|
23 | + .card-body | |
|
20 | 24 |
|
|
21 | 25 |
|
|
22 | 26 |
|
@@ -25,9 +29,12 | |||
|
25 | 29 |
|
|
26 | 30 |
|
|
27 | 31 |
|
|
28 |
- |
|
|
29 | - =label_tag :user_id, "User" | |
|
32 | + .row | |
|
33 | + .col-auto | |
|
34 | + =label_tag :user_id, "User", class: 'col-form-label' | |
|
35 | + .col-auto | |
|
30 | 36 | =select_tag :user_id, options_from_collection_for_select(User.all,'id','login_with_name'), class: 'select2', style: 'width: 25em'; |
|
37 | + .col-auto | |
|
31 | 38 | =submit_tag "Add",class: 'btn btn-primary' |
|
32 | 39 | |
|
33 | 40 | |
@@ -47,19 +54,22 | |||
|
47 | 54 |
|
|
48 | 55 |
|
|
49 | 56 |
|
|
50 | - .panel.panel-default | |
|
51 |
- |
|
|
52 |
- |
|
|
53 |
- |
|
|
57 | + .card | |
|
58 | + .card-header | |
|
59 | + Problems | |
|
60 | + .card-body | |
|
54 | 61 |
|
|
55 | 62 |
|
|
56 | 63 |
|
|
57 | 64 |
|
|
58 | 65 |
|
|
59 |
- |
|
|
60 |
- |
|
|
61 | - =label_tag :problem_id, "Problem" | |
|
66 | + =form_tag add_problem_group_path(@group) do | |
|
67 | + .row | |
|
68 | + .col-auto | |
|
69 | + =label_tag :problem_id, "Problem",class: 'col-form-label' | |
|
70 | + .col-auto | |
|
62 | 71 | =select_tag :problem_id, options_from_collection_for_select(Problem.all,'id','long_name'), class: 'select2', style: 'width: 25em'; |
|
72 | + .col-auto | |
|
63 | 73 | =submit_tag "Add",class: 'btn btn-primary' |
|
64 | 74 | |
|
65 | 75 |
@@ -135,8 +135,8 | |||
|
135 | 135 | = "#{value[:first][:value]} @" |
|
136 | 136 | = link_to "#" + value[:first][:sub_id].to_s, submission_path( value[:first][:sub_id]) |
|
137 | 137 | |
|
138 | - %script{src:"https://cdn.jsdelivr.net/npm/chart.js"} | |
|
139 | 138 | :javascript |
|
139 | + $(document).on('import-map-loaded',(e) => { | |
|
140 | 140 | data = #{@chart_dataset} |
|
141 | 141 | config = { |
|
142 | 142 | type: 'bar', |
@@ -152,4 +152,5 | |||
|
152 | 152 | Chart.defaults.font.size = 15 |
|
153 | 153 | //Chart.defaults.font.family = 'Sarabun Light' |
|
154 | 154 | chart = new Chart($('#chart'),config) |
|
155 | + }); | |
|
155 | 156 |
@@ -49,16 +49,6 | |||
|
49 | 49 | = link_to "[#{contest.name}]", :action => 'contests', :id => contest.id |
|
50 | 50 | = link_to "[no contest]", :action => 'contests', :id => 'none' |
|
51 | 51 | |
|
52 | - -# Total #{@user_count} users | | |
|
53 | - -# - if !@paginated | |
|
54 | - -# Display all users. | |
|
55 | - -# \#{link_to '[show in pages]', :action => 'index', :page => '1'} | |
|
56 | - -# - else | |
|
57 | - -# Display in pages. | |
|
58 | - -# \#{link_to '[display all]', :action => 'index', :page => 'all'} | | |
|
59 | - -# \#{will_paginate @users, :container => false} | |
|
60 | - | |
|
61 | - | |
|
62 | 52 | %table.table.table-hover.table-condense.datatable |
|
63 | 53 | %thead |
|
64 | 54 | %th Login |
@@ -85,10 +75,10 | |||
|
85 | 75 | %td= toggle_button(user.activated?, toggle_activate_user_path(user),"toggle_activate_user_#{user.id}") |
|
86 | 76 | %td= toggle_button(user.enabled?, toggle_enable_user_path(user),"toggle_enable_user_#{user.id}") |
|
87 | 77 | %td= user.last_ip |
|
88 |
- %td= link_to 'Clear IP', {:action => 'clear_last_ip', :id => user, :page=>params[:page]}, :confirm => 'This will reset last logging in ip of the user, are you sure?', class: 'btn btn- |
|
|
89 |
- %td= link_to 'Show', {:action => 'show', :id => user}, class: 'btn btn- |
|
|
90 |
- %td= link_to 'Edit', {:action => 'edit', :id => user}, class: 'btn btn- |
|
|
91 |
- %td= link_to 'Destroy', {action: :destroy, id: user}, data: {confirm: 'Are you sure?'}, method: :delete, class: 'btn btn-danger btn- |
|
|
78 | + %td= link_to 'Clear IP', {:action => 'clear_last_ip', :id => user, :page=>params[:page]}, :confirm => 'This will reset last logging in ip of the user, are you sure?', class: 'btn btn-secondary btn-sm btn-block' | |
|
79 | + %td= link_to 'Show', {:action => 'show', :id => user}, class: 'btn btn-secondary btn-sm btn-block' | |
|
80 | + %td= link_to 'Edit', {:action => 'edit', :id => user}, class: 'btn btn-secondary btn-sm btn-block' | |
|
81 | + %td= link_to 'Destroy', {action: :destroy, id: user}, data: {confirm: 'Are you sure?'}, method: :delete, class: 'btn btn-danger btn-sm btn-block' | |
|
92 | 82 | %br/ |
|
93 | 83 | = link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '} |
|
94 | 84 | = link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '} |
You need to be logged in to leave comments.
Login now