Merge branch 'master' into next

This commit is contained in:
Tom Hughes 2018-06-10 17:02:12 +01:00
commit d3700e6201
471 changed files with 490115 additions and 102173 deletions

View file

@ -2,9 +2,9 @@ $(document).ready(function () {
var id = $("#id-embed");
if (id.data("key")) {
var hashParams = OSM.params(location.hash.substring(1)),
mapParams = OSM.mapParams(),
params = {};
var hashParams = OSM.params(location.hash.substring(1));
var mapParams = OSM.mapParams();
var params = {};
if (mapParams.object) {
params.id = mapParams.object.type[0] + mapParams.object.id;
@ -20,8 +20,9 @@ $(document).ready(function () {
if (hashParams.background) params.background = hashParams.background;
if (hashParams.comment) params.comment = hashParams.comment;
if (hashParams.disable_features) params.disable_features = hashParams.disable_features;
if (hashParams.hashtags) params.hashtags = hashParams.hashtags;
if (hashParams.source) params.source = hashParams.source;
if (hashParams.disable_features) params.disable_features = hashParams.disable_features;
if (hashParams.offset) params.offset = hashParams.offset;
if (hashParams.walkthrough) params.walkthrough = hashParams.walkthrough;

View file

@ -20,6 +20,7 @@
//= require index/changeset
//= require index/query
//= require router
//= require bowser
$(document).ready(function () {
var loaderTimeout;
@ -241,7 +242,7 @@ $(document).ready(function () {
function remoteEditHandler(bbox, object) {
var loaded = false,
url = "http://127.0.0.1:8111/load_and_zoom?",
url,
query = {
left: bbox.getWest() - 0.0001,
top: bbox.getNorth() + 0.0001,
@ -249,6 +250,13 @@ $(document).ready(function () {
bottom: bbox.getSouth() - 0.0001
};
if (location.protocol === 'http' ||
bowser.check({chrome: "53", firefox: "55"})) {
url = "http://127.0.0.1:8111/load_and_zoom?";
} else {
url = "https://127.0.0.1:8112/load_and_zoom?";
}
if (object) query.select = object.type + object.id;
var iframe = $('<iframe>')

View file

@ -69,6 +69,7 @@ OSM.Directions = function (map) {
endpoint.setValue = function(value, latlng) {
endpoint.value = value;
delete endpoint.latlng;
input.removeClass("error");
input.val(value);
if (latlng) {

View file

@ -27,13 +27,12 @@ function GraphHopperEngine(id, vehicleType) {
locale: I18n.currentLocale(),
key: "LijBPDQGfu7Iiq80w3HzwB4RUDJbMbhs6BU0dEnn",
"ch.disable": vehicleType === "car",
type: "jsonp",
elevation: false,
instructions: true,
point: points.map(function (p) { return p.lat + "," + p.lng; })
},
traditional: true,
dataType: "jsonp",
dataType: "json",
success: function (data) {
if (!data.paths || data.paths.length === 0)
return callback(true);

View file

@ -32,6 +32,8 @@ function OSRMEngine() {
'turn slight left': 'javascripts.directions.instructions.slight_left',
'roundabout': 'javascripts.directions.instructions.roundabout',
'rotary': 'javascripts.directions.instructions.roundabout',
'exit roundabout': 'javascripts.directions.instructions.exit_roundabout',
'exit rotary': 'javascripts.directions.instructions.exit_roundabout',
'depart': 'javascripts.directions.instructions.start',
'arrive': 'javascripts.directions.instructions.destination',
};
@ -57,9 +59,14 @@ function OSRMEngine() {
'turn sharp left': 7,
'roundabout': 10,
'rotary': 10,
'exit roundabout': 10,
'exit rotary': 10,
'depart': 8,
'arrive': 14
};
var numToWord = function(num) {
return ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth"][num-1];
};
var transformed_steps = input_steps.map(function(step, idx) {
var maneuver_id;
@ -76,6 +83,8 @@ function OSRMEngine() {
case 'arrive':
case 'roundabout':
case 'rotary':
case 'exit roundabout':
case 'exit rotary':
maneuver_id = step.maneuver.type;
break;
case 'roundabout turn':
@ -110,11 +119,17 @@ function OSRMEngine() {
namedRoad = false;
}
if (step.maneuver.type.match(/rotary|roundabout/)) {
if (step.maneuver.type.match(/exit (rotary|roundabout)/)) {
instText += I18n.t(template, { name: name });
} else if (step.maneuver.type.match(/rotary|roundabout/)) {
if (step.maneuver.exit) {
instText += I18n.t(template + '_with_exit', { exit: step.maneuver.exit, name: name } );
if (step.maneuver.exit <= 10) {
instText += I18n.t(template + '_with_exit_ordinal', { exit: I18n.t('javascripts.directions.instructions.exit_counts.' + numToWord(step.maneuver.exit)), name: name });
} else {
instText += I18n.t(template + '_with_exit', { exit: step.maneuver.exit, name: name });
}
} else {
instText += I18n.t(template + '_without_exit', { name: name } );
instText += I18n.t(template + '_without_exit', { name: name });
}
} else if (step.maneuver.type.match(/on ramp|off ramp/)) {
var params = {};

View file

@ -287,7 +287,7 @@ OSM.Query = function(map) {
nodes = "node(" + around + ")",
ways = "way(" + around + ")",
relations = "relation(" + around + ")",
nearby = "(" + nodes + ";" + ways + ");out tags geom(" + bbox + ");" + relations + ";out geom(" + bbox + ");",
nearby = "(" + nodes + ";" + ways + ";);out tags geom(" + bbox + ");" + relations + ";out geom(" + bbox + ");",
isin = "is_in(" + lat + "," + lng + ")->.a;way(pivot.a);out tags bb;out ids geom(" + bbox + ");relation(pivot.a);out tags bb;";
$("#sidebar_content .query-intro")

View file

@ -44,7 +44,7 @@ L.OSM.Map = L.Map.extend({
}
this.baseLayers.push(new L.OSM.HOT({
attribution: copyright + ". Tiles courtesy of <a href='https://www.hotosm.org/' target='_blank'>Humanitarian OpenStreetMap Team</a>",
attribution: copyright + ". Tiles style by <a href='https://www.hotosm.org/' target='_blank'>Humanitarian OpenStreetMap Team</a>" + " hosted by <a href='https://openstreetmap.fr/' target='_blank'>OpenStreetMap France</a>",
code: "H",
keyid: "hot",
name: I18n.t("javascripts.map.base.hot")

View file

@ -0,0 +1,30 @@
$(document).ready(function () {
$(".inbox-mark-unread").on("ajax:success", function (event, data) {
$("#inboxanchor").remove();
$(".user-button").before(data.inboxanchor);
$("#inbox-count").replaceWith(data.inbox_count);
$(this).parents(".inbox-row").removeClass("inbox-row").addClass("inbox-row-unread");
});
$(".inbox-mark-read").on("ajax:success", function (event, data) {
$("#inboxanchor").remove();
$(".user-button").before(data.inboxanchor);
$("#inbox-count").replaceWith(data.inbox_count);
$(this).parents(".inbox-row-unread").removeClass("inbox-row-unread").addClass("inbox-row");
});
$(".inbox-destroy").on("ajax:success", function (event, data) {
$("#inboxanchor").remove();
$(".user-button").before(data.inboxanchor);
$("#inbox-count").replaceWith(data.inbox_count);
$(this).parents(".inbox-row, .inbox-row-unread").fadeOut(800, "linear", function () {
$(this).remove();
});
});
});

View file

@ -92,7 +92,7 @@
.railway.level_crossing::before { content: image-url('browse/level_crossing.p.16.png'); }
.shop::before { content: image-url('browse/shop_convenience.p.16.png'); }
.shop.alcohol::before { content: image-url('browse/shop_alcohol.16.pn'); }
.shop.alcohol::before { content: image-url('browse/shop_alcohol.16.png'); }
.shop.bakery::before { content: image-url('browse/shop_bakery.16.png'); }
.shop.bicycle::before { content: image-url('browse/shop_bicycle.16.png'); }
.shop.books::before { content: image-url('browse/shop_books.16.png'); }

View file

@ -1028,7 +1028,7 @@ header .search_forms,
/* Rules for search sidebar */
.search_results_entry {
#sidebar .search_results_entry {
ul li {
border-bottom: $keyline;
cursor: pointer;
@ -1036,12 +1036,9 @@ header .search_forms,
&.selected { background: $list-highlight; }
}
.search_details {
display: block;
float: right;
text-align: right;
margin-top: 0.2em;
margin-left: 0.5em;
.search_more .loader {
display: none;
width: 100%;
}
}
@ -1131,6 +1128,11 @@ tr.turn:hover {
.comments-0 {
opacity: 0.5;
}
.changeset_more .loader {
display: none;
width: 100%;
}
}
/* Rules for the browse sidebar */
@ -1668,10 +1670,6 @@ tr.turn:hover {
}
}
.content-heading .hide_unless_logged_in { // hacky selector, better to just add a new class to this div
display: inline;
}
.pagination {
padding-top: $lineheight;
}
@ -1891,14 +1889,14 @@ tr.turn:hover {
display: none;
}
.message-read .message-buttons {
.messages-show .message-buttons {
margin-top: $lineheight;
margin-bottom: $lineheight * 1.5;
padding-top: $lineheight;
border-top: 1px solid $lightgrey;
}
.message-read .buttons .mark-unread-button {
.messages-show .buttons .mark-unread-button {
border-radius: 0;
}

View file

@ -67,7 +67,7 @@ class ApiController < ApplicationController
if gpx_file.identifiable?
track << (XML::Node.new("name") << gpx_file.name)
track << (XML::Node.new("desc") << gpx_file.description)
track << (XML::Node.new("url") << url_for(:controller => "trace", :action => "view", :display_name => gpx_file.user.display_name, :id => gpx_file.id))
track << (XML::Node.new("url") << url_for(:controller => "traces", :action => "view", :display_name => gpx_file.user.display_name, :id => gpx_file.id))
end
else
# use the anonymous track segment if the user hasn't allowed

View file

@ -175,7 +175,7 @@ class ApplicationController < ActionController::Base
end
def authorize(realm = "Web Password", errormessage = "Couldn't authenticate you")
# make the @user object from any auth sources we have
# make the current_user object from any auth sources we have
setup_user_auth
# handle authenticate pass/fail
@ -295,7 +295,8 @@ class ApplicationController < ActionController::Base
end
end
def preferred_languages
def preferred_languages(reset = false)
@preferred_languages = nil if reset
@preferred_languages ||= if params[:locale]
Locale.list(params[:locale])
elsif current_user
@ -307,13 +308,13 @@ class ApplicationController < ActionController::Base
helper_method :preferred_languages
def set_locale
def set_locale(reset = false)
if current_user && current_user.languages.empty? && !http_accept_language.user_preferred_languages.empty?
current_user.languages = http_accept_language.user_preferred_languages
current_user.save
end
I18n.locale = Locale.available.preferred(preferred_languages)
I18n.locale = Locale.available.preferred(preferred_languages(reset))
response.headers["Vary"] = "Accept-Language"
response.headers["Content-Language"] = I18n.locale.to_s
@ -377,9 +378,9 @@ class ApplicationController < ActionController::Base
end
##
# ensure that there is a "this_user" instance variable
def lookup_this_user
render_unknown_user params[:display_name] unless @this_user = User.active.find_by(:display_name => params[:display_name])
# ensure that there is a "user" instance variable
def lookup_user
render_unknown_user params[:display_name] unless @user = User.active.find_by(:display_name => params[:display_name])
end
##
@ -409,10 +410,11 @@ class ApplicationController < ActionController::Base
def map_layout
append_content_security_policy_directives(
:child_src => %w[127.0.0.1:8111],
:connect_src => %w[nominatim.openstreetmap.org overpass-api.de router.project-osrm.org],
:child_src => %w[http://127.0.0.1:8111 https://127.0.0.1:8112],
:frame_src => %w[http://127.0.0.1:8111 https://127.0.0.1:8112],
:connect_src => %w[nominatim.openstreetmap.org overpass-api.de router.project-osrm.org graphhopper.com],
:form_action => %w[render.openstreetmap.org],
:script_src => %w[graphhopper.com open.mapquestapi.com],
:script_src => %w[open.mapquestapi.com],
:img_src => %w[developer.mapquest.com]
)

View file

@ -3,7 +3,7 @@ class BrowseController < ApplicationController
before_action :authorize_web
before_action :set_locale
before_action :except => [:query] { |c| c.check_database_readable(true) }
before_action(:except => [:query]) { |c| c.check_database_readable(true) }
before_action :require_oauth
around_action :web_timeout

View file

@ -4,7 +4,7 @@ class DiaryEntryController < ApplicationController
before_action :authorize_web
before_action :set_locale
before_action :require_user, :only => [:new, :edit, :comment, :hide, :hidecomment, :subscribe, :unsubscribe]
before_action :lookup_this_user, :only => [:view, :comments]
before_action :lookup_user, :only => [:view, :comments]
before_action :check_database_readable
before_action :check_database_writable, :only => [:new, :edit, :comment, :hide, :hidecomment, :subscribe, :unsubscribe]
before_action :require_administrator, :only => [:hide, :hidecomment]
@ -101,11 +101,11 @@ class DiaryEntryController < ApplicationController
def list
if params[:display_name]
@this_user = User.active.find_by(:display_name => params[:display_name])
@user = User.active.find_by(:display_name => params[:display_name])
if @this_user
@title = t "diary_entry.list.user_title", :user => @this_user.display_name
@entries = @this_user.diary_entries
if @user
@title = t "diary_entry.list.user_title", :user => @user.display_name
@entries = @user.diary_entries
else
render_unknown_user params[:display_name]
return
@ -155,9 +155,9 @@ class DiaryEntryController < ApplicationController
if user
@entries = user.diary_entries
@title = I18n.t("diary_entry.feed.user.title", :user => user.display_name)
@description = I18n.t("diary_entry.feed.user.description", :user => user.display_name)
@link = "#{SERVER_PROTOCOL}://#{SERVER_URL}/user/#{user.display_name}/diary"
@title = t("diary_entry.feed.user.title", :user => user.display_name)
@description = t("diary_entry.feed.user.description", :user => user.display_name)
@link = url_for :controller => "diary_entry", :action => "list", :display_name => user.display_name, :host => SERVER_URL, :protocol => SERVER_PROTOCOL
else
head :not_found
return
@ -167,13 +167,13 @@ class DiaryEntryController < ApplicationController
if params[:language]
@entries = @entries.where(:language_code => params[:language])
@title = I18n.t("diary_entry.feed.language.title", :language_name => Language.find(params[:language]).english_name)
@description = I18n.t("diary_entry.feed.language.description", :language_name => Language.find(params[:language]).english_name)
@link = "#{SERVER_PROTOCOL}://#{SERVER_URL}/diary/#{params[:language]}"
@title = t("diary_entry.feed.language.title", :language_name => Language.find(params[:language]).english_name)
@description = t("diary_entry.feed.language.description", :language_name => Language.find(params[:language]).english_name)
@link = url_for :controller => "diary_entry", :action => "list", :language => params[:language], :host => SERVER_URL, :protocol => SERVER_PROTOCOL
else
@title = I18n.t("diary_entry.feed.all.title")
@description = I18n.t("diary_entry.feed.all.description")
@link = "#{SERVER_PROTOCOL}://#{SERVER_URL}/diary"
@title = t("diary_entry.feed.all.title")
@description = t("diary_entry.feed.all.description")
@link = url_for :controller => "diary_entry", :action => "list", :host => SERVER_URL, :protocol => SERVER_PROTOCOL
end
end
@ -181,7 +181,7 @@ class DiaryEntryController < ApplicationController
end
def view
@entry = @this_user.diary_entries.visible.where(:id => params[:id]).first
@entry = @user.diary_entries.visible.where(:id => params[:id]).first
if @entry
@title = t "diary_entry.view.title", :user => params[:display_name], :title => @entry.title
else
@ -205,7 +205,7 @@ class DiaryEntryController < ApplicationController
def comments
@comment_pages, @comments = paginate(:diary_comments,
:conditions => {
:user_id => @this_user,
:user_id => @user,
:visible => true
},
:order => "created_at DESC",

View file

@ -1,13 +1,13 @@
class MessageController < ApplicationController
class MessagesController < ApplicationController
layout "site"
before_action :authorize_web
before_action :set_locale
before_action :require_user
before_action :lookup_this_user, :only => [:new]
before_action :lookup_user, :only => [:new]
before_action :check_database_readable
before_action :check_database_writable, :only => [:new, :reply, :mark]
before_action :allow_thirdparty_images, :only => [:new, :read]
before_action :check_database_writable, :only => [:new, :reply, :mark, :destroy]
before_action :allow_thirdparty_images, :only => [:new, :show]
# Allow the user to write a new message to another user. This action also
# deals with the sending of that message to the other user when the user
@ -16,23 +16,23 @@ class MessageController < ApplicationController
def new
if request.post?
if current_user.sent_messages.where("sent_on >= ?", Time.now.getutc - 1.hour).count >= MAX_MESSAGES_PER_HOUR
flash[:error] = t "message.new.limit_exceeded"
flash[:error] = t ".limit_exceeded"
else
@message = Message.new(message_params)
@message.recipient = @this_user
@message.recipient = @user
@message.sender = current_user
@message.sent_on = Time.now.getutc
if @message.save
flash[:notice] = t "message.new.message_sent"
flash[:notice] = t ".message_sent"
Notifier.message_notification(@message).deliver_now
redirect_to :action => "inbox", :display_name => current_user.display_name
redirect_to :action => :inbox
end
end
end
@message ||= Message.new(message_params.merge(:recipient => @this_user))
@title = t "message.new.title"
@message ||= Message.new(message_params.merge(:recipient => @user))
@title = t ".title"
end
# Allow the user to reply to another message.
@ -52,47 +52,39 @@ class MessageController < ApplicationController
render :action => "new"
else
flash[:notice] = t "message.reply.wrong_user", :user => current_user.display_name
flash[:notice] = t ".wrong_user", :user => current_user.display_name
redirect_to :controller => "user", :action => "login", :referer => request.fullpath
end
rescue ActiveRecord::RecordNotFound
@title = t "message.no_such_message.title"
@title = t "messages.no_such_message.title"
render :action => "no_such_message", :status => :not_found
end
# Show a message
def read
@title = t "message.read.title"
@message = Message.find(params[:message_id])
def show
@title = t ".title"
@message = Message.find(params[:id])
if @message.recipient == current_user || @message.sender == current_user
@message.message_read = true if @message.recipient == current_user
@message.save
else
flash[:notice] = t "message.read.wrong_user", :user => current_user.display_name
flash[:notice] = t ".wrong_user", :user => current_user.display_name
redirect_to :controller => "user", :action => "login", :referer => request.fullpath
end
rescue ActiveRecord::RecordNotFound
@title = t "message.no_such_message.title"
@title = t "messages.no_such_message.title"
render :action => "no_such_message", :status => :not_found
end
# Display the list of messages that have been sent to the user.
def inbox
@title = t "message.inbox.title"
if current_user && params[:display_name] == current_user.display_name
else
redirect_to :action => "inbox", :display_name => current_user.display_name
end
@title = t ".title"
end
# Display the list of messages that the user has sent to other users.
def outbox
@title = t "message.outbox.title"
if current_user && params[:display_name] == current_user.display_name
else
redirect_to :action => "outbox", :display_name => current_user.display_name
end
@title = t ".title"
end
# Set the message as being read or unread.
@ -100,37 +92,37 @@ class MessageController < ApplicationController
@message = Message.where("to_user_id = ? OR from_user_id = ?", current_user.id, current_user.id).find(params[:message_id])
if params[:mark] == "unread"
message_read = false
notice = t "message.mark.as_unread"
notice = t ".as_unread"
else
message_read = true
notice = t "message.mark.as_read"
notice = t ".as_read"
end
@message.message_read = message_read
if @message.save && !request.xhr?
flash[:notice] = notice
redirect_to :action => "inbox", :display_name => current_user.display_name
redirect_to :action => :inbox
end
rescue ActiveRecord::RecordNotFound
@title = t "message.no_such_message.title"
@title = t "messages.no_such_message.title"
render :action => "no_such_message", :status => :not_found
end
# Delete the message.
def delete
# Destroy the message.
def destroy
@message = Message.where("to_user_id = ? OR from_user_id = ?", current_user.id, current_user.id).find(params[:message_id])
@message.from_user_visible = false if @message.sender == current_user
@message.to_user_visible = false if @message.recipient == current_user
if @message.save && !request.xhr?
flash[:notice] = t "message.delete.deleted"
flash[:notice] = t ".destroyed"
if params[:referer]
redirect_to params[:referer]
else
redirect_to :action => "inbox", :display_name => current_user.display_name
redirect_to :action => :inbox
end
end
rescue ActiveRecord::RecordNotFound
@title = t "message.no_such_message.title"
@title = t "messages.no_such_message.title"
render :action => "no_such_message", :status => :not_found
end

View file

@ -278,14 +278,14 @@ class NotesController < ApplicationController
# Display a list of notes by a specified user
def mine
if params[:display_name]
if @this_user = User.active.find_by(:display_name => params[:display_name])
if @user = User.active.find_by(:display_name => params[:display_name])
@params = params.permit(:display_name)
@title = t "note.mine.title", :user => @this_user.display_name
@heading = t "note.mine.heading", :user => @this_user.display_name
@description = t "note.mine.subheading", :user => render_to_string(:partial => "user", :object => @this_user)
@title = t "notes.mine.title", :user => @user.display_name
@heading = t "notes.mine.heading", :user => @user.display_name
@description = t "notes.mine.subheading", :user => render_to_string(:partial => "user", :object => @user)
@page = (params[:page] || 1).to_i
@page_size = 10
@notes = @this_user.notes
@notes = @user.notes
@notes = @notes.visible unless current_user && current_user.moderator?
@notes = @notes.order("updated_at DESC, id").distinct.offset((@page - 1) * @page_size).limit(@page_size).preload(:comments => :author).to_a
else

View file

@ -30,7 +30,7 @@ class OauthController < ApplicationController
@token = current_user.oauth_tokens.find_by :token => params[:token]
if @token
@token.invalidate!
flash[:notice] = t("oauth.revoke.flash", :application => @token.client_application.name)
flash[:notice] = t(".flash", :application => @token.client_application.name)
end
redirect_to oauth_clients_url(:display_name => @token.user.display_name)
end
@ -38,10 +38,10 @@ class OauthController < ApplicationController
protected
def oauth1_authorize
append_content_security_policy_directives(:form_action => %w[*])
override_content_security_policy_directives(:form_action => []) if CSP_ENFORCE || defined?(CSP_REPORT_URL)
if @token.invalidated?
@message = t "oauth.oauthorize_failure.invalid"
@message = t "oauth.authorize_failure.invalid"
render :action => "authorize_failure"
elsif request.post?
if user_authorizes_token?
@ -69,7 +69,7 @@ class OauthController < ApplicationController
end
else
@token.invalidate!
@message = t("oauth.oauthorize_failure.denied", :app_name => @token.client_application.name)
@message = t("oauth.authorize_failure.denied", :app_name => @token.client_application.name)
render :action => "authorize_failure"
end
end

View file

@ -25,7 +25,7 @@ class RedactionsController < ApplicationController
# 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"
@ -42,7 +42,7 @@ class RedactionsController < ApplicationController
@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"
@ -54,14 +54,14 @@ class RedactionsController < ApplicationController
@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

View file

@ -120,7 +120,8 @@ class SiteController < ApplicationController
append_content_security_policy_directives(
:connect_src => %w[*],
:img_src => %w[* blob:],
:script_src => %w[dev.virtualearth.net 'unsafe-eval']
:script_src => %w[dev.virtualearth.net *.wikipedia.org www.wikidata.org services.arcgisonline.com serviceslab.arcgisonline.com 'unsafe-eval'],
:style_src => %w['unsafe-inline']
)
render "id", :layout => false

View file

@ -1,19 +1,19 @@
class TraceController < ApplicationController
class TracesController < ApplicationController
layout "site", :except => :georss
skip_before_action :verify_authenticity_token, :only => [:api_create, :api_read, :api_update, :api_delete, :api_data]
before_action :authorize_web
before_action :set_locale
before_action :require_user, :only => [:mine, :create, :edit, :delete]
before_action :require_user, :only => [:mine, :new, :create, :edit, :delete]
before_action :authorize, :only => [:api_create, :api_read, :api_update, :api_delete, :api_data]
before_action :check_database_readable, :except => [:api_read, :api_data]
before_action :check_database_writable, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete]
before_action :check_database_writable, :only => [:new, :create, :edit, :delete, :api_create, :api_update, :api_delete]
before_action :check_api_readable, :only => [:api_read, :api_data]
before_action :check_api_writable, :only => [:api_create, :api_update, :api_delete]
before_action :require_allow_read_gpx, :only => [:api_read, :api_data]
before_action :require_allow_write_gpx, :only => [:api_create, :api_update, :api_delete]
before_action :offline_warning, :only => [:mine, :view]
before_action :offline_redirect, :only => [:create, :edit, :delete, :data, :api_create, :api_delete, :api_data]
before_action :offline_redirect, :only => [:new, :create, :edit, :delete, :data, :api_create, :api_delete, :api_data]
around_action :api_call_handle_error, :only => [:api_create, :api_read, :api_update, :api_delete, :api_data]
# Counts and selects pages of GPX traces for various criteria (by user, tags, public etc.).
@ -31,14 +31,14 @@ class TraceController < ApplicationController
# set title
@title = if target_user.nil?
t "trace.list.public_traces"
t ".public_traces"
elsif current_user && current_user == target_user
t "trace.list.my_traces"
t ".my_traces"
else
t "trace.list.public_traces_from", :user => target_user.display_name
t ".public_traces_from", :user => target_user.display_name
end
@title += t "trace.list.tagged_with", :tags => params[:tag] if params[:tag]
@title += t ".tagged_with", :tags => params[:tag] if params[:tag]
# four main cases:
# 1 - all traces, logged in = all public traces + all user's (i.e + all mine)
@ -94,50 +94,50 @@ class TraceController < ApplicationController
if @trace && @trace.visible? &&
(@trace.public? || @trace.user == current_user)
@title = t "trace.view.title", :name => @trace.name
@title = t ".title", :name => @trace.name
else
flash[:error] = t "trace.view.trace_not_found"
flash[:error] = t ".trace_not_found"
redirect_to :action => "list"
end
rescue ActiveRecord::RecordNotFound
flash[:error] = t "trace.view.trace_not_found"
flash[:error] = t ".trace_not_found"
redirect_to :action => "list"
end
def new
@title = t ".upload_trace"
@trace = Trace.new(:visibility => default_visibility)
end
def create
if request.post?
logger.info(params[:trace][:gpx_file].class.name)
logger.info(params[:trace][:gpx_file].class.name)
if params[:trace][:gpx_file].respond_to?(:read)
begin
do_create(params[:trace][:gpx_file], params[:trace][:tagstring],
params[:trace][:description], params[:trace][:visibility])
rescue StandardError => ex
logger.debug ex
end
if params[:trace][:gpx_file].respond_to?(:read)
begin
do_create(params[:trace][:gpx_file], params[:trace][:tagstring],
params[:trace][:description], params[:trace][:visibility])
rescue StandardError => ex
logger.debug ex
end
if @trace.id
flash[:notice] = t "trace.create.trace_uploaded"
if @trace.id
flash[:notice] = t ".trace_uploaded"
flash[:warning] = t ".traces_waiting", :count => current_user.traces.where(:inserted => false).count if current_user.traces.where(:inserted => false).count > 4
flash[:warning] = t "trace.trace_header.traces_waiting", :count => current_user.traces.where(:inserted => false).count if current_user.traces.where(:inserted => false).count > 4
redirect_to :action => :list, :display_name => current_user.display_name
end
else
@trace = Trace.new(:name => "Dummy",
:tagstring => params[:trace][:tagstring],
:description => params[:trace][:description],
:visibility => params[:trace][:visibility],
:inserted => false, :user => current_user,
:timestamp => Time.now.getutc)
@trace.valid?
@trace.errors.add(:gpx_file, "can't be blank")
redirect_to :action => :list, :display_name => current_user.display_name
end
else
@trace = Trace.new(:visibility => default_visibility)
@trace = Trace.new(:name => "Dummy",
:tagstring => params[:trace][:tagstring],
:description => params[:trace][:description],
:visibility => params[:trace][:visibility],
:inserted => false, :user => current_user,
:timestamp => Time.now.getutc)
@trace.valid?
@trace.errors.add(:gpx_file, "can't be blank")
@title = t ".upload_trace"
render :action => "new"
end
@title = t "trace.create.upload_trace"
end
def data
@ -168,7 +168,7 @@ class TraceController < ApplicationController
elsif current_user.nil? || @trace.user != current_user
head :forbidden
else
@title = t "trace.edit.title", :name => @trace.name
@title = t ".title", :name => @trace.name
if request.post? && params[:trace]
@trace.description = params[:trace][:description]
@ -191,7 +191,7 @@ class TraceController < ApplicationController
else
trace.visible = false
trace.save
flash[:notice] = t "trace.delete.scheduled_for_deletion"
flash[:notice] = t ".scheduled_for_deletion"
redirect_to :action => :list, :display_name => trace.user.display_name
end
rescue ActiveRecord::RecordNotFound
@ -385,7 +385,7 @@ class TraceController < ApplicationController
end
def offline_warning
flash.now[:warning] = t "trace.offline_warning.message" if STATUS == :gpx_offline
flash.now[:warning] = t "traces.offline_warning.message" if STATUS == :gpx_offline
end
def offline_redirect

View file

@ -5,7 +5,7 @@ class UserBlocksController < ApplicationController
before_action :set_locale
before_action :require_user, :only => [:new, :create, :edit, :update, :revoke]
before_action :require_moderator, :only => [:new, :create, :edit, :update, :revoke]
before_action :lookup_this_user, :only => [:new, :create, :blocks_on, :blocks_by]
before_action :lookup_user, :only => [:new, :create, :blocks_on, :blocks_by]
before_action :lookup_user_block, :only => [:show, :edit, :update, :revoke]
before_action :require_valid_params, :only => [:create, :update]
before_action :check_database_readable
@ -37,7 +37,7 @@ class UserBlocksController < ApplicationController
def create
if @valid_params
@user_block = UserBlock.new(
:user => @this_user,
:user => @user,
:creator => current_user,
:reason => params[:user_block][:reason],
:ends_at => Time.now.getutc + @block_period.hours,
@ -45,7 +45,7 @@ class UserBlocksController < ApplicationController
)
if @user_block.save
flash[:notice] = t("user_block.create.flash", :name => @this_user.display_name)
flash[:notice] = t(".flash", :name => @user.display_name)
redirect_to @user_block
else
render :action => "new"
@ -58,14 +58,14 @@ class UserBlocksController < ApplicationController
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"
@ -80,7 +80,7 @@ class UserBlocksController < ApplicationController
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
@ -92,7 +92,7 @@ class UserBlocksController < ApplicationController
@params = params.permit(:display_name)
@user_blocks_pages, @user_blocks = paginate(:user_blocks,
:include => [:user, :creator, :revoker],
:conditions => { :user_id => @this_user.id },
:conditions => { :user_id => @user.id },
:order => "user_blocks.ends_at DESC",
:per_page => 20)
end
@ -103,7 +103,7 @@ class UserBlocksController < ApplicationController
@params = params.permit(:display_name)
@user_blocks_pages, @user_blocks = paginate(:user_blocks,
:include => [:user, :creator, :revoker],
:conditions => { :creator_id => @this_user.id },
:conditions => { :creator_id => @user.id },
:order => "user_blocks.ends_at DESC",
:per_page => 20)
end
@ -128,10 +128,10 @@ class UserBlocksController < ApplicationController
@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

View file

@ -118,7 +118,6 @@ class UserController < ApplicationController
end
def account
@title = t "user.account.title"
@tokens = current_user.oauth_tokens.authorized
if params[:user] && params[:user][:display_name] && params[:user][:description]
@ -135,6 +134,7 @@ class UserController < ApplicationController
current_user.errors.add(attribute, error)
end
end
@title = t "user.account.title"
end
def go_public
@ -377,7 +377,7 @@ class UserController < ApplicationController
end
def api_read
if @this_user.visible?
if @user.visible?
render :action => :api_read, :content_type => "text/xml"
else
head :gone
@ -385,7 +385,7 @@ class UserController < ApplicationController
end
def api_details
@this_user = current_user
@user = current_user
render :action => :api_read, :content_type => "text/xml"
end
@ -398,11 +398,11 @@ class UserController < ApplicationController
end
def view
@this_user = User.find_by(:display_name => params[:display_name])
@user = User.find_by(:display_name => params[:display_name])
if @this_user &&
(@this_user.visible? || (current_user && current_user.administrator?))
@title = @this_user.display_name
if @user &&
(@user.visible? || (current_user && current_user.administrator?))
@title = @user.display_name
else
render_unknown_user params[:display_name]
end
@ -462,15 +462,15 @@ class UserController < ApplicationController
##
# sets a user's status
def set_status
@this_user.status = params[:status]
@this_user.save
@user.status = params[:status]
@user.save
redirect_to :action => "view", :display_name => params[:display_name]
end
##
# delete a user, marking them as deleted and removing personal data
def delete
@this_user.delete
@user.delete
redirect_to :action => "view", :display_name => params[:display_name]
end
@ -712,7 +712,7 @@ class UserController < ApplicationController
end
if user.save
set_locale
set_locale(true)
if user.new_email.blank? || user.new_email == user.email
flash.now[:notice] = t "user.account.flash update success"
@ -761,17 +761,17 @@ class UserController < ApplicationController
end
##
# ensure that there is a "this_user" instance variable
# ensure that there is a "user" instance variable
def lookup_user_by_id
@this_user = User.find(params[:id])
@user = User.find(params[:id])
end
##
# ensure that there is a "this_user" instance variable
# ensure that there is a "user" instance variable
def lookup_user_by_name
@this_user = User.find_by(:display_name => params[:display_name])
@user = User.find_by(:display_name => params[:display_name])
rescue ActiveRecord::RecordNotFound
redirect_to :action => "view", :display_name => params[:display_name] unless @this_user
redirect_to :action => "view", :display_name => params[:display_name] unless @user
end
##

View file

@ -1,5 +1,5 @@
# Update and read user preferences, which are arbitrayr key/val pairs
class UserPreferenceController < ApplicationController
class UserPreferencesController < ApplicationController
skip_before_action :verify_authenticity_token
before_action :authorize
before_action :require_allow_read_prefs, :only => [:read_one, :read]

View file

@ -3,25 +3,25 @@ class UserRolesController < ApplicationController
before_action :authorize_web
before_action :require_user
before_action :lookup_this_user
before_action :lookup_user
before_action :require_administrator
before_action :require_valid_role
before_action :not_in_role, :only => [:grant]
before_action :in_role, :only => [:revoke]
def grant
@this_user.roles.create(:role => @role, :granter => current_user)
redirect_to user_path(@this_user)
@user.roles.create(:role => @role, :granter => current_user)
redirect_to user_path(@user)
end
def revoke
# checks that administrator role is not revoked from current user
if current_user == @this_user && @role == "administrator"
if current_user == @user && @role == "administrator"
flash[:error] = t("user_role.filter.not_revoke_admin_current_user")
else
UserRole.where(:user_id => @this_user.id, :role => @role).delete_all
UserRole.where(:user_id => @user.id, :role => @role).delete_all
end
redirect_to user_path(@this_user)
redirect_to user_path(@user)
end
private
@ -32,7 +32,7 @@ class UserRolesController < ApplicationController
def require_administrator
unless current_user.administrator?
flash[:error] = t "user_role.filter.not_an_administrator"
redirect_to user_path(@this_user)
redirect_to user_path(@user)
end
end
@ -43,25 +43,25 @@ class UserRolesController < ApplicationController
@role = params[:role]
unless UserRole::ALL_ROLES.include?(@role)
flash[:error] = t("user_role.filter.not_a_role", :role => @role)
redirect_to user_path(@this_user)
redirect_to user_path(@user)
end
end
##
# checks that the user doesn't already have this role
def not_in_role
if @this_user.has_role? @role
if @user.has_role? @role
flash[:error] = t("user_role.filter.already_has_role", :role => @role)
redirect_to user_path(@this_user)
redirect_to user_path(@user)
end
end
##
# checks that the user already has this role
def in_role
unless @this_user.has_role? @role
unless @user.has_role? @role
flash[:error] = t("user_role.filter.doesnt_have_role", :role => @role)
redirect_to user_path(@this_user)
redirect_to user_path(@user)
end
end
end

View file

@ -17,44 +17,6 @@ module ApplicationHelper
link_to(image_tag("RSS.png", :size => "16x16", :border => 0), Hash[*args], :class => "rsssmall")
end
def style_rules
css = ""
css << ".hidden { display: none !important }"
css << ".hide_unless_logged_in { display: none !important }" unless current_user
css << ".hide_if_logged_in { display: none !important }" if current_user
css << ".hide_if_user_#{current_user.id} { display: none !important }" if current_user
css << ".show_if_user_#{current_user.id} { display: inline !important }" if current_user
css << ".hide_unless_administrator { display: none !important }" unless current_user && current_user.administrator?
css << ".hide_unless_moderator { display: none !important }" unless current_user && current_user.moderator?
content_tag(:style, css, :type => "text/css")
end
def if_logged_in(tag = :div, &block)
content_tag(tag, capture(&block), :class => "hide_unless_logged_in")
end
def if_not_logged_in(tag = :div, &block)
content_tag(tag, capture(&block), :class => "hide_if_logged_in")
end
def if_user(user, tag = :div, &block)
content_tag(tag, capture(&block), :class => "hidden show_if_user_#{user.id}") if user
end
def unless_user(user, tag = :div, &block)
if user
content_tag(tag, capture(&block), :class => "hide_if_user_#{user.id}")
else
content_tag(tag, capture(&block))
end
end
def if_administrator(tag = :div, &block)
content_tag(tag, capture(&block), :class => "hide_unless_administrator")
end
def richtext_area(object_name, method, options = {})
id = "#{object_name}_#{method}"
type = options.delete(:format) || "markdown"

View file

@ -163,7 +163,7 @@ module BrowseHelper
# The simple wikidata-tag (this is limited to only one value)
if key == "wikidata" && value =~ /^[Qq][1-9][0-9]*$/
return [{
:url => "//www.wikidata.org/wiki/#{value}?uselang=#{I18n.locale}",
:url => "//www.wikidata.org/entity/#{value}?uselang=#{I18n.locale}",
:title => value
}]
# Key has to be one of the accepted wikidata-tags
@ -172,7 +172,7 @@ module BrowseHelper
value =~ /^[Qq][1-9][0-9]*(\s*;\s*[Qq][1-9][0-9]*)*$/
# Splitting at every semicolon to get a separate hash for each wikidata-ID
return value.split(";").map do |id|
{ :title => id, :url => "//www.wikidata.org/wiki/#{id.strip}?uselang=#{I18n.locale}" }
{ :title => id, :url => "//www.wikidata.org/entity/#{id.strip}?uselang=#{I18n.locale}" }
end
end
nil

View file

@ -7,19 +7,19 @@ module UserBlocksHelper
# 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

View file

@ -8,9 +8,7 @@ class Notifier < ActionMailer::Base
def signup_confirm(user, token)
with_recipient_locale user do
@url = url_for(:host => SERVER_URL,
:protocol => SERVER_PROTOCOL,
:controller => "user", :action => "confirm",
@url = url_for(:controller => "user", :action => "confirm",
:display_name => user.display_name,
:confirm_string => token.token)
@ -22,9 +20,7 @@ class Notifier < ActionMailer::Base
def email_confirm(user, token)
with_recipient_locale user do
@address = user.new_email
@url = url_for(:host => SERVER_URL,
:protocol => SERVER_PROTOCOL,
:controller => "user", :action => "confirm_email",
@url = url_for(:controller => "user", :action => "confirm_email",
:confirm_string => token.token)
mail :to => user.new_email,
@ -34,9 +30,7 @@ class Notifier < ActionMailer::Base
def lost_password(user, token)
with_recipient_locale user do
@url = url_for(:host => SERVER_URL,
:protocol => SERVER_PROTOCOL,
:controller => "user", :action => "reset_password",
@url = url_for(:controller => "user", :action => "reset_password",
:token => token.token)
mail :to => user.email,
@ -75,14 +69,8 @@ class Notifier < ActionMailer::Base
@from_user = message.sender.display_name
@text = message.body
@title = message.title
@readurl = url_for(:host => SERVER_URL,
:protocol => SERVER_PROTOCOL,
:controller => "message", :action => "read",
:message_id => message.id)
@replyurl = url_for(:host => SERVER_URL,
:protocol => SERVER_PROTOCOL,
:controller => "message", :action => "reply",
:message_id => message.id)
@readurl = message_url(message)
@replyurl = reply_message_url(message)
@author = @from_user
attach_user_avatar(message.sender)
@ -99,26 +87,18 @@ class Notifier < ActionMailer::Base
@from_user = comment.user.display_name
@text = comment.body
@title = comment.diary_entry.title
@readurl = url_for(:host => SERVER_URL,
:protocol => SERVER_PROTOCOL,
:controller => "diary_entry",
@readurl = url_for(:controller => "diary_entry",
:action => "view",
:display_name => comment.diary_entry.user.display_name,
:id => comment.diary_entry.id,
:anchor => "comment#{comment.id}")
@commenturl = url_for(:host => SERVER_URL,
:protocol => SERVER_PROTOCOL,
:controller => "diary_entry",
@commenturl = url_for(:controller => "diary_entry",
:action => "view",
:display_name => comment.diary_entry.user.display_name,
:id => comment.diary_entry.id,
:anchor => "newcomment")
@replyurl = url_for(:host => SERVER_URL,
:protocol => SERVER_PROTOCOL,
:controller => "message",
:action => "new",
:display_name => comment.user.display_name,
:title => "Re: #{comment.diary_entry.title}")
@replyurl = new_message_url(comment.user, :message => { :title => "Re: #{comment.diary_entry.title}" })
@author = @from_user
attach_user_avatar(comment.user)
@ -132,13 +112,9 @@ class Notifier < ActionMailer::Base
def friend_notification(friend)
with_recipient_locale friend.befriendee do
@friend = friend
@viewurl = url_for(:host => SERVER_URL,
:protocol => SERVER_PROTOCOL,
:controller => "user", :action => "view",
@viewurl = url_for(:controller => "user", :action => "view",
:display_name => @friend.befriender.display_name)
@friendurl = url_for(:host => SERVER_URL,
:protocol => SERVER_PROTOCOL,
:controller => "user", :action => "make_friend",
@friendurl = url_for(:controller => "user", :action => "make_friend",
:display_name => @friend.befriender.display_name)
@author = @friend.befriender.display_name
@ -150,7 +126,7 @@ class Notifier < ActionMailer::Base
def note_comment_notification(comment, recipient)
with_recipient_locale recipient do
@noteurl = browse_note_url(comment.note, :host => SERVER_URL)
@noteurl = browse_note_url(comment.note)
@place = Nominatim.describe_location(comment.note.lat, comment.note.lon, 14, I18n.locale)
@comment = comment.body
@owner = recipient == comment.note.author
@ -178,7 +154,7 @@ class Notifier < ActionMailer::Base
def changeset_comment_notification(comment, recipient)
with_recipient_locale recipient do
@to_user = recipient.display_name
@changeset_url = changeset_url(comment.changeset, :host => SERVER_URL)
@changeset_url = changeset_url(comment.changeset)
@comment = comment.body
@owner = recipient == comment.changeset.user
@commenter = comment.author.display_name
@ -202,7 +178,7 @@ class Notifier < ActionMailer::Base
private
def set_shared_template_vars
@root_url = root_url(:host => SERVER_URL)
@root_url = root_url
end
def attach_project_logo

View file

@ -117,6 +117,7 @@ class User < ActiveRecord::Base
before_save :encrypt_password
before_save :update_tile
after_save :spam_check
after_save :reset_preferred_languages
def to_param
display_name
@ -197,6 +198,10 @@ class User < ActiveRecord::Base
@preferred_languages ||= Locale.list(languages)
end
def reset_preferred_languages
@preferred_languages = nil
end
def nearby(radius = NEARBY_RADIUS, num = NEARBY_USERS)
if home_lon && home_lat
gc = OSM::GreatCircle.new(home_lat, home_lon)

View file

@ -1,8 +1,8 @@
<li><%=
linked_name = link_to h(printable_name(containing_relation.relation)), :action => "relation", :id => containing_relation.relation.id.to_s
if containing_relation.member_role.blank?
raw t 'browse.containing_relation.entry', :relation_name => linked_name
raw t '.entry', :relation_name => linked_name
else
raw t 'browse.containing_relation.entry_role', :relation_name => linked_name, :relation_role => h(containing_relation.member_role)
raw t '.entry_role', :relation_name => linked_name, :relation_role => h(containing_relation.member_role)
end
%></li>
%></li>

View file

@ -16,7 +16,7 @@
<% end %>
<% unless relation.relation_members.empty? %>
<h4><%= t'browse.relation.members' %></h4>
<h4><%= t '.members' %></h4>
<ul><%= render :partial => "relation_member", :collection => relation.relation_members %></ul>
<% end %>
</div>

View file

@ -1,12 +1,12 @@
<%
member_class = link_class(relation_member.member_type.downcase, relation_member.member)
linked_name = link_to printable_name(relation_member.member), { :action => relation_member.member_type.downcase, :id => relation_member.member_id.to_s }, :title => link_title(relation_member.member), :rel => link_follow(relation_member.member)
type_str = t'browse.relation_member.type.' + relation_member.member_type.downcase
type_str = t '.type.' + relation_member.member_type.downcase
%>
<li class="<%= member_class %>"><%=
if relation_member.member_role.blank?
raw t'browse.relation_member.entry', :type => type_str, :name => linked_name
raw t '.entry', :type => type_str, :name => linked_name
else
raw t'browse.relation_member.entry_role', :type => type_str, :name => linked_name, :role => h(relation_member.member_role)
raw t '.entry_role', :type => type_str, :name => linked_name, :role => h(relation_member.member_role)
end
%></li>

View file

@ -1,5 +1,5 @@
<% unless tag_details.empty? %>
<h4><%= t 'browse.tag_details.tags' %></h4>
<h4><%= t '.tags' %></h4>
<table class='browse-tag-list'>
<%= render :partial => "tag", :collection => tag_details.sort %>
</table>

View file

@ -18,14 +18,14 @@
<% end %>
<% unless way.way_nodes.empty? %>
<h4><%= t'browse.way.nodes' %></h4>
<h4><%= t '.nodes' %></h4>
<ul>
<% way.way_nodes.each do |wn| %>
<li>
<%= link_to printable_name(wn.node), { :action => "node", :id => wn.node_id.to_s }, :class => link_class('node', wn.node), :title => link_title(wn.node), :rel => link_follow(wn.node) %>
<% related_ways = wn.node.ways.reject { |w| w.id == wn.way_id } %>
<% if related_ways.size > 0 then %>
(<%= raw t 'browse.way.also_part_of', :count => related_ways.size, :related_ways => related_ways.map { |w| link_to(printable_name(w), { :action => "way", :id => w.id.to_s }, :class => link_class('way', w), :title => link_title(w) ) }.to_sentence %>)
(<%= raw t '.also_part_of', :count => related_ways.size, :related_ways => related_ways.map { |w| link_to(printable_name(w), { :action => "way", :id => w.id.to_s }, :class => link_class('way', w), :title => link_title(w) ) }.to_sentence %>)
<% end %>
</li>
<% end %>

View file

@ -1,8 +1,8 @@
<% set_title(t('browse.changeset.title', :id => @changeset.id)) %>
<% set_title(t('.title', :id => @changeset.id)) %>
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= t('browse.changeset.title', :id => @changeset.id) %>
<%= t('.title', :id => @changeset.id) %>
</h2>
<div class="browse-section">
@ -11,17 +11,19 @@
<%= render :partial => "tag_details", :object => @changeset.tags.except('comment') %>
<h4 class="comments-header"><%= t('browse.changeset.discussion') %></h4>
<h4 class="comments-header"><%= t('.discussion') %></h4>
<div class="buttons clearfix subscribe-buttons">
<form action="#" class="hide_unless_logged_in">
<% if current_user and @changeset.subscribers.exists?(current_user.id) %>
<input class="action-button" type="submit" name="unsubscribe" value="<%= t('javascripts.changesets.show.unsubscribe') %>" data-method="POST" data-url="<%= changeset_unsubscribe_url(@changeset) %>" />
<% else %>
<input class="action-button" type="submit" name="subscribe" value="<%= t('javascripts.changesets.show.subscribe') %>" data-method="POST" data-url="<%= changeset_subscribe_url(@changeset) %>" />
<% end %>
</form>
</div>
<% if current_user %>
<div class="buttons clearfix subscribe-buttons">
<form action="#">
<% if @changeset.subscribers.exists?(current_user.id) %>
<input class="action-button" type="submit" name="unsubscribe" value="<%= t('javascripts.changesets.show.unsubscribe') %>" data-method="POST" data-url="<%= changeset_unsubscribe_url(@changeset) %>" />
<% else %>
<input class="action-button" type="submit" name="subscribe" value="<%= t('javascripts.changesets.show.subscribe') %>" data-method="POST" data-url="<%= changeset_subscribe_url(@changeset) %>" />
<% end %>
</form>
</div>
<% end %>
<div class="clearfix"></div>
@ -33,7 +35,7 @@
<% if comment.visible %>
<li id="c<%= comment.id %>">
<small class='deemphasize'>
<%= t("browse.changeset.commented_by",
<%= t(".commented_by",
:when => friendly_date(comment.created_at), :exact_time => l(comment.created_at),
:user => link_to(h(comment.author.display_name), user_path(comment.author))).html_safe %>
<% if current_user and current_user.moderator? %>
@ -45,7 +47,7 @@
<% elsif current_user and current_user.moderator? %>
<li id="c<%= comment.id %>">
<small class='deemphasize'>
<%= t("browse.changeset.hidden_commented_by",
<%= t(".hidden_commented_by",
:when => friendly_date(comment.created_at), :exact_time => l(comment.created_at),
:user => link_to(h(comment.author.display_name), user_path(comment.author))).html_safe %>
— <span class="action-button deemphasize" data-comment-id="<%= comment.id %>" data-method="POST" data-url="<%= changeset_comment_unhide_url(comment.id) %>"><%= t('javascripts.changesets.show.unhide_comment') %></span>
@ -59,23 +61,27 @@
</div>
<% end %>
<div class="notice hide_if_logged_in">
<%= link_to(t("browse.changeset.join_discussion"), :controller => 'user', :action => 'login', :referer => request.fullpath) %>
</div>
<% unless @changeset.is_open? %>
<form action="#" class="hide_unless_logged_in">
<textarea class="comment" name="text" cols="40" rows="5"></textarea>
<div class="buttons clearfix">
<input type="submit" name="comment" value="<%= t('javascripts.changesets.show.comment') %>" data-changeset-id="<%= @changeset.id %>" data-method="POST" data-url="<%= changeset_comment_url(@changeset) %>" disabled="1"/>
</div>
</form>
<% else %>
<div class="notice hide_unless_logged_in">
<%= t('browse.changeset.still_open') %>
<% unless current_user %>
<div class="notice">
<%= link_to(t(".join_discussion"), :controller => 'user', :action => 'login', :referer => request.fullpath) %>
</div>
<% end %>
<% if current_user %>
<% unless @changeset.is_open? %>
<form action="#">
<textarea class="comment" name="text" cols="40" rows="5"></textarea>
<div class="buttons clearfix">
<input type="submit" name="comment" value="<%= t('javascripts.changesets.show.comment') %>" data-changeset-id="<%= @changeset.id %>" data-method="POST" data-url="<%= changeset_comment_url(@changeset) %>" disabled="1"/>
</div>
</form>
<% else %>
<div class="notice">
<%= t('.still_open') %>
</div>
<% end %>
<% end %>
<% unless @ways.empty? %>
<h4>
<%= type_and_paginated_count('way', @way_pages) %>
@ -131,7 +137,7 @@
<% end %>
<div class='secondary-actions'>
<%= link_to(t('browse.changeset.changesetxml'), :controller => "changeset", :action => "read") %>
<%= link_to(t('.changesetxml'), :controller => "changeset", :action => "read") %>
&middot;
<%= link_to(t('browse.changeset.osmchangexml'), :controller => "changeset", :action => "download") %>
<%= link_to(t('.osmchangexml'), :controller => "changeset", :action => "download") %>
</div>

View file

@ -1,12 +1,4 @@
<%
browse_not_found_type = {
'node' => I18n.t('browse.not_found.type.node'),
'way' => I18n.t('browse.not_found.type.way'),
'relation' => I18n.t('browse.not_found.type.relation'),
'changeset' => I18n.t('browse.not_found.type.changeset'),
};
%>
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= t'browse.not_found.sorry', :type=> browse_not_found_type[@type] , :id => params[:id] %></h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= t ".sorry", :type => t(".type.#{@type}"), :id => params[:id] %>
</h2>

View file

@ -1,12 +1,12 @@
<% set_title(t('browse.note.title', :id => @note.id)) %>
<% set_title(t('.title', :id => @note.id)) %>
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= t "browse.note.#{@note.status}_title", :note_name => @note.id %>
<%= t ".#{@note.status}_title", :note_name => @note.id %>
</h2>
<div class="browse-section">
<h4><%= t('browse.note.description') %></h4>
<h4><%= t('.description') %></h4>
<div class="note-description">
<%= h(@note_comments.first.body.to_html) %>
</div>
@ -44,8 +44,12 @@
<form action="#">
<textarea class="comment" name="text" cols="40" rows="5"></textarea>
<div class="buttons clearfix">
<input type="submit" name="hide" value="<%= t('javascripts.notes.show.hide') %>" class="hide_unless_moderator deemphasize" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, 'json') %>">
<input type="submit" name="close" value="<%= t('javascripts.notes.show.resolve') %>" class="hide_unless_logged_in" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= close_note_url(@note, 'json') %>">
<% if current_user and current_user.moderator? -%>
<input type="submit" name="hide" value="<%= t('javascripts.notes.show.hide') %>" class="deemphasize" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, 'json') %>">
<% end -%>
<% if current_user -%>
<input type="submit" name="close" value="<%= t('javascripts.notes.show.resolve') %>" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= close_note_url(@note, 'json') %>">
<% end -%>
<input type="submit" name="comment" value="<%= t('javascripts.notes.show.comment') %>" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= comment_note_url(@note, 'json') %>" disabled="1">
</div>
</form>
@ -53,8 +57,12 @@
<form action="#">
<input type="hidden" name="text" value="">
<div class="buttons clearfix">
<input type="submit" name="hide" value="<%= t('javascripts.notes.show.hide') %>" class="hide_unless_moderator deemphasize" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, 'json') %>">
<input type="submit" name="reopen" value="<%= t('javascripts.notes.show.reactivate') %>" class="hide_unless_logged_in" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= reopen_note_url(@note, 'json') %>">
<% if current_user and current_user.moderator? -%>
<input type="submit" name="hide" value="<%= t('javascripts.notes.show.hide') %>" class="deemphasize" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, 'json') %>">
<% end -%>
<% if current_user -%>
<input type="submit" name="reopen" value="<%= t('javascripts.notes.show.reactivate') %>" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= reopen_note_url(@note, 'json') %>">
<% end -%>
</div>
</form>
<% end %>

View file

@ -1,22 +1,22 @@
<% set_title(t "browse.query.title") %>
<% set_title(t ".title") %>
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= t "browse.query.title" %>
<%= t ".title" %>
</h2>
<div class="query-intro">
<p><%= t("browse.query.introduction") %></p>
<p><%= t(".introduction") %></p>
</div>
<div id="query-nearby" class="query-results">
<h3><%= t("browse.query.nearby") %></h3>
<h3><%= t(".nearby") %></h3>
<%= image_tag "searching.gif", :class => "loader" %>
<ul class="query-results-list"></ul>
</div>
<div id="query-isin" class="query-results">
<h3><%= t("browse.query.enclosing") %></h3>
<h3><%= t(".enclosing") %></h3>
<%= image_tag "searching.gif", :class => "loader" %>
<ul class="query-results-list"></ul>
</div>

View file

@ -1,12 +1,4 @@
<%
browse_timeout_type = {
'node' => I18n.t('browse.timeout.type.node'),
'way' => I18n.t('browse.timeout.type.way'),
'relation' => I18n.t('browse.timeout.type.relation'),
'changeset' => I18n.t('browse.timeout.type.changeset'),
};
%>
<div class="browse-section">
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= t'browse.timeout.sorry', :type=> browse_timeout_type[@type] , :id => params[:id] %>
<%= t '.sorry', :type => t(".type.#{@type}"), :id => params[:id] %>
</div>

View file

@ -4,14 +4,14 @@
</ol>
<% if @edits.size == 20 -%>
<div class="changeset_more">
<%= link_to t('changeset.list.load_more'), url_for(@params.merge(:max_id => @edits.last.id - 1)), :class => "button load_more" %>
<%= image_tag "searching.gif", :class => "loader", :style => "display: none;" %>
<%= link_to t('.load_more'), url_for(@params.merge(:max_id => @edits.last.id - 1)), :class => "button load_more" %>
<div class="loader"><%= image_tag "searching.gif" %></div>
</div>
<% end -%>
<% elsif params[:bbox] %>
<div class="inner22"><%= t(params[:max_id] ? 'changeset.list.no_more_area' : 'changeset.list.empty_area') %></div>
<div class="inner22"><%= t(params[:max_id] ? '.no_more_area' : '.empty_area') %></div>
<% elsif params[:display_name] %>
<div class="inner22"><%= t(params[:max_id] ? 'changeset.list.no_more_user' : 'changeset.list.empty_user') %></div>
<div class="inner22"><%= t(params[:max_id] ? '.no_more_user' : '.empty_user') %></div>
<% else %>
<div class="inner22"><%= t(params[:max_id] ? 'changeset.list.no_more' : 'changeset.list.empty') %></div>
<div class="inner22"><%= t(params[:max_id] ? '.no_more' : '.empty') %></div>
<% end %>

View file

@ -6,7 +6,7 @@ atom_feed(:language => I18n.locale, :schema_date => 2009,
feed.subtitle :type => "xhtml" do |xhtml|
xhtml.p do |p|
p << t("changeset.timeout.sorry")
p << t(".sorry")
end
end
end

View file

@ -1 +1 @@
<p><%= t'changeset.timeout.sorry' %></p>
<p><%= t '.sorry' %></p>

View file

@ -1,13 +1,15 @@
<div class="clearfix diary-comment">
<%= user_thumbnail diary_comment.user %>
<p class="deemphasize comment-heading" id="comment<%= diary_comment.id %>"><%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %>
<p class="deemphasize comment-heading" id="comment<%= diary_comment.id %>"><%= raw(t('.comment_from', :link_user => (link_to h(diary_comment.user.display_name), user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %>
<% if current_user and diary_comment.user.id != current_user.id %>
| <%= report_link(t(".report"), diary_comment) %>
<% end %>
</p>
<div class="richtext"><%= diary_comment.body.to_html %></div>
<%= if_administrator(:span) do %>
<%= link_to t('diary_entry.diary_comment.hide_link'), hide_diary_comment_path(:display_name => diary_comment.diary_entry.user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id), :method => :post, :data=> { :confirm => t('diary_entry.diary_comment.confirm') } %>
<% if current_user && current_user.administrator? %>
<span>
<%= link_to t('.hide_link'), hide_diary_comment_path(:display_name => diary_comment.diary_entry.user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id), :method => :post, :data=> { :confirm => t('.confirm') } %>
</span>
<% end %>
</div>

View file

@ -1,13 +1,13 @@
<div class='diary_post'>
<div class='post_heading clearfix'>
<% if !@this_user %>
<% if !@user %>
<%= user_thumbnail diary_entry.user %>
<% end %>
<h2><%= link_to h(diary_entry.title), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id %></h2>
<small class='deemphasize'>
<%= raw(t 'diary_entry.diary_entry.posted_by', :link_user => (link_to h(diary_entry.user.display_name), user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'list', :display_name => nil, :language => diary_entry.language_code)) %>
<%= raw(t '.posted_by', :link_user => (link_to h(diary_entry.user.display_name), user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'list', :display_name => nil, :language => diary_entry.language_code)) %>
</small>
</div>
@ -22,13 +22,13 @@
<ul class='secondary-actions clearfix'>
<% if params[:action] == 'list' %>
<li><%= link_to t('diary_entry.diary_entry.comment_link'), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'newcomment' %></li>
<li><%= link_to t('diary_entry.diary_entry.reply_link'), :controller => 'message', :action => 'new', :display_name => diary_entry.user.display_name, :title => "Re: #{diary_entry.title}" %></li>
<li><%= link_to t('diary_entry.diary_entry.comment_count', :count => diary_entry.visible_comments.count), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'comments' %></li>
<li><%= link_to t('.comment_link'), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'newcomment' %></li>
<li><%= link_to t('.reply_link'), new_message_path(diary_entry.user, :message => { :title => "Re: #{diary_entry.title}" }) %></li>
<li><%= link_to t('.comment_count', :count => diary_entry.visible_comments.count), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'comments' %></li>
<% end %>
<%= if_user(diary_entry.user, :li) do %>
<%= link_to t('diary_entry.diary_entry.edit_link'), :action => 'edit', :display_name => diary_entry.user.display_name, :id => diary_entry.id %>
<% if current_user && current_user == diary_entry.user %>
<li><%= link_to t('.edit_link'), :action => 'edit', :display_name => diary_entry.user.display_name, :id => diary_entry.id %></li>
<% end %>
<% if current_user and diary_entry.user != current_user %>
@ -37,8 +37,10 @@
</li>
<% end %>
<%= if_administrator(:li) do %>
<%= link_to t('diary_entry.diary_entry.hide_link'), hide_diary_entry_path(:display_name => diary_entry.user.display_name, :id => diary_entry.id), :method => :post, :data => { :confirm => t('diary_entry.diary_entry.confirm') } %>
<% if current_user && current_user.administrator? %>
<li>
<%= link_to t('.hide_link'), hide_diary_entry_path(:display_name => diary_entry.user.display_name, :id => diary_entry.id), :method => :post, :data => { :confirm => t('.confirm') } %>
</li>
<% end %>
</ul>
</div>

View file

@ -1,4 +1,4 @@
<%= t 'diary_entry.location.location' %>
<%= t '.location' %>
<a href="<%= url_for :controller => 'site', :action => 'index', :anchor => "map=14/#{location.latitude}/#{location.longitude}" %>">
<abbr class="geo" title="<%= number_with_precision(location.latitude, :precision => 4) %>; <%= number_with_precision(location.longitude, :precision => 4) %>">

View file

@ -1,24 +1,24 @@
<% content_for :heading do %>
<h1><%= t('diary_entry.comments.has_commented_on', :display_name => @this_user.display_name) %></h1>
<h1><%= t('.has_commented_on', :display_name => @user.display_name) %></h1>
<% end %>
<table class="messages" width="100%">
<tr>
<th width="25%"><%= t 'diary_entry.comments.post' %></th>
<th width="25%"><%= t 'diary_entry.comments.when' %></th>
<th width="50%"><%= t 'diary_entry.comments.comment' %></th>
<th width="25%"><%= t '.post' %></th>
<th width="25%"><%= t '.when' %></th>
<th width="50%"><%= t '.comment' %></th>
</tr>
<% @comments.each do |comment| -%>
<% cl = cycle('table0', 'table1') %>
<tr class="<%= cl %>">
<td width="25%"><%= link_to comment.diary_entry.title, :action => :view, :display_name => comment.diary_entry.user.display_name, :id => comment.diary_entry.id %></td>
<td width="25%"><span title="<%= l comment.created_at, :format => :friendly %>"><%= t 'diary_entry.comments.ago', :ago => time_ago_in_words(comment.created_at) %></span></td>
<td width="25%"><span title="<%= l comment.created_at, :format => :friendly %>"><%= t '.ago', :ago => time_ago_in_words(comment.created_at) %></span></td>
<td width="50%" class="richtext"><%= comment.body.to_html %></td>
</tr>
<% end -%>
</table>
<div class='secondary-actions clearfix'>
<span><%= link_to t('diary_entry.comments.older_comments') , { :page => @comment_pages.current.next} if @comment_pages.current.next %>
<%= link_to t('diary_entry.comments.newer_comments'), { :page => @comment_pages.current.previous } if @comment_pages.current.previous %></span>
<span><%= link_to t('.older_comments') , { :page => @comment_pages.current.next} if @comment_pages.current.next %>
<%= link_to t('.newer_comments'), { :page => @comment_pages.current.previous } if @comment_pages.current.previous %></span>
</div>

View file

@ -12,32 +12,32 @@
<div class="diary_entry standard-form">
<fieldset>
<div class='form-row'>
<label class="standard-label"><%= t 'diary_entry.edit.subject' -%></label>
<label class="standard-label"><%= t '.subject' -%></label>
<%= f.text_field :title, :class => "richtext_title" %>
</div>
<div class='form-row'>
<label class="standard-label"><%= t 'diary_entry.edit.body' -%></label>
<label class="standard-label"><%= t '.body' -%></label>
<%= richtext_area :diary_entry, :body, :cols => 80, :rows => 20, :format => @diary_entry.body_format %>
</div>
<div class='form-row'>
<label class="standard-label"><%= t 'diary_entry.edit.language' -%></label>
<label class="standard-label"><%= t '.language' -%></label>
<%= f.collection_select :language_code, Language.order(:english_name), :code, :name %>
</div>
</fieldset>
<fieldset class='location'>
<label class="standard-label"><%= t 'diary_entry.edit.location' -%></label>
<label class="standard-label"><%= t '.location' -%></label>
<%= content_tag "div", "", :id => "map", :data => {:lat => @lat, :lon => @lon, :zoom => @zoom} %>
<div class='form-row clearfix'>
<div class='form-column'>
<label class="secondary standard-label"><%= t 'diary_entry.edit.latitude' -%></label>
<label class="secondary standard-label"><%= t '.latitude' -%></label>
<%= f.text_field :latitude, :size => 20, :id => "latitude" %>
</div>
<div class='form-column'>
<label class="secondary standard-label"><%= t 'diary_entry.edit.longitude' -%></label>
<label class="secondary standard-label"><%= t '.longitude' -%></label>
<%= f.text_field :longitude, :size => 20, :id => "longitude" %>
</div>
<div class='form-column'>
<a href="#" id="usemap"><%= t 'diary_entry.edit.use_map_link' -%></a>
<a href="#" id="usemap"><%= t '.use_map_link' -%></a>
</div>
</div>
</fieldset>
@ -45,7 +45,7 @@
<% if action_name == 'new' %>
<%= submit_tag t('diary_entry.new.publish_button') %>
<% else %>
<%= submit_tag t('diary_entry.edit.save_button') %>
<%= submit_tag t('.save_button') %>
<% end %>
</div>
<% end %>

View file

@ -1,7 +1,7 @@
<% content_for :heading do %>
<div <% if @this_user %> id="userinformation"<% end %> >
<% if @this_user %>
<%= user_image @this_user %>
<div <% if @user %> id="userinformation"<% end %> >
<% if @user %>
<%= user_image @user %>
<% end %>
<h1><%= h(@title) %></h1>
@ -10,13 +10,17 @@
<li><%= rss_link_to :action => 'rss', :language => params[:language] %></li>
<% end -%>
<% if @this_user %>
<%= if_user(@this_user) do %>
<li><%= link_to image_tag("new.png", :class => "small_icon", :border=>0) + t('diary_entry.list.new'), {:controller => 'diary_entry', :action => 'new'}, {:title => t('diary_entry.list.new_title')} %></li>
<% if @user %>
<% if @user == current_user %>
<div>
<li><%= link_to image_tag("new.png", :class => "small_icon", :border=>0) + t('.new'), {:controller => 'diary_entry', :action => 'new'}, {:title => t('.new_title')} %></li>
</div>
<% end %>
<% else %>
<%= if_logged_in do %>
<li><%= link_to image_tag("new.png", :class => "small_icon", :border=>0) + t('diary_entry.list.new'), {:controller => 'diary_entry', :action => 'new'}, {:title => t('diary_entry.list.new_title')} %></li>
<% if current_user %>
<div>
<li><%= link_to image_tag("new.png", :class => "small_icon", :border=>0) + t('.new'), {:controller => 'diary_entry', :action => 'new'}, {:title => t('.new_title')} %></li>
</div>
<% end %>
<% end %>
</ul>
@ -24,11 +28,11 @@
<% end %>
<% if @entries.empty? %>
<h4><%= t 'diary_entry.list.no_entries' %></h4>
<h4><%= t '.no_entries' %></h4>
<% else %>
<h4><%= t 'diary_entry.list.recent_entries' %></h4>
<h4><%= t '.recent_entries' %></h4>
<% if @this_user %>
<% if @user %>
<%= render :partial => 'diary_entry', :collection => @entries %>
<% else %>
<%= render :partial => 'diary_list_entry', :collection => @entries %>
@ -36,17 +40,17 @@
<div class="pagination">
<% if @entries.size < @page_size -%>
<%= t('diary_entry.list.older_entries') %>
<%= t('.older_entries') %>
<% else -%>
<%= link_to t('diary_entry.list.older_entries'), @params.merge(:page => @page + 1 ) %>
<%= link_to t('.older_entries'), @params.merge(:page => @page + 1 ) %>
<% end -%>
|
<% if @page > 1 -%>
<%= link_to t('diary_entry.list.newer_entries'), @params.merge(:page => @page - 1) %>
<%= link_to t('.newer_entries'), @params.merge(:page => @page - 1) %>
<% else -%>
<%= t('diary_entry.list.newer_entries') %>
<%= t('.newer_entries') %>
<% end -%>
</div>
<% end %>

View file

@ -1,5 +1,5 @@
<% content_for :heading do %>
<h2><%= t 'diary_entry.no_such_entry.heading', :id => h(params[:id]) %></h2>
<h2><%= t '.heading', :id => h(params[:id]) %></h2>
<% end %>
<p><%= t 'diary_entry.no_such_entry.body', :id => h(params[:id]) %></p>
<p><%= t '.body', :id => h(params[:id]) %></p>

View file

@ -1,7 +1,7 @@
<% content_for :heading do %>
<div id="userinformation" >
<%= user_image @entry.user %>
<h2><%= link_to t('diary_entry.view.user_title', :user => h(@entry.user.display_name)), :action => :list %></h2>
<h2><%= link_to t('.user_title', :user => h(@entry.user.display_name)), :action => :list %></h2>
<p><%= rss_link_to :action => :rss, :display_name => @entry.user.display_name %></p>
</div>
<% end %>
@ -12,25 +12,27 @@
<div class='comments'>
<%= render :partial => 'diary_comment', :collection => @entry.visible_comments %>
</div>
<%= if_logged_in(:div) do %>
<h3 id="newcomment"><%= t 'diary_entry.view.leave_a_comment' %></h3>
<%= error_messages_for 'diary_comment' %>
<%= form_for :diary_comment, :url => { :action => 'comment' } do |f| %>
<%= richtext_area :diary_comment, :body, :cols => 80, :rows => 15 %>
<%= submit_tag t('diary_entry.view.save_button') %>
<div>
<% if current_user %>
<h3 id="newcomment"><%= t '.leave_a_comment' %></h3>
<%= error_messages_for 'diary_comment' %>
<%= form_for :diary_comment, :url => { :action => 'comment' } do |f| %>
<%= richtext_area :diary_comment, :body, :cols => 80, :rows => 15 %>
<%= submit_tag t('.save_button') %>
<% end %>
<% if @entry.subscribers.exists?(current_user.id) %>
<div class="diary-subscribe-buttons"><%= link_to t('javascripts.changesets.show.unsubscribe'), diary_entry_unsubscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %></div>
<% else %>
<div class="diary-subscribe-buttons"><%= link_to t('javascripts.changesets.show.subscribe'), diary_entry_subscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %></div>
<% end %>
<% else %>
<h3 id="newcomment"><%= raw t(".login_to_leave_a_comment", :login_link => link_to(t(".login"), :controller => 'user', :action => 'login', :referer => request.fullpath)) %></h3>
<% end %>
<% if current_user and @entry.subscribers.exists?(current_user.id) %>
<div class="diary-subscribe-buttons"><%= link_to t('javascripts.changesets.show.unsubscribe'), diary_entry_unsubscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %></div>
<% elsif current_user %>
<div class="diary-subscribe-buttons"><%= link_to t('javascripts.changesets.show.subscribe'), diary_entry_subscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %></div>
<% end %>
<% end %>
<%= if_not_logged_in(:div) do %>
<h3 id="newcomment"><%= raw t("diary_entry.view.login_to_leave_a_comment", :login_link => link_to(t("diary_entry.view.login"), :controller => 'user', :action => 'login', :referer => request.fullpath)) %></h3>
<% end %>
</div>
<% content_for :auto_discovery_link_tag do -%>
<%= auto_discovery_link_tag :rss, :action => :rss, :display_name => @entry.user.display_name %>

View file

@ -1,5 +1,5 @@
<% if @results.empty? %>
<p class="search_results_entry inner12"><%= t 'geocoder.results.no_results' %></p>
<p class="search_results_entry inner12"><%= t '.no_results' %></p>
<% else %>
<ul class='results-list'>
<% @results.each do |result| %>
@ -8,8 +8,8 @@
</ul>
<% if @more_params %>
<div class="search_more">
<%= link_to t('geocoder.results.more_results'), url_for(@more_params), :class => "button load_more" %>
<%= image_tag "searching.gif", :class => "loader", :style => "display: none;" %>
<%= link_to t('.more_results'), url_for(@more_params), :class => "button load_more" %>
<div class="loader"><%= image_tag "searching.gif" %></div>
</div>
<% end %>
<% end %>

View file

@ -3,7 +3,7 @@
<%= t('site.sidebar.search_results') %>
</h2>
<% @sources.each do |source| %>
<h4 class="inner12"><%= raw(t "geocoder.search.title.#{source}") %></h4>
<h4 class="inner12"><%= raw(t ".title.#{source}") %></h4>
<div class="search_results_entry" data-href="<%= url_for @params.merge(:action => "search_#{source}") %>">
<%= image_tag "searching.gif", :class => "loader" %>
</div>

View file

@ -33,7 +33,6 @@
<% if flash[:piwik_goal] -%>
<%= tag("meta", :name => "piwik-goal", :content => flash[:piwik_goal]) %>
<% end -%>
<%= style_rules %>
<%= yield :head %>
<%= yield :auto_discovery_link_tag %>
<%= csrf_meta_tag %>

View file

@ -67,7 +67,7 @@
</a>
<ul class='dropdown-menu'>
<li>
<%= link_to inbox_path(:display_name => current_user.display_name) do %>
<%= link_to inbox_messages_path do %>
<span class='count-number'><%= number_with_delimiter(current_user.new_messages.size) %></span>
<%= t('user.view.my messages') %>
<% end %>

View file

@ -1,8 +0,0 @@
<tr id="inbox-<%= message_summary.id %>" class="inbox-row<%= "-unread" if not message_summary.message_read? %>">
<td class="inbox-sender"><%= link_to h(message_summary.sender.display_name), user_path(message_summary.sender) %></td>
<td class="inbox-subject"><%= link_to h(message_summary.title), :controller => 'message', :action => 'read', :message_id => message_summary.id %></td>
<td class="inbox-sent"><%= l message_summary.sent_on, :format => :friendly %></td>
<td class="inbox-mark-unread"><%= button_to t('message.message_summary.unread_button'), {:controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'unread'}, { :remote => true } %></td>
<td class="inbox-mark-read"><%= button_to t('message.message_summary.read_button'), {:controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'read'}, { :remote => true } %></td>
<td class="inbox-delete"><%= button_to t('message.message_summary.delete_button'), {:controller => 'message', :action => 'delete', :message_id => message_summary.id, :referer => request.fullpath}, { :remote => true } %></td>
</tr>

View file

@ -1,5 +0,0 @@
$("#inboxanchor").replaceWith("<%=j render :partial => "layouts/inbox" %>");
$("#inbox-count").replaceWith("<%=j render :partial => "message_count" %>");
$("#inbox-<%= @message.id %>").fadeOut(800, "linear", function () {
$(this).remove();
});

View file

@ -1,24 +0,0 @@
<% content_for :heading do %>
<h2><%= t'message.inbox.my_inbox'%>/<%= link_to t('message.inbox.outbox'), outbox_path(current_user.display_name) %></h2>
<% end %>
<h4><%= render :partial => "message_count" %></h4>
<% if current_user.messages.size > 0 %>
<table class="messages">
<thead>
<tr>
<th><%= t'message.inbox.from' %></th>
<th><%= t'message.inbox.subject' %></th>
<th><%= t'message.inbox.date' %></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<%= render :partial => "message_summary", :collection => current_user.messages %>
</tbody>
</table>
<% else %>
<div><%= raw(t'message.inbox.no_messages_yet', :people_mapping_nearby_link => link_to(t('message.inbox.people_mapping_nearby'), user_path(current_user))) %></div>
<% end %>

View file

@ -1,7 +0,0 @@
$("#inboxanchor").replaceWith("<%=j render :partial => "layouts/inbox" %>");
$("#inbox-count").replaceWith("<%=j render :partial => "message_count" %>");
<% if @message.message_read? -%>
$("#inbox-<%= @message.id %>").removeClass("inbox-row-unread").addClass("inbox-row");
<% else -%>
$("#inbox-<%= @message.id %>").removeClass("inbox-row").addClass("inbox-row-unread");
<% end -%>

View file

@ -1,22 +0,0 @@
<% content_for :heading do %>
<h2><%= raw(t'message.new.send_message_to', :name => link_to(h(@message.recipient.display_name), user_path(@message.recipient))) %></h2>
<% end %>
<%= error_messages_for 'message' %>
<%= form_for :message, :html => { :class => 'standard-form' }, :url => { :action => "new", :display_name => @message.recipient.display_name } do |f| %>
<fieldset>
<div class='form-row'>
<label class="standard-label"><%= t'message.new.subject' %></label>
<%= f.text_field :title, :size => 60, :class => "richtext_title" %>
</div>
<div class='form-row'>
<label class="standard-label"><%= t'message.new.body' %></label>
<%= richtext_area :message, :body, :cols => 80, :rows => 20 %>
</div>
<div class='buttons'>
<%= submit_tag t('message.new.send_button') %>
<%= link_to t('message.new.back_to_inbox'), { :controller => 'message', :action => 'inbox', :display_name => current_user.display_name }, :class => 'deemphasize button' %>
</div>
</fieldset>
<% end %>

View file

@ -1,5 +0,0 @@
<% content_for :heading do %>
<h1><%= t'message.no_such_message.heading' %></h1>
<% end %>
<p><%= t'message.no_such_message.body' %></p>

View file

@ -1,23 +0,0 @@
<% content_for :heading do %>
<h2><%= raw(t'message.outbox.my_inbox', :inbox_link => link_to(t('message.outbox.inbox'), inbox_path(current_user.display_name))) %>/<%= t'message.outbox.outbox' %></h2>
<% end %>
<h4><%= t'message.outbox.messages', :count => current_user.sent_messages.size %></h4>
<% if current_user.sent_messages.size > 0 %>
<table class="messages">
<thead>
<tr>
<th><%= t'message.outbox.to' %></th>
<th><%= t'message.outbox.subject' %></th>
<th><%= t'message.outbox.date' %></th>
<th></th>
</tr>
</thead>
<tbody>
<%= render :partial => "sent_message_summary", :collection => current_user.sent_messages %>
</tbody>
</table>
<% else %>
<div class="messages"><%= raw(t'message.outbox.no_sent_messages', :people_mapping_nearby_link => link_to(t('message.outbox.people_mapping_nearby'), user_path(current_user))) %></div>
<% end %>

View file

@ -1,8 +1,8 @@
<p id="inbox-count">
<%= t "message.inbox.messages",
:new_messages => t("message.inbox.new_messages",
<%= t "messages.inbox.messages",
:new_messages => t("messages.inbox.new_messages",
:count => current_user.new_messages.size),
:old_messages => t("message.inbox.old_messages",
:old_messages => t("messages.inbox.old_messages",
:count => current_user.messages.size - current_user.new_messages.size)
%>
</p>

View file

@ -0,0 +1,8 @@
<tr id="inbox-<%= message_summary.id %>" class="inbox-row<%= "-unread" if not message_summary.message_read? %>">
<td class="inbox-sender"><%= link_to h(message_summary.sender.display_name), user_path(message_summary.sender) %></td>
<td class="inbox-subject"><%= link_to h(message_summary.title), message_path(message_summary) %></td>
<td class="inbox-sent"><%= l message_summary.sent_on, :format => :friendly %></td>
<td class="inbox-mark-unread"><%= button_to t('.unread_button'), mark_message_path(message_summary, :mark => 'unread'), { :remote => true } %></td>
<td class="inbox-mark-read"><%= button_to t('.read_button'), mark_message_path(message_summary, :mark => 'read'), { :remote => true } %></td>
<td class="inbox-destroy"><%= button_to t('.destroy_button'), destroy_message_path(message_summary, :referer => request.fullpath), { :remote => true } %></td>
</tr>

View file

@ -1,6 +1,6 @@
<tr class="inbox-row">
<td class="inbox-sender"><%= link_to h(sent_message_summary.recipient.display_name), user_path(sent_message_summary.recipient) %></td>
<td class="inbox-subject"><%= link_to h(sent_message_summary.title), :controller => 'message', :action => 'read', :message_id => sent_message_summary.id %></td>
<td class="inbox-subject"><%= link_to h(sent_message_summary.title), message_path(sent_message_summary) %></td>
<td class="inbox-sent"><%= l sent_message_summary.sent_on, :format => :friendly %></td>
<td class="inbox-delete"><%= button_to t('message.sent_message_summary.delete_button'), :controller => 'message', :action => 'delete', :message_id => sent_message_summary.id, :referer => request.fullpath %></td>
<td class="inbox-destroy"><%= button_to t('.destroy_button'), destroy_message_path(sent_message_summary, :referer => request.fullpath), { :remote => true } %></td>
</tr>

View file

@ -0,0 +1,2 @@
json.inboxanchor render(:partial => "layouts/inbox")
json.inbox_count render(:partial => "message_count")

View file

@ -0,0 +1,28 @@
<% content_for :head do %>
<%= javascript_include_tag "messages" %>
<% end %>
<% content_for :heading do %>
<h2><%= t '.my_inbox'%>/<%= link_to t('.outbox'), outbox_messages_path %></h2>
<% end %>
<h4><%= render :partial => "message_count" %></h4>
<% if current_user.messages.size > 0 %>
<table class="messages">
<thead>
<tr>
<th><%= t '.from' %></th>
<th><%= t '.subject' %></th>
<th><%= t '.date' %></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<%= render :partial => "message_summary", :collection => current_user.messages %>
</tbody>
</table>
<% else %>
<div><%= raw(t '.no_messages_yet', :people_mapping_nearby_link => link_to(t('.people_mapping_nearby'), user_path(current_user))) %></div>
<% end %>

View file

@ -0,0 +1,2 @@
json.inboxanchor render(:partial => "layouts/inbox")
json.inbox_count render(:partial => "message_count")

View file

@ -0,0 +1,22 @@
<% content_for :heading do %>
<h2><%= raw(t '.send_message_to', :name => link_to(h(@message.recipient.display_name), user_path(@message.recipient))) %></h2>
<% end %>
<%= error_messages_for 'message' %>
<%= form_for :message, :html => { :class => 'standard-form' }, :url => new_message_path(@message.recipient) do |f| %>
<fieldset>
<div class='form-row'>
<label class="standard-label" for="message_title"><%= t '.subject' %></label>
<%= f.text_field :title, :size => 60, :class => "richtext_title" %>
</div>
<div class='form-row'>
<label class="standard-label" for="message_body"><%= t '.body' %></label>
<%= richtext_area :message, :body, :cols => 80, :rows => 20 %>
</div>
<div class='buttons'>
<%= submit_tag t('.send_button') %>
<%= link_to t('.back_to_inbox'), inbox_messages_path, :class => 'deemphasize button' %>
</div>
</fieldset>
<% end %>

View file

@ -0,0 +1,5 @@
<% content_for :heading do %>
<h1><%= t '.heading' %></h1>
<% end %>
<p><%= t '.body' %></p>

View file

@ -0,0 +1,27 @@
<% content_for :head do %>
<%= javascript_include_tag "messages" %>
<% end %>
<% content_for :heading do %>
<h2><%= raw(t '.my_inbox', :inbox_link => link_to(t('.inbox'), inbox_messages_path)) %>/<%= t'.outbox' %></h2>
<% end %>
<h4><%= t '.messages', :count => current_user.sent_messages.size %></h4>
<% if current_user.sent_messages.size > 0 %>
<table class="messages">
<thead>
<tr>
<th><%= t '.to' %></th>
<th><%= t '.subject' %></th>
<th><%= t '.date' %></th>
<th></th>
</tr>
</thead>
<tbody>
<%= render :partial => "sent_message_summary", :collection => current_user.sent_messages %>
</tbody>
</table>
<% else %>
<div class="messages"><%= raw(t '.no_sent_messages', :people_mapping_nearby_link => link_to(t('.people_mapping_nearby'), user_path(current_user))) %></div>
<% end %>

View file

@ -14,9 +14,9 @@
<div class="richtext"><%= @message.body.to_html %></div>
<div class='message-buttons buttons'>
<%= button_to t('message.read.reply_button'), {:controller => 'message', :action => 'reply', :message_id => @message.id}, :class => 'reply-button' %>
<%= button_to t('message.read.unread_button'), {:controller => 'message', :action => 'mark', :message_id => @message.id, :mark => 'unread'}, :class => 'mark-unread-button' %>
<%= button_to t('message.read.delete_button'), {:controller => 'message', :action => 'delete', :message_id => @message.id}, :class => 'delete-button' %>
<%= button_to t('.reply_button'), reply_message_path(@message), :class => 'reply-button' %>
<%= button_to t('.unread_button'), mark_message_path(@message, :mark => 'unread'), :class => 'mark-unread-button' %>
<%= button_to t('.destroy_button'), destroy_message_path(@message), :class => 'destroy-button' %>
<% else %>
@ -36,5 +36,5 @@
<% end %>
<%= link_to t('message.read.back'), {:controller => 'message', :action => 'outbox', :display_name => current_user.display_name }, :class => "button deemphasize" %>
<%= link_to t('.back'), outbox_messages_path, :class => "button deemphasize" %>
</div>

View file

@ -1,8 +1,8 @@
<div class="note-comment" style="margin-top: 5px">
<% if comment.author.nil? -%>
<div class="note-comment-description" style="font-size: smaller; color: #999999"><%= t "note.description.#{comment.event}_at_html", :when => friendly_date(comment.created_at) %></div>
<div class="note-comment-description" style="font-size: smaller; color: #999999"><%= t ".#{comment.event}_at_html", :when => friendly_date(comment.created_at) %></div>
<% else -%>
<div class="note-comment-description" style="font-size: smaller; color: #999999"><%= t "note.description.#{comment.event}_at_by_html", :when => friendly_date(comment.created_at), :user => note_author(comment.author, :only_path => false) %></div>
<div class="note-comment-description" style="font-size: smaller; color: #999999"><%= t ".#{comment.event}_at_by_html", :when => friendly_date(comment.created_at), :user => note_author(comment.author, :only_path => false) %></div>
<% end -%>
<div class="note-comment-text"><%= comment.body %></div>
</div>

View file

@ -1,4 +1,4 @@
<h2><%= t "note.entry.comment" %></h2>
<h2><%= t ".comment" %></h2>
<%= render :partial => "comment", :object => entry %>
<h2><%= t "note.entry.full" %></h2>
<h2><%= t ".full" %></h2>
<%= render :partial => "description", :object => entry.note %>

View file

@ -2,11 +2,11 @@ xml.item do
location = describe_location(note.lat, note.lon, 14, locale)
if note.closed?
xml.title t("note.rss.closed", :place => location)
xml.title t("notes.rss.closed", :place => location)
elsif note.comments.length > 1
xml.title t("note.rss.commented", :place => location)
xml.title t("notes.rss.commented", :place => location)
else
xml.title t("note.rss.opened", :place => location)
xml.title t("notes.rss.opened", :place => location)
end
xml.link browse_note_url(note)

View file

@ -5,15 +5,15 @@ xml.rss("version" => "2.0",
"xmlns:geo" => "http://www.w3.org/2003/01/geo/wgs84_pos#",
"xmlns:georss" => "http://www.georss.org/georss") do
xml.channel do
xml.title t("note.rss.title")
xml.description t("note.rss.description_area", :min_lat => @min_lat, :min_lon => @min_lon, :max_lat => @max_lat, :max_lon => @max_lon)
xml.title t("notes.rss.title")
xml.description t("notes.rss.description_area", :min_lat => @min_lat, :min_lon => @min_lon, :max_lat => @max_lat, :max_lon => @max_lon)
xml.link url_for(:controller => "site", :action => "index", :only_path => false)
@comments.each do |comment|
location = describe_location(comment.note.lat, comment.note.lon, 14, locale)
xml.item do
xml.title t("note.rss.#{comment.event}", :place => location)
xml.title t("notes.rss.#{comment.event}", :place => location)
xml.link url_for(:controller => "browse", :action => "note", :id => comment.note.id, :anchor => "c#{comment.id}", :only_path => false)
xml.guid url_for(:controller => "browse", :action => "note", :id => comment.note.id, :anchor => "c#{comment.id}", :only_path => false)

View file

@ -5,8 +5,8 @@ xml.rss("version" => "2.0",
"xmlns:geo" => "http://www.w3.org/2003/01/geo/wgs84_pos#",
"xmlns:georss" => "http://www.georss.org/georss") do
xml.channel do
xml.title t("note.rss.title")
xml.description t("note.rss.description_area", :min_lat => @min_lat, :min_lon => @min_lon, :max_lat => @max_lat, :max_lon => @max_lon)
xml.title t("notes.rss.title")
xml.description t("notes.rss.description_area", :min_lat => @min_lat, :min_lon => @min_lon, :max_lat => @max_lat, :max_lon => @max_lon)
xml.link url_for(:controller => "site", :action => "index", :only_path => false)
xml << (render(:partial => "note", :collection => @notes) || "")

View file

@ -8,11 +8,11 @@
<table class="note_list">
<tr>
<th></th>
<th><%= t'note.mine.id' %></th>
<th><%= t'note.mine.creator' %></th>
<th><%= t'note.mine.description' %></th>
<th><%= t'note.mine.created_at' %></th>
<th><%= t'note.mine.last_changed' %></th>
<th><%= t '.id' %></th>
<th><%= t '.creator' %></th>
<th><%= t '.description' %></th>
<th><%= t '.created_at' %></th>
<th><%= t '.last_changed' %></th>
</tr>
<% @notes.each do |note| -%>
<tr<% if note.author != @user2 %> class="creator"<% end %>>
@ -25,9 +25,9 @@
</td>
<td><%= link_to note.id.to_s, :controller => "browse", :action => "note", :id => note.id %></td>
<td><%= note_author(note.author) %></td>
<td><%= note.comments.first.body.to_html %></td>
<td><%= t 'note.mine.ago_html', :when => friendly_date(note.created_at) %></td>
<td><%= t 'note.mine.ago_html', :when => friendly_date(note.updated_at) %></td>
<td><%= note.comments.first.body.to_html %></td>
<td><%= t '.ago_html', :when => friendly_date(note.created_at) %></td>
<td><%= t '.ago_html', :when => friendly_date(note.updated_at) %></td>
</tr>
<% end -%>
</table>

View file

@ -4,8 +4,8 @@ xml.rss("version" => "2.0",
"xmlns:geo" => "http://www.w3.org/2003/01/geo/wgs84_pos#",
"xmlns:georss" => "http://www.georss.org/georss") do
xml.channel do
xml.title t("note.rss.title")
xml.description t("note.rss.description_item", :id => @note.id)
xml.title t("notes.rss.title")
xml.description t("notes.rss.description_item", :id => @note.id)
xml.link url_for(:controller => "site", :action => "index", :only_path => false)
xml << render(:partial => "note", :object => @note)

View file

@ -10,7 +10,7 @@
height: 50,
border: 0
),
user_url(@author, :host => SERVER_URL),
user_url(@author),
:target => "_blank"
) %>
</td>

View file

@ -1,16 +1,16 @@
<p>
<%= t 'notifier.changeset_comment_notification.hi', :to_user => @to_user %>
<%= t '.hi', :to_user => @to_user %>
</p>
<p>
<% if @owner %>
<%= raw t "notifier.changeset_comment_notification.commented.your_changeset", :commenter => link_to_user(@commenter), :time => @time %>
<%= raw t ".commented.your_changeset", :commenter => link_to_user(@commenter), :time => @time %>
<% else %>
<%= raw t "notifier.changeset_comment_notification.commented.commented_changeset", :commenter => link_to_user(@commenter), :time => @time, :changeset_author => @changeset_author %>
<%= raw t ".commented.commented_changeset", :commenter => link_to_user(@commenter), :time => @time, :changeset_author => @changeset_author %>
<% end %>
<% if @changeset_comment %>
<%= raw t "notifier.changeset_comment_notification.commented.partial_changeset_with_comment", :changeset_comment => content_tag("em", @changeset_comment) %>
<%= raw t ".commented.partial_changeset_with_comment", :changeset_comment => content_tag("em", @changeset_comment) %>
<% else %>
<%= t "notifier.changeset_comment_notification.commented.partial_changeset_without_comment" %>
<%= t ".commented.partial_changeset_without_comment" %>
<% end %>
</p>
@ -19,11 +19,11 @@
<% end %>
<p>
<%= raw t 'notifier.changeset_comment_notification.details', :url => link_to(@changeset_url, @changeset_url) %>
<%= raw t '.details', :url => link_to(@changeset_url, @changeset_url) %>
</p>
<% content_for :footer do %>
<p>
<%= raw t 'notifier.changeset_comment_notification.unsubscribe', :url => link_to(@changeset_url, @changeset_url, :style => "color: #222") %>
<%= raw t '.unsubscribe', :url => link_to(@changeset_url, @changeset_url, :style => "color: #222") %>
</p>
<% end %>

View file

@ -1,20 +1,20 @@
<%= t 'notifier.changeset_comment_notification.hi', :to_user => @to_user %>
<%= t '.hi', :to_user => @to_user %>
<% if @owner %>
<%= t "notifier.changeset_comment_notification.commented.your_changeset", :commenter => @commenter, :time => @time %>
<%= t ".commented.your_changeset", :commenter => @commenter, :time => @time %>
<% else %>
<%= t "notifier.changeset_comment_notification.commented.commented_changeset", :commenter => @commenter, :time => @time, :changeset_author => @changeset_author %>
<%= t ".commented.commented_changeset", :commenter => @commenter, :time => @time, :changeset_author => @changeset_author %>
<% end %>
<% if @changeset_comment %>
<%= t "notifier.changeset_comment_notification.commented.partial_changeset_with_comment", :changeset_comment => @changeset_comment %>
<%= t ".commented.partial_changeset_with_comment", :changeset_comment => @changeset_comment %>
<% else %>
<%= t "notifier.changeset_comment_notification.commented.partial_changeset_without_comment" %>
<%= t ".commented.partial_changeset_without_comment" %>
<% end %>
==
<%= @comment.to_text %>
==
<%= t 'notifier.changeset_comment_notification.details', :url => @changeset_url %>
<%= t '.details', :url => @changeset_url %>
<%= t 'notifier.changeset_comment_notification.unsubscribe', :url => @changeset_url %>
<%= t '.unsubscribe', :url => @changeset_url %>

View file

@ -1,8 +1,8 @@
<p>
<%= t'notifier.diary_comment_notification.hi', :to_user => @to_user %>
<%= t '.hi', :to_user => @to_user %>
</p>
<p>
<%= raw t'notifier.diary_comment_notification.header', :from_user => link_to_user(@from_user), :subject => content_tag("em", @title) %>
<%= raw t '.header', :from_user => link_to_user(@from_user), :subject => content_tag("em", @title) %>
</p>
<%= message_body do %>
@ -10,7 +10,7 @@
<% end %>
<% content_for :footer do %>
<p><%= raw t'notifier.diary_comment_notification.footer',
<p><%= raw t '.footer',
:readurl => link_to(@readurl, @readurl) + tag(:br),
:commenturl => link_to(@commenturl, @commenturl) + tag(:br),
:replyurl => link_to(@replyurl, @replyurl)

View file

@ -1,9 +1,9 @@
<%= t'notifier.diary_comment_notification.hi', :to_user => @to_user %>
<%= t '.hi', :to_user => @to_user %>
<%= t'notifier.diary_comment_notification.header', :from_user => @from_user, :subject => @title %>
<%= t '.header', :from_user => @from_user, :subject => @title %>
==
<%= raw @text.to_text %>
==
<%= t'notifier.diary_comment_notification.footer', :readurl => @readurl, :commenturl => @commenturl, :replyurl => @replyurl %>
<%= t '.footer', :readurl => @readurl, :commenturl => @commenturl, :replyurl => @replyurl %>

View file

@ -1,9 +1,9 @@
<p><%= t 'notifier.friend_notification.had_added_you', :user => @friend.befriender.display_name %></p>
<p><%= t '.had_added_you', :user => @friend.befriender.display_name %></p>
<%= message_body do %>
<p><%= raw t 'notifier.friend_notification.see_their_profile', :userurl => link_to(@viewurl, @viewurl) %></p>
<p><%= raw t '.see_their_profile', :userurl => link_to(@viewurl, @viewurl) %></p>
<% unless @friend.befriendee.is_friends_with?(@friend.befriender) -%>
<p><%= raw t 'notifier.friend_notification.befriend_them', :befriendurl => link_to(@friendurl, @friendurl) %></p>
<p><%= raw t '.befriend_them', :befriendurl => link_to(@friendurl, @friendurl) %></p>
<% end -%>
<% end %>

View file

@ -1,7 +1,7 @@
<%= t 'notifier.friend_notification.had_added_you', :user => @friend.befriender.display_name %>
<%= t '.had_added_you', :user => @friend.befriender.display_name %>
<%= t 'notifier.friend_notification.see_their_profile', :userurl => @viewurl %>
<%= t '.see_their_profile', :userurl => @viewurl %>
<% unless @friend.befriendee.is_friends_with?(@friend.befriender) -%>
<%= t 'notifier.friend_notification.befriend_them', :befriendurl => @friendurl %>
<%= t '.befriend_them', :befriendurl => @friendurl %>
<% end -%>

View file

@ -1,8 +1,8 @@
<p>
<%= t'notifier.message_notification.hi', :to_user => @to_user %>
<%= t '.hi', :to_user => @to_user %>
</p>
<p>
<%= raw t'notifier.message_notification.header',
<%= raw t '.header',
:from_user => link_to_user(@from_user),
:subject => content_tag("em", @title)
%>
@ -14,7 +14,7 @@
<% content_for :footer do %>
<p>
<%= t'notifier.message_notification.footer_html',
<%= t '.footer_html',
:readurl => link_to(@readurl, @readurl) + tag(:br),
:replyurl => link_to(@replyurl, @replyurl)
%>

View file

@ -1,9 +1,9 @@
<%= raw t'notifier.message_notification.hi', :to_user => @to_user %>
<%= raw t '.hi', :to_user => @to_user %>
<%= raw t'notifier.message_notification.header', :from_user => @from_user, :subject => @title %>
<%= raw t '.header', :from_user => @from_user, :subject => @title %>
==
<%= raw @text.to_text %>
==
<%= word_wrap(t'notifier.message_notification.footer_html', :readurl => @readurl, :replyurl => @replyurl) %>
<%= word_wrap(t '.footer_html', :readurl => @readurl, :replyurl => @replyurl) %>

View file

@ -1,9 +1,9 @@
<p><%= t 'notifier.note_comment_notification.greeting' %></p>
<p><%= t '.greeting' %></p>
<% if @owner %>
<p><%= raw t "notifier.note_comment_notification.#{@event}.your_note", :commenter => link_to_user(@commenter), :place => @place %></p>
<p><%= raw t ".#{@event}.your_note", :commenter => link_to_user(@commenter), :place => @place %></p>
<% else %>
<p><%= raw t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => link_to_user(@commenter), :place => @place %></p>
<p><%= raw t ".#{@event}.commented_note", :commenter => link_to_user(@commenter), :place => @place %></p>
<% end %>
<% unless @comment.empty? %>
@ -12,4 +12,4 @@
<% end %>
<% end %>
<p><%= raw t 'notifier.note_comment_notification.details', :url => link_to(@noteurl, @noteurl) %></p>
<p><%= raw t '.details', :url => link_to(@noteurl, @noteurl) %></p>

View file

@ -1,9 +1,9 @@
<%= t 'notifier.note_comment_notification.greeting' %>
<%= t '.greeting' %>
<% if @owner %>
<%= t "notifier.note_comment_notification.#{@event}.your_note", :commenter => @commenter, :place => @place %>
<%= t ".#{@event}.your_note", :commenter => @commenter, :place => @place %>
<% else %>
<%= t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => @commenter, :place => @place %>
<%= t ".#{@event}.commented_note", :commenter => @commenter, :place => @place %>
<% end %>
<% unless @comment.empty? %>
@ -12,4 +12,4 @@
==
<% end %>
<%= t 'notifier.note_comment_notification.details', :url => @noteurl %>
<%= t '.details', :url => @noteurl %>

View file

@ -1,9 +1,9 @@
<p><%= t("notifier.signup_confirm.greeting") %></p>
<p><%= t(".greeting") %></p>
<p><%= t("notifier.signup_confirm.created", :site_url => SERVER_URL) %></p>
<p><%= t(".created", :site_url => SERVER_URL) %></p>
<p><%= t("notifier.signup_confirm.confirm") %></p>
<p><%= t(".confirm") %></p>
<p><%= link_to @url, @url %></p>
<p><%= t("notifier.signup_confirm.welcome") %></p>
<p><%= t(".welcome") %></p>

View file

@ -1,9 +1,9 @@
<%= fp(t("notifier.signup_confirm.greeting")) %>
<%= fp(t(".greeting")) %>
<%= fp(t("notifier.signup_confirm.created", :site_url => SERVER_URL)) %>
<%= fp(t(".created", :site_url => SERVER_URL)) %>
<%= fp(t("notifier.signup_confirm.confirm")) %>
<%= fp(t(".confirm")) %>
<%= @url %>
<%= fp(t("notifier.signup_confirm.welcome")) %>
<%= fp(t(".welcome")) %>

View file

@ -1,19 +1,19 @@
<% content_for :heading do %>
<h1><%= t "oauth.oauthorize.title" %></h1>
<h1><%= t ".title" %></h1>
<% end %>
<p><%= raw t("oauth.oauthorize.request_access", :app_name => link_to(@token.client_application.name, @token.client_application.url), :user => link_to(current_user.display_name, :controller => :user, :action => :view, :display_name => current_user.display_name)) %></p>
<p><%= raw t(".request_access", :app_name => link_to(@token.client_application.name, @token.client_application.url), :user => link_to(current_user.display_name, :controller => :user, :action => :view, :display_name => current_user.display_name)) %></p>
<%= form_tag authorize_url do %>
<%= hidden_field_tag "oauth_token", @token.token %>
<%- if params[:oauth_callback] -%>
<%= hidden_field_tag "oauth_callback", params[:oauth_callback] %>
<%- end -%>
<p><%= t 'oauth.oauthorize.allow_to' %></p>
<p><%= t '.allow_to' %></p>
<ul>
<% @token.client_application.permissions.each do |perm| %>
<li><%= check_box_tag perm.to_s, "yes", @token.read_attribute(perm) %><%= t "oauth.oauthorize.#{perm}" %></li>
<li><%= check_box_tag perm.to_s, "yes", @token.read_attribute(perm) %><%= label_tag perm.to_s, t(".#{perm}") %></li>
<% end %>
</ul>
<p><%= submit_tag t("oauth.oauthorize.grant_access") %></p>
<p><%= submit_tag t(".grant_access") %></p>
<% end %>

View file

@ -1,5 +1,5 @@
<% content_for :heading do %>
<h1><%= t "oauth.oauthorize_failure.title" %></h1>
<h1><%= t ".title" %></h1>
<% end %>
<p><%= @message %></p>

View file

@ -1,9 +1,9 @@
<% content_for :heading do %>
<h1><%= t "oauth.oauthorize_success.title" %></h1>
<h1><%= t ".title" %></h1>
<% end %>
<p><%= raw t("oauth.oauthorize_success.allowed", :app_name => link_to(@token.client_application.name, @token.client_application.url)) %></p>
<p><%= raw t(".allowed", :app_name => link_to(@token.client_application.name, @token.client_application.url)) %></p>
<% if @token.oob? and not @token.oauth10? %>
<p><%= t "oauth.oauthorize_success.verification", :code => @token.verifier %></p>
<p><%= t ".verification", :code => @token.verifier %></p>
<% end %>

View file

@ -1,29 +1,29 @@
<div class='standard-form'>
<fieldset>
<div class="form-row">
<label class='standard-label' for="client_application_name"><%= t'oauth_clients.form.name' %> (<%= t'oauth_clients.form.required' %>)</label>
<label class='standard-label' for="client_application_name"><%= t '.name' %> (<%= t '.required' %>)</label>
<%= f.text_field :name %>
</div>
<div class="form-row">
<label class='standard-label' for="client_application_url"><%= t'oauth_clients.form.url' %> (<%= t'oauth_clients.form.required' %>)</label>
<label class='standard-label' for="client_application_url"><%= t '.url' %> (<%= t '.required' %>)</label>
<%= f.text_field :url %>
</div>
<div class="form-row">
<label class='standard-label' for="client_application_callback_url"><%= t'oauth_clients.form.callback_url' %></label>
<label class='standard-label' for="client_application_callback_url"><%= t '.callback_url' %></label>
<%= f.text_field :callback_url %>
</div>
<div class="form-row">
<label class='standard-label' for="client_application_support_url"><%= t'oauth_clients.form.support_url' %></label>
<label class='standard-label' for="client_application_support_url"><%= t '.support_url' %></label>
<%= f.text_field :support_url %>
</div>
</fieldset>
<fieldset class='form-divider'>
<p><%= t'oauth_clients.form.requests' %></p>
<p><%= t '.requests' %></p>
<% ClientApplication.all_permissions.each do |perm| %>
<div class="form-row">
<%= f.check_box perm %>
<label class='standard-label' for="client_application_<%= perm.to_s %>"><%= t('oauth_clients.form.' + perm.to_s) %></label>
<label class='standard-label' for="client_application_<%= perm.to_s %>"><%= t('.' + perm.to_s) %></label>
</div>
<% end %>
</fieldset>
</div>
</div>

View file

@ -1,8 +1,8 @@
<% content_for :heading do %>
<h1><%= t'oauth_clients.edit.title' %></h1>
<h1><%= t '.title' %></h1>
<% end %>
<%= form_for @client_application, :url => oauth_client_path(@client_application.user.display_name, @client_application), :html => { :method => :put } do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<%= submit_tag t'oauth_clients.edit.submit' %>
<%= submit_tag t '.submit' %>
<% end %>

View file

@ -1,13 +1,13 @@
<% content_for :heading do %>
<h1><%= t'oauth_clients.index.title' %></h1>
<h1><%= t '.title' %></h1>
<% end %>
<% unless @tokens.empty? %>
<h3><%= t'oauth_clients.index.my_tokens' %></h3>
<p><%= t'oauth_clients.index.list_tokens' %></p>
<h3><%= t '.my_tokens' %></h3>
<p><%= t '.list_tokens' %></p>
<table>
<tr><th><%= t'oauth_clients.index.application' %></th>
<th><%= t'oauth_clients.index.issued_at' %></th><th>&nbsp;</th></tr>
<tr><th><%= t '.application' %></th>
<th><%= t '.issued_at' %></th><th>&nbsp;</th></tr>
<% @tokens.each do |token|%>
<%= content_tag_for :tr, token do %>
<td><%= link_to token.client_application.name, token.client_application.url %></td>
@ -15,22 +15,22 @@
<td>
<%= form_tag :controller => 'oauth', :action => 'revoke' do %>
<%= hidden_field_tag 'token', token.token %>
<%= submit_tag t('oauth_clients.index.revoke') %>
<%= submit_tag t('.revoke') %>
<% end %>
</td>
<% end %>
<% end %>
</table>
<% end %>
<h3><%= t'oauth_clients.index.my_apps' %></h3>
<h3><%= t '.my_apps' %></h3>
<% if @client_applications.empty? %>
<p><%= raw(t('oauth_clients.index.no_apps', :oauth => "<a href=\"https://oauth.net\">OAuth</a>")) %></p>
<p><%= raw(t('.no_apps', :oauth => "<a href=\"https://oauth.net\">OAuth</a>")) %></p>
<% else %>
<p><%= t'oauth_clients.index.registered_apps' %></p>
<p><%= t '.registered_apps' %></p>
<% @client_applications.each do |client|%>
<%= div_for client do %>
<%= link_to client.name, :action => :show, :id => client.id %>
<% end %>
<% end %>
<% end %>
<h3><%= link_to t('oauth_clients.index.register_new'), :action => :new %></h3>
<h3><%= link_to t('.register_new'), :action => :new %></h3>

View file

@ -1,10 +1,10 @@
<% content_for :heading do %>
<h1><%= t'oauth_clients.new.title' %></h1>
<h1><%= t '.title' %></h1>
<% end %>
<div class='standard-form'>
<%= form_for :client_application, :url => { :action => :create } do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<%= submit_tag t('oauth_clients.new.submit') %>
<%= submit_tag t('.submit') %>
<% end %>
</div>

View file

@ -1 +1 @@
<p><%= t('oauth_clients.not_found.sorry', :type => @type) %></p>
<p><%= t('.sorry', :type => @type) %></p>

View file

@ -1,33 +1,33 @@
<% content_for :heading do %>
<h1><%= t('oauth_clients.show.title', :app_name => @client_application.name) %></h1>
<h1><%= t('.title', :app_name => @client_application.name) %></h1>
<% end %>
<div class='prose'>
<p>
<strong><%= t'oauth_clients.show.key' %></strong> <%=@client_application.key %>
<strong><%= t '.key' %></strong> <%=@client_application.key %>
</p>
<p>
<strong><%= t'oauth_clients.show.secret' %></strong> <%=@client_application.secret %>
<strong><%= t '.secret' %></strong> <%=@client_application.secret %>
</p>
<p>
<strong><%= t'oauth_clients.show.url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.request_token_path %>
<strong><%= t '.url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.request_token_path %>
</p>
<p>
<strong><%= t'oauth_clients.show.access_url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.access_token_path %>
<strong><%= t '.access_url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.access_token_path %>
</p>
<p>
<strong><%= t'oauth_clients.show.authorize_url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.authorize_path %>
<strong><%= t '.authorize_url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.authorize_path %>
</p>
<p><%= t'oauth_clients.show.requests' %></p>
<p><%= t '.requests' %></p>
<ul><% @client_application.permissions.each do |perm| %>
<div class="field">
<li><%= t('oauth_clients.form.' + perm.to_s) %></li>
</div>
<% end %></ul>
<p><%= t'oauth_clients.show.support_notice' %></p>
<p><%= t '.support_notice' %></p>
</div>
<div class="buttons">
<%= button_to t('oauth_clients.show.edit'), edit_oauth_client_path(@client_application.user.display_name, @client_application), :method => :get, :class=> "oauth-edit" %>
<%= button_to t('oauth_clients.show.delete'), oauth_client_path(@client_application.user.display_name, @client_application), :method => :delete, :data => { :confirm => t('oauth_clients.show.confirm') }, :class=> "oauth-delete deemphasize" %>
<%= button_to t('.edit'), edit_oauth_client_path(@client_application.user.display_name, @client_application), :method => :get, :class=> "oauth-edit" %>
<%= button_to t('.delete'), oauth_client_path(@client_application.user.display_name, @client_application), :method => :delete, :data => { :confirm => t('.confirm') }, :class=> "oauth-delete deemphasize" %>
</div>

Some files were not shown because too many files have changed in this diff Show more