Description:
Merge branch 'master' into codejom (bug fix)
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r227:eda4ffd09089 - - 2 files changed: 14 inserted, 10 deleted
@@ -1,18 +1,17 | |||||
|
1 | - content_for :head do |
|
1 | - content_for :head do |
|
2 | = javascript_include_tag :defaults |
|
2 | = javascript_include_tag :defaults |
|
3 | - %script{:type => 'text/javascript', :src => '/javascripts/announcement_refresh.js'} |
|
3 | + = javascript_include_tag 'announcement_refresh.js' |
|
4 |
|
4 | ||
|
5 | = user_title_bar(@user) |
|
5 | = user_title_bar(@user) |
|
6 |
|
6 | ||
|
7 | - - if @announcements.length!=0 |
|
7 | + .announcementbox{:style => (@announcements.length==0 ? "display:none" : "")} |
|
8 | - .announcementbox |
|
8 | + %span{:class => 'title'} |
|
9 | - %span{:class => 'title'} |
|
9 | + Announcements |
|
10 |
- |
|
10 | + #announcementbox-body |
|
11 | - #announcementbox-body |
|
11 | + = render :partial => 'announcement', :collection => @announcements |
|
12 | - = render :partial => 'announcement', :collection => @announcements |
|
||
|
13 |
|
12 | ||
|
14 | %hr/ |
|
13 | %hr/ |
|
15 |
|
14 | ||
|
16 | - if (Configuration.contest_mode?) and (@user.site!=nil) and (@user.site.started!=true) |
|
15 | - if (Configuration.contest_mode?) and (@user.site!=nil) and (@user.site.started!=true) |
|
17 | %p=t 'main.start_soon' |
|
16 | %p=t 'main.start_soon' |
|
18 |
|
17 |
@@ -15,19 +15,24 | |||||
|
15 | refreshAnnouncement: function() { |
|
15 | refreshAnnouncement: function() { |
|
16 | var url = '/main/announcements'; |
|
16 | var url = '/main/announcements'; |
|
17 | new Ajax.Request(url, { |
|
17 | new Ajax.Request(url, { |
|
18 | method: 'get', |
|
18 | method: 'get', |
|
19 | parameters: { recent: Announcement.mostRecentId }, |
|
19 | parameters: { recent: Announcement.mostRecentId }, |
|
20 | onSuccess: function(transport) { |
|
20 | onSuccess: function(transport) { |
|
21 | - var announcementBody = $("announcementbox-body"); |
|
21 | + if(transport.responseText.match(/\S/)!=null) { |
|
22 | - announcementBody.insert({ top: transport.responseText }); |
|
22 | + var announcementBody = $("announcementbox-body"); |
|
|
23 | + announcementBody.insert({ top: transport.responseText }); | ||
|
|
24 | + var announcementBoxes = $$(".announcementbox"); | ||
|
|
25 | + if(announcementBoxes.length!=0) | ||
|
|
26 | + announcementBoxes[0].show(); | ||
|
|
27 | + } | ||
|
23 | } |
|
28 | } |
|
24 | }); |
|
29 | }); |
|
25 | Announcement.registerRefreshEventTimer(); |
|
30 | Announcement.registerRefreshEventTimer(); |
|
26 | }, |
|
31 | }, |
|
27 |
|
32 | ||
|
28 | registerRefreshEventTimer: function() { |
|
33 | registerRefreshEventTimer: function() { |
|
29 | setTimeout(function () { |
|
34 | setTimeout(function () { |
|
30 | Announcement.refreshAnnouncement(); |
|
35 | Announcement.refreshAnnouncement(); |
|
31 | }, 30000); |
|
36 | }, 30000); |
|
32 | } |
|
37 | } |
|
33 | - }; No newline at end of file |
|
38 | + }; |
You need to be logged in to leave comments.
Login now