diff --git a/lib/open_project/backlogs/issue_form.rb b/lib/open_project/backlogs/issue_form.rb index 46dd7677e6..7e7f617d0d 100644 --- a/lib/open_project/backlogs/issue_form.rb +++ b/lib/open_project/backlogs/issue_form.rb @@ -1,54 +1,54 @@ -#class Backlogs::IssueForm < Backlogs::IssueView; end -#require_dependency 'backlogs/issue_form/custom_field_paragraph' -#require_dependency 'backlogs/issue_form/description_paragraph' -#require_dependency 'backlogs/issue_form/fields_paragraph' -#require_dependency 'backlogs/issue_form/heading' -#require_dependency 'backlogs/issue_form/notes_paragraph' -# -#class Backlogs::IssueForm < Backlogs::IssueView -# attr_reader :form_id -# -# def initialize(issue) -# super(issue) -# @form_id = "form_#{ActiveSupport::SecureRandom.hex(10)}" -# end -# -# def render(t) -# s = super(t) -# content_tag(:form, [ -# errors_paragraph.render(t), -# s, -# notes_paragraph.render(t) -# ].join, :id => form_id) -# end -# -# def errors_paragraph -# @errors_paragraph ||= OpenProject::Nissue::SimpleParagraph.new(@issue) do |t| -# content_tag(:div, t.error_messages_for('issue'), :style => "clear:right") -# end -# end -# -# def heading -# @heading ||= Backlogs::IssueForm::Heading.new(@issue) -# end -# -# def notes_paragraph -# @notes_paragraph ||= Backlogs::IssueForm::NotesParagraph.new(@issue) -# end -# -# def fields_paragraph -# @fields_paragraph ||= Backlogs::IssueForm::FieldsParagraph.new(@issue) -# end -# -# def description_paragraph -# @description_paragraph ||= Backlogs::IssueForm::DescriptionParagraph.new(@issue) -# end -# -# def related_issues_paragraph -# @related_issues_paragraph ||= OpenProject::Nissue::EmptyParagraph.new -# end -# -# def sub_issues_paragraph -# @sub_issues_paragraph ||= OpenProject::Nissue::EmptyParagraph.new -# end -#end +class OpenProject::Backlogs::IssueForm < OpenProjects::Backlogs::IssueView; end +require_dependency 'backlogs/issue_form/custom_field_paragraph' +require_dependency 'backlogs/issue_form/description_paragraph' +require_dependency 'backlogs/issue_form/fields_paragraph' +require_dependency 'backlogs/issue_form/heading' +require_dependency 'backlogs/issue_form/notes_paragraph' + +class OpenProject::Backlogs::IssueForm < OpenProject::Backlogs::IssueView + attr_reader :form_id + + def initialize(issue) + super(issue) + @form_id = "form_#{ActiveSupport::SecureRandom.hex(10)}" + end + + def render(t) + s = super(t) + content_tag(:form, [ + errors_paragraph.render(t), + s, + notes_paragraph.render(t) + ].join, :id => form_id) + end + + def errors_paragraph + @errors_paragraph ||= OpenProject::Nissue::SimpleParagraph.new(@issue) do |t| + content_tag(:div, t.error_messages_for('issue'), :style => "clear:right") + end + end + + def heading + @heading ||= OpenProjects::Backlogs::IssueForm::Heading.new(@issue) + end + + def notes_paragraph + @notes_paragraph ||= OpenProjects::Backlogs::IssueForm::NotesParagraph.new(@issue) + end + + def fields_paragraph + @fields_paragraph ||= OpenProjects::Backlogs::IssueForm::FieldsParagraph.new(@issue) + end + + def description_paragraph + @description_paragraph ||= OpenProjects::Backlogs::IssueForm::DescriptionParagraph.new(@issue) + end + + def related_issues_paragraph + @related_issues_paragraph ||= OpenProject::Nissue::EmptyParagraph.new + end + + def sub_issues_paragraph + @sub_issues_paragraph ||= OpenProject::Nissue::EmptyParagraph.new + end +end diff --git a/lib/open_project/backlogs/issue_view.rb b/lib/open_project/backlogs/issue_view.rb index 71f3900810..b99496b208 100644 --- a/lib/open_project/backlogs/issue_view.rb +++ b/lib/open_project/backlogs/issue_view.rb @@ -1,18 +1,18 @@ -#class Backlogs::IssueView < OpenProject::Nissue::IssueView; end -#require_dependency 'backlogs/issue_view/fields_paragraph' -#require_dependency 'backlogs/issue_view/heading' -#require_dependency 'backlogs/issue_view/issue_hierarchy_paragraph' -# -#class Backlogs::IssueView < OpenProject::Nissue::IssueView -# def fields_paragraph -# @fields_paragraph ||= Backlogs::IssueView::FieldsParagraph.new(@issue) -# end -# -# def heading -# @heading ||= Backlogs::IssueView::Heading.new(@issue) -# end -# -# def sub_issues_paragraph -# @sub_issues_paragraph ||= Backlogs::IssueView::IssueHierarchyParagraph.new(@issue) -# end -#end +class OpenProject::Backlogs::IssueView < OpenProject::Nissue::IssueView; end +require_dependency 'backlogs/issue_view/fields_paragraph' +require_dependency 'backlogs/issue_view/heading' +require_dependency 'backlogs/issue_view/issue_hierarchy_paragraph' + +class OpenProject::Backlogs::IssueView < OpenProject::Nissue::IssueView + def fields_paragraph + @fields_paragraph ||= OpenProject::Backlogs::IssueView::FieldsParagraph.new(@issue) + end + + def heading + @heading ||= OpenProject::Backlogs::IssueView::Heading.new(@issue) + end + + def sub_issues_paragraph + @sub_issues_paragraph ||= OpenProject::Backlogs::IssueView::IssueHierarchyParagraph.new(@issue) + end +end