obsolete.ChilliProject/app/controllers/previews_controller.rb

34 lines
953 B
Ruby
Raw Normal View History

class PreviewsController < ApplicationController
before_filter :find_project
def issue
@issue = @project.issues.find_by_id(params[:id]) unless params[:id].blank?
if @issue
@attachements = @issue.attachments
@description = params[:issue] && params[:issue][:description]
if @description && @description.gsub(/(\r?\n|\n\r?)/, "\n") == @issue.description.to_s.gsub(/(\r?\n|\n\r?)/, "\n")
@description = nil
end
@notes = params[:notes]
else
@description = (params[:issue] ? params[:issue][:description] : nil)
end
render :layout => false
end
def news
@text = (params[:news] ? params[:news][:description] : nil)
render :partial => 'common/preview'
end
private
Merge branch 'master' into master-journalized Conflicts: app/controllers/application_controller.rb app/controllers/context_menus_controller.rb app/controllers/gantts_controller.rb app/controllers/issue_moves_controller.rb app/controllers/issues_controller.rb app/controllers/journals_controller.rb app/controllers/previews_controller.rb app/controllers/timelog_controller.rb app/helpers/issues_helper.rb app/helpers/journals_helper.rb app/models/issue.rb app/models/journal.rb app/models/journal_observer.rb app/views/admin/projects.rhtml app/views/context_menus/issues.html.erb app/views/issues/_action_menu.rhtml app/views/issues/_history.rhtml app/views/news/_news.rhtml app/views/news/index.rhtml app/views/repositories/diff.rhtml config/locales/bg.yml config/locales/bs.yml config/locales/ca.yml config/locales/cs.yml config/locales/da.yml config/locales/de.yml config/locales/el.yml config/locales/en-GB.yml config/locales/es.yml config/locales/eu.yml config/locales/fi.yml config/locales/fr.yml config/locales/gl.yml config/locales/he.yml config/locales/hr.yml config/locales/hu.yml config/locales/id.yml config/locales/it.yml config/locales/ko.yml config/locales/lt.yml config/locales/lv.yml config/locales/mn.yml config/locales/nl.yml config/locales/no.yml config/locales/pl.yml config/locales/pt-BR.yml config/locales/pt.yml config/locales/ro.yml config/locales/ru.yml config/locales/sk.yml config/locales/sl.yml config/locales/sr-YU.yml config/locales/sr.yml config/locales/sv.yml config/locales/th.yml config/locales/tr.yml config/locales/uk.yml config/locales/vi.yml config/locales/zh-TW.yml config/locales/zh.yml config/routes.rb doc/CHANGELOG lib/redmine.rb lib/redmine/export/pdf.rb lib/redmine/helpers/gantt.rb lib/redmine/version.rb public/stylesheets/application.css test/functional/context_menus_controller_test.rb test/functional/issues_controller_test.rb test/functional/journals_controller_test.rb test/functional/previews_controller_test.rb test/functional/users_controller_test.rb test/functional/wiki_controller_test.rb test/integration/routing_test.rb test/unit/issue_test.rb test/unit/mailer_test.rb test/unit/query_test.rb
2010-10-26 20:20:57 +04:00
def find_project
project_id = (params[:issue] && params[:issue][:project_id]) || params[:project_id]
@project = Project.find(project_id)
rescue ActiveRecord::RecordNotFound
render_404
end
Merge branch 'master' into master-journalized Conflicts: app/controllers/application_controller.rb app/controllers/context_menus_controller.rb app/controllers/gantts_controller.rb app/controllers/issue_moves_controller.rb app/controllers/issues_controller.rb app/controllers/journals_controller.rb app/controllers/previews_controller.rb app/controllers/timelog_controller.rb app/helpers/issues_helper.rb app/helpers/journals_helper.rb app/models/issue.rb app/models/journal.rb app/models/journal_observer.rb app/views/admin/projects.rhtml app/views/context_menus/issues.html.erb app/views/issues/_action_menu.rhtml app/views/issues/_history.rhtml app/views/news/_news.rhtml app/views/news/index.rhtml app/views/repositories/diff.rhtml config/locales/bg.yml config/locales/bs.yml config/locales/ca.yml config/locales/cs.yml config/locales/da.yml config/locales/de.yml config/locales/el.yml config/locales/en-GB.yml config/locales/es.yml config/locales/eu.yml config/locales/fi.yml config/locales/fr.yml config/locales/gl.yml config/locales/he.yml config/locales/hr.yml config/locales/hu.yml config/locales/id.yml config/locales/it.yml config/locales/ko.yml config/locales/lt.yml config/locales/lv.yml config/locales/mn.yml config/locales/nl.yml config/locales/no.yml config/locales/pl.yml config/locales/pt-BR.yml config/locales/pt.yml config/locales/ro.yml config/locales/ru.yml config/locales/sk.yml config/locales/sl.yml config/locales/sr-YU.yml config/locales/sr.yml config/locales/sv.yml config/locales/th.yml config/locales/tr.yml config/locales/uk.yml config/locales/vi.yml config/locales/zh-TW.yml config/locales/zh.yml config/routes.rb doc/CHANGELOG lib/redmine.rb lib/redmine/export/pdf.rb lib/redmine/helpers/gantt.rb lib/redmine/version.rb public/stylesheets/application.css test/functional/context_menus_controller_test.rb test/functional/issues_controller_test.rb test/functional/journals_controller_test.rb test/functional/previews_controller_test.rb test/functional/users_controller_test.rb test/functional/wiki_controller_test.rb test/integration/routing_test.rb test/unit/issue_test.rb test/unit/mailer_test.rb test/unit/query_test.rb
2010-10-26 20:20:57 +04:00
end