Permalink
Browse files

Massive cleanup.

Removed old theme, old images, unused views/partials/helpers, etc.

I'm sure there's more that can be removed, but this is a good start.
  • Loading branch information...
1 parent eb591e8 commit 0c51b6b585e10b78e85cd51ea971e5a5831a10ec @seven1m seven1m committed Nov 21, 2010
Showing 424 changed files with 127 additions and 19,372 deletions.
@@ -33,17 +33,7 @@ def show
@family_people = @person.family.try(:visible_people) || []
@albums = @person.albums.all(:order => 'created_at desc')
@verses = @person.verses.all(:order => 'book, chapter, verse')
- if params[:simple]
- if @logged_in.full_access?
- if params[:photo]
- render :action => 'show_simple_photo', :layout => false
- else
- render :action => 'show_simple', :layout => false
- end
- else
- render :text => '', :status => 404
- end
- elsif params[:business]
+ if params[:business]
render :action => 'business'
else
respond_to do |format|
@@ -1,72 +0,0 @@
-class RecipesController < ApplicationController
-
- def index
- if params[:person_id]
- @person = Person.find(params[:person_id])
- if @logged_in.can_see?(@person)
- @recipes = @person.recipes.paginate(:order => 'created_at desc', :page => params[:page])
- else
- render :text => t('not_authorized'), :layout => true, :status => 401
- end
- @tags = Recipe.tag_counts(:conditions => ['recipes.id in (?)', @recipes.map { |v| v.id } || [0]])
- else
- @recipes = Recipe.paginate(:order => 'title', :page => params[:page])
- @tags = Recipe.tag_counts
- end
- end
-
- def show
- @recipe = Recipe.find(params[:id])
- end
-
- def new
- @recipe = Recipe.new
- end
-
- def create
- @recipe = Recipe.new(params[:recipe])
- @recipe.person = @logged_in
- if @recipe.save
- flash[:notice] = t('recipes.saved')
- redirect_to @recipe
- else
- render :action => 'new'
- end
- end
-
- def edit
- @recipe = Recipe.find(params[:id])
- unless @logged_in.can_edit?(@recipe)
- render :text => t('not_authorized'), :layout => true, :status => 401
- end
- end
-
- def update
- @recipe = Recipe.find(params[:id])
- @recipe.tag_list.remove(params[:remove_tag]) if params[:remove_tag]
- @recipe.tag_list.add(*params[:add_tags].split) if params[:add_tags]
- @recipe.save if params[:remove_tag] or params[:add_tags]
- if @logged_in.can_edit?(@recipe)
- if @recipe.update_attributes(params[:recipe])
- flash[:notice] = t('recipes.saved')
- redirect_to @recipe
- else
- render :action => 'edit'
- end
- else
- render :text => t('not_authorized'), :layout => true, :status => 401
- end
- end
-
- def destroy
- @recipe = Recipe.find(params[:id])
- if @logged_in.can_edit?(@recipe)
- @recipe.destroy
- flash[:notice] = t('recipes.deleted')
- redirect_to recipes_path
- else
- render :text => t('not_authorized'), :layout => true, :status => 401
- end
- end
-
-end
@@ -1,26 +0,0 @@
-class ToursController < ApplicationController
-
- # allow start/stop from a get request
- def show
- if params[:start]
- create
- elsif params[:stop]
- destroy
- else
- raise ActionController::UnknownAction, t('No_action_to_show')
- end
- end
-
- def create
- session[:touring] = true
- expire_fragment(%r{views/people/.+_#{@logged_in.id}})
- redirect_to stream_path
- end
-
- def destroy
- session[:touring] = false
- expire_fragment(%r{views/people/.+_#{@logged_in.id}})
- redirect_back
- end
-
-end
@@ -1,2 +0,0 @@
-module RecipesHelper
-end
@@ -43,15 +43,4 @@ def recent_time_ago_in_words(time)
end
end
- def stream_type_checkmark(name, type, checked_by_default=true)
- enabled = cookies["stream_#{type}"]
- enabled = cookies["stream_#{type}"] = checked_by_default if cookies["stream_#{type}"].nil?
- link_to_function(
- image_tag(enabled ? 'checkmark.png' : 'remove.gif', :alt => t('stream.enable_disable') + " #{name}", :class => 'icon') + " #{name}",
- "enable_stream_item_type('" + type + "', this.getElementsByTagName('img')[0].readAttribute('src') != '/images/checkmark.png');",
- :id => "enable-stream_" + type
- )
- end
-
-
end
@@ -1,15 +0,0 @@
-module ToursHelper
-
- def tour_popup(name, url, width, align)
- if File.exist?("#{Rails.root}/public/#{url.sub(/^\/pages\//, '')}.#{I18n.locale}.html.liquid")
- html = ''
- html << stylesheet_link_tag('modalbox.css')
- html << javascript_include_tag('modalbox.js')
- html << '<script type="text/javascript">'
- html << "Modalbox.show('#{url}', {title: 'Site Tour - #{name}', width: #{width}, align: '#{align}'});"
- html << "setTimeout('Modalbox.resizeToContent()', 5000);" # hack to fit content
- html << '</script>'
- end
- end
-
-end
View
@@ -1,105 +0,0 @@
-class Recipe < ActiveRecord::Base
-
- has_many :comments, :dependent => :destroy
- belongs_to :person, :include => :family, :conditions => ['people.visible = ? and families.visible = ?', true, true]
- has_and_belongs_to_many :tags
- belongs_to :site
-
- scope_by_site_id
-
- attr_accessible :title, :notes, :description, :ingredients, :directions, :prep, :bake, :serving_size
-
- validates_presence_of :title
- validates_presence_of :ingredients
- validates_presence_of :directions
- validates_attachment_size :photo, :less_than => PAPERCLIP_PHOTO_MAX_SIZE
- validates_attachment_content_type :photo, :content_type => PAPERCLIP_PHOTO_CONTENT_TYPES
-
- has_attached_file :photo, PAPERCLIP_PHOTO_OPTIONS
- acts_as_logger LogItem
- acts_as_taggable
-
- def name; title; end
-
- def body; description; end
-
- # not needed any more?
- def admin?(person)
- person.can_edit?(self)
- end
-
- def tag_string=(text)
- text.split.each do |tag_name|
- tag = Tag.find_or_create_by_name(tag_name.downcase)
- tags << tag if not tags.include? tag
- end
- tags
- end
-
- def ingredients=(text)
- write_attribute :ingredients, Recipe.convert_entities(text)
- end
-
- def directions=(text)
- write_attribute :directions, Recipe.convert_entities(text)
- end
-
- CONVERSIONS = {
- '1/4' => '&frac14;',
- '1/2' => '&frac12;',
- '3/4' => '&frac34;',
- '1/3' => '&#8531;',
- '2/3' => '&#8532;',
- '1/5' => '&#8533;',
- '2/5' => '&#8534;',
- '3/5' => '&#8535;',
- '4/5' => '&#8536;',
- '1/6' => '&#8537;',
- '5/6' => '&#8538;',
- '1/8' => '&#8539;',
- '3/8' => '&#8540;',
- '5/8' => '&#8541;',
- '7/8' => '&#8542;'
- }
-
- class << self
- def convert_entities(text)
- CONVERSIONS.each do |raw, entity|
- text.gsub! Regexp.new(' ?'+raw), entity
- end
- text
- end
- end
-
- after_create :create_as_stream_item
-
- def create_as_stream_item
- return unless person
- StreamItem.create!(
- :title => title,
- :body => description,
- :person_id => person_id,
- :streamable_type => 'Recipe',
- :streamable_id => id,
- :created_at => created_at,
- :shared => person.share_activity?
- )
- end
-
- after_update :update_stream_items
-
- def update_stream_items
- StreamItem.find_all_by_streamable_type_and_streamable_id('Recipe', id).each do |stream_item|
- stream_item.title = title
- stream_item.body = description
- stream_item.save
- end
- end
-
- after_destroy :delete_stream_items
-
- def delete_stream_items
- StreamItem.destroy_all(:streamable_type => 'Recipe', :streamable_id => id)
- end
-
-end
@@ -14,10 +14,6 @@
}
</script>
-<% content_for :subnav do %>
- <li><%= link_to image_tag('eye.png', :alt => t('privacies.view_profile'), :class => 'icon') + ' ' + t('privacies.view_profile'), person_path(@person) %></li>
-<% end %>
-
<h2><%= @person.name %></h2>
<%= form_for @person, :url => person_account_path(@person), :html => {:onsubmit => "return encrypt_passwords()"} do |form| %>
<%= hidden_field_tag :encrypted_password %>
@@ -0,0 +1 @@
+$('#record<%= @record.id %>').hide('slow', function(){$(this).detach()});
@@ -1 +0,0 @@
-page.visual_effect(:fade, "record#{@record.id}")
@@ -4,7 +4,7 @@
<% if @group %><%= t('for') %> <%= @group.name %><% end %>
</h2>
-<p>
+<p id="record-count">
<%= pluralize @record_count, t('import.record') %>
</p>
@@ -61,7 +61,7 @@
<%= record.created_at.to_s(:time) %>
</td>
<td>
- <%= link_to image_tag('delete.png', :alt => t('Delete'), :class => 'icon no-print'), :remote => true, :url => administration_attendance_path(record), :method => 'delete', :confirm => t('are_you_sure') %>
+ <%= link_to '', administration_attendance_path(record), :remote => true, :method => 'delete', :confirm => t('are_you_sure'), :class => 'delete-icon' %>
</td>
</tr>
<% end %>
@@ -47,7 +47,7 @@
</td>
<td>
<% if item.flagged_on %>
- <%= image_tag('flag_red.gif', :alt => t('admin.logs.flagged'), :class => 'icon') %>
+ <span class="very-strong">!</span>
<% end %>
</td>
<td><%= item.loggable_type %></td>
@@ -28,7 +28,7 @@
<%= render :partial => 'people/thumbnail', :locals => {:person => update.person} %>
</a>
<% else %>
- <%= image_tag 'man.tn.gif', :alt => '(' + t('admin.updates.person_deleted') + ')', :class => 'icon thumbnail' %>
+ <%= image_tag 'clean/manoutline.tn.png', :alt => '(' + t('admin.updates.person_deleted') + ')', :class => 'icon thumbnail' %>
<% end %>
</td>
<td class="update">
@@ -1,7 +1,3 @@
-<% content_for :subnav do %>
- <li><%= link_to image_tag('eye.png', :alt => t('groups.view_group'), :class => 'icon') + ' ' + t('groups.view_group'), @group %></li>
-<% end %>
-
<p>
<%= label_tag :attended_at, t('attendance.date') + ':', :class => 'inline' %>
<%= text_field_tag :attended_at, @attended_at.to_s(:date), :onchange => "location.href='?attended_at='+encodeURIComponent(this.value)" %>
@@ -1,13 +1,10 @@
-<% content_for :subnav do %>
+<% content_for :sidebar do %>
<% if @person %>
- <li><%= link_to image_tag('user.png', :alt => t('person'), :class => 'icon') + ' ' + t('back_to') + ' ' + @person.name, @person %></li>
<% if params[:family] %>
- <li><%= link_to image_tag('checkmark.png', :alt => t('calendars.family_members_enabled'), :class => 'icon') + ' ' + t('calendars.family_members_enabled'), '?', :style => 'text-decoration:none;' %></li>
+ <p><%= link_to t('calendars.family_members_enabled'), '?' %></p>
<% else %>
- <li><%= link_to image_tag('remove.gif', :alt => t('calendars.family_members_disabled'), :class => 'icon') + ' ' + t('calendars.family_members_disabled'), '?family=true', :style => 'text-decoration:none;' %></li>
+ <p><%= link_to t('calendars.family_members_disabled'), '?family=true' %></p>
<% end %>
- <% elsif @group %>
- <li><%= link_to image_tag('group.png', :alt => 'Group', :class => 'icon') + ' ' + t('back_to') + ' ' + @group.name, @group %></li>
<% end %>
<% end %>
@@ -1,10 +1,6 @@
-<% content_for :subnav do %>
- <li><%= link_to image_tag('user.png', :alt => @person.name, :class => 'icon') + ' ' + @person.name, @person %></li>
-<% end %>
-
<% content_for :sidebar do %>
<%= render :partial => 'people/photo' %>
- <h1><%= @person.name %></h1>
+ <h2><%= @person.name %></h2>
<% end %>
<p>
@@ -21,6 +17,6 @@
<% end %>
</p>
-<h2><%= t('contributions.Contributions') %></h2>
+<h3><%= t('contributions.Contributions') %></h3>
-<%= render :partial => 'donations' %>
+<%= render :partial => 'donations' %>
@@ -2,5 +2,8 @@
<%= render :partial => 'families/photo' %>
<% end %>
<h2><%= link_to @family.name, @family %></h2>
-<p><%= preserve_breaks @family.pretty_address %> <%= render(:partial => 'map_link') %></p>
<p><%= format_phone @family.home_phone %></p>
+<p><%= preserve_breaks @family.pretty_address %></p>
+<% if @family.mapable? %>
+ <p><%= link_to t('families.find_on_map'), "http://maps.yahoo.com/broadband/#mvt=m&q1=#{url_encode(@family.mapable_address)}", :target => '_new', :class => 'right-icon' %></p>
+<% end %>
@@ -1,3 +0,0 @@
-<% if @family.mapable? %>
- <%= link_to image_tag('map_go.gif', :alt => t('families.find_on_map'), :class => 'icon'), "http://maps.yahoo.com/broadband/#mvt=m&q1=#{url_encode(@family.mapable_address)}", :target => '_new' %>
-<% end %>
@@ -2,6 +2,6 @@
<%= feed.name %>
<%= link_to_function 'url', "$('#feed#{feed.id}').show();$(this).hide();" %>
<span id="feed<%= feed.id %>" style="display:none;font-family:monospace;"><%= feed.url %></span>
- <% if @logged_in.admin? %><span class="small discreet">(<%= pluralize(feed.error_count, ' error') %>)</small><% end %>
- <%= link_to image_tag('delete.png', :alt => t('Delete'), :class => 'icon'), [@person, feed], :method => 'delete', :confirm => t('feeds.are_you_sure') %>
+ <% if @logged_in.admin? %><span class="small discreet">(<%= pluralize(feed.error_count, ' error') %>)</span><% end %>
+ <%= link_to '', [@person, feed], :method => 'delete', :confirm => t('feeds.are_you_sure'), :class => 'delete-icon' %>
</li>
Oops, something went wrong.

0 comments on commit 0c51b6b

Please sign in to comment.