Description:
use jquery by default
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r554:50143f71e61a - - 12 files changed: 95 inserted, 50 deleted
@@ -0,0 +1,35 | |||||
|
|
1 | + %header.navbar.navbar-default.navbar-fixed-top | ||
|
|
2 | + %nav | ||
|
|
3 | + .container-fluid | ||
|
|
4 | + .navbar-header | ||
|
|
5 | + %a.navbar-brand{href: main_list_path} หน้าหลัก | ||
|
|
6 | + .collapse.navbar-collapse | ||
|
|
7 | + %ul.nav.navbar-nav | ||
|
|
8 | + - if (@current_user!=nil) and (GraderConfiguration.show_tasks_to?(@current_user)) | ||
|
|
9 | + = add_menu("#{I18n.t 'menu.tasks'}", 'tasks', 'list') | ||
|
|
10 | + = add_menu("#{I18n.t 'menu.submissions'}", 'main', 'submission') | ||
|
|
11 | + = add_menu("#{I18n.t 'menu.test'}", 'test', 'index') | ||
|
|
12 | + - if GraderConfiguration['right.user_hall_of_fame'] | ||
|
|
13 | + = add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof') | ||
|
|
14 | + %ul.nav.navbar-nav.navbar-right | ||
|
|
15 | + = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') | ||
|
|
16 | + = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'list', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}}) | ||
|
|
17 | + - if GraderConfiguration['system.user_setting_enabled'] | ||
|
|
18 | + = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog')}".html_safe, 'users', 'index', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}}) | ||
|
|
19 | + = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-log-out')} #{@current_user.full_name}".html_safe, 'main', 'login', {title: I18n.t('menu.log_out'), data: {toggle: 'tooltip'}}) | ||
|
|
20 | + | ||
|
|
21 | + - if (@current_user!=nil) and (session[:admin]) | ||
|
|
22 | + %nav.navbar.navbar-default.navbar-fixed-top.navbar-inverse.secondnavbar | ||
|
|
23 | + .container-fluid | ||
|
|
24 | + .collapse.navbar-collapse | ||
|
|
25 | + %ul.nav.navbar-nav | ||
|
|
26 | + = add_menu( '[Announcements]', 'announcements', 'index') | ||
|
|
27 | + = add_menu( '[Msg console]', 'messages', 'console') | ||
|
|
28 | + = add_menu( '[Problems]', 'problems', 'index') | ||
|
|
29 | + = add_menu( '[Users]', 'user_admin', 'index') | ||
|
|
30 | + = add_menu( '[Results]', 'user_admin', 'user_stat') | ||
|
|
31 | + = add_menu( '[Report]', 'report', 'multiple_login') | ||
|
|
32 | + = add_menu( '[Graders]', 'graders', 'list') | ||
|
|
33 | + = add_menu( '[Contests]', 'contest_management', 'index') | ||
|
|
34 | + = add_menu( '[Sites]', 'sites', 'index') | ||
|
|
35 | + = add_menu( '[System config]', 'configurations', 'index') |
@@ -0,0 +1,6 | |||||
|
|
1 | + = form_tag({:action => 'submit'}, :multipart => true) do | ||
|
|
2 | + %b Problem: | ||
|
|
3 | + = select 'submission', 'problem_id', [[(t 'main.specified_in_header'),'-1']] + @problems.collect {|p| [p.full_name, p.id]}, {:selected => '-1'}, { class: 'select2' } | ||
|
|
4 | + %b File: | ||
|
|
5 | + = file_field_tag 'file' | ||
|
|
6 | + = submit_tag 'Submit' |
@@ -2,6 +2,8 | |||||
|
2 |
|
2 | ||
|
3 | gem 'rails', '3.2.21' |
|
3 | gem 'rails', '3.2.21' |
|
4 |
|
4 | ||
|
|
5 | + gem 'select2-rails' | ||
|
|
6 | + | ||
|
5 | # Bundle edge Rails instead: |
|
7 | # Bundle edge Rails instead: |
|
6 | # gem 'rails', :git => 'git://github.com/rails/rails.git' |
|
8 | # gem 'rails', :git => 'git://github.com/rails/rails.git' |
|
7 |
|
9 |
@@ -135,6 +135,8 | |||||
|
135 | railties (~> 3.2.0) |
|
135 | railties (~> 3.2.0) |
|
136 | sass (>= 3.1.10) |
|
136 | sass (>= 3.1.10) |
|
137 | tilt (~> 1.3) |
|
137 | tilt (~> 1.3) |
|
|
138 | + select2-rails (4.0.1) | ||
|
|
139 | + thor (~> 0.14) | ||
|
138 | sprockets (2.2.3) |
|
140 | sprockets (2.2.3) |
|
139 | hike (~> 1.2) |
|
141 | hike (~> 1.2) |
|
140 | multi_json (~> 1.0) |
|
142 | multi_json (~> 1.0) |
@@ -176,6 +178,7 | |||||
|
176 | rouge |
|
178 | rouge |
|
177 | rspec-rails (~> 2.99.0) |
|
179 | rspec-rails (~> 2.99.0) |
|
178 | sass-rails (~> 3.2.6) |
|
180 | sass-rails (~> 3.2.6) |
|
|
181 | + select2-rails | ||
|
179 | test-unit |
|
182 | test-unit |
|
180 | uglifier |
|
183 | uglifier |
|
181 | verification! |
|
184 | verification! |
@@ -10,9 +10,17 | |||||
|
10 | // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
|
10 | // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
|
11 | // GO AFTER THE REQUIRES BELOW. |
|
11 | // GO AFTER THE REQUIRES BELOW. |
|
12 | // |
|
12 | // |
|
13 |
- //= require |
|
13 | + //= require jquery |
|
14 |
- //= require |
|
14 | + //= require jquery_ujs |
|
15 | - //= require effects |
|
15 | + //= require jquery.ui.all |
|
16 | - //= require dragdrop |
|
||
|
17 | - //= require controls |
|
||
|
18 | //= require bootstrap-sprockets |
|
16 | //= require bootstrap-sprockets |
|
|
17 | + //= require custom | ||
|
|
18 | + //= require select2 | ||
|
|
19 | + | ||
|
|
20 | + | ||
|
|
21 | + // since this is after blank line, it is not downloaded | ||
|
|
22 | + //x= require prototype | ||
|
|
23 | + //x= require prototype_ujs | ||
|
|
24 | + //x= require effects | ||
|
|
25 | + //x= require dragdrop | ||
|
|
26 | + //x= require controls |
@@ -10,11 +10,13 | |||||
|
10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new |
|
10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new |
|
11 | * file per style scope. |
|
11 | * file per style scope. |
|
12 | * |
|
12 | * |
|
13 | - *= require_tree . |
|
13 | + // bootstrap says that we should not do this, but @import each file instead |
|
14 |
- *= require_ |
|
14 | + # *= require_tree . |
|
|
15 | + # *= require_self | ||
|
15 | */ |
|
16 | */ |
|
16 |
|
17 | ||
|
17 | - |
|
18 | + @import jquery.ui.all |
|
|
19 | + @import jquery.ui.core | ||
|
18 | @import jquery.ui.core |
|
20 | @import jquery.ui.core |
|
19 | @import jquery.ui.theme |
|
21 | @import jquery.ui.theme |
|
20 | @import jquery.ui.datepicker |
|
22 | @import jquery.ui.datepicker |
@@ -23,17 +25,18 | |||||
|
23 | @import jquery-tablesorter/theme.metro-dark |
|
25 | @import jquery-tablesorter/theme.metro-dark |
|
24 | @import tablesorter-theme.cafe |
|
26 | @import tablesorter-theme.cafe |
|
25 |
|
27 | ||
|
26 | - |
|
28 | + @import bootstrap-sprockets |
|
27 |
- @import |
|
29 | + @import bootstrap |
|
28 | - @import "bootstrap" |
|
30 | + @import select2 |
|
|
31 | + @import select2-bootstrap | ||
|
29 |
|
32 | ||
|
30 | .secondnavbar |
|
33 | .secondnavbar |
|
31 | top: 50px |
|
34 | top: 50px |
|
32 |
|
35 | ||
|
33 | body |
|
36 | body |
|
34 | background: white image-url("topbg.jpg") repeat-x top center |
|
37 | background: white image-url("topbg.jpg") repeat-x top center |
|
35 |
- |
|
38 | + //font-size: 13px |
|
36 |
- |
|
39 | + //font-family: Tahoma, "sans-serif" |
|
37 | margin: 10px |
|
40 | margin: 10px |
|
38 | padding: 10px |
|
41 | padding: 10px |
|
39 | padding-top: 100px |
|
42 | padding-top: 100px |
@@ -1,9 +1,16 | |||||
|
1 | class ApplicationController < ActionController::Base |
|
1 | class ApplicationController < ActionController::Base |
|
2 | protect_from_forgery |
|
2 | protect_from_forgery |
|
3 |
|
3 | ||
|
|
4 | + before_filter :current_user | ||
|
|
5 | + | ||
|
4 | SINGLE_USER_MODE_CONF_KEY = 'system.single_user_mode' |
|
6 | SINGLE_USER_MODE_CONF_KEY = 'system.single_user_mode' |
|
5 | MULTIPLE_IP_LOGIN_CONF_KEY = 'right.multiple_ip_login' |
|
7 | MULTIPLE_IP_LOGIN_CONF_KEY = 'right.multiple_ip_login' |
|
6 |
|
8 | ||
|
|
9 | + # Returns the current logged-in user (if any). | ||
|
|
10 | + def current_user | ||
|
|
11 | + @current_user ||= User.find(session[:user_id]) | ||
|
|
12 | + end | ||
|
|
13 | + | ||
|
7 | def admin_authorization |
|
14 | def admin_authorization |
|
8 | return false unless authenticate |
|
15 | return false unless authenticate |
|
9 | user = User.find(session[:user_id], :include => ['roles']) |
|
16 | user = User.find(session[:user_id], :include => ['roles']) |
@@ -15,14 +15,14 | |||||
|
15 | if GraderConfiguration['right.user_hall_of_fame'] |
|
15 | if GraderConfiguration['right.user_hall_of_fame'] |
|
16 | left_menu << add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof') |
|
16 | left_menu << add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof') |
|
17 | end |
|
17 | end |
|
18 | - left_menu << add_menu("#{I18n.t 'menu.help'}", 'main', 'help') |
|
||
|
19 | - |
|
||
|
20 |
|
18 | ||
|
21 |
- right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon- |
|
19 | + right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') |
|
|
20 | + right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'list', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}}) | ||
|
22 | if GraderConfiguration['system.user_setting_enabled'] |
|
21 | if GraderConfiguration['system.user_setting_enabled'] |
|
23 |
- right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog')} |
|
22 | + right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog')}".html_safe, 'users', 'index', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}}) |
|
24 | end |
|
23 | end |
|
25 |
- right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-log-out')} #{ |
|
24 | + right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-log-out')} #{user.full_name}".html_safe, 'main', 'login', {title: I18n.t('menu.log_out'), data: {toggle: 'tooltip'}}) |
|
|
25 | + | ||
|
26 |
|
26 | ||
|
27 | result = content_tag(:ul,left_menu.html_safe,class: 'nav navbar-nav') + content_tag(:ul,right_menu.html_safe,class: 'nav navbar-nav navbar-right') |
|
27 | result = content_tag(:ul,left_menu.html_safe,class: 'nav navbar-nav') + content_tag(:ul,right_menu.html_safe,class: 'nav navbar-nav navbar-right') |
|
28 | end |
|
28 | end |
@@ -9,22 +9,7 | |||||
|
9 | = yield :head |
|
9 | = yield :head |
|
10 |
|
10 | ||
|
11 | %body |
|
11 | %body |
|
12 | - %nav.navbar.navbar-default.navbar-fixed-top |
|
12 | + = render 'layouts/header' |
|
13 | - .container-fluid |
|
||
|
14 | - .navbar-header |
|
||
|
15 | - %a.navbar-brand{href: main_list_path} หน้าหลัก |
|
||
|
16 | - .collapse.navbar-collapse |
|
||
|
17 | - = navbar_user_header #call helper function |
|
||
|
18 | - %nav.navbar.navbar-default.navbar-fixed-top.navbar-inverse.secondnavbar |
|
||
|
19 | - .container-fluid |
|
||
|
20 | - .collapse.navbar-collapse |
|
||
|
21 | - %ul.nav.navbar-nav |
|
||
|
22 | - %li |
|
||
|
23 | - %a{href:'#'}hahaha |
|
||
|
24 | - |
|
||
|
25 | - %div.userbar |
|
||
|
26 | - = user_header |
|
||
|
27 |
|
13 | ||
|
28 | = content_tag(:p,flash[:notice],:style => "color:green") if flash[:notice]!=nil |
|
14 | = content_tag(:p,flash[:notice],:style => "color:green") if flash[:notice]!=nil |
|
29 | = yield |
|
15 | = yield |
|
30 | - |
|
@@ -22,14 +22,16 | |||||
|
22 |
|
22 | ||
|
23 | - if GraderConfiguration.show_tasks_to?(@user) |
|
23 | - if GraderConfiguration.show_tasks_to?(@user) |
|
24 | - if not GraderConfiguration.multicontests? |
|
24 | - if not GraderConfiguration.multicontests? |
|
25 | - %table.info |
|
25 | + %table.table.table-striped |
|
26 |
- %t |
|
26 | + %thead |
|
27 | - %th |
|
27 | + %tr.info-head |
|
28 |
- %th |
|
28 | + %th # |
|
29 |
- %th |
|
29 | + %th Tasks name |
|
30 | - %th # of sub(s) |
|
30 | + %th Full name |
|
31 |
- %th |
|
31 | + %th # of sub(s) |
|
32 | - = render :partial => 'problem', :collection => @problems |
|
32 | + %th Results |
|
|
33 | + %tbody | ||
|
|
34 | + = render :partial => 'problem', :collection => @problems | ||
|
33 | - else |
|
35 | - else |
|
34 | - @contest_problems.each do |cp| |
|
36 | - @contest_problems.each do |cp| |
|
35 | - if cp[:problems].length > 0 |
|
37 | - if cp[:problems].length > 0 |
deleted file |
You need to be logged in to leave comments.
Login now