diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e55074aa..00000000 --- a/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. -# -# If you find yourself ignoring temporary files generated by your text editor -# or operating system, you probably want to add a global ignore instead: -# git config --global core.excludesfile '~/.gitignore_global' - -# Ignore bundler config. -/.bundle - -# Ignore the default SQLite database. -/db/*.sqlite3 -/db/*.sqlite3-journal - -# Ignore all logfiles and tempfiles. -/log/*.log -/tmp - -/config/database.yml -/config/config.yml - -/public/assets -.ruby-version -.rspec - -coverage - -/db/seeds.rb diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c31607c3..00000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: ruby - -rvm: - - 2.0.0 - -bundler_args: --without development - -before_script: - - cp config/config.yml.sample config/config.yml - - cp config/database.yml.sample config/database.yml - -script: - - bundle exec rake spec - - bundle exec rake cucumber diff --git a/Capfile b/Capfile deleted file mode 100644 index 3a9dac77..00000000 --- a/Capfile +++ /dev/null @@ -1,26 +0,0 @@ -# Load DSL and Setup Up Stages -require 'capistrano/setup' - -# Includes default deployment tasks -require 'capistrano/deploy' - -# Includes tasks from other gems included in your Gemfile -# -# For documentation on these, see for example: -# -# https://github.com/capistrano/rvm -# https://github.com/capistrano/rbenv -# https://github.com/capistrano/chruby -# https://github.com/capistrano/bundler -# https://github.com/capistrano/rails/tree/master/assets -# https://github.com/capistrano/rails/tree/master/migrations -# -require 'capistrano/rvm' -# require 'capistrano/rbenv' -# require 'capistrano/chruby' -require 'capistrano/bundler' -require 'capistrano/rails/assets' -require 'capistrano/rails/migrations' - -# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. -Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 0108e6d9..00000000 --- a/Gemfile +++ /dev/null @@ -1,58 +0,0 @@ -source 'https://rubygems.org' - -ruby '2.0.0' - -gem 'rails', '4.0.2' -gem 'mysql2', group: :production -gem 'sass-rails', '~> 4.0.0' -gem 'haml-rails', '~> 0.5.3' -gem 'less-rails', '~> 2.4.2' -gem 'kaminari', '~> 0.15.0' -gem 'uglifier', '>= 1.3.0' -gem 'coffee-rails', '~> 4.0.0' -gem 'therubyracer', '~> 0.12.0', platforms: :ruby -gem 'jquery-rails', '~> 3.0.4' -gem 'turbolinks', '~> 2.2.0' -gem 'jquery-turbolinks' -gem 'jbuilder', '~> 1.5.3' -gem 'airbrake', '~> 3.1.15' -gem 'devise', '~> 3.2.2' -gem 'omniauth', '~> 1.1.4' -gem 'omniauth-github', github: 'alexandrz/omniauth-github', branch: 'provide_emails' -gem 'octokit', '~> 2.7.0' -gem 'sawyer', '~> 0.5.2' -gem 'twitter_bootstrap_form_for', github: 'stouset/twitter_bootstrap_form_for' -gem 'twitter-bootstrap-rails', github: 'seyhunak/twitter-bootstrap-rails', branch: 'bootstrap3' -gem 'bootstrap_form', github: 'sigmike/rails-bootstrap-forms', branch: 'removed_for_on_radio_label' -gem 'sdoc', group: :doc, require: false -gem 'cancancan' -gem 'dusen' -gem 'render_csv' -gem 'demoji' - -gem "http_accept_language" -gem 'rails-i18n' -gem "i18n-js" -gem 'kaminari-i18n' -gem 'devise-i18n' - -group :development do - gem 'capistrano', '~> 3.0.1' - gem 'capistrano-rvm', '~> 0.1.0', github: 'capistrano/rvm' - gem 'capistrano-bundler', '>= 1.1.0' - gem 'capistrano-rails', '~> 1.1.0' - gem 'debugger', '~> 1.6.5' -end - -group :development, :test do - gem 'sqlite3', '~> 1.3.8' - gem 'factory_girl_rails', '~> 4.3.0' - gem 'rspec-rails', '~> 3.0.0.beta' -end - -group :test do - gem 'simplecov' - gem 'shoulda-matchers', '~> 2.5.0' - gem 'cucumber-rails', require: false - gem 'database_cleaner' -end diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index d9dcf137..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,363 +0,0 @@ -GIT - remote: git://github.com/alexandrz/omniauth-github.git - revision: 37a030aa37659831ef80af21b5c7270fe1384b3c - branch: provide_emails - specs: - omniauth-github (1.1.0) - omniauth (~> 1.0) - omniauth-oauth2 (~> 1.1) - -GIT - remote: git://github.com/capistrano/rvm.git - revision: 19e8d15ae3d705499c610370f159d523bbedbd94 - specs: - capistrano-rvm (0.1.0) - capistrano (~> 3.0) - sshkit (~> 1.2) - -GIT - remote: git://github.com/seyhunak/twitter-bootstrap-rails.git - revision: 4d0bd4271f7f01d79bbb2b72c04f30a5766db0ef - branch: bootstrap3 - specs: - twitter-bootstrap-rails (2.2.7) - actionpack (>= 3.1) - execjs - rails (>= 3.1) - railties (>= 3.1) - -GIT - remote: git://github.com/sigmike/rails-bootstrap-forms.git - revision: a1c8420ab999df56b13d3de8a097528b77a02217 - branch: removed_for_on_radio_label - specs: - bootstrap_form (2.0.1) - -GIT - remote: git://github.com/stouset/twitter_bootstrap_form_for.git - revision: 830dbfd439ebb1194e1ae025100fc0e790be37cf - specs: - twitter_bootstrap_form_for (2.0.0.beta) - actionpack (~> 4) - railties (~> 4) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.0.2) - actionpack (= 4.0.2) - mail (~> 2.5.4) - actionpack (4.0.2) - activesupport (= 4.0.2) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - activemodel (4.0.2) - activesupport (= 4.0.2) - builder (~> 3.1.0) - activerecord (4.0.2) - activemodel (= 4.0.2) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.2) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.2) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - addressable (2.3.5) - airbrake (3.1.15) - builder - multi_json - arel (4.0.1) - atomic (1.1.14) - bcrypt-ruby (3.1.2) - builder (3.1.4) - cancancan (1.7.1) - capistrano (3.0.1) - i18n - rake (>= 10.0.0) - sshkit (>= 0.0.23) - capistrano-bundler (1.1.1) - capistrano (~> 3.0) - sshkit (>= 1.2.0) - capistrano-rails (1.1.0) - capistrano (>= 3.0.0) - capistrano-bundler (>= 1.0.0) - capybara (2.2.1) - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - coffee-rails (4.0.1) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.0) - coffee-script (2.2.0) - coffee-script-source - execjs - coffee-script-source (1.6.3) - columnize (0.8.9) - commonjs (0.2.7) - cucumber (1.3.14) - builder (>= 2.1.2) - diff-lcs (>= 1.1.3) - gherkin (~> 2.12) - multi_json (>= 1.7.5, < 2.0) - multi_test (>= 0.1.1) - cucumber-rails (1.4.0) - capybara (>= 1.1.2) - cucumber (>= 1.2.0) - nokogiri (>= 1.5.0) - rails (>= 3.0.0) - database_cleaner (1.2.0) - debugger (1.6.8) - columnize (>= 0.3.1) - debugger-linecache (~> 1.2.0) - debugger-ruby_core_source (~> 1.3.5) - debugger-linecache (1.2.0) - debugger-ruby_core_source (1.3.5) - demoji (0.0.5) - devise (3.2.2) - bcrypt-ruby (~> 3.0) - orm_adapter (~> 0.1) - railties (>= 3.2.6, < 5) - thread_safe (~> 0.1) - warden (~> 1.2.3) - devise-i18n (0.11.0) - diff-lcs (1.2.5) - dusen (0.4.10) - activerecord - edge_rider (>= 0.2.5) - edge_rider (0.3.0) - activerecord - erubis (2.7.0) - execjs (2.0.2) - factory_girl (4.3.0) - activesupport (>= 3.0.0) - factory_girl_rails (4.3.0) - factory_girl (~> 4.3.0) - railties (>= 3.0.0) - faraday (0.8.9) - multipart-post (~> 1.2.0) - gherkin (2.12.2) - multi_json (~> 1.3) - haml (4.0.5) - tilt - haml-rails (0.5.3) - actionpack (>= 4.0.1) - activesupport (>= 4.0.1) - haml (>= 3.1, < 5.0) - railties (>= 4.0.1) - hashie (2.0.5) - hike (1.2.3) - http_accept_language (2.0.2) - httpauth (0.2.1) - i18n (0.6.9) - i18n-js (2.1.2) - i18n - jbuilder (1.5.3) - activesupport (>= 3.0.0) - multi_json (>= 1.2.0) - jquery-rails (3.0.4) - railties (>= 3.0, < 5.0) - thor (>= 0.14, < 2.0) - jquery-turbolinks (2.0.1) - railties (>= 3.1.0) - turbolinks - json (1.8.1) - jwt (0.1.11) - multi_json (>= 1.5) - kaminari (0.15.0) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) - kaminari-i18n (0.2.0) - kaminari - rails - less (2.4.0) - commonjs (~> 0.2.7) - less-rails (2.4.2) - actionpack (>= 3.1) - less (~> 2.4.0) - libv8 (3.16.14.3) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.25.1) - mini_portile (0.5.3) - minitest (4.7.5) - multi_json (1.8.4) - multi_test (0.1.1) - multipart-post (1.2.0) - mysql2 (0.3.14) - net-scp (1.1.2) - net-ssh (>= 2.6.5) - net-ssh (2.7.0) - nokogiri (1.6.1) - mini_portile (~> 0.5.0) - oauth2 (0.8.1) - faraday (~> 0.8) - httpauth (~> 0.1) - jwt (~> 0.1.4) - multi_json (~> 1.0) - rack (~> 1.2) - octokit (2.7.0) - sawyer (~> 0.5.2) - omniauth (1.1.4) - hashie (>= 1.2, < 3) - rack - omniauth-oauth2 (1.1.1) - oauth2 (~> 0.8.0) - omniauth (~> 1.0) - orm_adapter (0.5.0) - polyglot (0.3.3) - rack (1.5.2) - rack-test (0.6.2) - rack (>= 1.0) - rails (4.0.2) - actionmailer (= 4.0.2) - actionpack (= 4.0.2) - activerecord (= 4.0.2) - activesupport (= 4.0.2) - bundler (>= 1.3.0, < 2.0) - railties (= 4.0.2) - sprockets-rails (~> 2.0.0) - rails-i18n (4.0.3) - i18n (~> 0.6) - railties (~> 4.0) - railties (4.0.2) - actionpack (= 4.0.2) - activesupport (= 4.0.2) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.1.1) - rdoc (4.1.1) - json (~> 1.4) - ref (1.0.5) - render_csv (2.0.0) - rails (>= 3.0) - rspec-collection_matchers (0.0.2) - rspec-expectations (>= 2.99.0.beta1) - rspec-core (3.0.0.beta1) - rspec-support (= 3.0.0.beta1) - rspec-expectations (3.0.0.beta1) - diff-lcs (>= 1.1.3, < 2.0) - rspec-support (= 3.0.0.beta1) - rspec-mocks (3.0.0.beta1) - rspec-support (= 3.0.0.beta1) - rspec-rails (3.0.0.beta1) - actionpack (>= 3.0) - activemodel (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-collection_matchers - rspec-core (= 3.0.0.beta1) - rspec-expectations (= 3.0.0.beta1) - rspec-mocks (= 3.0.0.beta1) - rspec-support (3.0.0.beta1) - sass (3.2.13) - sass-rails (4.0.1) - railties (>= 4.0.0, < 5.0) - sass (>= 3.1.10) - sprockets-rails (~> 2.0.0) - sawyer (0.5.2) - addressable (~> 2.3.5) - faraday (~> 0.8, < 0.10) - sdoc (0.4.0) - json (~> 1.8) - rdoc (~> 4.0, < 5.0) - shoulda-matchers (2.5.0) - activesupport (>= 3.0.0) - simplecov (0.7.1) - multi_json (~> 1.0) - simplecov-html (~> 0.7.1) - simplecov-html (0.7.1) - sprockets (2.10.1) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.1) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (~> 2.8) - sqlite3 (1.3.8) - sshkit (1.3.0) - net-scp (>= 1.1.2) - net-ssh - term-ansicolor - term-ansicolor (1.2.2) - tins (~> 0.8) - therubyracer (0.12.0) - libv8 (~> 3.16.14.0) - ref - thor (0.18.1) - thread_safe (0.1.3) - atomic - tilt (1.4.1) - tins (0.13.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - turbolinks (2.2.0) - coffee-rails - tzinfo (0.3.38) - uglifier (2.4.0) - execjs (>= 0.3.0) - json (>= 1.8.0) - warden (1.2.3) - rack (>= 1.0) - xpath (2.0.0) - nokogiri (~> 1.3) - -PLATFORMS - ruby - -DEPENDENCIES - airbrake (~> 3.1.15) - bootstrap_form! - cancancan - capistrano (~> 3.0.1) - capistrano-bundler (>= 1.1.0) - capistrano-rails (~> 1.1.0) - capistrano-rvm (~> 0.1.0)! - coffee-rails (~> 4.0.0) - cucumber-rails - database_cleaner - debugger (~> 1.6.5) - demoji - devise (~> 3.2.2) - devise-i18n - dusen - factory_girl_rails (~> 4.3.0) - haml-rails (~> 0.5.3) - http_accept_language - i18n-js - jbuilder (~> 1.5.3) - jquery-rails (~> 3.0.4) - jquery-turbolinks - kaminari (~> 0.15.0) - kaminari-i18n - less-rails (~> 2.4.2) - mysql2 - octokit (~> 2.7.0) - omniauth (~> 1.1.4) - omniauth-github! - rails (= 4.0.2) - rails-i18n - render_csv - rspec-rails (~> 3.0.0.beta) - sass-rails (~> 4.0.0) - sawyer (~> 0.5.2) - sdoc - shoulda-matchers (~> 2.5.0) - simplecov - sqlite3 (~> 1.3.8) - therubyracer (~> 0.12.0) - turbolinks (~> 2.2.0) - twitter-bootstrap-rails! - twitter_bootstrap_form_for! - uglifier (>= 1.3.0) diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 5707826a..00000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 tip4commit - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index e045c2d0..389b5520 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,4 @@ Tip4commit ========== -[![tip for next commit](https://tip4commit.com/projects/307.svg)](https://tip4commit.com/projects/307) -[![Build Status](https://travis-ci.org/tip4commit/tip4commit.svg?branch=master)](https://travis-ci.org/tip4commit/tip4commit) - -Donate bitcoins to open source projects or receive tips for code contributions. - -| | | -| -------------- | ------------------------------------------------- | -| Official site: | https://tip4commit.com/ | -| Discussions: | https://bitcointalk.org/index.php?topic=315802 | -| FAQs: | https://github.com/tip4commit/tip4commit/wiki/FAQ | -| Issues: | https://github.com/tip4commit/tip4commit/issues | - - -Developers -========== - -If you would like to contribute to the development of tip4commit, you can find the contribution guidelines and installation instructions on the [developer README](https://github.com/tip4commit/tip4commit/wiki/README---Developers) - - -License -======= - -[MIT License](https://github.com/tip4commit/tip4commit/blob/master/LICENSE) +Has ceased to exist. diff --git a/Rakefile b/Rakefile deleted file mode 100644 index ccbbc5fa..00000000 --- a/Rakefile +++ /dev/null @@ -1,6 +0,0 @@ -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require File.expand_path('../config/application', __FILE__) - -T4c::Application.load_tasks diff --git a/app/assets/images/.keep b/app/assets/images/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/app/assets/images/flags/de.png b/app/assets/images/flags/de.png deleted file mode 100755 index ac4a9773..00000000 Binary files a/app/assets/images/flags/de.png and /dev/null differ diff --git a/app/assets/images/flags/en.png b/app/assets/images/flags/en.png deleted file mode 100644 index ff701e19..00000000 Binary files a/app/assets/images/flags/en.png and /dev/null differ diff --git a/app/assets/images/flags/fr.png b/app/assets/images/flags/fr.png deleted file mode 100644 index 8332c4ec..00000000 Binary files a/app/assets/images/flags/fr.png and /dev/null differ diff --git a/app/assets/images/flags/pl.png b/app/assets/images/flags/pl.png deleted file mode 100644 index cca0e7dd..00000000 Binary files a/app/assets/images/flags/pl.png and /dev/null differ diff --git a/app/assets/images/flags/ru.png b/app/assets/images/flags/ru.png deleted file mode 100755 index 47da4214..00000000 Binary files a/app/assets/images/flags/ru.png and /dev/null differ diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee deleted file mode 100644 index a2a76b69..00000000 --- a/app/assets/javascripts/application.js.coffee +++ /dev/null @@ -1,18 +0,0 @@ -#= require jquery -#= require jquery.turbolinks -#= require jquery_ujs -#= require twitter/bootstrap -#= require turbolinks -#= require i18n -#= require i18n/translations -#= require_tree . - -$(document).on "ready page:change", -> - - # Remove all global properties set by addthis, otherwise it won't reinitialize - for i of window - delete window[i] if /^addthis/.test(i) or /^_at/.test(i) - window.addthis_share = null - - # Finally, load addthis - $.getScript "//s7.addthis.com/js/250/addthis_widget.js#pubid=ra-526425ac0ea0780b" diff --git a/app/assets/javascripts/bootstrap.js.coffee b/app/assets/javascripts/bootstrap.js.coffee deleted file mode 100644 index 94406798..00000000 --- a/app/assets/javascripts/bootstrap.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -jQuery -> - $("a[rel~=popover], .has-popover").popover() - $("a[rel~=tooltip], .has-tooltip").tooltip() diff --git a/app/assets/javascripts/bootstrapValidator.js b/app/assets/javascripts/bootstrapValidator.js deleted file mode 100644 index bbf63f1e..00000000 --- a/app/assets/javascripts/bootstrapValidator.js +++ /dev/null @@ -1,882 +0,0 @@ -/** - * BootstrapValidator v0.2.3 (http://github.com/nghuuphuoc/bootstrapvalidator) - * - * A jQuery plugin to validate form fields. Use with Bootstrap 3 - * - * @author Nguyen Huu Phuoc - * @copyright (c) 2013 Nguyen Huu Phuoc - * @license MIT - */ - -(function($) { - var BootstrapValidator = function(form, options) { - this.$form = $(form); - this.options = $.extend({}, BootstrapValidator.DEFAULT_OPTIONS, options); - - if ('disabled' == this.options.live) { - // Don't disable the submit buttons if the live validating is disabled - this.options.submitButtons = null; - } - - this.invalidFields = {}; - this.xhrRequests = {}; - this.numPendingRequests = null; - this.formSubmited = false; - this.submitHandlerCalled = false; - - this._init(); - }; - - // The default options - BootstrapValidator.DEFAULT_OPTIONS = { - // The form CSS class - elementClass: 'bootstrap-validator-form', - - // Default invalid message - message: 'This value is not valid', - - // The submit buttons selector - // These buttons will be disabled when the form input are invalid - submitButtons: 'button[type="submit"]', - - // The custom submit handler - // It will prevent the form from the default submitting - // - // submitHandler: function(validator, form) { - // - validator is the BootstrapValidator instance - // - form is the jQuery object present the current form - // } - submitHandler: null, - - // Live validating. Can be one of 3 values: - // - enabled: The plugin validates fields as soon as they are changed - // - disabled: Disable the live validating. The error messages are only shown after the form is submitted - // - submitted: The live validating is enabled after the form is submitted - live: 'enabled', - - // Map the field name with validator rules - fields: null - }; - - BootstrapValidator.prototype = { - constructor: BootstrapValidator, - - /** - * Init form - */ - _init: function() { - if (this.options.fields == null) { - return; - } - - var that = this; - this.$form - // Disable client side validation in HTML 5 - .attr('novalidate', 'novalidate') - .addClass(this.options.elementClass) - .on('submit', function(e) { - that.formSubmited = true; - if (that.options.fields) { - for (var field in that.options.fields) { - if (that.numPendingRequests > 0 || that.numPendingRequests == null) { - // Check if the field is valid - var $field = that.getFieldElement(field); - if ($field && $field.data('bootstrapValidator.isValid') !== true) { - that.validateField(field); - } - } - } - if (!that.isValid()) { - that.$form.find(that.options.submitButtons).attr('disabled', 'disabled'); - if ('submitted' == that.options.live) { - that.options.live = 'enabled'; - that._setLiveValidating(); - } - - // Focus to the first invalid field - for (var i in that.invalidFields) { - that.getFieldElement(i).focus(); - break; - } - - e.preventDefault(); - } else { - if (!that.submitHandlerCalled && that.options.submitHandler && 'function' == typeof that.options.submitHandler) { - // Avoid calling submitHandler recursively - // in the case user call form.submit() right inside the submitHandler() - that.submitHandlerCalled = true; - that.options.submitHandler.call(that, that, that.$form); - return false; - } - } - } - }); - - for (var field in this.options.fields) { - this._initField(field); - } - - this._setLiveValidating(); - }, - - /** - * Enable live validating - */ - _setLiveValidating: function() { - if ('enabled' == this.options.live) { - var that = this; - // Since this should be called once, I have to disable the live validating mode - this.options.live = 'disabled'; - - for (var field in this.options.fields) { - (function(field) { - var fields = that.getFieldElements(field); - - if (fields && fields.length > 0) { - var $field = $(fields[0]); - var type = $field.attr('type'); - - if ('radio' == type) { - var event = 'change'; - fields.on(event, function() { - that.formSubmited = false; - that.validateField(field); - }); - } else { - var event = ('checkbox' == type || 'SELECT' == $field.get(0).tagName) ? 'change' : 'keyup'; - $field.on(event, function() { - that.formSubmited = false; - that.validateField(field); - }); - } - - } - })(field); - } - } - }, - - /** - * Init field - * - * @param {String} field The field name - */ - _initField: function(field) { - if (this.options.fields[field] == null || this.options.fields[field].validators == null) { - return; - } - - var $field = this.getFieldElement(field); - if (null == $field) { - return; - } - - // Create a help block element for showing the error - var $parent = $field.parents('.form-group'), - helpBlock = $parent.find('.help-block'); - - if (helpBlock.length == 0) { - var $small = $('').addClass('help-block').css('display', 'none').appendTo($parent); - $field.data('bootstrapValidator.error', $small); - - // Calculate the number of columns of the label/field element - // Then set offset to the help block element - var label, cssClasses, offset, size; - if (label = $parent.find('label').get(0)) { - // The default Bootstrap form don't require class for label (http://getbootstrap.com/css/#forms) - if (cssClasses = $(label).attr('class')) { - cssClasses = cssClasses.split(' '); - for (var i = 0; i < cssClasses.length; i++) { - if (/^col-(xs|sm|md|lg)-\d+$/.test(cssClasses[i])) { - offset = cssClasses[i].substr(7); - size = cssClasses[i].substr(4, 2); - break; - } - } - } - } else if (cssClasses = $parent.children().eq(0).attr('class')) { - cssClasses = cssClasses.split(' '); - for (var i = 0; i < cssClasses.length; i++) { - if (/^col-(xs|sm|md|lg)-offset-\d+$/.test(cssClasses[i])) { - offset = cssClasses[i].substr(14); - size = cssClasses[i].substr(4, 2); - break; - } - } - } - if (size && offset) { - $small.addClass(['col-', size, '-offset-', offset].join('')) - .addClass(['col-', size, '-', 12 - offset].join('')); - } - } else { - $field.data('bootstrapValidator.error', helpBlock.eq(0)); - } - }, - - /** - * Get field element - * - * @param {String} field The field name - * @returns {jQuery} - */ - getFieldElement: function(field) { - var fields = this.$form.find('[name="' + field + '"]'); - return (fields.length == 0) ? null : $(fields[0]); - }, - - /** - * Get field elements - * Used for radios - * - * @param {String} field The field name - * @returns {jQuery} - */ - getFieldElements: function(field) { - var fields = this.$form.find('[name="' + field + '"]'); - return (fields.length == 0) ? null : fields; - }, - - - /** - * Validate given field - * - * @param {String} field The field name - */ - validateField: function(field) { - var $field = this.getFieldElement(field); - if (null == $field) { - // Return if cannot find the field with given name - return; - } - var that = this, - validators = that.options.fields[field].validators; - for (var validatorName in validators) { - if (!$.fn.bootstrapValidator.validators[validatorName]) { - continue; - } - var isValid = $.fn.bootstrapValidator.validators[validatorName].validate(that, $field, validators[validatorName]); - if (isValid === false) { - that.showError($field, validatorName); - break; - } else if (isValid === true) { - that.removeError($field); - } - } - }, - - /** - * Show field error - * - * @param {jQuery} $field The field element - * @param {String} validatorName - */ - showError: function($field, validatorName) { - var field = $field.attr('name'), - validator = this.options.fields[field].validators[validatorName], - message = validator.message || this.options.message, - $parent = $field.parents('.form-group'); - - this.invalidFields[field] = true; - - // Add has-error class to parent element - $parent.removeClass('has-success').addClass('has-error'); - - $field.data('bootstrapValidator.error').html(message).show(); - - this.$form.find(this.options.submitButtons).attr('disabled', 'disabled'); - }, - - /** - * Remove error from given field - * - * @param {jQuery} $field The field element - */ - removeError: function($field) { - delete this.invalidFields[$field.attr('name')]; - $field.parents('.form-group').removeClass('has-error').addClass('has-success'); - $field.data('bootstrapValidator.error').hide(); - this.$form.find(this.options.submitButtons).removeAttr('disabled'); - }, - - /** - * Start remote checking - * - * @param {jQuery} $field The field element - * @param {String} validatorName - * @param {XMLHttpRequest} xhr - */ - startRequest: function($field, validatorName, xhr) { - var field = $field.attr('name'); - - $field.data('bootstrapValidator.isValid', false); - this.$form.find(this.options.submitButtons).attr('disabled', 'disabled'); - - if(this.numPendingRequests == null){ - this.numPendingRequests = 0; - } - this.numPendingRequests++; - // Abort the previous request - if (!this.xhrRequests[field]) { - this.xhrRequests[field] = {}; - } - - if (this.xhrRequests[field][validatorName]) { - this.numPendingRequests--; - this.xhrRequests[field][validatorName].abort(); - } - this.xhrRequests[field][validatorName] = xhr; - }, - - /** - * Complete remote checking - * - * @param {jQuery} $field The field element - * @param {String} validatorName - * @param {Boolean} isValid - */ - completeRequest: function($field, validatorName, isValid) { - if (isValid === false) { - this.showError($field, validatorName); - } else if (isValid === true) { - this.removeError($field); - $field.data('bootstrapValidator.isValid', true); - } - - var field = $field.attr('name'); - - delete this.xhrRequests[field][validatorName]; - - this.numPendingRequests--; - if (this.numPendingRequests <= 0) { - this.numPendingRequests = 0; - if (this.formSubmited) { - if (!this.submitHandlerCalled && this.options.submitHandler && 'function' == typeof this.options.submitHandler) { - this.submitHandlerCalled = true; - this.options.submitHandler.call(this, this, this.$form); - } else { - this.$form.submit(); - } - } - } - }, - - /** - * Check the form validity - * - * @returns {Boolean} - */ - isValid: function() { - if (this.numPendingRequests > 0) { - return false; - } - for (var field in this.invalidFields) { - // Don't validate disabled element - if (this.invalidFields[field] && !this.getFieldElement(field).is(':disabled')) { - return false; - } - } - return true; - } - }; - - // Plugin definition - $.fn.bootstrapValidator = function(options) { - return this.each(function() { - var $this = $(this), data = $this.data('bootstrapValidator'); - if (!data) { - $this.data('bootstrapValidator', (data = new BootstrapValidator(this, options))); - } - }); - }; - - // Available validators - $.fn.bootstrapValidator.validators = {}; - - $.fn.bootstrapValidator.Constructor = BootstrapValidator; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.between = { - /** - * Return true if the input value is between (strictly or not) two given numbers - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Can consist of the following keys: - * - min - * - max - * - inclusive [optional]: Can be true or false. Default is true - * - message: The invalid message - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - - value = parseFloat(value); - return (options.inclusive === true) - ? (value > options.min && value < options.max) - : (value >= options.min && value <= options.max); - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.callback = { - /** - * Return result from the callback method - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Can consist of the following keys: - * - callback: The callback method that passes 2 parameters: - * callback: function(fieldValue, validator) { - * // fieldValue is the value of field - * // validator is instance of BootstrapValidator - * } - * - message: The invalid message - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (options.callback && 'function' == typeof options.callback) { - return options.callback.call(this, value, this); - } - return true; - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.creditCard = { - /** - * Return true if the input value is valid credit card number - * Based on https://gist.github.com/DiegoSalazar/4075533 - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Can consist of the following key: - * - message: The invalid message - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - - // Accept only digits, dashes or spaces - if (/[^0-9-\s]+/.test(value)) { - return false; - } - - // The Luhn Algorithm - // http://en.wikipedia.org/wiki/Luhn - value = value.replace(/\D/g, ''); - var check = 0, digit = 0, even = false, length = value.length; - - for (var n = length - 1; n >= 0; n--) { - digit = parseInt(value.charAt(n), 10); - - if (even) { - if ((digit *= 2) > 9) { - digit -= 9; - } - } - - check += digit; - even = !even; - } - - return (check % 10) == 0; - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.different = { - /** - * Return true if the input value is different with given field's value - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Consists of the following key: - * - field: The name of field that will be used to compare with current one - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - - var $compareWith = validator.getFieldElement(options.field); - if ($compareWith && value != $compareWith.val()) { - validator.removeError($compareWith); - return true; - } else { - return false; - } - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.digits = { - /** - * Return true if the input value contains digits only - * - * @param {BootstrapValidator} validator Validate plugin instance - * @param {jQuery} $field Field element - * @param {Object} options - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - - return /^\d+$/.test(value); - } - } -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.emailAddress = { - /** - * Return true if and only if the input value is a valid email address - * - * @param {BootstrapValidator} validator Validate plugin instance - * @param {jQuery} $field Field element - * @param {Object} options - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - - // Email address regular expression - // http://stackoverflow.com/questions/46155/validate-email-address-in-javascript - var emailRegExp = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; - return emailRegExp.test(value); - } - } -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.greaterThan = { - /** - * Return true if the input value is greater than or equals to given number - * - * @param {BootstrapValidator} validator Validate plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Can consist of the following keys: - * - value: The number used to compare to - * - inclusive [optional]: Can be true or false. Default is true - * - message: The invalid message - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - value = parseFloat(value); - return (options.inclusive === true) ? (value > options.value) : (value >= options.value); - } - } -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.hexColor = { - /** - * Return true if the input value is a valid hex color - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Can consist of the following keys: - * - message: The invalid message - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(value); - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.identical = { - /** - * Check if input value equals to value of particular one - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Consists of the following key: - * - field: The name of field that will be used to compare with current one - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - - var $compareWith = validator.getFieldElement(options.field); - if ($compareWith && value == $compareWith.val()) { - validator.removeError($compareWith); - return true; - } else { - return false; - } - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.lessThan = { - /** - * Return true if the input value is less than or equal to given number - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Can consist of the following keys: - * - value: The number used to compare to - * - inclusive [optional]: Can be true or false. Default is true - * - message: The invalid message - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - value = parseFloat(value); - return (options.inclusive === true) ? (value < options.value) : (value <= options.value); - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.notEmpty = { - /** - * Check if input value is empty or not - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - - - var type = $field.attr('type'); - if('radio' == type) { - var radioSelector = "input[name=" + $field.attr('name') + "]:checked"; - return ($(radioSelector).length > 0); - } - - return ('checkbox' == type) ? $field.is(':checked') : ($.trim($field.val()) != ''); - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.regexp = { - /** - * Check if the element value matches given regular expression - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Consists of the following key: - * - regexp: The regular expression you need to check - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - - return options.regexp.test(value); - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.remote = { - /** - * Request a remote server to check the input value - * - * @param {BootstrapValidator} validator Plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Can consist of the following keys: - * - url - * - data [optional]: By default, it will take the value - * { - * : - * } - * - message: The invalid message - * @returns {Boolean|String} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - - var name = $field.attr('name'), data = options.data; - if (data == null) { - data = {}; - } - data[name] = value; - var xhr = $.ajax({ - type: 'POST', - url: options.url, - dataType: 'json', - data: data - }).success(function(response) { - var isValid = response.valid === true || response.valid === 'true'; - validator.completeRequest($field, 'remote', isValid); - }); - validator.startRequest($field, 'remote', xhr); - - return 'pending'; - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.stringLength = { - /** - * Check if the length of element value is less or more than given number - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options Consists of following keys: - * - min - * - max - * At least one of two keys is required - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - - var length = $.trim(value).length; - if ((options.min && length < options.min) || (options.max && length > options.max)) { - return false; - } - - return true; - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.uri = { - /** - * Return true if the input value is a valid URL - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options - * @returns {Boolean} - */ - validate: function(validator, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - - // Credit to https://gist.github.com/dperini/729294 - // - // Regular Expression for URL validation - // - // Author: Diego Perini - // Updated: 2010/12/05 - // - // the regular expression composed & commented - // could be easily tweaked for RFC compliance, - // it was expressly modified to fit & satisfy - // these test for an URL shortener: - // - // http://mathiasbynens.be/demo/url-regex - // - // Notes on possible differences from a standard/generic validation: - // - // - utf-8 char class take in consideration the full Unicode range - // - TLDs have been made mandatory so single names like "localhost" fails - // - protocols have been restricted to ftp, http and https only as requested - // - // Changes: - // - // - IP address dotted notation validation, range: 1.0.0.0 - 223.255.255.255 - // first and last IP address of each class is considered invalid - // (since they are broadcast/network addresses) - // - // - Added exclusion of private, reserved and/or local networks ranges - // - // Compressed one-line versions: - // - // Javascript version - // - // /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i - // - // PHP version - // - // _^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))(?::\d{2,5})?(?:/[^\s]*)?$_iuS - var urlExp = new RegExp( - "^" + - // protocol identifier - "(?:(?:https?|ftp)://)" + - // user:pass authentication - "(?:\\S+(?::\\S*)?@)?" + - "(?:" + - // IP address exclusion - // private & local networks - "(?!10(?:\\.\\d{1,3}){3})" + - "(?!127(?:\\.\\d{1,3}){3})" + - "(?!169\\.254(?:\\.\\d{1,3}){2})" + - "(?!192\\.168(?:\\.\\d{1,3}){2})" + - "(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})" + - // IP address dotted notation octets - // excludes loopback network 0.0.0.0 - // excludes reserved space >= 224.0.0.0 - // excludes network & broacast addresses - // (first & last IP address of each class) - "(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" + - "(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" + - "(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" + - "|" + - // host name - "(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)" + - // domain name - "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*" + - // TLD identifier - "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))" + - ")" + - // port number - "(?::\\d{2,5})?" + - // resource path - "(?:/[^\\s]*)?" + - "$", "i" - ); - return urlExp.test(value); - } - }; -}(window.jQuery)); -;(function($) { - $.fn.bootstrapValidator.validators.usZipCode = { - /** - * Return true if and only if the input value is a valid US zip code - * - * @param {BootstrapValidator} validator The validator plugin instance - * @param {jQuery} $field Field element - * @param {Object} options - * @returns {Boolean} - */ - validate: function(validateInstance, $field, options) { - var value = $field.val(); - if (value == '') { - return true; - } - return /^\d{5}([\-]\d{4})?$/.test(value); - } - }; -}(window.jQuery)); diff --git a/app/assets/javascripts/deposits.js.coffee b/app/assets/javascripts/deposits.js.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/deposits.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/i18n/translations.js b/app/assets/javascripts/i18n/translations.js deleted file mode 100644 index 029f45b8..00000000 --- a/app/assets/javascripts/i18n/translations.js +++ /dev/null @@ -1,2 +0,0 @@ -var I18n = I18n || {}; -I18n.translations = {"en":{"js":{"errors":{"value":{"invalid":"Value is invalid"},"email":{"invalid":"Invalid Email Address","blank":"The Email is required and can't be empty"},"password":{"blank":"The password is required and can't be empty","invalid":"The password and its confirmation are not same"},"password_confirmation":{"blank":"The password confirmation is required and can't be empty","invalid":"The password and its confirmation are not same"}}}},"fr":{"js":{"errors":{"value":{"invalid":"Valeur non valide"},"email":{"invalid":"Adresse Email non valide","blank":"L'Email est requis et doit être renseigné"},"password":{"blank":"Les mot de passe est requis et doit être renseigné","invalid":"Le mot de passe et sa confirmation ne sont pas identiques"},"password_confirmation":{"blank":"La confirmation du mot de passe est requise et doit être renseignée","invalid":"Le mot de passe et sa confirmation ne sont pas identiques"}}}},"hr":{"js":{"errors":{"value":{"invalid":"Vrijednost nevazeca"},"email":{"invalid":"Nezaveca email adresa","blank":"Email je potreban i ne moze biti prazno"},"password":{"blank":"Lozinka je potrebna i ne moze biti prazno","invalid":"Lozinka i njezina potvrda nisu isti"},"password_confirmation":{"blank":"Potvrda lozinke je potrebna i ne moze biti prazno","invalid":"Lozinka i potvrda lozinke nisu isti"}}}},"pl":{"js":{"errors":{"value":{"invalid":"Wartość jest niepoprawna"},"email":{"invalid":"Błędny adres E-mail","blank":"E-mail jest wymagany i nie może być pusty"},"password":{"blank":"Hasło jest wymagane i nie może być puste","invalid":"Hasło i jego potwierdzenie nie są takie same"},"password_confirmation":{"blank":"Potwierdzenie hasła jest wymagane i nie może być puste","invalid":"Hasło i jego potwierdzenie nie są takie same"}}}},"ru":{"js":{"errors":{"value":{"invalid":"Неверное значение"},"email":{"invalid":"Ошибка в Email адресе","blank":"Email не может быть пустым"},"password":{"blank":"Пароль не может быть пустым","invalid":"Пароль и его подтверждение не совпадают"},"password_confirmation":{"blank":"Подтверждение пароля не может быть пустым","invalid":"Пароль и его подтверждение не совпадают"}}}}}; \ No newline at end of file diff --git a/app/assets/javascripts/projects.js.coffee b/app/assets/javascripts/projects.js.coffee deleted file mode 100644 index 849796e7..00000000 --- a/app/assets/javascripts/projects.js.coffee +++ /dev/null @@ -1,9 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ - -init = () -> - $('.qrcode').each () -> - $(this).qrcode($(this).attr('data-qrcode')); - -$(document).on 'ready page:load', init diff --git a/app/assets/javascripts/qrcode/jquery.qr.js b/app/assets/javascripts/qrcode/jquery.qr.js deleted file mode 100644 index 81f78645..00000000 --- a/app/assets/javascripts/qrcode/jquery.qr.js +++ /dev/null @@ -1,89 +0,0 @@ -(function( $ ){ - $.fn.qrcode = function(options) { - // if options is string, - if( typeof options === 'string' ){ - options = { text: options }; - } - - // set default values - // typeNumber < 1 for automatic calculation - options = $.extend( {}, { - render : "canvas", - width : 256, - height : 256, - typeNumber : -1, - correctLevel : QRErrorCorrectLevel.H, - background : "#ffffff", - foreground : "#000000" - }, options); - - var createCanvas = function(){ - // create the qrcode itself - var qrcode = new QRCode(options.typeNumber, options.correctLevel); - qrcode.addData(options.text); - qrcode.make(); - - // create canvas element - var canvas = document.createElement('canvas'); - canvas.width = options.width; - canvas.height = options.height; - var ctx = canvas.getContext('2d'); - - // compute tileW/tileH based on options.width/options.height - var tileW = options.width / qrcode.getModuleCount(); - var tileH = options.height / qrcode.getModuleCount(); - - // draw in the canvas - for( var row = 0; row < qrcode.getModuleCount(); row++ ){ - for( var col = 0; col < qrcode.getModuleCount(); col++ ){ - ctx.fillStyle = qrcode.isDark(row, col) ? options.foreground : options.background; - var w = (Math.ceil((col+1)*tileW) - Math.floor(col*tileW)); - var h = (Math.ceil((row+1)*tileW) - Math.floor(row*tileW)); - ctx.fillRect(Math.round(col*tileW),Math.round(row*tileH), w, h); - } - } - // return just built canvas - return canvas; - } - - // from Jon-Carlos Rivera (https://github.com/imbcmdth) - var createTable = function(){ - // create the qrcode itself - var qrcode = new QRCode(options.typeNumber, options.correctLevel); - qrcode.addData(options.text); - qrcode.make(); - - // create table element - var $table = $('
') - .css("width", options.width+"px") - .css("height", options.height+"px") - .css("border", "0px") - .css("border-collapse", "collapse") - .css('background-color', options.background); - - // compute tileS percentage - var tileW = options.width / qrcode.getModuleCount(); - var tileH = options.height / qrcode.getModuleCount(); - - // draw in the table - for(var row = 0; row < qrcode.getModuleCount(); row++ ){ - var $row = $('').css('height', tileH+"px").appendTo($table); - - for(var col = 0; col < qrcode.getModuleCount(); col++ ){ - $('') - .css('width', tileW+"px") - .css('background-color', qrcode.isDark(row, col) ? options.foreground : options.background) - .appendTo($row); - } - } - // return just built canvas - return $table; - } - - - return this.each(function(){ - var element = options.render == "canvas" ? createCanvas() : createTable(); - $(element).appendTo(this); - }); - }; -})( jQuery ); \ No newline at end of file diff --git a/app/assets/javascripts/qrcode/qrcode.js b/app/assets/javascripts/qrcode/qrcode.js deleted file mode 100644 index 3bca9b07..00000000 --- a/app/assets/javascripts/qrcode/qrcode.js +++ /dev/null @@ -1,1237 +0,0 @@ -//--------------------------------------------------------------------- -// QRCode for JavaScript -// -// Copyright (c) 2009 Kazuhiko Arase -// -// URL: http://www.d-project.com/ -// -// Licensed under the MIT license: -// http://www.opensource.org/licenses/mit-license.php -// -// The word "QR Code" is registered trademark of -// DENSO WAVE INCORPORATED -// http://www.denso-wave.com/qrcode/faqpatent-e.html -// -//--------------------------------------------------------------------- - -//--------------------------------------------------------------------- -// QR8bitByte -//--------------------------------------------------------------------- - -function QR8bitByte(data) { - this.mode = QRMode.MODE_8BIT_BYTE; - this.data = data; -} - -QR8bitByte.prototype = { - - getLength : function(buffer) { - return this.data.length; - }, - - write : function(buffer) { - for (var i = 0; i < this.data.length; i++) { - // not JIS ... - buffer.put(this.data.charCodeAt(i), 8); - } - } -}; - -//--------------------------------------------------------------------- -// QRCode -//--------------------------------------------------------------------- - -function QRCode(typeNumber, errorCorrectLevel) { - this.typeNumber = typeNumber; - this.errorCorrectLevel = errorCorrectLevel; - this.modules = null; - this.moduleCount = 0; - this.dataCache = null; - this.dataList = new Array(); -} - -QRCode.prototype = { - - addData : function(data) { - var newData = new QR8bitByte(data); - this.dataList.push(newData); - this.dataCache = null; - }, - - isDark : function(row, col) { - if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) { - throw new Error(row + "," + col); - } - return this.modules[row][col]; - }, - - getModuleCount : function() { - return this.moduleCount; - }, - - make : function() { - // Calculate automatically typeNumber if provided is < 1 - if (this.typeNumber < 1 ){ - var typeNumber = 1; - for (typeNumber = 1; typeNumber < 40; typeNumber++) { - var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel); - - var buffer = new QRBitBuffer(); - var totalDataCount = 0; - for (var i = 0; i < rsBlocks.length; i++) { - totalDataCount += rsBlocks[i].dataCount; - } - - for (var i = 0; i < this.dataList.length; i++) { - var data = this.dataList[i]; - buffer.put(data.mode, 4); - buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber) ); - data.write(buffer); - } - if (buffer.getLengthInBits() <= totalDataCount * 8) - break; - } - this.typeNumber = typeNumber; - } - this.makeImpl(false, this.getBestMaskPattern() ); - }, - - makeImpl : function(test, maskPattern) { - - this.moduleCount = this.typeNumber * 4 + 17; - this.modules = new Array(this.moduleCount); - - for (var row = 0; row < this.moduleCount; row++) { - - this.modules[row] = new Array(this.moduleCount); - - for (var col = 0; col < this.moduleCount; col++) { - this.modules[row][col] = null;//(col + row) % 3; - } - } - - this.setupPositionProbePattern(0, 0); - this.setupPositionProbePattern(this.moduleCount - 7, 0); - this.setupPositionProbePattern(0, this.moduleCount - 7); - this.setupPositionAdjustPattern(); - this.setupTimingPattern(); - this.setupTypeInfo(test, maskPattern); - - if (this.typeNumber >= 7) { - this.setupTypeNumber(test); - } - - if (this.dataCache == null) { - this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList); - } - - this.mapData(this.dataCache, maskPattern); - }, - - setupPositionProbePattern : function(row, col) { - - for (var r = -1; r <= 7; r++) { - - if (row + r <= -1 || this.moduleCount <= row + r) continue; - - for (var c = -1; c <= 7; c++) { - - if (col + c <= -1 || this.moduleCount <= col + c) continue; - - if ( (0 <= r && r <= 6 && (c == 0 || c == 6) ) - || (0 <= c && c <= 6 && (r == 0 || r == 6) ) - || (2 <= r && r <= 4 && 2 <= c && c <= 4) ) { - this.modules[row + r][col + c] = true; - } else { - this.modules[row + r][col + c] = false; - } - } - } - }, - - getBestMaskPattern : function() { - - var minLostPoint = 0; - var pattern = 0; - - for (var i = 0; i < 8; i++) { - - this.makeImpl(true, i); - - var lostPoint = QRUtil.getLostPoint(this); - - if (i == 0 || minLostPoint > lostPoint) { - minLostPoint = lostPoint; - pattern = i; - } - } - - return pattern; - }, - - createMovieClip : function(target_mc, instance_name, depth) { - - var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth); - var cs = 1; - - this.make(); - - for (var row = 0; row < this.modules.length; row++) { - - var y = row * cs; - - for (var col = 0; col < this.modules[row].length; col++) { - - var x = col * cs; - var dark = this.modules[row][col]; - - if (dark) { - qr_mc.beginFill(0, 100); - qr_mc.moveTo(x, y); - qr_mc.lineTo(x + cs, y); - qr_mc.lineTo(x + cs, y + cs); - qr_mc.lineTo(x, y + cs); - qr_mc.endFill(); - } - } - } - - return qr_mc; - }, - - setupTimingPattern : function() { - - for (var r = 8; r < this.moduleCount - 8; r++) { - if (this.modules[r][6] != null) { - continue; - } - this.modules[r][6] = (r % 2 == 0); - } - - for (var c = 8; c < this.moduleCount - 8; c++) { - if (this.modules[6][c] != null) { - continue; - } - this.modules[6][c] = (c % 2 == 0); - } - }, - - setupPositionAdjustPattern : function() { - - var pos = QRUtil.getPatternPosition(this.typeNumber); - - for (var i = 0; i < pos.length; i++) { - - for (var j = 0; j < pos.length; j++) { - - var row = pos[i]; - var col = pos[j]; - - if (this.modules[row][col] != null) { - continue; - } - - for (var r = -2; r <= 2; r++) { - - for (var c = -2; c <= 2; c++) { - - if (r == -2 || r == 2 || c == -2 || c == 2 - || (r == 0 && c == 0) ) { - this.modules[row + r][col + c] = true; - } else { - this.modules[row + r][col + c] = false; - } - } - } - } - } - }, - - setupTypeNumber : function(test) { - - var bits = QRUtil.getBCHTypeNumber(this.typeNumber); - - for (var i = 0; i < 18; i++) { - var mod = (!test && ( (bits >> i) & 1) == 1); - this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod; - } - - for (var i = 0; i < 18; i++) { - var mod = (!test && ( (bits >> i) & 1) == 1); - this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod; - } - }, - - setupTypeInfo : function(test, maskPattern) { - - var data = (this.errorCorrectLevel << 3) | maskPattern; - var bits = QRUtil.getBCHTypeInfo(data); - - // vertical - for (var i = 0; i < 15; i++) { - - var mod = (!test && ( (bits >> i) & 1) == 1); - - if (i < 6) { - this.modules[i][8] = mod; - } else if (i < 8) { - this.modules[i + 1][8] = mod; - } else { - this.modules[this.moduleCount - 15 + i][8] = mod; - } - } - - // horizontal - for (var i = 0; i < 15; i++) { - - var mod = (!test && ( (bits >> i) & 1) == 1); - - if (i < 8) { - this.modules[8][this.moduleCount - i - 1] = mod; - } else if (i < 9) { - this.modules[8][15 - i - 1 + 1] = mod; - } else { - this.modules[8][15 - i - 1] = mod; - } - } - - // fixed module - this.modules[this.moduleCount - 8][8] = (!test); - - }, - - mapData : function(data, maskPattern) { - - var inc = -1; - var row = this.moduleCount - 1; - var bitIndex = 7; - var byteIndex = 0; - - for (var col = this.moduleCount - 1; col > 0; col -= 2) { - - if (col == 6) col--; - - while (true) { - - for (var c = 0; c < 2; c++) { - - if (this.modules[row][col - c] == null) { - - var dark = false; - - if (byteIndex < data.length) { - dark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1); - } - - var mask = QRUtil.getMask(maskPattern, row, col - c); - - if (mask) { - dark = !dark; - } - - this.modules[row][col - c] = dark; - bitIndex--; - - if (bitIndex == -1) { - byteIndex++; - bitIndex = 7; - } - } - } - - row += inc; - - if (row < 0 || this.moduleCount <= row) { - row -= inc; - inc = -inc; - break; - } - } - } - - } - -}; - -QRCode.PAD0 = 0xEC; -QRCode.PAD1 = 0x11; - -QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) { - - var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); - - var buffer = new QRBitBuffer(); - - for (var i = 0; i < dataList.length; i++) { - var data = dataList[i]; - buffer.put(data.mode, 4); - buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber) ); - data.write(buffer); - } - - // calc num max data. - var totalDataCount = 0; - for (var i = 0; i < rsBlocks.length; i++) { - totalDataCount += rsBlocks[i].dataCount; - } - - if (buffer.getLengthInBits() > totalDataCount * 8) { - throw new Error("code length overflow. (" - + buffer.getLengthInBits() - + ">" - + totalDataCount * 8 - + ")"); - } - - // end code - if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { - buffer.put(0, 4); - } - - // padding - while (buffer.getLengthInBits() % 8 != 0) { - buffer.putBit(false); - } - - // padding - while (true) { - - if (buffer.getLengthInBits() >= totalDataCount * 8) { - break; - } - buffer.put(QRCode.PAD0, 8); - - if (buffer.getLengthInBits() >= totalDataCount * 8) { - break; - } - buffer.put(QRCode.PAD1, 8); - } - - return QRCode.createBytes(buffer, rsBlocks); -} - -QRCode.createBytes = function(buffer, rsBlocks) { - - var offset = 0; - - var maxDcCount = 0; - var maxEcCount = 0; - - var dcdata = new Array(rsBlocks.length); - var ecdata = new Array(rsBlocks.length); - - for (var r = 0; r < rsBlocks.length; r++) { - - var dcCount = rsBlocks[r].dataCount; - var ecCount = rsBlocks[r].totalCount - dcCount; - - maxDcCount = Math.max(maxDcCount, dcCount); - maxEcCount = Math.max(maxEcCount, ecCount); - - dcdata[r] = new Array(dcCount); - - for (var i = 0; i < dcdata[r].length; i++) { - dcdata[r][i] = 0xff & buffer.buffer[i + offset]; - } - offset += dcCount; - - var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); - var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1); - - var modPoly = rawPoly.mod(rsPoly); - ecdata[r] = new Array(rsPoly.getLength() - 1); - for (var i = 0; i < ecdata[r].length; i++) { - var modIndex = i + modPoly.getLength() - ecdata[r].length; - ecdata[r][i] = (modIndex >= 0)? modPoly.get(modIndex) : 0; - } - - } - - var totalCodeCount = 0; - for (var i = 0; i < rsBlocks.length; i++) { - totalCodeCount += rsBlocks[i].totalCount; - } - - var data = new Array(totalCodeCount); - var index = 0; - - for (var i = 0; i < maxDcCount; i++) { - for (var r = 0; r < rsBlocks.length; r++) { - if (i < dcdata[r].length) { - data[index++] = dcdata[r][i]; - } - } - } - - for (var i = 0; i < maxEcCount; i++) { - for (var r = 0; r < rsBlocks.length; r++) { - if (i < ecdata[r].length) { - data[index++] = ecdata[r][i]; - } - } - } - - return data; - -} - -//--------------------------------------------------------------------- -// QRMode -//--------------------------------------------------------------------- - -var QRMode = { - MODE_NUMBER : 1 << 0, - MODE_ALPHA_NUM : 1 << 1, - MODE_8BIT_BYTE : 1 << 2, - MODE_KANJI : 1 << 3 -}; - -//--------------------------------------------------------------------- -// QRErrorCorrectLevel -//--------------------------------------------------------------------- - -var QRErrorCorrectLevel = { - L : 1, - M : 0, - Q : 3, - H : 2 -}; - -//--------------------------------------------------------------------- -// QRMaskPattern -//--------------------------------------------------------------------- - -var QRMaskPattern = { - PATTERN000 : 0, - PATTERN001 : 1, - PATTERN010 : 2, - PATTERN011 : 3, - PATTERN100 : 4, - PATTERN101 : 5, - PATTERN110 : 6, - PATTERN111 : 7 -}; - -//--------------------------------------------------------------------- -// QRUtil -//--------------------------------------------------------------------- - -var QRUtil = { - - PATTERN_POSITION_TABLE : [ - [], - [6, 18], - [6, 22], - [6, 26], - [6, 30], - [6, 34], - [6, 22, 38], - [6, 24, 42], - [6, 26, 46], - [6, 28, 50], - [6, 30, 54], - [6, 32, 58], - [6, 34, 62], - [6, 26, 46, 66], - [6, 26, 48, 70], - [6, 26, 50, 74], - [6, 30, 54, 78], - [6, 30, 56, 82], - [6, 30, 58, 86], - [6, 34, 62, 90], - [6, 28, 50, 72, 94], - [6, 26, 50, 74, 98], - [6, 30, 54, 78, 102], - [6, 28, 54, 80, 106], - [6, 32, 58, 84, 110], - [6, 30, 58, 86, 114], - [6, 34, 62, 90, 118], - [6, 26, 50, 74, 98, 122], - [6, 30, 54, 78, 102, 126], - [6, 26, 52, 78, 104, 130], - [6, 30, 56, 82, 108, 134], - [6, 34, 60, 86, 112, 138], - [6, 30, 58, 86, 114, 142], - [6, 34, 62, 90, 118, 146], - [6, 30, 54, 78, 102, 126, 150], - [6, 24, 50, 76, 102, 128, 154], - [6, 28, 54, 80, 106, 132, 158], - [6, 32, 58, 84, 110, 136, 162], - [6, 26, 54, 82, 110, 138, 166], - [6, 30, 58, 86, 114, 142, 170] - ], - - G15 : (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0), - G18 : (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0), - G15_MASK : (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1), - - getBCHTypeInfo : function(data) { - var d = data << 10; - while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) { - d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) ) ); - } - return ( (data << 10) | d) ^ QRUtil.G15_MASK; - }, - - getBCHTypeNumber : function(data) { - var d = data << 12; - while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) { - d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) ) ); - } - return (data << 12) | d; - }, - - getBCHDigit : function(data) { - - var digit = 0; - - while (data != 0) { - digit++; - data >>>= 1; - } - - return digit; - }, - - getPatternPosition : function(typeNumber) { - return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1]; - }, - - getMask : function(maskPattern, i, j) { - - switch (maskPattern) { - - case QRMaskPattern.PATTERN000 : return (i + j) % 2 == 0; - case QRMaskPattern.PATTERN001 : return i % 2 == 0; - case QRMaskPattern.PATTERN010 : return j % 3 == 0; - case QRMaskPattern.PATTERN011 : return (i + j) % 3 == 0; - case QRMaskPattern.PATTERN100 : return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 == 0; - case QRMaskPattern.PATTERN101 : return (i * j) % 2 + (i * j) % 3 == 0; - case QRMaskPattern.PATTERN110 : return ( (i * j) % 2 + (i * j) % 3) % 2 == 0; - case QRMaskPattern.PATTERN111 : return ( (i * j) % 3 + (i + j) % 2) % 2 == 0; - - default : - throw new Error("bad maskPattern:" + maskPattern); - } - }, - - getErrorCorrectPolynomial : function(errorCorrectLength) { - - var a = new QRPolynomial([1], 0); - - for (var i = 0; i < errorCorrectLength; i++) { - a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0) ); - } - - return a; - }, - - getLengthInBits : function(mode, type) { - - if (1 <= type && type < 10) { - - // 1 - 9 - - switch(mode) { - case QRMode.MODE_NUMBER : return 10; - case QRMode.MODE_ALPHA_NUM : return 9; - case QRMode.MODE_8BIT_BYTE : return 8; - case QRMode.MODE_KANJI : return 8; - default : - throw new Error("mode:" + mode); - } - - } else if (type < 27) { - - // 10 - 26 - - switch(mode) { - case QRMode.MODE_NUMBER : return 12; - case QRMode.MODE_ALPHA_NUM : return 11; - case QRMode.MODE_8BIT_BYTE : return 16; - case QRMode.MODE_KANJI : return 10; - default : - throw new Error("mode:" + mode); - } - - } else if (type < 41) { - - // 27 - 40 - - switch(mode) { - case QRMode.MODE_NUMBER : return 14; - case QRMode.MODE_ALPHA_NUM : return 13; - case QRMode.MODE_8BIT_BYTE : return 16; - case QRMode.MODE_KANJI : return 12; - default : - throw new Error("mode:" + mode); - } - - } else { - throw new Error("type:" + type); - } - }, - - getLostPoint : function(qrCode) { - - var moduleCount = qrCode.getModuleCount(); - - var lostPoint = 0; - - // LEVEL1 - - for (var row = 0; row < moduleCount; row++) { - - for (var col = 0; col < moduleCount; col++) { - - var sameCount = 0; - var dark = qrCode.isDark(row, col); - - for (var r = -1; r <= 1; r++) { - - if (row + r < 0 || moduleCount <= row + r) { - continue; - } - - for (var c = -1; c <= 1; c++) { - - if (col + c < 0 || moduleCount <= col + c) { - continue; - } - - if (r == 0 && c == 0) { - continue; - } - - if (dark == qrCode.isDark(row + r, col + c) ) { - sameCount++; - } - } - } - - if (sameCount > 5) { - lostPoint += (3 + sameCount - 5); - } - } - } - - // LEVEL2 - - for (var row = 0; row < moduleCount - 1; row++) { - for (var col = 0; col < moduleCount - 1; col++) { - var count = 0; - if (qrCode.isDark(row, col ) ) count++; - if (qrCode.isDark(row + 1, col ) ) count++; - if (qrCode.isDark(row, col + 1) ) count++; - if (qrCode.isDark(row + 1, col + 1) ) count++; - if (count == 0 || count == 4) { - lostPoint += 3; - } - } - } - - // LEVEL3 - - for (var row = 0; row < moduleCount; row++) { - for (var col = 0; col < moduleCount - 6; col++) { - if (qrCode.isDark(row, col) - && !qrCode.isDark(row, col + 1) - && qrCode.isDark(row, col + 2) - && qrCode.isDark(row, col + 3) - && qrCode.isDark(row, col + 4) - && !qrCode.isDark(row, col + 5) - && qrCode.isDark(row, col + 6) ) { - lostPoint += 40; - } - } - } - - for (var col = 0; col < moduleCount; col++) { - for (var row = 0; row < moduleCount - 6; row++) { - if (qrCode.isDark(row, col) - && !qrCode.isDark(row + 1, col) - && qrCode.isDark(row + 2, col) - && qrCode.isDark(row + 3, col) - && qrCode.isDark(row + 4, col) - && !qrCode.isDark(row + 5, col) - && qrCode.isDark(row + 6, col) ) { - lostPoint += 40; - } - } - } - - // LEVEL4 - - var darkCount = 0; - - for (var col = 0; col < moduleCount; col++) { - for (var row = 0; row < moduleCount; row++) { - if (qrCode.isDark(row, col) ) { - darkCount++; - } - } - } - - var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; - lostPoint += ratio * 10; - - return lostPoint; - } - -}; - - -//--------------------------------------------------------------------- -// QRMath -//--------------------------------------------------------------------- - -var QRMath = { - - glog : function(n) { - - if (n < 1) { - throw new Error("glog(" + n + ")"); - } - - return QRMath.LOG_TABLE[n]; - }, - - gexp : function(n) { - - while (n < 0) { - n += 255; - } - - while (n >= 256) { - n -= 255; - } - - return QRMath.EXP_TABLE[n]; - }, - - EXP_TABLE : new Array(256), - - LOG_TABLE : new Array(256) - -}; - -for (var i = 0; i < 8; i++) { - QRMath.EXP_TABLE[i] = 1 << i; -} -for (var i = 8; i < 256; i++) { - QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] - ^ QRMath.EXP_TABLE[i - 5] - ^ QRMath.EXP_TABLE[i - 6] - ^ QRMath.EXP_TABLE[i - 8]; -} -for (var i = 0; i < 255; i++) { - QRMath.LOG_TABLE[QRMath.EXP_TABLE[i] ] = i; -} - -//--------------------------------------------------------------------- -// QRPolynomial -//--------------------------------------------------------------------- - -function QRPolynomial(num, shift) { - - if (num.length == undefined) { - throw new Error(num.length + "/" + shift); - } - - var offset = 0; - - while (offset < num.length && num[offset] == 0) { - offset++; - } - - this.num = new Array(num.length - offset + shift); - for (var i = 0; i < num.length - offset; i++) { - this.num[i] = num[i + offset]; - } -} - -QRPolynomial.prototype = { - - get : function(index) { - return this.num[index]; - }, - - getLength : function() { - return this.num.length; - }, - - multiply : function(e) { - - var num = new Array(this.getLength() + e.getLength() - 1); - - for (var i = 0; i < this.getLength(); i++) { - for (var j = 0; j < e.getLength(); j++) { - num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i) ) + QRMath.glog(e.get(j) ) ); - } - } - - return new QRPolynomial(num, 0); - }, - - mod : function(e) { - - if (this.getLength() - e.getLength() < 0) { - return this; - } - - var ratio = QRMath.glog(this.get(0) ) - QRMath.glog(e.get(0) ); - - var num = new Array(this.getLength() ); - - for (var i = 0; i < this.getLength(); i++) { - num[i] = this.get(i); - } - - for (var i = 0; i < e.getLength(); i++) { - num[i] ^= QRMath.gexp(QRMath.glog(e.get(i) ) + ratio); - } - - // recursive call - return new QRPolynomial(num, 0).mod(e); - } -}; - -//--------------------------------------------------------------------- -// QRRSBlock -//--------------------------------------------------------------------- - -function QRRSBlock(totalCount, dataCount) { - this.totalCount = totalCount; - this.dataCount = dataCount; -} - -QRRSBlock.RS_BLOCK_TABLE = [ - - // L - // M - // Q - // H - - // 1 - [1, 26, 19], - [1, 26, 16], - [1, 26, 13], - [1, 26, 9], - - // 2 - [1, 44, 34], - [1, 44, 28], - [1, 44, 22], - [1, 44, 16], - - // 3 - [1, 70, 55], - [1, 70, 44], - [2, 35, 17], - [2, 35, 13], - - // 4 - [1, 100, 80], - [2, 50, 32], - [2, 50, 24], - [4, 25, 9], - - // 5 - [1, 134, 108], - [2, 67, 43], - [2, 33, 15, 2, 34, 16], - [2, 33, 11, 2, 34, 12], - - // 6 - [2, 86, 68], - [4, 43, 27], - [4, 43, 19], - [4, 43, 15], - - // 7 - [2, 98, 78], - [4, 49, 31], - [2, 32, 14, 4, 33, 15], - [4, 39, 13, 1, 40, 14], - - // 8 - [2, 121, 97], - [2, 60, 38, 2, 61, 39], - [4, 40, 18, 2, 41, 19], - [4, 40, 14, 2, 41, 15], - - // 9 - [2, 146, 116], - [3, 58, 36, 2, 59, 37], - [4, 36, 16, 4, 37, 17], - [4, 36, 12, 4, 37, 13], - - // 10 - [2, 86, 68, 2, 87, 69], - [4, 69, 43, 1, 70, 44], - [6, 43, 19, 2, 44, 20], - [6, 43, 15, 2, 44, 16], - - // 11 - [4, 101, 81], - [1, 80, 50, 4, 81, 51], - [4, 50, 22, 4, 51, 23], - [3, 36, 12, 8, 37, 13], - - // 12 - [2, 116, 92, 2, 117, 93], - [6, 58, 36, 2, 59, 37], - [4, 46, 20, 6, 47, 21], - [7, 42, 14, 4, 43, 15], - - // 13 - [4, 133, 107], - [8, 59, 37, 1, 60, 38], - [8, 44, 20, 4, 45, 21], - [12, 33, 11, 4, 34, 12], - - // 14 - [3, 145, 115, 1, 146, 116], - [4, 64, 40, 5, 65, 41], - [11, 36, 16, 5, 37, 17], - [11, 36, 12, 5, 37, 13], - - // 15 - [5, 109, 87, 1, 110, 88], - [5, 65, 41, 5, 66, 42], - [5, 54, 24, 7, 55, 25], - [11, 36, 12], - - // 16 - [5, 122, 98, 1, 123, 99], - [7, 73, 45, 3, 74, 46], - [15, 43, 19, 2, 44, 20], - [3, 45, 15, 13, 46, 16], - - // 17 - [1, 135, 107, 5, 136, 108], - [10, 74, 46, 1, 75, 47], - [1, 50, 22, 15, 51, 23], - [2, 42, 14, 17, 43, 15], - - // 18 - [5, 150, 120, 1, 151, 121], - [9, 69, 43, 4, 70, 44], - [17, 50, 22, 1, 51, 23], - [2, 42, 14, 19, 43, 15], - - // 19 - [3, 141, 113, 4, 142, 114], - [3, 70, 44, 11, 71, 45], - [17, 47, 21, 4, 48, 22], - [9, 39, 13, 16, 40, 14], - - // 20 - [3, 135, 107, 5, 136, 108], - [3, 67, 41, 13, 68, 42], - [15, 54, 24, 5, 55, 25], - [15, 43, 15, 10, 44, 16], - - // 21 - [4, 144, 116, 4, 145, 117], - [17, 68, 42], - [17, 50, 22, 6, 51, 23], - [19, 46, 16, 6, 47, 17], - - // 22 - [2, 139, 111, 7, 140, 112], - [17, 74, 46], - [7, 54, 24, 16, 55, 25], - [34, 37, 13], - - // 23 - [4, 151, 121, 5, 152, 122], - [4, 75, 47, 14, 76, 48], - [11, 54, 24, 14, 55, 25], - [16, 45, 15, 14, 46, 16], - - // 24 - [6, 147, 117, 4, 148, 118], - [6, 73, 45, 14, 74, 46], - [11, 54, 24, 16, 55, 25], - [30, 46, 16, 2, 47, 17], - - // 25 - [8, 132, 106, 4, 133, 107], - [8, 75, 47, 13, 76, 48], - [7, 54, 24, 22, 55, 25], - [22, 45, 15, 13, 46, 16], - - // 26 - [10, 142, 114, 2, 143, 115], - [19, 74, 46, 4, 75, 47], - [28, 50, 22, 6, 51, 23], - [33, 46, 16, 4, 47, 17], - - // 27 - [8, 152, 122, 4, 153, 123], - [22, 73, 45, 3, 74, 46], - [8, 53, 23, 26, 54, 24], - [12, 45, 15, 28, 46, 16], - - // 28 - [3, 147, 117, 10, 148, 118], - [3, 73, 45, 23, 74, 46], - [4, 54, 24, 31, 55, 25], - [11, 45, 15, 31, 46, 16], - - // 29 - [7, 146, 116, 7, 147, 117], - [21, 73, 45, 7, 74, 46], - [1, 53, 23, 37, 54, 24], - [19, 45, 15, 26, 46, 16], - - // 30 - [5, 145, 115, 10, 146, 116], - [19, 75, 47, 10, 76, 48], - [15, 54, 24, 25, 55, 25], - [23, 45, 15, 25, 46, 16], - - // 31 - [13, 145, 115, 3, 146, 116], - [2, 74, 46, 29, 75, 47], - [42, 54, 24, 1, 55, 25], - [23, 45, 15, 28, 46, 16], - - // 32 - [17, 145, 115], - [10, 74, 46, 23, 75, 47], - [10, 54, 24, 35, 55, 25], - [19, 45, 15, 35, 46, 16], - - // 33 - [17, 145, 115, 1, 146, 116], - [14, 74, 46, 21, 75, 47], - [29, 54, 24, 19, 55, 25], - [11, 45, 15, 46, 46, 16], - - // 34 - [13, 145, 115, 6, 146, 116], - [14, 74, 46, 23, 75, 47], - [44, 54, 24, 7, 55, 25], - [59, 46, 16, 1, 47, 17], - - // 35 - [12, 151, 121, 7, 152, 122], - [12, 75, 47, 26, 76, 48], - [39, 54, 24, 14, 55, 25], - [22, 45, 15, 41, 46, 16], - - // 36 - [6, 151, 121, 14, 152, 122], - [6, 75, 47, 34, 76, 48], - [46, 54, 24, 10, 55, 25], - [2, 45, 15, 64, 46, 16], - - // 37 - [17, 152, 122, 4, 153, 123], - [29, 74, 46, 14, 75, 47], - [49, 54, 24, 10, 55, 25], - [24, 45, 15, 46, 46, 16], - - // 38 - [4, 152, 122, 18, 153, 123], - [13, 74, 46, 32, 75, 47], - [48, 54, 24, 14, 55, 25], - [42, 45, 15, 32, 46, 16], - - // 39 - [20, 147, 117, 4, 148, 118], - [40, 75, 47, 7, 76, 48], - [43, 54, 24, 22, 55, 25], - [10, 45, 15, 67, 46, 16], - - // 40 - [19, 148, 118, 6, 149, 119], - [18, 75, 47, 31, 76, 48], - [34, 54, 24, 34, 55, 25], - [20, 45, 15, 61, 46, 16] -]; - -QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) { - - var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); - - if (rsBlock == undefined) { - throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel); - } - - var length = rsBlock.length / 3; - - var list = new Array(); - - for (var i = 0; i < length; i++) { - - var count = rsBlock[i * 3 + 0]; - var totalCount = rsBlock[i * 3 + 1]; - var dataCount = rsBlock[i * 3 + 2]; - - for (var j = 0; j < count; j++) { - list.push(new QRRSBlock(totalCount, dataCount) ); - } - } - - return list; -} - -QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) { - - switch(errorCorrectLevel) { - case QRErrorCorrectLevel.L : - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; - case QRErrorCorrectLevel.M : - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; - case QRErrorCorrectLevel.Q : - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; - case QRErrorCorrectLevel.H : - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; - default : - return undefined; - } -} - -//--------------------------------------------------------------------- -// QRBitBuffer -//--------------------------------------------------------------------- - -function QRBitBuffer() { - this.buffer = new Array(); - this.length = 0; -} - -QRBitBuffer.prototype = { - - get : function(index) { - var bufIndex = Math.floor(index / 8); - return ( (this.buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1; - }, - - put : function(num, length) { - for (var i = 0; i < length; i++) { - this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1); - } - }, - - getLengthInBits : function() { - return this.length; - }, - - putBit : function(bit) { - - var bufIndex = Math.floor(this.length / 8); - if (this.buffer.length <= bufIndex) { - this.buffer.push(0); - } - - if (bit) { - this.buffer[bufIndex] |= (0x80 >>> (this.length % 8) ); - } - - this.length++; - } -}; \ No newline at end of file diff --git a/app/assets/javascripts/sessions.js.coffee b/app/assets/javascripts/sessions.js.coffee deleted file mode 100644 index e69de29b..00000000 diff --git a/app/assets/javascripts/users.js.coffee b/app/assets/javascripts/users.js.coffee deleted file mode 100644 index b7fcd1a7..00000000 --- a/app/assets/javascripts/users.js.coffee +++ /dev/null @@ -1,42 +0,0 @@ -load_bootstrap_validator = -> - $('.registration_form').bootstrapValidator - message: I18n.t('js.errors.value.invalid') - fields: - "user[email]": - validators: - emailAddress: - message: I18n.t('js.errors.email.invalid') - notEmpty: - message: I18n.t('js.errors.email.blank') - - "user[password]": - validators: - notEmpty: - message: I18n.t('js.errors.password.blank') - identical: - field: 'user[password_confirmation]' - message: I18n.t('js.errors.password.invalid') - - "user[password_confirmation]": - validators: - notEmpty: - message: I18n.t('js.errors.password_confirmation.blank') - identical: - field: 'user[password]' - message: I18n.t('js.errors.password_confirmation.invalid') - $('.session_form').bootstrapValidator - message: I18n.t('js.errors.value.invalid') - fields: - "user[email]": - validators: - emailAddress: - message: I18n.t('js.errors.email.invalid') - notEmpty: - message: I18n.t('js.errors.email.blank') - - "user[password]": - validators: - notEmpty: - message: I18n.t('js.errors.password_confirmation.blank') - -$(document).on "ready page:load", load_bootstrap_validator diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css deleted file mode 100644 index fce99d41..00000000 --- a/app/assets/stylesheets/application.css +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the top of the - * compiled file, but it's generally better to create a new file per style scope. - * - *= require rails_bootstrap_forms - *= require_self - *= require_tree . - */ - - -@font-face {font-family: 'Code-Pro-Light-Demo';src: url('/webfonts/28BE49_0_0.eot');src: url('/webfonts/28BE49_0_0.eot?#iefix') format('embedded-opentype'),url('/webfonts/28BE49_0_0.woff') format('woff'),url('/webfonts/28BE49_0_0.ttf') format('truetype');} -.code-pro { font-family: Code-Pro-Light-Demo; } - -.addthis_counter -{ - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; -} -.form-devise { - max-width: 430px; - padding: 15px; - margin: 0 auto; -} diff --git a/app/assets/stylesheets/bootstrapValidator.css.scss b/app/assets/stylesheets/bootstrapValidator.css.scss deleted file mode 100644 index 999d429e..00000000 --- a/app/assets/stylesheets/bootstrapValidator.css.scss +++ /dev/null @@ -1,5 +0,0 @@ -.bootstrap-validator-form { - .help-block { - margin-bottom: 0; - } -} diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less deleted file mode 100644 index 9c3ec0d1..00000000 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ /dev/null @@ -1,30 +0,0 @@ -@import "twitter/bootstrap/bootstrap"; - -// Set the correct sprite paths -@iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png"); -@iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png"); - -// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines) -@fontAwesomeEotPath: asset-url("fontawesome-webfont.eot"); -@fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot?#iefix"); -@fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff"); -@fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf"); -@fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular"); - -// Font Awesome -@import "fontawesome/font-awesome"; - -// Glyphicons -//@import "twitter/bootstrap/sprites.less"; - -// Your custom LESS stylesheets goes here -// -// Since bootstrap was imported above you have access to its mixins which -// you may use and inherit here -// -// If you'd like to override bootstrap's own variables, you can do so here as well -// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation -// -// Example: -// @linkColor: #ff0000; -.qrcode {text-align:center} \ No newline at end of file diff --git a/app/assets/stylesheets/deposits.css.scss b/app/assets/stylesheets/deposits.css.scss deleted file mode 100644 index a47ad02e..00000000 --- a/app/assets/stylesheets/deposits.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Deposits controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/home.css.scss b/app/assets/stylesheets/home.css.scss deleted file mode 100644 index f0ddc684..00000000 --- a/app/assets/stylesheets/home.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the home controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/justified-nav.css b/app/assets/stylesheets/justified-nav.css deleted file mode 100644 index 0bfb4ac9..00000000 --- a/app/assets/stylesheets/justified-nav.css +++ /dev/null @@ -1,89 +0,0 @@ -body { - padding-top: 20px; -} - -.footer { - border-top: 1px solid #eee; - margin-top: 40px; - padding-top: 40px; - padding-bottom: 40px; -} - -/* Main marketing message and sign up button */ -.jumbotron { - text-align: center; - background-color: transparent; -} -.jumbotron .btn { - font-size: 21px; - padding: 14px 24px; -} - -/* Customize the nav-justified links to be fill the entire space of the .navbar */ - -.nav-justified { - background-color: #eee; - border-radius: 5px; - border: 1px solid #ccc; -} -.nav-justified > li > a { - margin-bottom: 0; - padding-top: 15px; - padding-bottom: 15px; - color: #777; - font-weight: bold; - text-align: center; - border-bottom: 1px solid #d5d5d5; - background-color: #e5e5e5; /* Old browsers */ - background-repeat: repeat-x; /* Repeat the gradient */ - background-image: -moz-linear-gradient(top, #f5f5f5 0%, #e5e5e5 100%); /* FF3.6+ */ - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */ - background-image: -webkit-linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* Chrome 10+,Safari 5.1+ */ - background-image: -ms-linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* IE10+ */ - background-image: -o-linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* Opera 11.10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */ - background-image: linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* W3C */ -} -.nav-justified > .active > a, -.nav-justified > .active > a:hover, -.nav-justified > .active > a:focus { - background-color: #ddd; - background-image: none; - box-shadow: inset 0 3px 7px rgba(0,0,0,.15); -} -.nav-justified > li:first-child > a { - border-radius: 5px 5px 0 0; -} -.nav-justified > li:last-child > a { - border-bottom: 0; - border-radius: 0 0 5px 5px; -} - -@media (min-width: 768px) { - .nav-justified { - max-height: 52px; - } - .nav-justified > li > a { - border-left: 1px solid #fff; - border-right: 1px solid #d5d5d5; - } - .nav-justified > li:first-child > a { - border-left: 0; - border-radius: 5px 0 0 5px; - } - .nav-justified > li:last-child > a { - border-radius: 0 5px 5px 0; - border-right: 0; - } -} - -/* Responsive: Portrait tablets and up */ -@media screen and (min-width: 768px) { - /* Remove the padding we set earlier */ - .masthead, - .marketing, - .footer { - padding-left: 0; - padding-right: 0; - } -} diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss deleted file mode 100644 index 6d95023e..00000000 --- a/app/assets/stylesheets/projects.css.scss +++ /dev/null @@ -1,7 +0,0 @@ -// Place all the styles related to the projects controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -.commit-sha { - font-family: monospace; -} diff --git a/app/assets/stylesheets/sessions.css.scss b/app/assets/stylesheets/sessions.css.scss deleted file mode 100644 index 7bef9cf8..00000000 --- a/app/assets/stylesheets/sessions.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the sessions controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/users.css.scss b/app/assets/stylesheets/users.css.scss deleted file mode 100644 index 31a2eacb..00000000 --- a/app/assets/stylesheets/users.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Users controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb deleted file mode 100644 index d87ef354..00000000 --- a/app/controllers/application_controller.rb +++ /dev/null @@ -1,36 +0,0 @@ -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception - - rescue_from CanCan::AccessDenied do |exception| - redirect_to root_path, :alert => I18n.t('errors.access_denied') - end - - before_filter :load_locale - - private - - def load_locale - if params[:locale] && ::Rails.application.config.available_locales.include?(params[:locale]) - I18n.locale = session[:locale] = params[:locale].to_sym - redirect_to :back rescue true - elsif session[:locale] - I18n.locale = session[:locale] - elsif l = http_accept_language.compatible_language_from(::Rails.application.config.available_locales).to_sym rescue nil - I18n.locale = session[:locale] = l - end - end - - def load_project(project) - if project.is_a? Project - @project = project - else - @project = Project.where(id: project).first - end - unless @project - flash[:error] = I18n.t('errors.project_not_found') - redirect_to projects_path - end - end -end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/app/controllers/deposits_controller.rb b/app/controllers/deposits_controller.rb deleted file mode 100644 index 67a2b25c..00000000 --- a/app/controllers/deposits_controller.rb +++ /dev/null @@ -1,24 +0,0 @@ -class DepositsController < ApplicationController - before_action :load_project - - def index - if params[:project_id] - @deposits = @project.deposits - else - @deposits = Deposit.includes(:project) - end - @deposits = @deposits.order(created_at: :desc). - page(params[:page]). - per(params[:per_page] || 30) - respond_to do |format| - format.html - format.csv { render csv: @deposits, except: [:updated_at, :confirmations, :fee_size], add_methods: [:project_name, :fee, :confirmed?] } - end - end - - private - - def load_project - super(params[:project_id]) if params[:project_id].present? - end -end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb deleted file mode 100644 index 2b145420..00000000 --- a/app/controllers/home_controller.rb +++ /dev/null @@ -1,55 +0,0 @@ -class HomeController < ApplicationController - def index - end - - def blockchain_info_callback - # todo: check if remote IP address belongs to blockchain.info - - if (params[:secret]!=CONFIG["blockchain_info"]["callback_secret"]) - render :text => "Invalid secret #{params}!" - return - end - - test = params[:test] - - if (params[:value].to_i < 0) || Sendmany.find_by(txid: params[:transaction_hash]) - render :text => "*ok*"; - return - end - - if project = Project.find_by(bitcoin_address: params[:input_address]) - deposit = project.deposits.find_by(txid: params[:transaction_hash]) - else - deposit = nil - end - - if deposit - deposit.update_attribute(:confirmations, confirmations = params[:confirmations]) if !test - if confirmations.to_i > 6 - render :text => "*ok*" - else - render :text => "Deposit #{deposit.id} updated!" - end - return - end - - if params[:input_address] == CONFIG['deposit_address'] - # Deposit from the cold wallet - render :text => "*ok*" - elsif project - if !test - deposit = Deposit.create({ - project_id: project.id, - txid: params[:transaction_hash], - confirmations: params[:confirmations], - amount: params[:value].to_i - }) - project.update_cache - end - render :text => "Deposit #{deposit[:txid]} has been created!" - else - render :text => "Project with deposit address #{params[:input_address]} is not found!" - end - end - -end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb deleted file mode 100644 index ee02fbfa..00000000 --- a/app/controllers/projects_controller.rb +++ /dev/null @@ -1,111 +0,0 @@ -require 'net/http' - -class ProjectsController < ApplicationController - - before_filter :load_project, only: [:show, :edit, :update, :decide_tip_amounts] - - def index - @projects = Project.order(projects_order).page(params[:page]).per(30) - end - - def search - if params[:query].present? && project = Project.find_or_create_by_url(params[:query]) - redirect_to pretty_project_path(project) - else - @projects = Project.search(params[:query].to_s).order(projects_order).page(params[:page]).per(30) - render :index - end - end - - # Redirect to pretty url for html format - include ProjectsHelper - before_filter only: [:show] do - if params[:id].present? - begin - respond_to do |format| - format.html { redirect_to pretty_project_path(@project) } - end - rescue ActionController::UnknownFormat - end - end - end - - def show - if @project.bitcoin_address.nil? - uri = URI("https://blockchain.info/merchant/#{CONFIG["blockchain_info"]["guid"]}/new_address") - params = { password: CONFIG["blockchain_info"]["password"], label:"#{@project.full_name}@tip4commit" } - uri.query = URI.encode_www_form(params) - res = Net::HTTP.get_response(uri) - if res.is_a?(Net::HTTPSuccess) && (bitcoin_address = JSON.parse(res.body)["address"]) - @project.update_attribute :bitcoin_address, bitcoin_address - end - end - @project_tips = @project.tips - @recent_tips = @project_tips.includes(:user).order(created_at: :desc).first(5) - end - - def edit - authorize! :update, @project - end - - def update - authorize! :update, @project - @project.attributes = project_params - if @project.tipping_policies_text.try(:text_changed?) - @project.tipping_policies_text.user = current_user - end - if @project.save - redirect_to project_path(@project), notice: I18n.t('notices.project_updated') - else - render 'edit' - end - end - - def decide_tip_amounts - authorize! :decide_tip_amounts, @project - if request.patch? - @project.available_amount # preload anything required to get the amount, otherwise it's loaded during the assignation and there are undesirable consequences - percentages = params[:project][:tips_attributes].values.map{|tip| tip['amount_percentage'].to_f} - if percentages.sum > 100 - redirect_to decide_tip_amounts_project_path(@project), alert: I18n.t('errors.can_assign_more_tips') - return - end - raise "wrong data" if percentages.min < 0 - @project.attributes = params.require(:project).permit(tips_attributes: [:id, :amount_percentage]) - if @project.save - message = I18n.t('notices.tips_decided') - if @project.has_undecided_tips? - redirect_to decide_tip_amounts_project_path(@project), notice: message - else - redirect_to @project, notice: message - end - end - end - end - - private - - def load_project - if params[:id].present? - super(params[:id]) - elsif params[:service].present? && params[:repo].present? - super( - Project.where(host: params[:service]). - where('lower(`full_name`) = ?', params[:repo].downcase).first - ) - end - end - - def project_params - params.require(:project).permit(:branch, :disable_notifications, :hold_tips, tipping_policies_text_attributes: [:text]) - end - - def projects_order - { - 'balance' => {available_amount_cache: :desc, watchers_count: :desc, full_name: :asc}, - 'watchers' => {watchers_count: :desc, available_amount_cache: :desc, full_name: :asc}, - 'repository' => {full_name: :asc, available_amount_cache: :desc, watchers_count: :desc}, - 'description' => {description: :asc, available_amount_cache: :desc, watchers_count: :desc, full_name: :asc} - }.[](params[:order] || 'balance') - end -end diff --git a/app/controllers/tips_controller.rb b/app/controllers/tips_controller.rb deleted file mode 100644 index 99a91dfa..00000000 --- a/app/controllers/tips_controller.rb +++ /dev/null @@ -1,27 +0,0 @@ -class TipsController < ApplicationController - - before_action :load_project - - def index - if params[:project_id] - @tips = @project.tips.includes(:user) - elsif params[:user_id] && @user = User.find(params[:user_id]) - @tips = @user.tips.includes(:project) - else - @tips = Tip.includes(:user, :project) - end - @tips = @tips.order(created_at: :desc). - page(params[:page]). - per(params[:per_page] || 30) - respond_to do |format| - format.html - format.csv { render csv: @tips, except: [:updated_at, :commit, :commit_message, :refunded_at, :decided_at], add_methods: [:user_name, :project_name, :decided?, :claimed?, :paid?, :refunded?, :txid] } - end - end - - private - - def load_project - super(params[:project_id]) if params[:project_id].present? - end -end diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb deleted file mode 100644 index ebefbc65..00000000 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ /dev/null @@ -1,37 +0,0 @@ -class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController - before_action :load_omniauth_info, only: :github - - def github - @user = User.find_by(nickname: @omniauth_info.nickname) || - User.find_by(email: @omniauth_info.verified_emails) - - if @user.present? - if @omniauth_info.primary_email.present? && @user.email != @omniauth_info.primary_email - # update email if it has been changed - @user.update email: @omniauth_info.primary_email - end - else # user not found - if @omniauth_info.primary_email.present? - @user = User.create_with_omniauth!(@omniauth_info) - else - set_flash_message(:error, :failure, kind: 'GitHub', reason: I18n.t('devise.errors.primary_email')) - redirect_to new_user_session_path and return - end - end - - @user.update(@omniauth_info.slice(:name, :image).as_json) - - sign_in_and_redirect @user, event: :authentication - set_flash_message(:notice, :success, kind: 'GitHub') if is_navigational_format? - end - - private - - def load_omniauth_info - @omniauth_info = request.env['omniauth.auth']['info'] - unless @omniauth_info - set_flash_message(:error, :failure, kind: 'GitHub', reason: I18n.t('devise.errors.omniauth_info')) - redirect_to new_user_session_path and return - end - end -end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb deleted file mode 100644 index f3e5a8db..00000000 --- a/app/controllers/users_controller.rb +++ /dev/null @@ -1,56 +0,0 @@ -class UsersController < ApplicationController - - before_action :authenticate_user!, :load_user, :valid_user!, except: [:login, :index] - - def show - @user_tips = @user.tips - @recent_tips = @user_tips.includes(:project).order(created_at: :desc).first(5) - end - - def index - @users = User.order(withdrawn_amount: :desc, commits_count: :desc).where('commits_count > 0').page(params[:page]).per(30) - end - - def update - if @user.update_attributes(users_params) - redirect_to @user, notice: I18n.t('notices.user_updated') - else - show - render :show, alert: I18n.t('errors.wrong_bitcoin_address') - end - end - - def login - @user = User.find_by(login_token: params[:token]) - if @user - @user.confirm! - sign_in_and_redirect @user, event: :authentication - if params[:unsubscribe] - @user.update unsubscribed: true - flash[:alert] = I18n.t('notices.user_unsubscribed') - end - else - redirect_to root_url, alert: I18n.t('errors.user_not_found') - end - end - - private - def users_params - params.require(:user).permit(:bitcoin_address, :password, :password_confirmation, :unsubscribed, :display_name) - end - - def load_user - @user = User.where(id: params[:id]).first - unless @user - flash[:error] = I18n.t('errors.user_not_found') - redirect_to root_path and return - end - end - - def valid_user! - if current_user != @user - flash[:error] = I18n.t('errors.access_denied') - redirect_to root_path and return - end - end -end diff --git a/app/controllers/withdrawals_controller.rb b/app/controllers/withdrawals_controller.rb deleted file mode 100644 index 8c9168e5..00000000 --- a/app/controllers/withdrawals_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class WithdrawalsController < ApplicationController - def index - @sendmanies = Sendmany.order(created_at: :desc).page(params[:page]).per(30) - end -end \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb deleted file mode 100644 index 9b58333c..00000000 --- a/app/helpers/application_helper.rb +++ /dev/null @@ -1,28 +0,0 @@ -module ApplicationHelper - def btc_human amount, options = {} - nobr = options.has_key?(:nobr) ? options[:nobr] : true - btc = "%.8f Ƀ" % to_btc(amount) - btc = "#{btc}" if nobr - btc.html_safe - end - - def to_btc satoshies - (1.0*satoshies.to_i/1e8) - end - - def render_flash_messages - html = [] - flash.each do |_type, _message| - alert_type = case _type - when :notice then :success - when :alert, :error then :danger - end - html << content_tag(:div, class: "alert alert-#{alert_type}"){ _message } - end - html.join("\n").html_safe - end - - def commit_tag(sha1) - content_tag(:span, truncate(sha1, length: 10, omission: ""), class: "commit-sha") - end -end diff --git a/app/helpers/deposits_helper.rb b/app/helpers/deposits_helper.rb deleted file mode 100644 index 3cf0cb4a..00000000 --- a/app/helpers/deposits_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module DepositsHelper -end diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb deleted file mode 100644 index 23de56ac..00000000 --- a/app/helpers/home_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module HomeHelper -end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb deleted file mode 100644 index 6189890b..00000000 --- a/app/helpers/projects_helper.rb +++ /dev/null @@ -1,32 +0,0 @@ -module ProjectsHelper - - def shield_btc_amount amount - btc_amount = to_btc amount - "%.#{9 - btc_amount.to_i.to_s.length}f Ƀ" % btc_amount - end - - def shield_color project - last_tip = project.tips.order(:created_at).last - if last_tip.nil? || (Time.now - last_tip.created_at > 30.days) - 'red' - elsif (Time.now - last_tip.created_at > 7.days) - 'yellow' - elsif (Time.now - last_tip.created_at > 1.day) - 'yellowgreen' - else - 'green' - end - end - - def pretty_project_path project - "/#{project.host}/#{project.full_name}" - end - - def pretty_project_url project - root_url.gsub(/\/$/,'') + pretty_project_path(project) - end - - def shield_url project - project_url project, format: :svg - end -end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb deleted file mode 100644 index 309f8b2e..00000000 --- a/app/helpers/sessions_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module SessionsHelper -end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb deleted file mode 100644 index 2310a240..00000000 --- a/app/helpers/users_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module UsersHelper -end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb deleted file mode 100644 index 08719dec..00000000 --- a/app/mailers/user_mailer.rb +++ /dev/null @@ -1,16 +0,0 @@ -class UserMailer < ActionMailer::Base - add_template_helper(ApplicationHelper) - - def new_tip user, tip - @user = user - @tip = tip - - mail to: user.email, subject: "You received a tip for your commit" - end - - def check_bitcoin_address user - @user = user - - mail to: user.email, subject: "Check your Bitcoin address" - end -end diff --git a/app/models/ability.rb b/app/models/ability.rb deleted file mode 100644 index 63f6fd78..00000000 --- a/app/models/ability.rb +++ /dev/null @@ -1,9 +0,0 @@ -class Ability - include CanCan::Ability - - def initialize(user) - if user and user.nickname.present? - can [:update, :decide_tip_amounts], Project, collaborators: {login: user.nickname} - end - end -end diff --git a/app/models/collaborator.rb b/app/models/collaborator.rb deleted file mode 100644 index 3c0e6f15..00000000 --- a/app/models/collaborator.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Collaborator < ActiveRecord::Base - belongs_to :project -end diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/app/models/deposit.rb b/app/models/deposit.rb deleted file mode 100644 index 5891a98a..00000000 --- a/app/models/deposit.rb +++ /dev/null @@ -1,29 +0,0 @@ -class Deposit < ActiveRecord::Base - belongs_to :project - - CONFIRMATIONS_NEEDED = 2 - - scope :confirmed, -> { where("confirmations >= #{CONFIRMATIONS_NEEDED}") } - scope :unconfirmed, -> { where("confirmations < #{CONFIRMATIONS_NEEDED}") } - - def confirmed? - confirmations.to_i >= CONFIRMATIONS_NEEDED - end - - def fee - (amount * fee_size).to_i - end - - def available_amount - [amount - fee, 0].max - end - - before_create do - self.fee_size = CONFIG["our_fee"] - end - - def project_name - project.full_name - end - -end diff --git a/app/models/project.rb b/app/models/project.rb deleted file mode 100644 index 5affe082..00000000 --- a/app/models/project.rb +++ /dev/null @@ -1,215 +0,0 @@ -class Project < ActiveRecord::Base - has_many :deposits # todo: only confirmed deposits - has_many :tips, inverse_of: :project - accepts_nested_attributes_for :tips - has_many :collaborators, autosave: true - - has_one :tipping_policies_text, inverse_of: :project - accepts_nested_attributes_for :tipping_policies_text - - validates :full_name, :github_id, uniqueness: true, presence: true - validates :host, inclusion: [ "github", "bitbucket" ], presence: true - - search_syntax do - search_by :text do |scope, phrases| - columns = [:full_name, :host, :description, :language] - scope.where_like(columns => phrases) - end - end - - # before_save :check_tips_to_pay_against_avaiable_amount - - def update_repository_info repo - self.github_id = repo.id - self.name = repo.name - self.full_name = repo.full_name - self.source_full_name = repo.source.full_name rescue '' - self.description = repo.description - self.watchers_count = repo.watchers_count - self.language = repo.language - self.save! - end - - def update_collaborators(repo_collaborators) - existing_collaborators = collaborators - - repo_logins = repo_collaborators.map(&:login) - existing_logins = existing_collaborators.map(&:login) - - existing_collaborators.each do |existing_collaborator| - unless repo_logins.include?(existing_collaborator.login) - existing_collaborator.mark_for_destruction - end - end - - repo_collaborators.each do |repo_collaborator| - unless existing_logins.include?(repo_collaborator.login) - collaborators.build(login: repo_collaborator.login) - end - end - - save! - end - - def repository_client - if host.present? - host.classify.constantize.new - end - end - - def github_url - repository_client.repository_url self - end - - def source_github_url - repository_client.source_repository_url self - end - - def raw_commits - repository_client.commits self - end - - def repository_info - repository_client.repository_info self - end - - def collaborators_info - repository_client.collaborators_info self - end - - def branches - repository_client.branches self - end - - def new_commits - begin - commits = Timeout::timeout(90) do - raw_commits. - # Filter merge request - select{|c| !(c.commit.message =~ /^(Merge\s|auto\smerge)/)}. - # Filter fake emails - select{|c| c.commit.author.email =~ Devise::email_regexp }. - # Filter commited after t4c project creation - select{|c| c.commit.committer.date > self.deposits.first.created_at }. - to_a. - # tip for older commits first - reverse - end - rescue Octokit::BadGateway, Octokit::NotFound, Octokit::InternalServerError, Octokit::Forbidden, - Errno::ETIMEDOUT, Net::ReadTimeout, Faraday::Error::ConnectionFailed => e - Rails.logger.info "Project ##{id}: #{e.class} happened" - rescue StandardError => e - Airbrake.notify(e) - end - sleep(1) - commits || [] - end - - def tip_commits - new_commits.each do |commit| - Project.transaction do - tip_for commit - update_attribute :last_commit, commit.sha - end - end - end - - def tip_for commit - if (next_tip_amount > 0) && !Tip.exists?(commit: commit.sha) - - user = User.find_or_create_with_commit commit - user.update(nickname: commit.author.login) if commit.author.try(:login) - - if hold_tips - amount = nil - else - amount = next_tip_amount - end - - # create tip - tip = tips.create({ user: user, - amount: amount, - commit: commit.sha, - commit_message: commit.commit.message }) - - tip.notify_user - - Rails.logger.info " Tip created #{tip.inspect}" - end - end - - def donated - self.deposits.confirmed.map(&:available_amount).sum - end - - def available_amount - donated - tips_paid_amount - end - - def unconfirmed_amount - self.deposits.unconfirmed.where('created_at > ?', 7.days.ago).map(&:available_amount).sum - end - - def tips_paid_amount - self.tips.decided.non_refunded.sum(:amount) - end - - def tips_paid_unclaimed_amount - self.tips.decided.non_refunded.unclaimed.sum(:amount) - end - - def next_tip_amount - (CONFIG["tip"]*available_amount).ceil - end - - def update_cache - update available_amount_cache: available_amount - end - - def self.update_cache - find_each do |project| - project.update_cache - end - end - - def update_info - begin - update_repository_info(repository_info) - update_collaborators(collaborators_info) - rescue Octokit::BadGateway, Octokit::NotFound, Octokit::InternalServerError, Octokit::Forbidden, - Errno::ETIMEDOUT, Net::ReadTimeout, Faraday::Error::ConnectionFailed => e - Rails.logger.info "Project ##{id}: #{e.class} happened" - rescue StandardError => e - Airbrake.notify(e) - end - end - - def amount_to_pay - tips.to_pay.sum(:amount) - end - - def has_undecided_tips? - tips.undecided.any? - end - - def commit_url(commit) - repository_client.commit_url(self, commit) - end - - def check_tips_to_pay_against_avaiable_amount - if available_amount < 0 - raise "Not enough funds to pay the pending tips on #{inspect} (#{available_amount} < 0)" - end - end - - def self.find_or_create_by_url project_url - - project_name = project_url. - gsub(/https?\:\/\/github.com\//, ''). - gsub(/\#.+$/, ''). - gsub(' ', '') - - Github.new.find_or_create_project project_name - - end -end diff --git a/app/models/sendmany.rb b/app/models/sendmany.rb deleted file mode 100644 index 6ef75fbc..00000000 --- a/app/models/sendmany.rb +++ /dev/null @@ -1,28 +0,0 @@ -class Sendmany < ActiveRecord::Base - has_many :tips - - def total_amount - JSON.parse(data).values.map(&:to_d).sum if data - end - - def send_transaction - return if txid || is_error - - update_attribute :is_error, true # it's a lock to prevent duplicates - - uri = URI("https://blockchain.info/merchant/#{CONFIG["blockchain_info"]["guid"]}/sendmany") - params = { password: CONFIG["blockchain_info"]["password"], recipients: data } - uri.query = URI.encode_www_form(params) - res = Net::HTTP.get_response(uri) - if res.is_a?(Net::HTTPSuccess) && (json = JSON.parse(res.body)) - Rails.logger.info res.body - update_attribute :result, json - if !(txid = json["tx_hash"]).blank? - update_attribute :is_error, false - update_attribute :txid, json["tx_hash"] - end - else - Rails.logger.error "Failed to get correct response from blockchain.info" - end - end -end diff --git a/app/models/tip.rb b/app/models/tip.rb deleted file mode 100644 index 4620d4e5..00000000 --- a/app/models/tip.rb +++ /dev/null @@ -1,159 +0,0 @@ -class Tip < ActiveRecord::Base - belongs_to :user - belongs_to :sendmany - belongs_to :project, inverse_of: :tips - - AVAILABLE_AMOUNTS = [ - ['undecided', ""], - ['free', 0], - ['tiny', 0.1], - ['small', 0.5], - ['normal', 1], - ['big', 2], - ['huge', 5] - ] - - validates :amount, numericality: { greater_or_equal_than: 0, allow_nil: true } - - scope :not_sent, -> { where(sendmany_id: nil) } - def not_sent? - sendmany_id.nil? - end - - scope :unpaid, -> { non_refunded.not_sent } - def unpaid? - non_refunded? and not_sent? - end - - scope :to_pay, -> { unpaid.decided.not_free.with_address } - def to_pay? - unpaid? and decided? and !free? and with_address? - end - - scope :free, -> { where('amount = 0') } - scope :not_free, -> { where('amount > 0') } - def free? - amount == 0 - end - - scope :paid, -> { where.not(sendmany_id: nil) } - def paid? - !!sendmany_id - end - - scope :refunded, -> { where.not(refunded_at: nil) } - def refunded? - !!refunded_at - end - - scope :non_refunded, -> { where(refunded_at: nil) } - def non_refunded? - !refunded? - end - - scope :unclaimed, -> { joins(:user). - unpaid. - where('users.bitcoin_address' => ['', nil]) } - def claimed? - paid? || user.bitcoin_address.present? - end - def unclaimed? - !claimed? - end - - scope :with_address, -> { joins(:user).where.not('users.bitcoin_address' => ['', nil]) } - def with_address? - user.bitcoin_address.present? - end - - scope :decided, -> { where.not(amount: nil) } - scope :undecided, -> { where(amount: nil) } - def decided? - !!amount - end - def undecided? - !decided? - end - - before_save :check_amount_against_project - before_save :touch_decided_at_if_decided - after_save :notify_user_if_just_decided - - def self.refund_unclaimed - unclaimed.non_refunded. - where.not(decided_at: nil). - where('tips.decided_at < ?', 1.month.ago). - find_each do |tip| - tip.touch :refunded_at - end - end - - def self.auto_decide_older_tips - undecided.non_refunded. - where('tips.created_at < ?', 1.month.ago). - find_each do |tip| - tip.amount_percentage = 1 - tip.save - end - end - - def commit_url - project.commit_url(commit) - end - - def amount_percentage - nil - end - - def amount_percentage=(percentage) - if undecided? and percentage.present? and AVAILABLE_AMOUNTS.map(&:last).compact.map(&:to_s).include?(percentage.to_s) - self.amount = (project.available_amount * (percentage.to_f / 100)).ceil - end - end - - def notify_user - if amount && amount > 0 && user.bitcoin_address.blank? && - !user.unsubscribed && !project.disable_notifications && - user.balance > 21000000*1e8 - if user.notified_at.nil? or user.notified_at < 30.days.ago - begin - UserMailer.new_tip(user, self).deliver - user.touch :notified_at - rescue Net::SMTPServerBusy => e - Rails.logger.info "Error: #{e.class}: #{e.message}" - end - end - end - end - - def notify_user_if_just_decided - notify_user if amount_was.nil? and amount - end - - def check_amount_against_project - if amount && amount_changed? - available_amount = project.available_amount - available_amount -= amount_was if amount_was - if amount > available_amount - raise "Not enough funds on project to save #{inspect} (available: #{available_amount}). Project #{project.inspect} available_amount: #{project.available_amount} #{project.tips.count} tips: #{project.tips.map(&:amount).join(', ')}" - end - end - end - - def touch_decided_at_if_decided - self.decided_at = Time.now if amount_changed? && decided? - end - - def project_name - project.full_name - end - - def user_name - user.display_name - end - - def txid - try(:sendmany).try(:txid) - end - -end diff --git a/app/models/tipping_policies_text.rb b/app/models/tipping_policies_text.rb deleted file mode 100644 index eaf490f2..00000000 --- a/app/models/tipping_policies_text.rb +++ /dev/null @@ -1,4 +0,0 @@ -class TippingPoliciesText < ActiveRecord::Base - belongs_to :project - belongs_to :user -end diff --git a/app/models/user.rb b/app/models/user.rb deleted file mode 100644 index 90ec7df1..00000000 --- a/app/models/user.rb +++ /dev/null @@ -1,74 +0,0 @@ -class User < ActiveRecord::Base - # Include default devise modules. Others available are: - # :lockable, :timeoutable - devise :database_authenticatable, :registerable, :recoverable, - :rememberable, :trackable, :validatable, :confirmable - - devise :omniauthable, :omniauth_providers => [:github] - - # Validations - validates :bitcoin_address, bitcoin_address: true - - # Associations - has_many :tips - - # Callbacks - before_create :set_login_token!, unless: :login_token? - - # Instance Methods - def github_url - "https://github.com/#{nickname}" - end - - def balance - tips.decided.unpaid.sum(:amount) - end - - def display_name - attributes['display_name'].presence || name.presence || nickname.presence || email - end - - def subscribed? - !unsubscribed? - end - - # Class Methods - def self.update_cache - includes(:tips).find_each do |user| - user.update commits_count: user.tips.count - user.update withdrawn_amount: user.tips.paid.sum(:amount) - end - end - - def self.create_with_omniauth!(auth_info) - generated_password = Devise.friendly_token.first(Devise.password_length.min) - create do |user| - user.email = auth_info.primary_email - user.password = generated_password - user.nickname = auth_info.nickname - user.skip_confirmation! - end - end - - def self.find_or_create_with_commit commit - author = commit.commit.author - nickname = commit.author.try(:login) - user = find_by(nickname: nickname) if nickname - user || where(email: author.email).first_or_create do |user| - user.email = author.email - user.password = Devise.friendly_token.first(Devise.password_length.min) - user.name = author.name - user.nickname = nickname - user.skip_confirmation! - end - end - - private - - def set_login_token! - loop do - self.login_token = SecureRandom.urlsafe_base64 - break login_token unless User.exists?(login_token: login_token) - end - end -end diff --git a/app/services/bitbucket.rb b/app/services/bitbucket.rb deleted file mode 100644 index 207e050a..00000000 --- a/app/services/bitbucket.rb +++ /dev/null @@ -1,82 +0,0 @@ -require 'sawyer' - -class Bitbucket - Repository = Struct.new :id, :name, :full_name, :source_full_name, :description, :watchers_count, :language - - Changeset = Struct.new :sha, :commit, :author - Commit = Struct.new :author, :message, :commiter - Committer = Struct.new :date - Author = Struct.new :email, :name - - attr_reader :agent - - def initialize - @agent = Sawyer::Agent.new("https://bitbucket.org") - end - - def repository_info repository - data = request :get, repository_path(repository.full_name) - - Repository.new( - data.slug, - data.name, - repository.full_name, - (data.fork_of.owner + "/" + data.fork_of.slug rescue ''), - data.description, - data.followers_count, - data.language) - end - - def collaborators_info project - # TODO - [] - end - - def branches project - # TODO - ['master'] - end - - def commits repository - # todo use repository.branch - data = request :get, changesets_path(repository.full_name) - - data.changesets.map do |cs| - author_pieces = cs.raw_author.match(/^(.*) <(.*@.*)>$/) - - date = DateTime.parse(cs.utctimestamp) - author = Author.new(author_pieces[2], author_pieces[1]) - commit = Commit.new(author, cs.message, Committer.new(date)) - Changeset.new(cs.raw_node, commit) - end - end - - def repository_url project - "https://bitbucket.org/#{project.full_name}" - end - - def source_repository_url project - "https://bitbucket.org/#{project.source_full_name}" - end - - def commit_url project, commit - "https://bitbucket.org/#{project.full_name}/commits/#{commit}" - end - - protected - def repository_path full_name - "#{base_path}#{full_name}" - end - - def changesets_path full_name - "#{base_path}#{full_name}/changesets?limit=15" - end - - def base_path - "/api/1.0/repositories/" - end - - def request method, path - agent.call(method, path).data - end -end diff --git a/app/services/github.rb b/app/services/github.rb deleted file mode 100644 index 103c3cb9..00000000 --- a/app/services/github.rb +++ /dev/null @@ -1,90 +0,0 @@ -class Github - def initialize - options = { client_id: CONFIG['github']['key'], client_secret: CONFIG['github']['secret'] } - if CONFIG['github']['auto_paginate'] - options.merge! :auto_paginate => true - else - options.merge! :per_page => 100 - end - @client = Octokit::Client.new(options) - end - - attr_reader :client - - def commits project - if project.branch.blank? - commits = client.commits project.full_name - else - commits = client.commits project.full_name, sha: project.branch - end - - last_response = client.last_response - pages = (CONFIG['github']['project_pages'][project.full_name] || CONFIG['github']['pages'] || 1).to_i - (pages - 1).times do - if last_response.rels[:next] - last_response = last_response.rels[:next].get - commits += last_response.data - end - end - - commits - end - - def repository_info project - if project.is_a?(String) - client.repo project - elsif project.is_a?(Project) - if project.github_id.present? - client.get "/repositories/#{project.github_id}" - else - client.repo project.full_name - end - else - raise 'Unknown parameter class' - end - end - - def find_or_create_project project_name - if project = Project.find_by(host: "github", full_name: project_name) - project - elsif project_name =~ /\w+\/\w+/ - begin - repo = repository_info project_name - project = Project.find_or_create_by host: "github", full_name: repo.full_name - project.update_repository_info repo - project - rescue Octokit::NotFound - nil - end - else - nil - end - end - - def collaborators_info project - client.get("/repos/#{project.full_name}/collaborators") + - (client.get("/orgs/#{project.full_name.split('/').first}/members") rescue []) - end - - def branches project - branches = client.get("/repos/#{project.full_name}/branches") - last_response = client.last_response - while last_response && last_response.rels[:next] - last_response = last_response.rels[:next].get - branches += last_response.data - end - branches.map(&:name) - end - - def repository_url project - "https://github.com/#{project.full_name}" - end - - def source_repository_url project - "https://github.com/#{project.source_full_name}" - end - - def commit_url project, commit - "https://github.com/#{project.full_name}/commit/#{commit}" - end -end diff --git a/app/views/common/_menu.html.haml b/app/views/common/_menu.html.haml deleted file mode 100644 index a51fce91..00000000 --- a/app/views/common/_menu.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%ul.nav.nav-justified - %li{class: controller_name == 'home' ? 'active' : ''} - %a{href: root_path}= t('menu.home') - %li{class: controller_name == 'projects' || @project ? 'active' : ''} - %a{href: projects_path}= t('menu.projects') diff --git a/app/views/deposits/index.html.haml b/app/views/deposits/index.html.haml deleted file mode 100644 index 7950e74d..00000000 --- a/app/views/deposits/index.html.haml +++ /dev/null @@ -1,28 +0,0 @@ -%h1 - - if @project - = raw t('.project_deposits', project: link_to(@project.full_name, pretty_project_path(@project))) - - else - = t('.deposits') -%p - %table.table.table-striped - %thead - %tr - %th= t('.created_at') - - unless @project - %th= t('.project') - %th= t('.amount') - %th= t('.fee') - %th= t('.transaction') - %th= t('.confirmed') - %tbody - - @deposits.each do |deposit| - %tr - %td= l deposit.created_at, format: :short - - unless @project - %td= link_to(deposit.project.full_name, pretty_project_path(deposit.project)) - %td= btc_human deposit.amount - %td= btc_human deposit.fee - %td= link_to deposit.txid, "https://blockchain.info/tx/#{deposit.txid}", target: :blank - %td= deposit.confirmed? ? t('.confirmed_yes') : t('.confirmed_no') - - = paginate @deposits diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml deleted file mode 100644 index 98616ee4..00000000 --- a/app/views/devise/confirmations/new.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -= twitter_bootstrap_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, class: 'form-devise' }) do |f| - %h2= t('.title') - = devise_error_messages! - = f.email_field :email, :autofocus => true - = f.submit t('.submit') - %p - = render "devise/shared/links" diff --git a/app/views/devise/mailer/confirmation_instructions.html.haml b/app/views/devise/mailer/confirmation_instructions.html.haml deleted file mode 100644 index dfa5989a..00000000 --- a/app/views/devise/mailer/confirmation_instructions.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%p - Welcome #{@email}! -%p You can confirm your account email through the link below: -%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml deleted file mode 100644 index eda27ee3..00000000 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%p - Hello #{@resource.email}! -%p Someone has requested a link to change your password. You can do this through the link below. -%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) -%p If you didn't request this, please ignore this email. -%p Your password won't change until you access the link above and create a new one. diff --git a/app/views/devise/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml deleted file mode 100644 index 47f55a54..00000000 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%p - Hello #{@resource.email}! -%p Your account has been locked due to an excessive number of unsuccessful sign in attempts. -%p Click the link below to unlock your account: -%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml deleted file mode 100644 index 64d97232..00000000 --- a/app/views/devise/passwords/edit.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -= twitter_bootstrap_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, class: 'form-devise' }) do |f| - %h2= t('.title') - = devise_error_messages! - = f.hidden_field :reset_password_token - = f.password_field :password, :autofocus => true, :autocomplete => "off" - = f.password_field :password_confirmation, :autocomplete => "off" - = f.submit t('.submit') - %p - = render "devise/shared/links" diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml deleted file mode 100644 index 0099a39b..00000000 --- a/app/views/devise/passwords/new.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -= twitter_bootstrap_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, class: 'form-devise', role: 'form' }) do |f| - %h2= t('.title') - = devise_error_messages! - = f.email_field :email, :autofocus => true - = f.submit t('.submit') - %p - = render "devise/shared/links" diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml deleted file mode 100644 index 3a293c04..00000000 --- a/app/views/devise/registrations/edit.html.haml +++ /dev/null @@ -1,28 +0,0 @@ -= twitter_bootstrap_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, class: 'form-devise' }) do |f| - %h2 - Edit #{resource_name.to_s.humanize} - = devise_error_messages! - = f.email_field :email, :autofocus => true - - if devise_mapping.confirmable? && resource.pending_reconfirmation? - %div - Currently waiting confirmation for: #{resource.unconfirmed_email} - %div - = f.label :password - %i (leave blank if you don't want to change it) - %br/ - = f.password_field :password, :autocomplete => "off" - %div - = f.label :password_confirmation - %br/ - = f.password_field :password_confirmation, :autocomplete => "off" - %div - = f.label :current_password - %i (we need your current password to confirm your changes) - %br/ - = f.password_field :current_password, :autocomplete => "off" - %div= f.submit "Update" - %p - %h3 Cancel my account - %p - Unhappy? #{button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete} - = link_to "Back", :back diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml deleted file mode 100644 index c6070f5c..00000000 --- a/app/views/devise/registrations/new.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -= twitter_bootstrap_form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { class: 'form-devise registration_form'}) do |f| - %h2= t('.title') - = devise_error_messages! - = f.email_field :email, :autofocus => true - = f.password_field :password, :autocomplete => "off" - = f.password_field :password_confirmation, :autocomplete => "off" - = f.submit t('.submit') - %p - = render "devise/shared/links" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml deleted file mode 100644 index 0f3ff00b..00000000 --- a/app/views/devise/sessions/new.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -= twitter_bootstrap_form_for(resource, :as => resource_name, :url => session_path(resource_name), html: {class: 'form-devise session_form' }) do |f| - = devise_error_messages! - %h2= t('.title') - = f.email_field :email, :autofocus => true - = f.password_field :password, :autocomplete => "off" - - if devise_mapping.rememberable? - %div - = f.check_box :remember_me, t('.remember_me') - = f.submit t('.submit') - %p - = render "devise/shared/links" diff --git a/app/views/devise/shared/_links.haml b/app/views/devise/shared/_links.haml deleted file mode 100644 index 122a6754..00000000 --- a/app/views/devise/shared/_links.haml +++ /dev/null @@ -1,19 +0,0 @@ -- if controller_name != 'sessions' - = link_to t('devise.links.sign_in'), new_session_path(resource_name) - %br/ -- if devise_mapping.registerable? && controller_name != 'registrations' - = link_to t('devise.links.sign_up'), new_registration_path(resource_name) - %br/ -- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' - = link_to t('devise.links.recover'), new_password_path(resource_name) - %br/ -- if devise_mapping.confirmable? && controller_name != 'confirmations' - = link_to t('devise.links.confirm'), new_confirmation_path(resource_name) - %br/ -- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' - = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) - %br/ -- if devise_mapping.omniauthable? - - resource_class.omniauth_providers.each do |provider| - = link_to t('devise.links.sign_in_with', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider) - %br/ diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml deleted file mode 100644 index d3c87d07..00000000 --- a/app/views/devise/unlocks/new.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -%h2 Resend unlock instructions -= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| - = devise_error_messages! - %div - = f.label :email - %br/ - = f.email_field :email, :autofocus => true - %div= f.submit "Resend unlock instructions" -= render "devise/shared/links" diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml deleted file mode 100644 index 76c75087..00000000 --- a/app/views/home/index.html.haml +++ /dev/null @@ -1,33 +0,0 @@ -.jumbotron - %h1= t('meta.title') - %p.lead= t('meta.description') - - %a.btn.btn-lg.btn-success{href: projects_path}= t('.see_projects') - -.row - .col-lg-4 - %h2= t('.how_does_it_work.title') - %p= t('.how_does_it_work.text') - %p - %a.btn.btn-primary{href: "https://weusecoins.com/", target: '_blank'} - = t('.how_does_it_work.button') - » - .col-lg-4 - %h2= t('.donate.title') - %p= t('.donate.text') - %p - %a.btn.btn-primary{href: projects_path} - = t('.donate.button') - » - .col-lg-4 - %h2= t('.contribute.title') - %p - = t('.contribute.text') - - if !current_user - = raw t('.contribute.sign_in_text', sign_in_link: link_to(t('links.sign_in'), new_user_session_path)) - - if Devise.mappings[:user].registerable? - = raw t('.contribute.sign_up_text', sign_up_link: link_to(t('links.sign_up'), new_user_registration_path)) - %p - %a.btn.btn-primary{href: projects_path} - = t('.contribute.button') - » diff --git a/app/views/kaminari/_first_page.html.haml b/app/views/kaminari/_first_page.html.haml deleted file mode 100644 index a1bbf186..00000000 --- a/app/views/kaminari/_first_page.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%li - = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote diff --git a/app/views/kaminari/_gap.html.haml b/app/views/kaminari/_gap.html.haml deleted file mode 100644 index dfe33aac..00000000 --- a/app/views/kaminari/_gap.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%li.disabled - = link_to raw(t 'views.pagination.truncate'), '#' diff --git a/app/views/kaminari/_last_page.html.haml b/app/views/kaminari/_last_page.html.haml deleted file mode 100644 index e70697d0..00000000 --- a/app/views/kaminari/_last_page.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%li - = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} diff --git a/app/views/kaminari/_next_page.html.haml b/app/views/kaminari/_next_page.html.haml deleted file mode 100644 index ea9af453..00000000 --- a/app/views/kaminari/_next_page.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%li - = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote diff --git a/app/views/kaminari/_page.html.haml b/app/views/kaminari/_page.html.haml deleted file mode 100644 index 9df7ce02..00000000 --- a/app/views/kaminari/_page.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%li{class: "#{'active' if page.current?}"} - = link_to page, page.current? ? '#' : url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} diff --git a/app/views/kaminari/_paginator.html.haml b/app/views/kaminari/_paginator.html.haml deleted file mode 100644 index d0806f32..00000000 --- a/app/views/kaminari/_paginator.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -= paginator.render do - %ul.pagination - = first_page_tag unless current_page.first? - = prev_page_tag unless current_page.first? - - each_page do |page| - - if page.left_outer? || page.right_outer? || page.inside_window? - = page_tag page - - elsif !page.was_truncated? - = gap_tag - = next_page_tag unless current_page.last? - = last_page_tag unless current_page.last? \ No newline at end of file diff --git a/app/views/kaminari/_prev_page.html.haml b/app/views/kaminari/_prev_page.html.haml deleted file mode 100644 index dab3b318..00000000 --- a/app/views/kaminari/_prev_page.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%li - = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml deleted file mode 100644 index fb318476..00000000 --- a/app/views/layouts/application.html.haml +++ /dev/null @@ -1,74 +0,0 @@ -!!! -%html{lang: "en"} - %head - %meta{charset: "utf-8"}/ - %meta{content: "width=device-width, initial-scale=1.0", name: "viewport"}/ - %meta{content: "", name: "description"}/ - %meta{content: "", name: "author"}/ - %link{href: "/favicon.png", rel: "shortcut icon"}/ - - %title= t('tip4commit') + " — " + (content_for?(:title) ? yield(:title) : " " + t('meta.title')) - - %meta{name: 'description', content: (content_for?(:description) ? yield(:description) : t('meta.description'))} - %meta{name: 'keywords', content: 'open source,contribute,github,community,git,bitcoin,tips,perks'} - / %meta{:property => 'og:image', :content => asset_path('logo.png')} - / %link{:rel => 'image_src', :type => 'image/png', :href => asset_path('logo.png')} - - = stylesheet_link_tag "application", media: "all" - = javascript_include_tag "application" - - :javascript - I18n.locale = "#{I18n.locale}"; - - = csrf_meta_tags - %body - :javascript - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - - ga('create', 'UA-1115214-16', 'tip4commit.com'); - ga('send', 'pageview'); - .container - .masthead - %div.pull-right - %small - - if current_user - = current_user.display_name - \/ - = link_to btc_human(current_user.balance), current_user - \/ - = link_to t('links.sign_out'), destroy_user_session_path, method: :delete - - else - - if controller_name != 'registrations' - = link_to t('links.sign_up'), new_user_registration_path - - unless %w{sessions registrations}.include? controller_name - = " or " - - if controller_name != 'sessions' - = link_to t('links.sign_in'), new_user_session_path - - %h3.text-muted.code-pro= t('tip4commit') - - = render 'common/menu' - - %br - - = render_flash_messages - - = yield - - .footer - .alert.alert-warning - We are not affiliated with most of the projects, their owners might not endorse use of tip4commit. - - - %p.pull-right - - ::Rails.application.config.available_locales.each do |locale| - = link_to image_tag("flags/#{locale}.png"), "?locale=#{locale}", data: {no_turbolink: true} - %p - © - = link_to t('tip4commit'), 'http://tip4commit.com/', target: '_blank' - 2013-#{Date.today.year}. - = raw t('footer.text', github_link: link_to(t('footer.github_link'), 'https://github.com/tip4commit/tip4commit', target: '_blank'), support_link: link_to(t('footer.support_link'), 'http://tip4commit.com/projects/307')) - = link_to t('footer.follow_link'), 'https://twitter.com/tip4commit', target: '_blank' diff --git a/app/views/projects/decide_tip_amounts.html.haml b/app/views/projects/decide_tip_amounts.html.haml deleted file mode 100644 index 423d65fe..00000000 --- a/app/views/projects/decide_tip_amounts.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -= bootstrap_form_for @project, url: decide_tip_amounts_project_path(@project) do |f| - %table.table.table-hover.decide-tip-amounts-table - %thead - %tr - %th= t('.commit') - %th= t('.author') - %th= t('.message') - %th= t('.tip') - %tbody - = f.fields_for(:tips, @project.tips.undecided) do |tip_fields| - = tip_fields.hidden_field :id - - tip = tip_fields.object - %tr - %td= link_to commit_tag(tip.commit), tip.commit_url, target: '_blank' - %td= tip.user.nickname - %td= simple_format tip.commit_message - %td - - Tip::AVAILABLE_AMOUNTS.each do |amount| - = tip_fields.radio_button :amount_percentage, amount[1], inline: true, label: t(amount[0], scope: 'tip_amounts') - - .text-center - = f.submit t('.submit') diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml deleted file mode 100644 index 5e4e5104..00000000 --- a/app/views/projects/edit.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -- content_for :title do - = t('.project_settings', project: @project.full_name) - -%h1= t('.project_settings', project: @project.full_name) -.row - .col-md-12 - = bootstrap_form_for @project do |f| - = f.select :branch, @project.branches, label: t('.branch'), include_blank: t('.default_branch') - = f.fields_for :tipping_policies_text, @project.tipping_policies_text || @project.build_tipping_policies_text do |fields| - = fields.text_area :text, rows: 10, label: t('.tipping_policies') - = f.check_box :hold_tips, label: t('.hold_tips') - = f.check_box :disable_notifications, label: t('.disable_notifications') - = f.submit t('.save'), class: "btn btn-default" diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml deleted file mode 100644 index a6c1445a..00000000 --- a/app/views/projects/index.html.haml +++ /dev/null @@ -1,39 +0,0 @@ -%h1= t('menu.projects') -%p - = form_tag search_projects_path, role: 'form', method: :get do |f| - .form-group - .row - .col-lg-12 - .input-group - = text_field_tag :query, '', class: 'form-control', placeholder: t('.find_project.placeholder'), :value => params[:query] - = hidden_field_tag :order, params[:order] || 'balance' - %span.input-group-btn - = button_tag t('.find_project.button'), class: "btn btn-default", name: nil -%p - - if @projects.count > 0 - %table.table.table-striped - %thead - %tr - %th= link_to_unless_current t('.repository'), params.merge(:order => 'repository') - %th= link_to_unless_current t('.description'), params.merge(:order => 'description') - %th= link_to_unless_current t('.watchers'), params.merge(:order => 'watchers') - %th= link_to_unless params[:order].blank? || params[:order] == 'balance', t('.balance'), params.merge(:order => 'balance') - %th - %tbody - - @projects.each do |project| - %tr - %td - %strong= link_to project.full_name, pretty_project_path(project) - - if !project.source_full_name.blank? - %br - %nobr - %small - = t('.forked_from') - = link_to project.source_full_name, project.source_github_url, target: '_blank' - %td= project.description - %td= project.watchers_count - %td= btc_human project.available_amount_cache - %td= link_to t('.support'), pretty_project_path(project), class: 'btn btn-xs btn-success' - = paginate @projects - - else - .alert.alert-warning{role: 'alert'}= I18n.t('errors.project_not_found') diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml deleted file mode 100644 index 48043f1f..00000000 --- a/app/views/projects/show.html.haml +++ /dev/null @@ -1,145 +0,0 @@ -- content_for :title do - = t('.title', project: @project.name) -- content_for :description do - = @project.description - -- if @project.disable_notifications - .alert.alert-danger= t('.disabled_notifications') - -%h1 - = @project.full_name - %small= link_to glyph(:github), @project.github_url, target: '_blank' - .pull-right - - if can? :update, @project - = link_to t('.edit_project'), edit_project_path(@project), class: "btn btn-primary" - - if can? :decide_tip_amounts, @project and @project.has_undecided_tips? - = link_to t('.decide_tip_amounts'), decide_tip_amounts_project_path(@project), class: "btn btn-warning" - -.row - .col-md-4 - .panel.panel-default - .panel-heading - %h4.panel-title= t('.project_sponsors') - .panel-body - %iframe{ src: "//coingiving.com/project_sponsors?locale=#{I18n.locale}&url=#{project_url(@project, :protocol => 'https')}", scrolling: "no", style: 'width:100%; height:500px; border:0px; padding:0;overflow:hidden'} - .hidden - %span(data-coingiving="title")= "[tip4commit] " + @project.full_name - %span(data-coingiving="description")= @project.description - %span(data-coingiving="bitcoin-address")= @project.bitcoin_address - %p= t('.fee', percentage: number_to_percentage(100-CONFIG["our_fee"]*100, precision: 0)) - .col-md-8 - - unless @project.description.blank? - .well.well-sm= @project.description - %h4 - = t('.balance') - - if @project.deposits.count > 0 - %small= link_to t('.deposits'), project_deposits_path(@project) - = btc_human @project.available_amount - - if @project.hold_tips? - = t('.custom_tip_size') - - else - = t('.default_tip_size', percentage: number_to_percentage(CONFIG["tip"]*100, precision: 0)) - - if @project.unconfirmed_amount > 0 - = raw t('.unconfirmed_amount', amount: btc_human(@project.unconfirmed_amount)) - - - if @project.tipping_policies_text.try(:text).present? - %h4= t('.tipping_policies') - = simple_format @project.tipping_policies_text.text - %small - %em - - user = @project.tipping_policies_text.user - - name = user.nickname.presence || user.name if user - - date = l(@project.tipping_policies_text.updated_at) - - if name.present? - = t('.updated_by_user', name: name, date: date) - - else - = t('.updated_by_unknown', date: date) - - %h4= t('.tips_paid') - = btc_human @project.tips_paid_amount - - if (tips_paid_unclaimed_amount = @project.tips_paid_unclaimed_amount) > 0 - = raw t('.unclaimed_amount', amount: btc_human(tips_paid_unclaimed_amount)) - - - if @project_tips.count > 0 - %h4 - =t('.last_tips') - - if @project_tips.count > 5 - %small= link_to t('.see_all'), project_tips_path(@project) - %ul - - @recent_tips.each do |tip| - %li - = l tip.created_at, format: :short - - if tip.user.nickname.blank? - = tip.user.display_name - - else - = link_to tip.user.display_name, "https://github.com/#{tip.user.nickname}", target: '_blank' - - if tip.decided? - = raw t('.received', amount: btc_human(tip.amount)) - - else - = t('.will_receive') - = t('.for_commit') - = link_to tip.commit[0..6], "https://github.com/#{@project.full_name}/commit/#{tip.commit}", target: :blank - - if tip.undecided? - = t('.when_decided') - - - if @project.next_tip_amount > 0 - %h4= t('.next_tip') - = btc_human @project.next_tip_amount - - %h4= t('.contribute_and_earn') - = raw t('.contribute_and_earn_description', make_commits_link: link_to(t('.make_commits_link'), @project.github_url, target: '_blank'), branch: @project.branch.present? ? t('.contribute_and_earn_branch', branch: @project.branch) : '') - - - if current_user - - if current_user.bitcoin_address.blank? - = raw t('.tell_us_bitcoin_address', tell_us_link: link_to(t('.tell_us_link'), current_user)) - - else - = raw t('.sign_in', sign_in_link: link_to(t('links.sign_in_imp'), new_user_session_path)) - - %h4= t('.promote_project', project: @project.full_name) - %p - / AddThis Button BEGIN - .addthis_toolbox.addthis_default_style.addthis_32x32_style(addthis:data_track_clickback="false" addthis:data_track_addressbar="false" - addthis:ui_language="#{I18n.locale}") - %a.addthis_button_preferred_1 - %a.addthis_button_preferred_2 - %a.addthis_button_preferred_3 - %a.addthis_button_preferred_4 - %a.addthis_button_compact - %a.addthis_counter.addthis_bubble_style - / AddThis Button END - - %h4= t('.embedding') - %p= link_to image_tag(shield_url(@project), alt: t('tip4commit')), pretty_project_url(@project) - %form.form-horizontal - %div.form-group - %label.control-label.col-sm-2{for: 'image_url'}= t('.image_url') - %div.col-sm-10 - %input.form-control{id: 'image_url', type: 'text', value: "#{shield_url(@project)}"} - %div.form-group - %label.control-label.col-sm-2{for: 'markdown_text'} Markdown: - %div.col-sm-10 - %input.form-control{id: 'markdown_text', type: 'text', value: "[![#{t('.shield_title')}](#{shield_url(@project)})](#{pretty_project_url(@project)})"} - %div.form-group - %label.control-label.col-sm-2{for: 'textile_text'} Textile: - %div.col-sm-10 - %input.form-control{id: 'textile_text', type: 'text', value: "!#{shield_url(@project)}!:#{pretty_project_url(@project)}"} - %div.form-group - %label.control-label.col-sm-2{for: 'rdoc_text'} RDOC: - %div.col-sm-10 - %input.form-control{id: 'rdoc_text', type: 'text', value: "{\"#{t('.shield_title')}\"}[#{pretty_project_url(@project)}]"} - %div.form-group - %label.control-label.col-sm-2{for: 'asciidoc_text'} AsciiDoc: - %div.col-sm-10 - %input.form-control{id: 'asciidoc_text', type: 'text', value: "image:#{shield_url(@project)}[\"#{t('.shield_title')}\", link=\"#{pretty_project_url(@project)}\"]"} - %div.form-group - %label.control-label.col-sm-2{for: 'rst_text'} Rst: - %div.col-sm-10 - %input.form-control{id: 'rst_text', type: 'text', value: ".. image:: #{shield_url(@project)} :target: #{pretty_project_url(@project)}"} - %div.form-group - %label.control-label.col-sm-2{for: 'pod_text'} POD: - %div.col-sm-10 - %input.form-control{id: 'pod_text', type: 'text', value: "=for HTML "} - %div.form-group - %label.control-label.col-sm-2{for: 'bbcode_text'} BBCode: - %div.col-sm-10 - %input.form-control{id: 'bbcode_text', type: 'text', value: "[url=#{pretty_project_url(@project)}][img]#{shield_url(@project)}[/img][/url]"} diff --git a/app/views/projects/show.svg.erb b/app/views/projects/show.svg.erb deleted file mode 100644 index c4fd0a57..00000000 --- a/app/views/projects/show.svg.erb +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tip4commit - - - - - - - - <%= shield_btc_amount @project.next_tip_amount %> - - - diff --git a/app/views/tips/index.html.haml b/app/views/tips/index.html.haml deleted file mode 100644 index ded8f6e0..00000000 --- a/app/views/tips/index.html.haml +++ /dev/null @@ -1,53 +0,0 @@ -%h1 - - if @project - = raw t('.project_tips', project: link_to(@project.full_name, pretty_project_path(@project))) - - elsif @user - = raw t('.user_tips', user: link_to(@user.display_name, @user)) - - else - = t('.tips') -%p - %table.table.table-striped - %thead - %tr - %th= t('.created_at') - - unless @user - %th= t('.commiter') - - unless @project - %th= t('.project') - %th= t('.commit') - %th= t('.amount') - %th= t('.withdrawal') - %tbody - - @tips.each do |tip| - %tr - %td= l tip.created_at, format: :short - - unless @user - %td - - if tip.user.nickname.blank? - = tip.user.display_name - - else - = link_to tip.user.display_name, "https://github.com/#{tip.user.nickname}", target: '_blank' - - unless @project - %td= link_to tip.project.full_name, pretty_project_path(tip.project) - %td= link_to tip.commit[0..6], "https://github.com/#{tip.project.full_name}/commit/#{tip.commit}", target: :blank - %td= btc_human tip.amount - %td - - if tip.sendmany.nil? - - if tip.refunded_at - = t('.refunded') - - elsif tip.undecided? - = t('.undecided') - - elsif tip.user.bitcoin_address.blank? - = t('.no_bitcoin_address') - - elsif tip.user.balance < CONFIG["min_payout"] - = t('.below_threshold') - - else - = t('.waiting') - - else - - if tip.sendmany.txid.present? - = link_to tip.sendmany.txid, "https://blockchain.info/tx/#{tip.sendmany.txid}", target: :blank - - else - = t('.waiting') - - if tip.sendmany.is_error - = t('.error') - = paginate @tips diff --git a/app/views/user_mailer/check_bitcoin_address.html.haml b/app/views/user_mailer/check_bitcoin_address.html.haml deleted file mode 100644 index 5d19ec4a..00000000 --- a/app/views/user_mailer/check_bitcoin_address.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -%h4 Hello, #{@user.display_name}! - -%p Recently, we discovered a security breach in our system and it's possible that someone changed your Bitcoin address. Please check it: - -%p - %strong= @user.bitcoin_address - -%p - If this address is not yours, please - = link_to 'update it', login_users_url(token: @user.login_token) - -%p Thank you for contributing to Open Source and sorry for troubles! - -%p= link_to "tip4commit.com", "http://tip4commit.com/" diff --git a/app/views/user_mailer/new_tip.html.haml b/app/views/user_mailer/new_tip.html.haml deleted file mode 100644 index cb7f9d30..00000000 --- a/app/views/user_mailer/new_tip.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -%h4 Hello, #{@user.display_name}! - -%p You were tipped #{btc_human @tip.amount} for your commit on Project #{@tip.project.full_name}. Please, log in and tell us your bitcoin address to get it. - -%p Your current balance is #{btc_human @user.balance}. If you don't enter a bitcoin address your tips will be returned to the project in 30 days. - -%p If you don't need bitcoins you can redirect your funds to any charity by using its address which you can find at #{link_to 'coingiving.com', 'https://coingiving.com/'}. - -%p= link_to 'Sign In', login_users_url(token: @user.login_token) - -%p Thanks for contributing to Open Source! - -%p= link_to "tip4commit.com", "https://tip4commit.com/" - -%p - %small - = link_to "Don't notify me anymore, I don't need tips.", login_users_url(token: @user.login_token, unsubscribe: true) - - -.alert.alert-warning We are not affiliated with most of the projects, their owners might not endorse use of tip4commit. diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml deleted file mode 100644 index 13b5d405..00000000 --- a/app/views/users/index.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -%h1= t('.title') -%p - %table.table.table-striped - %thead - %tr - %th= t('.name') - %th= t('.commits_count') - %th= t('.withdrawn') - %tbody - - @users.each do |user| - %tr - %td - - if user.nickname.blank? - = user.display_name - - else - = link_to user.display_name, "https://github.com/#{user.nickname}", target: '_blank' - %td= user.commits_count - %td= btc_human user.withdrawn_amount - = paginate @users diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml deleted file mode 100644 index 41e3ff16..00000000 --- a/app/views/users/show.html.haml +++ /dev/null @@ -1,37 +0,0 @@ -%h1= @user.display_name -%p - %strong= t('.balance') -%p - = btc_human @user.balance -%p - %small= raw t('.threshold', threshold: btc_human(CONFIG["min_payout"])) - -- if @user_tips.count > 0 - %p - %strong Last Tips - - if @user_tips.count > 5 - = link_to t('.see_all'), user_tips_path(@user) - %ul - - @recent_tips.each do |tip| - %li - = raw t('.received', time: l(tip.created_at, format: :short), amount: btc_human(tip.amount), commit: link_to(tip.commit[0..6], "https://github.com/#{tip.project.full_name}/commit/#{tip.commit}", target: :blank), project: link_to(tip.project.full_name, tip.project)) - -%p - %strong= User.human_attribute_name(:email) -%p= @user.email -= twitter_bootstrap_form_for @user do |f| - = f.text_field :bitcoin_address, placeholder: t('.bitcoin_address_placeholder') - = f.text_field :display_name - - if f.object.bitcoin_address.blank? - = f.check_box :unsubscribed, t('.notify'), { checked: !f.object.unsubscribed? }, '0', '1' - %br - = f.submit t('.submit_user') -%br -%p - %strong= link_to t('.change_password'), '#new_password_form', data: {toggle: "collapse"} - -= twitter_bootstrap_form_for @user, html: {class: (params[:new_password] ? '' : 'collapse'), id: 'new_password_form'} do |f| - = hidden_field_tag :new_password, value: true - = f.password_field :password, autofocus: true, autocomplete: "off" - = f.password_field :password_confirmation, autocomplete: "off" - = f.submit t('.submit_password') diff --git a/app/views/withdrawals/index.html.haml b/app/views/withdrawals/index.html.haml deleted file mode 100644 index 9e0825e2..00000000 --- a/app/views/withdrawals/index.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -%h1= t('.title') -%p - %table.table.table-striped - %thead - %tr - %th= t('.created_at') - %th= t('.transaction') - %th= t('.result') - %tbody - - @sendmanies.each do |sendmany| - %tr - %td= l(sendmany.created_at, format: :short) - %td= link_to(sendmany.txid, "https://blockchain.info/tx/#{sendmany.txid}", target: '_blank') - %td= sendmany.is_error ? t('.error') : t('.success') diff --git a/bin/airbrake b/bin/airbrake deleted file mode 100755 index b29b0771..00000000 --- a/bin/airbrake +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'airbrake' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('airbrake', 'airbrake') diff --git a/bin/bundle b/bin/bundle deleted file mode 100755 index 66e9889e..00000000 --- a/bin/bundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') diff --git a/bin/bundler b/bin/bundler deleted file mode 100755 index 72c62ec0..00000000 --- a/bin/bundler +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'bundler' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('bundler', 'bundler') diff --git a/bin/cap b/bin/cap deleted file mode 100755 index 30352d4d..00000000 --- a/bin/cap +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'cap' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('capistrano', 'cap') diff --git a/bin/cdiff b/bin/cdiff deleted file mode 100755 index 066279d2..00000000 --- a/bin/cdiff +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'cdiff' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('term-ansicolor', 'cdiff') diff --git a/bin/colortab b/bin/colortab deleted file mode 100755 index 195df76f..00000000 --- a/bin/colortab +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'colortab' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('term-ansicolor', 'colortab') diff --git a/bin/decolor b/bin/decolor deleted file mode 100755 index 214e8d18..00000000 --- a/bin/decolor +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'decolor' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('term-ansicolor', 'decolor') diff --git a/bin/erubis b/bin/erubis deleted file mode 100755 index 2c7348b8..00000000 --- a/bin/erubis +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'erubis' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('erubis', 'erubis') diff --git a/bin/haml b/bin/haml deleted file mode 100755 index 3c6d074f..00000000 --- a/bin/haml +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'haml' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('haml', 'haml') diff --git a/bin/lessc b/bin/lessc deleted file mode 100755 index 833b943e..00000000 --- a/bin/lessc +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'lessc' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('less', 'lessc') diff --git a/bin/rackup b/bin/rackup deleted file mode 100755 index 8cc9953e..00000000 --- a/bin/rackup +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'rackup' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rack', 'rackup') diff --git a/bin/rails b/bin/rails deleted file mode 100755 index 728cd85a..00000000 --- a/bin/rails +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/bin/rake b/bin/rake deleted file mode 100755 index 17240489..00000000 --- a/bin/rake +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/bin/rdoc b/bin/rdoc deleted file mode 100755 index f57260f3..00000000 --- a/bin/rdoc +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'rdoc' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rdoc', 'rdoc') diff --git a/bin/ri b/bin/ri deleted file mode 100755 index 90f2517d..00000000 --- a/bin/ri +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'ri' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rdoc', 'ri') diff --git a/bin/sass b/bin/sass deleted file mode 100755 index d65bb10a..00000000 --- a/bin/sass +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'sass' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sass', 'sass') diff --git a/bin/sass-convert b/bin/sass-convert deleted file mode 100755 index ddde743f..00000000 --- a/bin/sass-convert +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'sass-convert' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sass', 'sass-convert') diff --git a/bin/scss b/bin/scss deleted file mode 100755 index 9f5e435d..00000000 --- a/bin/scss +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'scss' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sass', 'scss') diff --git a/bin/sdoc b/bin/sdoc deleted file mode 100755 index 9da297e6..00000000 --- a/bin/sdoc +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'sdoc' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sdoc', 'sdoc') diff --git a/bin/sdoc-merge b/bin/sdoc-merge deleted file mode 100755 index e29a7d95..00000000 --- a/bin/sdoc-merge +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'sdoc-merge' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sdoc', 'sdoc-merge') diff --git a/bin/slimrb b/bin/slimrb deleted file mode 100755 index d9152e29..00000000 --- a/bin/slimrb +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'slimrb' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('slim', 'slimrb') diff --git a/bin/sprockets b/bin/sprockets deleted file mode 100755 index 09a1ad18..00000000 --- a/bin/sprockets +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'sprockets' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sprockets', 'sprockets') diff --git a/bin/term_display b/bin/term_display deleted file mode 100755 index d65c316b..00000000 --- a/bin/term_display +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'term_display' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('term-ansicolor', 'term_display') diff --git a/bin/term_mandel b/bin/term_mandel deleted file mode 100755 index c7dd35e6..00000000 --- a/bin/term_mandel +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'term_mandel' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('term-ansicolor', 'term_mandel') diff --git a/bin/thor b/bin/thor deleted file mode 100755 index 8421e001..00000000 --- a/bin/thor +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'thor' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('thor', 'thor') diff --git a/bin/tilt b/bin/tilt deleted file mode 100755 index 09fe73eb..00000000 --- a/bin/tilt +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'tilt' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('tilt', 'tilt') diff --git a/bin/tt b/bin/tt deleted file mode 100755 index 6e3920b8..00000000 --- a/bin/tt +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'tt' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('treetop', 'tt') diff --git a/config.ru b/config.ru deleted file mode 100644 index 5bc2a619..00000000 --- a/config.ru +++ /dev/null @@ -1,4 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require ::File.expand_path('../config/environment', __FILE__) -run Rails.application diff --git a/config/application.rb b/config/application.rb deleted file mode 100644 index e801a593..00000000 --- a/config/application.rb +++ /dev/null @@ -1,34 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails/all' - -# Require the gems listed in Gemfile, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) - -# load config.yaml preprocessed -CONFIG ||= YAML::load(ERB.new(File.read("config/config.yml")).result) - - -module T4c - class Application < Rails::Application - - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. - # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' - - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - # config.i18n.default_locale = :de - - config.autoload_paths += %W(#{config.root}/lib) - config.assets.initialize_on_precompile = true - config.available_locales = %w(en fr ru pl) - end -end - -I18n.enforce_available_locales = false diff --git a/config/boot.rb b/config/boot.rb deleted file mode 100644 index 35967366..00000000 --- a/config/boot.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) - -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) diff --git a/config/config.yml.sample b/config/config.yml.sample deleted file mode 100644 index 6d292b47..00000000 --- a/config/config.yml.sample +++ /dev/null @@ -1,43 +0,0 @@ -github: - key: "111111111111" - secret: "111111111111" - auto_paginate: false - pages: 3 - project_pages: - "torvalds/linux": 30 - -blockchain_info: - guid: "111111111111" - password: "111111111111" - callback_secret: "111111111111" - -devise: - secret: "111111111111" - -application: - secret: "111111111111" - -smtp_settings: - address: smtp.gmail.com - port: 587 - domain: foobar.com - user_name: example@foobar.com - password: MY_PASSWORD - authentication: plain - enable_starttls_auto: true - -# Uncomment to use airbrake/errbit - -# airbrake: -# api_key: 111111111111 -# host: errbit.tip4commit.com - -tip: 0.01 -min_payout: 100000 -our_fee: 0.05 - -deposit_address: 1M4bS4gPyA6Kb8w7aXsgth9oUZWcRk73tQ - -address_versions: # 0/5 for bitcoin addresses, 111/196 for testnet, see chainparams.cpp - - 0 - - 5 diff --git a/config/cross-fork-dev/config.yml.dev b/config/cross-fork-dev/config.yml.dev deleted file mode 100644 index 8a96d72c..00000000 --- a/config/cross-fork-dev/config.yml.dev +++ /dev/null @@ -1,116 +0,0 @@ - -<% -# list local feature branches in their appropriate *_BRANCHES lists below -MY_BRANCHES = %w{master} -TIP4COMMIT_BRANCHES = %w{tip4commit-master tip4commit-new-feature} -PEER4COMMIT_BRANCHES = %w{peer4commit-master peer4commit-new-feature} -PRIME4COMMIT_BRANCHES = %w{prime4commit-master peer4commit-new-feature} -BRANCHES_LISTS_FILENAME = 'config/config.yml' # DEBUG - -BRANCH_NAME = `git rev-parse --abbrev-ref HEAD`.strip -IS_MYFORK = MY_BRANCHES.include? BRANCH_NAME -IS_TIP4COMMIT_FORK = TIP4COMMIT_BRANCHES.include? BRANCH_NAME -IS_PEER4COMMIT_FORK = PEER4COMMIT_BRANCHES.include? BRANCH_NAME -IS_PRIME4COMMIT_FORK = PRIME4COMMIT_BRANCHES.include? BRANCH_NAME -%> - - -<% if IS_MY_FORK %> -<% puts "no app config defined for local branch: '#{BRANCH_NAME}'" %> -<% elsif IS_TIP4COMMIT_FORK %> -github: - key: "111111111111" - secret: "111111111111" - auto_paginate: false - pages: 3 - project_pages: {} - -blockchain_info: - guid: "111111111111" - password: "111111111111" - callback_secret: "111111111111" - -tip: 0.01 -min_payout: 100000 -our_fee: 0.05 - -deposit_address: 1M4bS4gPyA6Kb8w7aXsgth9oUZWcRk73tQ - -address_versions: # 0/5 for bitcoin addresses, 111/196 for testnet, see chainparams.cpp - - 0 - - 5 - - -<% elsif IS_PEER4COMMIT_FORK %> -github: - key: "111111111111" - secret: "111111111111" - -daemon: - username: rpcuser - password: rpcpassword - host: localhost - port: 9904 - path: /path/to/ppcoin/src/ppcoind - -tip: 0.01 -min_payout: 1.0 # in PPC -our_fee: 0.05 -tipper_delay: "1.hour" - -address_versions: # 55/117 for peercoin, 111/196 for testnet, see base58.h - - 111 - - 196 - -# canonical_host: peer4commit.example.com # will redirect all other hostnames to this one - - -<% elsif IS_PRIME4COMMIT_FORK %> -github: - key: "111111111111" - secret: "111111111111" - -daemon: - username: rpcuser - password: rpcpassword - host: localhost - port: 9914 - path: /path/to/primecoin/src/primecoind - -tip: 0.01 -min_payout: 1.0 # in XPM -our_fee: 0.05 -tipper_delay: "1.hour" - -address_versions: # 23/83 for primecoin, 111/196 for testnet, see base58.h - - 111 - - 196 - -# canonical_host: prime4commit.example.com # will redirect all other hostnames to this one - - -<% else %> -<% puts "ERROR: config/config.yml - no app config defined for branch: '#{BRANCH_NAME}'" + - " - you must add it to one of the *_BRANCHES lists in #{BRANCHES_LISTS_FILENAME}" %> -<% end %> - - -devise: - secret: "111111111111" - -application: - secret: "111111111111" - -smtp_settings: - address: smtp.gmail.com - port: 587 - domain: example.com - user_name: example@example.com - password: MY_PASSWORD - authentication: plain - enable_starttls_auto: true - -# Uncomment to use airbrake/errbit -# airbrake: -# api_key: 111111111111 -# host: errbit.tip4commit.com diff --git a/config/cross-fork-dev/cross-fork-dev-REAMDE.md b/config/cross-fork-dev/cross-fork-dev-REAMDE.md deleted file mode 100644 index a8749b45..00000000 --- a/config/cross-fork-dev/cross-fork-dev-REAMDE.md +++ /dev/null @@ -1,49 +0,0 @@ -### cross-fork development - -the files in this directory exist to aid cross-fork development of the various tip4commit forks from within the same local clone - if you will be working on only one fork then use Gemfile, config/config.yml.sample, and config/database.yml.sample instead - -the various forks have drifted apart significantly and require different configuratons - these files will allow these all to be functional within in the same clone without manual config swapping - the only routine maintenance required is in adding new feature branches to the appropriate *_BRANCHES list in config.yml.dev and re-bundling when switching between forks - - -#### config/cross-fork-dev/config.yml.dev - - config.yml.dev includes a separate configuration for each known tip4commit variant - switched per the current git branch - - config.yml.dev also defines which feature branches should share configurations - you will need to manually add each new branch to the appropriate *_BRANCHES list - - -#### config/cross-fork-dev/database.yml.dev - database.yml.dev also includes a separate configuration for each known tip4commit variant - switched per the current git branch (requires the *_BRANCHES list in config.yml.dev) - - -### setup - - * fork any of the tip4commit forks then clone your fork - * copy config/cross-fork-dev/config.yml.dev to config/config.yml and - copy config/cross-fork-dev/database.yml.dev to config/database.yml -``` - cp config/cross-fork-dev/config.yml.dev config/config.yml - cp config/cross-fork-dev/database.yml.dev config/database.yml -``` - * customize config/config.yml and config/database.yml - * repeat the following flow for each fork including the one you forked from -``` - git remote add tip4commit https://github.com/tip4commit/tip4commit.git - git checkout -b tip4commit-master - git fetch tip4commit - git merge tip4commit/master -``` - * add each fork branch created above its corresponding *_BRANCHES list - - -### maintenance - * add new local feature branches in their appropriate *_BRANCHES lists - (e.g. to reduce ambiguity use your local master branch for experimentaion only) - * re-bundle each time you switch to a new fork configuration -``` - # for tip4commit - bundle install --without production - - # for peer4commit amd prime4commit - bundle install --without mysql postgresql -``` diff --git a/config/cross-fork-dev/database.yml.dev b/config/cross-fork-dev/database.yml.dev deleted file mode 100644 index d22fc1f4..00000000 --- a/config/cross-fork-dev/database.yml.dev +++ /dev/null @@ -1,45 +0,0 @@ - -development: - adapter: sqlite3 - pool: 5 - timeout: 5000 -<% if IS_MY_FORK %> - database: db/my_development.sqlite3 -<% elsif IS_TIP4COMMIT_FORK %> - database: db/tip4commit_development.sqlite3 -<% elsif IS_PEER4COMMIT_FORK %> - database: db/peer4commit_development.sqlite3 -<% elsif IS_PRIME4COMMIT_FORK %> - database: db/prime4commit_development.sqlite3 -<% else %> -<% puts "ERROR: config/database.yml - no development db specified for branch: '#{branch_name}'" - + - " - you must add it to one of the *_BRANCHES lists in #{BRANCHES_LISTS_FILENAME}" %> -<% end %> - - -test: - adapter: sqlite3 - pool: 5 - timeout: 5000 -<% if IS_MY_FORK %> - database: db/my_test.sqlite3 -<% elsif IS_TIP4COMMIT_FORK %> - database: db/tip4commit_test.sqlite3 -<% elsif IS_PEER4COMMIT_FORK %> - database: db/peer4commit_test.sqlite3 -<% elsif IS_PRIME4COMMIT_FORK %> - database: db/prime4commit_test.sqlite3 -<% else %> -<% puts "ERROR: config/database.yml - no test db specified for branch: '#{branch_name}'" + - " - you must add it to one of the *_BRANCHES lists in #{BRANCHES_LISTS_FILENAME}" %> -<% end %> - - -production: - adapter: mysql2 - encoding: utf8 - database: tip4commit - username: root - password: - socket: /var/run/mysqld/mysqld.sock diff --git a/config/cucumber.yml b/config/cucumber.yml deleted file mode 100644 index 19b288df..00000000 --- a/config/cucumber.yml +++ /dev/null @@ -1,8 +0,0 @@ -<% -rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" -rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" -std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip" -%> -default: <%= std_opts %> features -wip: --tags @wip:3 --wip features -rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip diff --git a/config/database.yml.sample b/config/database.yml.sample deleted file mode 100644 index 7f623d96..00000000 --- a/config/database.yml.sample +++ /dev/null @@ -1,27 +0,0 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -development: - adapter: sqlite3 - database: db/development.sqlite3 - pool: 5 - timeout: 5000 - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - adapter: sqlite3 - database: db/test.sqlite3 - pool: 5 - timeout: 5000 - -production: - adapter: mysql2 - encoding: utf8 - database: tip4commit - username: root - password: - socket: /var/run/mysqld/mysqld.sock diff --git a/config/deploy.rb b/config/deploy.rb deleted file mode 100644 index c2600939..00000000 --- a/config/deploy.rb +++ /dev/null @@ -1,43 +0,0 @@ -set :application, 't4c' -set :repo_url, 'git@github.com:tip4commit/tip4commit.git' - -# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } - -set :deploy_to, "/home/apps/t4c" -set :scm, :git - -set :rvm_type, :user -set :rvm_ruby_version, '2.0.0-p247' -set :rvm_custom_path, '~/.rvm' - -set :format, :pretty -# set :log_level, :debug -# set :pty, true - -set :linked_files, %w{config/database.yml config/config.yml} -set :linked_dirs, %w{log tmp} - -# set :default_env, { path: "/opt/ruby/bin:$PATH" } -set :keep_releases, 5 - -namespace :deploy do - - desc 'Restart application' - task :restart do - on roles(:app), in: :sequence, wait: 5 do - execute :touch, release_path.join('tmp/restart.txt') - end - end - - after :restart, :clear_cache do - on roles(:web), in: :groups, limit: 3, wait: 10 do - # Here we can do anything such as: - # within release_path do - # execute :rake, 'cache:clear' - # end - end - end - - after :finishing, 'deploy:cleanup' - -end diff --git a/config/deploy/production.rb b/config/deploy/production.rb deleted file mode 100644 index 06838c2e..00000000 --- a/config/deploy/production.rb +++ /dev/null @@ -1,45 +0,0 @@ -set :stage, :production - -# Simple Role Syntax -# ================== -# Supports bulk-adding hosts to roles, the primary -# server in each group is considered to be the first -# unless any hosts have the primary property set. -role :app, %w{apps@50.116.2.58} -role :web, %w{apps@50.116.2.58} -role :db, %w{apps@50.116.2.58} - -set :rails_env, 'production' -set :migration_role, 'db' - -# Extended Server Syntax -# ====================== -# This can be used to drop a more detailed server -# definition into the server list. The second argument -# something that quacks like a has can be used to set -# extended properties on the server. -#server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value - -# you can set custom ssh options -# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options -# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) -# set it globally -# set :ssh_options, { -# keys: %w(/home/rlisowski/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(password) -# } -# and/or per server -# server 'example.com', -# user: 'user_name', -# roles: %w{web app}, -# ssh_options: { -# user: 'user_name', # overrides user setting above -# keys: %w(/home/user_name/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(publickey password) -# # password: 'please use keys' -# } -# setting per server overrides global ssh_options - -# fetch(:default_env).merge!(rails_env: :production) diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb deleted file mode 100644 index 0966af3f..00000000 --- a/config/deploy/staging.rb +++ /dev/null @@ -1,42 +0,0 @@ -set :stage, :staging - -# Simple Role Syntax -# ================== -# Supports bulk-adding hosts to roles, the primary -# server in each group is considered to be the first -# unless any hosts have the primary property set. -role :app, %w{deploy@example.com} -role :web, %w{deploy@example.com} -role :db, %w{deploy@example.com} - -# Extended Server Syntax -# ====================== -# This can be used to drop a more detailed server -# definition into the server list. The second argument -# something that quacks like a has can be used to set -# extended properties on the server. -server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value - -# you can set custom ssh options -# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options -# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) -# set it globally -# set :ssh_options, { -# keys: %w(/home/rlisowski/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(password) -# } -# and/or per server -# server 'example.com', -# user: 'user_name', -# roles: %w{web app}, -# ssh_options: { -# user: 'user_name', # overrides user setting above -# keys: %w(/home/user_name/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(publickey password) -# # password: 'please use keys' -# } -# setting per server overrides global ssh_options - -# fetch(:default_env).merge!(rails_env: :staging) diff --git a/config/environment.rb b/config/environment.rb deleted file mode 100644 index 8fc35cc4..00000000 --- a/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the Rails application. -require File.expand_path('../application', __FILE__) - -# Initialize the Rails application. -T4c::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb deleted file mode 100644 index 33b915ab..00000000 --- a/config/environments/development.rb +++ /dev/null @@ -1,31 +0,0 @@ -T4c::Application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false - - config.action_mailer.default_url_options = { :host => "localhost:3000" } - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations - config.active_record.migration_error = :page_load - - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true -end diff --git a/config/environments/production.rb b/config/environments/production.rb deleted file mode 100644 index 27cba157..00000000 --- a/config/environments/production.rb +++ /dev/null @@ -1,86 +0,0 @@ -T4c::Application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both thread web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Enable Rack::Cache to put a simple HTTP cache in front of your application - # Add `rack-cache` to your Gemfile before enabling this. - # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. - # config.action_dispatch.rack_cache = true - - # Disable Rails's static asset server (Apache or nginx will already do this). - config.serve_static_assets = false - - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # Generate digests for assets URLs. - config.assets.digest = true - - # Version of your assets, change this if you want to expire all your assets. - config.assets.version = '1.0' - - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # Set to :debug to see everything in the log. - config.log_level = :info - - # Prepend all log lines with the following tags. - # config.log_tags = [ :subdomain, :uuid ] - - # Use a different logger for distributed setups. - # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = "http://assets.example.com" - - # Precompile additional assets. - # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. - # config.assets.precompile += %w( search.js ) - - smtp_settings = CONFIG['smtp_settings'] - domain = smtp_settings['domain'] - config.action_mailer.delivery_method = :smtp - config.action_mailer.smtp_settings = smtp_settings.to_options - - config.action_mailer.perform_deliveries = true - config.action_mailer.raise_delivery_errors = true - config.action_mailer.default_url_options = { :host => domain, :protocol => 'https' } - config.action_mailer.default_options = {from: 'no-reply@' + domain } - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation can not be found). - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Disable automatic flushing of the log to improve performance. - # config.autoflush_log = false - - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new -end diff --git a/config/environments/test.rb b/config/environments/test.rb deleted file mode 100644 index 359f1c92..00000000 --- a/config/environments/test.rb +++ /dev/null @@ -1,39 +0,0 @@ -T4c::Application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true - config.static_cache_control = "public, max-age=3600" - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - config.action_mailer.raise_delivery_errors = false - config.action_mailer.default_url_options = { :host => 'tip4commit.com', :protocol => 'https' } - config.action_mailer.default_options = { from: 'no-reply@tip4commit.com' } - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr -end diff --git a/config/i18n-js.yml b/config/i18n-js.yml deleted file mode 100644 index ca77b010..00000000 --- a/config/i18n-js.yml +++ /dev/null @@ -1,3 +0,0 @@ -translations: - - file: "app/assets/javascripts/i18n/translations.js" - only: ['*.js'] diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cdf..00000000 --- a/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/config/initializers/demoji.rb b/config/initializers/demoji.rb deleted file mode 100644 index d4121d33..00000000 --- a/config/initializers/demoji.rb +++ /dev/null @@ -1 +0,0 @@ -ActiveRecord::Base.send :include, Demoji diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb deleted file mode 100644 index 2501563d..00000000 --- a/config/initializers/devise.rb +++ /dev/null @@ -1,258 +0,0 @@ -# Use this hook to configure devise mailer, warden hooks and so forth. -# Many of these configuration options can be set straight in your model. -Devise.setup do |config| - # The secret key used by Devise. Devise uses this key to generate - # random tokens. Changing this key will render invalid all existing - # confirmation, reset password and unlock tokens in the database. - config.secret_key = CONFIG['devise']['secret'] - - # ==> Mailer Configuration - # Configure the e-mail address which will be shown in Devise::Mailer, - # note that it will be overwritten if you use your own mailer class - # with default "from" parameter. - config.mailer_sender = 'no-reply@' + CONFIG['smtp_settings']['domain'] - - # Configure the class responsible to send e-mails. - # config.mailer = 'Devise::Mailer' - - # ==> ORM configuration - # Load and configure the ORM. Supports :active_record (default) and - # :mongoid (bson_ext recommended) by default. Other ORMs may be - # available as additional gems. - require 'devise/orm/active_record' - - # ==> Configuration for any authentication mechanism - # Configure which keys are used when authenticating a user. The default is - # just :email. You can configure it to use [:username, :subdomain], so for - # authenticating a user, both parameters are required. Remember that those - # parameters are used only when authenticating and not when retrieving from - # session. If you need permissions, you should implement that in a before filter. - # You can also supply a hash where the value is a boolean determining whether - # or not authentication should be aborted when the value is not present. - # config.authentication_keys = [ :email ] - - # Configure parameters from the request object used for authentication. Each entry - # given should be a request method and it will automatically be passed to the - # find_for_authentication method and considered in your model lookup. For instance, - # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. - # The same considerations mentioned for authentication_keys also apply to request_keys. - # config.request_keys = [] - - # Configure which authentication keys should be case-insensitive. - # These keys will be downcased upon creating or modifying a user and when used - # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [ :email ] - - # Configure which authentication keys should have whitespace stripped. - # These keys will have whitespace before and after removed upon creating or - # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [ :email ] - - # Tell if authentication through request.params is enabled. True by default. - # It can be set to an array that will enable params authentication only for the - # given strategies, for example, `config.params_authenticatable = [:database]` will - # enable it only for database (email + password) authentication. - # config.params_authenticatable = true - - # Tell if authentication through HTTP Auth is enabled. False by default. - # It can be set to an array that will enable http authentication only for the - # given strategies, for example, `config.http_authenticatable = [:token]` will - # enable it only for token authentication. The supported strategies are: - # :database = Support basic authentication with authentication key + password - # :token = Support basic authentication with token authentication key - # :token_options = Support token authentication with options as defined in - # http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html - # config.http_authenticatable = false - - # If http headers should be returned for AJAX requests. True by default. - # config.http_authenticatable_on_xhr = true - - # The realm used in Http Basic Authentication. 'Application' by default. - # config.http_authentication_realm = 'Application' - - # It will change confirmation, password recovery and other workflows - # to behave the same regardless if the e-mail provided was right or wrong. - # Does not affect registerable. - # config.paranoid = true - - # By default Devise will store the user in session. You can skip storage for - # :http_auth and :token_auth by adding those symbols to the array below. - # Notice that if you are skipping storage for all authentication paths, you - # may want to disable generating routes to Devise's sessions controller by - # passing :skip => :sessions to `devise_for` in your config/routes.rb - config.skip_session_storage = [:http_auth] - - # By default, Devise cleans up the CSRF token on authentication to - # avoid CSRF token fixation attacks. This means that, when using AJAX - # requests for sign in and sign up, you need to get a new CSRF token - # from the server. You can disable this option at your own risk. - # config.clean_up_csrf_token_on_authentication = true - - # ==> Configuration for :database_authenticatable - # For bcrypt, this is the cost for hashing the password and defaults to 10. If - # using other encryptors, it sets how many times you want the password re-encrypted. - # - # Limiting the stretches to just one in testing will increase the performance of - # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use - # a value less than 10 in other environments. - config.stretches = Rails.env.test? ? 1 : 10 - - # Setup a pepper to generate the encrypted password. - # config.pepper = '7f59490cff28973cfed68f769dab87ba8bcf39eedca96d7373b951f2fc0beb0f166466beb48b9adf5ae5a7f5023f7563f83f76b7e56d8e221502926517f43434' - - # ==> Configuration for :confirmable - # A period that the user is allowed to access the website even without - # confirming his account. For instance, if set to 2.days, the user will be - # able to access the website for two days without confirming his account, - # access will be blocked just in the third day. Default is 0.days, meaning - # the user cannot access the website without confirming his account. - # config.allow_unconfirmed_access_for = 2.days - - # A period that the user is allowed to confirm their account before their - # token becomes invalid. For example, if set to 3.days, the user can confirm - # their account within 3 days after the mail was sent, but on the fourth day - # their account can't be confirmed with the token any more. - # Default is nil, meaning there is no restriction on how long a user can take - # before confirming their account. - # config.confirm_within = 3.days - - # If true, requires any email changes to be confirmed (exactly the same way as - # initial account confirmation) to be applied. Requires additional unconfirmed_email - # db field (see migrations). Until confirmed new email is stored in - # unconfirmed email column, and copied to email column on successful confirmation. - config.reconfirmable = true - - # Defines which key will be used when confirming an account - # config.confirmation_keys = [ :email ] - - # ==> Configuration for :rememberable - # The time the user will be remembered without asking for credentials again. - # config.remember_for = 2.weeks - - # If true, extends the user's remember period when remembered via cookie. - # config.extend_remember_period = false - - # Options to be passed to the created cookie. For instance, you can set - # :secure => true in order to force SSL only cookies. - # config.rememberable_options = {} - - # ==> Configuration for :validatable - # Range for password length. Default is 8..128. - config.password_length = 8..128 - - # Email regex used to validate email formats. It simply asserts that - # one (and only one) @ exists in the given string. This is mainly - # to give user feedback and not to assert the e-mail validity. - # config.email_regexp = /\A[^@]+@[^@]+\z/ - - # ==> Configuration for :timeoutable - # The time you want to timeout the user session without activity. After this - # time the user will be asked for credentials again. Default is 30 minutes. - # config.timeout_in = 30.minutes - - # If true, expires auth token on session timeout. - # config.expire_auth_token_on_timeout = false - - # ==> Configuration for :lockable - # Defines which strategy will be used to lock an account. - # :failed_attempts = Locks an account after a number of failed attempts to sign in. - # :none = No lock strategy. You should handle locking by yourself. - # config.lock_strategy = :failed_attempts - - # Defines which key will be used when locking and unlocking an account - # config.unlock_keys = [ :email ] - - # Defines which strategy will be used to unlock an account. - # :email = Sends an unlock link to the user email - # :time = Re-enables login after a certain amount of time (see :unlock_in below) - # :both = Enables both strategies - # :none = No unlock strategy. You should handle unlocking by yourself. - # config.unlock_strategy = :both - - # Number of authentication tries before locking an account if lock_strategy - # is failed attempts. - # config.maximum_attempts = 20 - - # Time interval to unlock the account if :time is enabled as unlock_strategy. - # config.unlock_in = 1.hour - - # ==> Configuration for :recoverable - # - # Defines which key will be used when recovering the password for an account - # config.reset_password_keys = [ :email ] - - # Time interval you can reset your password with a reset password key. - # Don't put a too small interval or your users won't have the time to - # change their passwords. - config.reset_password_within = 6.hours - - # ==> Configuration for :encryptable - # Allow you to use another encryption algorithm besides bcrypt (default). You can use - # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, - # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) - # and :restful_authentication_sha1 (then you should set stretches to 10, and copy - # REST_AUTH_SITE_KEY to pepper). - # - # Require the `devise-encryptable` gem when using anything other than bcrypt - # config.encryptor = :sha512 - - # ==> Configuration for :token_authenticatable - # Defines name of the authentication token params key - # config.token_authentication_key = :auth_token - - # ==> Scopes configuration - # Turn scoped views on. Before rendering "sessions/new", it will first check for - # "users/sessions/new". It's turned off by default because it's slower if you - # are using only default views. - # config.scoped_views = false - - # Configure the default scope given to Warden. By default it's the first - # devise role declared in your routes (usually :user). - # config.default_scope = :user - - # Set this configuration to false if you want /users/sign_out to sign out - # only the current scope. By default, Devise signs out all scopes. - # config.sign_out_all_scopes = true - - # ==> Navigation configuration - # Lists the formats that should be treated as navigational. Formats like - # :html, should redirect to the sign in page when the user does not have - # access, but formats like :xml or :json, should return 401. - # - # If you have any extra navigational formats, like :iphone or :mobile, you - # should add them to the navigational formats lists. - # - # The "*/*" below is required to match Internet Explorer requests. - # config.navigational_formats = ['*/*', :html] - - # The default HTTP method used to sign out a resource. Default is :delete. - config.sign_out_via = :delete - - # ==> OmniAuth - # Add a new OmniAuth provider. Check the wiki for more information on setting - # up on your models and hooks. - config.omniauth :github, CONFIG['github']['key'], CONFIG['github']['secret'], scope: 'user:email' - - # ==> Warden configuration - # If you want to use other strategies, that are not supported by Devise, or - # change the failure app, you can configure them inside the config.warden block. - # - # config.warden do |manager| - # manager.intercept_401 = false - # manager.default_strategies(:scope => :user).unshift :some_external_strategy - # end - - # ==> Mountable engine configurations - # When using Devise inside an engine, let's call it `MyEngine`, and this engine - # is mountable, there are some extra configurations to be taken into account. - # The following options are available, assuming the engine is mounted as: - # - # mount MyEngine, at: '/my_engine' - # - # The router that invoked `devise_for`, in the example above, would be: - # config.router_name = :my_engine - # - # When using omniauth, Devise cannot automatically set Omniauth path, - # so you need to do it manually. For the users scope, it would be: - # config.omniauth_path_prefix = '/my_engine/users/auth' -end diff --git a/config/initializers/errbit.rb b/config/initializers/errbit.rb deleted file mode 100644 index a161e2af..00000000 --- a/config/initializers/errbit.rb +++ /dev/null @@ -1,10 +0,0 @@ -if CONFIG['airbrake'] - Airbrake.configure do |config| - config.api_key = CONFIG['airbrake']['api_key'] - config.host = CONFIG['airbrake']['host'] - config.port = 80 - config.secure = config.port == 443 - - config.ignore << "ArgumentError" - end -end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb deleted file mode 100644 index 4a994e1e..00000000 --- a/config/initializers/filter_parameter_logging.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb deleted file mode 100644 index ac033bf9..00000000 --- a/config/initializers/inflections.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb deleted file mode 100644 index c0feb58c..00000000 --- a/config/initializers/mime_types.rb +++ /dev/null @@ -1,6 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone -Mime::Type.register "image/svg+xml", :svg diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb deleted file mode 100644 index 0e3db2c8..00000000 --- a/config/initializers/secret_token.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. -T4c::Application.config.secret_key_base = CONFIG['application']['secret'] diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb deleted file mode 100644 index 4fd9a3e7..00000000 --- a/config/initializers/session_store.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -T4c::Application.config.session_store :cookie_store, key: '_t4c_session' diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb deleted file mode 100644 index 33725e95..00000000 --- a/config/initializers/wrap_parameters.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] if respond_to?(:wrap_parameters) -end - -# To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end diff --git a/config/locales/en.yml b/config/locales/en.yml deleted file mode 100644 index a496ef53..00000000 --- a/config/locales/en.yml +++ /dev/null @@ -1,216 +0,0 @@ -en: - tip4commit: Tip4Commit - meta: - title: Contribute to Open Source - description: Donate bitcoins to open source projects or make commits and get tips for it. - menu: - home: Home - projects: Supported Projects - footer: - text: "Source code is available at %{github_link} and you can also %{support_link} its development." - github_link: GitHub - support_link: support - follow_link: Follow @tip4commit - links: - sign_in: Sign in - sign_in_imp: sign in - sign_out: Sign Out - errors: - project_not_found: Project not found. - access_denied: Access denied - can_assign_more_tips: "You can't assign more than 100% of available funds." - wrong_bitcoin_address: Error updating bitcoin address - user_not_found: User not found - access_denied: You are not authorized to perform this action! - notices: - project_updated: The project settings have been updated - tips_decided: The tip amounts have been defined - user_updated: Your information saved! - user_unsubscribed: "You unsubscribed! Sorry for bothering you. Although, you still can leave us your bitcoin address to get your tips." - tip_amounts: - undecided: "Undecided" - free: "Free: 0%" - tiny: "Tiny: 0.1%" - small: "Small: 0.5%" - normal: "Normal: 1%" - big: "Big: 2%" - huge: "Huge: 5%" - js: - errors: - value: - invalid: Value is invalid - email: - invalid: Invalid Email Address - blank: The Email is required and can't be empty - password: - blank: The password is required and can't be empty - invalid: The password and its confirmation are not same - password_confirmation: - blank: The password confirmation is required and can't be empty - invalid: The password and its confirmation are not same - home: - index: - see_projects: See projects - how_does_it_work: - title: How does it work? - text: People donate bitcoins to projects. When someone's commit is accepted into the project repository, we automatically tip the author. - button: Learn about Bitcoin - donate: - title: Donate - text: Find a project you like and deposit bitcoins into it. Your donation will be accumulated with the funds of other donators to give as tips for new commits. - button: Find or add a project - contribute: - title: Contribute - text: Go and fix something! If your commit is accepted by the project maintainer, you will get a tip! - sign_in_text: "Just check your email for an invitation or %{sign_in_link}." - sign_up_text: "If you have not yet received an invitation, you can %{sign_up_link} with a valid email address or via GitHub." - button: Supported projects - projects: - index: - find_project: - placeholder: Enter GitHub project URL to add a project or any keyword to find it... - button: Find or add project - repository: Repository - description: Description - watchers: Watchers - balance: Balance - forked_from: forked from - support: Support project - show: - title: "Contribute to %{project}" - edit_project: Change project settings - decide_tip_amounts: Decide tip amounts - disabled_notifications: "Project maintainers have decided not to notify new contributors about tips and they probably don't like this way of funding." - project_sponsors: Project sponsors - fee: "%{percentage} of deposited funds will be used to tip for new commits." - balance: Balance - deposits: deposits - custom_tip_size: (each new commit receives a percentage of available balance) - default_tip_size: "(each new commit receives %{percentage} of available balance)" - unconfirmed_amount: "(%{amount} unconfirmed)" - tipping_policies: Tipping policies - updated_by_user: "(Last updated by %{name} on %{date})" - updated_by_unknown: "(Last updated on %{date})" - tips_paid: Tips Paid - unclaimed_amount: "(%{amount} of this is unclaimed, and will be refunded to the project after being unclaimed for 1 month.)" - last_tips: Last Tips - see_all: see all - received: "received %{amount}" - will_receive: will receive a tip - for_commit: for commit - when_decided: when its amount is decided - next_tip: Next Tip - contribute_and_earn: Contribute and Earn - contribute_and_earn_description: "Donate bitcoins to this project or %{make_commits_link} and get tips for it. If your commit is accepted %{branch} by a project maintainer and there are bitcoins on its balance, you will get a tip!" - contribute_and_earn_branch: "to %{branch} branch" - make_commits_link: make commits - tell_us_bitcoin_address: "Just %{tell_us_link} your bitcoin address." - tell_us_link: tell us - sign_in: "Just check your email or %{sign_in_link}." - promote_project: Promote %{project} - embedding: Embedding - image_url: "Image URL:" - shield_title: tip for next commit - edit: - project_settings: "%{project} project settings" - branch: Branch - default_branch: Default branch - tipping_policies: Tipping policies - hold_tips: "Do not send the tips immediately. Give collaborators the ability to modify the tips before they're sent" - save: Save the project settings - disable_notifications: Don't notify new contributors - decide_tip_amounts: - commit: Commit - author: Author - message: Message - tip: Tip (relative to the project balance) - submit: Send the selected tip amounts - tips: - index: - tips: Tips - project_tips: '%{project} tips' - user_tips: "%{user} tips" - created_at: Created At - commiter: Commiter - project: Project - commit: Commit - amount: Amount - refunded: Refunded to project's deposit - undecided: The amount of the tip has not been decided yet - no_bitcoin_address: User didn't specify withdrawal address - below_threshold: "User's balance is below withdrawal threshold" - waiting: Waiting for withdrawal - error: (error sending transaction) - deposits: - index: - project_deposits: '%{project} deposits' - deposits: Deposits - created_at: Created At - project: Project - amount: Amount - transaction: Transaction - confirmed: Confirmed - confirmed_yes: 'Yes' - confirmed_no: 'No' - users: - index: - title: Top Contributors - name: Name - commits_count: Commits tipped - withdrawn: Withdrawn - show: - balance: Balance - threshold: "You will get your money when your balance hits the threshold of %{threshold}" - see_all: see all - received: "%{time} received %{amount} for commit %{commit} in %{project}" - bitcoin_address_placeholder: Your bitcoin address - notify: Notify me about new tips (no more than one email per month) - submit_user: Update user info - change_password: Change your password - submit_password: Change my password - withdrawals: - index: - title: Last Withdrawals - created_at: Created At - transaction: Transaction - result: Result - error: Error - success: Success - devise: - sessions: - new: - title: Sign in - remember_me: Remember me - submit: Sign in - registrations: - new: - title: Sign up - submit: Sign up - passwords: - new: - title: Forgot your password? - submit: Send me reset password instructions - edit: - title: Change your password - submit: Change my password - confirmations: - new: - title: Resend confirmation instructions - submit: Resend confirmation instructions - links: - sign_in: Sign in - sign_up: Sign up - recover: Forgot your password? - confirm: Didn't receive confirmation instructions? - sign_in_with: "Sign in with %{provider}" - errors: - primary_email: your primary email address should be verified. - onmiauth_info: we were unable to fetch your information. - activerecord: - attributes: - user: - email: E-mail - bitcoin_address: Bitcoin address - password: Password - password_confirmation: Password confirmation - display_name: Display name diff --git a/config/locales/fr.yml b/config/locales/fr.yml deleted file mode 100644 index 861ad848..00000000 --- a/config/locales/fr.yml +++ /dev/null @@ -1,216 +0,0 @@ -fr: - tip4commit: Tip4Commit - meta: - title: Contribuez aux logiciels libres - description: Faites don de bitcoins à des projets open source ou contribuez et recevez des pourboires. - menu: - home: Accueil - projects: Projets supportés - footer: - text: "Code source disponible sur %{github_link} et vous pouvez également %{support_link} son développement." - github_link: GitHub - support_link: subventionner - follow_link: Suivez @tip4commit - links: - sign_in: Se connecter - sign_in_imp: se connecter - sign_out: Se déconnecter - errors: - project_not_found: Projet non trouvé. - access_denied: Accès refusé - can_assign_more_tips: "Vous ne pouvez pas attribuer plus de 100% de vos fonds disponibles." - wrong_bitcoin_address: Echec de mise à jour de l'adresse bitcoin - user_not_found: Utilisateur non trouvé - access_denied: "Vous n'avez pas le droit d'effectuer cette action !" - notices: - project_updated: Les paramètres du projet ont été mis à jour - tips_decided: Les montants des pourboires ont été définis - user_updated: Vos informations ont été enregistrées ! - user_unsubscribed: "Vous avez été désinscrit ! Désolé de vous avoir dérangé. Celà dit, vous pouvez toujours nous donner votre adresse bitcoin pour recevoir vos fonds." - tip_amounts: - undecided: "Non défini" - free: "Gratuit : 0%" - tiny: "Minuscule : 0.1%" - small: "Petit : 0.5%" - normal: "Normal : 1%" - big: "Grand : 2%" - huge: "Géant : 5%" - js: - errors: - value: - invalid: Valeur non valide - email: - invalid: Adresse Email non valide - blank: L'Email est requis et doit être renseigné - password: - blank: Les mot de passe est requis et doit être renseigné - invalid: Le mot de passe et sa confirmation ne sont pas identiques - password_confirmation: - blank: La confirmation du mot de passe est requise et doit être renseignée - invalid: Le mot de passe et sa confirmation ne sont pas identiques - home: - index: - see_projects: Voir les projets - how_does_it_work: - title: Comment ça marche ? - text: Des gens donnent des bitcoins à des projets. Lorsque quelqu'une contribution est acceptée par un projet, nous donnons automatiquement un pourboire à son auteur. - button: En savoir plus sur le Bitcoin - donate: - title: Faire un don - text: Trouvez un projet que vous soutenez et désposez-y des bitcoins. Votre don d'ajoutera aux fonds des autres donnateurs pour récompenser les nouvelles contributions. - button: Trouver ou ajouter un projet - contribute: - title: Contribuer - text: Améliorez un projet ! Si votre contribution est acceptée par le mainteneur du projet, vous recevrez un pourboire ! - sign_in_text: "Vérifiez simplement vos emails ou %{sign_in_link}." - sign_up_text: "Si vous n'avez pas encore reçu une invitation, vous pouvez %{sign_up_link} avec une adresse de courriel valide ou via GitHub." - button: Projets subventionnés - projects: - index: - find_project: - placeholder: "Indiquez l'URL d'un projet GitHub pour l'ajouter ou n'importe quel mot clef pour le trouver..." - button: Trouver ou ajouter un projet - repository: Dépôt - description: Description - watchers: Observateurs - balance: Fonds - forked_from: forké depuis - support: Subventionner - show: - title: "Contribuer à %{project}" - edit_project: Changer les paramètres du projet - decide_tip_amounts: Choisir un montant de pourboire - disabled_notifications: "Les responsables du projet ont décidé de ne pas prévenir les nouveaux contributeurs au sujet des pourboires, et n'apprécient probablement pas ce type de rémunération." - project_sponsors: Sponsors du projet - fee: "%{percentage} des fonds déposés seront utilisés pour récompenser les nouvelles contributions." - balance: Fonds - deposits: dépôts - custom_tip_size: (chaque nouvelle contribution reçoit un pourcentage des fonds disponibles) - default_tip_size: "(chaque contribution reçoit %{percentage} des fonds disponsibles)" - unconfirmed_amount: "(%{amount} non confirmé)" - tipping_policies: Politique des pourboires - updated_by_user: "(Dernière mise à jour par %{name} le %{date})" - updated_by_unknown: "(Dernière mise à jour le %{date})" - tips_paid: Pourboires Payés - unclaimed_amount: "(%{amount} n'ont pas été réclamés, et seront rendus au projet s'ils le restent pendant 1 mois.)" - last_tips: Derniers Pourboires - see_all: tout voir - received: "%{amount} reçus" - will_receive: recevra un pourboire - for_commit: pour la contribution - when_decided: lorsque le montant sera choisi - next_tip: Prochain Pourboire - contribute_and_earn: Contribuez et Gagnez - contribute_and_earn_description: "Donner des bitcoins à ce projet ou %{make_commits_link} et recevez des pourboires. Si votre contribution est acceptée %{branch} par un mainteneur du projet et qu'un fond de bitcoins est disponible, vous recevrez un pourboire !" - contribute_and_earn_branch: "sur la branche %{branch}" - make_commits_link: contribuer - tell_us_bitcoin_address: "%{tell_us_link} simplement votre adresse bitcoin." - tell_us_link: Renseignez - sign_in: "Verifiez simplement vos emails ou %{sign_in_link}." - promote_project: Promouvoir %{project} - embedding: Intégration - image_url: "URL de l'image:" - shield_title: prochain pourboire - edit: - project_settings: "Paramètres du projet %{project}" - branch: Branche - default_branch: Branche par défaut - tipping_policies: Politique des pourboires - hold_tips: "N'envoyez pas les bourboires tout de suite. Laissez à vos collaborateurs la possibilité de modifier les pourboires avant qu'ils ne soient envoyés" - save: Enregistrer les paramètres du projet - disable_notifications: Ne pas prévenir les nouveaux contributeurs - decide_tip_amounts: - commit: Contribution - author: Auteur - message: Message - tip: Pourboire (en fonction des fonds du projet) - submit: Envoyer les pourboires - tips: - index: - tips: Pourboires - project_tips: 'Pourboires pour %{project}' - user_tips: "Pourboires pour %{user}" - created_at: Créé à - commiter: Contributeur - project: Projet - commit: Contribution - amount: Montant - refunded: Rendus aux fonds du projet - undecided: Le montant du pourboire n'a pas encore été décidé - no_bitcoin_address: "L'utilisateur n'a pas indiqué d'adresse de retrait" - below_threshold: "Les fonds de l'utilisateur sont sous le seuil de retrait" - waiting: En attente de retrait - error: (erreur d'envoi de la transaction) - deposits: - index: - project_deposits: 'Versements pour %{project}' - deposits: Versements - created_at: Créé à - project: Projet - amount: Montant - transaction: Transaction - confirmed: Confirmée - confirmed_yes: 'Oui' - confirmed_no: 'Non' - users: - index: - title: Meilleurs Contributeurs - name: Nom - commits_count: Contributions récompensées - withdrawn: Retiré - show: - balance: Fonds - threshold: "Vous recevrez vos fonds dès qu'ils atteindront le seuil de %{threshold}" - see_all: tout voir - received: "%{time} %{amount} reçus pour avoir contribué %{commit} à %{project}" - bitcoin_address_placeholder: Votre adresse bitcoin - notify: Me tenir au courant des nouveaux pourboires (pas plus d'un email par mois) - submit_user: Mettre à jour - change_password: Modifier votre mot de passe - submit_password: Modifier mon mot de passe - withdrawals: - index: - title: Derniers Retraits - created_at: Créé à - transaction: Transaction - result: Résultat - error: Erreur - success: Succès - devise: - sessions: - new: - title: Se connecter - remember_me: Se souvenir de moi - submit: Se connecter - registrations: - new: - title: S'enregistrer - submit: S'enregistrer - passwords: - new: - title: Mot de passe oublié ? - submit: Envoyez-moi des instructions pour réinitialiser mon mot de passe - edit: - title: Modifier votre mot de passe - submit: Modifier mon mot de passe - confirmations: - new: - title: Renvoyer les instructions de confirmation - submit: Renvoyer les instructions de confirmation - links: - sign_in: Se connecter - sign_up: S'enregistrer - recover: Mot de passe oublié ? - confirm: "Vous n'avez pas reçu d'instructions de confirmation ?" - sign_in_with: "Se connecter avec %{provider}" - errors: - primary_email: votre adresse email principale doit être vérifiée. - onmiauth_info: impossible d'obtenir vos informations. - activerecord: - attributes: - user: - email: E-mail - bitcoin_address: Adresse bitcoin - password: Mot de passe - password_confirmation: Confirmation - display_name: Nom affiché diff --git a/config/locales/hr.yml b/config/locales/hr.yml deleted file mode 100644 index 9b65dff7..00000000 --- a/config/locales/hr.yml +++ /dev/null @@ -1,216 +0,0 @@ -hr: - tip4commit: Tip4Commit - meta: - title: Doprinosite otvorenom izvoru - description: Donirajte bitcoine u otvoreni izvor projekata ili napravite cinove i dobite napojnice. - menu: - home: Pocetna stranica - projects: Podrzavani Projekti - footer: - text: "Izvorni kod dostupan na %{github_link} i mozete takoder %{support_link} razvoj." - github_link: GitHub - support_link: podrzi - follow_link: Follow @tip4commit - links: - sign_in: Prijava - sign_in_imp: prijava - sign_out: Odjava - errors: - project_not_found: Projekt nije nadjen. - access_denied: Pristup odbijen - can_assign_more_tips: "Ne mozete dodijeliti vise od 100% dostupnih sredstva." - wrong_bitcoin_address: Greska u updejtanju bitcoin adrese - user_not_found: Korisnik nije naden - access_denied: Niste ovlasteni da napravite ovu akciju! - notices: - project_updated: Postavke projekta su primijenjena - tips_decided: Broj napojnica je bio definiran - user_updated: Vasa informacija je sacuvana! - user_unsubscribed: "Maknuli ste vasu pretplatu! Zao nam je sto smo vam smetali. Svejedno mozete ostaviti vasu bitcoin adresu da dobite svoje napojnice." - tip_amounts: - undecided: "Neodluceno" - free: "Besplatno: 0%" - tiny: "Vrlo malo: 0.1%" - small: "Malo: 0.5%" - normal: "Normalno: 1%" - big: "Veliko: 2%" - huge: "Ogromno: 5%" - js: - errors: - value: - invalid: Vrijednost nevazeca - email: - invalid: Nezaveca email adresa - blank: Email je potreban i ne moze biti prazno - password: - blank: Lozinka je potrebna i ne moze biti prazno - invalid: Lozinka i njezina potvrda nisu isti - password_confirmation: - blank: Potvrda lozinke je potrebna i ne moze biti prazno - invalid: Lozinka i potvrda lozinke nisu isti - home: - index: - see_projects: Vidjeti projekte - how_does_it_work: - title: Kako ovo radi? - text: Ljudi doniraju bitcoine projektima. Kada se neciji cin potvrdi u repozitorij projekta, mi automatski posaljemo napojnicu autoru. - button: Nauciti o Bitcoin - donate: - title: Donirati - text: Pronadite projekt u koji zelite posvojiti svoje bitcoine. Vase donacije ce biti akumulirane sa fundovima ostalih donatora kao napojnice za nove cinove. - button: Pronaci ili dodati pojekt - contribute: - title: Doprinositi - text: Idite i popravite nesto! Ako je vas cin odobren od odrzavatelja projekta, dobiti cete napojnicu! - sign_in_text: "Samo provjerite vas email ili %{sign_in_link}." - sign_up_text: "Ako jos niste dobili pozivnicu, moze te se %{sign_up_link} sa valjanom email adresom ili GitHub-om." - button: Podrzavani projekti - projects: - index: - find_project: - placeholder: Upisite GitHub URL projekta kako biste dodati projekt ili bilo koju kljucnu rijec da biste je nasli... - button: Nadi ili dodaj projekt - repository: Repozitorij - description: Opis - watchers: Gledatelji - balance: Ravnoteza - forked_from: Odvojeno od - support: Podrzavaj - show: - title: "Doprinosi %{project}" - edit_project: Promijeni postavke projekta - decide_tip_amounts: Odredi kolicinu napojnica - disabled_notifications: "Odrzavatelji projekata su odlucili da nece obavjestiti nove doprinositelje o napojnicama i najvjerovatnije ne vole ovaj nacin isplate." - project_sponsors: Sponzori projekta - fee: "%{percentage} od polozenih isplata ce se koristiti kao napojnice za nove cinove." - balance: Ravnoteza - deposits: polozenja - custom_tip_size: (Svaki novi cin dobiva postotak dostune ravnoteze) - default_tip_size: "(Svaki novi cin dobiva %{percentage} dostupne ravnoteze)" - unconfirmed_amount: "(%{amount} nepotvrdeno)" - tipping_policies: Pravila o napojnicama - updated_by_user: "(Zadnje updejtao %{name} na %{date})" - updated_by_unknown: "(Zadnje updejtano %{date})" - tips_paid: Napojnice placene - unclaimed_amount: "(%{amount} od ovog neostvarenog, i biti ce natrag isplaceno u projekt nakon jednog mjeseca.)" - last_tips: Zadnje napojnice - see_all: Vidjeti sve - received: "dobiveno %{amount}" - will_receive: ce dobiti napojnicu - for_commit: za cin - when_decided: kada je kolicina odlucena - next_tip: Sljedeca napojnica - contribute_and_earn: Contribute and earn - contribute_and_earn_description: "Doniraj Bitcone u ovaj projekt ili %{make_commits_link} i dobij napojnicu. Ako je commit prihvacen %{branch} od strane voditelja projekta i ima Bitcoina na racunu, dobit ce te napojnicu." - contribute_and_earn_branch: "u %{branch} branch" - make_commits_link: make commits - tell_us_bitcoin_address: "Samo %{tell_us_link} vasu bitcoin adresu." - tell_us_link: tell us - sign_in: "Samo provjerite vas email ili %{sign_in_link}." - promote_project: Promoviraj %{project} - embedding: Embedding - image_url: "URL slike:" - shield_title: tip for next commit - edit: - project_settings: "%{project} project settings" - branch: Branch - default_branch: Default branch - tipping_policies: Tipping policies - hold_tips: "Do not send the tips immediatly. Give collaborators the ability to modify the tips before they're sent" - save: Save the project settings - disable_notifications: Don't notify new contributors - decide_tip_amounts: - commit: Commit - author: Author - message: Message - tip: Tip (relative to the project balance) - submit: Send the selected tip amounts - tips: - index: - tips: Tips - project_tips: '%{project} napojnice' - user_tips: "%{user} napojnice" - created_at: Stvoreno na - commiter: Commiter - project: Projekt - commit: Commit - amount: Kolicina - refunded: Refunded to project's deposit - undecided: The amount of the tip has not been decided yet - no_bitcoin_address: User didn't specify withdrawal address - below_threshold: "User's balance is below withdrawal threshold" - waiting: Waiting for withdrawal - error: (error sending transaction) - deposits: - index: - project_deposits: '%{project} uplate' - deposits: Deposits - created_at: "Stvoreno na" - project: Projekt - amount: Kolicina - transaction: Transaction - confirmed: Confirmed - confirmed_yes: 'Da' - confirmed_no: 'Ne' - users: - index: - title: Top Contributors - name: Ime - commits_count: Commits tipped - withdrawn: Withdrawn - show: - balance: Ravnoteza - threshold: "Dobiti ce te vase novce kada vasa ravnoteza prijede prag od %{threshold}" - see_all: vidjeti sve - received: "%{time} primljeno %{amount} za cin %{commit} u %{project}" - bitcoin_address_placeholder: Vasa bitcoin adresa - notify: Notificirati me o novim savjetima (ne vise od jednog emaila po mjesecu) - submit_user: Azurirati informaciju korisnika - change_password: Promijeniti vasu lozinku - submit_password: Promijeniti moju lozinku - withdrawals: - index: - title: Zadnje povlacenje - created_at: Stvoreno - transaction: Transakcije - result: Rezultat - error: Greska - success: Uspjesno - devise: - sessions: - new: - title: Prijava - remember_me: Zapamti me - submit: Prijava - registrations: - new: - title: Prijava - submit: Registracija - passwords: - new: - title: Zaboravili ste vasu lozinku? - submit: Poslati mi uputstva za resetiranje lozinke - edit: - title: Promijenite vasu lozinku - submit: Promijeniti svoju lozinku - confirmations: - new: - title: Ponovno poslati uputstva za potvrdivanje - submit: Ponovno poslati uputstva za potvrdivanje - links: - sign_in: Prijava - sign_up: Registracija - recover: Zaboravili ste vasu lozinku? - confirm: Niste primili uputstva za potvrdivanje? - sign_in_with: "Prijavi se sa %{provider}" - errors: - primary_email: vasa glavna email adresa bi trebala biti potvrdena. - onmiauth_info: Nismo bili u stanju dohvatiti vasu informaciju. - activerecord: - attributes: - user: - email: E-mail - bitcoin_address: Bitcoin adresa - password: Lozinka - password_confirmation: Potvrda lozinke - display_name: Prikazno ime diff --git a/config/locales/pl.yml b/config/locales/pl.yml deleted file mode 100644 index 319c60d9..00000000 --- a/config/locales/pl.yml +++ /dev/null @@ -1,216 +0,0 @@ -pl: - tip4commit: Tip4Commit - meta: - title: Wspieraj Open Source - description: Podaruj Bitcoiny na projekty Open Source lub współpracuj tworząc nowe "commits" i otrzymuj napiwki. - menu: - home: Strona Główna - projects: Wspierane Projekty - footer: - text: "Kod żródłowy dostępny jest na %{github_link} możesz także %{support_link} jego rozwój." - github_link: GitHub - support_link: wsparcie - follow_link: Obserwuj @tip4commit - links: - sign_in: Zaloguj się - sign_in_imp: zaloguj się - sign_out: Wyloguj się - errors: - project_not_found: Nie znaleziono projektu. - access_denied: Odmowa dostępu - can_assign_more_tips: "Nie możesz przydzielić więcej niż 100% dostępnych środków." - wrong_bitcoin_address: Błąd w aktualizowaniu adresu bitcoin - user_not_found: Nie znaleziono użytkownika - access_denied: Nie masz uprawnień do wykonania tej czynności! - notices: - project_updated: Ustawienia prjektu zostały zaktualizowane - tips_decided: Rozmiary napiwków zostały zdefiniowane - user_updated: Informacje zostały zapisane! - user_unsubscribed: "Zrezygnowałeś z subskrypcji! Przepraszamy za wszelkie niedogodności. Nadal możesz zostawić swój adres bitcoin i otrzymywać napiwki." - tip_amounts: - undecided: "Nieokreślony" - free: "Darmowy: 0%" - tiny: "Bardzo mały: 0.1%" - small: "Mały: 0.5%" - normal: "Średni: 1%" - big: "Duży: 2%" - huge: "Bardzo duży: 5%" - js: - errors: - value: - invalid: Wartość jest niepoprawna - email: - invalid: Błędny adres E-mail - blank: E-mail jest wymagany i nie może być pusty - password: - blank: Hasło jest wymagane i nie może być puste - invalid: Hasło i jego potwierdzenie nie są takie same - password_confirmation: - blank: Potwierdzenie hasła jest wymagane i nie może być puste - invalid: Hasło i jego potwierdzenie nie są takie same - home: - index: - see_projects: Zobacz projekty - how_does_it_work: - title: Jak to działa? - text: 'Ludzie przesyłają bitcoiny. Kiedy kogoś "commit" zostanie zaakceptowany do repozytorium projektu, automatycznie płacimy autorowi.' - button: Dowiedz się więcej o Bitcoin - donate: - title: Podaruj - text: 'Znajdź projekt, który ci się podoba i prześlij na niego bitcoiny. Twoje bitcoiny będzią zsumowana z innymi aby dać napiwki za nowe "commits".' - button: 'Znajdż lub dodaj projekt' - contribute: - title: 'Współpracuj' - text: 'Idź i coś napraw! Jeśli twój commit zostanie zaakceptowany przez nadzorcę projektu, dostaniesz napiwek!' - sign_in_text: "Wystarczy sprawdzić e-mail lub %{sign_in_link}." - sign_up_text: "Jeśli nadal nie otrzymałeś zaproszenia, możesz %{sign_up_link} za pomocą adresu e-mail lub przez GitHub." - button: Wspierane projekty - projects: - index: - find_project: - placeholder: Wpisz URL projektu GitHub aby dodać projekt lub słowo kluczowe aby go znaleźć... - button: Znajdź lub dodaj projekt - repository: Repozytorium - description: Opis - watchers: Obserwujący - balance: Saldo - forked_from: "zforkowany" - support: Pomoc - show: - title: "Współpracuj z %{project}" - edit_project: Zmień ustawienia projektu - decide_tip_amounts: Ustal rozmiary napiwków - disabled_notifications: "Nadzorcy projektów zdecydowali nie powiadamiać nowych współpracowników o napiwkach i prawdopodobnie nie lubią tego typu finansowania." - project_sponsors: Sponsorzy projektu - fee: "%{percentage} z salda zostanie użyte jako następny napiwek." - balance: saldo - deposits: wpłaty - custom_tip_size: (Każdy nowy "commit" dostaje część z dostępnego salda) - default_tip_size: "(Każdy nowy \"commit\" dostaje %{percentage} z dostępnego salda)" - unconfirmed_amount: "(%{amount} niepotwierdzone)" - tipping_policies: Zasady napiwków - updated_by_user: "(Ostatnio zaktualizowane przez %{name} w dniu %{date})" - updated_by_unknown: "(Ostatnia aktualizacja: %{date})" - tips_paid: Zapłacone napiwki - unclaimed_amount: "(%{amount} z tego jest niezebrane, i zostanie zwrócone do projektu po jednym miesiącu.)" - last_tips: Ostatnie napiwki - see_all: zobacz wszystko - received: "otrzymano %{amount}" - will_receive: dostanie napiwek - for_commit: za "commit" - when_decided: kiedy jego rozmiar zostanie określony - next_tip: Następny napiwek - contribute_and_earn: Pomagaj i zarabiaj - contribute_and_earn_description: "Wyślij bitcoiny na ten projekt lub %{make_commits_link} i otrzymaj za nie napiwki. Jeśli zostaną zaakceptowane %{branch} przez nadzorce projektu i jeśli są pieniądze na koncie projektu, otrzymasz napiwek!" - contribute_and_earn_branch: "do %{branch} gałęzi" - make_commits_link: twórz "commits" - tell_us_bitcoin_address: "Tylko %{tell_us_link} twój adres bitcoin." - tell_us_link: powiedz nam - sign_in: "Sprawdż e-mail lub %{sign_in_link}." - promote_project: Promuj %{project} - embedding: Umieść - image_url: "URL obrazka:" - shield_title: napiwek za następny "commit" - edit: - project_settings: "%{project} ustawienia projektu" - branch: Gałąź - default_branch: Domyślna gałąź - tipping_policies: Zasady napiwków - hold_tips: "Nie wysyłaj napiwków od razu. Daj współpracownikom możliwość zmiany napiwków zanim zostaną wysłane" - save: Zapisz ustawienia projektu - disable_notifications: Nie powiadamiaj nowych kontrybutorów - decide_tip_amounts: - commit: Commit - author: Autor - message: Wiadomość - tip: Napiwek (zależy od salda projektu) - submit: Wyślij wybrane ilości napiwków - tips: - index: - tips: Napiwki - project_tips: '%{project} napiwki' - user_tips: "%{user} napiwki" - created_at: Utworzony Na - commiter: Commiter - project: Projekt - commit: Commit - amount: Ilość - refunded: Zwrócone do projektu - undecided: Rozmiar napiwku nie został jeszcze określony - no_bitcoin_address: Użytkownik nie sprecyzował adresu do wypłaty - below_threshold: "Saldo użytkownika jest poniżej wymaganego do wypłaty" - waiting: Oczekiwanie na wypłate - error: (błąd w wysyłaniu transakcji) - deposits: - index: - project_deposits: '%{project} wpłaty' - deposits: Wpłaty - created_at: Utworzono Na - project: Projekt - amount: Ilość - transaction: Transakcja - confirmed: Potwierdzone - confirmed_yes: 'Tak' - confirmed_no: 'Nie' - users: - index: - title: Najlepsi kontrybutorzy - name: Imie - commits_count: Opłacone "commity" - withdrawn: Wypłacone - show: - balance: Saldo - threshold: "Otrzymasz pieniądze kiedy twoje saldo przekroczy limit %{threshold}" - see_all: zobacz wszystko - received: "%{time} otrzymano %{amount} za commit %{commit} w %{project}" - bitcoin_address_placeholder: Twój adres bitcoin - notify: Notify me about new tips (no more than one email per month) - submit_user: Zaktualizuj dane użytkownika - change_password: Zmień Twoje hasło - submit_password: Zmień moje hasło - withdrawals: - index: - title: Ostatnie wypłaty - created_at: Utworzono na - transaction: Transakcje - result: Wynik - error: Błąd - success: Sukces - devise: - sessions: - new: - title: Zaloguj się - remember_me: Zapamiętaj mnie - submit: Zaloguj się - registrations: - new: - title: Zarejestruj się - submit: Zarejestruj się - passwords: - new: - title: Zapomniałeś hasło? - submit: Wyślij mi instrukcje resetowania hasła - edit: - title: Zmień Twoje hasło - submit: Zmień moje hasło - confirmations: - new: - title: Ponownie wyślij instrukcje potwierdzenia - submit: Ponownie wyślij instrukcje potwierdzenia - links: - sign_in: Zaloguj się - sign_up: Zarejestruj się - recover: Zapomniałeś hasło? - confirm: Nie otrzymałeś instrukcji potwierdzenia? - sign_in_with: "Zaloguj się za pomocą %{provider}" - errors: - primary_email: Twój główny e-mail musi być potwierdzony. - onmiauth_info: Nie byliśmy w stanie otrzymać twoich danych. - activerecord: - attributes: - user: - email: E-mail - bitcoin_address: AAdres Bitcoin - password: Hasło - password_confirmation: Potwierdzenie hasła - display_name: Wyświetlana nazwa \ No newline at end of file diff --git a/config/locales/ru.yml b/config/locales/ru.yml deleted file mode 100644 index ce98929f..00000000 --- a/config/locales/ru.yml +++ /dev/null @@ -1,216 +0,0 @@ -ru: - tip4commit: Tip4Commit - meta: - title: Помощь проектам с открытым исходным кодом - description: Жертвуйте биткойны проектам с открытым исходным кодом или создавайте коммиты и получайте чаевые за них. - menu: - home: Главная - projects: Проекты - footer: - text: "Исходный код доступен на %{github_link}. Также вы можете %{support_link} разработку проекта." - github_link: GitHub - support_link: поддержать - follow_link: Следите за @tip4commit - links: - sign_in: Войти - sign_in_imp: войдите - sign_out: Выйти - errors: - project_not_found: Проект не найден. - access_denied: Доступ запрещен - can_assign_more_tips: "Нельзя использовать более чем 100% свободных средств." - wrong_bitcoin_address: Ошибка обновления биткоин адреса - user_not_found: Пользователь не найден - access_denied: Вы не авторизованы для выполнения данного действия! - notices: - project_updated: Настройки проекта обновлены - tips_decided: Сумма чаевых определена - user_updated: Ваш профиль обновлен! - user_unsubscribed: "Вы отписались! Приносим извинения за предоставленные неудобства. Однако, вы все равно можете оставить нам свой Биткоин адрес, чтобы получать вознагрождения" - tip_amounts: - undecided: "Не определено" - free: "Нет: 0%" - tiny: "Крошечные: 0.1%" - small: "Маленькие: 0.5%" - normal: "Обычные: 1%" - big: "Большие: 2%" - huge: "Огромные: 5%" - js: - errors: - value: - invalid: Неверное значение - email: - invalid: Ошибка в Email адресе - blank: Email не может быть пустым - password: - blank: Пароль не может быть пустым - invalid: Пароль и его подтверждение не совпадают - password_confirmation: - blank: Подтверждение пароля не может быть пустым - invalid: Пароль и его подтверждение не совпадают - home: - index: - see_projects: Проекты - how_does_it_work: - title: Как это работает? - text: Люди жертвуют биткоины на проекты. Если владелец проекта принимает коммит в репозиторий, мы автоматически начисляем чаевые автору этого коммита. - button: Узнать о Биткоин - donate: - title: Жертвуйте - text: Найдите проект который вам по душе и перечислите биткоины на него. Ваши пожертвования вместе с пожертвованиями других людей будут автоматически выплачиваться авторам новых коммитов в виде чаевых. - button: Найти или добавить проект - contribute: - title: Участвуйте - text: Идите и почините что-нибудь! Если ваш коммит будет принят владельцами проекта, вам будут выплачены чаевые! - sign_in_text: "Просто проверьте ваш email или %{sign_in_link}." - sign_up_text: "Если вы еще не получил приглашение, вы можете %{sign_up_link} с действительным адресом электронной почты или через GitHub." - button: Проекты - projects: - index: - find_project: - placeholder: Введите GitHub адрес вашего проекта чтобы добавить его или ключевое слово для поиска... - button: Найти или добавить проект - repository: Репозиторий - description: Описание - watchers: Наблюдателей - balance: Баланс - forked_from: ответвление от - support: "Поддержать проект" - show: - title: "Помогайте %{project}" - edit_project: Изменить настройки проекта - decide_tip_amounts: Установить сумму чаевых - disabled_notifications: "Контрибьюторы проекта решили не уведомлять новых участников о чаевых и вероятно им не нравиться такой способ финансирования." - project_sponsors: Спонсоры проекта - fee: "%{percentage} средств будет выплачено в качестве чаевых за новый коммит." - balance: Баланс - deposits: депозиты - custom_tip_size: (каждый новый коммит получает процент от доступного остатка) - default_tip_size: "(каждый новый коммит получает %{percentage} от доступного остатка)" - unconfirmed_amount: "(%{amount} не подтверждено)" - tipping_policies: Политика чаевых - updated_by_user: "(Последние изменения %{name} на %{date})" - updated_by_unknown: "(Последния изменения на %{date})" - tips_paid: Выплаченные чаевые - unclaimed_amount: "(%{amount} от суммы являются невостребованными, и будут возвращены проекту через месяц.)" - last_tips: Недавние чаевые - see_all: смотреть все - received: "получено %{amount}" - will_receive: получит чаевые - for_commit: за коммит - when_decided: когда сумма будет определена - next_tip: Следующие чаевые - contribute_and_earn: Помогайте и зарабатывайте - contribute_and_earn_description: "Жертвуйте биткойны этому проекту или %{make_commits_link} и получайте чаевые за них. Если ваш коммит будет принят %{branch} владельцами проекта, а баланс этого проекта положительный, то вы получите чаевые!" - contribute_and_earn_branch: "в ветку %{branch}" - make_commits_link: создавайте коммиты - tell_us_bitcoin_address: "Просто %{tell_us_link} ваш биткоин адрес." - tell_us_link: укажите - sign_in: "Просто проверьте ваш email или %{sign_in_link}." - promote_project: "Расскажите о %{project}" - embedding: Код для вставки - image_url: "URL изображения:" - shield_title: чаевые за следующий коммит - edit: - project_settings: "%{project} настройки проекта" - branch: Ветка - default_branch: Ветка по умолчанию - tipping_policies: Чаевые - hold_tips: "Не отправляйте чаевые сразу. Предоставьте владельцам проекта возможность изменить чаевые перед тем как они будут отправлены" - save: Сохранить настройки проекта - disable_notifications: Не оповещать новых контрибьюторов - decide_tip_amounts: - commit: Коммит - author: Автор - message: Сообщение - tip: Чаевые (зависят от баланса проекта) - submit: Отправить выбранную сумму чаевых - tips: - index: - tips: Чаевые - project_tips: 'Чаевые %{project}' - user_tips: "Чаевые %{user}" - created_at: Время создания - commiter: Автор - project: Проект - commit: Коммит - amount: Сумма - refunded: Возвращено на депозит проекта - undecided: Сумма чаевых ещё не определена - no_bitcoin_address: Адрес вывода не указан - below_threshold: "Баланс пользователя ниже порога вывода" - waiting: Ожидает вывода - error: (ошибка при отправке) - deposits: - index: - project_deposits: 'Депозиты %{project}' - deposits: Депозиты - created_at: Время создания - project: Проект - amount: Сумма - transaction: Транзакция - confirmed: Подтверждена - confirmed_yes: 'Да' - confirmed_no: 'Нет' - users: - index: - title: Топ Контрибьюторов - name: Имя - commits_count: Количество коммитов - withdrawn: Выплачено - show: - balance: Баланс - threshold: "Вы получите свои деньги, когда ваш баланс достигнет %{threshold}" - see_all: смотреть все - received: "%{time} получено %{amount} за коммит %{commit} в %{project}" - bitcoin_address_placeholder: Ваш биткоин адрес - notify: Сообщать мне о новых чаевых (не чаще чем одно сообщение в месяц) - submit_user: Обновить информацию пользователя - change_password: Смена пароля - submit_password: Сменить пароль - withdrawals: - index: - title: Последние выплаты - created_at: Время выплаты - transaction: Транзакция - result: Результат - error: Ошибка - success: Успешно - devise: - sessions: - new: - title: Вход - remember_me: Запомнить меня - submit: Войти - registrations: - new: - title: Регистрация - submit: Войти - passwords: - new: - title: Забыли ваш пароль? - submit: Сбросить пароль - edit: - title: Смена пароля - submit: Сменить пароль - confirmations: - new: - title: Выслать еще раз письмо с подтверждением - submit: Выслать - links: - sign_in: Вход - sign_up: Регистрация - recover: Забыли ваш пароль? - confirm: Не получили письмо с подтверждением? - sign_in_with: "Войти с %{provider}" - errors: - primary_email: ваш email адрес должен быть подтвержден. - onmiauth_info: не удалось получить информацию. - activerecord: - attributes: - user: - email: E-mail - bitcoin_address: Биткоин адрес - password: Пароль - password_confirmation: Пароль еще раз - display_name: Имя diff --git a/config/routes.rb b/config/routes.rb deleted file mode 100644 index 16cdf7ad..00000000 --- a/config/routes.rb +++ /dev/null @@ -1,86 +0,0 @@ -T4c::Application.routes.draw do - - root 'home#index' - - get '/blockchain_info_callback' => "home#blockchain_info_callback", :as => "blockchain_info_callback" - - get '/:service/:repo' => 'projects#show', :constraints => {:service => /github/, :repo => /.+/} - - devise_for :users, - :controllers => { - :omniauth_callbacks => "users/omniauth_callbacks" - } - - resources :users, :only => [:show, :update, :index] do - collection do - get :login - end - resources :tips, :only => [:index] - end - resources :projects, :only => [:show, :index, :edit, :update] do - collection do - get 'search' - end - member do - get :decide_tip_amounts - patch :decide_tip_amounts - end - resources :tips, :only => [:index] - resources :deposits, :only => [:index] - end - resources :tips, :only => [:index] - resources :deposits, :only => [:index] - resources :withdrawals, :only => [:index] - - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end -end diff --git a/db/migrate/20131019133109_devise_create_users.rb b/db/migrate/20131019133109_devise_create_users.rb deleted file mode 100644 index ab71c3d1..00000000 --- a/db/migrate/20131019133109_devise_create_users.rb +++ /dev/null @@ -1,42 +0,0 @@ -class DeviseCreateUsers < ActiveRecord::Migration - def change - create_table(:users) do |t| - ## Database authenticatable - t.string :email, :null => false, :default => "" - t.string :encrypted_password, :null => false, :default => "" - - ## Recoverable - t.string :reset_password_token - t.datetime :reset_password_sent_at - - ## Rememberable - t.datetime :remember_created_at - - ## Trackable - t.integer :sign_in_count, :default => 0, :null => false - t.datetime :current_sign_in_at - t.datetime :last_sign_in_at - t.string :current_sign_in_ip - t.string :last_sign_in_ip - - ## Confirmable - # t.string :confirmation_token - # t.datetime :confirmed_at - # t.datetime :confirmation_sent_at - # t.string :unconfirmed_email # Only if using reconfirmable - - ## Lockable - # t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts - # t.string :unlock_token # Only if unlock strategy is :email or :both - # t.datetime :locked_at - - - t.timestamps - end - - add_index :users, :email, :unique => true - add_index :users, :reset_password_token, :unique => true - # add_index :users, :confirmation_token, :unique => true - # add_index :users, :unlock_token, :unique => true - end -end diff --git a/db/migrate/20131019133235_add_columns_to_users.rb b/db/migrate/20131019133235_add_columns_to_users.rb deleted file mode 100644 index 63f1b7f3..00000000 --- a/db/migrate/20131019133235_add_columns_to_users.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddColumnsToUsers < ActiveRecord::Migration - def change - add_column :users, :nickname, :string - add_column :users, :name, :string - add_column :users, :image, :string - end -end diff --git a/db/migrate/20131019144930_add_bitcoin_address_to_users.rb b/db/migrate/20131019144930_add_bitcoin_address_to_users.rb deleted file mode 100644 index 0977232b..00000000 --- a/db/migrate/20131019144930_add_bitcoin_address_to_users.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddBitcoinAddressToUsers < ActiveRecord::Migration - def change - add_column :users, :bitcoin_address, :string - end -end diff --git a/db/migrate/20131019164745_create_projects.rb b/db/migrate/20131019164745_create_projects.rb deleted file mode 100644 index 165a4180..00000000 --- a/db/migrate/20131019164745_create_projects.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateProjects < ActiveRecord::Migration - def change - create_table :projects do |t| - t.string :url - t.string :bitcoin_address - - t.timestamps - end - end -end diff --git a/db/migrate/20131019170122_create_deposits.rb b/db/migrate/20131019170122_create_deposits.rb deleted file mode 100644 index 8c483564..00000000 --- a/db/migrate/20131019170122_create_deposits.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateDeposits < ActiveRecord::Migration - def change - create_table :deposits do |t| - t.references :project, index: true - t.string :txid - t.integer :confirmations - t.integer :duration, :default => 30.days.to_i - t.integer :paid_out, :limit => 8 - t.datetime :paid_out_at - - t.timestamps - end - end -end diff --git a/db/migrate/20131019170659_create_sendmanies.rb b/db/migrate/20131019170659_create_sendmanies.rb deleted file mode 100644 index b3f9ddb8..00000000 --- a/db/migrate/20131019170659_create_sendmanies.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateSendmanies < ActiveRecord::Migration - def change - create_table :sendmanies do |t| - t.string :txid - t.text :data - t.string :result - t.boolean :is_error - - t.timestamps - end - end -end diff --git a/db/migrate/20131019170925_create_tips.rb b/db/migrate/20131019170925_create_tips.rb deleted file mode 100644 index 3dc35405..00000000 --- a/db/migrate/20131019170925_create_tips.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateTips < ActiveRecord::Migration - def change - create_table :tips do |t| - t.references :deposit, index: true - t.references :user, index: true - t.integer :amount, :limit => 8 - t.references :sendmany, index: true - t.boolean :is_refunded - - t.timestamps - end - end -end diff --git a/db/migrate/20131019175751_add_some_fields_to_projects.rb b/db/migrate/20131019175751_add_some_fields_to_projects.rb deleted file mode 100644 index f643f300..00000000 --- a/db/migrate/20131019175751_add_some_fields_to_projects.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddSomeFieldsToProjects < ActiveRecord::Migration - def change - add_column :projects, :name, :string - add_column :projects, :full_name, :string - add_column :projects, :source_full_name, :string - add_column :projects, :description, :string - add_column :projects, :watchers_count, :integer - add_column :projects, :language, :string - end -end diff --git a/db/migrate/20131019205025_add_amount_to_deposit.rb b/db/migrate/20131019205025_add_amount_to_deposit.rb deleted file mode 100644 index b34c8bd1..00000000 --- a/db/migrate/20131019205025_add_amount_to_deposit.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddAmountToDeposit < ActiveRecord::Migration - def change - add_column :deposits, :amount, :integer, :limit => 8 - end -end diff --git a/db/migrate/20131019211518_add_last_commit_to_projects.rb b/db/migrate/20131019211518_add_last_commit_to_projects.rb deleted file mode 100644 index 92078e8a..00000000 --- a/db/migrate/20131019211518_add_last_commit_to_projects.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddLastCommitToProjects < ActiveRecord::Migration - def change - add_column :projects, :last_commit, :string - end -end diff --git a/db/migrate/20131020003746_add_commit_to_tip.rb b/db/migrate/20131020003746_add_commit_to_tip.rb deleted file mode 100644 index 3cd6a56b..00000000 --- a/db/migrate/20131020003746_add_commit_to_tip.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddCommitToTip < ActiveRecord::Migration - def change - add_column :tips, :commit, :string - end -end diff --git a/db/migrate/20131020120722_add_login_token_to_users.rb b/db/migrate/20131020120722_add_login_token_to_users.rb deleted file mode 100644 index 82ba6d74..00000000 --- a/db/migrate/20131020120722_add_login_token_to_users.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddLoginTokenToUsers < ActiveRecord::Migration - def change - add_column :users, :login_token, :string - end -end diff --git a/db/migrate/20131020143021_add_unsubscribed_to_users.rb b/db/migrate/20131020143021_add_unsubscribed_to_users.rb deleted file mode 100644 index a6b587d1..00000000 --- a/db/migrate/20131020143021_add_unsubscribed_to_users.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddUnsubscribedToUsers < ActiveRecord::Migration - def change - add_column :users, :unsubscribed, :boolean - end -end diff --git a/db/migrate/20131020145043_add_notified_at_to_users.rb b/db/migrate/20131020145043_add_notified_at_to_users.rb deleted file mode 100644 index 8561e278..00000000 --- a/db/migrate/20131020145043_add_notified_at_to_users.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddNotifiedAtToUsers < ActiveRecord::Migration - def change - add_column :users, :notified_at, :datetime - end -end diff --git a/db/migrate/20131030142320_add_project_to_tip.rb b/db/migrate/20131030142320_add_project_to_tip.rb deleted file mode 100644 index bf45132c..00000000 --- a/db/migrate/20131030142320_add_project_to_tip.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddProjectToTip < ActiveRecord::Migration - def change - add_reference :tips, :project, index: true - end -end diff --git a/db/migrate/20131030142749_drop_deposit_from_tip.rb b/db/migrate/20131030142749_drop_deposit_from_tip.rb deleted file mode 100644 index 1c1ddff8..00000000 --- a/db/migrate/20131030142749_drop_deposit_from_tip.rb +++ /dev/null @@ -1,5 +0,0 @@ -class DropDepositFromTip < ActiveRecord::Migration - def change - remove_column :tips, :deposit_id - end -end diff --git a/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb b/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb deleted file mode 100644 index 28260bf5..00000000 --- a/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddAvailableAmountCacheToProjects < ActiveRecord::Migration - def change - add_column :projects, :available_amount_cache, :integer - end -end diff --git a/db/migrate/20131212190037_add_cache_to_users.rb b/db/migrate/20131212190037_add_cache_to_users.rb deleted file mode 100644 index 0be8ddf8..00000000 --- a/db/migrate/20131212190037_add_cache_to_users.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddCacheToUsers < ActiveRecord::Migration - def change - add_column :users, :commits_count, :integer, default: 0 - add_column :users, :withdrawn_amount, :integer, limit: 8, default: 0 - end -end diff --git a/db/migrate/20140102095035_add_refunded_at_to_tips.rb b/db/migrate/20140102095035_add_refunded_at_to_tips.rb deleted file mode 100644 index 14d98acf..00000000 --- a/db/migrate/20140102095035_add_refunded_at_to_tips.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddRefundedAtToTips < ActiveRecord::Migration - def change - add_column :tips, :refunded_at, :timestamp - remove_column :tips, :is_refunded, :boolean - end -end diff --git a/db/migrate/20140207061855_add_github_id_to_projects.rb b/db/migrate/20140207061855_add_github_id_to_projects.rb deleted file mode 100644 index 9f2e8f24..00000000 --- a/db/migrate/20140207061855_add_github_id_to_projects.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddGithubIdToProjects < ActiveRecord::Migration - def change - add_column :projects, :github_id, :string - end -end diff --git a/db/migrate/20140209022632_change_projects_description.rb b/db/migrate/20140209022632_change_projects_description.rb deleted file mode 100644 index a02592e2..00000000 --- a/db/migrate/20140209022632_change_projects_description.rb +++ /dev/null @@ -1,8 +0,0 @@ -class ChangeProjectsDescription < ActiveRecord::Migration - def up - change_column :projects, :description, :text, :limit => nil - end - def down - change_column :projects, :description, :string - end -end diff --git a/db/migrate/20140209041123_create_indexes_for_projects.rb b/db/migrate/20140209041123_create_indexes_for_projects.rb deleted file mode 100644 index 30f06922..00000000 --- a/db/migrate/20140209041123_create_indexes_for_projects.rb +++ /dev/null @@ -1,6 +0,0 @@ -class CreateIndexesForProjects < ActiveRecord::Migration - def change - add_index :projects, :full_name, :unique => true - add_index :projects, :github_id, :unique => true - end -end diff --git a/db/migrate/20140223061035_add_project_host.rb b/db/migrate/20140223061035_add_project_host.rb deleted file mode 100644 index ee2a5825..00000000 --- a/db/migrate/20140223061035_add_project_host.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddProjectHost < ActiveRecord::Migration - class Project < ActiveRecord::Base - end - - def change - add_column :projects, :host, :string, default: 'github' - - reversible do |dir| - # Update all existing projects - dir.up { Project.where(host: nil).update_all(host: 'github') } - end - end -end diff --git a/db/migrate/20140309192616_create_collaborators.rb b/db/migrate/20140309192616_create_collaborators.rb deleted file mode 100644 index c0d734dc..00000000 --- a/db/migrate/20140309192616_create_collaborators.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateCollaborators < ActiveRecord::Migration - def change - create_table :collaborators do |t| - t.belongs_to :project, index: true - t.string :login - - t.timestamps - end - end -end diff --git a/db/migrate/20140323072851_add_hold_tips_to_project.rb b/db/migrate/20140323072851_add_hold_tips_to_project.rb deleted file mode 100644 index bb932ba1..00000000 --- a/db/migrate/20140323072851_add_hold_tips_to_project.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddHoldTipsToProject < ActiveRecord::Migration - def change - add_column :projects, :hold_tips, :boolean, default: false - end -end diff --git a/db/migrate/20140323165816_add_commit_message_to_tip.rb b/db/migrate/20140323165816_add_commit_message_to_tip.rb deleted file mode 100644 index aad73bee..00000000 --- a/db/migrate/20140323165816_add_commit_message_to_tip.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddCommitMessageToTip < ActiveRecord::Migration - def change - add_column :tips, :commit_message, :string - end -end diff --git a/db/migrate/20140323173320_create_tipping_policies_texts.rb b/db/migrate/20140323173320_create_tipping_policies_texts.rb deleted file mode 100644 index 898e3428..00000000 --- a/db/migrate/20140323173320_create_tipping_policies_texts.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateTippingPoliciesTexts < ActiveRecord::Migration - def change - create_table :tipping_policies_texts do |t| - t.belongs_to :project, index: true - t.belongs_to :user, index: true - t.text :text - - t.timestamps - end - end -end diff --git a/db/migrate/20140402032836_change_commit_message_type.rb b/db/migrate/20140402032836_change_commit_message_type.rb deleted file mode 100644 index 48467d77..00000000 --- a/db/migrate/20140402032836_change_commit_message_type.rb +++ /dev/null @@ -1,8 +0,0 @@ -class ChangeCommitMessageType < ActiveRecord::Migration - def up - change_column :tips, :commit_message, :text - end - def down - change_column :tips, :commit_message, :string - end -end diff --git a/db/migrate/20140402034521_change_commit_message_limit.rb b/db/migrate/20140402034521_change_commit_message_limit.rb deleted file mode 100644 index 34aca125..00000000 --- a/db/migrate/20140402034521_change_commit_message_limit.rb +++ /dev/null @@ -1,8 +0,0 @@ -class ChangeCommitMessageLimit < ActiveRecord::Migration - def up - change_column :tips, :commit_message, :text, limit: nil - end - def down - change_column :tips, :commit_message, :text - end -end diff --git a/db/migrate/20140402082149_add_fee_size_to_deposits.rb b/db/migrate/20140402082149_add_fee_size_to_deposits.rb deleted file mode 100644 index 5f3c96a1..00000000 --- a/db/migrate/20140402082149_add_fee_size_to_deposits.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddFeeSizeToDeposits < ActiveRecord::Migration - class Deposit < ActiveRecord::Base - end - - def change - add_column :deposits, :fee_size, :float - remove_column :deposits, :duration, :integer - reversible do |dir| - # Update all existing deposits - dir.up { Deposit.update_all(fee_size: CONFIG["our_fee"]) } - end - end -end diff --git a/db/migrate/20140620123610_add_decided_at_to_tips.rb b/db/migrate/20140620123610_add_decided_at_to_tips.rb deleted file mode 100644 index 3cb03115..00000000 --- a/db/migrate/20140620123610_add_decided_at_to_tips.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddDecidedAtToTips < ActiveRecord::Migration - def change - add_column :tips, :decided_at, :timestamp - end -end diff --git a/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb b/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb deleted file mode 100644 index 17ab997f..00000000 --- a/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb +++ /dev/null @@ -1,7 +0,0 @@ -class UpdateDecidedAtForExistingTips < ActiveRecord::Migration - def up - Tip.where.not(amount: nil).find_each do |tip| - tip.update decided_at: tip.created_at - end - end -end diff --git a/db/migrate/20140717085945_add_info_updated_at_to_projects.rb b/db/migrate/20140717085945_add_info_updated_at_to_projects.rb deleted file mode 100644 index 7b5d77af..00000000 --- a/db/migrate/20140717085945_add_info_updated_at_to_projects.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddInfoUpdatedAtToProjects < ActiveRecord::Migration - def change - add_column :projects, :info_updated_at, :timestamp - end -end diff --git a/db/migrate/20140722092532_add_confirmation_fields_to_users.rb b/db/migrate/20140722092532_add_confirmation_fields_to_users.rb deleted file mode 100644 index dab00bd0..00000000 --- a/db/migrate/20140722092532_add_confirmation_fields_to_users.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddConfirmationFieldsToUsers < ActiveRecord::Migration - def change - add_column :users, :confirmed_at, :timestamp - add_column :users, :confirmation_sent_at, :timestamp - add_column :users, :confirmation_token, :string - add_column :users, :unconfirmed_email, :string - end -end diff --git a/db/migrate/20140725054216_add_display_name_to_users.rb b/db/migrate/20140725054216_add_display_name_to_users.rb deleted file mode 100644 index 9e783036..00000000 --- a/db/migrate/20140725054216_add_display_name_to_users.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddDisplayNameToUsers < ActiveRecord::Migration - def change - add_column :users, :display_name, :string - end -end diff --git a/db/migrate/20140816062159_remove_paid_out_from_deposits.rb b/db/migrate/20140816062159_remove_paid_out_from_deposits.rb deleted file mode 100644 index b7726e56..00000000 --- a/db/migrate/20140816062159_remove_paid_out_from_deposits.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemovePaidOutFromDeposits < ActiveRecord::Migration - def change - remove_column :deposits, :paid_out, :integer, :limit => 8 - remove_column :deposits, :paid_out_at, :datetime - end -end diff --git a/db/migrate/20140823035950_add_branch_to_projects.rb b/db/migrate/20140823035950_add_branch_to_projects.rb deleted file mode 100644 index d514601c..00000000 --- a/db/migrate/20140823035950_add_branch_to_projects.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddBranchToProjects < ActiveRecord::Migration - def change - add_column :projects, :branch, :string, default: 'master' - end -end diff --git a/db/migrate/20140823060921_make_default_branch_blank.rb b/db/migrate/20140823060921_make_default_branch_blank.rb deleted file mode 100644 index b191d00b..00000000 --- a/db/migrate/20140823060921_make_default_branch_blank.rb +++ /dev/null @@ -1,5 +0,0 @@ -class MakeDefaultBranchBlank < ActiveRecord::Migration - def change - change_column :projects, :branch, :string, default: nil - end -end diff --git a/db/migrate/20140918051752_add_disable_notifications_to_projects.rb b/db/migrate/20140918051752_add_disable_notifications_to_projects.rb deleted file mode 100644 index 98c03469..00000000 --- a/db/migrate/20140918051752_add_disable_notifications_to_projects.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddDisableNotificationsToProjects < ActiveRecord::Migration - def change - add_column :projects, :disable_notifications, :boolean - end -end diff --git a/db/schema.rb b/db/schema.rb deleted file mode 100644 index b9683cf3..00000000 --- a/db/schema.rb +++ /dev/null @@ -1,130 +0,0 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 20140918051752) do - - create_table "collaborators", force: true do |t| - t.integer "project_id" - t.string "login" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "collaborators", ["project_id"], name: "index_collaborators_on_project_id" - - create_table "deposits", force: true do |t| - t.integer "project_id" - t.string "txid" - t.integer "confirmations" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "amount", limit: 8 - t.float "fee_size" - end - - add_index "deposits", ["project_id"], name: "index_deposits_on_project_id" - - create_table "projects", force: true do |t| - t.string "url" - t.string "bitcoin_address" - t.datetime "created_at" - t.datetime "updated_at" - t.string "name" - t.string "full_name" - t.string "source_full_name" - t.text "description" - t.integer "watchers_count" - t.string "language" - t.string "last_commit" - t.integer "available_amount_cache" - t.string "github_id" - t.string "host", default: "github" - t.boolean "hold_tips", default: false - t.datetime "info_updated_at" - t.string "branch" - t.boolean "disable_notifications" - end - - add_index "projects", ["full_name"], name: "index_projects_on_full_name", unique: true - add_index "projects", ["github_id"], name: "index_projects_on_github_id", unique: true - - create_table "sendmanies", force: true do |t| - t.string "txid" - t.text "data" - t.string "result" - t.boolean "is_error" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "tipping_policies_texts", force: true do |t| - t.integer "project_id" - t.integer "user_id" - t.text "text" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "tipping_policies_texts", ["project_id"], name: "index_tipping_policies_texts_on_project_id" - add_index "tipping_policies_texts", ["user_id"], name: "index_tipping_policies_texts_on_user_id" - - create_table "tips", force: true do |t| - t.integer "user_id" - t.integer "amount", limit: 8 - t.integer "sendmany_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "commit" - t.integer "project_id" - t.datetime "refunded_at" - t.text "commit_message" - t.datetime "decided_at" - end - - add_index "tips", ["project_id"], name: "index_tips_on_project_id" - add_index "tips", ["sendmany_id"], name: "index_tips_on_sendmany_id" - add_index "tips", ["user_id"], name: "index_tips_on_user_id" - - create_table "users", force: true do |t| - t.string "email", default: "", null: false - t.string "encrypted_password", default: "", null: false - t.string "reset_password_token" - t.datetime "reset_password_sent_at" - t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0, null: false - t.datetime "current_sign_in_at" - t.datetime "last_sign_in_at" - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" - t.datetime "created_at" - t.datetime "updated_at" - t.string "nickname" - t.string "name" - t.string "image" - t.string "bitcoin_address" - t.string "login_token" - t.boolean "unsubscribed" - t.datetime "notified_at" - t.integer "commits_count", default: 0 - t.integer "withdrawn_amount", limit: 8, default: 0 - t.datetime "confirmed_at" - t.datetime "confirmation_sent_at" - t.string "confirmation_token" - t.string "unconfirmed_email" - t.string "display_name" - end - - add_index "users", ["email"], name: "index_users_on_email", unique: true - add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true - -end diff --git a/db/seeds.rb b/db/seeds.rb deleted file mode 100644 index 4edb1e85..00000000 --- a/db/seeds.rb +++ /dev/null @@ -1,7 +0,0 @@ -# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). -# -# Examples: -# -# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) -# Mayor.create(name: 'Emanuel', city: cities.first) diff --git a/features/notification_threshold.feature b/features/notification_threshold.feature deleted file mode 100644 index 5e613f6e..00000000 --- a/features/notification_threshold.feature +++ /dev/null @@ -1,19 +0,0 @@ -Feature: Users should not be notified if their balance is small - Background: - Given a project "django" - And a deposit of "0.1" - And 2 new commits - - Scenario: Without big deposits - When the new commits are read - Then there should be 0 email sent - - Scenario: User's balance hits threshold - When 100 new commits - And the new commits are read - Then there should be 1 email sent - - Scenario: With bigger donation - When a deposit of "2" - And the new commits are read - Then there should be 1 email sent \ No newline at end of file diff --git a/features/step_definitions/common.rb b/features/step_definitions/common.rb deleted file mode 100644 index 28b359c9..00000000 --- a/features/step_definitions/common.rb +++ /dev/null @@ -1,122 +0,0 @@ -Before do - ActionMailer::Base.deliveries.clear - - # mock branches method to prevent api call - Project.any_instance.stub(:branches).and_return(%w(master)) -end - -Then(/^there should be (\d+) email sent$/) do |arg1| - ActionMailer::Base.deliveries.size.should eq(arg1.to_i) -end - -When(/^the email counters are reset$/) do - ActionMailer::Base.deliveries.clear -end - -Given(/^the tip for commit is "(.*?)"$/) do |arg1| - CONFIG["tip"] = arg1.to_f -end - -Given(/^our fee is "(.*?)"$/) do |arg1| - CONFIG["our_fee"] = arg1.to_f -end - -Given(/^a project$/) do - @project = Project.create!(full_name: "example/test", github_id: 123, bitcoin_address: 'mq4NtnmQoQoPfNWEPbhSvxvncgtGo6L8WY') -end - -Given(/^a project "(.*?)"$/) do |arg1| - @project = Project.create!(full_name: "example/#{arg1}", github_id: Digest::SHA1.hexdigest(arg1), bitcoin_address: 'mq4NtnmQoQoPfNWEPbhSvxvncgtGo6L8WY') -end - -Given(/^a deposit of "(.*?)"$/) do |arg1| - Deposit.create!(project: @project, amount: arg1.to_d * 1e8, confirmations: 2) -end - -Given(/^the last known commit is "(.*?)"$/) do |arg1| - @project.update!(last_commit: arg1) -end - -def add_new_commit(id, params = {}) - @new_commits ||= {} - defaults = { - sha: id, - commit: { - message: "Some changes", - author: { - email: "anonymous@example.com", - }, - }, - } - @new_commits[id] = defaults.deep_merge(params) -end - -def find_new_commit(id) - @new_commits[id] -end - -Given(/^a new commit "(.*?)" with parent "([^"]*?)"$/) do |arg1, arg2| - add_new_commit(arg1, parents: [{sha: arg2}]) -end - -Given(/^a new commit "(.*?)" with parent "(.*?)" and "(.*?)"$/) do |arg1, arg2, arg3| - add_new_commit(arg1, parents: [{sha: arg2}, {sha: arg3}], commit: {message: "Merge #{arg2} and #{arg3}"}) -end - -Given(/^(\d+) new commits$/) do |arg1| - arg1.to_i.times do - add_new_commit(Digest::SHA1.hexdigest(SecureRandom.hex)) - end -end - -Given(/^a new commit "([^"]*?)"$/) do |arg1| - add_new_commit(arg1) -end - -Given(/^the project holds tips$/) do - @project.update(hold_tips: true) -end - -Given(/^the message of commit "(.*?)" is "(.*?)"$/) do |arg1, arg2| - find_new_commit(arg1).deep_merge!(commit: {message: arg2}) -end - -When(/^the new commits are read$/) do - @project.reload - @project.should_receive(:new_commits).and_return(@new_commits.values.map(&:to_ostruct)) - @project.tip_commits -end - -Then(/^there should be no tip for commit "(.*?)"$/) do |arg1| - Tip.where(commit: arg1).to_a.should eq([]) -end - -Then(/^there should be a tip of "(.*?)" for commit "(.*?)"$/) do |arg1, arg2| - amount = Tip.find_by(commit: arg2).amount - amount.should_not be_nil - (amount.to_d / 1e8).should eq(arg1.to_d) -end - -Then(/^the tip amount for commit "(.*?)" should be undecided$/) do |arg1| - Tip.find_by(commit: arg1).undecided?.should eq(true) -end - -Then(/^the new last known commit should be "(.*?)"$/) do |arg1| - @project.reload.last_commit.should eq(arg1) -end - -Given(/^the project collaborators are:$/) do |table| - @project.reload - @project.collaborators.each(&:destroy) - table.raw.each do |name,| - @project.collaborators.create!(login: name) - end -end - -Given(/^the author of commit "(.*?)" is "(.*?)"$/) do |arg1, arg2| - find_new_commit(arg1).deep_merge!(author: {login: arg2}, commit: {author: {email: "#{arg2}@example.com"}}) -end - -Given(/^an illustration of the history is:$/) do |string| - # not checked -end diff --git a/features/step_definitions/tip_modifier_interface.rb b/features/step_definitions/tip_modifier_interface.rb deleted file mode 100644 index 9ebc31da..00000000 --- a/features/step_definitions/tip_modifier_interface.rb +++ /dev/null @@ -1,84 +0,0 @@ -When(/^I choose the amount "(.*?)" on commit "(.*?)"$/) do |arg1, arg2| - within find(".decide-tip-amounts-table tbody tr", text: arg2) do - choose arg1 - end -end - -When(/^I choose the amount "(.*?)" on all commits$/) do |arg1| - all(".decide-tip-amounts-table tbody tr").each do |tr| - within tr do - choose arg1 - end - end -end - -When(/^I go to the edit page of the project$/) do - visit edit_project_path(@project) -end - -When(/^I send a forged request to enable tip holding on the project$/) do - page.driver.browser.process_and_follow_redirects(:patch, project_path(@project), project: {hold_tips: "1"}) -end - -Then(/^I should see an access denied$/) do - page.should have_content("You are not authorized to perform this action!") -end - -Then(/^the project should not hold tips$/) do - @project.reload.hold_tips.should eq(false) -end - -Then(/^the project should hold tips$/) do - @project.reload.hold_tips.should eq(true) -end - -Given(/^the project has undedided tips$/) do - create(:undecided_tip, project: @project) - @project.reload.should have_undecided_tips -end - -Given(/^the project has (\d+) undecided tip$/) do |arg1| - @project.tips.undecided.each(&:destroy) - create(:undecided_tip, project: @project) - @project.reload.should have_undecided_tips -end - -Given(/^I send a forged request to set the amount of the first undecided tip of the project$/) do - tip = @project.tips.undecided.first - tip.should_not be_nil - params = { - project: { - tips_attributes: { - "0" => { - id: tip.id, - amount_percentage: "5", - }, - }, - }, - } - - page.driver.browser.process_and_follow_redirects(:patch, decide_tip_amounts_project_path(@project), params) -end - -When(/^I send a forged request to change the percentage of commit "(.*?)" on project "(.*?)" to "(.*?)"$/) do |arg1, arg2, arg3| - project = find_project(arg2) - tip = project.tips.detect { |t| t.commit == arg1 } - tip.should_not be_nil - params = { - project: { - tips_attributes: { - "0" => { - id: tip.id, - amount_percentage: arg3, - }, - }, - }, - } - - page.driver.browser.process_and_follow_redirects(:patch, decide_tip_amounts_project_path(project), params) -end - -Then(/^the project should have (\d+) undecided tips$/) do |arg1| - @project.tips.undecided.size.should eq(arg1.to_i) -end - diff --git a/features/step_definitions/web.rb b/features/step_definitions/web.rb deleted file mode 100644 index c3a6c65c..00000000 --- a/features/step_definitions/web.rb +++ /dev/null @@ -1,49 +0,0 @@ -Given(/^I'm logged in as "(.*?)"$/) do |arg1| - OmniAuth.config.test_mode = true - OmniAuth.config.mock_auth[:github] = { - "info" => { - "nickname" => arg1, - "primary_email" => "#{arg1.gsub(/\s+/,'')}@example.com", - "verified_emails" => [], - }, - }.to_ostruct - visit root_path - first(:link, "Sign in").click - click_on "Sign in with Github" - page.should have_content("Successfully authenticated") -end - -Given(/^I'm not logged in$/) do - visit root_path - if page.has_content?("Sign Out") - click_on "Sign Out" - page.should have_content("Signed out successfully") - else - page.should have_content("Sign in") - end -end - -Given(/^I go to the project page$/) do - visit project_path(@project) -end - -Given(/^I click on "(.*?)"$/) do |arg1| - click_on(arg1) -end - -Given(/^I check "(.*?)"$/) do |arg1| - check(arg1) -end - -Then(/^I should see "(.*?)"$/) do |arg1| - page.should have_content(arg1) -end - -Then(/^I should not see "(.*?)"$/) do |arg1| - page.should have_no_content(arg1) -end - -Given(/^I fill "(.*?)" with:$/) do |arg1, string| - fill_in arg1, with: string -end - diff --git a/features/support/big_decimal_inspect.rb b/features/support/big_decimal_inspect.rb deleted file mode 100644 index 97c4d459..00000000 --- a/features/support/big_decimal_inspect.rb +++ /dev/null @@ -1,5 +0,0 @@ -class BigDecimal - def inspect - "" - end -end diff --git a/features/support/env.rb b/features/support/env.rb deleted file mode 100644 index 64ddf610..00000000 --- a/features/support/env.rb +++ /dev/null @@ -1,58 +0,0 @@ -# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file -# instead of editing this one. Cucumber will automatically load all features/**/*.rb -# files. - -require 'cucumber/rails' - -# Capybara defaults to CSS3 selectors rather than XPath. -# If you'd prefer to use XPath, just uncomment this line and adjust any -# selectors in your step definitions to use the XPath syntax. -# Capybara.default_selector = :xpath - -# By default, any exception happening in your Rails application will bubble up -# to Cucumber so that your scenario will fail. This is a different from how -# your application behaves in the production environment, where an error page will -# be rendered instead. -# -# Sometimes we want to override this default behaviour and allow Rails to rescue -# exceptions and display an error page (just like when the app is running in production). -# Typical scenarios where you want to do this is when you test your error pages. -# There are two ways to allow Rails to rescue exceptions: -# -# 1) Tag your scenario (or feature) with @allow-rescue -# -# 2) Set the value below to true. Beware that doing this globally is not -# recommended as it will mask a lot of errors for you! -# -ActionController::Base.allow_rescue = false - -# Remove/comment out the lines below if your app doesn't have a database. -# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead. -begin - DatabaseCleaner.strategy = :transaction -rescue NameError - raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it." -end - -# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios. -# See the DatabaseCleaner documentation for details. Example: -# -# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do -# # { :except => [:widgets] } may not do what you expect here -# # as Cucumber::Rails::Database.javascript_strategy overrides -# # this setting. -# DatabaseCleaner.strategy = :truncation -# end -# -# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do -# DatabaseCleaner.strategy = :transaction -# end -# - -# Possible values are :truncation and :transaction -# The :transaction strategy is faster, but might give you threading problems. -# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature -Cucumber::Rails::Database.javascript_strategy = :truncation - diff --git a/features/support/factory_girl.rb b/features/support/factory_girl.rb deleted file mode 100644 index 139fbe01..00000000 --- a/features/support/factory_girl.rb +++ /dev/null @@ -1 +0,0 @@ -World(FactoryGirl::Syntax::Methods) diff --git a/features/support/finders.rb b/features/support/finders.rb deleted file mode 100644 index 47334b17..00000000 --- a/features/support/finders.rb +++ /dev/null @@ -1,4 +0,0 @@ -def find_project(name) - project = Project.where(full_name: "example/#{name}").first - project or raise "Project #{name.inspect} not found" -end diff --git a/features/support/ostruct_slice.rb b/features/support/ostruct_slice.rb deleted file mode 100644 index 70b0fd7e..00000000 --- a/features/support/ostruct_slice.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'ostruct' - -class OpenStruct - def slice(*args, &block) - marshal_dump.slice(*args, &block) - end -end diff --git a/features/support/rspec_doubles.rb b/features/support/rspec_doubles.rb deleted file mode 100644 index 6476fc19..00000000 --- a/features/support/rspec_doubles.rb +++ /dev/null @@ -1 +0,0 @@ -require 'cucumber/rspec/doubles' diff --git a/features/support/to_ostruct.rb b/features/support/to_ostruct.rb deleted file mode 100644 index bbb9cbc8..00000000 --- a/features/support/to_ostruct.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'ostruct' - -class Hash - def to_ostruct - o = OpenStruct.new(self) - each do |k,v| - o.send(:"#{k}=", v.to_ostruct) if v.respond_to? :to_ostruct - end - o - end -end - -class Array - def to_ostruct - map do |item| - if item.respond_to? :to_ostruct - item.to_ostruct - else - item - end - end - end -end diff --git a/features/tip_modifier_interface.feature b/features/tip_modifier_interface.feature deleted file mode 100644 index b4fa3a0f..00000000 --- a/features/tip_modifier_interface.feature +++ /dev/null @@ -1,125 +0,0 @@ -Feature: A project collaborator can change the tips of commits - Background: - Given a project "a" - And the project collaborators are: - | seldon | - | daneel | - And our fee is "0" - And a deposit of "500" - And the last known commit is "AAA" - And a new commit "BBB" with parent "AAA" - And a new commit "CCC" with parent "BBB" - And the author of commit "BBB" is "yugo" - And the message of commit "BBB" is "Tiny change" - And the author of commit "CCC" is "gaal" - - Scenario: Without anything modified - When the new commits are read - Then there should be a tip of "5" for commit "BBB" - And there should be a tip of "4.95" for commit "CCC" - And there should be 2 email sent - - Scenario: A collaborator wants to alter the tips - Given I'm logged in as "seldon" - And I go to the project page - And I click on "Change project settings" - And I check "Do not send the tips immediately. Give collaborators the ability to modify the tips before they're sent" - And I click on "Save the project settings" - Then I should see "The project settings have been updated" - - When the new commits are read - Then the tip amount for commit "BBB" should be undecided - And the tip amount for commit "CCC" should be undecided - And there should be 0 email sent - - When I go to the project page - And I click on "Decide tip amounts" - Then I should see "BBB" - And I should see "Tiny change" - And I should see "CCC" - And I should not see "AAA" - - When I choose the amount "Tiny: 0.1%" on commit "BBB" - And I click on "Send the selected tip amounts" - Then there should be a tip of "0.5" for commit "BBB" - And the tip amount for commit "CCC" should be undecided - And there should be 1 email sent - - When the email counters are reset - And I choose the amount "Free: 0%" on commit "CCC" - And I click on "Send the selected tip amounts" - Then there should be a tip of "0.5" for commit "BBB" - And there should be a tip of "0" for commit "CCC" - And there should be 0 email sent - - Scenario: A non collaborator does not see the settings button - Given I'm logged in as "yugo" - And I go to the project page - Then I should not see "Change project settings" - - Scenario: A non collaborator does not see the decide tip amounts button - Given the project has undedided tips - And I'm logged in as "yugo" - And I go to the project page - Then I should not see "Decide tip amounts" - - Scenario: A non collaborator goes to the edit page of a project - Given I'm logged in as "yugo" - When I go to the edit page of the project - Then I should see an access denied - - Scenario: A non collaborator sends a forged update on a project - Given I'm logged in as "yugo" - When I send a forged request to enable tip holding on the project - Then I should see an access denied - And the project should not hold tips - - Scenario: A collaborator sends a forged update on a project - Given I'm logged in as "daneel" - When I send a forged request to enable tip holding on the project - Then the project should hold tips - - Scenario Outline: A user sends a forged request to set a tip amount - Given the project has 1 undecided tip - And I'm logged in as "" - And I go to the project page - And I send a forged request to set the amount of the first undecided tip of the project - Then the project should have undecided tips - - Examples: - | user | remaining undecided tips | - | seldon | 0 | - | yugo | 1 | - - Scenario: A collaborator sends large amounts in tips - Given 20 new commits - And a new commit "last" - And the project holds tips - When the new commits are read - And I'm logged in as "seldon" - And I go to the project page - And I click on "Decide tip amounts" - And I choose the amount "Huge: 5%" on all commits - And I click on "Send the selected tip amounts" - Then I should see "You can't assign more than 100% of available funds." - And the tip amount for commit "BBB" should be undecided - And the tip amount for commit "CCC" should be undecided - - Scenario Outline: A collaborator changes the amount of a tip on another project - Given the project holds tips - And the new commits are read - And a project "fake" - And the project collaborators are: - | bad guy | - And a new commit "fake commit" - And the project holds tips - When the new commits are read - And I'm logged in as "" - And I send a forged request to change the percentage of commit "BBB" on project "a" to "5" - Then - - Examples: - | user | consequences | - | seldon | there should be a tip of "25" for commit "BBB" | - | bad guy | the tip amount for commit "BBB" should be undecided | - diff --git a/features/tipping_policies.feature b/features/tipping_policies.feature deleted file mode 100644 index 3b3c3e8a..00000000 --- a/features/tipping_policies.feature +++ /dev/null @@ -1,25 +0,0 @@ -Feature: A project collaborator can display the tipping policies of the project - Background: - Given a project - And the project collaborators are: - | seldon | - | daneel | - - Scenario: A collaborator changes the tipping policies - Given I'm logged in as "seldon" - And I go to the project page - And I click on "Change project settings" - And I fill "Tipping policies" with: - """ - All commits are huge! - - Blah blah - """ - And I click on "Save the project settings" - Then I should see "The project settings have been updated" - - Given I'm not logged in - And I go to the project page - Then I should see "All commits are huge!" - And I should see "Blah blah" - And I should see "seldon" diff --git a/lib/assets/.keep b/lib/assets/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/bitcoin_address_validator.rb b/lib/bitcoin_address_validator.rb deleted file mode 100644 index bce980bc..00000000 --- a/lib/bitcoin_address_validator.rb +++ /dev/null @@ -1,63 +0,0 @@ -require 'digest' - -class BitcoinAddressValidator < ActiveModel::EachValidator - def validate_each(record, field, value) - unless value.blank? || valid_bitcoin_address?(value) - record.errors[field] << "Bitcoin address is invalid" - end - end - - private - - B58Chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' - B58Base = B58Chars.length - - def valid_bitcoin_address?(address) - if (address =~ /^[a-zA-Z1-9]{33,35}$/) and version = version(address) - if (expected_versions = CONFIG["address_versions"]).present? - expected_versions.include?(version.ord) - else - true - end - else - false - end - end - - def version(address) - decoded = b58_decode(address, 25) - - version = decoded[0, 1] - checksum = decoded[-4, decoded.length] - vh160 = decoded[0, decoded.length - 4] - - hashed = (Digest::SHA2.new << (Digest::SHA2.new << vh160).digest).digest - - hashed[0, 4] == checksum ? version[0] : nil - end - - def b58_decode(value, length) - long_value = 0 - index = 0 - result = "" - - value.reverse.each_char do |c| - long_value += B58Chars.index(c) * (B58Base ** index) - index += 1 - end - - while long_value >= 256 do - div, mod = long_value.divmod 256 - result = mod.chr + result - long_value = div - end - - result = long_value.chr + result - - if result.length < length - result = 0.chr * (length - result.length) + result - end - - result - end -end diff --git a/lib/bitcoin_tipper.rb b/lib/bitcoin_tipper.rb deleted file mode 100644 index 0c61921a..00000000 --- a/lib/bitcoin_tipper.rb +++ /dev/null @@ -1,75 +0,0 @@ -class BitcoinTipper - def self.work_forever - while true do - self.work - end - end - - def self.work withdraw = true - Rails.logger.info "Traversing projects..." - Project.find_each do |project| - if project.available_amount > 0 - Rails.logger.info " Project #{project.id} #{project.full_name}" - project.tip_commits - end - end - - Rails.logger.info "Updating projects info..." - Project.order(:info_updated_at => :desc).last(20).each do |project| - Rails.logger.info " Project #{project.id} #{project.full_name}" - project.update_info - project.touch(:info_updated_at) - end - - if withdraw - Rails.logger.info "Traversing users..." - users_waiting_for_withdrawal = 0 - User.find_each do |user| - if user.bitcoin_address.present? && user.balance > CONFIG["min_payout"] - users_waiting_for_withdrawal += 1 - Rails.logger.info "User ##{user.id} is waiting for withdrawal" - end - end - - if users_waiting_for_withdrawal > 2 - self.create_sendmany - end - - Rails.logger.info "Traversing sendmanies..." - Sendmany.where(txid: nil).each do |sendmany| - sendmany.send_transaction - end - end - - Rails.logger.info "Auto-deciding older tips..." - Tip.auto_decide_older_tips - - Rails.logger.info "Refunding unclaimed tips..." - Tip.refund_unclaimed - - Rails.logger.info "Updating projects cache..." - Project.update_cache - - Rails.logger.info "Updating users cache..." - User.update_cache - end - - def self.create_sendmany - Rails.logger.info "Creating sendmany" - ActiveRecord::Base.transaction do - sendmany = Sendmany.create - outs = {} - User.find_each do |user| - if user.bitcoin_address.present? && user.balance > CONFIG["min_payout"] - user.tips.decided.unpaid.each do |tip| - tip.update_attribute :sendmany_id, sendmany.id - outs[user.bitcoin_address] = outs[user.bitcoin_address].to_i + tip.amount - end - end - end - sendmany.update_attribute :data, outs.to_json - Rails.logger.info " #{sendmany.inspect}" - end - end - -end diff --git a/lib/tasks/.keep b/lib/tasks/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake deleted file mode 100644 index 9f53ce49..00000000 --- a/lib/tasks/cucumber.rake +++ /dev/null @@ -1,65 +0,0 @@ -# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file -# instead of editing this one. Cucumber will automatically load all features/**/*.rb -# files. - - -unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks - -vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first -$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? - -begin - require 'cucumber/rake/task' - - namespace :cucumber do - Cucumber::Rake::Task.new({:ok => 'test:prepare'}, 'Run features that should pass') do |t| - t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. - t.fork = true # You may get faster startup if you set this to false - t.profile = 'default' - end - - Cucumber::Rake::Task.new({:wip => 'test:prepare'}, 'Run features that are being worked on') do |t| - t.binary = vendored_cucumber_bin - t.fork = true # You may get faster startup if you set this to false - t.profile = 'wip' - end - - Cucumber::Rake::Task.new({:rerun => 'test:prepare'}, 'Record failing features and run only them if any exist') do |t| - t.binary = vendored_cucumber_bin - t.fork = true # You may get faster startup if you set this to false - t.profile = 'rerun' - end - - desc 'Run all features' - task :all => [:ok, :wip] - - task :statsetup do - require 'rails/code_statistics' - ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features') - ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features') - end - end - desc 'Alias for cucumber:ok' - task :cucumber => 'cucumber:ok' - - task :default => :cucumber - - task :features => :cucumber do - STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" - end - - # In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon. - task 'test:prepare' do - end - - task :stats => 'cucumber:statsetup' -rescue LoadError - desc 'cucumber rake task not available (cucumber not installed)' - task :cucumber do - abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' - end -end - -end diff --git a/lib/templates/haml/scaffold/_form.html.haml b/lib/templates/haml/scaffold/_form.html.haml deleted file mode 100644 index ac3aa7bc..00000000 --- a/lib/templates/haml/scaffold/_form.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -= simple_form_for(@<%= singular_table_name %>) do |f| - = f.error_notification - - .form-inputs - <%- attributes.each do |attribute| -%> - = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> - <%- end -%> - - .form-actions - = f.button :submit diff --git a/log/.keep b/log/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/public/404.html b/public/404.html deleted file mode 100644 index a0daa0c1..00000000 --- a/public/404.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - -
-

