Description:
[web] added announcement
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@185 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r97:bd747ee8a498 - - 18 files changed: 336 inserted, 1 deleted
@@ -0,0 +1,91 | |||||
|
|
1 | + class AnnouncementsController < ApplicationController | ||
|
|
2 | + | ||
|
|
3 | + before_filter :authenticate | ||
|
|
4 | + before_filter { |controller| controller.authorization_by_roles(['admin'])} | ||
|
|
5 | + | ||
|
|
6 | + in_place_edit_for :announcement, :published | ||
|
|
7 | + | ||
|
|
8 | + # GET /announcements | ||
|
|
9 | + # GET /announcements.xml | ||
|
|
10 | + def index | ||
|
|
11 | + @announcements = Announcement.find(:all) | ||
|
|
12 | + | ||
|
|
13 | + respond_to do |format| | ||
|
|
14 | + format.html # index.html.erb | ||
|
|
15 | + format.xml { render :xml => @announcements } | ||
|
|
16 | + end | ||
|
|
17 | + end | ||
|
|
18 | + | ||
|
|
19 | + # GET /announcements/1 | ||
|
|
20 | + # GET /announcements/1.xml | ||
|
|
21 | + def show | ||
|
|
22 | + @announcement = Announcement.find(params[:id]) | ||
|
|
23 | + | ||
|
|
24 | + respond_to do |format| | ||
|
|
25 | + format.html # show.html.erb | ||
|
|
26 | + format.xml { render :xml => @announcement } | ||
|
|
27 | + end | ||
|
|
28 | + end | ||
|
|
29 | + | ||
|
|
30 | + # GET /announcements/new | ||
|
|
31 | + # GET /announcements/new.xml | ||
|
|
32 | + def new | ||
|
|
33 | + @announcement = Announcement.new | ||
|
|
34 | + | ||
|
|
35 | + respond_to do |format| | ||
|
|
36 | + format.html # new.html.erb | ||
|
|
37 | + format.xml { render :xml => @announcement } | ||
|
|
38 | + end | ||
|
|
39 | + end | ||
|
|
40 | + | ||
|
|
41 | + # GET /announcements/1/edit | ||
|
|
42 | + def edit | ||
|
|
43 | + @announcement = Announcement.find(params[:id]) | ||
|
|
44 | + end | ||
|
|
45 | + | ||
|
|
46 | + # POST /announcements | ||
|
|
47 | + # POST /announcements.xml | ||
|
|
48 | + def create | ||
|
|
49 | + @announcement = Announcement.new(params[:announcement]) | ||
|
|
50 | + | ||
|
|
51 | + respond_to do |format| | ||
|
|
52 | + if @announcement.save | ||
|
|
53 | + flash[:notice] = 'Announcement was successfully created.' | ||
|
|
54 | + format.html { redirect_to(@announcement) } | ||
|
|
55 | + format.xml { render :xml => @announcement, :status => :created, :location => @announcement } | ||
|
|
56 | + else | ||
|
|
57 | + format.html { render :action => "new" } | ||
|
|
58 | + format.xml { render :xml => @announcement.errors, :status => :unprocessable_entity } | ||
|
|
59 | + end | ||
|
|
60 | + end | ||
|
|
61 | + end | ||
|
|
62 | + | ||
|
|
63 | + # PUT /announcements/1 | ||
|
|
64 | + # PUT /announcements/1.xml | ||
|
|
65 | + def update | ||
|
|
66 | + @announcement = Announcement.find(params[:id]) | ||
|
|
67 | + | ||
|
|
68 | + respond_to do |format| | ||
|
|
69 | + if @announcement.update_attributes(params[:announcement]) | ||
|
|
70 | + flash[:notice] = 'Announcement was successfully updated.' | ||
|
|
71 | + format.html { redirect_to(@announcement) } | ||
|
|
72 | + format.xml { head :ok } | ||
|
|
73 | + else | ||
|
|
74 | + format.html { render :action => "edit" } | ||
|
|
75 | + format.xml { render :xml => @announcement.errors, :status => :unprocessable_entity } | ||
|
|
76 | + end | ||
|
|
77 | + end | ||
|
|
78 | + end | ||
|
|
79 | + | ||
|
|
80 | + # DELETE /announcements/1 | ||
|
|
81 | + # DELETE /announcements/1.xml | ||
|
|
82 | + def destroy | ||
|
|
83 | + @announcement = Announcement.find(params[:id]) | ||
|
|
84 | + @announcement.destroy | ||
|
|
85 | + | ||
|
|
86 | + respond_to do |format| | ||
|
|
87 | + format.html { redirect_to(announcements_url) } | ||
|
|
88 | + format.xml { head :ok } | ||
|
|
89 | + end | ||
|
|
90 | + end | ||
|
|
91 | + end |
@@ -0,0 +1,27 | |||||
|
|
1 | + <h1>Editing announcement</h1> | ||
|
|
2 | + | ||
|
|
3 | + <%= error_messages_for :announcement %> | ||
|
|
4 | + | ||
|
|
5 | + <% form_for(@announcement) do |f| %> | ||
|
|
6 | + <p> | ||
|
|
7 | + <b>Body</b><br /> | ||
|
|
8 | + <%= f.text_area :body %> | ||
|
|
9 | + </p> | ||
|
|
10 | + | ||
|
|
11 | + <p> | ||
|
|
12 | + <b>Author</b><br /> | ||
|
|
13 | + <%= f.text_field :author %> | ||
|
|
14 | + </p> | ||
|
|
15 | + | ||
|
|
16 | + <p> | ||
|
|
17 | + <b>Published</b><br /> | ||
|
|
18 | + <%= f.check_box :published %> | ||
|
|
19 | + </p> | ||
|
|
20 | + | ||
|
|
21 | + <p> | ||
|
|
22 | + <%= f.submit "Update" %> | ||
|
|
23 | + </p> | ||
|
|
24 | + <% end %> | ||
|
|
25 | + | ||
|
|
26 | + <%= link_to 'Show', @announcement %> | | ||
|
|
27 | + <%= link_to 'Back', announcements_path %> |
@@ -0,0 +1,30 | |||||
|
|
1 | + <% content_for :head do %> | ||
|
|
2 | + <%= stylesheet_link_tag 'scaffold' %> | ||
|
|
3 | + <%= javascript_include_tag :defaults %> | ||
|
|
4 | + <% end %> | ||
|
|
5 | + | ||
|
|
6 | + <h1>Listing announcements</h1> | ||
|
|
7 | + | ||
|
|
8 | + <table> | ||
|
|
9 | + <tr> | ||
|
|
10 | + <th>Body</th> | ||
|
|
11 | + <th>Author</th> | ||
|
|
12 | + <th>Published</th> | ||
|
|
13 | + </tr> | ||
|
|
14 | + | ||
|
|
15 | + <% for announcement in @announcements %> | ||
|
|
16 | + <tr> | ||
|
|
17 | + <% @announcement = announcement %> | ||
|
|
18 | + <td><%=h announcement.body %></td> | ||
|
|
19 | + <td><%=h announcement.author %></td> | ||
|
|
20 | + <td><%= in_place_editor_field :announcement, :published, {}, :rows => 1 %></td> | ||
|
|
21 | + <td><%= link_to 'Show', announcement %></td> | ||
|
|
22 | + <td><%= link_to 'Edit', edit_announcement_path(announcement) %></td> | ||
|
|
23 | + <td><%= link_to 'Destroy', announcement, :confirm => 'Are you sure?', :method => :delete %></td> | ||
|
|
24 | + </tr> | ||
|
|
25 | + <% end %> | ||
|
|
26 | + </table> | ||
|
|
27 | + | ||
|
|
28 | + <br /> | ||
|
|
29 | + | ||
|
|
30 | + <%= link_to 'New announcement', new_announcement_path %> |
@@ -0,0 +1,26 | |||||
|
|
1 | + <h1>New announcement</h1> | ||
|
|
2 | + | ||
|
|
3 | + <%= error_messages_for :announcement %> | ||
|
|
4 | + | ||
|
|
5 | + <% form_for(@announcement) do |f| %> | ||
|
|
6 | + <p> | ||
|
|
7 | + <b>Body</b><br /> | ||
|
|
8 | + <%= f.text_area :body %> | ||
|
|
9 | + </p> | ||
|
|
10 | + | ||
|
|
11 | + <p> | ||
|
|
12 | + <b>Author</b><br /> | ||
|
|
13 | + <%= f.text_field :author %> | ||
|
|
14 | + </p> | ||
|
|
15 | + | ||
|
|
16 | + <p> | ||
|
|
17 | + <b>Published</b><br /> | ||
|
|
18 | + <%= f.check_box :published %> | ||
|
|
19 | + </p> | ||
|
|
20 | + | ||
|
|
21 | + <p> | ||
|
|
22 | + <%= f.submit "Create" %> | ||
|
|
23 | + </p> | ||
|
|
24 | + <% end %> | ||
|
|
25 | + | ||
|
|
26 | + <%= link_to 'Back', announcements_path %> |
@@ -0,0 +1,18 | |||||
|
|
1 | + <p> | ||
|
|
2 | + <b>Author:</b> | ||
|
|
3 | + <%=h @announcement.author %> | ||
|
|
4 | + </p> | ||
|
|
5 | + | ||
|
|
6 | + <p> | ||
|
|
7 | + <b>Body:</b> | ||
|
|
8 | + <%=h @announcement.body %> | ||
|
|
9 | + </p> | ||
|
|
10 | + | ||
|
|
11 | + <p> | ||
|
|
12 | + <b>Published:</b> | ||
|
|
13 | + <%=h @announcement.published %> | ||
|
|
14 | + </p> | ||
|
|
15 | + | ||
|
|
16 | + | ||
|
|
17 | + <%= link_to 'Edit', edit_announcement_path(@announcement) %> | | ||
|
|
18 | + <%= link_to 'Back', announcements_path %> |
@@ -0,0 +1,4 | |||||
|
|
1 | + .announcement | ||
|
|
2 | + = markdown(announcement.body) | ||
|
|
3 | + .pub-info | ||
|
|
4 | + %p= "#{announcement.author} #{announcement.created_at}" |
@@ -0,0 +1,15 | |||||
|
|
1 | + class CreateAnnouncements < ActiveRecord::Migration | ||
|
|
2 | + def self.up | ||
|
|
3 | + create_table :announcements do |t| | ||
|
|
4 | + t.string :author | ||
|
|
5 | + t.text :body | ||
|
|
6 | + t.boolean :published | ||
|
|
7 | + | ||
|
|
8 | + t.timestamps | ||
|
|
9 | + end | ||
|
|
10 | + end | ||
|
|
11 | + | ||
|
|
12 | + def self.down | ||
|
|
13 | + drop_table :announcements | ||
|
|
14 | + end | ||
|
|
15 | + end |
@@ -0,0 +1,11 | |||||
|
|
1 | + # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
|
|
2 | + | ||
|
|
3 | + one: | ||
|
|
4 | + author: MyString | ||
|
|
5 | + body: MyText | ||
|
|
6 | + published: false | ||
|
|
7 | + | ||
|
|
8 | + two: | ||
|
|
9 | + author: MyString | ||
|
|
10 | + body: MyText | ||
|
|
11 | + published: false |
@@ -0,0 +1,45 | |||||
|
|
1 | + require File.dirname(__FILE__) + '/../test_helper' | ||
|
|
2 | + | ||
|
|
3 | + class AnnouncementsControllerTest < ActionController::TestCase | ||
|
|
4 | + def test_should_get_index | ||
|
|
5 | + get :index | ||
|
|
6 | + assert_response :success | ||
|
|
7 | + assert_not_nil assigns(:announcements) | ||
|
|
8 | + end | ||
|
|
9 | + | ||
|
|
10 | + def test_should_get_new | ||
|
|
11 | + get :new | ||
|
|
12 | + assert_response :success | ||
|
|
13 | + end | ||
|
|
14 | + | ||
|
|
15 | + def test_should_create_announcement | ||
|
|
16 | + assert_difference('Announcement.count') do | ||
|
|
17 | + post :create, :announcement => { } | ||
|
|
18 | + end | ||
|
|
19 | + | ||
|
|
20 | + assert_redirected_to announcement_path(assigns(:announcement)) | ||
|
|
21 | + end | ||
|
|
22 | + | ||
|
|
23 | + def test_should_show_announcement | ||
|
|
24 | + get :show, :id => announcements(:one).id | ||
|
|
25 | + assert_response :success | ||
|
|
26 | + end | ||
|
|
27 | + | ||
|
|
28 | + def test_should_get_edit | ||
|
|
29 | + get :edit, :id => announcements(:one).id | ||
|
|
30 | + assert_response :success | ||
|
|
31 | + end | ||
|
|
32 | + | ||
|
|
33 | + def test_should_update_announcement | ||
|
|
34 | + put :update, :id => announcements(:one).id, :announcement => { } | ||
|
|
35 | + assert_redirected_to announcement_path(assigns(:announcement)) | ||
|
|
36 | + end | ||
|
|
37 | + | ||
|
|
38 | + def test_should_destroy_announcement | ||
|
|
39 | + assert_difference('Announcement.count', -1) do | ||
|
|
40 | + delete :destroy, :id => announcements(:one).id | ||
|
|
41 | + end | ||
|
|
42 | + | ||
|
|
43 | + assert_redirected_to announcements_path | ||
|
|
44 | + end | ||
|
|
45 | + end |
@@ -0,0 +1,8 | |||||
|
|
1 | + require File.dirname(__FILE__) + '/../test_helper' | ||
|
|
2 | + | ||
|
|
3 | + class AnnouncementTest < ActiveSupport::TestCase | ||
|
|
4 | + # Replace this with your real tests. | ||
|
|
5 | + def test_truth | ||
|
|
6 | + assert true | ||
|
|
7 | + end | ||
|
|
8 | + end |
@@ -83,28 +83,32 | |||||
|
83 | @user = User.find(session[:user_id]) |
|
83 | @user = User.find(session[:user_id]) |
|
84 | @problems = Problem.find_available_problems |
|
84 | @problems = Problem.find_available_problems |
|
85 | if params[:id]==nil |
|
85 | if params[:id]==nil |
|
86 | @problem = nil |
|
86 | @problem = nil |
|
87 | @submissions = nil |
|
87 | @submissions = nil |
|
88 | else |
|
88 | else |
|
89 | @problem = Problem.find_by_name(params[:id]) |
|
89 | @problem = Problem.find_by_name(params[:id]) |
|
90 | @submissions = Submission.find_all_by_user_problem(@user.id, @problem.id) |
|
90 | @submissions = Submission.find_all_by_user_problem(@user.id, @problem.id) |
|
91 | end |
|
91 | end |
|
92 | end |
|
92 | end |
|
93 |
|
93 | ||
|
94 | protected |
|
94 | protected |
|
95 | def prepare_list_information |
|
95 | def prepare_list_information |
|
96 | @problems = Problem.find_available_problems |
|
96 | @problems = Problem.find_available_problems |
|
97 | @prob_submissions = Array.new |
|
97 | @prob_submissions = Array.new |
|
98 | @user = User.find(session[:user_id]) |
|
98 | @user = User.find(session[:user_id]) |
|
99 | @problems.each do |p| |
|
99 | @problems.each do |p| |
|
100 | sub = Submission.find_last_by_user_and_problem(@user.id,p.id) |
|
100 | sub = Submission.find_last_by_user_and_problem(@user.id,p.id) |
|
101 | if sub!=nil |
|
101 | if sub!=nil |
|
102 | @prob_submissions << { :count => sub.number, :submission => sub } |
|
102 | @prob_submissions << { :count => sub.number, :submission => sub } |
|
103 | else |
|
103 | else |
|
104 | @prob_submissions << { :count => 0, :submission => nil } |
|
104 | @prob_submissions << { :count => 0, :submission => nil } |
|
105 | end |
|
105 | end |
|
106 | end |
|
106 | end |
|
|
107 | + | ||
|
|
108 | + @announcements = Announcement.find(:all, | ||
|
|
109 | + :conditions => "published = 1", | ||
|
|
110 | + :order => "created_at DESC") | ||
|
107 | end |
|
111 | end |
|
108 |
|
112 | ||
|
109 | end |
|
113 | end |
|
110 |
|
114 |
@@ -1,34 +1,35 | |||||
|
1 | # Methods added to this helper will be available to all templates in the application. |
|
1 | # Methods added to this helper will be available to all templates in the application. |
|
2 | module ApplicationHelper |
|
2 | module ApplicationHelper |
|
3 |
|
3 | ||
|
4 | def user_header |
|
4 | def user_header |
|
5 | menu_items = '' |
|
5 | menu_items = '' |
|
6 | user = User.find(session[:user_id]) |
|
6 | user = User.find(session[:user_id]) |
|
7 |
|
7 | ||
|
8 | if (user!=nil) and (user.admin?) |
|
8 | if (user!=nil) and (user.admin?) |
|
9 | # admin menu |
|
9 | # admin menu |
|
10 | menu_items << "<b>Administrative task:</b> " |
|
10 | menu_items << "<b>Administrative task:</b> " |
|
|
11 | + append_to menu_items, '[Announcements]', 'announcements', 'index' | ||
|
11 | append_to menu_items, '[Problem admin]', 'problems', 'index' |
|
12 | append_to menu_items, '[Problem admin]', 'problems', 'index' |
|
12 | append_to menu_items, '[User admin]', 'user_admin', 'index' |
|
13 | append_to menu_items, '[User admin]', 'user_admin', 'index' |
|
13 | append_to menu_items, '[User stat]', 'user_admin', 'user_stat' |
|
14 | append_to menu_items, '[User stat]', 'user_admin', 'user_stat' |
|
14 | #append_to menu_items, '[Graders]', 'graders', 'list' |
|
15 | #append_to menu_items, '[Graders]', 'graders', 'list' |
|
15 | append_to menu_items, '[Site config]', 'configurations', 'index' |
|
16 | append_to menu_items, '[Site config]', 'configurations', 'index' |
|
16 | menu_items << "<br/>" |
|
17 | menu_items << "<br/>" |
|
17 | end |
|
18 | end |
|
18 |
|
19 | ||
|
19 | # main page |
|
20 | # main page |
|
20 | append_to menu_items, '[Main]', 'main', 'list' |
|
21 | append_to menu_items, '[Main]', 'main', 'list' |
|
21 | append_to menu_items, '[Tasks]', 'tasks', 'list' |
|
22 | append_to menu_items, '[Tasks]', 'tasks', 'list' |
|
22 | append_to menu_items, '[Submissions]', 'main', 'submission' |
|
23 | append_to menu_items, '[Submissions]', 'main', 'submission' |
|
23 | append_to menu_items, '[Test]', 'test', 'index' |
|
24 | append_to menu_items, '[Test]', 'test', 'index' |
|
24 | append_to menu_items, '[Settings]', 'users', 'index' |
|
25 | append_to menu_items, '[Settings]', 'users', 'index' |
|
25 | append_to menu_items, '[Log out]', 'main', 'login' |
|
26 | append_to menu_items, '[Log out]', 'main', 'login' |
|
26 |
|
27 | ||
|
27 | menu_items |
|
28 | menu_items |
|
28 | end |
|
29 | end |
|
29 |
|
30 | ||
|
30 | def append_to(option,label, controller, action) |
|
31 | def append_to(option,label, controller, action) |
|
31 | option << ' ' if option!='' |
|
32 | option << ' ' if option!='' |
|
32 | option << link_to_unless_current(label, |
|
33 | option << link_to_unless_current(label, |
|
33 | :controller => controller, |
|
34 | :controller => controller, |
|
34 | :action => action) |
|
35 | :action => action) |
@@ -1,22 +1,28 | |||||
|
1 | = user_title_bar(@user) |
|
1 | = user_title_bar(@user) |
|
2 |
|
2 | ||
|
|
3 | + - if @announcements.length!=0 | ||
|
|
4 | + .announcementbox | ||
|
|
5 | + %span{:class => 'title'} | ||
|
|
6 | + Announcements | ||
|
|
7 | + = render :partial => 'announcement', :collection => @announcements | ||
|
|
8 | + | ||
|
3 | .submitbox |
|
9 | .submitbox |
|
4 | = error_messages_for 'submission' |
|
10 | = error_messages_for 'submission' |
|
5 | = render :partial => 'submission_box' |
|
11 | = render :partial => 'submission_box' |
|
6 |
|
12 | ||
|
7 |
|
13 | ||
|
8 | %hr/ |
|
14 | %hr/ |
|
9 |
|
15 | ||
|
10 | %table.info |
|
16 | %table.info |
|
11 | %tr.info-head |
|
17 | %tr.info-head |
|
12 | %th |
|
18 | %th |
|
13 | %th Tasks |
|
19 | %th Tasks |
|
14 | %th # of sub(s) |
|
20 | %th # of sub(s) |
|
15 | %th Results |
|
21 | %th Results |
|
16 | = render :partial => 'problem', :collection => @problems |
|
22 | = render :partial => 'problem', :collection => @problems |
|
17 |
|
23 | ||
|
18 | %hr |
|
24 | %hr |
|
19 |
|
25 | ||
|
20 | .submitbox |
|
26 | .submitbox |
|
21 | = render :partial => 'submission_box' |
|
27 | = render :partial => 'submission_box' |
|
22 |
|
28 |
@@ -1,25 +1,27 | |||||
|
1 | ActionController::Routing::Routes.draw do |map| |
|
1 | ActionController::Routing::Routes.draw do |map| |
|
|
2 | + map.resources :announcements | ||
|
|
3 | + | ||
|
2 | map.resources :sites |
|
4 | map.resources :sites |
|
3 |
|
5 | ||
|
4 | # The priority is based upon order of creation: first created -> highest priority. |
|
6 | # The priority is based upon order of creation: first created -> highest priority. |
|
5 |
|
7 | ||
|
6 | # Sample of regular route: |
|
8 | # Sample of regular route: |
|
7 | # map.connect 'products/:id', :controller => 'catalog', :action => 'view' |
|
9 | # map.connect 'products/:id', :controller => 'catalog', :action => 'view' |
|
8 | # Keep in mind you can assign values other than :controller and :action |
|
10 | # Keep in mind you can assign values other than :controller and :action |
|
9 |
|
11 | ||
|
10 | # Sample of named route: |
|
12 | # Sample of named route: |
|
11 | # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' |
|
13 | # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' |
|
12 | # This route can be invoked with purchase_url(:id => product.id) |
|
14 | # This route can be invoked with purchase_url(:id => product.id) |
|
13 |
|
15 | ||
|
14 | # You can have the root of your site routed by hooking up '' |
|
16 | # You can have the root of your site routed by hooking up '' |
|
15 | # -- just remember to delete public/index.html. |
|
17 | # -- just remember to delete public/index.html. |
|
16 | map.connect '', :controller => 'main', :action => 'login' |
|
18 | map.connect '', :controller => 'main', :action => 'login' |
|
17 |
|
19 | ||
|
18 | # Allow downloading Web Service WSDL as a file with an extension |
|
20 | # Allow downloading Web Service WSDL as a file with an extension |
|
19 | # instead of a file named 'wsdl' |
|
21 | # instead of a file named 'wsdl' |
|
20 | map.connect ':controller/service.wsdl', :action => 'wsdl' |
|
22 | map.connect ':controller/service.wsdl', :action => 'wsdl' |
|
21 |
|
23 | ||
|
22 | # Install the default route as the lowest priority. |
|
24 | # Install the default route as the lowest priority. |
|
23 | map.connect ':controller/:action/:id.:format' |
|
25 | map.connect ':controller/:action/:id.:format' |
|
24 | map.connect ':controller/:action/:id' |
|
26 | map.connect ':controller/:action/:id' |
|
25 | end |
|
27 | end |
@@ -1,36 +1,44 | |||||
|
1 | # This file is auto-generated from the current state of the database. Instead of editing this file, |
|
1 | # This file is auto-generated from the current state of the database. Instead of editing this file, |
|
2 | # please use the migrations feature of ActiveRecord to incrementally modify your database, and |
|
2 | # please use the migrations feature of ActiveRecord to incrementally modify your database, and |
|
3 | # then regenerate this schema definition. |
|
3 | # then regenerate this schema definition. |
|
4 | # |
|
4 | # |
|
5 | # Note that this schema.rb definition is the authoritative source for your database schema. If you need |
|
5 | # Note that this schema.rb definition is the authoritative source for your database schema. If you need |
|
6 | # to create the application database on another system, you should be using db:schema:load, not running |
|
6 | # to create the application database on another system, you should be using db:schema:load, not running |
|
7 | # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
7 | # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
8 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
8 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
9 | # |
|
9 | # |
|
10 | # It's strongly recommended to check this file into your version control system. |
|
10 | # It's strongly recommended to check this file into your version control system. |
|
11 |
|
11 | ||
|
12 |
- ActiveRecord::Schema.define(:version => |
|
12 | + ActiveRecord::Schema.define(:version => 30) do |
|
|
13 | + | ||
|
|
14 | + create_table "announcements", :force => true do |t| | ||
|
|
15 | + t.string "author" | ||
|
|
16 | + t.text "body" | ||
|
|
17 | + t.boolean "published" | ||
|
|
18 | + t.datetime "created_at" | ||
|
|
19 | + t.datetime "updated_at" | ||
|
|
20 | + end | ||
|
13 |
|
21 | ||
|
14 | create_table "configurations", :force => true do |t| |
|
22 | create_table "configurations", :force => true do |t| |
|
15 | t.string "key" |
|
23 | t.string "key" |
|
16 | t.string "value_type" |
|
24 | t.string "value_type" |
|
17 | t.string "value" |
|
25 | t.string "value" |
|
18 | t.datetime "created_at" |
|
26 | t.datetime "created_at" |
|
19 | t.datetime "updated_at" |
|
27 | t.datetime "updated_at" |
|
20 | end |
|
28 | end |
|
21 |
|
29 | ||
|
22 | create_table "descriptions", :force => true do |t| |
|
30 | create_table "descriptions", :force => true do |t| |
|
23 | t.text "body" |
|
31 | t.text "body" |
|
24 | t.boolean "markdowned" |
|
32 | t.boolean "markdowned" |
|
25 | t.datetime "created_at" |
|
33 | t.datetime "created_at" |
|
26 | t.datetime "updated_at" |
|
34 | t.datetime "updated_at" |
|
27 | end |
|
35 | end |
|
28 |
|
36 | ||
|
29 | create_table "grader_processes", :force => true do |t| |
|
37 | create_table "grader_processes", :force => true do |t| |
|
30 | t.string "host", :limit => 20 |
|
38 | t.string "host", :limit => 20 |
|
31 | t.integer "pid" |
|
39 | t.integer "pid" |
|
32 | t.string "mode" |
|
40 | t.string "mode" |
|
33 | t.boolean "active" |
|
41 | t.boolean "active" |
|
34 | t.datetime "created_at" |
|
42 | t.datetime "created_at" |
|
35 | t.datetime "updated_at" |
|
43 | t.datetime "updated_at" |
|
36 | t.integer "task_id" |
|
44 | t.integer "task_id" |
@@ -135,24 +135,59 | |||||
|
135 | table.taskdesc p { |
|
135 | table.taskdesc p { |
|
136 | font-size: 13px; |
|
136 | font-size: 13px; |
|
137 | } |
|
137 | } |
|
138 |
|
138 | ||
|
139 | table.taskdesc tr.name { |
|
139 | table.taskdesc tr.name { |
|
140 | border: 1px solid black; |
|
140 | border: 1px solid black; |
|
141 | background: #aaaaaa; |
|
141 | background: #aaaaaa; |
|
142 | color: white; |
|
142 | color: white; |
|
143 | font-weight: bold; |
|
143 | font-weight: bold; |
|
144 | font-size: 14px; |
|
144 | font-size: 14px; |
|
145 | text-align: center; |
|
145 | text-align: center; |
|
146 | } |
|
146 | } |
|
147 |
|
147 | ||
|
148 | table.taskdesc td.desc-odd { |
|
148 | table.taskdesc td.desc-odd { |
|
149 | padding: 5px; |
|
149 | padding: 5px; |
|
150 | padding-left: 20px; |
|
150 | padding-left: 20px; |
|
151 | background: #fefeee; |
|
151 | background: #fefeee; |
|
152 | } |
|
152 | } |
|
153 |
|
153 | ||
|
154 | table.taskdesc td.desc-even { |
|
154 | table.taskdesc td.desc-even { |
|
155 | padding: 5px; |
|
155 | padding: 5px; |
|
156 | padding-left: 20px; |
|
156 | padding-left: 20px; |
|
157 | background: #feeefe; |
|
157 | background: #feeefe; |
|
158 | } |
|
158 | } |
|
|
159 | + | ||
|
|
160 | + /********************** | ||
|
|
161 | + [Announcement] | ||
|
|
162 | + ***********************/ | ||
|
|
163 | + | ||
|
|
164 | + div.announcementbox { | ||
|
|
165 | + margin-top: 10px; | ||
|
|
166 | + margin-bottom: 10px; | ||
|
|
167 | + background: green; | ||
|
|
168 | + padding: 2px; | ||
|
|
169 | + } | ||
|
|
170 | + | ||
|
|
171 | + div.announcementbox span.title { | ||
|
|
172 | + font-weight: bold; | ||
|
|
173 | + color: white; | ||
|
|
174 | + padding-left: 10px; | ||
|
|
175 | + } | ||
|
|
176 | + | ||
|
|
177 | + div.announcement { | ||
|
|
178 | + margin: 2px; | ||
|
|
179 | + background: white; | ||
|
|
180 | + padding: 2px; | ||
|
|
181 | + padding-left: 10px; | ||
|
|
182 | + padding-right: 10px; | ||
|
|
183 | + } | ||
|
|
184 | + | ||
|
|
185 | + div.announcement p { | ||
|
|
186 | + font-size: 13px; | ||
|
|
187 | + } | ||
|
|
188 | + | ||
|
|
189 | + div.pub-info, div.pub-info p { | ||
|
|
190 | + text-align: right; | ||
|
|
191 | + font-style: italic; | ||
|
|
192 | + font-size: 10px; | ||
|
|
193 | + } No newline at end of file |
You need to be logged in to leave comments.
Login now