Skip to content

Commit

Permalink
Added SETTINGS.name, changed all uses of "Calagator" in code to use it.
Browse files Browse the repository at this point in the history
  • Loading branch information
igal committed Feb 15, 2009
1 parent b64ee0f commit 6996df3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def source_code_version
def datestamp(item)
stamp = "This item was "
if item.source.nil?
stamp << "added directly to Calagator"
stamp << "added directly to #{SETTINGS.name}"
else
stamp << "imported from " << link_to(truncate(item.source.name, 40), item.source.name)
end
Expand Down
4 changes: 1 addition & 3 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,6 @@ def self.to_ical(events, opts={})
# use created_at for DTSTAMP; if there's no created_at, use event.start_time;
c.dtstamp event.created_at || event.start_time
c.uid opts[:url_helper].call(event) if opts[:url_helper]
# c.uid ("http://calagator.org/events/" + event.id.to_s)


# TODO Figure out how to encode a venue. Remember that Vpim can't handle Vvenue itself and our parser had to
# go through many hoops to extract venues from the source data. Also note that the Vevent builder here doesn't
Expand All @@ -460,7 +458,7 @@ def self.to_ical(events, opts={})

# TODO Add calendar title support to vpim or find a prettier way to do this.
# method added because of bug in Outlook 2003, which won't import .ics without a METHOD
return icalendar.encode.sub(/CALSCALE:Gregorian/, "CALSCALE:Gregorian\nX-WR-CALNAME:Calagator\nMETHOD:PUBLISH")
return icalendar.encode.sub(/CALSCALE:Gregorian/, "CALSCALE:Gregorian\nX-WR-CALNAME:#{SETTINGS.name}\nMETHOD:PUBLISH")
end

def location
Expand Down
2 changes: 1 addition & 1 deletion app/views/events/_gcal_reminder.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<%= hidden_field_tag :location, %{#{@event.venue ? @event.venue.title : ''}#{@event.venue ? (@event.venue.geocode_address.blank? ? '' : " #{@event.venue.geocode_address}") : ''}} %>
<%= hidden_field_tag :trp, "true" %>
<%= hidden_field_tag :sprop, url_for('/') %>
<%= hidden_field_tag :sprop, "name:Calagator" %>
<%= hidden_field_tag :sprop, "name:#{SETTINGS.name}" %>
<%= submit_tag "Google Calendar", :style => "display: none" %>
<% end %>
<a href="#" onclick="$('#add_to_google_calendar').submit()">Google Calendar</a>
2 changes: 1 addition & 1 deletion app/views/events/index.atom.builder
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cache_if(@perform_caching, CacheObserver.daily_key_for("events_atom", request)) do
@events ||= @events_deferred.call
atom_feed() do |feed|
feed.title("Calagator#{': ' + @page_title if @page_title}")
feed.title("#{SETTINGS.name}#{': ' + @page_title if @page_title}")
unless @events.size == 0
feed.updated(@events.sort_by(&:updated_at).last.updated_at)

Expand Down
2 changes: 1 addition & 1 deletion app/views/site/recent_changes.atom.builder
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
atom_feed() do |feed|
feed.title("Calagator: Recent Changes")
feed.title("#{SETTINGS.name}: Recent Changes")
unless @items.size == 0
feed.updated(@items.sort_by(&:updated_at).last.updated_at)

Expand Down
4 changes: 2 additions & 2 deletions app/views/sources/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
</div>
<div class='help'>
<p>
<b>Bookmarklet</b>: Import pages faster by adding the following bookmark to your browser's bookmarks and click it when you're visiting a webpage that contains events that you'd like to import into Calagator:
<a href="javascript:d=document;q=(d.location.href);w=window;location.href='http://<%= PRODUCTION_HOSTNAME %>/sources/new?url='+escape(q);">Add to Calagator</a>
<b>Bookmarklet</b>: Import pages faster by adding the following bookmark to your browser's bookmarks and click it when you're visiting a webpage that contains events that you'd like to import:
<%= link_to "Add to #{SETTINGS.name}", "javascript:d=document;q=(d.location.href);w=window;location.href='#{new_source_url}?url='+escape(q);" %>
</p>
</div>
</fieldset>
Expand Down
9 changes: 6 additions & 3 deletions themes/default/settings.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Timezone to display times in:
# Site's name:
name: 'Calagator'

# Deault timezone, run "rake time:zones:all" for options:
timezone: 'Pacific Time (US & Canada)'

# Google map to display on venues page:
# Google map to display on /venues page:
venues_google_map_options:
# Zoom magnification level:
zoom: 12
# Center of the map, latitude and longitude:
# Center of the map, in latitude and longitude:
center: [45.518493, -122.660737]

0 comments on commit 6996df3

Please sign in to comment.