Description:
change login box
fix add user, delete user
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r679:043258f318f9 - - 11 files changed: 55 inserted, 38 deleted
@@ -0,0 +1,7 | |||
|
1 | + %h1 New user | |
|
2 | + = form_tag( {action: 'create'}, { class: 'form-horizontal'}) do | |
|
3 | + = render :partial => 'form' | |
|
4 | + .form-group | |
|
5 | + .col-md-offset-2.col-md-10 | |
|
6 | + = submit_tag "Create", class: 'btn btn-primary' | |
|
7 | + = link_to 'Back', :action => 'index' |
@@ -537,12 +537,18 | |||
|
537 | 537 | background: #f5f5f5; |
|
538 | 538 | padding: 5px; |
|
539 | 539 | margin: 10px 0; |
|
540 | 540 | font-size: 12px; |
|
541 | 541 | line-height: 1.5em; |
|
542 | 542 | } |
|
543 | 543 | } |
|
544 | 544 | |
|
545 | 545 | h2.contest-title { |
|
546 | 546 | margin-top: 5px; |
|
547 | 547 | margin-bottom: 5px; |
|
548 | 548 | } |
|
549 | + | |
|
550 | + | |
|
551 | + | |
|
552 | + .grader-comment { | |
|
553 | + word-wrap: break-word; | |
|
554 | + } |
@@ -6,25 +6,25 | |||
|
6 | 6 | <p> |
|
7 | 7 | <b>Title:</b> |
|
8 | 8 | <%=h @announcement.title %> |
|
9 | 9 | </p> |
|
10 | 10 | |
|
11 | 11 | <p> |
|
12 | 12 | <b>Notes:</b> |
|
13 | 13 | <%=h @announcement.notes %> |
|
14 | 14 | </p> |
|
15 | 15 | |
|
16 | 16 | <p> |
|
17 | 17 | <b>Body:</b> |
|
18 | - <%=h @announcement.body %> | |
|
18 | + <%=h markdown(@announcement.body) %> | |
|
19 | 19 | </p> |
|
20 | 20 | |
|
21 | 21 | <p> |
|
22 | 22 | <b>Published:</b> |
|
23 | 23 | <%=h @announcement.published %> |
|
24 | 24 | </p> |
|
25 | 25 | |
|
26 | 26 | <p> |
|
27 | 27 | <b>Show on front page:</b> |
|
28 | 28 | <%=h @announcement.frontpage %> |
|
29 | 29 | </p> |
|
30 | 30 |
@@ -3,37 +3,41 | |||
|
3 | 3 | |
|
4 | 4 | - if !@hidelogin |
|
5 | 5 | =t 'login.message' |
|
6 | 6 | %br/ |
|
7 | 7 | %br/ |
|
8 | 8 | |
|
9 | 9 | - if flash[:notice] |
|
10 | 10 | %hr/ |
|
11 | 11 | %b= flash[:notice] |
|
12 | 12 | %hr/ |
|
13 | 13 | |
|
14 | 14 | %div{ :style => "border: solid 1px gray; padding: 4px; background: #eeeeff;"} |
|
15 | - = form_tag login_login_path do | |
|
16 | - %table | |
|
17 | - %tr | |
|
18 | - %td{:align => "right"} | |
|
19 | - ="#{t 'login_label'}:" | |
|
20 | - %td= text_field_tag 'login' | |
|
21 | - %tr | |
|
22 | - %td{:align => "right"} | |
|
23 | - ="#{t 'password_label'}:" | |
|
24 | - %td= password_field_tag | |
|
25 | - - unless GraderConfiguration['right.bypass_agreement'] | |
|
26 | - %tr | |
|
27 | - %td{:align => "right"}= check_box_tag 'accept_agree' | |
|
28 | - %td ยอมรับข้อตกลงการใช้งาน | |
|
29 | - | |
|
30 | - = submit_tag t('login.login_submit') | |
|
15 | + = form_tag login_login_path, {class: 'form-horizontal'} do | |
|
16 | + .form-group | |
|
17 | + =label_tag :login, "Login",class: 'col-sm-3 control-label' | |
|
18 | + .col-sm-9 | |
|
19 | + =text_field_tag :login, nil, class: 'form-control' | |
|
20 | + .form-group | |
|
21 | + =label_tag :password, "Password", class: 'col-sm-3 control-label' | |
|
22 | + .col-sm-9 | |
|
23 | + =password_field_tag :password, nil, class: 'form-control' | |
|
24 | + - unless GraderConfiguration['right.bypass_agreement'] | |
|
25 | + .form-group | |
|
26 | + .col-sm-offset-3.col-sm-9 | |
|
27 | + .checkbox | |
|
28 | + %label | |
|
29 | + = check_box_tag 'accept_agree' | |
|
30 | + ยอมรับข้อตกลงการใช้งาน | |
|
31 | + | |
|
32 | + .form-group | |
|
33 | + .col-sm-offset-3.col-sm-9 | |
|
34 | + = submit_tag t('login.login_submit'), class: 'btn btn-primary' | |
|
31 | 35 | %br/ |
|
32 | 36 | |
|
33 | 37 | - if GraderConfiguration['system.online_registration'] |
|
34 | 38 | =t 'login.participation' |
|
35 | 39 | %b |
|
36 | 40 | = "#{t 'login.please'} " |
|
37 | 41 | = link_to "#{t 'login.register'}", :controller => :users, :action => :new |
|
38 | 42 | %br/ |
|
39 | 43 | = link_to "#{t 'login.forget_password'}", :controller => :users, :action => :forget |
@@ -2,21 +2,21 | |||
|
2 | 2 | %td |
|
3 | 3 | - if @current_user and @current_user.admin? |
|
4 | 4 | = link_to problem.name, stat_problem_path(problem) |
|
5 | 5 | - else |
|
6 | 6 | = "#{problem.name}" |
|
7 | 7 | %td |
|
8 | 8 | = "#{problem.full_name}" |
|
9 | 9 | |
|
10 | 10 | %br |
|
11 | 11 | = link_to_description_if_any "[#{t 'main.problem_desc'}] <span class='glyphicon glyphicon-file'></span>".html_safe, problem |
|
12 | 12 | %td |
|
13 | 13 | = @prob_submissions[problem.id][:count] |
|
14 | - = link_to "[subs]", main_submission_path(problem.id) | |
|
14 | + -#= link_to "[subs]", main_submission_path(problem.id) | |
|
15 | 15 | %td |
|
16 | 16 | = render :partial => 'submission_short', |
|
17 | 17 | :locals => {:submission => @prob_submissions[problem.id][:submission], :problem_name => problem.name, :problem_id => problem.id } |
|
18 | 18 | %td |
|
19 | 19 | - if @prob_submissions[problem.id][:submission] |
|
20 | 20 | = link_to 'Edit', edit_submission_path(@prob_submissions[problem.id][:submission]), class: 'btn btn-success' |
|
21 | 21 | - else |
|
22 | 22 | = link_to 'New', direct_edit_problem_submissions_path(problem.id), class: 'btn btn-success' |
@@ -4,25 +4,25 | |||
|
4 | 4 | - else |
|
5 | 5 | - unless submission.graded_at |
|
6 | 6 | = t 'main.submitted_at' |
|
7 | 7 | = format_short_time(submission.submitted_at.localtime) |
|
8 | 8 | - else |
|
9 | 9 | %strong= t 'main.graded_at' |
|
10 | 10 | = "#{format_short_time(submission.graded_at.localtime)} " |
|
11 | 11 | %br |
|
12 | 12 | - if GraderConfiguration['ui.show_score'] |
|
13 | 13 | %strong=t 'main.score' |
|
14 | 14 | = "#{(submission.points*100/submission.problem.full_score).to_i} " |
|
15 | 15 | = " [" |
|
16 | - %tt | |
|
16 | + %tt.grader-comment | |
|
17 | 17 | = submission.grader_comment |
|
18 | 18 | = "]" |
|
19 | 19 | %br |
|
20 | 20 | %strong View: |
|
21 | 21 | - if GraderConfiguration.show_grading_result |
|
22 | 22 | = link_to '[detailed result]', :action => 'result', :id => submission.id |
|
23 | 23 | /= link_to "#{t 'main.cmp_msg'}", {:action => 'compiler_msg', :id => submission.id}, {popup: true,class: 'btn btn-xs btn-info'} |
|
24 | 24 | = link_to "#{t 'main.cmp_msg'}", compiler_msg_submission_path(submission.id), {popup: true,remote: true,class: 'btn btn-xs btn-info'} |
|
25 | 25 | = link_to "#{t 'main.src_link'}",{:action => 'source', :id => submission.id}, class: 'btn btn-xs btn-info' |
|
26 | 26 | = link_to "#{t 'main.submissions_link'}", problem_submissions_path(problem_id), class: 'btn btn-xs btn-info' |
|
27 | 27 | - if GraderConfiguration.show_testcase |
|
28 | 28 | = link_to "testcases", show_problem_testcases_path(problem_id), class: 'btn btn-xs btn-info' |
@@ -1,12 +1,11 | |||
|
1 | 1 | %h1= GraderConfiguration['ui.front.title'] |
|
2 | 2 | |
|
3 | - %table | |
|
4 | - %tr | |
|
5 | - %td | |
|
6 | - - if @announcements.length!=0 | |
|
7 | - .announcementbox{:style => 'margin-top: 0px'} | |
|
8 | - %span{:class => 'title'} | |
|
9 | - Announcements | |
|
10 | - = render :partial => 'announcement', :collection => @announcements | |
|
11 | - %td{:style => 'vertical-align: top; width: 40%; padding-left: 20px;'} | |
|
12 | - = render :partial => 'login_box' | |
|
3 | + .row | |
|
4 | + .col-md-6 | |
|
5 | + - if @announcements.length!=0 | |
|
6 | + .announcementbox{:style => 'margin-top: 0px'} | |
|
7 | + %span{:class => 'title'} | |
|
8 | + Announcements | |
|
9 | + = render :partial => 'announcement', :collection => @announcements | |
|
10 | + .col-md-4{style: "padding-left: 20px;"} | |
|
11 | + = render :partial => 'login_box' |
@@ -1,31 +1,38 | |||
|
1 | 1 | = error_messages_for 'user' |
|
2 | 2 | / [form:user] |
|
3 | 3 | .form-group |
|
4 | 4 | %label.col-md-2.control-label{for: :login} Login |
|
5 | 5 | .col-md-4 |
|
6 | 6 | = text_field 'user', 'login', class: 'form-control' |
|
7 | + .col-md-6 | |
|
7 | 8 | .form-group |
|
8 | 9 | %label.col-md-2.control-label{for: :full_name} Full name |
|
9 | 10 | .col-md-4 |
|
10 | 11 | = text_field 'user', 'full_name', class: 'form-control' |
|
12 | + .col-md-6 | |
|
11 | 13 | .form-group |
|
12 | 14 | %label.col-md-2.control-label{for: :password} Password |
|
13 | 15 | .col-md-4 |
|
14 | 16 | = password_field 'user', 'password', class: 'form-control' |
|
17 | + .col-md-6 | |
|
15 | 18 | .form-group |
|
16 | 19 | %label.col-md-2.control-label{for: :password_confirmation} Password (confirm) |
|
17 | 20 | .col-md-4 |
|
18 | 21 | = password_field 'user', 'password_confirmation', class: 'form-control' |
|
22 | + .col-md-6 | |
|
19 | 23 | .form-group |
|
20 | 24 | %label.col-md-2.control-label{for: :email} E-mail |
|
21 | 25 | .col-md-4 |
|
22 | 26 | = email_field 'user', 'email', class: 'form-control' |
|
27 | + .col-md-6 | |
|
23 | 28 | .form-group |
|
24 | 29 | %label.col-md-2.control-label{for: :alias} Alias |
|
25 | 30 | .col-md-4 |
|
26 | 31 | = text_field 'user', 'alias', class: 'form-control' |
|
32 | + .col-md-6 | |
|
27 | 33 | .form-group |
|
28 | 34 | %label.col-md-2.control-label{for: :remark} Remark |
|
29 | 35 | .col-md-4 |
|
30 | 36 | = text_field 'user', 'remark', class: 'form-control' |
|
37 | + .col-md-6 | |
|
31 | 38 | / [eoform:user] |
@@ -86,16 +86,16 | |||
|
86 | 86 | - for user in @users |
|
87 | 87 | %tr |
|
88 | 88 | %td= link_to user.login, stat_user_path(user) |
|
89 | 89 | %td= user.full_name |
|
90 | 90 | %td= user.email |
|
91 | 91 | %td= user.remark |
|
92 | 92 | %td= toggle_button(user.activated?, toggle_activate_user_path(user),"toggle_activate_user_#{user.id}") |
|
93 | 93 | %td= toggle_button(user.enabled?, toggle_enable_user_path(user),"toggle_enable_user_#{user.id}") |
|
94 | 94 | %td= user.last_ip |
|
95 | 95 | %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-default btn-xs btn-block' |
|
96 | 96 | %td= link_to 'Show', {:action => 'show', :id => user}, class: 'btn btn-default btn-xs btn-block' |
|
97 | 97 | %td= link_to 'Edit', {:action => 'edit', :id => user}, class: 'btn btn-default btn-xs btn-block' |
|
98 |
- %td= link_to 'Destroy', |
|
|
98 | + %td= link_to 'Destroy', user_admin_destroy_path(user), data: {confirm: 'Are you sure?'}, method: :delete, class: 'btn btn-danger btn-xs btn-block' | |
|
99 | 99 | %br/ |
|
100 | 100 | = link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '} |
|
101 | 101 | = link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '} |
@@ -71,24 +71,26 | |||
|
71 | 71 | get 'get_latest_submission_status/:uid/:pid', to: 'submissions#get_latest_submission_status', as: 'get_latest_submission_status' |
|
72 | 72 | end |
|
73 | 73 | end |
|
74 | 74 | |
|
75 | 75 | |
|
76 | 76 | |
|
77 | 77 | #main |
|
78 | 78 | get "main/list" |
|
79 | 79 | get 'main/submission(/:id)', to: 'main#submission', as: 'main_submission' |
|
80 | 80 | |
|
81 | 81 | #user admin |
|
82 | 82 | get 'user_admin/bulk_manage', to: 'user_admin#bulk_manage', as: 'bulk_manage_user_admin' |
|
83 | + post 'user_admin', to: 'user_admin#create' | |
|
84 | + delete 'user_admin/:id', to: 'user_admin#destroy', as: 'user_admin_destroy' | |
|
83 | 85 | |
|
84 | 86 | #report |
|
85 | 87 | get 'report/current_score', to: 'report#current_score', as: 'report_current_score' |
|
86 | 88 | get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof' |
|
87 | 89 | get "report/login" |
|
88 | 90 | get 'report/max_score', to: 'report#max_score', as: 'report_max_score' |
|
89 | 91 | post 'report/show_max_score', to: 'report#show_max_score', as: 'report_show_max_score' |
|
90 | 92 | |
|
91 | 93 | |
|
92 | 94 | # |
|
93 | 95 | get 'tasks/view/:file.:ext' => 'tasks#view' |
|
94 | 96 | get 'tasks/download/:id/:file.:ext' => 'tasks#download' |
deleted file |
You need to be logged in to leave comments.
Login now