Description:
announcement
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r868:826ade30ee35 - - 5 files changed: 45 inserted, 28 deleted

@@ -31,24 +31,25
31 @import "select2/select2-bootstrap-5-theme.min";
31 @import "select2/select2-bootstrap-5-theme.min";
32
32
33 //@import bootstrap3-switch
33 //@import bootstrap3-switch
34 //@import "bootstrap-toggle";
34 //@import "bootstrap-toggle";
35 //@import "bootstrap-sortable";
35 //@import "bootstrap-sortable";
36 //@import "bootstrap-datepicker3";
36 //@import "bootstrap-datepicker3";
37 //@import "bootstrap-datetimepicker";
37 //@import "bootstrap-datetimepicker";
38 //@import "datatables.net-bs/css/dataTables.bootstrap.min";
38 //@import "datatables.net-bs/css/dataTables.bootstrap.min";
39 //@import "datatables.net-buttons-bs/css/buttons.bootstrap.min";
39 //@import "datatables.net-buttons-bs/css/buttons.bootstrap.min";
40
40
41 //new import
41 //new import
42 @import 'datatables/datatables.min';
42 @import 'datatables/datatables.min';
43 + @import 'material_icons';
43
44
44 //bootstrap navbar color (from)
45 //bootstrap navbar color (from)
45 $bgDefault: #19197b;
46 $bgDefault: #19197b;
46 $bgHighlight: #06064b;
47 $bgHighlight: #06064b;
47 $colDefault: #8e8eb4;
48 $colDefault: #8e8eb4;
48 $colHighlight: #ffffff;
49 $colHighlight: #ffffff;
49 $dropDown: false;
50 $dropDown: false;
50
51
51 @font-face {
52 @font-face {
52 font-family: 'Glyphicons Halflings';
53 font-family: 'Glyphicons Halflings';
53 src: font-path('bootstrap/glyphicons-halflings-regular.eot');
54 src: font-path('bootstrap/glyphicons-halflings-regular.eot');
54 src: font-path('bootstrap/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
55 src: font-path('bootstrap/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
@@ -56,40 +56,40
56 format.html { render :action => "new" }
56 format.html { render :action => "new" }
57 format.xml { render :xml => @announcement.errors, :status => :unprocessable_entity }
57 format.xml { render :xml => @announcement.errors, :status => :unprocessable_entity }
58 end
58 end
59 end
59 end
60 end
60 end
61
61
62 # PUT /announcements/1
62 # PUT /announcements/1
63 # PUT /announcements/1.xml
63 # PUT /announcements/1.xml
64 def update
64 def update
65 @announcement = Announcement.find(params[:id])
65 @announcement = Announcement.find(params[:id])
66
66
67 respond_to do |format|
67 respond_to do |format|
68 - if @announcement.update_attributes(announcement_params)
68 + if @announcement.update(announcement_params)
69 flash[:notice] = 'Announcement was successfully updated.'
69 flash[:notice] = 'Announcement was successfully updated.'
70 format.html { redirect_to(@announcement) }
70 format.html { redirect_to(@announcement) }
71 format.js {}
71 format.js {}
72 format.xml { head :ok }
72 format.xml { head :ok }
73 else
73 else
74 format.html { render :action => "edit" }
74 format.html { render :action => "edit" }
75 format.js {}
75 format.js {}
76 format.xml { render :xml => @announcement.errors, :status => :unprocessable_entity }
76 format.xml { render :xml => @announcement.errors, :status => :unprocessable_entity }
77 end
77 end
78 end
78 end
79 end
79 end
80
80
81 def toggle
81 def toggle
82 @announcement = Announcement.find(params[:id])
82 @announcement = Announcement.find(params[:id])
83 - @announcement.update_attributes( published: !@announcement.published? )
83 + @announcement.update( published: !@announcement.published? )
84 respond_to do |format|
84 respond_to do |format|
85 format.js { render partial: 'toggle_button',
85 format.js { render partial: 'toggle_button',
86 locals: {button_id: "#announcement_toggle_#{@announcement.id}",button_on: @announcement.published? } }
86 locals: {button_id: "#announcement_toggle_#{@announcement.id}",button_on: @announcement.published? } }
87 end
87 end
88 end
88 end
89
89
90 def toggle_front
90 def toggle_front
91 @announcement = Announcement.find(params[:id])
91 @announcement = Announcement.find(params[:id])
92 @announcement.update_attributes( frontpage: !@announcement.frontpage? )
92 @announcement.update_attributes( frontpage: !@announcement.frontpage? )
93 respond_to do |format|
93 respond_to do |format|
94 format.js { render partial: 'toggle_button',
94 format.js { render partial: 'toggle_button',
95 locals: {button_id: "#announcement_toggle_front_#{@announcement.id}",button_on: @announcement.frontpage? } }
95 locals: {button_id: "#announcement_toggle_front_#{@announcement.id}",button_on: @announcement.frontpage? } }
@@ -61,22 +61,27
61 %li= link_to 'Current Score', current_score_report_path, class: 'dropdown-item'
61 %li= link_to 'Current Score', current_score_report_path, class: 'dropdown-item'
62 %li= link_to 'Score Report', max_score_report_path, class: 'dropdown-item'
62 %li= link_to 'Score Report', max_score_report_path, class: 'dropdown-item'
63 %li= link_to 'Submission Report', submission_report_path, class: 'dropdown-item'
63 %li= link_to 'Submission Report', submission_report_path, class: 'dropdown-item'
64 %li= link_to 'Login Report', login_report_path, class: 'dropdown-item'
64 %li= link_to 'Login Report', login_report_path, class: 'dropdown-item'
65 - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0
65 - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0
66 =link_to "#{ungraded} backlogs!",
66 =link_to "#{ungraded} backlogs!",
67 graders_list_path,
67 graders_list_path,
68 class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission'
68 class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission'
69 / announcement
69 / announcement
70 - @nav_announcement.each do |ann|
70 - @nav_announcement.each do |ann|
71 %p.navbar-text
71 %p.navbar-text
72 = ann.body.html_safe
72 = ann.body.html_safe
73 -
73 + %ul.navbar-nav
74 -
74 + %li.nav-item
75 -
75 + %a.nav-link{href: help_main_path}
76 - %ul.nav.navbar-nav.navbar-right
76 + %span.mi.md-18 help
77 - = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help')
77 + %li.nav-item
78 - = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'index', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}})
78 + %a.nav-link{href: messages_path}
79 - - if GraderConfiguration['system.user_setting_enabled']
79 + %span.mi.md-18 chat
80 - = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog', id: 'user_profile')}".html_safe, 'users', 'profile', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}})
80 + - if GraderConfiguration['system.user_setting_enabled']
81 - = 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'}})
81 + %li.nav-item
82 -
82 + %a.nav-link{href: profile_users_path}
83 + %span.mi.md-18 settings
84 + %li.nav-item
85 + %a.nav-link{href: login_main_path}
86 + %span.mi.md-18 exit_to_app
87 + = @current_user.full_name
@@ -1,15 +1,26
1 - %li.list-group-item
1 + .card-body
2 - %strong
2 + .card-title
3 = announcement.title
3 = announcement.title
4 - - if @current_user and @current_user.admin?
4 + - if @current_user and @current_user.admin?
5 - = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-xs btn-default'
5 + = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-xs btn-default'
6 - %small= "(updated #{time_ago_in_words(announcement.updated_at)} ago on #{announcement.updated_at})"
6 + .card-subtitle
7 + = "(updated #{time_ago_in_words(announcement.updated_at)} ago on #{announcement.updated_at})"
8 + .card-text
9 + = markdown(announcement.body)
10 +
7
11
8 - %br
12 + -#
9 - = markdown(announcement.body)
13 + %li.list-group-item
10 - :javascript
14 + %strong
11 - Announcement.updateRecentId(#{announcement.id});
15 + - if @current_user and @current_user.admin?
12 - - if (defined? announcement_effect) and announcement_effect
16 + = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-xs btn-default'
17 + %small= "(updated #{time_ago_in_words(announcement.updated_at)} ago on #{announcement.updated_at})"
18 +
19 + %br
20 + = markdown(announcement.body)
13 :javascript
21 :javascript
14 - $("announcement-#{announcement.id}").blindDown({duration: 0.2});
22 + Announcement.updateRecentId(#{announcement.id});
15 - $("announcement-#{announcement.id}").appear({duration: 0.5, queue: 'end'});
23 + - if (defined? announcement_effect) and announcement_effect
24 + :javascript
25 + $("announcement-#{announcement.id}").blindDown({duration: 0.2});
26 + $("announcement-#{announcement.id}").appear({duration: 0.5, queue: 'end'});
@@ -35,29 +35,29
35 - if cp[:problems].length > 0
35 - if cp[:problems].length > 0
36 %h2{:class =>'contest-title'}
36 %h2{:class =>'contest-title'}
37 = "#{cp[:contest] ? cp[:contest].title : 'Public problems'}"
37 = "#{cp[:contest] ? cp[:contest].title : 'Public problems'}"
38 %table.info
38 %table.info
39 %tr.info-head
39 %tr.info-head
40 %th Task name
40 %th Task name
41 %th Full name
41 %th Full name
42 %th # of sub(s)
42 %th # of sub(s)
43 %th Results
43 %th Results
44 %th
44 %th
45 = render :partial => 'problem', :collection => cp[:problems]
45 = render :partial => 'problem', :collection => cp[:problems]
46 .col-md-5
46 .col-md-5
47 - .panel.panel-info
47 + .card
48 - .panel-heading
48 + .card-header
49 Announcement
49 Announcement
50 - = link_to 'Manage', announcements_path, class: 'btn btn-xs btn-default'
50 + = link_to 'Manage', announcements_path, class: 'btn btn-small'
51 - %ul.list-group
51 + .card-body
52 = render :partial => 'announcement', :collection => @announcements
52 = render :partial => 'announcement', :collection => @announcements
53
53
54 %script{:type => 'text/javascript'}
54 %script{:type => 'text/javascript'}
55 = "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';"
55 = "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';"
56 Announcement.registerRefreshEventTimer();
56 Announcement.registerRefreshEventTimer();
57
57
58 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
58 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
59 .modal-dialog.modal-lg{role:'document'}
59 .modal-dialog.modal-lg{role:'document'}
60 .modal-content
60 .modal-content
61 .modal-header
61 .modal-header
62 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
62 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
63 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
63 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
You need to be logged in to leave comments. Login now