       |> Enum.map(&EventHelp.add_date_line/1)
       |> Enum.map(&EventHelp.add_candidate_attr/1)
 
+    events =
+      if params["secret"] == @secret do
+        Enum.map events, &add_secret_attrs/1
+      else
+        events
+      end
+
     json conn, events
   end
+
+  defp add_secret_attrs(event = %{id: id}) do
+    organizer_id = Repo.one(from e in Event, where: e.id == ^id, select: e.organizer_id)
+    organizer_edit_hash = Cipher.encrypt("#{organizer_id}")
+    organizer_edit_url = "https://admin.justicedemocrats.com/my-events/#{organizer_edit_hash}"
+
+    event
+    |> Map.put(:rsvp_download_url, "https://admin.justicedemocrats.com/rsvps/#{Event.rsvp_link_for(event.name)}")
+    |> Map.put(:organizer_edit_url, organizer_edit_url)
+  end
 end

  use Core.Web, :controller
  require Logger
  import ShorterMaps
  alias Osdi.{Attendance, Address}

  def get(conn, params) do
    district = get_district(params["district"] || conn.cookies["district"])

      |> Enum.map(&EventHelp.add_date_line/1)
      |> Enum.map(&EventHelp.add_candidate_attr/1)

    events =
      if params["secret"] == @secret do
        Enum.map events, &add_secret_attrs/1
      else
        events
      end

    json conn, events
  end

