Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Commit

Permalink
I HATE TRAILING WHITESPACE. AAAAARGH.
Browse files Browse the repository at this point in the history
  • Loading branch information
moonglum committed Oct 28, 2012
1 parent 577c50b commit 7bdb549
Show file tree
Hide file tree
Showing 34 changed files with 56 additions and 71 deletions.
2 changes: 0 additions & 2 deletions app/admin/advertisements.rb
@@ -1,5 +1,3 @@
ActiveAdmin.register Advertisement do

form partial: "advertisement_form"

end
4 changes: 2 additions & 2 deletions app/admin/calendar_preset.rb
Expand Up @@ -10,7 +10,7 @@
column :id
column :title
column :user do |preset|
preset.user || 'Nerdhub Preset'
preset.user || 'Nerdhub Preset'
end
column :categories do |preset|
preset.categories.sort_by(&:title).map { |c| span(c.title, style: "color: #{c.color}") }
Expand All @@ -23,7 +23,7 @@
row :id
row :title
row :user do |preset|
preset.user || 'Nerdhub Preset'
preset.user || 'Nerdhub Preset'
end
row :categories do |preset|
ul do
Expand Down
2 changes: 1 addition & 1 deletion app/admin/pictures.rb
Expand Up @@ -10,7 +10,7 @@
end
column :carousel_image do |p|
image_tag p.carousel_image.url
end
end
column :title
column :description
default_actions
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/authorizations_controller.rb
@@ -1,5 +1,4 @@
class AuthorizationsController < ApplicationController

def destroy
@auth = current_user.authorizations.find_by_id(params[:id])
if (current_user.needs_one_authorization?)
Expand All @@ -9,5 +8,4 @@ def destroy
redirect_to edit_user_registration_path, notice: t('registrations.oauth.deleted', provider: @auth.provider.humanize)
end
end

end
13 changes: 6 additions & 7 deletions app/controllers/calendars_controller.rb
@@ -1,8 +1,7 @@
#encoding: utf-8
class CalendarsController < ApplicationController

def show
@advertisement = Advertisement.first
@advertisement = Advertisement.first
@categories = Category.calendar.all

# Die Presets
Expand All @@ -14,8 +13,8 @@ def show
@start_date = params[:start].present? ? Date.parse(params[:start]) : Date.today
rescue ArgumentError => e
@start_date = Date.today
flash.now[:error] = 'Das war kein gültiges Datum... Wir zeigen dir mal den Kalender ab heute'
end
flash.now[:error] = 'Das war kein gültiges Datum... Wir zeigen dir mal den Kalender ab heute'
end

@months = []
13.times { |i| @months << (@start_date + i.months) }
Expand All @@ -41,15 +40,15 @@ def entries
end

@single_events = SingleEvent.where('? <= occurrence AND occurrence <= ?', from, to)
@single_events = @single_events.in_categories(params[:categories].split(',').map(&:to_i)) if params[:categories]
@single_events = @single_events.in_categories(params[:categories].split(',').map(&:to_i)) if params[:categories]

# TODO: An dieser Stelle sollten eigentlich noch die Events nach den Tags rausgefilter werden
# sowohl mit der alten Methode, wie auch mit der neuen (siehe SingleEvent#is_for_user?) dauert
# das ca 6 Sekunden um 4 Wochen voller Termine zu filtern ... ähm ... da stimmt was nicht ...
# Da solltet ihr auf jeden Fall mal drüber gucken ... Solange bleibt die Funktion mal auskommentiert
#
# Das Gleiche gilt auch in der show Methode ...

#@single_events = @single_events.for_user(current_user)
render :entries, layout: false
end
Expand Down
9 changes: 3 additions & 6 deletions app/controllers/callbacks_controller.rb
@@ -1,8 +1,7 @@
class CallbacksController < Devise::OmniauthCallbacksController

# One method to serve them all!
def all

# If there is no token, but we are currently logged in
if current_user
@auth = Authorization.create_authorization(request.env["omniauth.auth"], current_user)
Expand All @@ -13,7 +12,7 @@ def all
end
else
user = User.from_omniauth(request.env["omniauth.auth"])

if user.persisted?
flash.notice = "Signed in via #{request.env["omniauth.auth"]["provider"].capitalize}"
sign_in_and_redirect user
Expand All @@ -24,12 +23,10 @@ def all
end
end
end

alias_method :linkedin, :all
alias_method :twitter, :all
alias_method :facebook, :all
alias_method :google_oauth2, :all
alias_method :github, :all


end
3 changes: 1 addition & 2 deletions app/controllers/podcasts_controller.rb
@@ -1,5 +1,4 @@
class PodcastsController < BlogPostsController

before_filter :sidebar_values

def index
Expand All @@ -9,7 +8,7 @@ def index
end

