Description:
announcement
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r868:826ade30ee35 - - 5 files changed: 45 inserted, 28 deleted
@@ -40,6 +40,7 | |||
|
40 | 40 | |
|
41 | 41 | //new import |
|
42 | 42 | @import 'datatables/datatables.min'; |
|
43 | + @import 'material_icons'; | |
|
43 | 44 | |
|
44 | 45 | //bootstrap navbar color (from) |
|
45 | 46 | $bgDefault: #19197b; |
@@ -65,7 +65,7 | |||
|
65 | 65 | @announcement = Announcement.find(params[:id]) |
|
66 | 66 | |
|
67 | 67 | respond_to do |format| |
|
68 |
- if @announcement.update |
|
|
68 | + if @announcement.update(announcement_params) | |
|
69 | 69 | flash[:notice] = 'Announcement was successfully updated.' |
|
70 | 70 | format.html { redirect_to(@announcement) } |
|
71 | 71 | format.js {} |
@@ -80,7 +80,7 | |||
|
80 | 80 | |
|
81 | 81 | def toggle |
|
82 | 82 | @announcement = Announcement.find(params[:id]) |
|
83 |
- @announcement.update |
|
|
83 | + @announcement.update( published: !@announcement.published? ) | |
|
84 | 84 | respond_to do |format| |
|
85 | 85 | format.js { render partial: 'toggle_button', |
|
86 | 86 | locals: {button_id: "#announcement_toggle_#{@announcement.id}",button_on: @announcement.published? } } |
@@ -70,13 +70,18 | |||
|
70 | 70 | - @nav_announcement.each do |ann| |
|
71 | 71 | %p.navbar-text |
|
72 | 72 | = ann.body.html_safe |
|
73 | - | |
|
74 | - | |
|
75 | - | |
|
76 | - %ul.nav.navbar-nav.navbar-right | |
|
77 | - = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') | |
|
78 | - = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'index', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}}) | |
|
79 | - - if GraderConfiguration['system.user_setting_enabled'] | |
|
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'}}) | |
|
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'}}) | |
|
82 | - | |
|
73 | + %ul.navbar-nav | |
|
74 | + %li.nav-item | |
|
75 | + %a.nav-link{href: help_main_path} | |
|
76 | + %span.mi.md-18 help | |
|
77 | + %li.nav-item | |
|
78 | + %a.nav-link{href: messages_path} | |
|
79 | + %span.mi.md-18 chat | |
|
80 | + - if GraderConfiguration['system.user_setting_enabled'] | |
|
81 | + %li.nav-item | |
|
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 | |
|
2 | - %strong | |
|
1 | + .card-body | |
|
2 | + .card-title | |
|
3 | 3 | = announcement.title |
|
4 | - - if @current_user and @current_user.admin? | |
|
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})" | |
|
4 | + - if @current_user and @current_user.admin? | |
|
5 | + = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-xs btn-default' | |
|
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 | |
|
9 | - = markdown(announcement.body) | |
|
10 | - :javascript | |
|
11 | - Announcement.updateRecentId(#{announcement.id}); | |
|
12 | - - if (defined? announcement_effect) and announcement_effect | |
|
12 | + -# | |
|
13 | + %li.list-group-item | |
|
14 | + %strong | |
|
15 | + - if @current_user and @current_user.admin? | |
|
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 | 21 | :javascript |
|
14 | - $("announcement-#{announcement.id}").blindDown({duration: 0.2}); | |
|
15 | - $("announcement-#{announcement.id}").appear({duration: 0.5, queue: 'end'}); | |
|
22 | + Announcement.updateRecentId(#{announcement.id}); | |
|
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'}); |
@@ -44,11 +44,11 | |||
|
44 | 44 | %th |
|
45 | 45 | = render :partial => 'problem', :collection => cp[:problems] |
|
46 | 46 | .col-md-5 |
|
47 | - .panel.panel-info | |
|
48 |
- . |
|
|
47 | + .card | |
|
48 | + .card-header | |
|
49 | 49 | Announcement |
|
50 |
- = link_to 'Manage', announcements_path, class: 'btn btn- |
|
|
51 | - %ul.list-group | |
|
50 | + = link_to 'Manage', announcements_path, class: 'btn btn-small' | |
|
51 | + .card-body | |
|
52 | 52 | = render :partial => 'announcement', :collection => @announcements |
|
53 | 53 | |
|
54 | 54 | %script{:type => 'text/javascript'} |
You need to be logged in to leave comments.
Login now