├── log └── .gitkeep ├── lib ├── tasks │ ├── .gitkeep │ └── cron.rake └── assets │ └── .gitkeep ├── test ├── unit │ ├── .gitkeep │ ├── user_test.rb │ ├── media_test.rb │ └── setting_test.rb ├── fixtures │ ├── .gitkeep │ ├── media.yml │ ├── settings.yml │ └── users.yml ├── functional │ └── .gitkeep ├── integration │ └── .gitkeep ├── performance │ └── browsing_test.rb └── test_helper.rb ├── .rvmrc ├── app ├── mailers │ └── .gitkeep ├── models │ ├── .gitkeep │ ├── setting.rb │ ├── user.rb │ └── medium.rb ├── assets │ ├── stylesheets │ │ ├── _vars.sass │ │ ├── _mixins.sass │ │ ├── application.css │ │ ├── form.sass │ │ └── screen.sass │ ├── .DS_Store │ ├── images │ │ ├── logo.png │ │ ├── .DS_Store │ │ ├── rails.png │ │ ├── ads-hof.png │ │ ├── favicon.png │ │ ├── foo │ │ │ └── foo.gif │ │ ├── ios-icon.png │ │ ├── team │ │ │ ├── jean.gif │ │ │ ├── luc.gif │ │ │ └── zog.gif │ │ ├── button-post.png │ │ ├── icon-search.gif │ │ ├── icon-share.png │ │ ├── logo-error.png │ │ ├── thumb-trash.gif │ │ ├── icon-logo-mini.png │ │ ├── icon-shuffle.png │ │ ├── background-body.gif │ │ ├── background-error.jpg │ │ ├── background-tags.png │ │ ├── background-thumb.gif │ │ ├── background-tips.png │ │ ├── dans-le-dur-logo.png │ │ ├── icon-no-results.png │ │ ├── background-overlay.png │ │ ├── background-footer-stats.gif │ │ ├── background-pagination-more.png │ │ └── background-thumb-original.gif │ └── javascripts │ │ ├── zeroclipboard │ │ ├── ZeroClipboard.fla │ │ ├── ZeroClipboard.swf │ │ ├── ZeroClipboard10.fla │ │ ├── ZeroClipboard10.swf │ │ ├── test.html │ │ ├── ZeroClipboard10.as │ │ ├── ZeroClipboard.as │ │ └── ZeroClipboard.js │ │ ├── fb.js │ │ ├── application.js │ │ └── shortcut.js ├── helpers │ └── application_helper.rb ├── .DS_Store ├── views │ ├── static │ │ ├── legals.haml │ │ ├── about.html.haml │ │ └── _misc.haml │ ├── media │ │ ├── edit.html.haml │ │ ├── new.html.haml │ │ ├── _compact.html.haml │ │ ├── _form.html.haml │ │ ├── hall_of_fame.html.haml │ │ ├── _misc.html.haml │ │ ├── index.html.haml │ │ ├── fullscreen.html.haml │ │ └── show.html.haml │ ├── devise │ │ └── sessions │ │ │ └── new.html.haml │ ├── shared │ │ ├── not_found.html.haml │ │ └── denied.html.haml │ └── layouts │ │ └── application.html.haml └── controllers │ ├── static_controller.rb │ ├── application_controller.rb │ └── media_controller.rb ├── last_tweet.pstore ├── vendor ├── plugins │ └── .gitkeep └── assets │ └── stylesheets │ └── .gitkeep ├── Procfile ├── public ├── images │ ├── bg.png │ ├── logo.png │ ├── paste.gif │ ├── bt-tag.png │ ├── favicon.png │ ├── Untitled-5.png │ ├── bg-medium.png │ ├── bg-search.png │ ├── bt-search.png │ ├── bt-shuffle.png │ ├── bt-tag-inner.png │ ├── pagination-next.png │ ├── pagination-prev.png │ ├── pagination-next-hover.png │ └── pagination-prev-hover.png ├── robots.txt ├── 422.html ├── 404.html └── 500.html ├── #template ├── images │ ├── .DS_Store │ ├── logo.png │ ├── ads-hof.png │ ├── button-post.png │ ├── icon-search.gif │ ├── thumb-trash.gif │ ├── background-body.gif │ ├── background-tags.png │ ├── background-tips.png │ ├── background-thumb.gif │ ├── fake │ │ └── thumb-206x132.png │ └── background-footer-stats.gif ├── imagess │ ├── logo.png │ ├── ads-hof.png │ ├── favicon.png │ ├── ios-icon.png │ ├── team │ │ ├── jean.gif │ │ ├── luc.gif │ │ └── zog.gif │ ├── button-post.png │ ├── icon-search.gif │ ├── icon-share.png │ ├── logo-error.png │ ├── thumb-trash.gif │ ├── icon-logo-mini.png │ ├── icon-shuffle.png │ ├── background-body.gif │ ├── background-error.jpg │ ├── background-tags.png │ ├── background-thumb.gif │ ├── background-tips.png │ ├── dans-le-dur-logo.png │ ├── icon-no-results.png │ ├── background-overlay.png │ ├── fake │ │ ├── thumb-100x64.gif │ │ ├── thumb-206x132.png │ │ └── thumb-original.gif │ ├── background-footer-stats.gif │ ├── background-pagination-more.png │ └── background-thumb-original.gif └── view │ ├── .DS_Store │ ├── show-layout.html.haml │ ├── about-layout.html.haml │ ├── error-layout.html.haml │ ├── result-layout.html.haml │ ├── form-and-flash.html.haml │ ├── application.html.haml │ └── index-layout.html.haml ├── .gitignore ├── config ├── unicorn.rb ├── boot.rb ├── initializers │ ├── mime_types.rb │ ├── fix_deadlock.rb │ ├── inflections.rb │ ├── backtrace_silencers.rb │ ├── session_store.rb │ ├── secret_token.rb │ ├── wrap_parameters.rb │ └── devise.rb ├── environment.rb ├── locales │ ├── en.yml │ ├── fr.yml │ ├── devise.en.yml │ └── devise.fr.yml ├── database.yml ├── environments │ ├── development.rb │ ├── test.rb │ └── production.rb ├── routes.rb └── application.rb ├── script ├── delayed_job └── rails ├── db ├── migrate │ ├── 20111230103748_add_counts_to_media.rb │ ├── 20110927205847_create_media.rb │ ├── 20110929191503_create_users.rb │ ├── 20110929171710_create_settings.rb │ ├── 20120517144759_add_url_to_media.rb │ ├── 20110927205949_add_image_to_media.rb │ ├── 20110927212124_acts_as_taggable_on_migration.rb │ ├── 20110929191516_add_devise_to_users.rb │ └── 20120311124156_create_delayed_jobs.rb ├── seeds.rb └── schema.rb ├── doc └── README_FOR_APP ├── config.ru ├── Rakefile ├── README.md ├── Gemfile └── Gemfile.lock /log/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/unit/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rvmrc: -------------------------------------------------------------------------------- 1 | rvm 1.9.2 2 | -------------------------------------------------------------------------------- /app/mailers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /last_tweet.pstore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functional/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/stylesheets/_vars.sass: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/.DS_Store -------------------------------------------------------------------------------- /app/assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/.DS_Store -------------------------------------------------------------------------------- /public/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/bg.png -------------------------------------------------------------------------------- /public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/logo.png -------------------------------------------------------------------------------- /public/images/paste.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/paste.gif -------------------------------------------------------------------------------- /#template/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/.DS_Store -------------------------------------------------------------------------------- /#template/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/logo.png -------------------------------------------------------------------------------- /#template/imagess/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/logo.png -------------------------------------------------------------------------------- /#template/view/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/view/.DS_Store -------------------------------------------------------------------------------- /app/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/logo.png -------------------------------------------------------------------------------- /public/images/bt-tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/bt-tag.png -------------------------------------------------------------------------------- /public/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/favicon.png -------------------------------------------------------------------------------- /#template/images/ads-hof.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/ads-hof.png -------------------------------------------------------------------------------- /app/assets/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/.DS_Store -------------------------------------------------------------------------------- /app/assets/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/rails.png -------------------------------------------------------------------------------- /public/images/Untitled-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/Untitled-5.png -------------------------------------------------------------------------------- /public/images/bg-medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/bg-medium.png -------------------------------------------------------------------------------- /public/images/bg-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/bg-search.png -------------------------------------------------------------------------------- /public/images/bt-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/bt-search.png -------------------------------------------------------------------------------- /public/images/bt-shuffle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/bt-shuffle.png -------------------------------------------------------------------------------- /#template/imagess/ads-hof.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/ads-hof.png -------------------------------------------------------------------------------- /#template/imagess/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/favicon.png -------------------------------------------------------------------------------- /#template/imagess/ios-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/ios-icon.png -------------------------------------------------------------------------------- /#template/imagess/team/jean.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/team/jean.gif -------------------------------------------------------------------------------- /#template/imagess/team/luc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/team/luc.gif -------------------------------------------------------------------------------- /#template/imagess/team/zog.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/team/zog.gif -------------------------------------------------------------------------------- /app/assets/images/ads-hof.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/ads-hof.png -------------------------------------------------------------------------------- /app/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/favicon.png -------------------------------------------------------------------------------- /app/assets/images/foo/foo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/foo/foo.gif -------------------------------------------------------------------------------- /app/assets/images/ios-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/ios-icon.png -------------------------------------------------------------------------------- /app/assets/images/team/jean.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/team/jean.gif -------------------------------------------------------------------------------- /app/assets/images/team/luc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/team/luc.gif -------------------------------------------------------------------------------- /app/assets/images/team/zog.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/team/zog.gif -------------------------------------------------------------------------------- /public/images/bt-tag-inner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/bt-tag-inner.png -------------------------------------------------------------------------------- /#template/images/button-post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/button-post.png -------------------------------------------------------------------------------- /#template/images/icon-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/icon-search.gif -------------------------------------------------------------------------------- /#template/images/thumb-trash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/thumb-trash.gif -------------------------------------------------------------------------------- /#template/imagess/button-post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/button-post.png -------------------------------------------------------------------------------- /#template/imagess/icon-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/icon-search.gif -------------------------------------------------------------------------------- /#template/imagess/icon-share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/icon-share.png -------------------------------------------------------------------------------- /#template/imagess/logo-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/logo-error.png -------------------------------------------------------------------------------- /#template/imagess/thumb-trash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/thumb-trash.gif -------------------------------------------------------------------------------- /app/assets/images/button-post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/button-post.png -------------------------------------------------------------------------------- /app/assets/images/icon-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/icon-search.gif -------------------------------------------------------------------------------- /app/assets/images/icon-share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/icon-share.png -------------------------------------------------------------------------------- /app/assets/images/logo-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/logo-error.png -------------------------------------------------------------------------------- /app/assets/images/thumb-trash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/thumb-trash.gif -------------------------------------------------------------------------------- /public/images/pagination-next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/pagination-next.png -------------------------------------------------------------------------------- /public/images/pagination-prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/pagination-prev.png -------------------------------------------------------------------------------- /#template/images/background-body.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/background-body.gif -------------------------------------------------------------------------------- /#template/images/background-tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/background-tags.png -------------------------------------------------------------------------------- /#template/images/background-tips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/background-tips.png -------------------------------------------------------------------------------- /#template/imagess/icon-logo-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/icon-logo-mini.png -------------------------------------------------------------------------------- /#template/imagess/icon-shuffle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/icon-shuffle.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .bundle 3 | db/*.sqlite3 4 | log/*.log 5 | tmp/ 6 | public/system/images/ 7 | .sass-cache/ 8 | -------------------------------------------------------------------------------- /app/assets/images/icon-logo-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/icon-logo-mini.png -------------------------------------------------------------------------------- /app/assets/images/icon-shuffle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/icon-shuffle.png -------------------------------------------------------------------------------- /app/views/static/legals.haml: -------------------------------------------------------------------------------- 1 | #main 2 | %h1 ???? 3 | %p.about Lorem ipsum non ? 4 | 5 | = render partial: 'static/misc' -------------------------------------------------------------------------------- /#template/images/background-thumb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/background-thumb.gif -------------------------------------------------------------------------------- /#template/imagess/background-body.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/background-body.gif -------------------------------------------------------------------------------- /#template/imagess/background-error.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/background-error.jpg -------------------------------------------------------------------------------- /#template/imagess/background-tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/background-tags.png -------------------------------------------------------------------------------- /#template/imagess/background-thumb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/background-thumb.gif -------------------------------------------------------------------------------- /#template/imagess/background-tips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/background-tips.png -------------------------------------------------------------------------------- /#template/imagess/dans-le-dur-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/dans-le-dur-logo.png -------------------------------------------------------------------------------- /#template/imagess/icon-no-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/icon-no-results.png -------------------------------------------------------------------------------- /app/assets/images/background-body.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/background-body.gif -------------------------------------------------------------------------------- /app/assets/images/background-error.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/background-error.jpg -------------------------------------------------------------------------------- /app/assets/images/background-tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/background-tags.png -------------------------------------------------------------------------------- /app/assets/images/background-thumb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/background-thumb.gif -------------------------------------------------------------------------------- /app/assets/images/background-tips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/background-tips.png -------------------------------------------------------------------------------- /app/assets/images/dans-le-dur-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/dans-le-dur-logo.png -------------------------------------------------------------------------------- /app/assets/images/icon-no-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/icon-no-results.png -------------------------------------------------------------------------------- /app/views/media/edit.html.haml: -------------------------------------------------------------------------------- 1 | = form_for @medium, url: medium_path(@medium) do |f| 2 | = render partial: 'form', locals: {f: f} -------------------------------------------------------------------------------- /#template/images/fake/thumb-206x132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/fake/thumb-206x132.png -------------------------------------------------------------------------------- /#template/imagess/background-overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/background-overlay.png -------------------------------------------------------------------------------- /#template/imagess/fake/thumb-100x64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/fake/thumb-100x64.gif -------------------------------------------------------------------------------- /#template/imagess/fake/thumb-206x132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/fake/thumb-206x132.png -------------------------------------------------------------------------------- /#template/imagess/fake/thumb-original.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/fake/thumb-original.gif -------------------------------------------------------------------------------- /app/assets/images/background-overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/background-overlay.png -------------------------------------------------------------------------------- /public/images/pagination-next-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/pagination-next-hover.png -------------------------------------------------------------------------------- /public/images/pagination-prev-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/public/images/pagination-prev-hover.png -------------------------------------------------------------------------------- /#template/images/background-footer-stats.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/images/background-footer-stats.gif -------------------------------------------------------------------------------- /#template/imagess/background-footer-stats.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/background-footer-stats.gif -------------------------------------------------------------------------------- /app/assets/images/background-footer-stats.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/background-footer-stats.gif -------------------------------------------------------------------------------- /config/unicorn.rb: -------------------------------------------------------------------------------- 1 | worker_processes 4 # amount of unicorn workers to spin up 2 | timeout 30 # restarts workers that hang for 30 seconds -------------------------------------------------------------------------------- /#template/imagess/background-pagination-more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/background-pagination-more.png -------------------------------------------------------------------------------- /#template/imagess/background-thumb-original.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/#template/imagess/background-thumb-original.gif -------------------------------------------------------------------------------- /app/assets/images/background-pagination-more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/background-pagination-more.png -------------------------------------------------------------------------------- /app/assets/images/background-thumb-original.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/images/background-thumb-original.gif -------------------------------------------------------------------------------- /app/assets/javascripts/zeroclipboard/ZeroClipboard.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/javascripts/zeroclipboard/ZeroClipboard.fla -------------------------------------------------------------------------------- /app/assets/javascripts/zeroclipboard/ZeroClipboard.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/javascripts/zeroclipboard/ZeroClipboard.swf -------------------------------------------------------------------------------- /app/assets/javascripts/zeroclipboard/ZeroClipboard10.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/javascripts/zeroclipboard/ZeroClipboard10.fla -------------------------------------------------------------------------------- /app/assets/javascripts/zeroclipboard/ZeroClipboard10.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zog/dansledur/master/app/assets/javascripts/zeroclipboard/ZeroClipboard10.swf -------------------------------------------------------------------------------- /test/unit/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/media_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MediaTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/views/media/new.html.haml: -------------------------------------------------------------------------------- 1 | #new_medium 2 | %h1 Poster un Dans le Dur ! 3 | 4 | = form_for @medium, url: [:media] do |f| 5 | = render partial: 'form', locals: {f: f} -------------------------------------------------------------------------------- /test/unit/setting_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SettingTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/controllers/static_controller.rb: -------------------------------------------------------------------------------- 1 | class StaticController < ApplicationController 2 | layout 'application' 3 | 4 | def about 5 | end 6 | 7 | def legals 8 | end 9 | 10 | end 11 | -------------------------------------------------------------------------------- /script/delayed_job: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) 4 | require 'delayed/command' 5 | Delayed::Command.new(ARGV).daemonize 6 | -------------------------------------------------------------------------------- /db/migrate/20111230103748_add_counts_to_media.rb: -------------------------------------------------------------------------------- 1 | class AddCountsToMedia < ActiveRecord::Migration 2 | def change 3 | change_table(:media) do |t| 4 | t.integer :views_count 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20110927205847_create_media.rb: -------------------------------------------------------------------------------- 1 | class CreateMedia < ActiveRecord::Migration 2 | def change 3 | create_table :media do |t| 4 | t.string :name 5 | t.timestamps 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20110929191503_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :username 5 | t.timestamps 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/tasks/cron.rake: -------------------------------------------------------------------------------- 1 | desc "This task is called by the Heroku cron add-on" 2 | task :cron => :environment do 3 | # if Time.now.seconds % 10 == 0 4 | # Medium.fetch.from_twitter 5 | # end 6 | Medium.fetch_unfetched 7 | end -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | 3 | # Set up gems listed in the Gemfile. 4 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 5 | 6 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 7 | -------------------------------------------------------------------------------- /db/migrate/20110929171710_create_settings.rb: -------------------------------------------------------------------------------- 1 | class CreateSettings < ActiveRecord::Migration 2 | def change 3 | create_table :settings do |t| 4 | t.string :key, :value 5 | t.timestamps 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /doc/README_FOR_APP: -------------------------------------------------------------------------------- 1 | Use this README file to introduce your application and point to useful places in the API for learning more. 2 | Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-Agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | 5 | use Rack::GoogleAnalytics, :tracker => 'UA-29670145-1' 6 | use Rack::Deflater 7 | 8 | run Dansledur::Application 9 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the rails application 2 | require File.expand_path('../application', __FILE__) 3 | BITLY_USERNAME = 'zogzog' 4 | BITLY_API_KEY = 'R_3ab70b6f10397b3e1b1507ab9f3fc2ac' 5 | 6 | # Initialize the rails application 7 | Dansledur::Application.initialize! 8 | -------------------------------------------------------------------------------- /db/migrate/20120517144759_add_url_to_media.rb: -------------------------------------------------------------------------------- 1 | class AddUrlToMedia < ActiveRecord::Migration 2 | def change 3 | add_column :media, :url, :string 4 | add_column :media, :fetched_at, :datetime 5 | Medium.all.each do |m| m.update_attribute :fetched_at, Time.now end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/views/static/about.html.haml: -------------------------------------------------------------------------------- 1 | #main 2 | %h1 A propos 3 | = image_tag "dans-le-dur-logo.png" 4 | %p.about Dans le Dur est une collection d’images de toute beauté selectionnées par une communauté triée sur le volet pour le plus grand bonheur de tous ! 5 | 6 | = render partial: 'static/misc' -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | # Add your own tasks in files placed in lib/tasks ending in .rake, 3 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 4 | 5 | require File.expand_path('../config/application', __FILE__) 6 | 7 | Dansledur::Application.load_tasks 8 | -------------------------------------------------------------------------------- /app/models/setting.rb: -------------------------------------------------------------------------------- 1 | class Setting < ActiveRecord::Base 2 | def self.[] key 3 | self.find_by_key(key).try :value 4 | end 5 | 6 | def self.[]= key, value 7 | self.find_or_create_by_key(key).update_attribute :value, value.to_s 8 | rescue => e 9 | p e 10 | raise 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/assets/stylesheets/_mixins.sass: -------------------------------------------------------------------------------- 1 | @mixin border-radius($radius) 2 | -moz-border-radius: $radius 3 | -webkit-border-radius: $radius 4 | border-radius: $radius 5 | 6 | @mixin box-shadow($shadow: 0 2px 5px rgba(0,0,0,0.5)) 7 | -moz-box-shadow: $shadow 8 | -webkit-box-shadow: $shadow 9 | box-shadow: $shadow 10 | -------------------------------------------------------------------------------- /script/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. 3 | 4 | APP_PATH = File.expand_path('../../config/application', __FILE__) 5 | require File.expand_path('../../config/boot', __FILE__) 6 | require 'rails/commands' 7 | -------------------------------------------------------------------------------- /app/views/media/_compact.html.haml: -------------------------------------------------------------------------------- 1 | %li 2 | %a{:href => medium_path(m)} 3 | %strong= m.name 4 | %p= m.tags.join(", ") 5 | - small = m.created_at.strftime('%d %B, %Y') 6 | - small << ' - ' 7 | - small << "#{m.views_count} vues" 8 | %small= small 9 | = image_tag m.filtered_thumb_url, :alt => m.name 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dans le dur 2 | 3 | Source code of the infamous http://dans-le-dur.com 4 | 5 | I use this site to bookmark my (mostly NSFW) favorite images. The coolest feature is that I'm able to publsh on it by tweeting to the corresponding twitter account :-) 6 | 7 | Oh, and you can use it to send custom messages too -> http://bit.ly/2jwMao7 8 | -------------------------------------------------------------------------------- /db/migrate/20110927205949_add_image_to_media.rb: -------------------------------------------------------------------------------- 1 | class AddImageToMedia < ActiveRecord::Migration 2 | 3 | def change 4 | add_column :media, :image_file_name, :string 5 | add_column :media, :image_content_type, :string 6 | add_column :media, :image_file_size, :integer 7 | add_column :media, :image_updated_at, :datetime 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/media/_form.html.haml: -------------------------------------------------------------------------------- 1 | = field_set_tag do 2 | = f.label :name 3 | = f.text_field :name, required: true 4 | 5 | - if f.object.image? 6 | = f.label "Picture" 7 | = image_tag(f.object.image.url(:medium)) 8 | - else 9 | = f.label :url 10 | = f.url_field :url, required: true 11 | 12 | = f.label :tags 13 | = f.text_field :tag_list 14 | 15 | = f.submit -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll automatically include all the stylesheets available in this directory 3 | * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. 5 | *= require_self 6 | *= require_tree . 7 | */ -------------------------------------------------------------------------------- /config/initializers/fix_deadlock.rb: -------------------------------------------------------------------------------- 1 | require "thread" 2 | class Mutex 3 | def lock_with_hack 4 | lock_without_hack 5 | rescue ThreadError => e 6 | if e.message != "deadlock; recursive locking" 7 | raise 8 | else 9 | unlock 10 | lock_without_hack 11 | end 12 | end 13 | alias_method :lock_without_hack, :lock 14 | alias_method :lock, :lock_with_hack 15 | end -------------------------------------------------------------------------------- /app/assets/javascripts/fb.js: -------------------------------------------------------------------------------- 1 | function fbs_click() { 2 | u=location.href; t=document.title; 3 | window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),' sharer', 'toolbar=0, status=0, width=626, height=436'); return false; 4 | } 5 | 6 | $(document).ready(function(){ 7 | $(".facebook").each(function(){ 8 | $(this).click(fbs_click); 9 | }) 10 | }) -------------------------------------------------------------------------------- /test/fixtures/media.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/settings.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | User.create email: "johan@about-blank.fr", password: "boulou" -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format 4 | # (all these examples are active by default): 5 | # ActiveSupport::Inflector.inflections do |inflect| 6 | # inflect.plural /^(ox)$/i, '\1en' 7 | # inflect.singular /^(ox)en/i, '\1' 8 | # inflect.irregular 'person', 'people' 9 | # inflect.uncountable %w( fish sheep ) 10 | # end 11 | -------------------------------------------------------------------------------- /test/performance/browsing_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | require 'rails/performance_test_help' 3 | 4 | class BrowsingTest < ActionDispatch::PerformanceTest 5 | # Refer to the documentation for all available options 6 | # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory] 7 | # :output => 'tmp/performance', :formats => [:flat] } 8 | 9 | def test_homepage 10 | get '/' 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Dansledur::Application.config.session_store :cookie_store, key: '_dansledur_session' 4 | 5 | # Use the database for sessions instead of the cookie-based default, 6 | # which shouldn't be used to store highly confidential information 7 | # (create the session table with "rails generate session_migration") 8 | # Dansledur::Application.config.session_store :active_record_store 9 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | en: 5 | hello: "Hello world" 6 | messages: 7 | are_you_sure: Are you sure ? 8 | helper: 9 | submit: 10 | session: 11 | create: Sign in 12 | activerecord: 13 | attributes: 14 | session: 15 | password: Password -------------------------------------------------------------------------------- /config/locales/fr.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | fr: 5 | hello: "Hello world" 6 | messages: 7 | are_you_sure: Are you sure ? 8 | helper: 9 | submit: 10 | session: 11 | create: Sign in 12 | activerecord: 13 | attributes: 14 | session: 15 | password: Password -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ActiveRecord::Base 2 | # Include default devise modules. Others available are: 3 | # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable 4 | devise :database_authenticatable, :registerable, 5 | :recoverable, :rememberable, :trackable, :validatable 6 | 7 | # Setup accessible (or protected) attributes for your model 8 | attr_accessible :email, :password, :password_confirmation, :remember_me 9 | end 10 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] = "test" 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. 7 | # 8 | # Note: You'll currently still have to declare fixtures explicitly in integration tests 9 | # -- they do not yet inherit this setting 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | # Make sure the secret is at least 30 characters and all random, 6 | # no regular words or you'll be exposed to dictionary attacks. 7 | Dansledur::Application.config.secret_token = '8abf31f5b559da370870972180120012249748f3414e7bc4191f4d8a3e4dbee9cc488d209edf9873dae65553cac79935333643d30c39ddb98d115ffca78e22d2' 8 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | # 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # Disable root element in JSON by default. 12 | ActiveSupport.on_load(:active_record) do 13 | self.include_root_in_json = false 14 | end 15 | -------------------------------------------------------------------------------- /app/views/media/hall_of_fame.html.haml: -------------------------------------------------------------------------------- 1 | #main 2 | %h1 Dans le Dur les plus populaires 3 | %ul.items 4 | - @medias.each do |m| 5 | = render partial: 'media/compact', locals: {m: m} 6 | 7 | #pagination 8 | - if @medias.current_page.to_i > 1 9 | = link_to "« Plus récents", hall_of_fame_media_path(params.merge(page: @medias.current_page.to_i - 1)) 10 | - if @medias.current_page.to_i < @medias.total_pages 11 | = link_to "Plus anciens »", hall_of_fame_media_path(params.merge(page: @medias.current_page.to_i + 1)) 12 | 13 | = render partial: 'media/misc' -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery 3 | 4 | if Rails.env.production? 5 | rescue_from Exception, :with => :not_found 6 | rescue_from ActionController::RoutingError, :with => :not_found 7 | end 8 | 9 | layout 'application' 10 | 11 | def not_found 12 | render 'shared/not_found', layout: nil, status: 404 13 | end 14 | 15 | def denied 16 | # if(params[:anything] && params[:anything] =~ /\.ico$/) 17 | # render nothing: true 18 | # return 19 | # end 20 | render 'shared/denied', layout: nil, status: 401 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: sqlite3 8 | database: db/development.sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: db/test.sqlite3 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: sqlite3 23 | database: db/production.sqlite3 24 | pool: 5 25 | timeout: 5000 26 | -------------------------------------------------------------------------------- /app/views/media/_misc.html.haml: -------------------------------------------------------------------------------- 1 | #misc 2 | %h2 Tags populaires ! 3 | %ul.tags 4 | - tag_cloud(Medium.tag_counts_on(:tags).limit(20), %w(css1 css2 css3 css4)) do |tag, css_class| 5 | %li= link_to tag.name, media_path(search: tag.name) 6 | 7 | %h2 Hall of Fame ! 8 | = link_to image_tag("ads-hof.png", :alt => "Hall of Fame"), [:hall_of_fame, :media] 9 | 10 | 11 | / %h2 Je veux une Newsletter ! 12 | / .newsletter 13 | / %p Enregistrez-vous si vous souhaitez recevoir les derniers DLDs ! 14 | / %form{:action => ""} 15 | / %fieldset 16 | / %legend Inscription 17 | / %label Email 18 | / %input{:type => "text", :placeholder => "Adresse Email"} 19 | / %input{:type => "submit", :value => "OK"} -------------------------------------------------------------------------------- /db/migrate/20110927212124_acts_as_taggable_on_migration.rb: -------------------------------------------------------------------------------- 1 | class ActsAsTaggableOnMigration < ActiveRecord::Migration 2 | def self.up 3 | create_table :tags do |t| 4 | t.string :name 5 | end 6 | 7 | create_table :taggings do |t| 8 | t.references :tag 9 | 10 | # You should make sure that the column created is 11 | # long enough to store the required class names. 12 | t.references :taggable, :polymorphic => true 13 | t.references :tagger, :polymorphic => true 14 | 15 | t.string :context 16 | 17 | t.datetime :created_at 18 | end 19 | 20 | add_index :taggings, :tag_id 21 | add_index :taggings, [:taggable_id, :taggable_type, :context] 22 | end 23 | 24 | def self.down 25 | drop_table :taggings 26 | drop_table :tags 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /app/views/static/_misc.haml: -------------------------------------------------------------------------------- 1 | #misc 2 | %h2 Fabriqué avec amour par ! 3 | %ul.team 4 | %li 5 | %a{:href => "https://twitter.com/#!/zog_zog"} 6 | = image_tag "team/zog.gif", :alt => "Zog" 7 | %li 8 | %a{:href => "https://twitter.com/#!/lucchaissac"} 9 | = image_tag "team/luc.gif", :alt => "Luc Chaissac" 10 | %li 11 | %a{:href => "http://www.google.fr/webhp?sourceid=chrome-instant&ix=e2&ie=UTF-8&ion=1&nord=1#hl=en&nord=1&q=jean+michel+sancowl&gs_sm=&gs_upl=&ion=1&um=1&ie=UTF-8&tbo=u&tbm=vid&source=og&sa=N&tab=wv&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=d89b037a635c458d&ion=1&biw=1267&bih=702"} 12 | = image_tag "team/jean.gif", :alt => "Jean-Michel Sancowl" 13 | 14 | %h2 Envie de poster des Dans le Dur ?! 15 | %p 16 | Faites simplement une demande : 17 | %a{:href => "mailto:invitation@dansledur.com"} Invitez-moi ! -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into including all the files listed below. 2 | // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically 3 | // be included in the compiled file accessible from http://example.com/assets/application.js 4 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 5 | // the compiled file. 6 | // 7 | //= require jquery 8 | //= require jquery_ujs 9 | //= require fb 10 | //= require_tree . 11 | 12 | $(document).ready(function(){ 13 | if($('#next_page')[0]){ 14 | shortcut.add("N",function() { 15 | document.location = $('#next_page')[0].href 16 | }); 17 | } 18 | if($('#prev_page')[0]){ 19 | shortcut.add("P",function() { 20 | document.location = $('#prev_page')[0].href 21 | }); 22 | } 23 | }) 24 | 25 | -------------------------------------------------------------------------------- /#template/view/show-layout.html.haml: -------------------------------------------------------------------------------- 1 | #main 2 | .thumb-display 3 | %div= image_tag "fake/thumb-original.gif", :atl => "Image Title" 4 | 5 | #misc 6 | .image-infos 7 | %h1 Titre 8 | %small October 12, 2011 9 | .social 10 | = link_to "Partager !", "#", :class => "twitter" 11 | = link_to "Partager !", "#", :class => "facebook" 12 | 13 | %ul.tags 14 | %li= link_to "OMG", "#" 15 | %li= link_to "Sexy chick", "#" 16 | %li= link_to "Nom Nom Nom", "#" 17 | %li= link_to "Gif", "#" 18 | 19 | %h2 Mais encore ! 20 | .more-pagination 21 | .prev 22 | %a{:href => "#"} 23 | %span 24 | = image_tag"fake/thumb-100x64.gif", :alt => "Title image" 25 | .next 26 | %a{:href => "#"} 27 | %span 28 | = image_tag"fake/thumb-100x64.gif", :alt => "Title image" 29 | 30 | = link_to "On se la joue shuffle ?!", "#", :class => "shuffle" -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The change you wanted was rejected (422) 6 | 19 | 20 | 21 | 22 | 23 |
24 |

