Skip to content

Commit

Permalink
Mode/Deadlines - UNSTABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
reddragon committed Jun 23, 2010
1 parent 6cea3f9 commit 3711506
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 4 deletions.
15 changes: 15 additions & 0 deletions app/controllers/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,20 @@ class DashboardController < ApplicationController

def index
end

def dashboard_links
partial = params[:partial]
if partial == "dashboard"
render :partial => "dashboard/dashboard", :locals => {:user => current_user}
else
render :partial => "dashboard/" + partial
end
end

def set_timeframes
APP_CONFIG['pct_from'] = Date::civil(params[:pct_from][:year].to_i, params[:pct_from][:month].to_i, params[:pct_from][:day].to_i)
APP_CONFIG['pct_to'] = Date::civil(params[:pct_to][:year].to_i, params[:pct_to][:month].to_i, params[:pct_to][:day].to_i)
redirect_to :controller => "dashboard", :action => "dashboard_links", :partial => "configure"
end

end
116 changes: 116 additions & 0 deletions app/views/dashboard/_configure.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
%h3
FSoC is currently in
= APP_CONFIG['fsocmode']
mode
%br
%br
%br
- if APP_CONFIG['fsocmode'] == "Summer Coding"
- form_tag :action => "set_timeframes" do
%h3
Project Creation Timeframe
%table{:id => 'hor-minimalist-a'}
%tr
%th
From
%th
To
%tr
%td
= select_date Date.today, :prefix => "pct_from"
%td
= select_date Date.today, :prefix => "pct_to"
%br
%br
%h3
Proposal Submission Timeframe
%table{:id => 'hor-minimalist-a'}
%tr
%th
From
%th
To
%tr
%td
= select_date Date.today
%td
= select_date Date.today

%br
%br
%h3
Proposal Acceptance Timeframe
%table{:id => 'hor-minimalist-a'}
%tr
%th
From
%th
To
%tr
%td
= select_date Date.today
%td
= select_date Date.today
%br

%br
%br
%h3
Coding Starts Date
%table{:id => 'hor-minimalist-a'}
%tr
%th
On
%tr
%td
= select_date Date.today

%br
%br
%h3
Mid-Term Evaluation Timeframe
%table{:id => 'hor-minimalist-a'}
%tr
%th
From
%th
To
%tr
%td
= select_date Date.today
%td
= select_date Date.today

%br
%br
%h3
Coding Ends Date
%table{:id => 'hor-minimalist-a'}
%tr
%th
On
%tr
%td
= select_date Date.today
%br

%br
%br
%h3
Final Evaluation Timeframe
%table{:id => 'hor-minimalist-a'}
%tr
%th
From
%th
To
%tr
%td
= select_date Date.today
%td
= select_date Date.today
%br

%br
%br
= submit_tag 'Set Timeframes'
17 changes: 13 additions & 4 deletions app/views/dashboard/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#++
= javascript_include_tag :defaults

.post
%h2.title
- if !logged_in?
Expand All @@ -26,6 +28,7 @@
%span.date &nbsp;
%div{:style => 'clear: both'} &nbsp;
.entry

- if !logged_in?
%h3 Hi and welcome to FSoC
%p.links
Expand All @@ -34,8 +37,14 @@
= link_to 'Signup', signup_path
to get started.
- else
- if admin?
%br/
%p /* under construction */
= render :partial => "dashboard/dashboard", :locals => { :user => current_user }
%br/
%div{:id => 'dashboard_content'}
= render :partial => "dashboard/dashboard", :locals => { :user => current_user }
%p.links
= link_to_remote 'My Projects and Proposals', :update => "dashboard_content", :url => {:action => "dashboard_links", :partial => 'dashboard' }
- if admin?
&nbsp;|&nbsp;
= link_to_remote 'Configure', :update => "dashboard_content", :url => {:action => "dashboard_links", :partial => 'configure' }



2 changes: 2 additions & 0 deletions config/app_settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fsocmode: Summer Coding

1 change: 1 addition & 0 deletions config/initializers/load_app_settings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APP_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/app_settings.yml")

0 comments on commit 3711506

Please sign in to comment.