diff --git a/.codeclimate.yml b/.codeclimate.yml index 28469e82..916b43f3 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,4 +1,18 @@ -engines: +version: "2" +checks: + file-lines: + config: + threshold: 300 + method-complexity: + config: + threshold: 50 + method-count: + config: + threshold: 20 + method-lines: + config: + threshold: 100 +plugins: brakeman: enabled: true fixme: @@ -16,3 +30,5 @@ engines: enabled: false Rubocop/Style/HashSyntax: enabled: false +#exclude_patterns: +#- app/assets/javascripts-jquery-ui diff --git a/.dockerignore b/.dockerignore index d9b8002c..51d21e85 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,4 @@ .bundle -.git config/database.yml config/site.yml coverage diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml new file mode 100644 index 00000000..85ff5f96 --- /dev/null +++ b/.github/workflows/build-docker-image.yml @@ -0,0 +1,47 @@ +name: 'build' + +on: + push: + branches: + - master + pull_request: + +jobs: + build-and-publish-latest: + name: 'Build latest' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 # Checking out the repo + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + tracksapp/tracks:latest + tracksapp/tracks:master + ghcr.io/tracksapp/tracks:latest + +#ghcr.io/TracksApp/tracks:1.0.0 +#tracksapp/tracks:1.0.0 diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 33de64c0..f66ed13c 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -6,13 +6,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: ["2.5", "2.6", "2.7"] + ruby: ["2.7", "3.0"] db: [sqlite, mysql, postgres] exclude: - - ruby: "2.5" - db: sqlite - - ruby: "2.5" - db: postgres - ruby: "2.6" db: sqlite - ruby: "2.6" diff --git a/.rubocop.yml b/.rubocop.yml index 8785daf6..03441c91 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,3 +16,20 @@ Style/StringLiterals: Layout/AlignParameters: EnforcedStyle: with_fixed_indentation + +Metrics/AbcSize: + Max: 100 +Metrics/CyclomaticComplexity: + Max: 100 +Metrics/MethodLength: + Max: 100 + CountAsOne: ['array', 'hash', 'heredoc'] +Metrics/ModuleLength: + Max: 300 + CountAsOne: ['array', 'hash', 'heredoc'] +Metrics/ClassLength: + Max: 300 +Metrics/ParameterLists: + Max: 20 +Metrics/PerceivedComplexity: + Max: 100 diff --git a/Dockerfile b/Dockerfile index 303b86b7..b770a113 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7.1 +FROM ruby:2.7 # throw errors if Gemfile has been modified since Gemfile.lock RUN bundle config --global frozen 1 @@ -13,18 +13,35 @@ RUN bundle install --jobs 4 RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -RUN apt-get update && apt-get install -y yarn +RUN apt-get update && apt-get install -y yarn netcat RUN mkdir /app/log -COPY . /app/ +COPY COPYING /app/ +COPY config /app/config/ COPY config/database.docker.yml /app/config/database.yml COPY config/site.docker.yml /app/config/site.yml +COPY bin /app/bin/ +COPY script /app/script/ +COPY public /app/public/ +COPY vendor /app/vendor/ + +COPY .yardopts /app/ +COPY Rakefile /app/ +COPY config.ru /app/ +COPY docker-entrypoint.sh /app/ + +COPY lib /app/lib/ +COPY app /app/app/ +COPY db /app/db/ + +COPY .git /app/.git + RUN RAILS_ENV=production bundle exec rake assets:precompile ENTRYPOINT ["/app/docker-entrypoint.sh"] EXPOSE 3000 -CMD ["rails", "server", "-b", "0.0.0.0"] +CMD ["./bin/rails", "server", "-b", "0.0.0.0"] diff --git a/Dockerfile-2.6 b/Dockerfile-2.6 index 0bef7e0e..ee5f7de3 100644 --- a/Dockerfile-2.6 +++ b/Dockerfile-2.6 @@ -1,4 +1,4 @@ -FROM ruby:2.6.5 +FROM ruby:2.6 # throw errors if Gemfile has been modified since Gemfile.lock RUN bundle config --global frozen 1 diff --git a/Dockerfile-2.5 b/Dockerfile-3.0 similarity index 97% rename from Dockerfile-2.5 rename to Dockerfile-3.0 index f453241e..534d5c92 100644 --- a/Dockerfile-2.5 +++ b/Dockerfile-3.0 @@ -1,4 +1,4 @@ -FROM ruby:2.5.7 +FROM ruby:3.0 # throw errors if Gemfile has been modified since Gemfile.lock RUN bundle config --global frozen 1 diff --git a/Gemfile b/Gemfile index c104f079..f44b6427 100644 --- a/Gemfile +++ b/Gemfile @@ -5,23 +5,23 @@ gem 'activemodel-serializers-xml', '~> 1.0.1' gem 'coffee-rails', '~> 5.0.0' -gem 'jquery-rails', '~> 4.4' +gem 'jquery-rails', '~> 4.5' gem 'jquery-ui-rails', '~>6.0.1' -gem 'rails', '~> 6.0.3' +gem 'rails', '~> 6.0.0' gem 'sassc-rails', '~> 2.1.2' gem 'bootstrap-sass', '3.4.1' -gem 'font-awesome-sass', '~> 5.15.1' +gem 'font-awesome-sass', '~> 6.1.2' gem 'uglifier', '>=1.3.0' -gem 'aasm', '~> 5.2.0' +gem 'aasm', '~> 5.3.0' gem 'acts_as_list' -gem 'bcrypt', '~> 3.1.16' +gem 'bcrypt', '~> 3.1.18' gem 'htmlentities' -gem 'paperclip' -gem 'puma', '~> 5.5' +gem "kt-paperclip", "~> 7.1" +gem 'puma', '~> 5.6' gem 'rails_autolink' gem 'RedCloth' gem 'sanitize', '~> 6.0' @@ -36,35 +36,35 @@ end # Use --without argument to skip unnecessary drivers gem 'sqlite3', group: :sqlite -gem 'mysql2', '~> 0.5.3', group: :mysql -gem 'pg', '~> 1.2.3', group: :postgresql +gem 'mysql2', '~> 0.5.4', group: :mysql +gem 'pg', '~> 1.4.3', group: :postgresql group :development do - gem 'spring' + gem 'spring', '~> 4' gem 'yard' - gem 'tolk', '~> 4.1.0' + gem 'tolk', '~> 4.3.0' gem 'bullet' gem 'rack-mini-profiler' gem 'solargraph' - gem 'i18n-tasks', '~> 0.9.35' + gem 'i18n-tasks', '~> 1.0.11' end group :development, :test do gem 'byebug' gem 'listen' - gem 'rubocop', '~> 1.22', require: false + gem 'rubocop', '~> 1.34', require: false end group :test do - # Get test coverage info on codeclimate - gem 'codeclimate-test-reporter', '1.0.7', require: nil - gem 'database_cleaner' + # get test coverage info on codeclimate + gem 'codeclimate-test-reporter', '1.0.7', group: :test, require: nil + gem 'database_cleaner', '~> 1' gem 'factory_bot_rails' - gem 'mocha', :require => false gem 'minitest-stub-const' + gem 'mocha', :require => false gem 'rails-controller-testing' gem 'rails-dom-testing', '~> 2.0.0' gem 'rspec-expectations' diff --git a/Gemfile.lock b/Gemfile.lock index 7dcb6f4b..88a50c44 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,28 +2,28 @@ GEM remote: https://rubygems.org/ specs: RedCloth (4.3.2) - aasm (5.2.0) + aasm (5.3.0) concurrent-ruby (~> 1.0) - actioncable (6.0.4.1) - actionpack (= 6.0.4.1) + actioncable (6.0.5.1) + actionpack (= 6.0.5.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.4.1) - actionpack (= 6.0.4.1) - activejob (= 6.0.4.1) - activerecord (= 6.0.4.1) - activestorage (= 6.0.4.1) - activesupport (= 6.0.4.1) + actionmailbox (6.0.5.1) + actionpack (= 6.0.5.1) + activejob (= 6.0.5.1) + activerecord (= 6.0.5.1) + activestorage (= 6.0.5.1) + activesupport (= 6.0.5.1) mail (>= 2.7.1) - actionmailer (6.0.4.1) - actionpack (= 6.0.4.1) - actionview (= 6.0.4.1) - activejob (= 6.0.4.1) + actionmailer (6.0.5.1) + actionpack (= 6.0.5.1) + actionview (= 6.0.5.1) + activejob (= 6.0.5.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.4.1) - actionview (= 6.0.4.1) - activesupport (= 6.0.4.1) + actionpack (6.0.5.1) + actionview (= 6.0.5.1) + activesupport (= 6.0.5.1) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) @@ -31,36 +31,36 @@ GEM actionpack-xml_parser (2.0.1) actionpack (>= 5.0) railties (>= 5.0) - actiontext (6.0.4.1) - actionpack (= 6.0.4.1) - activerecord (= 6.0.4.1) - activestorage (= 6.0.4.1) - activesupport (= 6.0.4.1) + actiontext (6.0.5.1) + actionpack (= 6.0.5.1) + activerecord (= 6.0.5.1) + activestorage (= 6.0.5.1) + activesupport (= 6.0.5.1) nokogiri (>= 1.8.5) - actionview (6.0.4.1) - activesupport (= 6.0.4.1) + actionview (6.0.5.1) + activesupport (= 6.0.5.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.4.1) - activesupport (= 6.0.4.1) + activejob (6.0.5.1) + activesupport (= 6.0.5.1) globalid (>= 0.3.6) - activemodel (6.0.4.1) - activesupport (= 6.0.4.1) + activemodel (6.0.5.1) + activesupport (= 6.0.5.1) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (6.0.4.1) - activemodel (= 6.0.4.1) - activesupport (= 6.0.4.1) - activestorage (6.0.4.1) - actionpack (= 6.0.4.1) - activejob (= 6.0.4.1) - activerecord (= 6.0.4.1) - marcel (~> 1.0.0) - activesupport (6.0.4.1) + activerecord (6.0.5.1) + activemodel (= 6.0.5.1) + activesupport (= 6.0.5.1) + activestorage (6.0.5.1) + actionpack (= 6.0.5.1) + activejob (= 6.0.5.1) + activerecord (= 6.0.5.1) + marcel (~> 1.0) + activesupport (6.0.5.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -69,16 +69,24 @@ GEM acts_as_list (1.0.4) activerecord (>= 4.2) ast (2.4.2) - autoprefixer-rails (10.1.0.0) - execjs + autoprefixer-rails (10.4.7.0) + execjs (~> 2) backport (1.2.0) - bcrypt (3.1.16) - benchmark (0.1.1) + bcrypt (3.1.18) + benchmark (0.2.0) + better_html (1.0.16) + actionview (>= 4.0) + activesupport (>= 4.0) + ast (~> 2.0) + erubi (~> 1.4) + html_tokenizer (~> 0.0.6) + parser (>= 2.4) + smart_properties bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) builder (3.2.4) - bullet (6.1.5) + bullet (7.0.3) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) byebug (11.1.3) @@ -92,31 +100,33 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) crass (1.0.6) - database_cleaner (1.8.5) - diff-lcs (1.4.4) - docile (1.3.4) + database_cleaner (1.99.0) + diff-lcs (1.5.0) + docile (1.4.0) e2mmap (0.1.0) - erubi (1.10.0) - execjs (2.7.0) - factory_bot (6.2.0) + erubi (1.11.0) + execjs (2.8.1) + factory_bot (6.2.1) activesupport (>= 5.0.0) factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) railties (>= 5.0.0) - ffi (1.15.3) - font-awesome-sass (5.15.1) - sassc (>= 1.11) - globalid (0.5.2) + ffi (1.15.5) + font-awesome-sass (6.1.2) + sassc (~> 2.0) + globalid (1.0.0) activesupport (>= 5.0) highline (2.0.3) + html_tokenizer (0.0.7) htmlentities (4.3.4) - i18n (1.8.11) + i18n (1.12.0) concurrent-ruby (~> 1.0) - i18n-tasks (0.9.35) + i18n-tasks (1.0.11) activesupport (>= 4.0.2) ast (>= 2.1.0) + better_html (~> 1.0) erubi highline (>= 2.0.0) i18n @@ -125,75 +135,73 @@ GEM rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) jaro_winkler (1.5.4) - jquery-rails (4.4.0) + jquery-rails (4.5.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) jquery-ui-rails (6.0.1) railties (>= 3.2.16) - kramdown (2.3.1) + json (2.6.2) + kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) + kt-paperclip (7.1.1) + activemodel (>= 4.2.0) + activesupport (>= 4.2.0) + marcel (~> 1.0.1) + mime-types + terrapin (~> 0.6.0) libv8 (3.16.14.19) - listen (3.7.0) + listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.12.0) + loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) marcel (1.0.2) method_source (1.0.0) - mime-types (3.3.1) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2020.1104) - mimemagic (0.3.10) - nokogiri (~> 1) - rake + mime-types-data (3.2022.0105) mini_mime (1.1.2) - mini_portile2 (2.6.1) - minitest (5.14.4) + mini_portile2 (2.8.0) + minitest (5.16.2) minitest-stub-const (0.6) - mocha (1.13.0) - mysql2 (0.5.3) + mocha (1.14.0) + mysql2 (0.5.4) nio4r (2.5.8) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + nokogiri (1.13.8) + mini_portile2 (~> 2.8.0) racc (~> 1.4) - paperclip (6.1.0) - activemodel (>= 4.2.0) - activesupport (>= 4.2.0) - mime-types - mimemagic (~> 0.3.0) - terrapin (~> 0.6.0) - parallel (1.21.0) - parser (3.0.2.0) + parallel (1.22.1) + parser (3.1.2.1) ast (~> 2.4.1) - pg (1.2.3) - puma (5.5.2) + pg (1.4.3) + puma (5.6.4) nio4r (~> 2.0) racc (1.6.0) - rack (2.2.3) - rack-mini-profiler (2.3.3) + rack (2.2.4) + rack-mini-profiler (3.0.0) rack (>= 1.2.0) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (6.0.4.1) - actioncable (= 6.0.4.1) - actionmailbox (= 6.0.4.1) - actionmailer (= 6.0.4.1) - actionpack (= 6.0.4.1) - actiontext (= 6.0.4.1) - actionview (= 6.0.4.1) - activejob (= 6.0.4.1) - activemodel (= 6.0.4.1) - activerecord (= 6.0.4.1) - activestorage (= 6.0.4.1) - activesupport (= 6.0.4.1) + rack-test (2.0.2) + rack (>= 1.3) + rails (6.0.5.1) + actioncable (= 6.0.5.1) + actionmailbox (= 6.0.5.1) + actionmailer (= 6.0.5.1) + actionpack (= 6.0.5.1) + actiontext (= 6.0.5.1) + actionview (= 6.0.5.1) + activejob (= 6.0.5.1) + activemodel (= 6.0.5.1) + activerecord (= 6.0.5.1) + activestorage (= 6.0.5.1) + activesupport (= 6.0.5.1) bundler (>= 1.3.0) - railties (= 6.0.4.1) + railties (= 6.0.5.1) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -202,44 +210,45 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) + rails-html-sanitizer (1.4.3) loofah (~> 2.3) - rails-i18n (6.0.0) + rails-i18n (7.0.5) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 7) + railties (>= 6.0.0, < 8) rails_autolink (1.1.6) rails (> 3.1) - railties (6.0.4.1) - actionpack (= 6.0.4.1) - activesupport (= 6.0.4.1) + railties (6.0.5.1) + actionpack (= 6.0.5.1) + activesupport (= 6.0.5.1) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) - rainbow (3.0.0) + rainbow (3.1.1) rake (13.0.6) - rb-fsevent (0.11.0) + rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) ref (2.0.0) - regexp_parser (2.1.1) - reverse_markdown (2.0.0) + regexp_parser (2.5.0) + reverse_markdown (2.1.1) nokogiri rexml (3.2.5) - rspec-expectations (3.10.1) + rspec-expectations (3.11.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.1) - rubocop (1.22.3) + rspec-support (~> 3.11.0) + rspec-support (3.11.0) + rubocop (1.35.0) + json (~> 2.3) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.12.0, < 2.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.20.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.12.0) - parser (>= 3.0.1.1) + rubocop-ast (1.21.0) + parser (>= 3.1.1.0) ruby-progressbar (1.11.0) safe_yaml (1.0.5) sanitize (6.0.0) @@ -258,8 +267,9 @@ GEM simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) - simplecov_json_formatter (0.1.2) - solargraph (0.44.0) + simplecov_json_formatter (0.1.4) + smart_properties (1.17.0) + solargraph (0.45.0) backport (~> 1.2) benchmark bundler (>= 1.17.2) @@ -274,15 +284,15 @@ GEM thor (~> 1.0) tilt (~> 2.0) yard (~> 0.9, >= 0.9.24) - spring (3.0.0) - sprockets (4.0.2) + spring (4.0.0) + sprockets (4.1.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.3.0) + sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.4.2) + sqlite3 (1.4.4) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) terrapin (0.6.0) @@ -290,77 +300,80 @@ GEM therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref - thor (1.1.0) + thor (1.2.1) thread_safe (0.3.6) - tilt (2.0.10) - tolk (4.1.0) + tilt (2.0.11) + tolk (4.3.0) rails (>= 5.0) safe_yaml (>= 0.8.6) sassc + sprockets-rails (~> 3.4) tracks-chartjs-ror (3.6.4) rails (>= 3.1) - tzinfo (1.2.9) + tzinfo (1.2.10) thread_safe (~> 0.1) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unicode-display_width (2.1.0) - uniform_notifier (1.14.2) + unicode-display_width (2.2.0) + uniform_notifier (1.16.0) + webrick (1.7.0) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) will_paginate (3.3.1) - yard (0.9.26) - zeitwerk (2.5.1) + yard (0.9.28) + webrick (~> 1.7.0) + zeitwerk (2.6.0) PLATFORMS ruby DEPENDENCIES RedCloth - aasm (~> 5.2.0) + aasm (~> 5.3.0) actionpack-xml_parser (~> 2.0) activemodel-serializers-xml (~> 1.0.1) acts_as_list - bcrypt (~> 3.1.16) + bcrypt (~> 3.1.18) bootstrap-sass (= 3.4.1) bullet byebug codeclimate-test-reporter (= 1.0.7) coffee-rails (~> 5.0.0) - database_cleaner + database_cleaner (~> 1) factory_bot_rails - font-awesome-sass (~> 5.15.1) + font-awesome-sass (~> 6.1.2) htmlentities - i18n-tasks (~> 0.9.35) - jquery-rails (~> 4.4) + i18n-tasks (~> 1.0.11) + jquery-rails (~> 4.5) jquery-ui-rails (~> 6.0.1) + kt-paperclip (~> 7.1) listen mini_racer minitest-stub-const mocha - mysql2 (~> 0.5.3) - paperclip - pg (~> 1.2.3) - puma (~> 5.5) + mysql2 (~> 0.5.4) + pg (~> 1.4.3) + puma (~> 5.6) rack-mini-profiler - rails (~> 6.0.3) + rails (~> 6.0.0) rails-controller-testing rails-dom-testing (~> 2.0.0) rails_autolink rspec-expectations - rubocop (~> 1.22) + rubocop (~> 1.34) sanitize (~> 6.0) sassc-rails (~> 2.1.2) simplecov solargraph - spring + spring (~> 4) sqlite3 therubyracer - tolk (~> 4.1.0) + tolk (~> 4.3.0) tracks-chartjs-ror uglifier (>= 1.3.0) will_paginate yard BUNDLED WITH - 2.2.22 + 2.2.33 diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index cbc0e71e..b5527f37 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -7,5 +7,8 @@ //= link datepicker-fi.js //= link datepicker-fr.js //= link datepicker-he.js +//= link datepicker-nb_NO.js //= link datepicker-nl.js //= link datepicker-ru.js +//= link datepicker-sv.js +//= link datepicker-tr.js diff --git a/app/assets/javascripts-jquery-ui/datepicker-cs.js b/app/assets/javascripts-jquery-ui/datepicker-cs.js index c2f79cf9..6e5552c6 100644 --- a/app/assets/javascripts-jquery-ui/datepicker-cs.js +++ b/app/assets/javascripts-jquery-ui/datepicker-cs.js @@ -1,6 +1,8 @@ /* Czech initialisation for the jQuery UI date picker plugin. */ /* Written by Tomas Muller (tomas@tomas-muller.net). */ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -10,20 +12,21 @@ // Browser globals factory( jQuery.datepicker ); } -}( function( datepicker ) { +} )( function( datepicker ) { +"use strict"; datepicker.regional.cs = { closeText: "Zavřít", - prevText: "<Dříve", - nextText: "Později>", + prevText: "Dříve", + nextText: "Později", currentText: "Nyní", - monthNames: [ "leden","únor","březen","duben","květen","červen", - "červenec","srpen","září","říjen","listopad","prosinec" ], - monthNamesShort: [ "led","úno","bře","dub","kvě","čer", - "čvc","srp","zář","říj","lis","pro" ], + monthNames: [ "leden", "únor", "březen", "duben", "květen", "červen", + "červenec", "srpen", "září", "říjen", "listopad", "prosinec" ], + monthNamesShort: [ "led", "úno", "bře", "dub", "kvě", "čer", + "čvc", "srp", "zář", "říj", "lis", "pro" ], dayNames: [ "neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota" ], dayNamesShort: [ "ne", "po", "út", "st", "čt", "pá", "so" ], - dayNamesMin: [ "ne","po","út","st","čt","pá","so" ], + dayNamesMin: [ "ne", "po", "út", "st", "čt", "pá", "so" ], weekHeader: "Týd", dateFormat: "dd.mm.yy", firstDay: 1, @@ -34,4 +37,4 @@ datepicker.setDefaults( datepicker.regional.cs ); return datepicker.regional.cs; -} ) ); +} ); diff --git a/app/assets/javascripts-jquery-ui/datepicker-de.js b/app/assets/javascripts-jquery-ui/datepicker-de.js index a6779084..8a08ebf3 100644 --- a/app/assets/javascripts-jquery-ui/datepicker-de.js +++ b/app/assets/javascripts-jquery-ui/datepicker-de.js @@ -1,6 +1,8 @@ /* German initialisation for the jQuery UI date picker plugin. */ /* Written by Milian Wolff (mail@milianw.de). */ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -10,20 +12,21 @@ // Browser globals factory( jQuery.datepicker ); } -}( function( datepicker ) { +} )( function( datepicker ) { +"use strict"; datepicker.regional.de = { closeText: "Schließen", - prevText: "<Zurück", - nextText: "Vor>", + prevText: "Zurück", + nextText: "Vor", currentText: "Heute", - monthNames: [ "Januar","Februar","März","April","Mai","Juni", - "Juli","August","September","Oktober","November","Dezember" ], - monthNamesShort: [ "Jan","Feb","Mär","Apr","Mai","Jun", - "Jul","Aug","Sep","Okt","Nov","Dez" ], - dayNames: [ "Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag" ], - dayNamesShort: [ "So","Mo","Di","Mi","Do","Fr","Sa" ], - dayNamesMin: [ "So","Mo","Di","Mi","Do","Fr","Sa" ], + monthNames: [ "Januar", "Februar", "März", "April", "Mai", "Juni", + "Juli", "August", "September", "Oktober", "November", "Dezember" ], + monthNamesShort: [ "Jan", "Feb", "Mär", "Apr", "Mai", "Jun", + "Jul", "Aug", "Sep", "Okt", "Nov", "Dez" ], + dayNames: [ "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" ], + dayNamesShort: [ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" ], + dayNamesMin: [ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" ], weekHeader: "KW", dateFormat: "dd.mm.yy", firstDay: 1, @@ -34,4 +37,4 @@ datepicker.setDefaults( datepicker.regional.de ); return datepicker.regional.de; -} ) ); +} ); diff --git a/app/assets/javascripts-jquery-ui/datepicker-es.js b/app/assets/javascripts-jquery-ui/datepicker-es.js index ea7116e0..dbb1f0aa 100644 --- a/app/assets/javascripts-jquery-ui/datepicker-es.js +++ b/app/assets/javascripts-jquery-ui/datepicker-es.js @@ -1,6 +1,8 @@ /* Inicialización en español para la extensión 'UI date picker' para jQuery. */ /* Traducido por Vester (xvester@gmail.com). */ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -10,20 +12,21 @@ // Browser globals factory( jQuery.datepicker ); } -}( function( datepicker ) { +} )( function( datepicker ) { +"use strict"; datepicker.regional.es = { closeText: "Cerrar", - prevText: "<Ant", - nextText: "Sig>", + prevText: "Ant", + nextText: "Sig", currentText: "Hoy", - monthNames: [ "enero","febrero","marzo","abril","mayo","junio", - "julio","agosto","septiembre","octubre","noviembre","diciembre" ], - monthNamesShort: [ "ene","feb","mar","abr","may","jun", - "jul","ago","sep","oct","nov","dic" ], - dayNames: [ "domingo","lunes","martes","miércoles","jueves","viernes","sábado" ], - dayNamesShort: [ "dom","lun","mar","mié","jue","vie","sáb" ], - dayNamesMin: [ "D","L","M","X","J","V","S" ], + monthNames: [ "enero", "febrero", "marzo", "abril", "mayo", "junio", + "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre" ], + monthNamesShort: [ "ene", "feb", "mar", "abr", "may", "jun", + "jul", "ago", "sep", "oct", "nov", "dic" ], + dayNames: [ "domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado" ], + dayNamesShort: [ "dom", "lun", "mar", "mié", "jue", "vie", "sáb" ], + dayNamesMin: [ "D", "L", "M", "X", "J", "V", "S" ], weekHeader: "Sm", dateFormat: "dd/mm/yy", firstDay: 1, @@ -34,4 +37,4 @@ datepicker.setDefaults( datepicker.regional.es ); return datepicker.regional.es; -} ) ); +} ); diff --git a/app/assets/javascripts-jquery-ui/datepicker-fi.js b/app/assets/javascripts-jquery-ui/datepicker-fi.js index a8386ff6..d355e9eb 100644 --- a/app/assets/javascripts-jquery-ui/datepicker-fi.js +++ b/app/assets/javascripts-jquery-ui/datepicker-fi.js @@ -1,6 +1,8 @@ /* Finnish initialisation for the jQuery UI date picker plugin. */ /* Written by Harri Kilpiö (harrikilpio@gmail.com). */ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -10,20 +12,21 @@ // Browser globals factory( jQuery.datepicker ); } -}( function( datepicker ) { +} )( function( datepicker ) { +"use strict"; datepicker.regional.fi = { closeText: "Sulje", - prevText: "«Edellinen", - nextText: "Seuraava»", + prevText: "Edellinen", + nextText: "Seuraava", currentText: "Tänään", - monthNames: [ "Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu", - "Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu" ], - monthNamesShort: [ "Tammi","Helmi","Maalis","Huhti","Touko","Kesä", - "Heinä","Elo","Syys","Loka","Marras","Joulu" ], - dayNamesShort: [ "Su","Ma","Ti","Ke","To","Pe","La" ], - dayNames: [ "Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai" ], - dayNamesMin: [ "Su","Ma","Ti","Ke","To","Pe","La" ], + monthNames: [ "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", + "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu" ], + monthNamesShort: [ "Tammi", "Helmi", "Maalis", "Huhti", "Touko", "Kesä", + "Heinä", "Elo", "Syys", "Loka", "Marras", "Joulu" ], + dayNamesShort: [ "Su", "Ma", "Ti", "Ke", "To", "Pe", "La" ], + dayNames: [ "Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai" ], + dayNamesMin: [ "Su", "Ma", "Ti", "Ke", "To", "Pe", "La" ], weekHeader: "Vk", dateFormat: "d.m.yy", firstDay: 1, @@ -34,4 +37,4 @@ datepicker.setDefaults( datepicker.regional.fi ); return datepicker.regional.fi; -} ) ); +} ); diff --git a/app/assets/javascripts-jquery-ui/datepicker-fr.js b/app/assets/javascripts-jquery-ui/datepicker-fr.js index 9e39fbd6..42b582bc 100644 --- a/app/assets/javascripts-jquery-ui/datepicker-fr.js +++ b/app/assets/javascripts-jquery-ui/datepicker-fr.js @@ -3,6 +3,8 @@ Stéphane Nahmani (sholby@sholby.net), Stéphane Raimbault */ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -12,7 +14,8 @@ // Browser globals factory( jQuery.datepicker ); } -}( function( datepicker ) { +} )( function( datepicker ) { +"use strict"; datepicker.regional.fr = { closeText: "Fermer", @@ -25,7 +28,7 @@ datepicker.regional.fr = { "juil.", "août", "sept.", "oct.", "nov.", "déc." ], dayNames: [ "dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi" ], dayNamesShort: [ "dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam." ], - dayNamesMin: [ "D","L","M","M","J","V","S" ], + dayNamesMin: [ "D", "L", "M", "M", "J", "V", "S" ], weekHeader: "Sem.", dateFormat: "dd/mm/yy", firstDay: 1, @@ -36,4 +39,4 @@ datepicker.setDefaults( datepicker.regional.fr ); return datepicker.regional.fr; -} ) ); +} ); diff --git a/app/assets/javascripts-jquery-ui/datepicker-he.js b/app/assets/javascripts-jquery-ui/datepicker-he.js index fb6238fd..fbe3c40c 100644 --- a/app/assets/javascripts-jquery-ui/datepicker-he.js +++ b/app/assets/javascripts-jquery-ui/datepicker-he.js @@ -1,6 +1,8 @@ /* Hebrew initialisation for the UI Datepicker extension. */ /* Written by Amir Hardon (ahardon at gmail dot com). */ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -10,20 +12,21 @@ // Browser globals factory( jQuery.datepicker ); } -}( function( datepicker ) { +} )( function( datepicker ) { +"use strict"; datepicker.regional.he = { closeText: "סגור", - prevText: "<הקודם", - nextText: "הבא>", + prevText: "הקודם", + nextText: "הבא", currentText: "היום", - monthNames: [ "ינואר","פברואר","מרץ","אפריל","מאי","יוני", - "יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר" ], - monthNamesShort: [ "ינו","פבר","מרץ","אפר","מאי","יוני", - "יולי","אוג","ספט","אוק","נוב","דצמ" ], - dayNames: [ "ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת" ], - dayNamesShort: [ "א'","ב'","ג'","ד'","ה'","ו'","שבת" ], - dayNamesMin: [ "א'","ב'","ג'","ד'","ה'","ו'","שבת" ], + monthNames: [ "ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", + "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר" ], + monthNamesShort: [ "ינו", "פבר", "מרץ", "אפר", "מאי", "יוני", + "יולי", "אוג", "ספט", "אוק", "נוב", "דצמ" ], + dayNames: [ "ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת" ], + dayNamesShort: [ "א'", "ב'", "ג'", "ד'", "ה'", "ו'", "שבת" ], + dayNamesMin: [ "א'", "ב'", "ג'", "ד'", "ה'", "ו'", "שבת" ], weekHeader: "Wk", dateFormat: "dd/mm/yy", firstDay: 0, @@ -34,4 +37,4 @@ datepicker.setDefaults( datepicker.regional.he ); return datepicker.regional.he; -} ) ); +} ); diff --git a/app/assets/javascripts-jquery-ui/datepicker-nb_NO.js b/app/assets/javascripts-jquery-ui/datepicker-nb_NO.js new file mode 100644 index 00000000..19bb0bc2 --- /dev/null +++ b/app/assets/javascripts-jquery-ui/datepicker-nb_NO.js @@ -0,0 +1,52 @@ +/* Norwegian Bokmål initialisation for the jQuery UI date picker plugin. */ +/* Written by Bjørn Johansen (post@bjornjohansen.no). */ +( function( factory ) { + "use strict"; + + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define( [ "../widgets/datepicker" ], factory ); + } else { + + // Browser globals + factory( jQuery.datepicker ); + } +} )( function( datepicker ) { +"use strict"; + +datepicker.regional.nb = { + closeText: "Lukk", + prevText: "Forrige", + nextText: "Neste", + currentText: "I dag", + monthNames: [ + "januar", + "februar", + "mars", + "april", + "mai", + "juni", + "juli", + "august", + "september", + "oktober", + "november", + "desember" + ], + monthNamesShort: [ "jan", "feb", "mar", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "des" ], + dayNamesShort: [ "søn", "man", "tir", "ons", "tor", "fre", "lør" ], + dayNames: [ "søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag" ], + dayNamesMin: [ "sø", "ma", "ti", "on", "to", "fr", "lø" ], + weekHeader: "Uke", + dateFormat: "dd.mm.yy", + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: "" +}; +datepicker.setDefaults( datepicker.regional.nb ); + +return datepicker.regional.nb; + +} ); diff --git a/app/assets/javascripts-jquery-ui/datepicker-nl.js b/app/assets/javascripts-jquery-ui/datepicker-nl.js index 7fcbff1a..535d7fbd 100644 --- a/app/assets/javascripts-jquery-ui/datepicker-nl.js +++ b/app/assets/javascripts-jquery-ui/datepicker-nl.js @@ -1,6 +1,8 @@ /* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ /* Written by Mathias Bynens */ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -10,12 +12,13 @@ // Browser globals factory( jQuery.datepicker ); } -}( function( datepicker ) { +} )( function( datepicker ) { +"use strict"; datepicker.regional.nl = { closeText: "Sluiten", - prevText: "←", - nextText: "→", + prevText: "Vorig", + nextText: "Volgende", currentText: "Vandaag", monthNames: [ "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december" ], @@ -34,4 +37,4 @@ datepicker.setDefaults( datepicker.regional.nl ); return datepicker.regional.nl; -} ) ); +} ); diff --git a/app/assets/javascripts-jquery-ui/datepicker-ru.js b/app/assets/javascripts-jquery-ui/datepicker-ru.js index 223e7764..5a8b3b7c 100644 --- a/app/assets/javascripts-jquery-ui/datepicker-ru.js +++ b/app/assets/javascripts-jquery-ui/datepicker-ru.js @@ -1,6 +1,8 @@ /* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ /* Written by Andrew Stromnov (stromnov@gmail.com). */ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -10,20 +12,21 @@ // Browser globals factory( jQuery.datepicker ); } -}( function( datepicker ) { +} )( function( datepicker ) { +"use strict"; datepicker.regional.ru = { closeText: "Закрыть", - prevText: "<Пред", - nextText: "След>", + prevText: "Пред", + nextText: "След", currentText: "Сегодня", - monthNames: [ "Январь","Февраль","Март","Апрель","Май","Июнь", - "Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь" ], - monthNamesShort: [ "Янв","Фев","Мар","Апр","Май","Июн", - "Июл","Авг","Сен","Окт","Ноя","Дек" ], - dayNames: [ "воскресенье","понедельник","вторник","среда","четверг","пятница","суббота" ], - dayNamesShort: [ "вск","пнд","втр","срд","чтв","птн","сбт" ], - dayNamesMin: [ "Вс","Пн","Вт","Ср","Чт","Пт","Сб" ], + monthNames: [ "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", + "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" ], + monthNamesShort: [ "Янв", "Фев", "Мар", "Апр", "Май", "Июн", + "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек" ], + dayNames: [ "воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота" ], + dayNamesShort: [ "вск", "пнд", "втр", "срд", "чтв", "птн", "сбт" ], + dayNamesMin: [ "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" ], weekHeader: "Нед", dateFormat: "dd.mm.yy", firstDay: 1, @@ -34,4 +37,4 @@ datepicker.setDefaults( datepicker.regional.ru ); return datepicker.regional.ru; -} ) ); +} ); diff --git a/app/assets/javascripts-jquery-ui/datepicker-sv.js b/app/assets/javascripts-jquery-ui/datepicker-sv.js new file mode 100644 index 00000000..ee9296ea --- /dev/null +++ b/app/assets/javascripts-jquery-ui/datepicker-sv.js @@ -0,0 +1,40 @@ +/* Swedish initialisation for the jQuery UI date picker plugin. */ +/* Written by Anders Ekdahl ( anders@nomadiz.se). */ +( function( factory ) { + "use strict"; + + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define( [ "../widgets/datepicker" ], factory ); + } else { + + // Browser globals + factory( jQuery.datepicker ); + } +} )( function( datepicker ) { +"use strict"; + +datepicker.regional.sv = { + closeText: "Stäng", + prevText: "Förra", + nextText: "Nästa", + currentText: "Idag", + monthNames: [ "januari", "februari", "mars", "april", "maj", "juni", + "juli", "augusti", "september", "oktober", "november", "december" ], + monthNamesShort: [ "jan.", "feb.", "mars", "apr.", "maj", "juni", + "juli", "aug.", "sep.", "okt.", "nov.", "dec." ], + dayNamesShort: [ "sön", "mån", "tis", "ons", "tor", "fre", "lör" ], + dayNames: [ "söndag", "måndag", "tisdag", "onsdag", "torsdag", "fredag", "lördag" ], + dayNamesMin: [ "sö", "må", "ti", "on", "to", "fr", "lö" ], + weekHeader: "Ve", + dateFormat: "yy-mm-dd", + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: "" }; +datepicker.setDefaults( datepicker.regional.sv ); + +return datepicker.regional.sv; + +} ); diff --git a/app/assets/javascripts-jquery-ui/datepicker-tr.js b/app/assets/javascripts-jquery-ui/datepicker-tr.js new file mode 100644 index 00000000..32eb3edd --- /dev/null +++ b/app/assets/javascripts-jquery-ui/datepicker-tr.js @@ -0,0 +1,40 @@ +/* Turkish initialisation for the jQuery UI date picker plugin. */ +/* Written by Izzet Emre Erkan (kara@karalamalar.net). */ +( function( factory ) { + "use strict"; + + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define( [ "../widgets/datepicker" ], factory ); + } else { + + // Browser globals + factory( jQuery.datepicker ); + } +} )( function( datepicker ) { +"use strict"; + +datepicker.regional.tr = { + closeText: "kapat", + prevText: "geri", + nextText: "ileri", + currentText: "bugün", + monthNames: [ "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", + "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık" ], + monthNamesShort: [ "Oca", "Şub", "Mar", "Nis", "May", "Haz", + "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara" ], + dayNames: [ "Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi" ], + dayNamesShort: [ "Pz", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct" ], + dayNamesMin: [ "Pz", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct" ], + weekHeader: "Hf", + dateFormat: "dd.mm.yy", + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: "" }; +datepicker.setDefaults( datepicker.regional.tr ); + +return datepicker.regional.tr; + +} ); diff --git a/app/assets/stylesheets/include/icons.scss b/app/assets/stylesheets/include/icons.scss index 001bc336..3141837b 100644 --- a/app/assets/stylesheets/include/icons.scss +++ b/app/assets/stylesheets/include/icons.scss @@ -1,2 +1 @@ -@import "font-awesome-sprockets"; @import "font-awesome"; diff --git a/app/controllers/data_controller.rb b/app/controllers/data_controller.rb index e9893f16..610ae047 100644 --- a/app/controllers/data_controller.rb +++ b/app/controllers/data_controller.rb @@ -62,12 +62,16 @@ class DataController < ApplicationController flash[:notice] = t 'data.import.projects_count', count: count when 'todos' count = Todo.import path_and_file, params, current_user - flash[:notice] = t 'data.import.todos.count', count: count + if !count + flash[:error] = t('data.import.errors.no_context') + else + flash[:notice] = t 'data.import.todos_count', count: count + end else flash[:error] = t('data.import.errors.invalid_destination') end rescue Exception => e - flash[:error] = t 'data.import.invalid_destination', e: e + flash[:error] = t 'data.import.errors.invalid_destination', e: e end File.delete(path_and_file) redirect_to import_data_path diff --git a/app/helpers/rendering_helper.rb b/app/helpers/rendering_helper.rb index ad406aa6..956e93d9 100644 --- a/app/helpers/rendering_helper.rb +++ b/app/helpers/rendering_helper.rb @@ -13,7 +13,7 @@ module RenderingHelper # do not change string; URL is already linked href else - content_tag(:a, h(href), :href => URI.escape(href)) + content_tag(:a, h(href), :href => href) end end end @@ -27,7 +27,7 @@ module RenderingHelper config = relaxed_config # add onenote and message protocols, allow a target - a_href_config = relaxed_config[:protocols]['a']['href'] + %w(onenote message) + a_href_config = relaxed_config[:protocols]['a']['href'] + %w[onenote message obsidian] a_attributes = relaxed_config[:attributes]['a'] + ['target'] config = Sanitize::Config.merge(config, protocols: { 'a' => { 'href' => a_href_config } }, :attributes => { 'a' => a_attributes }) diff --git a/app/models/message_gateway.rb b/app/models/message_gateway.rb index 711e6a92..2a125cd7 100644 --- a/app/models/message_gateway.rb +++ b/app/models/message_gateway.rb @@ -26,7 +26,7 @@ class MessageGateway < ActionMailer::Base attachment = todo.attachments.build # create temp file - tmp = Tempfile.new(['attachment', '.eml'], { universal_newline: true }) + tmp = Tempfile.new(['attachment', '.eml'], universal_newline: true) tmp.write email.raw_source.gsub(/\r/, "") # add temp file to attachment. paperclip will copy the file to the right location diff --git a/app/models/todo.rb b/app/models/todo.rb index c97f3ade..acfe032f 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -353,6 +353,7 @@ class Todo < ApplicationRecord def self.import(filename, params, user) default_context = user.contexts.order('id').first + return false if default_context.nil? count = 0 CSV.foreach(filename, headers: true) do |row| diff --git a/app/views/integrations/index.html.erb b/app/views/integrations/index.html.erb index 98e4ff9d..5de4fbf9 100644 --- a/app/views/integrations/index.html.erb +++ b/app/views/integrations/index.html.erb @@ -73,7 +73,7 @@ mailmap: <<%= I18n.t 'integrations.email_rich.field_descriptions.due_date' %> - ><%= I18n.t 'integrations.email_rich.field_descriptions.due_date' %> + ><%= I18n.t 'integrations.email_rich.field_descriptions.tickler_date' %> #<%= I18n.t 'integrations.email_rich.field_descriptions.tag' %> diff --git a/app/views/integrations/rest_api.html.erb b/app/views/integrations/rest_api.html.erb index abf9a758..3d867146 100644 --- a/app/views/integrations/rest_api.html.erb +++ b/app/views/integrations/rest_api.html.erb @@ -64,10 +64,10 @@
  • /projects/<%= t('rest_help.id') %>/todos.xml
  • -

    <%= raw t('rest_help.retrieve.limit', { +

    <%= raw t('rest_help.retrieve.limit', fields: 'ID, created_at, modified_at, completed_at', limit_parameter: 'limit_fields', - set_to: 'index'}) %>

    + set_to: 'index') %>

     
    @@ -87,10 +87,10 @@
     
     

    <%= t('rest_help.writing.title') %>

    -

    <%= raw t('rest_help.writing.description', { +

    <%= raw t('rest_help.writing.description', put: 'PUT', post: 'POST', - delete: 'DELETE'}) %>

    + delete: 'DELETE') %>

    <%= t('rest_help.writing.example_title') %>

    @@ -105,9 +105,9 @@ Location: <%= root_url %>projects/65.xml
    -

    <%= raw t('rest_help.writing.example_project_response_title', { +

    <%= raw t('rest_help.writing.example_project_response_title', response_code: 'HTTP/1.1 201 Created', - header: 'Location'}) %>

    + header: 'Location') %>

     
    @@ -120,9 +120,9 @@ Location: <%= root_url %>todos/452.xml
     
     
    -

    <%= raw t('rest_help.writing.example_todo_response_title', { +

    <%= raw t('rest_help.writing.example_todo_response_title', response_code: 'HTTP/1.1 201 Created', - header: 'Location'}) %>

    + header: 'Location') %>

     
    @@ -143,8 +143,8 @@ Location: <%= root_url %>todos/452.xml
     
     
    -

    <%= raw t('rest_help.writing.example_note_response_title', { - response_code: 'HTTP/1.1 200 OK'}) %>

    +

    <%= raw t('rest_help.writing.example_note_response_title', + response_code: 'HTTP/1.1 200 OK') %>

     
    @@ -164,8 +164,8 @@ Location: <%= root_url %>todos/452.xml
     
     
    -

    <%= raw t('rest_help.writing.example_delete_title', { - delete: 'DELETE'}) %>

    +

    <%= raw t('rest_help.writing.example_delete_title', + delete: 'DELETE') %>

     
    @@ -176,15 +176,15 @@ Location: <%= root_url %>todos/452.xml
     
     
    -

    <%= raw t('rest_help.writing.example_delete_response_title', { - response_code: 'HTTP/1.1 200 OK'}) %>

    +

    <%= raw t('rest_help.writing.example_delete_response_title', + response_code: 'HTTP/1.1 200 OK') %>

    <%= t('rest_help.response.title') %>

    -

    <%= raw t('rest_help.response.description', { +

    <%= raw t('rest_help.response.description', response_200: '200 OK', response_201: '201 Created', - example_call: 'GET /contexts/2/todos.xml'}) %>

    + example_call: 'GET /contexts/2/todos.xml') %>

    <%= t('rest_help.response.xml_description') %>

    @@ -200,11 +200,11 @@ $ curl -u username:p4ssw0rd -H "Content-Type: text/xml" \

    <%= t('rest_help.activeresource.title') %>

    -

    <%= raw I18n.t 'rest_help.activeresource.description', { +

    <%= raw I18n.t 'rest_help.activeresource.description', activeresource_link: link_to(I18n.t('rest_help.activeresource.activeresource_link_text'), 'http://weblog.rubyonrails.org/2007/9/30/rails-2-0-0-preview-release'), ror_link: link_to(I18n.t('rest_help.activeresource.ror_link_text'), 'http://www.rubyonrails.org'), gem_command: 'gem install activeresource --source http://gems.rubyonrails.org --include-dependencies' -} %>

    +%>

     
    @@ -226,8 +226,8 @@ Loading development environment (Rails 1.2.4)
     
     
    -

    <%= raw I18n.t 'rest_help.activeresource.wrapper_description', { - signals_link: link_to(I18n.t('rest_help.activeresource.signals_link_text'), 'http://www.37signals.com')} %>

    +

    <%= raw I18n.t 'rest_help.activeresource.wrapper_description', + signals_link: link_to(I18n.t('rest_help.activeresource.signals_link_text'), 'http://www.37signals.com') %>

     
    @@ -246,13 +246,13 @@ irb(main):003:0>
     

    <%= t('rest_help.notes.description') %>

      -
    • <%= raw I18n.t 'rest_help.notes.bullet1', { +
    • <%= raw I18n.t 'rest_help.notes.bullet1', id: 'ID', - url: 'URL'} %>
    • -
    • <%= raw I18n.t 'rest_help.notes.bullet2', { - omit: '...' } %>
    • + url: 'URL' %> +
    • <%= raw I18n.t 'rest_help.notes.bullet2', + omit: '...' %>
    -

    <%= raw I18n.t 'rest_help.notes.curl_description', { - curl: link_to(I18n.t('rest_help.curl_link_text'), 'http://en.wikipedia.org/wiki/CURL')} %>

    +

    <%= raw I18n.t 'rest_help.notes.curl_description', + curl: link_to(I18n.t('rest_help.curl_link_text'), 'http://en.wikipedia.org/wiki/CURL') %>

    diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb index aac3178e..f2fb0970 100644 --- a/app/views/shared/_footer.html.erb +++ b/app/views/shared/_footer.html.erb @@ -1,6 +1,7 @@