]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/2639'
authorTom Hughes <tom@compton.nu>
Wed, 3 Jun 2020 16:19:03 +0000 (17:19 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 3 Jun 2020 16:19:03 +0000 (17:19 +0100)
app/views/diary_entries/index.html.erb
config/initializers/new_framework_defaults_5_2.rb [deleted file]
config/initializers/query_cache.rb [deleted file]
config/locales/en.yml
lib/tasks/add_version_to_nodes.rake [deleted file]
script/daemons [deleted file]
script/gravatar [deleted file]

index 32a4e1e0fb7154f32f2f8b8d0789f84e122a8968..96c052da69fd940ff16c7e7f374017fbde99ed6c 100644 (file)
         <li><%= rss_link_to :action => "rss", :language => params[:language] %></li>
       <% end -%>
 
-      <% if @user %>
-        <% if @user == current_user %>
-          <li><%= link_to image_tag("new.png", :class => "small_icon") + t(".new"), new_diary_entry_path, :title => t(".new_title") %></li>
-        <% end %>
-      <% else %>
-        <% if current_user %>
-          <li><%= link_to image_tag("new.png", :class => "small_icon") + t(".new"), new_diary_entry_path, :title => t(".new_title") %></li>
-        <% end %>
+      <% if @user && @user == current_user || !@user && current_user %>
+        <li><%= link_to image_tag("new.png", :class => "small_icon") + t(".new"), new_diary_entry_path, :title => t(".new_title") %></li>
+      <% end %>
+
+      <% if !@user && current_user %>
+        <li><%= link_to t(".my_diary"), :controller => "diary_entries", :action => "index", :display_name => current_user.display_name %></li>
       <% end %>
     </ul>
   </div>
diff --git a/config/initializers/new_framework_defaults_5_2.rb b/config/initializers/new_framework_defaults_5_2.rb
deleted file mode 100644 (file)
index c383d07..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-# Be sure to restart your server when you modify this file.
-#
-# This file contains migration options to ease your Rails 5.2 upgrade.
-#
-# Once upgraded flip defaults one by one to migrate to the new default.
-#
-# Read the Guide for Upgrading Ruby on Rails for more info on each option.
-
-# Make Active Record use stable #cache_key alongside new #cache_version method.
-# This is needed for recyclable cache keys.
-# Rails.application.config.active_record.cache_versioning = true
-
-# Use AES-256-GCM authenticated encryption for encrypted cookies.
-# Also, embed cookie expiry in signed or encrypted cookies for increased security.
-#
-# This option is not backwards compatible with earlier Rails versions.
-# It's best enabled when your entire app is migrated and stable on 5.2.
-#
-# Existing cookies will be converted on read then written with the new scheme.
-# Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true
-
-# Use AES-256-GCM authenticated encryption as default cipher for encrypting messages
-# instead of AES-256-CBC, when use_authenticated_message_encryption is set to true.
-# Rails.application.config.active_support.use_authenticated_message_encryption = true
-
-# Add default protection from forgery to ActionController::Base instead of in
-# ApplicationController.
-# Rails.application.config.action_controller.default_protect_from_forgery = true
-
-# Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and
-# 'f' after migrating old data.
-# Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
-
-# Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header.
-# Rails.application.config.active_support.use_sha1_digests = true
-
-# Make `form_with` generate id attributes for any generated HTML tags.
-# Rails.application.config.action_view.form_with_generates_ids = true
diff --git a/config/initializers/query_cache.rb b/config/initializers/query_cache.rb
deleted file mode 100644 (file)
index bb9c8b0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Rails.configuration.middleware.delete ActiveRecord::QueryCache
index f9ea78ef3704abf956ec42d09d7e31a736d6866f..1ee3f2378fa76c4fd97e02d0f820954327ffcd37 100644 (file)
@@ -373,6 +373,7 @@ en:
       in_language_title: "Diary Entries in %{language}"
       new: New Diary Entry
       new_title: Compose a new entry in my user diary
+      my_diary: My Diary
       no_entries: No diary entries
       recent_entries: "Recent diary entries"
       older_entries: Older Entries
diff --git a/lib/tasks/add_version_to_nodes.rake b/lib/tasks/add_version_to_nodes.rake
deleted file mode 100644 (file)
index 4762116..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-namespace "db" do
-  desc "Adds a version number to the nodes table"
-  task :node_version => :environment do
-    require File.dirname(__FILE__) + "/../../config/environment"
-
-    increment = 1000
-    offset = 0
-    id_max = OldNode.find(:first, :order => "id desc").id
-
-    while offset < (id_max + increment)
-      hash = {}
-
-      # should be offsetting not selecting
-      OldNode.find(:all, :limit => increment, :offset => offset, :order => "timestamp").each do |node|
-        hash[node.id] ||= []
-        hash[node.id] << node
-      end
-
-      hash.each_value do |node_array|
-        n = 1
-        node_array.each do |node|
-          temp_old_node = TempOldNode.new
-          temp_old_node.id = node.id
-          temp_old_node.latitude = node.latitude
-          temp_old_node.longitude = node.longitude
-          temp_old_node.user_id = node.user_id
-          temp_old_node.visible = node.visible
-          temp_old_node.timestamp = node.timestamp
-          temp_old_node.tile = node.tile
-          temp_old_node.version = n
-          temp_old_node.save! || raise
-          n += 1
-        end
-      end
-      offset += increment
-    end
-  end
-end
diff --git a/script/daemons b/script/daemons
deleted file mode 100755 (executable)
index 4eb2fcf..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env ruby
-Dir[File.dirname(__FILE__) + "/../lib/daemons/*_ctl"].each { |f| `#{f} #{ARGV.first}` }
diff --git a/script/gravatar b/script/gravatar
deleted file mode 100755 (executable)
index 2c2c2bd..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env ruby
-
-# require File.dirname(__FILE__) + "/../config/environment"
-
-start = 0
-User.where("image_use_gravatar AND id >=" + start.to_s).order("id").find_each do |user|
-  p "checked up to id " + user.id.to_s if (user.id % 1000).zero? # just give a rough indication where we are for restarting
-  next if user.avatar.attached?
-
-  hash = Digest::MD5.hexdigest(user.email.downcase)
-  url = "https://www.gravatar.com/avatar/#{hash}?d=404" # without d=404 we will always get an image back
-  response = OSM.http_client.get(URI.parse(url))
-  user.image_use_gravatar = response.success?
-  user.save
-  sleep(1)
-end
-
-exit 0