The change you wanted was rejected.

25 |

Maybe you tried to change something you didn't have access to.

26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /app/views/devise/sessions/new.html.haml: -------------------------------------------------------------------------------- 1 | #sign_in 2 | 3 | %h1 Se connecter à Dans le Dur ! 4 | 5 | = form_for resource, :as => resource_name, :url => session_path(resource_name) do |f| 6 | = field_set_tag do 7 | = f.label :email, t(:email, :scope => [:activerecord, :attributes, :session]) 8 | = f.text_field :email, :tabindex => 1 9 | 10 | - h = "#{t(:password, :scope => [:activerecord, :attributes, :session])} (#{link_to(t(:forgot_your_password?, :scope => [:devise, :common]), new_password_path(resource_name))})" 11 | = f.label :password, raw(h) 12 | = f.password_field :password, :tabindex => 2 13 | 14 | .remember-me 15 | = f.check_box :remember_me, :class => 'checkbox' 16 | = f.label :remember_me, t(:remember_me, :scope => [:activerecord, :attributes, :session]) 17 | 18 | = f.submit t(:create, :scope => [:helper, :submit, :session]) 19 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The page you were looking for doesn't exist (404) 6 | 18 | 19 | 20 | 21 | 22 |
23 |

The page you were looking for doesn't exist.

24 |

You may have mistyped the address or the page may have moved.

25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | We're sorry, but something went wrong (500) 6 | 18 | 19 | 20 | 21 | 22 |
23 |

We're sorry, but something went wrong.

24 |

We've been notified about this issue and we'll take a look at it shortly.

