Voice data server for navigation voice changer app.
リビジョン | 5705bd43fa99d835e4e4452b4925ec69d1dc48f6 (tree) |
---|---|
日時 | 2016-09-29 22:58:18 |
作者 | HMML <hmml3939@gmai...> |
コミッター | HMML |
Tune upload error handling, update paperclip.
@@ -59,7 +59,7 @@ gem 'client_side_validations' | ||
59 | 59 | gem 'client_side_validations-simple_form' |
60 | 60 | gem 'responders' |
61 | 61 | gem 'rspec-rails', group: [:development, :test] |
62 | -gem 'paperclip', '3.5.0' | |
62 | +gem 'paperclip' | |
63 | 63 | gem 'rubyzip', '< 1.0.0', require: 'zip/zip' |
64 | 64 | gem 'rails_admin' |
65 | 65 | group :develpment do |
@@ -121,6 +121,7 @@ GEM | ||
121 | 121 | mime-types (3.1) |
122 | 122 | mime-types-data (~> 3.2015) |
123 | 123 | mime-types-data (3.2016.0521) |
124 | + mimemagic (0.3.2) | |
124 | 125 | minitest (5.9.1) |
125 | 126 | multi_json (1.12.1) |
126 | 127 | mysql2 (0.4.4) |
@@ -130,11 +131,12 @@ GEM | ||
130 | 131 | net-ssh (3.2.0) |
131 | 132 | nokogiri (1.6.8) |
132 | 133 | pkg-config (~> 1.1.7) |
133 | - paperclip (3.5.0) | |
134 | - activemodel (>= 3.0.0) | |
135 | - activesupport (>= 3.0.0) | |
136 | - cocaine (~> 0.5.0) | |
134 | + paperclip (5.1.0) | |
135 | + activemodel (>= 4.2.0) | |
136 | + activesupport (>= 4.2.0) | |
137 | + cocaine (~> 0.5.5) | |
137 | 138 | mime-types |
139 | + mimemagic (~> 0.3.0) | |
138 | 140 | pkg-config (1.1.7) |
139 | 141 | quiet_assets (1.1.0) |
140 | 142 | railties (>= 3.1, < 5.0) |
@@ -271,7 +273,7 @@ DEPENDENCIES | ||
271 | 273 | jquery-rails |
272 | 274 | kaminari |
273 | 275 | mysql2 |
274 | - paperclip (= 3.5.0) | |
276 | + paperclip | |
275 | 277 | quiet_assets |
276 | 278 | rails (= 4.2.7.1) |
277 | 279 | rails-i18n |
@@ -56,6 +56,7 @@ class NaviVoicesController < ApplicationController | ||
56 | 56 | logger.info "Delete NaviVoice ##{@navi_voice.id}, from #{request.remote_ip})" |
57 | 57 | @navi_voice.destroy |
58 | 58 | else |
59 | + flash[:error] = t 'delete_key_is_not_matched' | |
59 | 60 | @navi_voice.errors[:delete_key] << 'is not matched.' |
60 | 61 | logger.info "Delete denied: Key validation failed for ##{@navi_voice.id}, from #{request.remote_ip}" |
61 | 62 | end |
@@ -12,7 +12,9 @@ class NaviVoice < ActiveRecord::Base | ||
12 | 12 | attr_accessor :raw_delete_key |
13 | 13 | attr_accessor :tos_agree |
14 | 14 | |
15 | - validates_attachment :archive, presence: true, size: {less_than: 5120.kilobytes} | |
15 | + validates_attachment :archive, presence: true, | |
16 | + size: {less_than: 5120.kilobytes}, | |
17 | + content_type: { content_type: %w(application/zip) } | |
16 | 18 | validates :archive, voice_archive: { on: :create } |
17 | 19 | validates :title, presence: true, length: {maximum: 80} |
18 | 20 | validates :description, length: {maximum: 280} |
@@ -1,5 +1,5 @@ | ||
1 | 1 | - flash.each do |name, msg| |
2 | 2 | - if msg.is_a?(String) |
3 | - %div{:class => "alert alert-#{name == :notice ? "success" : "danger"}"} | |
3 | + %div{:class => "alert alert-#{name.to_s == 'notice' ? "success" : "danger"}"} | |
4 | 4 | %a.close{"data-dismiss" => "alert"} × |
5 | 5 | = content_tag :div, msg, :id => "flash_#{name}" |
@@ -17,5 +17,5 @@ | ||
17 | 17 | = link_to t('navi.news'), news_index_path |
18 | 18 | - if @headline |
19 | 19 | %p.navbar-text.pull-right.headline |
20 | - %span.glyphicon.glyphicon-exclamation-sign | |
20 | + %span.icon-exclamation-sign | |
21 | 21 | = link_to "#{@headline.created_at.strftime('%m/%d')} #{@headline.title}", @headline, class: 'navbar-link' |
@@ -17,3 +17,8 @@ | ||
17 | 17 | = f.input :tos_agree, as: :boolean |
18 | 18 | = next_arrow |
19 | 19 | = f.button :submit, class: 'btn btn-primary btn-lg btn-block', id: 'btn-nv-submit' |
20 | + | |
21 | +:coffee | |
22 | + $('#new_navi_voice').on 'submit', -> | |
23 | + $('#btn-nv-submit').val('#{t "uploading_wait"}').attr('disabled', 'disabled') | |
24 | + return true |
@@ -57,3 +57,5 @@ en: | ||
57 | 57 | err_normalize: Failed on rate/channel normalization |
58 | 58 | |
59 | 59 | site_title: NaviVoiceChanger |
60 | + delete_key_is_not_matched: Delete key is not matched. | |
61 | + uploading_wait: Uploading, please wait... | |
\ No newline at end of file |
@@ -77,3 +77,5 @@ ja: | ||
77 | 77 | err_normalize: サンプルレート/チャネル数の変更に失敗しました |
78 | 78 | |
79 | 79 | site_title: ナビボイスチェンジャー |
80 | + delete_key_is_not_matched: 削除キーが違います | |
81 | + uploading_wait: アップロード中です... | |
\ No newline at end of file |