def show
@advertisement = Advertisement.first
@advertisement = Advertisement.first
@post = BlogPost.find(params[:id])
end

Expand Down
5 changes: 2 additions & 3 deletions app/controllers/search_controller.rb
Expand Up @@ -2,9 +2,8 @@ class SearchController < ApplicationController
respond_to :html, :xml

def index
#authorize! :index, Search
unless params[:search].blank?
@single_events = SingleEvent.search(params[:search])
unless params[:search].blank?
@single_events = SingleEvent.search(params[:search])
@events = Event.search(params[:search])
@blog_posts = BlogPost.search(params[:search])
respond_with @events, @blog_posts, @single_events
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/user_tags_controller.rb
Expand Up @@ -12,7 +12,7 @@ def create

def destroy
return render(:nothing => true, :status => :unauthorized) unless current_user

if remove_tag_from_list params[:kind], remove: params[:id]
render json: { :status => :success, :message => t("user_tags.destroy.confirmation") }, :status => :ok
else
Expand Down
4 changes: 1 addition & 3 deletions app/models/single_event.rb
Expand Up @@ -175,7 +175,7 @@ def is_for_user?(user)

loved_tags_event = (self.event.tag_list & user.like_list)
loved_tags_self = (self.tag_list & user.like_list)

# Wenn der Event oder der Single Event einen Tag haben, den der Benutzer hasst...
if hated_tags_event.size + hated_tags_self.size > 0
# ... muss der Benutzer mindestens einen der anderen Tags des Events lieben
Expand All @@ -191,8 +191,6 @@ def is_for_user?(user)
else
true
end

end

end

2 changes: 1 addition & 1 deletion app/models/tag.rb
Expand Up @@ -2,5 +2,5 @@ class Tag < ActiveRecord::Base
belongs_to :category
def to_param
name
end
end
end
1 change: 0 additions & 1 deletion app/uploaders/advertisement_uploader.rb
Expand Up @@ -27,5 +27,4 @@ def store_dir
def extension_white_list
%w(jpg jpeg gif png)
end

end
@@ -1,7 +1,7 @@
= semantic_form_for [:admin, @welcome_content] do |form|
= form.semantic_fields_for :carousel do |f|
= f.inputs "carousel" do
= f.inputs "carousel items" do
= f.inputs "carousel" do
= f.inputs "carousel items" do
= render 'carousel_fields', :f => f
= add_carousel_link(f)
:javascript
Expand All @@ -17,8 +17,8 @@

- 1.upto(6) do |i|
= form.semantic_fields_for "box_#{i}".to_sym do |f|
= f.inputs "box_#{i}" do
= f.inputs "box_#{i}" do
= f.input :type, input_html: {rows: 1}, :as => :select, :collection => ["BlogPost", "ad", "Podcast" ]
= f.input :type_id, :label => "Choose BlogPost or Podcast", :as => :select, :collection => BlogPost.all.map{|u| [u.headline, u.id]}
= f.input :image_id, :as => :select, :collection => Picture.all.map{|u| [u.title, u.id]}
= form.button
= form.button
2 changes: 1 addition & 1 deletion app/views/events/index.html.haml
Expand Up @@ -13,5 +13,5 @@

= link_to t('common.back'), root_path
|
= link_to "vergangene Events", history_path
= link_to "vergangene Events", history_path

4 changes: 2 additions & 2 deletions app/views/layouts/application.html.haml
Expand Up @@ -79,10 +79,10 @@
%li
%a.nav-link{ href: "http://www.facebook.com/nerdhubcgn", title: "Nerdhub auf Facebook" }
%i.icon-facebook-sign
%li
%li
%a.nav-link{ href: "http://www.twitter.com/nerdhub_cgn", title: "Nerdhub auf Twitter" }
%i.icon-twitter-sign
%li
%li
%a.nav-link{ href: "http://www.github.com/nerdhub", title: "Nerdhub auf Github" }
%i.icon-github-sign
2 changes: 1 addition & 1 deletion app/views/podcasts/feed.rss.builder
@@ -1,5 +1,5 @@
xml.instruct! :xml, :version => "1.0"
xml.rss :version => "2.0",
xml.rss :version => "2.0",
"xmlns:itunes" => "http://www.itunes.com/dtds/podcast-1.0.dtd",
"xmlns:atom" => "http://www.w3.org/2005/Atom" do
xml.channel do
Expand Down
4 changes: 2 additions & 2 deletions app/views/search/index.html.haml
Expand Up @@ -21,7 +21,7 @@
- @events.each do |event|
%li
= link_to event.name, event_path(event)

- unless @blog_posts.blank?
%div Blogs:
- @blog_posts.each do |blog_post|
Expand All @@ -30,4 +30,4 @@