25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /#template/view/about-layout.html.haml: -------------------------------------------------------------------------------- 1 | #main 2 | %h1 A propos 3 | = image_tag "dans-le-dur-logo.png" 4 | %p.about Dans le Dur est une collection d’images de toute beauté selectionnées par une communauté triée sur le volet pour le plus grand bonheur de tous ! 5 | 6 | #misc 7 | %h2 Fabriqué avec amour par ! 8 | %ul.team 9 | %li 10 | %a{:href => "https://twitter.com/#!/zog_zog"} 11 | = image_tag "team/zog.gif", :alt => "Zog" 12 | %li 13 | %a{:href => "https://twitter.com/#!/lucchaissac"} 14 | = image_tag "team/luc.gif", :alt => "Luc Chaissac" 15 | %li 16 | %a{:href => "http://www.google.fr/webhp?sourceid=chrome-instant&ix=e2&ie=UTF-8&ion=1&nord=1#hl=en&nord=1&q=jean+michel+sancowl&gs_sm=&gs_upl=&ion=1&um=1&ie=UTF-8&tbo=u&tbm=vid&source=og&sa=N&tab=wv&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=d89b037a635c458d&ion=1&biw=1267&bih=702"} 17 | = image_tag "team/jean.gif", :alt => "Jean-Michel Sancowl" 18 | 19 | %h2 Envie de poster des Dans le Dur ?! 20 | %p 21 | Faites simplement une demande : 22 | %a{:href => "mailto:invitation@dansledur.com"} Invitez-moi ! -------------------------------------------------------------------------------- /app/views/media/index.html.haml: -------------------------------------------------------------------------------- 1 | #main 2 | - if @search 3 | %h1 4 | = @medias.count 5 | %span résultat(s) pour : 6 | = @search 7 | - else 8 | %h1 Dans le Dur récents 9 | 10 | - if @medias.count.zero? 11 | #no-result 12 | = image_tag "icon-no-results.png" 13 | %p 14 | Suggestions : 15 | = @suggestions.map{|s| link_to(s, media_path(search: s))}.join(', ').html_safe 16 | %ul 17 | %li Vérifiez l’orthographe des termes de recherche. 18 | %li Essayez d'autres mots. 19 | %li Utilisez des mots clés plus généraux. 20 | %li Soyez bon. 21 | - else 22 | 23 | %ul.items 24 | - @medias.each do |m| 25 | = render partial: 'media/compact', locals: {m: m} 26 | 27 | #pagination 28 | - if @medias.current_page.to_i > 1 29 | = link_to "« Plus récents", media_path(params.merge(page: @medias.current_page.to_i - 1)), id: 'prev_page' 30 | - if @medias.current_page.to_i < @medias.total_pages 31 | = link_to "Plus anciens »", media_path(params.merge(page: @medias.current_page.to_i + 1)), id: 'next_page' 32 | 33 | = render partial: 'media/misc' -------------------------------------------------------------------------------- /#template/view/error-layout.html.haml: -------------------------------------------------------------------------------- 1 | !!! 5 2 | %html 3 | %head 4 | %meta{ :'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8' } 5 | %meta{ :property => 'og:image', :content => 'http://bordeauxhype.com/images/preview.png' } 6 | %meta{ :name => "viewport", :content => "user-scalable=no;width=device-width" } 7 | 8 | %title Dans le Dur 9 | %link{ :rel => "icon", :type => "image/png", :href => "/images/favicon.png" } 10 | %link{ :rel => "apple-touch-icon-precomposed", :href => "/images/ios-icon.png" } 11 | = all_stylesheet_link_tag 12 | = all_javascript_include_tag 13 | = csrf_meta_tag 14 | = render 'shared/ga' 15 | 16 | %body 17 | #error-inner 18 | = image_tag "logo-error.png", :alt => "error" 19 | %h1 Désolé, la page que vous cherchez n'existe pas. 20 | %p 21 | Retour à 22 | = link_to "dansledur.com", "#" 23 | ou 24 | = link_to "contactez-nous", "#" 25 | au sujet d'un problème. 26 | = image_tag "icon-logo-mini.png", :alt => "error" 27 | #overlay-error 28 | #error-img 29 | = image_tag "background-error.jpg", :alt => "Dans le Dur !!" -------------------------------------------------------------------------------- /#template/view/result-layout.html.haml: -------------------------------------------------------------------------------- 1 | #main 2 | %h1 3 | 0 4 | %span résultat pour : 5 | Une rechercher tutututu 6 | #no-result 7 | = image_tag "icon-no-results.png" 8 | %p Suggestions : 9 | %ul 10 | %li Vérifiez l’orthographe des termes de recherche. 11 | %li Essayez d'autres mots. 12 | %li Utilisez des mots clés plus généraux. 13 | %li Soyez bon. 14 | 15 | #misc 16 | %h2 Tags populaires ! 17 | %ul.tags 18 | %li= link_to "Foudefafa", "#" 19 | %li= link_to "Ff grgoudefafa", "#" 20 | %li= link_to "Fefafa", "#" 21 | %li= link_to "Foudefafa", "#" 22 | %li= link_to "Gafa gr", "#" 23 | %li= link_to "Fef ergafa", "#" 24 | %li= link_to "Foafa", "#" 25 | %li= link_to "Gaergergfa", "#" 26 | 27 | %h2 Hall of Fame ! 28 | = image_tag "ads-hof.png", :alt => "Hall of Fame" 29 | 30 | %h2 Je veux une Newsletter ! 31 | .newsletter 32 | %p Enregistrez-vous si vous souhaitez recevoir les derniers DLDs ! 33 | %form{:action => ""} 34 | %fieldset 35 | %legend Inscription 36 | %label Email 37 | %input{:type => "text", :placeholder => "Adresse Email"} 38 | %input{:type => "submit", :value => "OK"} 39 | -------------------------------------------------------------------------------- /app/views/shared/not_found.html.haml: -------------------------------------------------------------------------------- 1 | !!! 5 2 | %html 3 | %head 4 | %meta{ :'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8' } 5 | %meta{ :property => 'og:image', :content => 'http://bordeauxhype.com/images/preview.png' } 6 | %meta{ :name => "viewport", :content => "user-scalable=no;width=device-width" } 7 | 8 | %title Dans le Dur 9 | %link{ :rel => "icon", :type => "image/png", :href => "/images/favicon.png" } 10 | %link{ :rel => "apple-touch-icon-precomposed", :href => "/images/ios-icon.png" } 11 | = stylesheet_link_tag :application 12 | = javascript_include_tag :application 13 | = csrf_meta_tag 14 | =# render 'shared/ga' 15 | 16 | %body 17 | #error-inner 18 | = image_tag "logo-error.png", :alt => "error" 19 | %h1 Désolé, la page que vous cherchez n'existe pas. 20 | %p 21 | Retour à 22 | = link_to "dansledur.com", "/" 23 | ou 24 | = link_to "contactez-nous", "mailto:contact@dansledur.com" 25 | au sujet d'un problème. 26 | = image_tag "icon-logo-mini.png", :alt => "error" 27 | #overlay-error 28 | #error-img 29 | = image_tag "background-error.jpg", :alt => "Dans le Dur !!" -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Dansledur::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Log error messages when you accidentally call methods on nil. 10 | config.whiny_nils = true 11 | 12 | # Show full error reports and disable caching 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger 20 | config.active_support.deprecation = :log 21 | 22 | # Only use best-standards-support built into browsers 23 | config.action_dispatch.best_standards_support = :builtin 24 | 25 | # Do not compress assets 26 | config.assets.compress = false 27 | 28 | # Expands the lines which load the assets 29 | config.assets.debug = true 30 | end 31 | -------------------------------------------------------------------------------- /app/views/shared/denied.html.haml: -------------------------------------------------------------------------------- 1 | !!! 5 2 | %html 3 | %head 4 | %meta{ :'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8' } 5 | %meta{ :property => 'og:image', :content => 'http://bordeauxhype.com/images/preview.png' } 6 | %meta{ :name => "viewport", :content => "user-scalable=no;width=device-width" } 7 | 8 | %title Dans le Dur 9 | %link{ :rel => "icon", :type => "image/png", :href => "/images/favicon.png" } 10 | %link{ :rel => "apple-touch-icon-precomposed", :href => "/images/ios-icon.png" } 11 | = stylesheet_link_tag :application 12 | = javascript_include_tag :application 13 | = csrf_meta_tag 14 | =# render 'shared/ga' 15 | 16 | %body 17 | #error-inner 18 | = image_tag "logo-error.png", :alt => "error" 19 | %h1 Accès interdit 20 | %h2 Ben dis-donc, tu te crois chez mémé ?! 21 | %p 22 | Retour à 23 | = link_to "dansledur.com", "/" 24 | ou 25 | = link_to "contactez-nous", "mailto:contact@dansledur.com" 26 | au sujet d'un problème. 27 | = image_tag "icon-logo-mini.png", :alt => "error" 28 | #overlay-error 29 | #error-img 30 | = image_tag "background-error.jpg", :alt => "Dans le Dur !!" -------------------------------------------------------------------------------- /db/migrate/20110929191516_add_devise_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddDeviseToUsers < ActiveRecord::Migration 2 | def self.up 3 | change_table(:users) do |t| 4 | t.database_authenticatable :null => false 5 | t.recoverable 6 | t.rememberable 7 | t.trackable 8 | 9 | # t.encryptable 10 | # t.confirmable 11 | # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both 12 | # t.token_authenticatable 13 | 14 | 15 | # Uncomment below if timestamps were not included in your original model. 16 | # t.timestamps 17 | end 18 | 19 | add_index :users, :email, :unique => true 20 | add_index :users, :reset_password_token, :unique => true 21 | # add_index :users, :confirmation_token, :unique => true 22 | # add_index :users, :unlock_token, :unique => true 23 | # add_index :users, :authentication_token, :unique => true 24 | end 25 | 26 | def self.down 27 | # By default, we don't want to make any assumption about how to roll back a migration when your 28 | # model already existed. Please edit below which fields you would like to remove in this migration. 29 | raise ActiveRecord::IrreversibleMigration 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /db/migrate/20120311124156_create_delayed_jobs.rb: -------------------------------------------------------------------------------- 1 | class CreateDelayedJobs < ActiveRecord::Migration 2 | def self.up 3 | create_table :delayed_jobs, :force => true do |table| 4 | table.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue 5 | table.integer :attempts, :default => 0 # Provides for retries, but still fail eventually. 6 | table.text :handler # YAML-encoded string of the object that will do work 7 | table.text :last_error # reason for last failure (See Note below) 8 | table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. 9 | table.datetime :locked_at # Set when a client is working on this object 10 | table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) 11 | table.string :locked_by # Who is working on this object (if locked) 12 | table.string :queue # The name of the queue this job is in 13 | table.timestamps 14 | end 15 | 16 | add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority' 17 | end 18 | 19 | def self.down 20 | drop_table :delayed_jobs 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'http://rubygems.org' 2 | 3 | gem 'rails', '3.2.0' 4 | gem 'unicorn' 5 | 6 | # Bundle edge Rails instead: 7 | # gem 'rails', :git => 'git://github.com/rails/rails.git' 8 | 9 | gem 'pg' 10 | gem 'aws-s3', '0.6.2' 11 | #gem 'aws-sdk' 12 | #gem 'omniauth', :git => 'git://github.com/intridea/omniauth.git' 13 | gem 'twitter', '2.0.2' 14 | gem 'devise' 15 | gem 'text' 16 | gem 'will_paginate', '~> 3.0' 17 | #gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3' 18 | gem 'bitly' 19 | gem 'rack-google-analytics', :require => 'rack/google-analytics' 20 | gem 'delayed_job_active_record' 21 | 22 | # Gems used only for assets and not required 23 | # in production environments by default. 24 | group :assets do 25 | gem 'sass-rails', " ~> 3.2.0" 26 | gem 'coffee-rails', "~> 3.2.0" 27 | gem 'uglifier' 28 | end 29 | 30 | group :production do 31 | gem 'dalli' 32 | end 33 | 34 | gem 'rack-cache' 35 | 36 | gem 'haml' 37 | gem "paperclip", "2.4.2" 38 | gem 'rmagick', :require => 'RMagick' 39 | gem 'acts-as-taggable-on', '~>2.1.0' 40 | 41 | gem 'jquery-rails' 42 | 43 | # Use unicorn as the web server 44 | # gem 'unicorn' 45 | 46 | # Deploy with Capistrano 47 | # gem 'capistrano' 48 | 49 | # To use debugger 50 | # gem 'ruby-debug19', :require => 'ruby-debug' 51 | 52 | group :development do 53 | gem 'sqlite3' 54 | end 55 | 56 | group :test do 57 | # Pretty printed test output 58 | gem 'turn', :require => false 59 | end 60 | -------------------------------------------------------------------------------- /app/views/media/fullscreen.html.haml: -------------------------------------------------------------------------------- 1 | %head 2 | = stylesheet_link_tag :application 3 | %title Dans le Dur 4 | %meta{property: "og:image", content: @medium.image.url} 5 | %link{ :rel => "icon", :type => "image/png", :href => "/images/favicon.png" } 6 | = javascript_include_tag :application 7 | :javascript 8 | var clip 9 | $(document).ready(function(){ 10 | ZeroClipboard.setMoviePath( '/assets/zeroclipboard/ZeroClipboard10.swf' ); 11 | var clip = new ZeroClipboard.Client() 12 | $(".paste").each(function(){ 13 | //$(this).click(copyclip) 14 | clip.setText(this.href) 15 | clip.glue(this) 16 | }) 17 | clip.addEventListener( 'onComplete', function(){alert("URL copiée dans le presse-papier !")} ); 18 | }) 19 | 20 | %body#fullscreen{style: "background-image: url(#{@medium.image.url})"} 21 | %table{height: "100%", width: "100%"} 22 | %tr 23 | %td.message= params[:message] 24 | #toolbar 25 | .icon 26 | %p 27 | =link_to "home", "/" 28 | %form{action: medium_path(@medium)} 29 | %label Ton message : 30 | %input{type: :hidden, name: :fullscreen, value: 1} 31 | %input{type: :text, name: :message, value: params[:message]} 32 | %input{type: :submit, value: "GO"} 33 | .short-url 34 | %p 35 | URL raccourcie: 36 | %br 37 | = link_to @short_url, @short_url 38 | %p= link_to @short_url, @short_url, class: "paste", alt: "copier l'url" -------------------------------------------------------------------------------- /#template/view/form-and-flash.html.haml: -------------------------------------------------------------------------------- 1 | %p.flash= "Mauvaise combinaison de nom d'utilisateur/e-mail et mot de passe." 2 | 3 | #sign_in 4 | 5 | %h1 Se connecter à Dans le Dur ! 6 | 7 | %form{:action => ""} 8 | %fieldset 9 | %legend Connexion 10 | %label Email 11 | %input{:type => "mail"} 12 | %label Mot de passe 13 | %input{:type => "password"} 14 | .remember-me 15 | %input{:type => "checkbox", :id => "remember-me"} 16 | %label{:for => "remember-me"} Se souvenir de moi 17 | %input{:type => "submit", :value => "Se connecter"} 18 | 19 | %a{:href => "mailto:invitation@dansledur.com"} 20 | Envie de participer ? 21 | %strong Demandez une invitation ! 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | = form_for resource, :as => resource_name, :url => session_path(resource_name) do |f| 30 | = field_set_tag do 31 | = f.label :email, t(:email, :scope => [:activerecord, :attributes, :session]) 32 | = f.text_field :email, :tabindex => 1 33 | 34 | - h = t(:password, :scope => [:activerecord, :attributes, :session]) 35 | - h << " (" 36 | - h << link_to(t(:forgot_your_password?, :scope => [:devise, :common]), new_password_path(resource_name)) 37 | - h << ")" 38 | = f.label :password, raw(h) 39 | = f.password_field :password, :tabindex => 2 40 | 41 | .remember-me 42 | = f.check_box :remember_me, :class => 'checkbox' 43 | = f.label :remember_me, t(:remember_me, :scope => [:activerecord, :attributes, :session]) 44 | 45 | = f.submit t(:create, :scope => [:helper, :submit, :session]) 46 | 47 | - if flash[:notice] || flash[:alert] 48 | .error= flash[:notice] || flash[:alert] -------------------------------------------------------------------------------- /app/views/media/show.html.haml: -------------------------------------------------------------------------------- 1 | #main 2 | .thumb-display 3 | %div= image_tag @medium.image.url, :alt => @medium.name 4 | 5 | #misc 6 | .image-infos 7 | %h1= @medium.name 8 | %small= @medium.created_at.strftime('%B %d, %Y') 9 | .social 10 | %script{type: "text/javascript", src: "//platform.twitter.com/widgets.js"} 11 | = link_to "Partager !", "https://twitter.com/intent/tweet?url=http://dansledur.com#{url_for(params)}&text=“#{@medium.name}” sur DansLeDur.com", :class => "twitter" 12 | / 13 | = link_to "Partager !", "#", :class => "facebook" 14 | 15 | %ul.tags 16 | - @medium.tags.each do |tag| 17 | %li= link_to tag.name, media_path(search: tag.name) 18 | 19 | 20 | %h2 Mais encore ! 21 | .more-pagination 22 | // XXX class names mismatch 23 | - _next = @medium.next 24 | .prev{class: _next.present? ? "" : "empty"} 25 | - if _next 26 | %a#prev_page{:href => medium_path(_next)} 27 | %span 28 | = image_tag _next.image.url(:icon), :alt => _next.name 29 | 30 | - _prev = @medium.previous 31 | .next{class: _prev.present? ? "" : "empty"} 32 | - if _prev 33 | %a#next_page{:href => medium_path(_prev)} 34 | %span 35 | = image_tag _prev.image.url(:icon), :alt => _prev.name 36 | 37 | = link_to "Fullscreen", medium_path(@medium, fullscreen: 1), :class => "shuffle fullscreen positive" 38 | = link_to "On se la joue shuffle ?!", medium_path(Medium.order('Random()').last), :class => "shuffle" 39 | - if current_user 40 | = link_to "Modifier", edit_medium_path(@medium), :class => "shuffle" 41 | = link_to "Supprimer", delete_medium_path(@medium), :class => "shuffle", :'data-confirm' => 'Are you sure?' 42 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Dansledur::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Configure static asset server for tests with Cache-Control for performance 11 | config.serve_static_assets = true 12 | config.static_cache_control = "public, max-age=3600" 13 | 14 | # Log error messages when you accidentally call methods on nil 15 | config.whiny_nils = true 16 | 17 | # Show full error reports and disable caching 18 | config.consider_all_requests_local = true 19 | config.action_controller.perform_caching = false 20 | 21 | # Raise exceptions instead of rendering exception templates 22 | config.action_dispatch.show_exceptions = false 23 | 24 | # Disable request forgery protection in test environment 25 | config.action_controller.allow_forgery_protection = false 26 | 27 | # Tell Action Mailer not to deliver emails to the real world. 28 | # The :test delivery method accumulates sent emails in the 29 | # ActionMailer::Base.deliveries array. 30 | config.action_mailer.delivery_method = :test 31 | 32 | # Use SQL instead of Active Record's schema dumper when creating the test database. 33 | # This is necessary if your schema can't be completely dumped by the schema dumper, 34 | # like if you have constraints or database-specific column types 35 | # config.active_record.schema_format = :sql 36 | 37 | # Print deprecation notices to the stderr 38 | config.active_support.deprecation = :stderr 39 | 40 | # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets 41 | config.assets.allow_debugging = true 42 | end 43 | -------------------------------------------------------------------------------- /app/controllers/media_controller.rb: -------------------------------------------------------------------------------- 1 | class MediaController < ApplicationController 2 | before_filter :fetch_medium, except: [:index, :new, :create, :fetch, :hall_of_fame] 3 | before_filter :authenticate!, only: [:update, :edit, :new, :create, :destroy] 4 | def index 5 | @medias = Medium.fetched 6 | @search = params[:search] 7 | @medias = @medias.tagged_with(@search.split(',')) unless @search.nil? 8 | @medias = @medias.order(:'created_at DESC' ).paginate(:page => params[:page], :per_page => 9) 9 | @suggestions = [] 10 | @suggestions = Medium.suggestions_for(@search) if @search && @medias.count.zero? 11 | end 12 | 13 | def hall_of_fame 14 | @medias = Medium.order(:'views_count DESC' ).paginate(:page => params[:page], :per_page => 9) 15 | end 16 | 17 | def show 18 | @medium.touch! 19 | if(params[:fullscreen]) 20 | bitly = Bitly.new(BITLY_USERNAME, BITLY_API_KEY) 21 | @short_url = bitly.shorten("http://dansledur.com" + medium_path(params)).shorten 22 | render template: 'media/fullscreen', layout: false 23 | end 24 | end 25 | 26 | def update 27 | @medium.update_attributes params[:medium] 28 | redirect_to medium_path(@medium) 29 | end 30 | 31 | def fetch 32 | c = Medium.fetch_from_twitter.to_i 33 | c += Medium.fetch_unfetched.to_i 34 | render text: c 35 | end 36 | 37 | def new 38 | @medium = Medium.new 39 | end 40 | 41 | def create 42 | @medium = Medium.create!(params[:medium]) 43 | redirect_to media_path 44 | rescue 45 | @medium = Medium.new 46 | render template: 'media/new' 47 | end 48 | 49 | def edit 50 | end 51 | 52 | def delete 53 | if @medium 54 | @medium.destroy 55 | redirect_to(media_path, notice: "Media destroyed, Feel my Power ! MWAHAHAHAHA") && return 56 | end 57 | redirect_to media_path 58 | end 59 | 60 | protected 61 | def authenticate! 62 | denied unless current_user 63 | end 64 | 65 | def fetch_medium 66 | @medium = Medium.fetched.find(params[:id]) rescue not_found 67 | end 68 | end 69 | -------------------------------------------------------------------------------- /#template/view/application.html.haml: -------------------------------------------------------------------------------- 1 | !!! 5 2 | %html 3 | %head 4 | %meta{ :'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8' } 5 | %meta{ :name => "viewport", :content => "user-scalable=no;width=device-width" } 6 | 7 | %title Dans le Dur 8 | %link{ :rel => "icon", :type => "image/png", :href => "/images/favicon.png" } 9 | %link{ :rel => "apple-touch-icon-precomposed", :href => "/images/ios-icon.png" } 10 | = stylesheet_link_tag 11 | = javascript_include_tag 12 | = csrf_meta_tag 13 | = render 'shared/ga' 14 | 15 | %body 16 | #header 17 | %header 18 | %a.logo{:href => "#"} 19 | = image_tag "logo.png", :alt => "Dans le Dur" 20 | %form{:action => ""} 21 | %fieldset 22 | %legend Rechercher une image 23 | %label Rechercher 24 | %input{:type => "text"} 25 | %input{:type => "submit", :value => "Rechercher"} 26 | #new-post 27 | %a.current{:href => "#"} 28 | Nouveau Post 29 | %span 30 | Poster un Dans le Dur 31 | %nav 32 | %ul 33 | %li 34 | = link_to "Accueil", "#", :class => "current" 35 | %li 36 | = link_to "Hall of Fame", "#" 37 | %li 38 | = link_to "A propos", "#" 39 | %a.session-link{:href => "#"} 40 | Déjà un compte ? 41 | %strong Connectez-vous ! 42 | 43 | #wrap 44 | #wrap-inner 45 | = yield 46 | 47 | #footer 48 | #footer-inner 49 | .stats 50 | %strong 250 ! 51 | %small Dans le Dur partagés 52 | %ul 53 | %li 54 | %a{:href => "#"} 55 | Demander une invitation ! 56 | %li 57 | %a{:href => "#"} 58 | A propos 59 | %li 60 | %a{:href => "#"} 61 | Légale 62 | %li 63 | %a{:href => "#"} 64 | @DansleDur 65 | %p Copyright © 2011 Dans le Dur. Toutes les captures © leurs propriétaires respectifs. Made in sunny Bordeaux. 66 | 67 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Dansledur::Application.routes.draw do 2 | devise_for :users 3 | 4 | # The priority is based upon order of creation: 5 | # first created -> highest priority. 6 | 7 | # Sample of regular route: 8 | # match 'products/:id' => 'catalog#view' 9 | # Keep in mind you can assign values other than :controller and :action 10 | 11 | # Sample of named route: 12 | # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase 13 | # This route can be invoked with purchase_url(:id => product.id) 14 | 15 | # Sample resource route (maps HTTP verbs to controller actions automatically): 16 | # resources :products 17 | 18 | # Sample resource route with options: 19 | # resources :products do 20 | # member do 21 | # get 'short' 22 | # post 'toggle' 23 | # end 24 | # 25 | # collection do 26 | # get 'sold' 27 | # end 28 | # end 29 | 30 | # Sample resource route with sub-resources: 31 | # resources :products do 32 | # resources :comments, :sales 33 | # resource :seller 34 | # end 35 | 36 | # Sample resource route with more complex sub-resources 37 | # resources :products do 38 | # resources :comments 39 | # resources :sales do 40 | # get 'recent', :on => :collection 41 | # end 42 | # end 43 | 44 | # Sample resource route within a namespace: 45 | # namespace :admin do 46 | # # Directs /admin/products/* to Admin::ProductsController 47 | # # (app/controllers/admin/products_controller.rb) 48 | # resources :products 49 | # end 50 | 51 | # You can have the root of your site routed with "root" 52 | # just remember to delete public/index.html. 53 | 54 | devise_for :users 55 | resources :media do 56 | collection do 57 | get 'fetch' 58 | get 'hall_of_fame' 59 | end 60 | member do 61 | get :delete 62 | end 63 | end 64 | 65 | match 'about' => 'static#about' 66 | match 'legals' => 'static#legals' 67 | 68 | match '/:anything', :to => "static#not_found", :constraints => { :anything => /.+/ } 69 | 70 | root :to => 'media#index' 71 | 72 | 73 | # See how all your routes lay out with "rake routes" 74 | 75 | # This is a legacy wild controller route that's not recommended for RESTful applications. 76 | # Note: This route will make all actions in every controller accessible via GET requests. 77 | # match ':controller(/:action(/:id(.:format)))' 78 | end 79 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Dansledur::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rbappli 3 | 4 | # Code is not reloaded between requests 5 | config.cache_classes = true 6 | 7 | # Full error reports are disabled and caching is turned on 8 | config.consider_all_requests_local = false 9 | config.action_controller.perform_caching = true 10 | 11 | # Disable Rails's static asset server (Apache or nginx will already do this) 12 | config.serve_static_assets = true 13 | config.static_cache_control = "public, max-age=3600" 14 | 15 | 16 | # Compress JavaScripts and CSS 17 | config.assets.compress = true 18 | 19 | # Don't fallback to assets pipeline if a precompiled asset is missed 20 | config.assets.compile = true 21 | 22 | # Generate digests for assets URLs 23 | config.assets.digest = true 24 | 25 | # Defaults to Rails.root.join("public/assets") 26 | # config.assets.manifest = YOUR_PATH 27 | 28 | # Specifies the header that your server uses for sending files 29 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 30 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 31 | 32 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 33 | # config.force_ssl = true 34 | 35 | # See everything in the log (default is :info) 36 | # config.log_level = :debug 37 | 38 | # Use a different logger for distributed setups 39 | # config.logger = SyslogLogger.new 40 | 41 | # Use a different cache store in production 42 | # config.cache_store = :mem_cache_store 43 | 44 | # Enable serving of images, stylesheets, and JavaScripts from an asset server 45 | # config.action_controller.asset_host = "http://assets.example.com" 46 | 47 | # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) 48 | # config.assets.precompile += %w( search.js ) 49 | 50 | # Disable delivery errors, bad email addresses will be ignored 51 | # config.action_mailer.raise_delivery_errors = false 52 | 53 | # Enable threaded mode 54 | # config.threadsafe! 55 | 56 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 57 | # the I18n.default_locale when a translation can not be found) 58 | config.i18n.fallbacks = true 59 | 60 | # Send deprecation notices to registered listeners 61 | config.active_support.deprecation = :notify 62 | end 63 | -------------------------------------------------------------------------------- /app/assets/javascripts/zeroclipboard/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Zero Clipboard Test 4 | 11 | 12 | 43 | 44 | 45 |

