From: Tom Hughes Date: Wed, 3 Jun 2020 16:09:07 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/2637' X-Git-Tag: live~2655 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/0bd6f889c5a4f8f13decd96d6ef478c29b0e388a?hp=cc3ea94e2f4d62d1c791c2a2fc6eb54bf571e007 Merge remote-tracking branch 'upstream/pull/2637' --- diff --git a/app/views/diary_entries/index.html.erb b/app/views/diary_entries/index.html.erb index 32a4e1e0f..96c052da6 100644 --- a/app/views/diary_entries/index.html.erb +++ b/app/views/diary_entries/index.html.erb @@ -10,14 +10,12 @@
  • <%= rss_link_to :action => "rss", :language => params[:language] %>
  • <% end -%> - <% if @user %> - <% if @user == current_user %> -
  • <%= link_to image_tag("new.png", :class => "small_icon") + t(".new"), new_diary_entry_path, :title => t(".new_title") %>
  • - <% end %> - <% else %> - <% if current_user %> -
  • <%= link_to image_tag("new.png", :class => "small_icon") + t(".new"), new_diary_entry_path, :title => t(".new_title") %>
  • - <% end %> + <% if @user && @user == current_user || !@user && current_user %> +
  • <%= link_to image_tag("new.png", :class => "small_icon") + t(".new"), new_diary_entry_path, :title => t(".new_title") %>
  • + <% end %> + + <% if !@user && current_user %> +
  • <%= link_to t(".my_diary"), :controller => "diary_entries", :action => "index", :display_name => current_user.display_name %>
  • <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index f9ea78ef3..1ee3f2378 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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 index 4762116f2..000000000 --- a/lib/tasks/add_version_to_nodes.rake +++ /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 index 4eb2fcf6a..000000000 --- a/script/daemons +++ /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 index 2c2c2bd4b..000000000 --- a/script/gravatar +++ /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