= link_to t('common.back'), :back
= link_to t('common.back'), :back
10 changes: 5 additions & 5 deletions app/views/users/registrations/edit.html.haml
Expand Up @@ -38,7 +38,7 @@
%p
= f.check_box :allow_ignore_view
= f.label :allow_ignore_view, t('users.edit.allow_ignore_view')

%fieldset
%legend= t 'registrations.oauth.title'
%ul
Expand All @@ -48,15 +48,15 @@
= link_to t('registrations.oauth.delete'), user_authorization_path(f.object, auth), :"data-confirm" => t('common.confirm_delete'), method: :delete unless f.object.needs_one_authorization?
- if f.object.needs_one_authorization?
%p=t 'registrations.oauth.only_one_no_password'

%p=t 'registrations.oauth.more'
%ul
- f.object.available_providers.each do |provider|
%li=link_to t('registrations.oauth.add_service', provider: provider.to_s.humanize), user_omniauth_authorize_url(provider)

%fieldset
%legend
= t 'registragions.edit.danger_zone'
= t 'registragions.edit.danger_zone'
- if f.object.encrypted_password?
%p
%em= t('registrations.edit.warning')
Expand All @@ -82,7 +82,7 @@
= f.label :password_confirmation
%br
= f.password_field :password_confirmation

%p= f.submit t('registrations.edit.save_profile')

%h3= t 'registrations.edit.delete_profile'
Expand Down
6 changes: 3 additions & 3 deletions app/views/users/registrations/new.html.haml
Expand Up @@ -4,14 +4,14 @@
= f.input :nickname
- if resource.email_required?
= f.input :email, :as => :email

- if resource.password_required? && !params[:auth].present?
= f.input :password, :as => :password
= f.input :password_confirmation, :as => :password

- if resource.auth_temp_token
= f.hidden_field :auth_temp_token, value: resource.auth_temp_token

.controls
= f.submit "Speichern", class: 'btn btn-inverse'
= render partial: "users/shared/links"
2 changes: 1 addition & 1 deletion app/views/users/sessions/new.html.haml
Expand Up @@ -7,7 +7,7 @@
= f.input :password
- if devise_mapping.rememberable?
= f.input :remember_me, :as => :boolean

.controls
= f.submit "Anmelden", class: 'btn btn-inverse'
= render partial: 'users/shared/links'
Expand Down
4 changes: 2 additions & 2 deletions app/views/users/shared/_links.html.haml
@@ -1,7 +1,7 @@
- if controller_name != 'sessions'
= link_to "Anmelden", new_session_path(resource_name), class: 'btn'
= link_to "Anmelden", new_session_path(resource_name), class: 'btn'

- if devise_mapping.registerable? && controller_name != 'registrations'
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to "Registrieren", new_registration_path(resource_name), class: 'btn'

- if devise_mapping.recoverable? && controller_name != 'passwords'
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Expand Up @@ -36,7 +36,7 @@ class Application < Rails::Application

# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password, :password_confirm]

# Enable the asset pipeline
config.assets.enabled = true
# We do not need rails when precompiling
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Expand Up @@ -15,7 +15,7 @@
config.assets.compress = true

# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
config.assets.compile = true

# Generate digests for assets URLs
config.assets.digest = true
Expand Down
3 changes: 1 addition & 2 deletions config/environments/test.rb
Expand Up @@ -38,8 +38,7 @@
config.active_support.deprecation = :stderr

config.action_mailer.default_url_options = { host: "hcking.de" }

# OmniAuth in testing mode
OmniAuth.config.test_mode = true

end
3 changes: 1 addition & 2 deletions config/initializers/active_admin.rb
Expand Up @@ -116,7 +116,6 @@
# Enable and disable Batch Actions
#
config.batch_actions = true


# == Controller Filters
#
Expand All @@ -134,7 +133,7 @@
#
# To load a stylesheet:
# config.register_stylesheet 'my_stylesheet.css'

# You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
# config.register_stylesheet 'my_print_stylesheet.css', :media => :print
#
Expand Down
2 changes: 1 addition & 1 deletion config/navigation.rb
Expand Up @@ -55,7 +55,7 @@
# :method - Specifies the http-method for the generated link - default is :get.
# :highlights_on - if autohighlighting is turned off and/or you want to explicitly specify
# when the item should be highlighted, you can set a regexp which is matched
# against the current URI. You may also use a proc, or the symbol <tt>:subpath</tt>.
# against the current URI. You may also use a proc, or the symbol <tt>:subpath</tt>.
#
#primary.item :key_1, 'name', url, options

Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20120714114632_create_authorizations.rb
Expand Up @@ -7,7 +7,7 @@ def change

t.timestamps
end

add_index :authorizations, :user_id
end
end

0 comments on commit 7bdb549

Please sign in to comment.