The page you were looking for doesn't exist.

-

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

-
-

If you are the application owner check the logs for more information.

- - diff --git a/public/422.html b/public/422.html deleted file mode 100644 index fbb4b84d..00000000 --- a/public/422.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - The change you wanted was rejected (422) - - - - - -
-

The change you wanted was rejected.

-

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

-
-

If you are the application owner check the logs for more information.

- - diff --git a/public/500.html b/public/500.html deleted file mode 100644 index e9052d35..00000000 --- a/public/500.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - -
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

- - diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index e69de29b..00000000 diff --git a/public/javascripts/translations.js b/public/javascripts/translations.js deleted file mode 100644 index 0f19fce3..00000000 --- a/public/javascripts/translations.js +++ /dev/null @@ -1,2 +0,0 @@ -var I18n = I18n || {}; -I18n.translations = {"en":{"date":{"formats":{"default":"%Y-%m-%d","short":"%b %d","long":"%B %d, %Y"},"day_names":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"abbr_day_names":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"month_names":[null,"January","February","March","April","May","June","July","August","September","October","November","December"],"abbr_month_names":[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"order":["year","month","day"]},"time":{"formats":{"default":"%a, %d %b %Y %H:%M:%S %z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"},"am":"am","pm":"pm"},"support":{"array":{"words_connector":", ","two_words_connector":" and ","last_word_connector":", and "}},"number":{"format":{"separator":".","delimiter":",","precision":3,"significant":false,"strip_insignificant_zeros":false},"currency":{"format":{"format":"%u%n","unit":"$","separator":".","delimiter":",","precision":2,"significant":false,"strip_insignificant_zeros":false}},"percentage":{"format":{"delimiter":"","format":"%n%"}},"precision":{"format":{"delimiter":""}},"human":{"format":{"delimiter":"","precision":3,"significant":true,"strip_insignificant_zeros":true},"storage_units":{"format":"%n %u","units":{"byte":{"one":"Byte","other":"Bytes"},"kb":"KB","mb":"MB","gb":"GB","tb":"TB"}},"decimal_units":{"format":"%n %u","units":{"unit":"","thousand":"Thousand","million":"Million","billion":"Billion","trillion":"Trillion","quadrillion":"Quadrillion"}}}},"errors":{"format":"%{attribute} %{message}","messages":{"inclusion":"is not included in the list","exclusion":"is reserved","invalid":"is invalid","confirmation":"doesn't match %{attribute}","accepted":"must be accepted","empty":"can't be empty","blank":"can't be blank","present":"must be blank","too_long":"is too long (maximum is %{count} characters)","too_short":"is too short (minimum is %{count} characters)","wrong_length":"is the wrong length (should be %{count} characters)","not_a_number":"is not a number","not_an_integer":"must be an integer","greater_than":"must be greater than %{count}","greater_than_or_equal_to":"must be greater than or equal to %{count}","equal_to":"must be equal to %{count}","less_than":"must be less than %{count}","less_than_or_equal_to":"must be less than or equal to %{count}","other_than":"must be other than %{count}","odd":"must be odd","even":"must be even","taken":"has already been taken","already_confirmed":"was already confirmed, please try signing in","confirmation_period_expired":"needs to be confirmed within %{period}, please request a new one","expired":"has expired, please request a new one","not_found":"not found","not_locked":"was not locked","not_saved":{"one":"1 error prohibited this %{resource} from being saved:","other":"%{count} errors prohibited this %{resource} from being saved:"}},"project_not_found":"Project not found.","access_denied":"You are not authorized to perform this action!","can_assign_more_tips":"You can't assign more than 100% of available funds.","wrong_bitcoin_address":"Error updating bitcoin address","user_not_found":"User not found"},"activerecord":{"errors":{"messages":{"record_invalid":"Validation failed: %{errors}","restrict_dependent_destroy":{"one":"Cannot delete record because a dependent %{record} exists","many":"Cannot delete record because dependent %{record} exist"}}},"attributes":{"user":{"email":"E-mail","bitcoin_address":"Bitcoin address","password":"Password","password_confirmation":"Password confirmation"}}},"datetime":{"distance_in_words":{"half_a_minute":"half a minute","less_than_x_seconds":{"one":"less than 1 second","other":"less than %{count} seconds"},"x_seconds":{"one":"1 second","other":"%{count} seconds"},"less_than_x_minutes":{"one":"less than a minute","other":"less than %{count} minutes"},"x_minutes":{"one":"1 minute","other":"%{count} minutes"},"about_x_hours":{"one":"about 1 hour","other":"about %{count} hours"},"x_days":{"one":"1 day","other":"%{count} days"},"about_x_months":{"one":"about 1 month","other":"about %{count} months"},"x_months":{"one":"1 month","other":"%{count} months"},"about_x_years":{"one":"about 1 year","other":"about %{count} years"},"over_x_years":{"one":"over 1 year","other":"over %{count} years"},"almost_x_years":{"one":"almost 1 year","other":"almost %{count} years"}},"prompts":{"year":"Year","month":"Month","day":"Day","hour":"Hour","minute":"Minute","second":"Seconds"}},"helpers":{"select":{"prompt":"Please select"},"submit":{"create":"Create %{model}","update":"Update %{model}","submit":"Save %{model}"},"page_entries_info":{"one_page":{"display_entries":{"zero":"No %{entry_name} found","one":"Displaying \u003Cb\u003E1\u003C/b\u003E %{entry_name}","other":"Displaying \u003Cb\u003Eall %{count}\u003C/b\u003E %{entry_name}"}},"more_pages":{"display_entries":"Displaying %{entry_name} \u003Cb\u003E%{first}\u0026nbsp;-\u0026nbsp;%{last}\u003C/b\u003E of \u003Cb\u003E%{total}\u003C/b\u003E in total"}},"actions":"Actions","links":{"back":"Back","cancel":"Cancel","confirm":"Are you sure?","destroy":"Delete","new":"New","edit":"Edit"},"titles":{"edit":"Edit %{model}","save":"Save %{model}","new":"New %{model}","delete":"Delete %{model}"}},"views":{"pagination":{"first":"\u0026laquo; First","last":"Last \u0026raquo;","previous":"\u0026lsaquo; Prev","next":"Next \u0026rsaquo;","truncate":"\u0026hellip;"}},"devise":{"confirmations":{"confirmed":"Your account was successfully confirmed. Please sign in.","send_instructions":"You will receive an email with instructions about how to confirm your account in a few minutes.","send_paranoid_instructions":"If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes.","confirmed_and_signed_in":"Your account was successfully confirmed. You are now signed in.","new":{"title":"Resend confirmation instructions","submit":"Resend confirmation instructions"}},"failure":{"already_authenticated":"You are already signed in.","inactive":"Your account is not activated yet.","invalid":"Invalid email or password.","locked":"Your account is locked.","last_attempt":"You have one more attempt before your account will be locked.","not_found_in_database":"Invalid email or password.","timeout":"Your session expired. Please sign in again to continue.","unauthenticated":"You need to sign in or sign up before continuing.","unconfirmed":"You have to confirm your account before continuing.","invalid_token":"Invalid authentication token."},"mailer":{"confirmation_instructions":{"subject":"Confirmation instructions"},"reset_password_instructions":{"subject":"Reset password instructions"},"unlock_instructions":{"subject":"Unlock Instructions"}},"omniauth_callbacks":{"failure":"Could not authenticate you from %{kind} because \"%{reason}\".","success":"Successfully authenticated from %{kind} account."},"passwords":{"no_token":"You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided.","send_instructions":"You will receive an email with instructions about how to reset your password in a few minutes.","send_paranoid_instructions":"If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes.","updated":"Your password was changed successfully. You are now signed in.","updated_not_active":"Your password was changed successfully.","new":{"title":"Forgot your password?","submit":"Send me reset password instructions"},"edit":{"title":"Change your password","submit":"Change my password"}},"registrations":{"destroyed":"Bye! Your account was successfully cancelled. We hope to see you again soon.","signed_up":"Welcome! You have signed up successfully.","signed_up_but_inactive":"You have signed up successfully. However, we could not sign you in because your account is not yet activated.","signed_up_but_locked":"You have signed up successfully. However, we could not sign you in because your account is locked.","signed_up_but_unconfirmed":"A message with a confirmation link has been sent to your email address. Please open the link to activate your account.","update_needs_confirmation":"You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address.","updated":"You updated your account successfully.","new":{"title":"Sign up","submit":"Sign up"}},"sessions":{"signed_in":"Signed in successfully.","signed_out":"Signed out successfully.","new":{"title":"Sign in","remember_me":"Remember me","submit":"Sign in"}},"unlocks":{"send_instructions":"You will receive an email with instructions about how to unlock your account in a few minutes.","send_paranoid_instructions":"If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.","unlocked":"Your account has been unlocked successfully. Please sign in to continue."},"links":{"sign_in":"Sign in","sign_up":"Sign up","recover":"Forgot your password?","confirm":"Didn't receive confirmation instructions?","sign_in_with":"Sign in with %{provider}"},"errors":{"primary_email":"your primary email address should be verified.","onmiauth_info":"we were unable to fetch your information."}},"tip4commit":"Tip4Commit","meta":{"title":"Contribute to Open Source","description":"Donate bitcoins to open source projects or make commits and get tips for it."},"menu":{"home":"Home","projects":"Supported Projects"},"footer":{"text":"Source code is available at %{github_link} and you can also %{support_link} its development.","github_link":"GitHub","support_link":"support","follow_link":"Follow @tip4commit"},"links":{"sign_in":"Sign in","sign_out":"Sign Out"},"notices":{"project_updated":"The project settings have been updated","tips_decided":"The tip amounts have been defined","user_updated":"Your information saved!","user_unsubscribed":"You unsubscribed! Sorry for bothering you. Although, you still can leave us your bitcoin address to get your tips."},"tip_amounts":{"undecided":"Undecided","free":"Free: 0%","tiny":"Tiny: 0.1%","small":"Small: 0.5%","normal":"Normal: 1%","big":"Big: 2%","huge":"Huge: 5%"},"home":{"index":{"see_projects":"See projects","how_does_it_work":{"title":"How does it work?","text":"People donate bitcoins to projects. When someone's commit is accepted into the project repository, we automatically tip the author.","button":"Learn about Bitcoin"},"donate":{"title":"Donate","text":"Find a project you like and deposit bitcoins into it. Your donation will be accumulated with the funds of other donators to give as tips for new commits.","button":"Find or add a project"},"contribute":{"title":"Contribute","text":"Go and fix something! If your commit is accepted by the project maintainer, you will get a tip!","sign_in_text":"Just check your email or %{sign_in_link}.","button":"Supported projects"}}},"projects":{"index":{"find_project":{"placeholder":"Enter GitHub project URL to find or add a project e.g. rails/rails","button":"Find or add project"},"repository":"Repository","description":"Description","watchers":"Watchers","balance":"Balance","forked_from":"forked from","support":"Support"},"show":{"title":"Contribute to %{project}","edit_project":"Change project settings","decide_tip_amounts":"Decide tip amounts","project_sponsors":"Project Sponsors","fee":"%{percentage} of deposited funds will be used to tip for new commits.","balance":"Balance","custom_tip_size":"(each new commit receives a percentage of available balance)","default_tip_size":"(each new commit receives %{percentage} of available balance)","unconfirmed_amount":"(%{amount} unconfirmed)","tipping_policies":"Tipping policies","updated_by_user":"(Last updated by %{name} on %{date})","updated_by_unknown":"(Last updated on %{date})","tips_paid":"Tips Paid","unclaimed_amount":"(%{amount} of this is unclaimed, and will be refunded to the project after being unclaimed for 1 month.)","last_tips":"Last Tips","see_all":"see all","received":"received %{amount}","will_receive":"will receive a tip","for_commit":"for commit","when_decided":"when its amount is decided","next_tip":"Next Tip","contribute_and_earn":"Contribute and Earn","cocontribute_and_earn_description":"Donate bitcoins to this project or %{make_commits_link} and get tips for it. If your commit is accepted by the project maintainer and there are bitcoins on its balance, you will get a tip!","make_commits_link":"make commits","tell_us_bitcoin_address":"Just %{tell_us_link} your bitcoin address.","tell_us_link":"tell us","sign_in":"Just check your email or %{sign_in_link}.","promote_project":"Promote %{project}","embedding":"Embedding","image_url":"Image URL:","shield_title":"tip for next commit"},"edit":{"project_settings":"%{project} project settings","tipping_policies":"Tipping policies","hold_tips":"Do not send the tips immediatly. Give collaborators the ability to modify the tips before they're sent","save":"Save the project settings"},"decide_tip_amounts":{"commit":"Commit","author":"Author","message":"Message","tip":"Tip (relative to the project balance)","submit":"Send the selected tip amounts"}},"tips":{"index":{"tips":"Tips","project_tips":"%{project} tips","user_tips":"%{user} tips","created_at":"Created At","commiter":"Commiter","project":"Project","commit":"Commit","amount":"Amount","refunded":"Refunded to project's deposit","undecided":"The amount of the tip has not been decided yet","no_bitcoin_address":"User didn't specify withdrawal address","below_threshold":"User's balance is below withdrawal threshold","waiting":"Waiting for withdrawal","error":"(error sending transaction)"}},"users":{"index":{"title":"Top Contributors","name":"Name","commits_count":"Commits tipped","withdrawn":"Withdrawn"},"show":{"balance":"Balance","threshold":"You will get your money when your balance hits the threshold of %{threshold}","see_all":"see all","received":"%{time} received %{amount} for commit %{commit} in %{project}","bitcoin_address_placeholder":"Your bitcoin address","notify":"Notify me about new tips (no more than one email per month)","submit_bitcoin_address":"Update Bitcoin address","change_password":"Change your password","submit_password":"Change my password"}},"withdrawals":{"index":{"title":"Last Withdrawals","created_at":"Created At","transaction":"Transaction","result":"Result","error":"Error","success":"Success"}}}}; \ No newline at end of file diff --git a/public/robots.txt b/public/robots.txt deleted file mode 100644 index 4860601a..00000000 --- a/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -User-agent: * -Disallow: /users/ -Crawl-delay: 10 diff --git a/public/shield.svg b/public/shield.svg deleted file mode 100644 index bfa7bfd8..00000000 --- a/public/shield.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tip4commit - - - - - - - - 0.075 Ƀ - - - \ No newline at end of file diff --git a/public/webfonts/28BE49_0_0.eot b/public/webfonts/28BE49_0_0.eot deleted file mode 100644 index 82ec9234..00000000 Binary files a/public/webfonts/28BE49_0_0.eot and /dev/null differ diff --git a/public/webfonts/28BE49_0_0.ttf b/public/webfonts/28BE49_0_0.ttf deleted file mode 100644 index 9bc48f70..00000000 Binary files a/public/webfonts/28BE49_0_0.ttf and /dev/null differ diff --git a/public/webfonts/28BE49_0_0.woff b/public/webfonts/28BE49_0_0.woff deleted file mode 100644 index 6dd9148d..00000000 Binary files a/public/webfonts/28BE49_0_0.woff and /dev/null differ diff --git a/script/cucumber b/script/cucumber deleted file mode 100755 index 7fa5c920..00000000 --- a/script/cucumber +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env ruby - -vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first -if vendored_cucumber_bin - load File.expand_path(vendored_cucumber_bin) -else - require 'rubygems' unless ENV['NO_RUBYGEMS'] - require 'cucumber' - load Cucumber::BINARY -end diff --git a/spec/controllers/deposits_controller_spec.rb b/spec/controllers/deposits_controller_spec.rb deleted file mode 100644 index 3180085e..00000000 --- a/spec/controllers/deposits_controller_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'spec_helper' - -describe DepositsController do - - describe "GET 'index'" do - it "returns http success" do - get 'index' - expect(response).to be_success - end - end - -end diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb deleted file mode 100644 index 10af3c4a..00000000 --- a/spec/controllers/home_controller_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe HomeController do - describe '#index' do - let(:subject) { get :index } - - it 'renders index template' do - expect(subject).to render_template :index - end - - it 'returns 200 status code' do - expect(subject.status).to eq 200 - end - end -end diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb deleted file mode 100644 index 02c5bb9d..00000000 --- a/spec/controllers/projects_controller_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'spec_helper' - -describe ProjectsController do - describe '#index' do - let(:subject) { get :index } - before do - allow(Project).to receive(:order).with(available_amount_cache: :desc, watchers_count: :desc, full_name: :asc).and_return(Project) - allow(Project).to receive(:page).with(nil).and_return(Project) - allow(Project).to receive(:per).with(30).and_return(Project) - end - - it 'renders index template' do - expect(subject).to render_template :index - end - - it 'returns 200 status code' do - expect(subject.status).to eq 200 - end - - it 'Project calls order' do - expect(Project).to receive(:order).with(available_amount_cache: :desc, watchers_count: :desc, full_name: :asc).and_return(Project) - subject - end - - it 'Project calls page' do - expect(Project).to receive(:page).with(nil).and_return(Project) - subject - end - - it 'Project calls per' do - expect(Project).to receive(:per).with(30).and_return(Project) - subject - end - - it 'assigns @projects' do - subject - expect(assigns[:projects].name).to eq 'Project' - end - end -end diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb deleted file mode 100644 index f5f09135..00000000 --- a/spec/controllers/users_controller_spec.rb +++ /dev/null @@ -1,61 +0,0 @@ -require 'spec_helper' - -describe UsersController do - describe '#show' do - let(:user) { mock_model User, id: 100000000 } - let(:subject) { get :show, id: user.id } - - context 'when logged in' do - login_user - - context 'when user found' do - context 'when viewing own page' do - before { allow(user).to receive(:id).and_return(@current_user.id) } - it 'renders show template' do - expect(subject).to render_template :show - end - - it 'returns 200 status code' do - expect(subject.status).to eq 200 - end - end - - context 'when viewing other\'s page' do - let(:new_user) { create(:user) } - let(:subject) { get :show, id: new_user.id } - - it 'redirect to root_path' do - expect(subject).to redirect_to root_path - end - - it 'sets flash error message' do - subject - expect(flash[:error]).to eq('You are not authorized to perform this action!') - end - end - end - - context 'when user not found' do - it 'redirect to root_path' do - expect(subject).to redirect_to root_path - end - - it 'sets flash error message' do - subject - expect(flash[:error]).to eq('User not found') - end - end - end - - context 'when not logged in' do - it 'redirects to login page' do - expect(subject).to redirect_to new_user_session_path - end - - it 'sets flash alert message' do - subject - expect(flash[:alert]).to eq('You need to sign in or sign up before continuing.') - end - end - end -end diff --git a/spec/factories/deposit.rb b/spec/factories/deposit.rb deleted file mode 100644 index e76681b0..00000000 --- a/spec/factories/deposit.rb +++ /dev/null @@ -1,8 +0,0 @@ -FactoryGirl.define do - factory :deposit do - association :project - txid "txid" - confirmations 1 - amount 100 - end -end diff --git a/spec/factories/project.rb b/spec/factories/project.rb deleted file mode 100644 index f900ff1c..00000000 --- a/spec/factories/project.rb +++ /dev/null @@ -1,16 +0,0 @@ -FactoryGirl.define do - factory :project do - url "MyString" - full_name "test/test" - github_id "1234567890" - bitcoin_address "bitcoin_address" - - trait :github do - host 'github' - end - - trait :bitbucket do - host 'bitbucket' - end - end -end diff --git a/spec/factories/sendmany.rb b/spec/factories/sendmany.rb deleted file mode 100644 index 6cf19257..00000000 --- a/spec/factories/sendmany.rb +++ /dev/null @@ -1,8 +0,0 @@ -FactoryGirl.define do - factory :sendmany do - txid "txid" - data "MyText" - result "MyString" - is_error false - end -end diff --git a/spec/factories/tip.rb b/spec/factories/tip.rb deleted file mode 100644 index 4107159e..00000000 --- a/spec/factories/tip.rb +++ /dev/null @@ -1,12 +0,0 @@ -FactoryGirl.define do - factory :tip do - association :user - association :project - amount 1 - commit { Digest::SHA1.hexdigest(SecureRandom.hex) } - - factory :undecided_tip do - amount nil - end - end -end diff --git a/spec/factories/user.rb b/spec/factories/user.rb deleted file mode 100644 index de2ee3db..00000000 --- a/spec/factories/user.rb +++ /dev/null @@ -1,9 +0,0 @@ -FactoryGirl.define do - factory :user do - sequence(:email) { |n| "test#{n}@gmail.com" } - password "password" - login_token "login_token" - name 'kd' - nickname 'kd' - end -end diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb deleted file mode 100644 index 4b0f1308..00000000 --- a/spec/mailers/user_mailer_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -require 'spec_helper' - -describe UserMailer do - describe 'new_tip' do - let(:user) { mock_model User, name: 'kd', email: 'kd.engineer@yahoo.co.in', display_name: 'kuldeep aggarwal', login_token: 'my login token', balance: 10 } - let(:project) { mock_model Project, full_name: 'logger-extension' } - let(:tip) { mock_model Tip, amount: 0.0001, project: project } - let(:mail) { UserMailer.new_tip(user, tip) } - - it 'renders the subject' do - expect(mail.subject).to eq 'You received a tip for your commit' - end - - it 'renders the receiver email' do - expect(mail.to).to eq [user.email] - end - - it 'renders the sender email' do - expect(mail.from).to eq ['no-reply@tip4commit.com'] - end - - it 'assigns user\'s display_name' do - expect(mail.body.encoded).to match(user.display_name) - end - - it 'assigns users\' balance' do - expect(mail.body.encoded).to match("Please, log in and tell us your bitcoin address to get it.

\r\n

Your current balance is 0.00000010 Ƀ") - end - - it 'useses secure protocol for links' do - expect(mail.body.encoded).to match('https') - end - end -end diff --git a/spec/models/deposit_spec.rb b/spec/models/deposit_spec.rb deleted file mode 100644 index d330387b..00000000 --- a/spec/models/deposit_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -require 'spec_helper' - -describe Deposit do - let(:deposit) { create(:deposit) } - - describe 'Associations' do - it { should belong_to :project } - end - - describe '#fee' do - it 'returns amount * fee' do - with_custom_fee do - expect(deposit.fee).to eq (deposit.amount * 0.01).to_i - end - end - end - - describe '#available_amount' do - it 'returns max of [(amount - fee), 0]' do - with_custom_fee do - deposit.amount = 100 - expect(deposit.available_amount).to eq 99 - deposit.amount = 0 - expect(deposit.available_amount).to eq 0 - end - end - end - - private - - def with_custom_fee - old_fee = CONFIG["our_fee"] - CONFIG["our_fee"] = 0.01 - yield - ensure - CONFIG["our_fee"] = old_fee - end - -end \ No newline at end of file diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb deleted file mode 100644 index c1a604fb..00000000 --- a/spec/models/project_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -require 'spec_helper' - -describe Project do - let(:project) { create(:project) } - let(:project_of_bitbucket) { create(:project, :bitbucket) } - - describe 'Associations' do - it { should have_many(:deposits) } - it { should have_many(:tips) } - end - - describe 'Validations' do - it { should validate_presence_of(:full_name) } - it { should validate_presence_of(:github_id) } - it { should validate_presence_of(:host) } - it { should validate_uniqueness_of(:full_name) } - it { should validate_uniqueness_of(:github_id) } - it { should ensure_inclusion_of(:host).in_array([ "github", "bitbucket" ]) } - end - - describe '#repository_client' do - context 'when host is github' do - it 'returns Github instance' do - expect(project.repository_client).to be_a Github - end - end - - context 'when host is bitbucket' do - it 'returns Bitbucket instance' do - expect(project_of_bitbucket.repository_client).to be_a Bitbucket - end - end - - context 'when host is blank' do - before { project.host = '' } - - it 'returns NilClass instance' do - expect(project.repository_client).to be_a NilClass - end - end - end -end \ No newline at end of file diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb deleted file mode 100644 index c95a5918..00000000 --- a/spec/models/user_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -require 'spec_helper' - -describe User do - let(:user) { create(:user) } - - describe 'full_name' do - context 'when name is present' do - it 'returns name' do - expect(user.display_name).to eq(user.name) - end - end - - context 'when name is absent and nickname is present' do - it 'returns nickname' do - user.name = nil - expect(user.display_name).to eq(user.nickname) - end - end - - context 'when name and nickname is absent and email is absent' do - it 'returns email' do - user.name = user.nickname = nil - expect(user.display_name).to eq(user.email) - end - end - end - - describe 'bitcoin_address' do - context 'when address is blank' do - it 'should be valid' do - user.bitcoin_address = '' - user.should be_valid - end - end - - context 'when address is valid' do - it 'should be valid' do - user.bitcoin_address = '1M4bS4gPyA6Kb8w7aXsgth9oUZWcRk73tQ' - user.should be_valid - end - end - - context 'when address is not valid' do - it 'should not be valid' do - user.bitcoin_address = '1M4bS4gPyA6Kb8w7aXsgth9oUZXXXXXXXX' - user.should_not be_valid - end - end - - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index cee30cb5..00000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,54 +0,0 @@ -require 'simplecov' -SimpleCov.start 'rails' - -# This file is copied to spec/ when you run 'rails generate rspec:install' -ENV["RAILS_ENV"] ||= 'test' -require File.expand_path("../../config/environment", __FILE__) -require 'rspec/rails' -require 'rspec/autorun' -# -# Requires supporting ruby files with custom matchers and macros, etc, in -# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are -# run as spec files by default. This means that files in spec/support that end -# in _spec.rb will both be required and run as specs, causing the specs to be -# run twice. It is recommended that you do not name files matching this glob to -# end with _spec.rb. You can configure this pattern with with the --pattern -# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. -Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } - -# Checks for pending migrations before tests are run. -# If you are not using ActiveRecord, you can remove this line. -ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration) - -RSpec.configure do |config| - # ## Mock Framework - # - # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: - # - # config.mock_with :mocha - # config.mock_with :flexmock - # config.mock_with :rr - - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" - - # If you're not using ActiveRecord, or you'd prefer not to run each of your - # examples within a transaction, remove the following line or assign false - # instead of true. - config.use_transactional_fixtures = true - - # If true, the base class of anonymous controllers will be inferred - # automatically. This will be the default behavior in future versions of - # rspec-rails. - config.infer_base_class_for_anonymous_controllers = false - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = "random" - - include FactoryGirl::Syntax::Methods - config.include Devise::TestHelpers, type: :controller - config.extend ControllerMacros, type: :controller -end diff --git a/spec/support/controller_macros.rb b/spec/support/controller_macros.rb deleted file mode 100644 index f8a72269..00000000 --- a/spec/support/controller_macros.rb +++ /dev/null @@ -1,10 +0,0 @@ -module ControllerMacros - def login_user - before do - @request.env['devise.mapping'] = Devise.mappings[:user] - @current_user = create(:user) - @current_user.confirm! - sign_in @current_user - end - end -end diff --git a/vendor/assets/javascripts/.keep b/vendor/assets/javascripts/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/assets/stylesheets/.keep b/vendor/assets/stylesheets/.keep deleted file mode 100644 index e69de29b..00000000