Zero Clipboard Test

46 |

47 | 48 | 49 | 62 | 68 | 69 |
50 | 51 | 52 | 53 | 54 | 55 | 56 |
Text:
57 |
58 |
59 |
Copy To Clipboard...
60 |
61 |
63 | 64 |
65 |

Debug Console:

66 |
67 |
70 | 71 |

72 | You can paste text here if you want, to make sure it worked:
73 |
74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | if defined?(Bundler) 6 | # If you precompile assets before deploying to production, use this line 7 | Bundler.require *Rails.groups(:assets => %w(development test)) 8 | # If you want your assets lazily compiled in production, use this line 9 | # Bundler.require(:default, :assets, Rails.env) 10 | end 11 | 12 | module Dansledur 13 | class Application < Rails::Application 14 | # Settings in config/environments/* take precedence over those specified here. 15 | # Application configuration should go into files in config/initializers 16 | # -- all .rb files in that directory are automatically loaded. 17 | 18 | # Custom directories with classes and modules you want to be autoloadable. 19 | # config.autoload_paths += %W(#{config.root}/extras) 20 | 21 | # Only load the plugins named here, in the order given (default is alphabetical). 22 | # :all can be used as a placeholder for all plugins not explicitly named. 23 | # config.plugins = [ :exception_notification, :ssl_requirement, :all ] 24 | 25 | # Activate observers that should always be running. 26 | # config.active_record.observers = :cacher, :garbage_collector, :forum_observer 27 | 28 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 29 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 30 | # config.time_zone = 'Central Time (US & Canada)' 31 | 32 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 33 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 34 | config.i18n.default_locale = :fr 35 | 36 | # Configure the default encoding used in templates for Ruby 1.9. 37 | config.encoding = "utf-8" 38 | 39 | # Configure sensitive parameters which will be filtered from the log file. 40 | config.filter_parameters += [:password] 41 | 42 | # Enable the asset pipeline 43 | config.assets.enabled = true 44 | 45 | # Version of your assets, change this if you want to expire all your assets 46 | config.assets.version = '1.0' 47 | 48 | config.assets.initialize_on_precompile = false 49 | config.cache_store = :dalli_store 50 | 51 | config.middleware.use Rack::Cache, 52 | :metastore => "memcached://#{ENV['MEMCACHE_SERVERS']}/meta", 53 | :entitystore => "memcached://#{ENV['MEMCACHE_SERVERS']}/body" 54 | 55 | Twitter.configure do |config| 56 | config.consumer_key = "015ZZmGe0nYga8ZG31zLXw" 57 | config.consumer_secret = "zsb0poqKi7yC4hHhxlLfehvC5hJ9LvBUwlL9S5CwDX0" 58 | config.oauth_token = "381148102-h4DsdXPzwXJyiemwgKIGyCbcMRfr0yfz7Kw65now" 59 | config.oauth_token_secret = "CwePo2TKKTqSW6bj4fQCPLx0orZyMiPmjOpkCwqy0" 60 | end 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /app/assets/javascripts/zeroclipboard/ZeroClipboard10.as: -------------------------------------------------------------------------------- 1 | package { // Simple Set Clipboard System // Author: Joseph Huckaby import flash.display.Stage; import flash.display.Sprite; import flash.desktop.Clipboard; import flash.desktop.ClipboardFormats; import flash.desktop.ClipboardTransferMode; import flash.display.LoaderInfo; import flash.display.StageScaleMode; import flash.events.*; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.external.ExternalInterface; import flash.system.Security; import flash.utils.*; import flash.system.System; public class ZeroClipboard10 extends Sprite { private var id:String = ''; private var button:Sprite; private var clipText:String = ''; public function ZeroClipboard10() { // constructor, setup event listeners and external interfaces stage.scaleMode = StageScaleMode.EXACT_FIT; flash.system.Security.allowDomain("*"); // import flashvars var flashvars:Object = LoaderInfo( this.root.loaderInfo ).parameters; id = flashvars.id; // invisible button covers entire stage button = new Sprite(); button.buttonMode = true; button.useHandCursor = true; button.graphics.beginFill(0xCCFF00); button.graphics.drawRect(0, 0, Math.floor(flashvars.width), Math.floor(flashvars.height)); button.alpha = 0.0; addChild(button); button.addEventListener(MouseEvent.CLICK, clickHandler); button.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event) { ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOver', null ); } ); button.addEventListener(MouseEvent.MOUSE_OUT, function(event:Event) { ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOut', null ); } ); button.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event) { ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseDown', null ); } ); button.addEventListener(MouseEvent.MOUSE_UP, function(event:Event) { ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseUp', null ); } ); // external functions ExternalInterface.addCallback("setHandCursor", setHandCursor); ExternalInterface.addCallback("setText", setText); // signal to the browser that we are ready ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'load', null ); } public function setText(newText) { // set the maximum number of files allowed clipText = newText; } public function setHandCursor(enabled:Boolean) { // control whether the hand cursor is shown on rollover (true) // or the default arrow cursor (false) button.useHandCursor = enabled; } private function clickHandler(event:Event):void { // user click copies text to clipboard // as of flash player 10, this MUST happen from an in-movie flash click event Clipboard.generalClipboard.clear(); Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, clipText); Clipboard.generalClipboard.setData(ClipboardFormats.HTML_FORMAT, clipText); ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'complete', clipText ); } } } -------------------------------------------------------------------------------- /app/views/layouts/application.html.haml: -------------------------------------------------------------------------------- 1 | !!! 5 2 | %html{'xmlns:og' => "http://opengraphprotocol.org/schema/", 'xmlns:fb' => "http://www.facebook.com/2008/fbml"} 3 | %head 4 | %meta{ :'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8' } 5 | %meta{ :name => "viewport", :content => "user-scalable=no;width=device-width" } 6 | 7 | %title Dans le Dur 8 | %link{ :rel => "icon", :type => "image/png", :href => "/images/favicon.png" } 9 | %link{ :rel => "apple-touch-icon-precomposed", :href => "/images/ios-icon.png" } 10 | = stylesheet_link_tag :application 11 | = javascript_include_tag :application 12 | = csrf_meta_tag 13 | =# render 'shared/ga' 14 | 15 | %body 16 | #header 17 | %header 18 | %a.logo{:href => "/"} 19 | = image_tag "logo.png", :alt => "Dans le Dur" 20 | %form{:action => "/"} 21 | %fieldset 22 | %legend Rechercher une image 23 | %label Rechercher 24 | %input{type: "text", name: "search", value: params[:search]} 25 | %input{type: "submit", :value => "Rechercher"} 26 | #new-post 27 | %a.current{:href => current_user ? new_medium_path : new_user_session_path} 28 | Nouveau Post 29 | %span 30 | Poster un Dans le Dur 31 | %nav 32 | %ul 33 | %li 34 | = link_to "Accueil", "/", :class => (params[:controller] == "media" && params[:action] == "index") ? "current" : "" 35 | %li 36 | = link_to "Hall of Fame", [:hall_of_fame, :media], :class => (params[:controller] == "media" && params[:action] == "hall_of_fame") ? "current" : "" 37 | %li 38 | = link_to "A propos", "/about", :class => (params[:controller] == "static" && params[:action] == "about") ? "current" : "" 39 | - if user_signed_in? 40 | %a.session-link{href: destroy_user_session_path, :'data-method' => :delete, :'data-confirm' => t('are_you_sure', scope: [:messages])} 41 | %strong Se déconnecter 42 | -else 43 | %a.session-link{:href => new_user_session_path} 44 | Déjà un compte ? 45 | %strong Connectez-vous ! 46 | 47 | #wrap 48 | - if flash[:notice] || flash[:alert] 49 | .flash= flash[:notice] || flash[:alert] 50 | #wrap-inner 51 | = yield 52 | 53 | #footer 54 | #footer-inner 55 | .stats 56 | %strong= "#{Medium.count} !" 57 | %small Dans le Dur partagés 58 | %ul 59 | %li 60 | %a{:href => "mailto:invitation@dansledur.com"} 61 | Demander une invitation ! 62 | %li 63 | %a{:href => "/about"} 64 | A propos 65 | %li 66 | %a{:href => "/legals"} 67 | Légale 68 | %li 69 | %a{:href => "http://twitter.com/#!/Dansledur", target: "_blank"} 70 | @DansleDur 71 | %p Copyright © 2011 Dans le Dur. Toutes les captures © leurs propriétaires respectifs. Made in sunny Bordeaux. 72 | 73 | -------------------------------------------------------------------------------- /app/assets/javascripts/zeroclipboard/ZeroClipboard.as: -------------------------------------------------------------------------------- 1 | package { 2 | // Simple Set Clipboard System 3 | // Author: Joseph Huckaby 4 | 5 | import flash.display.Stage; 6 | import flash.display.Sprite; 7 | import flash.display.LoaderInfo; 8 | import flash.display.StageScaleMode; 9 | import flash.events.*; 10 | import flash.display.StageAlign; 11 | import flash.display.StageScaleMode; 12 | import flash.external.ExternalInterface; 13 | import flash.system.Security; 14 | import flash.utils.*; 15 | import flash.system.System; 16 | 17 | public class ZeroClipboard extends Sprite { 18 | 19 | private var id:String = ''; 20 | private var button:Sprite; 21 | private var clipText:String = ''; 22 | 23 | public function ZeroClipboard() { 24 | // constructor, setup event listeners and external interfaces 25 | stage.scaleMode = StageScaleMode.EXACT_FIT; 26 | flash.system.Security.allowDomain("*"); 27 | 28 | // import flashvars 29 | var flashvars:Object = LoaderInfo( this.root.loaderInfo ).parameters; 30 | id = flashvars.id; 31 | 32 | // invisible button covers entire stage 33 | button = new Sprite(); 34 | button.buttonMode = true; 35 | button.useHandCursor = true; 36 | button.graphics.beginFill(0xCCFF00); 37 | button.graphics.drawRect(0, 0, Math.floor(flashvars.width), Math.floor(flashvars.height)); 38 | button.alpha = 0.0; 39 | addChild(button); 40 | button.addEventListener(MouseEvent.CLICK, clickHandler); 41 | 42 | button.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event) { 43 | ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOver', null ); 44 | } ); 45 | button.addEventListener(MouseEvent.MOUSE_OUT, function(event:Event) { 46 | ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOut', null ); 47 | } ); 48 | button.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event) { 49 | ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseDown', null ); 50 | } ); 51 | button.addEventListener(MouseEvent.MOUSE_UP, function(event:Event) { 52 | ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseUp', null ); 53 | } ); 54 | 55 | // external functions 56 | ExternalInterface.addCallback("setHandCursor", setHandCursor); 57 | ExternalInterface.addCallback("setText", setText); 58 | 59 | // signal to the browser that we are ready 60 | ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'load', null ); 61 | } 62 | 63 | public function setText(newText) { 64 | // set the maximum number of files allowed 65 | clipText = newText; 66 | } 67 | 68 | public function setHandCursor(enabled:Boolean) { 69 | // control whether the hand cursor is shown on rollover (true) 70 | // or the default arrow cursor (false) 71 | button.useHandCursor = enabled; 72 | } 73 | 74 | private function clickHandler(event:Event):void { 75 | // user click copies text to clipboard 76 | // as of flash player 10, this MUST happen from an in-movie flash click event 77 | System.setClipboard( clipText ); 78 | ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'complete', clipText ); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /#template/view/index-layout.html.haml: -------------------------------------------------------------------------------- 1 | #main 2 | %h1 Dans le Dur récents 3 | %ul.items 4 | %li 5 | %a{:href => "#"} 6 | %strong Best food recipe ever 7 | %p Tags, list, max, characters, Tags, list, max, characters, n... 8 | %small October 12, 2011 9 | = image_tag "fake/thumb-206x132.png", :alt => "Title" 10 | %li 11 | %a{:href => "#"} 12 | %strong Best food recipe ever 13 | %p Tags, list, max, characters, Tags, list, max, characters, n... 14 | %small October 12, 2011 15 | = image_tag "thumb-trash.gif", :alt => "Title" 16 | %li 17 | %a{:href => "#"} 18 | %strong Best food recipe ever 19 | %p Tags, list, max, characters, Tags, list, max, characters, n... 20 | %small October 12, 2011 21 | = image_tag "fake/thumb-206x132.png", :alt => "Title" 22 | %li 23 | %a{:href => "#"} 24 | %strong Best food recipe ever 25 | %p Tags, list, max, characters, Tags, list, max, characters, n... 26 | %small October 12, 2011 27 | = image_tag "fake/thumb-206x132.png", :alt => "Title" 28 | %li 29 | %a{:href => "#"} 30 | %strong Best food recipe ever 31 | %p Tags, list, max, characters, Tags, list, max, characters, n... 32 | %small October 12, 2011 33 | = image_tag "thumb-trash.gif", :alt => "Title" 34 | %li 35 | %a{:href => "#"} 36 | %strong Best food recipe ever 37 | %p Tags, list, max, characters, Tags, list, max, characters, n... 38 | %small October 12, 2011 39 | = image_tag "fake/thumb-206x132.png", :alt => "Title" 40 | %li 41 | %a{:href => "#"} 42 | %strong Best food recipe ever 43 | %p Tags, list, max, characters, Tags, list, max, characters, n... 44 | %small October 12, 2011 45 | = image_tag "fake/thumb-206x132.png", :alt => "Title" 46 | %li 47 | %a{:href => "#"} 48 | %strong Best food recipe ever 49 | %p Tags, list, max, characters, Tags, list, max, characters, n... 50 | %small October 12, 2011 51 | = image_tag "thumb-trash.gif", :alt => "Title" 52 | %li 53 | %a{:href => "#"} 54 | %strong Best food recipe ever 55 | %p Tags, list, max, characters, Tags, list, max, characters, n... 56 | %small October 12, 2011 57 | = image_tag "fake/thumb-206x132.png", :alt => "Title" 58 | #pagination 59 | = link_to "« Plus anciens", "#" 60 | = link_to "Plus récents »", "#" 61 | 62 | #misc 63 | %h2 Tags populaires ! 64 | %ul.tags 65 | %li= link_to "Foudefafa", "#" 66 | %li= link_to "Ff grgoudefafa", "#" 67 | %li= link_to "Fefafa", "#" 68 | %li= link_to "Foudefafa", "#" 69 | %li= link_to "Gafa gr", "#" 70 | %li= link_to "Fef ergafa", "#" 71 | %li= link_to "Foafa", "#" 72 | %li= link_to "Gaergergfa", "#" 73 | 74 | %h2 Hall of Fame ! 75 | = image_tag "ads-hof.png", :alt => "Hall of Fame" 76 | 77 | %h2 Je veux une Newsletter ! 78 | .newsletter 79 | %p Enregistrez-vous si vous souhaitez recevoir les derniers DLDs ! 80 | %form{:action => ""} 81 | %fieldset 82 | %legend Inscription 83 | %label Email 84 | %input{:type => "text", :placeholder => "Adresse Email"} 85 | %input{:type => "submit", :value => "OK"} 86 | -------------------------------------------------------------------------------- /config/locales/devise.en.yml: -------------------------------------------------------------------------------- 1 | # Additional translations at http://github.com/plataformatec/devise/wiki/I18n 2 | 3 | en: 4 | errors: 5 | messages: 6 | expired: "has expired, please request a new one" 7 | not_found: "not found" 8 | already_confirmed: "was already confirmed, please try signing in" 9 | not_locked: "was not locked" 10 | not_saved: 11 | one: "1 error prohibited this %{resource} from being saved:" 12 | other: "%{count} errors prohibited this %{resource} from being saved:" 13 | 14 | devise: 15 | common: 16 | forgot_your_password?: Forgot your password ? 17 | failure: 18 | already_authenticated: 'You are already signed in.' 19 | unauthenticated: 'You need to sign in or sign up before continuing.' 20 | unconfirmed: 'You have to confirm your account before continuing.' 21 | locked: 'Your account is locked.' 22 | invalid: 'Invalid email or password.' 23 | invalid_token: 'Invalid authentication token.' 24 | timeout: 'Your session expired, please sign in again to continue.' 25 | inactive: 'Your account was not activated yet.' 26 | sessions: 27 | signed_in: 'Signed in successfully.' 28 | signed_out: 'Signed out successfully.' 29 | passwords: 30 | send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.' 31 | updated: 'Your password was changed successfully. You are now signed in.' 32 | updated_not_active: 'Your password was changed successfully.' 33 | send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail" 34 | confirmations: 35 | send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' 36 | send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.' 37 | confirmed: 'Your account was successfully confirmed. You are now signed in.' 38 | registrations: 39 | signed_up: 'Welcome! You have signed up successfully.' 40 | inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.' 41 | updated: 'You updated your account successfully.' 42 | destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.' 43 | reasons: 44 | inactive: 'inactive' 45 | unconfirmed: 'unconfirmed' 46 | locked: 'locked' 47 | unlocks: 48 | send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.' 49 | unlocked: 'Your account was successfully unlocked. You are now signed in.' 50 | send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.' 51 | omniauth_callbacks: 52 | success: 'Successfully authorized from %{kind} account.' 53 | failure: 'Could not authorize you from %{kind} because "%{reason}".' 54 | mailer: 55 | confirmation_instructions: 56 | subject: 'Confirmation instructions' 57 | reset_password_instructions: 58 | subject: 'Reset password instructions' 59 | unlock_instructions: 60 | subject: 'Unlock Instructions' 61 | -------------------------------------------------------------------------------- /config/locales/devise.fr.yml: -------------------------------------------------------------------------------- 1 | # Additional translations at http://github.com/plataformatec/devise/wiki/I18n 2 | 3 | fr: 4 | errors: 5 | messages: 6 | expired: "has expired, please request a new one" 7 | not_found: "not found" 8 | already_confirmed: "was already confirmed, please try signing in" 9 | not_locked: "was not locked" 10 | not_saved: 11 | one: "1 error prohibited this %{resource} from being saved:" 12 | other: "%{count} errors prohibited this %{resource} from being saved:" 13 | 14 | devise: 15 | common: 16 | forgot_your_password?: Forgot your password ? 17 | failure: 18 | already_authenticated: 'You are already signed in.' 19 | unauthenticated: 'You need to sign in or sign up before continuing.' 20 | unconfirmed: 'You have to confirm your account before continuing.' 21 | locked: 'Your account is locked.' 22 | invalid: 'Invalid email or password.' 23 | invalid_token: 'Invalid authentication token.' 24 | timeout: 'Your session expired, please sign in again to continue.' 25 | inactive: 'Your account was not activated yet.' 26 | sessions: 27 | signed_in: 'Signed in successfully.' 28 | signed_out: 'Signed out successfully.' 29 | passwords: 30 | send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.' 31 | updated: 'Your password was changed successfully. You are now signed in.' 32 | updated_not_active: 'Your password was changed successfully.' 33 | send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail" 34 | confirmations: 35 | send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' 36 | send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.' 37 | confirmed: 'Your account was successfully confirmed. You are now signed in.' 38 | registrations: 39 | signed_up: 'Welcome! You have signed up successfully.' 40 | inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.' 41 | updated: 'You updated your account successfully.' 42 | destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.' 43 | reasons: 44 | inactive: 'inactive' 45 | unconfirmed: 'unconfirmed' 46 | locked: 'locked' 47 | unlocks: 48 | send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.' 49 | unlocked: 'Your account was successfully unlocked. You are now signed in.' 50 | send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.' 51 | omniauth_callbacks: 52 | success: 'Successfully authorized from %{kind} account.' 53 | failure: 'Could not authorize you from %{kind} because "%{reason}".' 54 | mailer: 55 | confirmation_instructions: 56 | subject: 'Confirmation instructions' 57 | reset_password_instructions: 58 | subject: 'Reset password instructions' 59 | unlock_instructions: 60 | subject: 'Unlock Instructions' 61 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended to check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(:version => 20120517144759) do 15 | 16 | create_table "delayed_jobs", :force => true do |t| 17 | t.integer "priority", :default => 0 18 | t.integer "attempts", :default => 0 19 | t.text "handler" 20 | t.text "last_error" 21 | t.datetime "run_at" 22 | t.datetime "locked_at" 23 | t.datetime "failed_at" 24 | t.string "locked_by" 25 | t.string "queue" 26 | t.datetime "created_at", :null => false 27 | t.datetime "updated_at", :null => false 28 | end 29 | 30 | add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" 31 | 32 | create_table "media", :force => true do |t| 33 | t.string "name" 34 | t.timestamp "created_at" 35 | t.timestamp "updated_at" 36 | t.string "image_file_name" 37 | t.string "image_content_type" 38 | t.integer "image_file_size" 39 | t.timestamp "image_updated_at" 40 | t.integer "views_count" 41 | t.string "url" 42 | t.datetime "fetched_at" 43 | end 44 | 45 | create_table "settings", :force => true do |t| 46 | t.string "key" 47 | t.string "value" 48 | t.timestamp "created_at" 49 | t.timestamp "updated_at" 50 | end 51 | 52 | create_table "taggings", :force => true do |t| 53 | t.integer "tag_id" 54 | t.integer "taggable_id" 55 | t.string "taggable_type" 56 | t.integer "tagger_id" 57 | t.string "tagger_type" 58 | t.string "context" 59 | t.timestamp "created_at" 60 | end 61 | 62 | add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" 63 | add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" 64 | 65 | create_table "tags", :force => true do |t| 66 | t.string "name" 67 | end 68 | 69 | create_table "users", :force => true do |t| 70 | t.string "username" 71 | t.timestamp "created_at" 72 | t.timestamp "updated_at" 73 | t.string "email", :default => "", :null => false 74 | t.string "encrypted_password", :limit => 128, :default => "", :null => false 75 | t.string "reset_password_token" 76 | t.timestamp "reset_password_sent_at" 77 | t.timestamp "remember_created_at" 78 | t.integer "sign_in_count", :default => 0 79 | t.timestamp "current_sign_in_at" 80 | t.timestamp "last_sign_in_at" 81 | t.string "current_sign_in_ip" 82 | t.string "last_sign_in_ip" 83 | end 84 | 85 | add_index "users", ["email"], :name => "index_users_on_email", :unique => true 86 | add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true 87 | 88 | end 89 | -------------------------------------------------------------------------------- /app/models/medium.rb: -------------------------------------------------------------------------------- 1 | require 'open-uri' 2 | require 'pstore' 3 | 4 | class Medium < ActiveRecord::Base 5 | if Rails.env.development? 6 | has_attached_file :image, 7 | :storage => :filesystem, 8 | :styles => { :icon => "100x64#", :medium => "680x600>", :thumb => "206x132#" } 9 | else 10 | has_attached_file :image, 11 | :storage => Rails.env.production? ? :s3 : :filesystem, 12 | :bucket => 'dans-le-dur', 13 | :s3_host_alias => 'cdn.dansledur.com', 14 | :url => ':s3_alias_url', 15 | :path => "app/public/system/images/:id/:style/:filename", 16 | :s3_credentials => { 17 | :access_key_id => ENV['S3_KEY'], 18 | :secret_access_key => ENV['S3_SECRET'] 19 | }, 20 | :styles => { :icon => "100x64#", :medium => "680x600#", :thumb => "206x132#" } 21 | end 22 | acts_as_taggable 23 | 24 | scope :not_fetched, where('fetched_at IS NULL') 25 | scope :fetched, where('fetched_at IS NOT NULL') 26 | 27 | validates :name, presence: true 28 | 29 | before_create {|m| m.views_count = 0 } 30 | 31 | def fetch 32 | return if fetched_at 33 | io = self.class.download(url) 34 | return unless io 35 | self.image = io 36 | io.close 37 | self.update_attribute :fetched_at, Time.now 38 | end 39 | 40 | def self.fetch_unfetched 41 | Medium.fetch_from_twitter + Medium.not_fetched.each(&:fetch).count 42 | end 43 | 44 | def self.fetch_from_twitter 45 | last_id = Setting[:last_mention_id].try :to_i 46 | if last_id 47 | mentions = Twitter.mentions since_id: last_id 48 | else 49 | last_id = 0 50 | mentions = Twitter.mentions 51 | end 52 | mentions.each do |m| 53 | begin 54 | if m.id > last_id 55 | last_id = m.id 56 | Setting[:last_mention_id] = m.id 57 | end 58 | tags = m.text.scan(/#(\w+)/).flatten 59 | name = m.text 60 | urls = m.text.scan(/((https?:\/\/)?[\w\.\-]+\.\w{2,5}(\/[\w.\-\_]+)*)/).map(&:first) 61 | urls.each do |url| 62 | name = name.gsub(url, "") 63 | end 64 | name = name.gsub(/#\w+/, '').gsub(/\@\w+/, "").gsub(/^\s+/, '').gsub(/\s+$/, '').gsub(/\s+/, " ") 65 | urls.each do |url| 66 | url = "http://#{url}" unless /https?:\/\//.match(url) 67 | medium = self.create! url: url, tag_list: tags, name: name 68 | medium.fetch 69 | end 70 | rescue e 71 | p e 72 | end 73 | end.count 74 | end 75 | 76 | def self.suggestions_for search, limit = 4 77 | suggestions = Hash.new{|h, k| h[k] = []} 78 | ActsAsTaggableOn::Tag.all.each do |t| 79 | suggestions[Text::Levenshtein.distance(search, t.name)] << t.name 80 | end 81 | suggestions = Hash[suggestions.sort] 82 | a = [] 83 | while a.count < limit 84 | a += suggestions.delete(suggestions.keys.first) 85 | end 86 | a[0..limit] 87 | end 88 | 89 | def next 90 | Medium.order(:id).where("id > ?", self.id).first 91 | end 92 | 93 | def previous 94 | Medium.order(:id).where("id < ?", self.id).last 95 | end 96 | 97 | def trash? 98 | tag_list.include? "trash" 99 | end 100 | 101 | def filtered_thumb_url 102 | self.trash? ? "thumb-trash.gif" : image.url(:thumb) 103 | end 104 | 105 | def touch! 106 | Medium.update_all("views_count = #{self.views_count.to_i + 1}", "id = #{self.id}") 107 | end 108 | 109 | protected 110 | def self.download url 111 | io = open(url) 112 | def io.original_filename; base_uri.path.split('/').last; end 113 | io.original_filename.blank? ? nil : io 114 | rescue => e # catch url errors with validations instead of exceptions (Errno::ENOENT, OpenURI::HTTPError, etc...) 115 | p e 116 | nil 117 | # io.close 118 | end 119 | end 120 | -------------------------------------------------------------------------------- /app/assets/stylesheets/form.sass: -------------------------------------------------------------------------------- 1 | @import "vars", "mixins" 2 | 3 | fieldset 4 | border: 0 5 | margin: 0 6 | padding: 0 7 | 8 | input, button, textarea 9 | font: 12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif 10 | resize: none 11 | -webkit-font-smoothing: antialiased 12 | 13 | input, textarea 14 | color: #333 15 | 16 | textarea 17 | &.resizable-on 18 | overflow: hidden 19 | 20 | select 21 | width: 200px 22 | margin: 5px 0 3px 23 | 24 | input[type=checkbox] 25 | -webkit-appearance: checkbox 26 | 27 | button[type=submit], input[type=submit] 28 | cursor: pointer 29 | color: #666666 30 | font-weight: bold 31 | border: 1px solid rgba(0,0,0,0.16) 32 | @include border-radius(3px) 33 | background: #f4f4f4 34 | background: -moz-linear-gradient(top, #f4f4f4 0%, #f4f4f4 49%, #eaeaea 50%, #eaeaea 100%) 35 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f4f4f4), color-stop(49%,#f4f4f4), color-stop(50%,#eaeaea), color-stop(100%,#eaeaea)) 36 | background: -webkit-linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 37 | background: -o-linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 38 | background: -ms-linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 39 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eaeaea',GradientType=0 ) 40 | background: linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 41 | text-shadow: 0 1px 0 rgba(255,255,255,1) 42 | &:hover 43 | color: white 44 | border-color: #c22d0c 45 | background: #f36f21 46 | background: -moz-linear-gradient(top, #f36f21 0%, #f36f21 49%, #f05c22 50%, #f05c22 100%) 47 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f36f21), color-stop(49%,#f36f21), color-stop(50%,#f05c22), color-stop(100%,#f05c22)) 48 | background: -webkit-linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 49 | background: -o-linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 50 | background: -ms-linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 51 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f36f21', endColorstr='#f05c22',GradientType=0 ) 52 | background: linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 53 | text-shadow: 0 -1px 0 #c22d0c 54 | 55 | input[type=text], input[type=password], input[type=mail], input[type=url] 56 | background: white 57 | border: 1px solid rgba(0,0,0,0.16) 58 | @include border-radius(3px) 59 | margin: 0 60 | padding: 0 61 | &:hover 62 | border-color: rgba(0,0,0,0.36) 63 | &:focus 64 | border-color: #f36f21 65 | 66 | //containers 67 | 68 | #sign_in, #new_medium 69 | legend 70 | display: none 71 | label 72 | padding: 0 0 4px 73 | display: block 74 | a 75 | display: inline 76 | .remember-me 77 | float: left 78 | padding: 10px 0 0 79 | label 80 | display: inline 81 | cursor: pointer 82 | padding: 0 0 4px 83 | &:hover 84 | color: #333333 85 | input[type=text], input[type=password], input[type=mail], input[type=url] 86 | width: 280px 87 | font-size: 16px 88 | padding: 8px 9px 89 | margin: 0 0 8px 90 | input[type=submit] 91 | font-size: 16px 92 | padding: 8px 12px 9px 93 | margin: 0 94 | float: right 95 | margin: 0 0 30px 96 | 97 | header 98 | form 99 | float: left 100 | margin: 9px 0 0 16px 101 | position: relative 102 | legend, label 103 | display: none 104 | input[type=text] 105 | background: white 106 | border: 1px solid #c22d0c 107 | @include border-radius(3px) 108 | margin: 0 109 | padding: 6px 6px 5px 110 | width: 274px 111 | @include box-shadow(0 1px 1px rgba(0,0,0,0.16) inset) 112 | -webkit-background-clip: padding-box 113 | color: #777 114 | &:hover, &:focus 115 | border-color: #a4260a 116 | &:focus 117 | color: #333 118 | input[type=submit] 119 | text-indent: -9999px 120 | width: 14px 121 | height: 14px 122 | position: absolute 123 | top: 7px 124 | right: 6px 125 | background: url(../assets/icon-search.gif) no-repeat 0 0 126 | border: 0 127 | &:hover 128 | background: url(../assets/icon-search.gif) no-repeat 0 -14px 129 | 130 | .newsletter 131 | width: 222px 132 | legend, label 133 | display: none 134 | input 135 | float: left 136 | margin: 0 2px 0 0 137 | input[type=text] 138 | width: 164px 139 | color: #777 140 | padding: 6px 6px 5px 141 | &:focus 142 | color: #333 143 | input[type=submit] 144 | width: 40px 145 | padding: 5px 0 4px -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: http://rubygems.org/ 3 | specs: 4 | actionmailer (3.2.0) 5 | actionpack (= 3.2.0) 6 | mail (~> 2.4.0) 7 | actionpack (3.2.0) 8 | activemodel (= 3.2.0) 9 | activesupport (= 3.2.0) 10 | builder (~> 3.0.0) 11 | erubis (~> 2.7.0) 12 | journey (~> 1.0.0) 13 | rack (~> 1.4.0) 14 | rack-cache (~> 1.1) 15 | rack-test (~> 0.6.1) 16 | sprockets (~> 2.1.2) 17 | activemodel (3.2.0) 18 | activesupport (= 3.2.0) 19 | builder (~> 3.0.0) 20 | activerecord (3.2.0) 21 | activemodel (= 3.2.0) 22 | activesupport (= 3.2.0) 23 | arel (~> 3.0.0) 24 | tzinfo (~> 0.3.29) 25 | activeresource (3.2.0) 26 | activemodel (= 3.2.0) 27 | activesupport (= 3.2.0) 28 | activesupport (3.2.0) 29 | i18n (~> 0.6) 30 | multi_json (~> 1.0) 31 | acts-as-taggable-on (2.1.1) 32 | rails 33 | addressable (2.2.7) 34 | ansi (1.4.2) 35 | arel (3.0.2) 36 | aws-s3 (0.6.2) 37 | builder 38 | mime-types 39 | xml-simple 40 | bcrypt-ruby (3.0.1) 41 | bitly (0.7.0) 42 | crack (>= 0.1.4) 43 | httparty (>= 0.7.6) 44 | oauth2 (~> 0.5.0) 45 | builder (3.0.0) 46 | cocaine (0.2.1) 47 | coffee-rails (3.2.2) 48 | coffee-script (>= 2.2.0) 49 | railties (~> 3.2.0) 50 | coffee-script (2.2.0) 51 | coffee-script-source 52 | execjs 53 | coffee-script-source (1.2.0) 54 | crack (0.3.1) 55 | dalli (1.1.5) 56 | delayed_job (3.0.1) 57 | activesupport (~> 3.0) 58 | delayed_job_active_record (0.3.2) 59 | activerecord (> 2.1.0) 60 | delayed_job (~> 3.0.0) 61 | devise (2.0.4) 62 | bcrypt-ruby (~> 3.0) 63 | orm_adapter (~> 0.0.3) 64 | railties (~> 3.1) 65 | warden (~> 1.1.1) 66 | erubis (2.7.0) 67 | execjs (1.3.0) 68 | multi_json (~> 1.0) 69 | faraday (0.7.6) 70 | addressable (~> 2.2) 71 | multipart-post (~> 1.1) 72 | rack (~> 1.1) 73 | haml (3.1.4) 74 | hike (1.2.1) 75 | httparty (0.8.1) 76 | multi_json 77 | multi_xml 78 | i18n (0.6.0) 79 | journey (1.0.3) 80 | jquery-rails (2.0.1) 81 | railties (>= 3.2.0, < 5.0) 82 | thor (~> 0.14) 83 | json (1.6.5) 84 | kgio (2.6.0) 85 | mail (2.4.1) 86 | i18n (>= 0.4.0) 87 | mime-types (~> 1.16) 88 | treetop (~> 1.4.8) 89 | mime-types (1.17.2) 90 | multi_json (1.1.0) 91 | multi_xml (0.4.1) 92 | multipart-post (1.1.5) 93 | oauth2 (0.5.2) 94 | faraday (~> 0.7) 95 | multi_json (~> 1.0) 96 | orm_adapter (0.0.6) 97 | paperclip (2.4.2) 98 | activerecord (>= 2.3.0) 99 | activesupport (>= 2.3.2) 100 | cocaine (>= 0.0.2) 101 | mime-types 102 | pg (0.13.2) 103 | polyglot (0.3.3) 104 | rack (1.4.1) 105 | rack-cache (1.1) 106 | rack (>= 0.4) 107 | rack-google-analytics (0.10.0) 108 | rack-ssl (1.3.2) 109 | rack 110 | rack-test (0.6.1) 111 | rack (>= 1.0) 112 | rails (3.2.0) 113 | actionmailer (= 3.2.0) 114 | actionpack (= 3.2.0) 115 | activerecord (= 3.2.0) 116 | activeresource (= 3.2.0) 117 | activesupport (= 3.2.0) 118 | bundler (~> 1.0) 119 | railties (= 3.2.0) 120 | railties (3.2.0) 121 | actionpack (= 3.2.0) 122 | activesupport (= 3.2.0) 123 | rack-ssl (~> 1.3.2) 124 | rake (>= 0.8.7) 125 | rdoc (~> 3.4) 126 | thor (~> 0.14.6) 127 | raindrops (0.8.0) 128 | rake (0.9.2.2) 129 | rdoc (3.12) 130 | json (~> 1.4) 131 | rmagick (2.13.1) 132 | sass (3.1.15) 133 | sass-rails (3.2.4) 134 | railties (~> 3.2.0) 135 | sass (>= 3.1.10) 136 | tilt (~> 1.3) 137 | simple_oauth (0.1.5) 138 | sprockets (2.1.2) 139 | hike (~> 1.2) 140 | rack (~> 1.0) 141 | tilt (~> 1.1, != 1.3.0) 142 | sqlite3 (1.3.5) 143 | text (1.0.3) 144 | thor (0.14.6) 145 | tilt (1.3.3) 146 | treetop (1.4.10) 147 | polyglot 148 | polyglot (>= 0.3.1) 149 | turn (0.9.3) 150 | ansi 151 | twitter (2.0.2) 152 | activesupport (>= 2.3.9, < 4) 153 | faraday (~> 0.7) 154 | multi_json (~> 1.0) 155 | simple_oauth (~> 0.1) 156 | tzinfo (0.3.31) 157 | uglifier (1.2.3) 158 | execjs (>= 0.3.0) 159 | multi_json (>= 1.0.2) 160 | unicorn (4.1.1) 161 | kgio (~> 2.4) 162 | rack 163 | raindrops (~> 0.6) 164 | warden (1.1.1) 165 | rack (>= 1.0) 166 | will_paginate (3.0.3) 167 | xml-simple (1.1.1) 168 | 169 | PLATFORMS 170 | ruby 171 | 172 | DEPENDENCIES 173 | acts-as-taggable-on (~> 2.1.0) 174 | aws-s3 (= 0.6.2) 175 | bitly 176 | coffee-rails (~> 3.2.0) 177 | dalli 178 | delayed_job_active_record 179 | devise 180 | haml 181 | jquery-rails 182 | paperclip (= 2.4.2) 183 | pg 184 | rack-cache 185 | rack-google-analytics 186 | rails (= 3.2.0) 187 | rmagick 188 | sass-rails (~> 3.2.0) 189 | sqlite3 190 | text 191 | turn 192 | twitter (= 2.0.2) 193 | uglifier 194 | unicorn 195 | will_paginate (~> 3.0) 196 | -------------------------------------------------------------------------------- /app/assets/javascripts/shortcut.js: -------------------------------------------------------------------------------- 1 | /** 2 | * http://www.openjs.com/scripts/events/keyboard_shortcuts/ 3 | * Version : 2.01.B 4 | * By Binny V A 5 | * License : BSD 6 | */ 7 | shortcut = { 8 | 'all_shortcuts':{},//All the shortcuts are stored in this array 9 | 'add': function(shortcut_combination,callback,opt) { 10 | //Provide a set of default options 11 | var default_options = { 12 | 'type':'keydown', 13 | 'propagate':false, 14 | 'disable_in_input':false, 15 | 'target':document, 16 | 'keycode':false 17 | } 18 | if(!opt) opt = default_options; 19 | else { 20 | for(var dfo in default_options) { 21 | if(typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo]; 22 | } 23 | } 24 | 25 | var ele = opt.target; 26 | if(typeof opt.target == 'string') ele = document.getElementById(opt.target); 27 | var ths = this; 28 | shortcut_combination = shortcut_combination.toLowerCase(); 29 | 30 | //The function to be called at keypress 31 | var func = function(e) { 32 | e = e || window.event; 33 | 34 | if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields 35 | var element; 36 | if(e.target) element=e.target; 37 | else if(e.srcElement) element=e.srcElement; 38 | if(element.nodeType==3) element=element.parentNode; 39 | 40 | if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return; 41 | } 42 | 43 | //Find Which key is pressed 44 | if (e.keyCode) code = e.keyCode; 45 | else if (e.which) code = e.which; 46 | var character = String.fromCharCode(code).toLowerCase(); 47 | 48 | if(code == 188) character=","; //If the user presses , when the type is onkeydown 49 | if(code == 190) character="."; //If the user presses , when the type is onkeydown 50 | 51 | var keys = shortcut_combination.split("+"); 52 | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked 53 | var kp = 0; 54 | 55 | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken 56 | var shift_nums = { 57 | "`":"~", 58 | "1":"!", 59 | "2":"@", 60 | "3":"#", 61 | "4":"$", 62 | "5":"%", 63 | "6":"^", 64 | "7":"&", 65 | "8":"*", 66 | "9":"(", 67 | "0":")", 68 | "-":"_", 69 | "=":"+", 70 | ";":":", 71 | "'":"\"", 72 | ",":"<", 73 | ".":">", 74 | "/":"?", 75 | "\\":"|" 76 | } 77 | //Special Keys - and their codes 78 | var special_keys = { 79 | 'esc':27, 80 | 'escape':27, 81 | 'tab':9, 82 | 'space':32, 83 | 'return':13, 84 | 'enter':13, 85 | 'backspace':8, 86 | 87 | 'scrolllock':145, 88 | 'scroll_lock':145, 89 | 'scroll':145, 90 | 'capslock':20, 91 | 'caps_lock':20, 92 | 'caps':20, 93 | 'numlock':144, 94 | 'num_lock':144, 95 | 'num':144, 96 | 97 | 'pause':19, 98 | 'break':19, 99 | 100 | 'insert':45, 101 | 'home':36, 102 | 'delete':46, 103 | 'end':35, 104 | 105 | 'pageup':33, 106 | 'page_up':33, 107 | 'pu':33, 108 | 109 | 'pagedown':34, 110 | 'page_down':34, 111 | 'pd':34, 112 | 113 | 'left':37, 114 | 'up':38, 115 | 'right':39, 116 | 'down':40, 117 | 118 | 'f1':112, 119 | 'f2':113, 120 | 'f3':114, 121 | 'f4':115, 122 | 'f5':116, 123 | 'f6':117, 124 | 'f7':118, 125 | 'f8':119, 126 | 'f9':120, 127 | 'f10':121, 128 | 'f11':122, 129 | 'f12':123 130 | } 131 | 132 | var modifiers = { 133 | shift: { wanted:false, pressed:false}, 134 | ctrl : { wanted:false, pressed:false}, 135 | alt : { wanted:false, pressed:false}, 136 | meta : { wanted:false, pressed:false} //Meta is Mac specific 137 | }; 138 | 139 | if(e.ctrlKey) modifiers.ctrl.pressed = true; 140 | if(e.shiftKey) modifiers.shift.pressed = true; 141 | if(e.altKey) modifiers.alt.pressed = true; 142 | if(e.metaKey) modifiers.meta.pressed = true; 143 | 144 | for(var i=0; k=keys[i],i 1) { //If it is a special key 161 | if(special_keys[k] == code) kp++; 162 | 163 | } else if(opt['keycode']) { 164 | if(opt['keycode'] == code) kp++; 165 | 166 | } else { //The special keys did not match 167 | if(character == k) kp++; 168 | else { 169 | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase 170 | character = shift_nums[character]; 171 | if(character == k) kp++; 172 | } 173 | } 174 | } 175 | } 176 | 177 | if(kp == keys.length && 178 | modifiers.ctrl.pressed == modifiers.ctrl.wanted && 179 | modifiers.shift.pressed == modifiers.shift.wanted && 180 | modifiers.alt.pressed == modifiers.alt.wanted && 181 | modifiers.meta.pressed == modifiers.meta.wanted) { 182 | callback(e); 183 | 184 | if(!opt['propagate']) { //Stop the event 185 | //e.cancelBubble is supported by IE - this will kill the bubbling process. 186 | e.cancelBubble = true; 187 | e.returnValue = false; 188 | 189 | //e.stopPropagation works in Firefox. 190 | if (e.stopPropagation) { 191 | e.stopPropagation(); 192 | e.preventDefault(); 193 | } 194 | return false; 195 | } 196 | } 197 | } 198 | this.all_shortcuts[shortcut_combination] = { 199 | 'callback':func, 200 | 'target':ele, 201 | 'event': opt['type'] 202 | }; 203 | //Attach the function with the event 204 | if(ele.addEventListener) ele.addEventListener(opt['type'], func, false); 205 | else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func); 206 | else ele['on'+opt['type']] = func; 207 | }, 208 | 209 | //Remove the shortcut - just specify the shortcut and I will remove the binding 210 | 'remove':function(shortcut_combination) { 211 | shortcut_combination = shortcut_combination.toLowerCase(); 212 | var binding = this.all_shortcuts[shortcut_combination]; 213 | delete(this.all_shortcuts[shortcut_combination]) 214 | if(!binding) return; 215 | var type = binding['event']; 216 | var ele = binding['target']; 217 | var callback = binding['callback']; 218 | 219 | if(ele.detachEvent) ele.detachEvent('on'+type, callback); 220 | else if(ele.removeEventListener) ele.removeEventListener(type, callback, false); 221 | else ele['on'+type] = false; 222 | } 223 | } -------------------------------------------------------------------------------- /config/initializers/devise.rb: -------------------------------------------------------------------------------- 1 | # Use this hook to configure devise mailer, warden hooks and so forth. The first 2 | # four configuration values can also be set straight in your models. 3 | Devise.setup do |config| 4 | # ==> Mailer Configuration 5 | # Configure the e-mail address which will be shown in Devise::Mailer, 6 | # note that it will be overwritten if you use your own mailer class with default "from" parameter. 7 | config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com" 8 | 9 | # Configure the class responsible to send e-mails. 10 | # config.mailer = "Devise::Mailer" 11 | 12 | # ==> ORM configuration 13 | # Load and configure the ORM. Supports :active_record (default) and 14 | # :mongoid (bson_ext recommended) by default. Other ORMs may be 15 | # available as additional gems. 16 | require 'devise/orm/active_record' 17 | 18 | # ==> Configuration for any authentication mechanism 19 | # Configure which keys are used when authenticating a user. The default is 20 | # just :email. You can configure it to use [:username, :subdomain], so for 21 | # authenticating a user, both parameters are required. Remember that those 22 | # parameters are used only when authenticating and not when retrieving from 23 | # session. If you need permissions, you should implement that in a before filter. 24 | # You can also supply a hash where the value is a boolean determining whether 25 | # or not authentication should be aborted when the value is not present. 26 | # config.authentication_keys = [ :email ] 27 | 28 | # Configure parameters from the request object used for authentication. Each entry 29 | # given should be a request method and it will automatically be passed to the 30 | # find_for_authentication method and considered in your model lookup. For instance, 31 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. 32 | # The same considerations mentioned for authentication_keys also apply to request_keys. 33 | # config.request_keys = [] 34 | 35 | # Configure which authentication keys should be case-insensitive. 36 | # These keys will be downcased upon creating or modifying a user and when used 37 | # to authenticate or find a user. Default is :email. 38 | config.case_insensitive_keys = [ :email ] 39 | 40 | # Configure which authentication keys should have whitespace stripped. 41 | # These keys will have whitespace before and after removed upon creating or 42 | # modifying a user and when used to authenticate or find a user. Default is :email. 43 | config.strip_whitespace_keys = [ :email ] 44 | 45 | # Tell if authentication through request.params is enabled. True by default. 46 | # config.params_authenticatable = true 47 | 48 | # Tell if authentication through HTTP Basic Auth is enabled. False by default. 49 | # config.http_authenticatable = false 50 | 51 | # If http headers should be returned for AJAX requests. True by default. 52 | # config.http_authenticatable_on_xhr = true 53 | 54 | # The realm used in Http Basic Authentication. "Application" by default. 55 | # config.http_authentication_realm = "Application" 56 | 57 | # It will change confirmation, password recovery and other workflows 58 | # to behave the same regardless if the e-mail provided was right or wrong. 59 | # Does not affect registerable. 60 | # config.paranoid = true 61 | 62 | # ==> Configuration for :database_authenticatable 63 | # For bcrypt, this is the cost for hashing the password and defaults to 10. If 64 | # using other encryptors, it sets how many times you want the password re-encrypted. 65 | # 66 | # Limiting the stretches to just one in testing will increase the performance of 67 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use 68 | # a value less than 10 in other environments. 69 | config.stretches = Rails.env.test? ? 1 : 10 70 | 71 | # Setup a pepper to generate the encrypted password. 72 | # config.pepper = "a11a56fead9ec86c30c581730c2381886df0e760d291c44fcc07bc57c5c76ab478f45595904f737ee8607f315e74be2f3b8d4278236793a126b165ef5fcc7d5a" 73 | 74 | # ==> Configuration for :confirmable 75 | # A period that the user is allowed to access the website even without 76 | # confirming his account. For instance, if set to 2.days, the user will be 77 | # able to access the website for two days without confirming his account, 78 | # access will be blocked just in the third day. Default is 0.days, meaning 79 | # the user cannot access the website without confirming his account. 80 | # config.confirm_within = 2.days 81 | 82 | # Defines which key will be used when confirming an account 83 | # config.confirmation_keys = [ :email ] 84 | 85 | # ==> Configuration for :rememberable 86 | # The time the user will be remembered without asking for credentials again. 87 | # config.remember_for = 2.weeks 88 | 89 | # If true, a valid remember token can be re-used between multiple browsers. 90 | # config.remember_across_browsers = true 91 | 92 | # If true, extends the user's remember period when remembered via cookie. 93 | # config.extend_remember_period = false 94 | 95 | # If true, uses the password salt as remember token. This should be turned 96 | # to false if you are not using database authenticatable. 97 | config.use_salt_as_remember_token = true 98 | 99 | # Options to be passed to the created cookie. For instance, you can set 100 | # :secure => true in order to force SSL only cookies. 101 | # config.cookie_options = {} 102 | 103 | # ==> Configuration for :validatable 104 | # Range for password length. Default is 6..128. 105 | # config.password_length = 6..128 106 | 107 | # Email regex used to validate email formats. It simply asserts that 108 | # an one (and only one) @ exists in the given string. This is mainly 109 | # to give user feedback and not to assert the e-mail validity. 110 | # config.email_regexp = /\A[^@]+@[^@]+\z/ 111 | 112 | # ==> Configuration for :timeoutable 113 | # The time you want to timeout the user session without activity. After this 114 | # time the user will be asked for credentials again. Default is 30 minutes. 115 | # config.timeout_in = 30.minutes 116 | 117 | # ==> Configuration for :lockable 118 | # Defines which strategy will be used to lock an account. 119 | # :failed_attempts = Locks an account after a number of failed attempts to sign in. 120 | # :none = No lock strategy. You should handle locking by yourself. 121 | # config.lock_strategy = :failed_attempts 122 | 123 | # Defines which key will be used when locking and unlocking an account 124 | # config.unlock_keys = [ :email ] 125 | 126 | # Defines which strategy will be used to unlock an account. 127 | # :email = Sends an unlock link to the user email 128 | # :time = Re-enables login after a certain amount of time (see :unlock_in below) 129 | # :both = Enables both strategies 130 | # :none = No unlock strategy. You should handle unlocking by yourself. 131 | # config.unlock_strategy = :both 132 | 133 | # Number of authentication tries before locking an account if lock_strategy 134 | # is failed attempts. 135 | # config.maximum_attempts = 20 136 | 137 | # Time interval to unlock the account if :time is enabled as unlock_strategy. 138 | # config.unlock_in = 1.hour 139 | 140 | # ==> Configuration for :recoverable 141 | # 142 | # Defines which key will be used when recovering the password for an account 143 | # config.reset_password_keys = [ :email ] 144 | 145 | # Time interval you can reset your password with a reset password key. 146 | # Don't put a too small interval or your users won't have the time to 147 | # change their passwords. 148 | config.reset_password_within = 2.hours 149 | 150 | # ==> Configuration for :encryptable 151 | # Allow you to use another encryption algorithm besides bcrypt (default). You can use 152 | # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, 153 | # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) 154 | # and :restful_authentication_sha1 (then you should set stretches to 10, and copy 155 | # REST_AUTH_SITE_KEY to pepper) 156 | # config.encryptor = :sha512 157 | 158 | # ==> Configuration for :token_authenticatable 159 | # Defines name of the authentication token params key 160 | # config.token_authentication_key = :auth_token 161 | 162 | # If true, authentication through token does not store user in session and needs 163 | # to be supplied on each request. Useful if you are using the token as API token. 164 | # config.stateless_token = false 165 | 166 | # ==> Scopes configuration 167 | # Turn scoped views on. Before rendering "sessions/new", it will first check for 168 | # "users/sessions/new". It's turned off by default because it's slower if you 169 | # are using only default views. 170 | # config.scoped_views = false 171 | 172 | # Configure the default scope given to Warden. By default it's the first 173 | # devise role declared in your routes (usually :user). 174 | # config.default_scope = :user 175 | 176 | # Configure sign_out behavior. 177 | # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope). 178 | # The default is true, which means any logout action will sign out all active scopes. 179 | # config.sign_out_all_scopes = true 180 | 181 | # ==> Navigation configuration 182 | # Lists the formats that should be treated as navigational. Formats like 183 | # :html, should redirect to the sign in page when the user does not have 184 | # access, but formats like :xml or :json, should return 401. 185 | # 186 | # If you have any extra navigational formats, like :iphone or :mobile, you 187 | # should add them to the navigational formats lists. 188 | # 189 | # The :"*/*" and "*/*" formats below is required to match Internet 190 | # Explorer requests. 191 | # config.navigational_formats = [:"*/*", "*/*", :html] 192 | 193 | # The default HTTP method used to sign out a resource. Default is :delete. 194 | config.sign_out_via = :delete 195 | 196 | # ==> OmniAuth 197 | # Add a new OmniAuth provider. Check the wiki for more information on setting 198 | # up on your models and hooks. 199 | # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' 200 | 201 | # ==> Warden configuration 202 | # If you want to use other strategies, that are not supported by Devise, or 203 | # change the failure app, you can configure them inside the config.warden block. 204 | # 205 | # config.warden do |manager| 206 | # manager.failure_app = AnotherApp 207 | # manager.intercept_401 = false 208 | # manager.default_strategies(:scope => :user).unshift :some_external_strategy 209 | # end 210 | end 211 | -------------------------------------------------------------------------------- /app/assets/javascripts/zeroclipboard/ZeroClipboard.js: -------------------------------------------------------------------------------- 1 | // Simple Set Clipboard System 2 | // Author: Joseph Huckaby 3 | 4 | var ZeroClipboard = { 5 | 6 | version: "1.0.7", 7 | clients: {}, // registered upload clients on page, indexed by id 8 | moviePath: 'ZeroClipboard.swf', // URL to movie 9 | nextId: 1, // ID of next movie 10 | 11 | $: function(thingy) { 12 | // simple DOM lookup utility function 13 | if (typeof(thingy) == 'string') thingy = document.getElementById(thingy); 14 | if (!thingy.addClass) { 15 | // extend element with a few useful methods 16 | thingy.hide = function() { this.style.display = 'none'; }; 17 | thingy.show = function() { this.style.display = ''; }; 18 | thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; }; 19 | thingy.removeClass = function(name) { 20 | var classes = this.className.split(/\s+/); 21 | var idx = -1; 22 | for (var k = 0; k < classes.length; k++) { 23 | if (classes[k] == name) { idx = k; k = classes.length; } 24 | } 25 | if (idx > -1) { 26 | classes.splice( idx, 1 ); 27 | this.className = classes.join(' '); 28 | } 29 | return this; 30 | }; 31 | thingy.hasClass = function(name) { 32 | return !!this.className.match( new RegExp("\\s*" + name + "\\s*") ); 33 | }; 34 | } 35 | return thingy; 36 | }, 37 | 38 | setMoviePath: function(path) { 39 | // set path to ZeroClipboard.swf 40 | this.moviePath = path; 41 | }, 42 | 43 | dispatch: function(id, eventName, args) { 44 | // receive event from flash movie, send to client 45 | var client = this.clients[id]; 46 | if (client) { 47 | client.receiveEvent(eventName, args); 48 | } 49 | }, 50 | 51 | register: function(id, client) { 52 | // register new client to receive events 53 | this.clients[id] = client; 54 | }, 55 | 56 | getDOMObjectPosition: function(obj, stopObj) { 57 | // get absolute coordinates for dom element 58 | var info = { 59 | left: 0, 60 | top: 0, 61 | width: obj.width ? obj.width : obj.offsetWidth, 62 | height: obj.height ? obj.height : obj.offsetHeight 63 | }; 64 | 65 | while (obj && (obj != stopObj)) { 66 | info.left += obj.offsetLeft; 67 | info.top += obj.offsetTop; 68 | obj = obj.offsetParent; 69 | } 70 | 71 | return info; 72 | }, 73 | 74 | Client: function(elem) { 75 | // constructor for new simple upload client 76 | this.handlers = {}; 77 | 78 | // unique ID 79 | this.id = ZeroClipboard.nextId++; 80 | this.movieId = 'ZeroClipboardMovie_' + this.id; 81 | 82 | // register client with singleton to receive flash events 83 | ZeroClipboard.register(this.id, this); 84 | 85 | // create movie 86 | if (elem) this.glue(elem); 87 | } 88 | }; 89 | 90 | ZeroClipboard.Client.prototype = { 91 | 92 | id: 0, // unique ID for us 93 | ready: false, // whether movie is ready to receive events or not 94 | movie: null, // reference to movie object 95 | clipText: '', // text to copy to clipboard 96 | handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor 97 | cssEffects: true, // enable CSS mouse effects on dom container 98 | handlers: null, // user event handlers 99 | 100 | glue: function(elem, appendElem, stylesToAdd) { 101 | // glue to DOM element 102 | // elem can be ID or actual DOM element object 103 | this.domElement = ZeroClipboard.$(elem); 104 | 105 | // float just above object, or zIndex 99 if dom element isn't set 106 | var zIndex = 99; 107 | if (this.domElement.style.zIndex) { 108 | zIndex = parseInt(this.domElement.style.zIndex, 10) + 1; 109 | } 110 | 111 | if (typeof(appendElem) == 'string') { 112 | appendElem = ZeroClipboard.$(appendElem); 113 | } 114 | else if (typeof(appendElem) == 'undefined') { 115 | appendElem = document.getElementsByTagName('body')[0]; 116 | } 117 | 118 | // find X/Y position of domElement 119 | var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem); 120 | 121 | // create floating DIV above element 122 | this.div = document.createElement('div'); 123 | var style = this.div.style; 124 | style.position = 'absolute'; 125 | style.left = '' + box.left + 'px'; 126 | style.top = '' + box.top + 'px'; 127 | style.width = '' + box.width + 'px'; 128 | style.height = '' + box.height + 'px'; 129 | style.zIndex = zIndex; 130 | 131 | if (typeof(stylesToAdd) == 'object') { 132 | for (addedStyle in stylesToAdd) { 133 | style[addedStyle] = stylesToAdd[addedStyle]; 134 | } 135 | } 136 | 137 | // style.backgroundColor = '#f00'; // debug 138 | 139 | appendElem.appendChild(this.div); 140 | 141 | this.div.innerHTML = this.getHTML( box.width, box.height ); 142 | }, 143 | 144 | getHTML: function(width, height) { 145 | // return HTML for movie 146 | var html = ''; 147 | var flashvars = 'id=' + this.id + 148 | '&width=' + width + 149 | '&height=' + height; 150 | 151 | if (navigator.userAgent.match(/MSIE/)) { 152 | // IE gets an OBJECT tag 153 | var protocol = location.href.match(/^https/i) ? 'https://' : 'http://'; 154 | html += ''; 155 | } 156 | else { 157 | // all other browsers get an EMBED tag 158 | html += ''; 159 | } 160 | return html; 161 | }, 162 | 163 | hide: function() { 164 | // temporarily hide floater offscreen 165 | if (this.div) { 166 | this.div.style.left = '-2000px'; 167 | } 168 | }, 169 | 170 | show: function() { 171 | // show ourselves after a call to hide() 172 | this.reposition(); 173 | }, 174 | 175 | destroy: function() { 176 | // destroy control and floater 177 | if (this.domElement && this.div) { 178 | this.hide(); 179 | this.div.innerHTML = ''; 180 | 181 | var body = document.getElementsByTagName('body')[0]; 182 | try { body.removeChild( this.div ); } catch(e) {;} 183 | 184 | this.domElement = null; 185 | this.div = null; 186 | } 187 | }, 188 | 189 | reposition: function(elem) { 190 | // reposition our floating div, optionally to new container 191 | // warning: container CANNOT change size, only position 192 | if (elem) { 193 | this.domElement = ZeroClipboard.$(elem); 194 | if (!this.domElement) this.hide(); 195 | } 196 | 197 | if (this.domElement && this.div) { 198 | var box = ZeroClipboard.getDOMObjectPosition(this.domElement); 199 | var style = this.div.style; 200 | style.left = '' + box.left + 'px'; 201 | style.top = '' + box.top + 'px'; 202 | } 203 | }, 204 | 205 | setText: function(newText) { 206 | // set text to be copied to clipboard 207 | this.clipText = newText; 208 | if (this.ready) this.movie.setText(newText); 209 | }, 210 | 211 | addEventListener: function(eventName, func) { 212 | // add user event listener for event 213 | // event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel 214 | eventName = eventName.toString().toLowerCase().replace(/^on/, ''); 215 | if (!this.handlers[eventName]) this.handlers[eventName] = []; 216 | this.handlers[eventName].push(func); 217 | }, 218 | 219 | setHandCursor: function(enabled) { 220 | // enable hand cursor (true), or default arrow cursor (false) 221 | this.handCursorEnabled = enabled; 222 | if (this.ready) this.movie.setHandCursor(enabled); 223 | }, 224 | 225 | setCSSEffects: function(enabled) { 226 | // enable or disable CSS effects on DOM container 227 | this.cssEffects = !!enabled; 228 | }, 229 | 230 | receiveEvent: function(eventName, args) { 231 | // receive event from flash 232 | eventName = eventName.toString().toLowerCase().replace(/^on/, ''); 233 | 234 | // special behavior for certain events 235 | switch (eventName) { 236 | case 'load': 237 | // movie claims it is ready, but in IE this isn't always the case... 238 | // bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function 239 | this.movie = document.getElementById(this.movieId); 240 | if (!this.movie) { 241 | var self = this; 242 | setTimeout( function() { self.receiveEvent('load', null); }, 1 ); 243 | return; 244 | } 245 | 246 | // firefox on pc needs a "kick" in order to set these in certain cases 247 | if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) { 248 | var self = this; 249 | setTimeout( function() { self.receiveEvent('load', null); }, 100 ); 250 | this.ready = true; 251 | return; 252 | } 253 | 254 | this.ready = true; 255 | this.movie.setText( this.clipText ); 256 | this.movie.setHandCursor( this.handCursorEnabled ); 257 | break; 258 | 259 | case 'mouseover': 260 | if (this.domElement && this.cssEffects) { 261 | this.domElement.addClass('hover'); 262 | if (this.recoverActive) this.domElement.addClass('active'); 263 | } 264 | break; 265 | 266 | case 'mouseout': 267 | if (this.domElement && this.cssEffects) { 268 | this.recoverActive = false; 269 | if (this.domElement.hasClass('active')) { 270 | this.domElement.removeClass('active'); 271 | this.recoverActive = true; 272 | } 273 | this.domElement.removeClass('hover'); 274 | } 275 | break; 276 | 277 | case 'mousedown': 278 | if (this.domElement && this.cssEffects) { 279 | this.domElement.addClass('active'); 280 | } 281 | break; 282 | 283 | case 'mouseup': 284 | if (this.domElement && this.cssEffects) { 285 | this.domElement.removeClass('active'); 286 | this.recoverActive = false; 287 | } 288 | break; 289 | } // switch eventName 290 | 291 | if (this.handlers[eventName]) { 292 | for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) { 293 | var func = this.handlers[eventName][idx]; 294 | 295 | if (typeof(func) == 'function') { 296 | // actual function reference 297 | func(this, args); 298 | } 299 | else if ((typeof(func) == 'object') && (func.length == 2)) { 300 | // PHP style object + method, i.e. [myObject, 'myMethod'] 301 | func[0][ func[1] ](this, args); 302 | } 303 | else if (typeof(func) == 'string') { 304 | // name of function 305 | window[func](this, args); 306 | } 307 | } // foreach event handler defined 308 | } // user defined handler for event 309 | } 310 | 311 | }; 312 | -------------------------------------------------------------------------------- /app/assets/stylesheets/screen.sass: -------------------------------------------------------------------------------- 1 | @import "vars", "mixins" 2 | 3 | * 4 | outline: none 5 | -webkit-text-size-adjust: 100% 6 | -webkit-appearance: none 7 | 8 | ::selection 9 | color: rgba(255, 255, 255, .85) 10 | background: #f36f21 11 | 12 | ul li 13 | list-style: none 14 | 15 | img 16 | border: none 17 | color: transparent 18 | text-decoration: none 19 | 20 | a 21 | color: #2D76B9 22 | cursor: pointer 23 | text-decoration: none 24 | &:hover 25 | text-decoration: underline 26 | img 27 | text-decoration: none 28 | &:focus 29 | outline: 1px dotted 30 | 31 | html 32 | -webkit-font-smoothing: antialiased 33 | 34 | body 35 | background: white0 36 | color: #666666 37 | font: 12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif 38 | margin: 0 39 | 40 | h1, h2 41 | font-size: 13px 42 | border-bottom: 2px solid #cccccc 43 | padding: 0 0 7px 44 | margin: 0 0 10px 45 | @include box-shadow(0 1px 0 rgba(255,255,255,1)) 46 | span 47 | font-weight: normal 48 | 49 | ul + h2, div + h2, img + h2, form + h2 50 | padding-top: 30px 51 | 52 | 53 | //containers 54 | 55 | #header 56 | height: 45px 57 | background: rgb(246,133,32) 58 | background: -moz-linear-gradient(top, rgba(246,133,32,1) 0%, rgba(240,91,34,1) 100%) 59 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(246,133,32,1)), color-stop(100%,rgba(240,91,34,1))) 60 | background: -webkit-linear-gradient(top, rgba(246,133,32,1) 0%,rgba(240,91,34,1) 100%) 61 | background: -o-linear-gradient(top, rgba(246,133,32,1) 0%,rgba(240,91,34,1) 100%) 62 | background: -ms-linear-gradient(top, rgba(246,133,32,1) 0%,rgba(240,91,34,1) 100%) 63 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f68520', endColorstr='#f05b22',GradientType=0 ) 64 | background: linear-gradient(top, rgba(246,133,32,1) 0%,rgba(240,91,34,1) 100%) 65 | @include box-shadow(0 -1px 0 #c22d0c inset) 66 | border-bottom: 1px solid #cccccc 67 | overflow: hidden 68 | header 69 | width: 940px 70 | margin: auto 71 | display: block 72 | overflow: hidden 73 | .logo 74 | margin: 10px 0 0 75 | display: block 76 | float: left 77 | &:hover 78 | opacity: 0.8 79 | #new-post 80 | float: left 81 | padding: 9px 0 0 3px 82 | position: relative 83 | &:hover 84 | span 85 | display: block 86 | a 87 | display: block 88 | text-indent: -99999px 89 | height: 28px 90 | width: 29px 91 | background: url(../assets/button-post.png) no-repeat 0 0 92 | span 93 | color: white 94 | display: none 95 | font-weight: bold 96 | white-space: nowrap 97 | position: absolute 98 | top: 10px 99 | left: 34px 100 | height: 25px 101 | line-height: 24px 102 | padding: 0 10px 0 14px 103 | @include border-radius(0 2px 2px 0) 104 | background: url(../assets/background-tips.png) no-repeat 0 0 105 | nav 106 | ul 107 | margin: 10px 0 0 108 | padding: 0 109 | float: left 110 | li 111 | display: inline 112 | border-left: 1px solid #de5418 113 | padding: 0 8px 0 10px 114 | color: white 115 | font-weight: bold 116 | height: 25px 117 | line-height: 24px 118 | &:first-child 119 | padding-left: 20px 120 | border: 0 121 | a 122 | color: white 123 | text-shadow: 0 -1px 0 rgba(194,45,12,0.37) 124 | &:hover, &.current 125 | text-decoration: none 126 | border-bottom: 2px solid white 127 | 128 | .session-link 129 | margin: 10px 0 0 130 | display: block 131 | color: white 132 | height: 25px 133 | line-height: 24px 134 | float: right 135 | text-shadow: 0 -1px 0 rgba(194,45,12,0.37) 136 | font-size: 11px 137 | strong 138 | font-size: 12px 139 | 140 | #sign_in, div#new_medium 141 | width: 300px 142 | margin: auto 143 | padding: 30px 0 60px 144 | a 145 | text-align: center 146 | display: block 147 | 148 | #wrap 149 | background: url(../assets/background-body.gif) repeat 0 0 150 | padding: 30px 0 30px 151 | #wrap-inner 152 | width: 940px 153 | margin: auto 154 | overflow: hidden 155 | 156 | #footer 157 | border-top: 1px solid #e3e3e3 158 | padding: 26px 0 50px 159 | overflow: hidden 160 | #footer-inner 161 | width: 940px 162 | margin: auto 163 | position: relative 164 | .stats 165 | position: absolute 166 | left: 0 167 | top: -4px 168 | background: url(../assets/background-footer-stats.gif) no-repeat 0 0 169 | min-height: 42px 170 | padding: 0 0 0 46px 171 | strong 172 | display: block 173 | color: #333333 174 | font-size: 24px 175 | line-height: 26px 176 | small 177 | font-size: 12px 178 | p 179 | float: right 180 | display: block 181 | color: #999999 182 | margin: 8px 0 0 183 | ul 184 | float: right 185 | margin: 0 186 | li 187 | display: inline 188 | border-left: 1px solid #cacaca 189 | padding: 0 8px 0 10px 190 | &:first-child 191 | border: 0 192 | &:last-child 193 | padding-right: 0 194 | a 195 | font-weight: bold 196 | color: #666666 197 | 198 | #main 199 | width: 700px 200 | float: left 201 | 202 | #misc 203 | width: 220px 204 | float: right 205 | p 206 | line-height: 15px 207 | h1 208 | color: #333 209 | border: 0 210 | @include box-shadow(0 0 0 rgba(0,0,0,0)) 211 | font-size: 20px 212 | padding: 0 213 | margin: 0 214 | + small 215 | color: #999999 216 | font-size: 11px 217 | 218 | // Contents 219 | 220 | ul.items 221 | margin: 0 222 | padding: 0 223 | width: 720px 224 | overflow: hidden 225 | li 226 | padding: 6px 227 | background: white url(../assets/background-thumb.gif) no-repeat 6px 6px 228 | border: 1px solid rgba(0,0,0,0.20) 229 | display: block 230 | float: left 231 | width: 206px 232 | height: 132px 233 | margin: 0 20px 20px 0 234 | position: relative 235 | a 236 | position: absolute 237 | top: 6px 238 | left: 6px 239 | padding: 12px 14px 240 | width: 178px 241 | height: 108px 242 | background: rgba(255,255,255,0.93) 243 | opacity: 0 244 | text-decoration: none 245 | -webkit-transition: opacity 0.2s linear 246 | -moz-transition: opacity 0.2s ease-in-out 247 | &:hover 248 | opacity: 1 249 | strong 250 | font-size: 14px 251 | color: #333 252 | p 253 | margin: 6px 0 0 254 | color: #666 255 | line-height: 15px 256 | small 257 | font-size: 11px 258 | color: #999 259 | position: absolute 260 | left: 14px 261 | bottom: 10px 262 | img 263 | display: block 264 | 265 | ul.tags 266 | overflow: hidden 267 | margin: 0 268 | padding: 0 269 | li 270 | a 271 | margin: 0 2px 2px 0 272 | background: url(/assets/background-tags.png) no-repeat 0 0 273 | color: white 274 | font-weight: bold 275 | @include border-radius(0 3px 3px 0) 276 | height: 23px 277 | line-height: 23px 278 | display: block 279 | float: left 280 | padding: 0 8px 0 18px 281 | &:hover 282 | text-decoration: none 283 | opacity: 0.8 284 | 285 | .thumb-display 286 | padding: 6px 287 | border: 1px solid rgba(0,0,0,0.20) 288 | display: block 289 | width: 686px 290 | margin: 0 20px 20px 0 291 | background: white 292 | div 293 | background: url(../assets/background-thumb-original.gif) repeat 0 0 294 | img 295 | display: block 296 | margin: auto 297 | max-width: 686px 298 | 299 | #pagination 300 | border-top: 2px solid #cccccc 301 | @include box-shadow(0 1px 0 rgba(255,255,255,1) inset) 302 | padding: 10px 0 1px 303 | text-align: center 304 | a 305 | cursor: pointer 306 | color: #666666 307 | padding: 8px 12px 308 | line-height: 34px 309 | font-weight: bold 310 | border: 1px solid rgba(0,0,0,0.16) 311 | background: #f4f4f4 312 | background: -moz-linear-gradient(top, #f4f4f4 0%, #f4f4f4 49%, #eaeaea 50%, #eaeaea 100%) 313 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f4f4f4), color-stop(49%,#f4f4f4), color-stop(50%,#eaeaea), color-stop(100%,#eaeaea)) 314 | background: -webkit-linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 315 | background: -o-linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 316 | background: -ms-linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 317 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eaeaea',GradientType=0 ) 318 | background: linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 319 | text-shadow: 0 1px 0 rgba(255,255,255,1) 320 | @include border-radius(3px) 321 | &:hover 322 | color: white 323 | border-color: #c22d0c 324 | background: #f36f21 325 | background: -moz-linear-gradient(top, #f36f21 0%, #f36f21 49%, #f05c22 50%, #f05c22 100%) 326 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f36f21), color-stop(49%,#f36f21), color-stop(50%,#f05c22), color-stop(100%,#f05c22)) 327 | background: -webkit-linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 328 | background: -o-linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 329 | background: -ms-linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 330 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f36f21', endColorstr='#f05c22',GradientType=0 ) 331 | background: linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 332 | text-shadow: 0 -1px 0 #c22d0c 333 | text-decoration: none 334 | 335 | .newsletter 336 | p 337 | margin-bottom: 4px 338 | 339 | .more-pagination 340 | overflow: hidden 341 | border-bottom: 1px solid #dbdbdb 342 | padding: 0 0 5px 343 | .empty 344 | background-color: #e5e5e5 345 | border: 1px solid transparent 346 | div 347 | padding: 4px 348 | background: white 349 | border: 1px solid rgba(0,0,0,0.20) 350 | display: block 351 | float: left 352 | width: 100px 353 | height: 64px 354 | position: relative 355 | a:hover span 356 | position: absolute 357 | top: 4px 358 | left: 4px 359 | width: 100px 360 | height: 64px 361 | display: block 362 | opacity: 0.9 363 | background: url(../assets/background-pagination-more.png) no-repeat 0 0 364 | &.prev a:hover span 365 | background-position: 0 -64px 366 | 367 | .social 368 | overflow: hidden 369 | padding: 10px 0 5px 370 | border-bottom: 1px solid #dbdbdb 371 | margin: 0 0 5px 372 | a 373 | width: 71px 374 | height: 28px 375 | line-height: 28px 376 | display: inline 377 | color: white 378 | font-weight: bold 379 | display: block 380 | float: left 381 | padding: 0 0 0 38px 382 | background: url(../assets/icon-share.png) no-repeat 0 0 383 | &.facebook 384 | background-position: 0 -28px 385 | margin: 0 0 0 2px 386 | &:hover 387 | opacity: 0.8 388 | text-decoration: none 389 | 390 | p.about 391 | font-size: 28px 392 | line-height: 36px 393 | font-weight: 300 394 | 395 | ul.team 396 | padding: 0 397 | margin: 0 398 | width: 222px 399 | overflow: hidden 400 | li 401 | float: left 402 | margin: 0 2px 0 0 403 | &:hover 404 | opacity: 0.8 405 | img 406 | display: block 407 | 408 | a.shuffle 409 | cursor: pointer 410 | color: #666666 411 | text-align: center 412 | display: block 413 | height: 28px 414 | margin: 5px 0 0 415 | line-height: 28px 416 | font-weight: bold 417 | border: 1px solid rgba(0,0,0,0.16) 418 | background: #f4f4f4 419 | background: -moz-linear-gradient(top, #f4f4f4 0%, #f4f4f4 49%, #eaeaea 50%, #eaeaea 100%) 420 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f4f4f4), color-stop(49%,#f4f4f4), color-stop(50%,#eaeaea), color-stop(100%,#eaeaea)) 421 | background: -webkit-linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 422 | background: -o-linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 423 | background: -ms-linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 424 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eaeaea',GradientType=0 ) 425 | background: linear-gradient(top, #f4f4f4 0%,#f4f4f4 49%,#eaeaea 50%,#eaeaea 100%) 426 | text-shadow: 0 1px 0 rgba(255,255,255,1) 427 | @include border-radius(3px) 428 | &:hover, &.positive 429 | color: white 430 | border-color: #c22d0c 431 | background: #f36f21 432 | background: -moz-linear-gradient(top, #f36f21 0%, #f36f21 49%, #f05c22 50%, #f05c22 100%) 433 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f36f21), color-stop(49%,#f36f21), color-stop(50%,#f05c22), color-stop(100%,#f05c22)) 434 | background: -webkit-linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 435 | background: -o-linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 436 | background: -ms-linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 437 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f36f21', endColorstr='#f05c22',GradientType=0 ) 438 | background: linear-gradient(top, #f36f21 0%,#f36f21 49%,#f05c22 50%,#f05c22 100%) 439 | text-shadow: 0 -1px 0 #c22d0c 440 | text-decoration: none 441 | 442 | #no-result 443 | font-size: 15px 444 | line-height: 20px 445 | position: relative 446 | padding: 0 0 0 144px 447 | img 448 | position: absolute 449 | top: 0 450 | left: 0 451 | ul 452 | padding: 0 0 0 20px 453 | li 454 | list-style: disc 455 | 456 | 457 | // Flashs 458 | .flash 459 | width: 400px 460 | background: white 461 | margin: auto 462 | position: absolute 463 | top: 46px 464 | left: 50% 465 | margin-left: -200px 466 | padding: 10px 0 467 | font-weiht: bold 468 | text-align: center 469 | @include border-radius(0 0 5px 5px) 470 | border: 3px solid rgba(0,0,0,0.12) 471 | border-top: 0 472 | 473 | // Error 474 | #error-inner 475 | background: transparent 476 | width: 600px 477 | padding: 0 478 | height: 230px 479 | display: block 480 | left: 50% 481 | margin-left: -300px 482 | margin-top: -115px 483 | position: absolute 484 | top: 50% 485 | z-index: 99999999 486 | text-align: center 487 | h1 488 | color: #3a2b24 489 | font-size: 26px 490 | border: 0 491 | @include box-shadow(0 0 0 white) 492 | font-weight: normal 493 | margin: 0 494 | h2 495 | border: none 496 | box-shadow: none 497 | -webkit-box-shadow: none 498 | img 499 | display: block 500 | margin: 20px auto 501 | p 502 | color: #65544b 503 | font-size: 17px 504 | margin: 0 505 | a 506 | color: #382e29 507 | border-bottom: 1px solid #f16222 508 | &:hover 509 | text-decoration: none 510 | border-color: #382e29 511 | 512 | #overlay-error 513 | background: transparent url(../assets/background-overlay.png) repeat 514 | width: 100% 515 | height: 100% 516 | display: block 517 | position: fixed 518 | z-index: 1 519 | opacity: 0.8 520 | 521 | #error-img 522 | position: fixed 523 | top: -50% 524 | left: -50% 525 | width: 200% 526 | height: 200% 527 | img 528 | position: absolute 529 | top: 0 530 | left: 0 531 | right: 0 532 | bottom: 0 533 | margin: auto 534 | min-width: 50% 535 | min-height: 50% 536 | 537 | #fullscreen 538 | #toolbar 539 | &:after 540 | content: "." 541 | display: block 542 | height: 0 543 | clear: both 544 | visibility: hidden 545 | background: black 546 | border-top: 1px solid #999 547 | padding: 3px 0px 5px 0px 548 | position: fixed 549 | bottom: 0 550 | width: 100% 551 | div 552 | float: right 553 | &.icon 554 | float: left 555 | a 556 | background: url(/images/favicon.png) 557 | display: block 558 | width: 16px 559 | height: 16px 560 | margin: 6px 10px 7px 15px 561 | text-indent: -1000px 562 | overflow: hidden 563 | 564 | p 565 | margin: 4px 0 0 0 566 | float: left 567 | a 568 | color: white 569 | .paste 570 | margin: 7px 10px 7px 20px 571 | text-indent: -1000px 572 | overflow: hidden 573 | background: url(/images/paste.gif) 574 | display: block 575 | width: 16px 576 | height: 16px 577 | form 578 | margin: 3px 0 0 3px 579 | input[type=text] 580 | width: 400px 581 | padding: 5px 582 | margin-left: 10px 583 | background-color: #ddd 584 | input[type=submit] 585 | padding: 4px 5px 5px 586 | float: left 587 | 588 | .message 589 | width: 80% 590 | height: 100% 591 | text-align: center 592 | display: table-cell 593 | vertical-align: middle 594 | margin: auto 595 | font-size: 10em 596 | font-weight: bold 597 | color: white 598 | text-shadow: -3px 0 black, 0 3px black, 3px 0 black, 0 -3px black 599 | letter-spacing: 10px --------------------------------------------------------------------------------