# note that the description format will default to 'markdown'
if @redaction.save
- flash[:notice] = t("redaction.create.flash")
+ flash[:notice] = t(".flash")
redirect_to @redaction
else
render :action => "new"
@redaction.description = params[:redaction][:description]
if @redaction.save
- flash[:notice] = t("redaction.update.flash")
+ flash[:notice] = t(".flash")
redirect_to @redaction
else
render :action => "edit"
@redaction.old_ways.empty? &&
@redaction.old_relations.empty?
if @redaction.destroy
- flash[:notice] = t("redaction.destroy.flash")
+ flash[:notice] = t(".flash")
redirect_to :redactions
else
- flash[:error] = t("redaction.destroy.error")
+ flash[:error] = t(".error")
redirect_to @redaction
end
else
- flash[:error] = t("redaction.destroy.not_empty")
+ flash[:error] = t(".not_empty")
redirect_to @redaction
end
end
)
if @user_block.save
- flash[:notice] = t("user_block.create.flash", :name => @user.display_name)
+ flash[:notice] = t(".flash", :name => @user.display_name)
redirect_to @user_block
else
render :action => "new"
def update
if @valid_params
if @user_block.creator != current_user
- flash[:error] = t("user_block.update.only_creator_can_edit")
+ flash[:error] = t(".only_creator_can_edit")
redirect_to :action => "edit"
elsif @user_block.update(
:ends_at => Time.now.getutc + @block_period.hours,
:reason => params[:user_block][:reason],
:needs_view => params[:user_block][:needs_view]
)
- flash[:notice] = t("user_block.update.success")
+ flash[:notice] = t(".success")
redirect_to(@user_block)
else
render :action => "edit"
def revoke
if params[:confirm]
if @user_block.revoke! current_user
- flash[:notice] = t "user_block.revoke.flash"
+ flash[:notice] = t ".flash"
redirect_to(@user_block)
end
end
@valid_params = false
if !UserBlock::PERIODS.include?(@block_period)
- flash[:error] = t("user_block.filter.block_period")
+ flash[:error] = t("user_blocks.filter.block_period")
elsif @user_block && !@user_block.active?
- flash[:error] = t("user_block.filter.block_expired")
+ flash[:error] = t("user_blocks.filter.block_expired")
else
@valid_params = true
# if the block hasn't expired yet show the date, if the user just needs to login show that
if block.needs_view?
if block.ends_at > Time.now.getutc
- I18n.t("user_block.helper.time_future_and_until_login", :time => friendly_date(block.ends_at)).html_safe
+ I18n.t("user_blocks.helper.time_future_and_until_login", :time => friendly_date(block.ends_at)).html_safe
else
- I18n.t("user_block.helper.until_login")
+ I18n.t("user_blocks.helper.until_login")
end
else
- I18n.t("user_block.helper.time_future", :time => friendly_date(block.ends_at)).html_safe
+ I18n.t("user_blocks.helper.time_future", :time => friendly_date(block.ends_at)).html_safe
end
else
# the max of the last update time or the ends_at time is when this block finished
# either because the user viewed the block (updated_at) or it expired or was
# revoked (ends_at)
last_time = [block.ends_at, block.updated_at].max
- I18n.t("user_block.helper.time_past", :time => friendly_date(last_time)).html_safe
+ I18n.t("user_blocks.helper.time_past", :time => friendly_date(last_time)).html_safe
end
end
end
-<% @title = t 'redaction.edit.title' %>
+<% @title = t '.title' %>
<% content_for :heading do %>
- <h1><%= t 'redaction.edit.heading' %></h1>
+ <h1><%= t '.heading' %></h1>
<% end %>
<%= form_for(@redaction) do |f| %>
<%= f.error_messages %>
<p>
- <%= f.label :title, t('redaction.edit.title') %><br />
+ <%= f.label :title, t('.title') %><br />
<%= f.text_field :title %>
</p>
<p>
- <%= f.label :description, t('redaction.edit.description') %><br />
+ <%= f.label :description, t('.description') %><br />
<%= richtext_area :redaction, :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
</p>
<p>
- <%= f.submit t('redaction.edit.submit') %>
+ <%= f.submit t('.submit') %>
</p>
<% end %>
-
-<% @title = t('redaction.index.title') %>
+<% @title = t('.title') %>
<% content_for :heading do %>
- <h1><%= t('redaction.index.heading') %></h1>
+ <h1><%= t('.heading') %></h1>
<% end %>
<% unless @redactions.empty? %>
<%= render :partial => 'redactions' %>
<% else %>
- <p><%= t 'redaction.index.empty' %></p>
+ <p><%= t '.empty' %></p>
<% end %>
-<% @title = t 'redaction.new.title' %>
+<% @title = t '.title' %>
<% content_for :heading do %>
- <h1><%= t 'redaction.new.heading' %></h1>
+ <h1><%= t '.heading' %></h1>
<% end %>
<%= form_for(@redaction) do |f| %>
<%= f.error_messages %>
<p>
- <%= f.label :title, t('redaction.new.title') %><br />
+ <%= f.label :title, t('.title') %><br />
<%= f.text_field :title %>
</p>
<p>
- <%= f.label :description, t('redaction.new.description') %><br />
+ <%= f.label :description, t('.description') %><br />
<%= richtext_area :redaction, :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
</p>
<p>
- <%= f.submit t('redaction.new.submit') %>
+ <%= f.submit t('.submit') %>
</p>
<% end %>
-
-
-<% @title = t('redaction.show.title') %>
+<% @title = t('.title') %>
<% content_for :heading do %>
- <h1><%= t('redaction.show.heading', :title => @redaction.title) %></h1>
+ <h1><%= t('.heading', :title => @redaction.title) %></h1>
<% end %>
<p>
- <b><%= t 'redaction.show.user' %></b>
+ <b><%= t '.user' %></b>
<%= link_to(@redaction.user.display_name, user_path(@redaction.user)) %>
</p>
<p class="richtext">
- <b><%= t 'redaction.show.description' %></b>
+ <b><%= t '.description' %></b>
<%= @redaction.description.to_html %>
</p>
<% if current_user and current_user.moderator? %>
<div class="buttons">
- <%= button_to t('redaction.show.edit'), edit_redaction_path(@redaction), :method => :get %></td>
- <%= button_to t('redaction.show.destroy'), @redaction, :method => "delete", :remote => true, :data => { :confirm => t('redaction.show.confirm') } %>
+ <%= button_to t('.edit'), edit_redaction_path(@redaction), :method => :get %></td>
+ <%= button_to t('.destroy'), @redaction, :method => "delete", :remote => true, :data => { :confirm => t('.confirm') } %>
</div>
<% end %>
-<% @title = t('user_block.blocks_by.title', :name => h(@user.display_name)) %>
+<% @title = t('.title', :name => h(@user.display_name)) %>
<% content_for :heading do %>
- <h1><%= raw(t('user_block.blocks_by.heading', :name => link_to(h(@user.display_name), user_path(@user)))) %></h1>
+ <h1><%= raw(t('.heading', :name => link_to(h(@user.display_name), user_path(@user)))) %></h1>
<% end %>
<% unless @user_blocks.empty? %>
<%= render :partial => 'blocks', :locals => { :show_revoke_link => (current_user and current_user.moderator?), :show_user_name => true, :show_creator_name => false } %>
<% else %>
-<p><%= t "user_block.blocks_by.empty", :name => h(@user.display_name) %></p>
+<p><%= t ".empty", :name => h(@user.display_name) %></p>
<% end %>
-<% @title = t('user_block.blocks_on.title', :name => h(@user.display_name)) %>
+<% @title = t('.title', :name => h(@user.display_name)) %>
<% content_for :heading do %>
- <h1><%= raw(t('user_block.blocks_on.heading', :name => link_to(h(@user.display_name), user_path(@user)))) %></h1>
+ <h1><%= raw(t('.heading', :name => link_to(h(@user.display_name), user_path(@user)))) %></h1>
<% end %>
<% unless @user_blocks.empty? %>
<%= render :partial => 'blocks', :locals => { :show_revoke_link => (current_user and current_user.moderator?), :show_user_name => false, :show_creator_name => true } %>
<% else %>
-<p><%= t "user_block.blocks_on.empty", :name => h(@user.display_name) %></p>
+<p><%= t ".empty", :name => h(@user.display_name) %></p>
<% end %>
-<% @title = t 'user_block.edit.title', :name => h(@user_block.user.display_name) %>
+<% @title = t '.title', :name => h(@user_block.user.display_name) %>
<% content_for :heading do %>
- <h1><%= raw t('user_block.edit.title',
+ <h1><%= raw t('.title',
:name => link_to(h(@user_block.user.display_name),
user_path(@user_block.user))) %></h1>
<ul class='secondary-actions clearfix'>
- <li><%= link_to t('user_block.edit.show'), @user_block %></li>
- <li><%= link_to t('user_block.edit.back'), user_blocks_path %></li>
+ <li><%= link_to t('.show'), @user_block %></li>
+ <li><%= link_to t('.back'), user_blocks_path %></li>
</ul>
<% end %>
<%= f.error_messages %>
<p>
- <%= f.label :reason, t('user_block.edit.reason', :name => h(@user_block.user.display_name)) %><br />
+ <%= f.label :reason, t('.reason', :name => h(@user_block.user.display_name)) %><br />
<%= richtext_area :user_block, :reason, :cols => 80, :rows => 20, :format => @user_block.reason_format %>
</p>
<p>
- <%= label_tag 'user_block_period', t('user_block.edit.period') %><br />
- <%= select_tag('user_block_period', options_for_select(UserBlock::PERIODS.collect { |h| [t('user_block.period', :count => h), h.to_s] }, params[:user_block_period])) %>
+ <%= label_tag 'user_block_period', t('.period') %><br />
+ <%= select_tag('user_block_period', options_for_select(UserBlock::PERIODS.collect { |h| [t('user_blocks.period', :count => h), h.to_s] }, params[:user_block_period])) %>
</p>
<p>
<%= f.check_box :needs_view %>
- <%= f.label :needs_view, t('user_block.edit.needs_view') %>
+ <%= f.label :needs_view, t('.needs_view') %>
</p>
<p>
- <%= f.submit t('user_block.edit.submit') %>
+ <%= f.submit t('.submit') %>
</p>
<% end %>
-<% @title = t('user_block.index.title') %>
+<% @title = t('.title') %>
<% content_for :heading do %>
- <h1><%= t('user_block.index.heading') %></h1>
+ <h1><%= t('.heading') %></h1>
<% end %>
<% unless @user_blocks.empty? %>
<%= render :partial => 'blocks', :locals => { :show_revoke_link => (current_user and current_user.moderator?), :show_user_name => true, :show_creator_name => true } %>
<% else %>
-<p><%= t "user_block.index.empty" %></p>
+<p><%= t ".empty" %></p>
<% end %>
-<% @title = t 'user_block.new.title', :name => h(@user.display_name) %>
+<% @title = t '.title', :name => h(@user.display_name) %>
<% content_for :heading do %>
- <h1><%= raw t('user_block.new.heading',
+ <h1><%= raw t('.heading',
:name => link_to(
h(@user.display_name),
user_path(@user))) %></h1>
<%= f.error_messages %>
<p>
- <%= f.label :reason, t('user_block.new.reason', :name => @user.display_name) %><br />
+ <%= f.label :reason, t('.reason', :name => @user.display_name) %><br />
<%= richtext_area :user_block, :reason, :cols => 80, :rows => 20 %>
</p>
<p>
- <%= label_tag 'user_block_period', t('user_block.new.period') %><br />
- <%= select_tag('user_block_period', options_for_select(UserBlock::PERIODS.collect { |h| [t('user_block.period', :count => h), h.to_s] }, params[:user_block_period] )) %>
+ <%= label_tag 'user_block_period', t('.period') %><br />
+ <%= select_tag('user_block_period', options_for_select(UserBlock::PERIODS.collect { |h| [t('user_blocks.period', :count => h), h.to_s] }, params[:user_block_period] )) %>
</p>
<p>
<%= f.check_box :needs_view %>
- <%= f.label :needs_view, t('user_block.new.needs_view') %>
+ <%= f.label :needs_view, t('.needs_view') %>
</p>
<p>
<%= hidden_field_tag 'display_name', @user.display_name %>
- <%= f.submit t('user_block.new.submit') %>
+ <%= f.submit t('.submit') %>
</p>
<% end %>
-<%= link_to t('user_block.new.back'), user_blocks_path %>
+<%= link_to t('.back'), user_blocks_path %>
-<p><%= t'user_block.not_found.sorry', :id => params[:id] %></p>
+<p><%= t'.sorry', :id => params[:id] %></p>
-<%= link_to t('user_block.not_found.back'), user_blocks_path %>
+<%= link_to t('.back'), user_blocks_path %>
-<% @title = t('user_block.revoke.title',
+<% @title = t('.title',
:block_on => h(@user_block.user.display_name),
:block_by => h(@user_block.creator.display_name)) %>
<% content_for :heading do %>
- <h1><%= raw t('user_block.revoke.heading',
+ <h1><%= raw t('.heading',
:block_on => link_to(
h(@user_block.user.display_name),
user_path(@user_block.user)),
<% if @user_block.ends_at > Time.now %>
<p><b>
- <%= t('user_block.revoke.time_future', :time => distance_of_time_in_words_to_now(@user_block.ends_at)) %>
+ <%= t('.time_future', :time => distance_of_time_in_words_to_now(@user_block.ends_at)) %>
</b></p>
<%= form_for :revoke, :url => { :action => "revoke" } do |f| %>
<%= f.error_messages %>
<p>
<%= check_box_tag 'confirm', 'yes' %>
- <%= label_tag 'confirm', t('user_block.revoke.confirm') %>
+ <%= label_tag 'confirm', t('.confirm') %>
</p>
<p>
- <%= submit_tag t('user_block.revoke.revoke') %>
+ <%= submit_tag t('.revoke') %>
</p>
<% end %>
<% else %>
<p>
- <%= t('user_block.revoke.past', :time => distance_of_time_in_words_to_now(@user_block.ends_at)) %>
+ <%= t('.past', :time => distance_of_time_in_words_to_now(@user_block.ends_at)) %>
</p>
<% end %>
-<% @title = t('user_block.show.title',
+<% @title = t('.title',
:block_on => @user_block.user.display_name,
:block_by => @user_block.creator.display_name) %>
<% content_for :heading do %>
- <h1><%= raw t('user_block.show.heading',
+ <h1><%= raw t('.heading',
:block_on => link_to(
h(@user_block.user.display_name),
user_path(@user_block.user)),
<ul class='secondary-actions clearfix'>
<% if @user_block.ends_at > Time.now.getutc %>
<% if current_user and current_user.id == @user_block.creator_id %>
- <li><%= link_to t('user_block.show.edit'), edit_user_block_path(@user_block) %></li>
+ <li><%= link_to t('.edit'), edit_user_block_path(@user_block) %></li>
<% end %>
<% if current_user and current_user.moderator? %>
- <li><%= link_to(t('user_block.show.revoke'),{:controller => 'user_blocks', :action => 'revoke', :id => @user_block.id}) %></li>
+ <li><%= link_to(t('.revoke'),{:controller => 'user_blocks', :action => 'revoke', :id => @user_block.id}) %></li>
<% end %>
<% end %>
- <li><%= link_to t('user_block.show.back'), user_blocks_path %></li>
+ <li><%= link_to t('.back'), user_blocks_path %></li>
</ul>
<% end %>
<% if @user_block.revoker %>
<p>
- <b><%= t'user_block.show.revoker' %></b>
+ <b><%= t'.revoker' %></b>
<%= link_to h(@user_block.revoker.display_name), user_path(@user_block.revoker) %>
</p>
<% end %>
-<p><b><%= t'user_block.show.created' %></b>: <%= raw t'user_block.show.ago', :time => friendly_date(@user_block.created_at) %></p>
+<p><b><%= t'.created' %></b>: <%= raw t'.ago', :time => friendly_date(@user_block.created_at) %></p>
-<p><b><%= t'user_block.show.status' %></b>: <%= block_status(@user_block) %></p>
+<p><b><%= t'.status' %></b>: <%= block_status(@user_block) %></p>
-<p><b><%= t'user_block.show.reason' %></b></p>
+<p><b><%= t'.reason' %></b></p>
<div class="richtext"><%= @user_block.reason.to_html %></div>
are_you_sure: "Are you sure you want to revoke the role `%{role}' from the user `%{name}'?"
confirm: "Confirm"
fail: "Could not revoke role `%{role}' from user `%{name}'. Please check that the user and role are both valid."
- user_block:
+ user_blocks:
model:
non_moderator_update: "Must be a moderator to create or update a block."
non_moderator_revoke: "Must be a moderator to revoke a block."
back: "View all blocks"
revoker: "Revoker:"
needs_view: "The user needs to log in before this block will be cleared."
- user_blocks:
block:
not_revoked: "(not revoked)"
show: "Show"
show_address: Show address
query_features: Query features
centre_map: Centre map here
- redaction:
+ redactions:
edit:
description: "Description"
heading: "Edit redaction"