2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-22 09:57:31 +00:00

Fixed message for validation error on wiki_page.

--HG--
branch : 3.0-stable
This commit is contained in:
Edho Arief 2012-07-11 23:19:31 +07:00
parent d0bb265e08
commit 85229411ed
3 changed files with 8 additions and 11 deletions

View File

@ -129,7 +129,7 @@ class WikiController < ApplicationController
if @page.save if @page.save
respond_to_success("Page reverted", :action => "show", :title => params[:title]) respond_to_success("Page reverted", :action => "show", :title => params[:title])
else else
respond_to_error("Error reverting page", { :action => 'show', :title => params[:title] }) respond_to_error((@page.errors.full_messages.first rescue "Error reverting page"), { :action => 'show', :title => params[:title] })
end end
end end
end end

View File

@ -107,15 +107,8 @@ class WikiPage < ActiveRecord::Base
protected protected
def ensure_changed def ensure_changed
changed = false unless (changed & ['title', 'body']).any?
latest = self.versions.latest errors.add :base, :no_change
if self.body != latest.body
changed = true
elsif self.title != latest.title
changed = true
elsif self.is_locked != latest.is_locked
changed = true
end end
return changed
end end
end end

View File

@ -106,7 +106,7 @@ en:
moderate: moderate:
uploaded_by_when_html: Uploaded by %{u} %{t_ago} (%{mod}) uploaded_by_when_html: Uploaded by %{u} %{t_ago} (%{mod})
mod: mod mod: mod
#models # ActiveRecord (models)
activerecord: activerecord:
attributes: attributes:
#user.attributes #user.attributes
@ -114,6 +114,10 @@ en:
password: Password password: Password
current_password: Current password current_password: Current password
password_confirmation: Password confirmation password_confirmation: Password confirmation
errors:
models:
wiki_page:
no_change: No change in page content/title
#view/artist/create #view/artist/create
artist_create: "Separate multiple aliases and group members with commas." artist_create: "Separate multiple aliases and group members with commas."
artist_name: "Name" artist_name: "Name"