Browse files

Locales and effective_date patch

  • Loading branch information...
1 parent 7d88fef commit e9b267a1ec3480087c4743488e6cc7dbbb72d085 Marcin Jędras committed Mar 22, 2010
Showing with 9 additions and 7 deletions.
  1. +3 −4 app/controllers/sprints_controller.rb
  2. +1 −0 config/locales/en.yml
  3. +2 −1 config/locales/pl.yml
  4. +2 −2 config/locales/zh.yml
  5. +1 −0 lib/version_patch.rb
View
7 app/controllers/sprints_controller.rb
@@ -72,16 +72,15 @@ def edit
# # POST /sprints.xml
def create
@sprint = @project.versions.build(params[:sprint])
-# @sprint = Sprint.new(params[:sprint])
-# @sprint.project_id = @project.id
if @sprint.save
render :update do |p|
p.insert_html :top, 'sprints_fieldset_main', :partial => "sprints/sprint", :locals => {:sprint => @sprint}
p["sprint_frame_cont_#{@sprint.id}"].visual_effect :blind_down, :duration => 1
end
else
- format.html { render :action => "new" }
- format.xml { render :xml => @sprint.errors, :status => :unprocessable_entity }
+ render :update do |page|
+ page.insert_html :top, "content", content_tag('div', t(:error_while_adding_sprint), :class => "error", :id => "errorExplanation")
+ end
end
end
View
1 config/locales/en.yml
@@ -47,3 +47,4 @@ en:
new_diagram: New diagram
unassigned_issues: Unassigned issues
error_changing_status: Error while changing status. You may not have persmissions.
+ error_while_adding_sprint: Error while adding Sprint. Field Date is required.
View
3 config/locales/pl.yml
@@ -45,4 +45,5 @@ pl:
upload_a_diagram: Wgraj diagram
new_diagram: Nowy diagram
unassigned_issues: Nieprzypisane zadania
- error_changing_status: Błąd podczas zmiany statusu. Możesz nie mieć prawa do tej zmiany.
+ error_changing_status: Błąd podczas zmiany statusu. Możesz nie mieć prawa do tej zmiany.
+ error_while_adding_sprint: Błąd podczas dodawania Sprintu. Pole data jest wymagane.
View
4 config/locales/zh.yml
@@ -1,5 +1,5 @@
-# English strings go here
-en:
+# Chanise strings go here
+zh:
label_dashboard: 仪表版
label_backlog: 任务
backlog: 任务
View
1 lib/version_patch.rb
@@ -7,6 +7,7 @@ def self.included(base)
unloadable
has_many :user_stories, :class_name => 'UserStory', :foreign_key => 'version_id'
+ validates_presence_of :effective_date
end
end
end

0 comments on commit e9b267a

Please sign in to comment.