Commit 9f3194370c0b5011b579af3f26e0620ff74a7cb8
0 parents
Exists in
master
and in
1 other branch
Add portal container files
Showing
1167 changed files
with
448946 additions
and
0 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 1167 files displayed.
| 1 | +++ a/Capfile | |
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +# Load DSL and Setup Up Stages | |
| 2 | +require 'capistrano/setup' | |
| 3 | +require 'capistrano/deploy' | |
| 4 | + | |
| 5 | +require 'capistrano/rails' | |
| 6 | +require 'capistrano/bundler' | |
| 7 | +require 'capistrano/rvm' | |
| 8 | +require 'capistrano/puma' | |
| 9 | + | |
| 10 | +# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. | |
| 11 | +Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } | ... | ... |
| 1 | +++ a/Dockerfile | |
| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | +FROM phusion/baseimage:0.9.8 | |
| 2 | +MAINTAINER Jonathan Brilhante | |
| 3 | + | |
| 4 | +ENV LANG en_US.UTF-8 | |
| 5 | +ENV LC_ALL en_US.UTF-8 | |
| 6 | + | |
| 7 | +# Install tools & libs to compile everything | |
| 8 | +RUN apt-get update && apt-get install -y build-essential libssl-dev libreadline-dev wget && apt-get clean | |
| 9 | + | |
| 10 | +# Install imagemagick | |
| 11 | +RUN apt-get install -y imagemagick libmagick++-dev libmagic-dev && apt-get clean | |
| 12 | + | |
| 13 | +# Install nodejs | |
| 14 | +RUN apt-get install -y python-software-properties | |
| 15 | +RUN add-apt-repository ppa:chris-lea/node.js | |
| 16 | +RUN apt-get update | |
| 17 | +RUN apt-get install -y nodejs && apt-get clean | |
| 18 | + | |
| 19 | +# Install ruby-build | |
| 20 | +RUN apt-get install -y git-core && apt-get clean | |
| 21 | +RUN git clone https://github.com/sstephenson/ruby-build.git && cd ruby-build && ./install.sh | |
| 22 | + | |
| 23 | +# Install ruby 2.1.1 | |
| 24 | +ENV CONFIGURE_OPTS --disable-install-rdoc | |
| 25 | +RUN ruby-build 2.1.1 /usr/local | |
| 26 | +RUN gem install bundler | |
| 27 | + | |
| 28 | +# Install Redis and make sure to not run it daemonized | |
| 29 | +RUN apt-get install -y redis-server && apt-get clean | |
| 30 | +ADD redis.sh /etc/my_init.d/ | |
| 31 | + | |
| 32 | +# Enable insecure key to easily use ssh | |
| 33 | +RUN /usr/sbin/enable_insecure_key | |
| 34 | + | |
| 35 | +# for a JS runtime | |
| 36 | +RUN apt-get install -y nodejs | |
| 37 | + | |
| 38 | +# Mysql dependencies | |
| 39 | + | |
| 40 | +RUN apt-get install -y mysql-client libmysqlclient-dev | |
| 41 | +RUN gem install mysql2 | |
| 42 | + | |
| 43 | +# Sqlite | |
| 44 | + | |
| 45 | +RUN apt-get install -y sqlite3 | |
| 46 | +RUN apt-get install -y libsqlite3-dev | |
| 47 | + | |
| 48 | +ENV APP_HOME /myapp | |
| 49 | +RUN mkdir $APP_HOME | |
| 50 | +WORKDIR $APP_HOME | |
| 51 | + | |
| 52 | +ADD * $APP_HOME/ | |
| 53 | +RUN bundle install | |
| 54 | + | |
| 55 | +ADD . $APP_HOME | ... | ... |
| 1 | +++ a/Gemfile | |
| ... | ... | @@ -0,0 +1,95 @@ |
| 1 | +source 'https://rubygems.org' | |
| 2 | + | |
| 3 | +ruby '2.1.1' | |
| 4 | +gem 'rails', '4.1.1' | |
| 5 | + | |
| 6 | +gem 'activeadmin', github: 'gregbell/active_admin' | |
| 7 | + | |
| 8 | +gem 'haml-rails' | |
| 9 | +gem 'sass-rails', '~> 4.0.3' | |
| 10 | + | |
| 11 | +gem 'twitter-bootstrap-rails' | |
| 12 | +gem 'less-rails' | |
| 13 | + | |
| 14 | +gem 'uglifier', '>= 1.3.0' | |
| 15 | +gem 'coffee-rails', '~> 4.0.0' | |
| 16 | +gem 'jquery-rails' | |
| 17 | +gem 'jquery.fileupload-rails' | |
| 18 | + | |
| 19 | +gem 'httmultiparty' | |
| 20 | + | |
| 21 | +gem 'therubyracer', :platform => :ruby | |
| 22 | +gem 'websocket-rails' | |
| 23 | + | |
| 24 | +# gem 'turbolinks' | |
| 25 | + | |
| 26 | +gem 'devise' | |
| 27 | +gem 'cancan' | |
| 28 | +gem 'rolify' | |
| 29 | + | |
| 30 | +gem 'simple_form' | |
| 31 | +gem 'kaminari' | |
| 32 | +gem 'kaminari-bootstrap', '~> 0.1.3' | |
| 33 | + | |
| 34 | +gem 'inherited_resources' | |
| 35 | + | |
| 36 | +gem 'delayed_job_active_record' | |
| 37 | +gem 'delayed_job_web' | |
| 38 | +gem 'foreman' | |
| 39 | +gem 'carrierwave' | |
| 40 | + | |
| 41 | +gem 'dotenv-rails' | |
| 42 | +gem 'annotate' | |
| 43 | + | |
| 44 | +group :development do | |
| 45 | + gem 'capistrano', require: false | |
| 46 | + gem 'capistrano-rails', require: false | |
| 47 | + gem 'capistrano-bundler', require: false | |
| 48 | + gem 'capistrano-rvm', require: false | |
| 49 | + gem 'capistrano3-puma', require: false | |
| 50 | + gem 'better_errors' | |
| 51 | + gem 'binding_of_caller', :platforms=>[:mri_21] | |
| 52 | + gem 'guard-bundler' | |
| 53 | + gem 'guard-rails' | |
| 54 | + gem 'guard-rspec' | |
| 55 | + gem 'guard-livereload', require: false | |
| 56 | + gem 'rack-livereload' | |
| 57 | + gem 'spring' | |
| 58 | + gem 'html2haml' | |
| 59 | + gem 'quiet_assets' | |
| 60 | + gem 'rails_layout' | |
| 61 | + gem 'rb-fchange', :require=>false | |
| 62 | + gem 'rb-fsevent', :require=>false | |
| 63 | + gem 'rb-inotify', :require=>false | |
| 64 | + gem 'awesome_print' | |
| 65 | +end | |
| 66 | + | |
| 67 | +group :development, :test do | |
| 68 | + gem 'factory_girl_rails' | |
| 69 | + gem 'pry-rails' | |
| 70 | + gem 'pry-rescue' | |
| 71 | + gem 'pry-debugger' | |
| 72 | + gem 'rspec-rails', '>= 3.0.0.beta2' | |
| 73 | + gem 'sqlite3' | |
| 74 | +end | |
| 75 | + | |
| 76 | +group :production do | |
| 77 | + gem 'thin' | |
| 78 | + gem 'mysql2' | |
| 79 | +end | |
| 80 | + | |
| 81 | +group :test do | |
| 82 | + gem 'capybara' | |
| 83 | + gem 'database_cleaner' | |
| 84 | + gem 'faker' | |
| 85 | + gem 'launchy' | |
| 86 | + gem 'selenium-webdriver' | |
| 87 | +end | |
| 88 | + | |
| 89 | +gem 'puma' | |
| 90 | + | |
| 91 | +gem 'faye-websocket', '0.10.0' | |
| 92 | + | |
| 93 | +gem "redis", ">= 3.2.0", :require => ["redis", "redis/connection/hiredis"] | |
| 94 | +gem "hiredis", "~> 0.6.0" | |
| 95 | + | ... | ... |
| 1 | +++ a/Gemfile.lock | |
| ... | ... | @@ -0,0 +1,491 @@ |
| 1 | +GIT | |
| 2 | + remote: git://github.com/gregbell/active_admin.git | |
| 3 | + revision: 9c690407cd3d36d3f47d4ca9a99a54ba8aa6f496 | |
| 4 | + specs: | |
| 5 | + activeadmin (1.0.0.pre) | |
| 6 | + arbre (~> 1.0) | |
| 7 | + bourbon | |
| 8 | + coffee-rails | |
| 9 | + formtastic (~> 2.3.0.rc3) | |
| 10 | + inherited_resources (~> 1.3) | |
| 11 | + jquery-rails | |
| 12 | + jquery-ui-rails | |
| 13 | + kaminari (~> 0.15) | |
| 14 | + rails (>= 3.2, < 4.2) | |
| 15 | + ransack (~> 1.0) | |
| 16 | + sass-rails | |
| 17 | + | |
| 18 | +GEM | |
| 19 | + remote: https://rubygems.org/ | |
| 20 | + specs: | |
| 21 | + actionmailer (4.1.1) | |
| 22 | + actionpack (= 4.1.1) | |
| 23 | + actionview (= 4.1.1) | |
| 24 | + mail (~> 2.5.4) | |
| 25 | + actionpack (4.1.1) | |
| 26 | + actionview (= 4.1.1) | |
| 27 | + activesupport (= 4.1.1) | |
| 28 | + rack (~> 1.5.2) | |
| 29 | + rack-test (~> 0.6.2) | |
| 30 | + actionview (4.1.1) | |
| 31 | + activesupport (= 4.1.1) | |
| 32 | + builder (~> 3.1) | |
| 33 | + erubis (~> 2.7.0) | |
| 34 | + activemodel (4.1.1) | |
| 35 | + activesupport (= 4.1.1) | |
| 36 | + builder (~> 3.1) | |
| 37 | + activerecord (4.1.1) | |
| 38 | + activemodel (= 4.1.1) | |
| 39 | + activesupport (= 4.1.1) | |
| 40 | + arel (~> 5.0.0) | |
| 41 | + activesupport (4.1.1) | |
| 42 | + i18n (~> 0.6, >= 0.6.9) | |
| 43 | + json (~> 1.7, >= 1.7.7) | |
| 44 | + minitest (~> 5.1) | |
| 45 | + thread_safe (~> 0.1) | |
| 46 | + tzinfo (~> 1.1) | |
| 47 | + addressable (2.3.6) | |
| 48 | + annotate (2.6.3) | |
| 49 | + activerecord (>= 2.3.0) | |
| 50 | + rake (>= 0.8.7) | |
| 51 | + arbre (1.0.1) | |
| 52 | + activesupport (>= 3.0.0) | |
| 53 | + arel (5.0.1.20140414130214) | |
| 54 | + awesome_print (1.2.0) | |
| 55 | + bcrypt (3.1.7) | |
| 56 | + better_errors (1.1.0) | |
| 57 | + coderay (>= 1.0.0) | |
| 58 | + erubis (>= 2.6.6) | |
| 59 | + binding_of_caller (0.7.2) | |
| 60 | + debug_inspector (>= 0.0.1) | |
| 61 | + bourbon (3.2.1) | |
| 62 | + sass (~> 3.2) | |
| 63 | + thor | |
| 64 | + builder (3.2.2) | |
| 65 | + cancan (1.6.10) | |
| 66 | + capistrano (3.2.1) | |
| 67 | + i18n | |
| 68 | + rake (>= 10.0.0) | |
| 69 | + sshkit (~> 1.3) | |
| 70 | + capistrano-bundler (1.1.2) | |
| 71 | + capistrano (~> 3.0) | |
| 72 | + sshkit (~> 1.2) | |
| 73 | + capistrano-rails (1.1.1) | |
| 74 | + capistrano (~> 3.1) | |
| 75 | + capistrano-bundler (~> 1.1) | |
| 76 | + capistrano-rvm (0.1.1) | |
| 77 | + capistrano (~> 3.0) | |
| 78 | + sshkit (~> 1.2) | |
| 79 | + capistrano3-puma (1.2.1) | |
| 80 | + capistrano (~> 3.0) | |
| 81 | + puma (>= 2.6) | |
| 82 | + capybara (2.2.1) | |
| 83 | + mime-types (>= 1.16) | |
| 84 | + nokogiri (>= 1.3.3) | |
| 85 | + rack (>= 1.0.0) | |
| 86 | + rack-test (>= 0.5.4) | |
| 87 | + xpath (~> 2.0) | |
| 88 | + carrierwave (0.10.0) | |
| 89 | + activemodel (>= 3.2.0) | |
| 90 | + activesupport (>= 3.2.0) | |
| 91 | + json (>= 1.7) | |
| 92 | + mime-types (>= 1.16) | |
| 93 | + celluloid (0.15.2) | |
| 94 | + timers (~> 1.1.0) | |
| 95 | + celluloid-io (0.15.0) | |
| 96 | + celluloid (>= 0.15.0) | |
| 97 | + nio4r (>= 0.5.0) | |
| 98 | + childprocess (0.5.3) | |
| 99 | + ffi (~> 1.0, >= 1.0.11) | |
| 100 | + coderay (1.1.0) | |
| 101 | + coffee-rails (4.0.1) | |
| 102 | + coffee-script (>= 2.2.0) | |
| 103 | + railties (>= 4.0.0, < 5.0) | |
| 104 | + coffee-script (2.2.0) | |
| 105 | + coffee-script-source | |
| 106 | + execjs | |
| 107 | + coffee-script-source (1.7.0) | |
| 108 | + colorize (0.7.3) | |
| 109 | + columnize (0.8.9) | |
| 110 | + commonjs (0.2.7) | |
| 111 | + daemons (1.1.9) | |
| 112 | + database_cleaner (1.2.0) | |
| 113 | + debug_inspector (0.0.2) | |
| 114 | + debugger (1.6.6) | |
| 115 | + columnize (>= 0.3.1) | |
| 116 | + debugger-linecache (~> 1.2.0) | |
| 117 | + debugger-ruby_core_source (~> 1.3.2) | |
| 118 | + debugger-linecache (1.2.0) | |
| 119 | + debugger-ruby_core_source (1.3.4) | |
| 120 | + delayed_job (4.0.1) | |
| 121 | + activesupport (>= 3.0, < 4.2) | |
| 122 | + delayed_job_active_record (4.0.1) | |
| 123 | + activerecord (>= 3.0, < 4.2) | |
| 124 | + delayed_job (>= 3.0, < 4.1) | |
| 125 | + delayed_job_web (1.2.9) | |
| 126 | + activerecord (> 3.0.0) | |
| 127 | + delayed_job (> 2.0.3) | |
| 128 | + sinatra (>= 1.4.4) | |
| 129 | + devise (3.2.4) | |
| 130 | + bcrypt (~> 3.0) | |
| 131 | + orm_adapter (~> 0.1) | |
| 132 | + railties (>= 3.2.6, < 5) | |
| 133 | + thread_safe (~> 0.1) | |
| 134 | + warden (~> 1.2.3) | |
| 135 | + diff-lcs (1.2.5) | |
| 136 | + dotenv (0.7.0) | |
| 137 | + dotenv-rails (0.7.0) | |
| 138 | + dotenv (= 0.7.0) | |
| 139 | + em-synchrony (1.0.3) | |
| 140 | + eventmachine (>= 1.0.0.beta.1) | |
| 141 | + em-websocket (0.5.1) | |
| 142 | + eventmachine (>= 0.12.9) | |
| 143 | + http_parser.rb (~> 0.6.0) | |
| 144 | + erubis (2.7.0) | |
| 145 | + eventmachine (1.2.0.1) | |
| 146 | + execjs (2.0.2) | |
| 147 | + factory_girl (4.4.0) | |
| 148 | + activesupport (>= 3.0.0) | |
| 149 | + factory_girl_rails (4.4.1) | |
| 150 | + factory_girl (~> 4.4.0) | |
| 151 | + railties (>= 3.0.0) | |
| 152 | + faker (1.3.0) | |
| 153 | + i18n (~> 0.5) | |
| 154 | + faye-websocket (0.10.0) | |
| 155 | + eventmachine (>= 0.12.0) | |
| 156 | + websocket-driver (>= 0.5.1) | |
| 157 | + ffi (1.9.3) | |
| 158 | + foreman (0.66.0) | |
| 159 | + dotenv (~> 0.7.0) | |
| 160 | + thor (~> 0.19.1) | |
| 161 | + formatador (0.2.4) | |
| 162 | + formtastic (2.3.0.rc3) | |
| 163 | + actionpack (>= 3.0) | |
| 164 | + guard (2.6.1) | |
| 165 | + formatador (>= 0.2.4) | |
| 166 | + listen (~> 2.7) | |
| 167 | + lumberjack (~> 1.0) | |
| 168 | + pry (>= 0.9.12) | |
| 169 | + thor (>= 0.18.1) | |
| 170 | + guard-bundler (2.0.0) | |
| 171 | + bundler (~> 1.0) | |
| 172 | + guard (~> 2.2) | |
| 173 | + guard-livereload (2.1.2) | |
| 174 | + em-websocket (~> 0.5) | |
| 175 | + guard (~> 2.0) | |
| 176 | + multi_json (~> 1.8) | |
| 177 | + guard-rails (0.5.0) | |
| 178 | + guard (>= 2.0.0) | |
| 179 | + guard-rspec (4.2.2) | |
| 180 | + guard (~> 2.1, >= 2.1) | |
| 181 | + rspec (~> 3.0.0.beta, >= 2.14, < 4.0) | |
| 182 | + haml (4.1.0.beta.1) | |
| 183 | + tilt | |
| 184 | + haml-rails (0.5.3) | |
| 185 | + actionpack (>= 4.0.1) | |
| 186 | + activesupport (>= 4.0.1) | |
| 187 | + haml (>= 3.1, < 5.0) | |
| 188 | + railties (>= 4.0.1) | |
| 189 | + has_scope (0.6.0.rc) | |
| 190 | + actionpack (>= 3.2, < 5) | |
| 191 | + activesupport (>= 3.2, < 5) | |
| 192 | + hike (1.2.3) | |
| 193 | + hiredis (0.6.1) | |
| 194 | + hpricot (0.8.6) | |
| 195 | + html2haml (1.0.1) | |
| 196 | + erubis (~> 2.7.0) | |
| 197 | + haml (>= 4.0.0.rc.1) | |
| 198 | + hpricot (~> 0.8.6) | |
| 199 | + ruby_parser (~> 3.1.1) | |
| 200 | + httmultiparty (0.3.14) | |
| 201 | + httparty (>= 0.7.3) | |
| 202 | + mimemagic | |
| 203 | + multipart-post | |
| 204 | + http_parser.rb (0.6.0) | |
| 205 | + httparty (0.13.1) | |
| 206 | + json (~> 1.8) | |
| 207 | + multi_xml (>= 0.5.2) | |
| 208 | + i18n (0.6.9) | |
| 209 | + inherited_resources (1.4.1) | |
| 210 | + has_scope (~> 0.6.0.rc) | |
| 211 | + responders (~> 1.0.0.rc) | |
| 212 | + interception (0.5) | |
| 213 | + jquery-rails (3.1.0) | |
| 214 | + railties (>= 3.0, < 5.0) | |
| 215 | + thor (>= 0.14, < 2.0) | |
| 216 | + jquery-ui-rails (4.2.1) | |
| 217 | + railties (>= 3.2.16) | |
| 218 | + jquery.fileupload-rails (1.9.0) | |
| 219 | + jquery-ui-rails (>= 3.0, < 5.0) | |
| 220 | + railties (>= 3.1) | |
| 221 | + json (1.8.1) | |
| 222 | + kaminari (0.15.1) | |
| 223 | + actionpack (>= 3.0.0) | |
| 224 | + activesupport (>= 3.0.0) | |
| 225 | + kaminari-bootstrap (0.1.3) | |
| 226 | + kaminari (>= 0.13.0) | |
| 227 | + rails | |
| 228 | + launchy (2.4.2) | |
| 229 | + addressable (~> 2.3) | |
| 230 | + less (2.5.0) | |
| 231 | + commonjs (~> 0.2.7) | |
| 232 | + less-rails (2.5.0) | |
| 233 | + actionpack (>= 3.1) | |
| 234 | + less (~> 2.5.0) | |
| 235 | + libv8 (3.16.14.3) | |
| 236 | + listen (2.7.4) | |
| 237 | + celluloid (>= 0.15.2) | |
| 238 | + celluloid-io (>= 0.15.0) | |
| 239 | + rb-fsevent (>= 0.9.3) | |
| 240 | + rb-inotify (>= 0.9) | |
| 241 | + lumberjack (1.0.5) | |
| 242 | + mail (2.5.4) | |
| 243 | + mime-types (~> 1.16) | |
| 244 | + treetop (~> 1.4.8) | |
| 245 | + method_source (0.8.2) | |
| 246 | + mime-types (1.25.1) | |
| 247 | + mimemagic (0.2.1) | |
| 248 | + mini_portile (0.5.3) | |
| 249 | + minitest (5.3.4) | |
| 250 | + multi_json (1.10.0) | |
| 251 | + multi_xml (0.5.5) | |
| 252 | + multipart-post (2.0.0) | |
| 253 | + mysql2 (0.3.15) | |
| 254 | + net-scp (1.2.1) | |
| 255 | + net-ssh (>= 2.6.5) | |
| 256 | + net-ssh (2.9.1) | |
| 257 | + nio4r (1.0.0) | |
| 258 | + nokogiri (1.6.2) | |
| 259 | + mini_portile (~> 0.5.2) | |
| 260 | + orm_adapter (0.5.0) | |
| 261 | + polyamorous (1.0.0) | |
| 262 | + activerecord (>= 3.0) | |
| 263 | + polyglot (0.3.4) | |
| 264 | + pry (0.9.12.6) | |
| 265 | + coderay (~> 1.0) | |
| 266 | + method_source (~> 0.8) | |
| 267 | + slop (~> 3.4) | |
| 268 | + pry-debugger (0.2.2) | |
| 269 | + debugger (~> 1.3) | |
| 270 | + pry (~> 0.9.10) | |
| 271 | + pry-rails (0.3.2) | |
| 272 | + pry (>= 0.9.10) | |
| 273 | + pry-rescue (1.4.1) | |
| 274 | + interception (>= 0.5) | |
| 275 | + pry | |
| 276 | + puma (3.2.0) | |
| 277 | + quiet_assets (1.0.2) | |
| 278 | + railties (>= 3.1, < 5.0) | |
| 279 | + rack (1.5.2) | |
| 280 | + rack-livereload (0.3.15) | |
| 281 | + rack | |
| 282 | + rack-protection (1.5.3) | |
| 283 | + rack | |
| 284 | + rack-test (0.6.2) | |
| 285 | + rack (>= 1.0) | |
| 286 | + rails (4.1.1) | |
| 287 | + actionmailer (= 4.1.1) | |
| 288 | + actionpack (= 4.1.1) | |
| 289 | + actionview (= 4.1.1) | |
| 290 | + activemodel (= 4.1.1) | |
| 291 | + activerecord (= 4.1.1) | |
| 292 | + activesupport (= 4.1.1) | |
| 293 | + bundler (>= 1.3.0, < 2.0) | |
| 294 | + railties (= 4.1.1) | |
| 295 | + sprockets-rails (~> 2.0) | |
| 296 | + rails_layout (1.0.16) | |
| 297 | + railties (4.1.1) | |
| 298 | + actionpack (= 4.1.1) | |
| 299 | + activesupport (= 4.1.1) | |
| 300 | + rake (>= 0.8.7) | |
| 301 | + thor (>= 0.18.1, < 2.0) | |
| 302 | + rake (10.3.2) | |
| 303 | + ransack (1.2.3) | |
| 304 | + actionpack (>= 3.0) | |
| 305 | + activerecord (>= 3.0) | |
| 306 | + activesupport (>= 3.0) | |
| 307 | + i18n | |
| 308 | + polyamorous (~> 1.0.0) | |
| 309 | + rb-fchange (0.0.6) | |
| 310 | + ffi | |
| 311 | + rb-fsevent (0.9.4) | |
| 312 | + rb-inotify (0.9.4) | |
| 313 | + ffi (>= 0.5.0) | |
| 314 | + redis (3.2.2) | |
| 315 | + redis-objects (0.9.1) | |
| 316 | + redis (>= 3.0.2) | |
| 317 | + ref (1.0.5) | |
| 318 | + responders (1.0.0) | |
| 319 | + railties (>= 3.2, < 5) | |
| 320 | + rolify (3.4.0) | |
| 321 | + rspec (3.0.0.beta2) | |
| 322 | + rspec-core (= 3.0.0.beta2) | |
| 323 | + rspec-expectations (= 3.0.0.beta2) | |
| 324 | + rspec-mocks (= 3.0.0.beta2) | |
| 325 | + rspec-collection_matchers (0.0.4) | |
| 326 | + rspec-expectations (>= 2.99.0.beta1) | |
| 327 | + rspec-core (3.0.0.beta2) | |
| 328 | + rspec-support (= 3.0.0.beta2) | |
| 329 | + rspec-expectations (3.0.0.beta2) | |
| 330 | + diff-lcs (>= 1.2.0, < 2.0) | |
| 331 | + rspec-support (= 3.0.0.beta2) | |
| 332 | + rspec-mocks (3.0.0.beta2) | |
| 333 | + rspec-support (= 3.0.0.beta2) | |
| 334 | + rspec-rails (3.0.0.beta2) | |
| 335 | + actionpack (>= 3.0) | |
| 336 | + activemodel (>= 3.0) | |
| 337 | + activesupport (>= 3.0) | |
| 338 | + railties (>= 3.0) | |
| 339 | + rspec-collection_matchers | |
| 340 | + rspec-core (= 3.0.0.beta2) | |
| 341 | + rspec-expectations (= 3.0.0.beta2) | |
| 342 | + rspec-mocks (= 3.0.0.beta2) | |
| 343 | + rspec-support (= 3.0.0.beta2) | |
| 344 | + rspec-support (3.0.0.beta2) | |
| 345 | + ruby_parser (3.1.3) | |
| 346 | + sexp_processor (~> 4.1) | |
| 347 | + rubyzip (1.1.3) | |
| 348 | + sass (3.2.19) | |
| 349 | + sass-rails (4.0.3) | |
| 350 | + railties (>= 4.0.0, < 5.0) | |
| 351 | + sass (~> 3.2.0) | |
| 352 | + sprockets (~> 2.8, <= 2.11.0) | |
| 353 | + sprockets-rails (~> 2.0) | |
| 354 | + selenium-webdriver (2.41.0) | |
| 355 | + childprocess (>= 0.5.0) | |
| 356 | + multi_json (~> 1.0) | |
| 357 | + rubyzip (~> 1.0) | |
| 358 | + websocket (~> 1.0.4) | |
| 359 | + sexp_processor (4.4.3) | |
| 360 | + simple_form (3.0.2) | |
| 361 | + actionpack (~> 4.0) | |
| 362 | + activemodel (~> 4.0) | |
| 363 | + sinatra (1.4.5) | |
| 364 | + rack (~> 1.4) | |
| 365 | + rack-protection (~> 1.4) | |
| 366 | + tilt (~> 1.3, >= 1.3.4) | |
| 367 | + slop (3.5.0) | |
| 368 | + spring (1.1.3) | |
| 369 | + sprockets (2.11.0) | |
| 370 | + hike (~> 1.2) | |
| 371 | + multi_json (~> 1.0) | |
| 372 | + rack (~> 1.0) | |
| 373 | + tilt (~> 1.1, != 1.3.0) | |
| 374 | + sprockets-rails (2.1.3) | |
| 375 | + actionpack (>= 3.0) | |
| 376 | + activesupport (>= 3.0) | |
| 377 | + sprockets (~> 2.8) | |
| 378 | + sqlite3 (1.3.9) | |
| 379 | + sshkit (1.5.1) | |
| 380 | + colorize | |
| 381 | + net-scp (>= 1.1.2) | |
| 382 | + net-ssh (>= 2.8.0) | |
| 383 | + therubyracer (0.12.1) | |
| 384 | + libv8 (~> 3.16.14.0) | |
| 385 | + ref | |
| 386 | + thin (1.6.2) | |
| 387 | + daemons (>= 1.0.9) | |
| 388 | + eventmachine (>= 1.0.0) | |
| 389 | + rack (>= 1.0.0) | |
| 390 | + thor (0.19.1) | |
| 391 | + thread_safe (0.3.4) | |
| 392 | + tilt (1.4.1) | |
| 393 | + timers (1.1.0) | |
| 394 | + treetop (1.4.15) | |
| 395 | + polyglot | |
| 396 | + polyglot (>= 0.3.1) | |
| 397 | + twitter-bootstrap-rails (2.2.8) | |
| 398 | + actionpack (>= 3.1) | |
| 399 | + execjs | |
| 400 | + rails (>= 3.1) | |
| 401 | + railties (>= 3.1) | |
| 402 | + tzinfo (1.2.0) | |
| 403 | + thread_safe (~> 0.1) | |
| 404 | + uglifier (2.5.0) | |
| 405 | + execjs (>= 0.3.0) | |
| 406 | + json (>= 1.8.0) | |
| 407 | + warden (1.2.3) | |
| 408 | + rack (>= 1.0) | |
| 409 | + websocket (1.0.7) | |
| 410 | + websocket-driver (0.6.3) | |
| 411 | + websocket-extensions (>= 0.1.0) | |
| 412 | + websocket-extensions (0.1.2) | |
| 413 | + websocket-rails (0.7.0) | |
| 414 | + em-synchrony | |
| 415 | + faye-websocket | |
| 416 | + hiredis | |
| 417 | + rack | |
| 418 | + rails | |
| 419 | + redis | |
| 420 | + redis-objects | |
| 421 | + thin | |
| 422 | + xpath (2.0.0) | |
| 423 | + nokogiri (~> 1.3) | |
| 424 | + | |
| 425 | +PLATFORMS | |
| 426 | + ruby | |
| 427 | + | |
| 428 | +DEPENDENCIES | |
| 429 | + activeadmin! | |
| 430 | + annotate | |
| 431 | + awesome_print | |
| 432 | + better_errors | |
| 433 | + binding_of_caller | |
| 434 | + cancan | |
| 435 | + capistrano | |
| 436 | + capistrano-bundler | |
| 437 | + capistrano-rails | |
| 438 | + capistrano-rvm | |
| 439 | + capistrano3-puma | |
| 440 | + capybara | |
| 441 | + carrierwave | |
| 442 | + coffee-rails (~> 4.0.0) | |
| 443 | + database_cleaner | |
| 444 | + delayed_job_active_record | |
| 445 | + delayed_job_web | |
| 446 | + devise | |
| 447 | + dotenv-rails | |
| 448 | + factory_girl_rails | |
| 449 | + faker | |
| 450 | + faye-websocket (= 0.10.0) | |
| 451 | + foreman | |
| 452 | + guard-bundler | |
| 453 | + guard-livereload | |
| 454 | + guard-rails | |
| 455 | + guard-rspec | |
| 456 | + haml-rails | |
| 457 | + hiredis (~> 0.6.0) | |
| 458 | + html2haml | |
| 459 | + httmultiparty | |
| 460 | + inherited_resources | |
| 461 | + jquery-rails | |
| 462 | + jquery.fileupload-rails | |
| 463 | + kaminari | |
| 464 | + kaminari-bootstrap (~> 0.1.3) | |
| 465 | + launchy | |
| 466 | + less-rails | |
| 467 | + mysql2 | |
| 468 | + pry-debugger | |
| 469 | + pry-rails | |
| 470 | + pry-rescue | |
| 471 | + puma | |
| 472 | + quiet_assets | |
| 473 | + rack-livereload | |
| 474 | + rails (= 4.1.1) | |
| 475 | + rails_layout | |
| 476 | + rb-fchange | |
| 477 | + rb-fsevent | |
| 478 | + rb-inotify | |
| 479 | + redis (>= 3.2.0) | |
| 480 | + rolify | |
| 481 | + rspec-rails (>= 3.0.0.beta2) | |
| 482 | + sass-rails (~> 4.0.3) | |
| 483 | + selenium-webdriver | |
| 484 | + simple_form | |
| 485 | + spring | |
| 486 | + sqlite3 | |
| 487 | + therubyracer | |
| 488 | + thin | |
| 489 | + twitter-bootstrap-rails | |
| 490 | + uglifier (>= 1.3.0) | |
| 491 | + websocket-rails | ... | ... |
| 1 | +++ a/Guardfile | |
| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | +# A sample Guardfile | |
| 2 | +# More info at https://github.com/guard/guard#readme | |
| 3 | + | |
| 4 | +guard :bundler do | |
| 5 | + watch('Gemfile') | |
| 6 | + # Uncomment next line if your Gemfile contains the `gemspec' command. | |
| 7 | + # watch(/^.+\.gemspec/) | |
| 8 | +end | |
| 9 | + | |
| 10 | +guard 'livereload' do | |
| 11 | + watch(%r{app/views/.+\.(erb|haml|slim)$}) | |
| 12 | + watch(%r{app/helpers/.+\.rb}) | |
| 13 | + watch(%r{public/.+\.(css|js|html)}) | |
| 14 | + watch(%r{config/locales/.+\.yml}) | |
| 15 | + # Rails Assets Pipeline | |
| 16 | + watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg))).*}) { |m| "/assets/#{m[3]}" } | |
| 17 | +end | |
| 18 | + | |
| 19 | +guard 'rails' do | |
| 20 | + watch('Gemfile.lock') | |
| 21 | + watch(%r{^(config|lib)/.*\.([^.]+)$}) { |m| m[0] if m[2] != 'yml' && !m[0]['locales'] } | |
| 22 | +end | |
| 23 | + | |
| 24 | + | |
| 25 | +guard :rspec do | |
| 26 | + watch(%r{^spec/.+_spec\.rb$}) | |
| 27 | + watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
| 28 | + watch('spec/spec_helper.rb') { "spec" } | |
| 29 | + | |
| 30 | + # Rails example | |
| 31 | + watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | |
| 32 | + watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | |
| 33 | + watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } | |
| 34 | + watch(%r{^spec/support/(.+)\.rb$}) { "spec" } | |
| 35 | + watch('config/routes.rb') { "spec/routing" } | |
| 36 | + watch('app/controllers/application_controller.rb') { "spec/controllers" } | |
| 37 | + | |
| 38 | + # Capybara features specs | |
| 39 | + watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" } | |
| 40 | + | |
| 41 | + # Turnip features and steps | |
| 42 | + watch(%r{^spec/acceptance/(.+)\.feature$}) | |
| 43 | + watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } | |
| 44 | +end | |
| 45 | + | ... | ... |
| 1 | +++ a/Rakefile | |
| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | +# Add your own tasks in files placed in lib/tasks ending in .rake, | |
| 2 | +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | |
| 3 | + | |
| 4 | +require File.expand_path('../config/application', __FILE__) | |
| 5 | + | |
| 6 | +Rails.application.load_tasks | ... | ... |
| 1 | +++ a/app/admin/dashboard.rb | |
| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +ActiveAdmin.register_page "Dashboard" do | |
| 3 | + | |
| 4 | + menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") } | |
| 5 | + | |
| 6 | + content title: proc{ I18n.t("active_admin.dashboard") } do | |
| 7 | + div class: "blank_slate_container", id: "dashboard_default_message" do | |
| 8 | + span class: "blank_slate" do | |
| 9 | + span I18n.t("active_admin.dashboard_welcome.welcome") | |
| 10 | + small I18n.t("active_admin.dashboard_welcome.call_to_action") | |
| 11 | + end | |
| 12 | + end | |
| 13 | + | |
| 14 | + # Here is an example of a simple dashboard with columns and panels. | |
| 15 | + # | |
| 16 | + # columns do | |
| 17 | + # column do | |
| 18 | + # panel "Recent Posts" do | |
| 19 | + # ul do | |
| 20 | + # Post.recent(5).map do |post| | |
| 21 | + # li link_to(post.title, admin_post_path(post)) | |
| 22 | + # end | |
| 23 | + # end | |
| 24 | + # end | |
| 25 | + # end | |
| 26 | + | |
| 27 | + # column do | |
| 28 | + # panel "Info" do | |
| 29 | + # para "Welcome to ActiveAdmin." | |
| 30 | + # end | |
| 31 | + # end | |
| 32 | + # end | |
| 33 | + end # content | |
| 34 | +end | ... | ... |
| 1 | +++ a/app/admin/user.rb | |
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +ActiveAdmin.register User do | |
| 3 | + menu :priority => 80 | |
| 4 | + | |
| 5 | + permit_params :email, :password, :password_confirmation | |
| 6 | + | |
| 7 | + index do | |
| 8 | + selectable_column | |
| 9 | + id_column | |
| 10 | + column :email | |
| 11 | + column :current_sign_in_at | |
| 12 | + column :sign_in_count | |
| 13 | + column :created_at | |
| 14 | + actions | |
| 15 | + end | |
| 16 | + | |
| 17 | + filter :email | |
| 18 | + filter :current_sign_in_at | |
| 19 | + filter :sign_in_count | |
| 20 | + filter :created_at | |
| 21 | + | |
| 22 | + form do |f| | |
| 23 | + f.inputs "Admin Details" do | |
| 24 | + f.input :email | |
| 25 | + f.input :password | |
| 26 | + f.input :password_confirmation | |
| 27 | + end | |
| 28 | + f.actions | |
| 29 | + end | |
| 30 | + | |
| 31 | +end | ... | ... |
| 1 | +++ a/app/admin/v_libras_request.rb | |
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +ActiveAdmin.register VLibras::Request do | |
| 3 | + menu :priority => 10 | |
| 4 | + | |
| 5 | + | |
| 6 | + # See permitted parameters documentation: | |
| 7 | + # https://github.com/gregbell/active_admin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters | |
| 8 | + # | |
| 9 | + # permit_params :list, :of, :attributes, :on, :model | |
| 10 | + # | |
| 11 | + # or | |
| 12 | + # | |
| 13 | + # permit_params do | |
| 14 | + # permitted = [:permitted, :attributes] | |
| 15 | + # permitted << :other if resource.something? | |
| 16 | + # permitted | |
| 17 | + # end | |
| 18 | + | |
| 19 | +end | ... | ... |
| 1 | +++ a/app/assets/images/.keep | ... | ... |
9.77 KB
556 Bytes
31.4 KB
1.01 KB
| 1 | +++ a/app/assets/javascripts/application.js | |
| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | +// This is a manifest file that'll be compiled into application.js, which will include all the files | |
| 2 | +// listed below. | |
| 3 | +// | |
| 4 | +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | |
| 5 | +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | |
| 6 | +// | |
| 7 | +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | |
| 8 | +// compiled file. | |
| 9 | +// | |
| 10 | +// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details | |
| 11 | +// about supported directives. | |
| 12 | +// | |
| 13 | +//= require jquery | |
| 14 | +//= require jquery_ujs | |
| 15 | +//= require jquery.fileupload | |
| 16 | +//= require twitter/bootstrap | |
| 17 | +//= require websocket_rails/main | |
| 0 | 18 | \ No newline at end of file | ... | ... |
| 1 | +++ a/app/assets/javascripts/bootstrap.js.coffee | ... | ... |
| 1 | +++ a/app/assets/javascripts/v_libras/requests/new.js | |
| ... | ... | @@ -0,0 +1,223 @@ |
| 1 | +/* | |
| 2 | + * jquery-File-Upload | |
| 3 | + */ | |
| 4 | +$(function() { | |
| 5 | + var videoFile; | |
| 6 | + var subtitleFile; | |
| 7 | + | |
| 8 | + function uploadFiles() { | |
| 9 | + initializeFileUpload(); | |
| 10 | + | |
| 11 | + if (subtitleFile == null) { | |
| 12 | + files = [videoFile]; | |
| 13 | + params = ['video']; | |
| 14 | + } else { | |
| 15 | + files = [videoFile, subtitleFile]; | |
| 16 | + params = ['video', 'subtitle']; | |
| 17 | + } | |
| 18 | + | |
| 19 | + $('#vlibras-form').fileupload('send', | |
| 20 | + { files: files, | |
| 21 | + paramName: params }); | |
| 22 | + } | |
| 23 | + | |
| 24 | + function initializeFileUpload() { | |
| 25 | + $('#vlibras-form').fileupload({ | |
| 26 | + autoUpload: false, | |
| 27 | + singleFileUploads: false, | |
| 28 | + | |
| 29 | + always: function (e, data) { | |
| 30 | + location.href = data.jqXHR.responseJSON.redirect_to; | |
| 31 | + }, | |
| 32 | + }); | |
| 33 | + | |
| 34 | + $("#vlibras-form").bind("fileuploadprogress", function (e, data) { | |
| 35 | + var percentage = Math.round(data.loaded / data.total * 100); | |
| 36 | + var bitrate = Math.round(data.bitrate / 8 / 1024 * 100) / 100 + " KB/s"; | |
| 37 | + | |
| 38 | + $("#upload-bar").css("width", percentage + "%"); | |
| 39 | + $("#upload-label").text(percentage + "% (" + bitrate + ")"); | |
| 40 | + }); | |
| 41 | + } | |
| 42 | + | |
| 43 | + | |
| 44 | + $("#vlibras-wizard").steps({ | |
| 45 | + headerTag: "h2", | |
| 46 | + bodyTag: "section", | |
| 47 | + transitionEffect: "slideLeft", | |
| 48 | + stepsOrientation: "horizontal", | |
| 49 | + enablePagination: true, | |
| 50 | + forceMoveForward: true, | |
| 51 | + | |
| 52 | + // startIndex: 1, | |
| 53 | + | |
| 54 | + onStepChanged: stepChanged, | |
| 55 | + onFinished: finished, | |
| 56 | + | |
| 57 | + labels: { | |
| 58 | + cancel: "Cancelar", | |
| 59 | + current: "etapa atual:", | |
| 60 | + pagination: "Pagination", | |
| 61 | + finish: "Finalizar", | |
| 62 | + next: "Próximo", | |
| 63 | + previous: "Anterior", | |
| 64 | + loading: "Carregando ..." | |
| 65 | + } | |
| 66 | + }); | |
| 67 | + | |
| 68 | + function stepChanged(event, currentIndex, priorIndex) { | |
| 69 | + var totalSteps = $("#vlibras-wizard .content section").size(); | |
| 70 | + | |
| 71 | + if ((priorIndex === 0) && (currentIndex === 1)) { | |
| 72 | + videojs($("#video-step").find("video")[0]).pause(); | |
| 73 | + videojs($("#service-step").find("video")[0]).play(); | |
| 74 | + | |
| 75 | + $("#menu").hide(); | |
| 76 | + } | |
| 77 | + | |
| 78 | + if ((priorIndex === 1) && (currentIndex === 2)) { | |
| 79 | + videojs($("#service-step").find("video")[0]).pause(); | |
| 80 | + videojs($("#position-step").find("video")[0]).play(); | |
| 81 | + | |
| 82 | + $("#menu").hide(); | |
| 83 | + } | |
| 84 | + | |
| 85 | + if ((priorIndex === 2) && (currentIndex === 3)) { | |
| 86 | + videojs($("#position-step").find("video")[0]).pause(); | |
| 87 | + videojs($("#size-step").find("video")[0]).play(); | |
| 88 | + } | |
| 89 | + | |
| 90 | + if ((currentIndex + 1) === totalSteps) { | |
| 91 | + $("#btn-next").text("Finalizar"); | |
| 92 | + } else { | |
| 93 | + $("#btn-next").text("Próximo"); | |
| 94 | + } | |
| 95 | + | |
| 96 | + deactivateNextButton(); | |
| 97 | + } | |
| 98 | + | |
| 99 | + function finished(event, currentIndex) { | |
| 100 | + $("#vlibras-wizard .content").hide(); | |
| 101 | + $("#vlibras-wizard .steps").hide(); | |
| 102 | + $("#menu").show(); | |
| 103 | + | |
| 104 | + // $("#btn-next").text("Enviando... Aguarde, por favor."); | |
| 105 | + $("#btn-next").hide(); | |
| 106 | + $(".progress").show(); | |
| 107 | + | |
| 108 | + uploadFiles(); | |
| 109 | + | |
| 110 | + deactivateNextButton(); | |
| 111 | + } | |
| 112 | + | |
| 113 | + $('#menu #btn-next').click(function() { | |
| 114 | + // Number of steps | |
| 115 | + var totalSteps = $("#vlibras-wizard .content section").size(); | |
| 116 | + var currentStep = $("#vlibras-wizard").steps('getCurrentIndex'); | |
| 117 | + | |
| 118 | + if ((currentStep + 1) === totalSteps) { | |
| 119 | + $("#vlibras-wizard").steps('finish'); | |
| 120 | + } else { | |
| 121 | + $("#vlibras-wizard").steps('next'); | |
| 122 | + } | |
| 123 | + | |
| 124 | + return false; | |
| 125 | + }); | |
| 126 | + | |
| 127 | + function activateNextButton() { | |
| 128 | + $("#btn-next").prop('disabled', false); | |
| 129 | + } | |
| 130 | + | |
| 131 | + function deactivateNextButton() { | |
| 132 | + $("#btn-next").prop('disabled', true); | |
| 133 | + } | |
| 134 | + | |
| 135 | + $("#vlibras-wizard").find("#position-step").on("click", "a", function() { | |
| 136 | + $("#vlibras-form").addHidden('params[posicao]', $(this).data("value")); | |
| 137 | + $("#vlibras-form").addHidden('params[transparencia]', 'opaco'); | |
| 138 | + $("#vlibras-wizard").steps('next'); | |
| 139 | + | |
| 140 | + console.debug("Posição: " + $(this).data("value")); | |
| 141 | + | |
| 142 | + return false; | |
| 143 | + }); | |
| 144 | + | |
| 145 | + $("#vlibras-wizard").find("#size-step").on("click", "a", function() { | |
| 146 | + $("#vlibras-form").addHidden('params[tamanho]', $(this).data("value")); | |
| 147 | + $("#vlibras-wizard").steps('finish'); | |
| 148 | + | |
| 149 | + console.debug("Tamanho: " + $(this).data("value")); | |
| 150 | + | |
| 151 | + return false; | |
| 152 | + }); | |
| 153 | + | |
| 154 | + | |
| 155 | + /* | |
| 156 | + * Button events | |
| 157 | + */ | |
| 158 | + $("#vlibras-wizard").on("click", "#btn-video-legenda", function() { | |
| 159 | + console.debug("Serviço: video-legenda"); | |
| 160 | + | |
| 161 | + $("#vlibras-form").addHidden('service', 'video-legenda'); | |
| 162 | + // $("#subtitle-upload-container").show(); | |
| 163 | + $("#subtitle-upload").click(); | |
| 164 | + // $("#menu").show(); | |
| 165 | + | |
| 166 | + // $('html, body').animate({ | |
| 167 | + // scrollTop: $("#subtitle-upload").offset().top | |
| 168 | + // }, 600); | |
| 169 | + | |
| 170 | + return false; | |
| 171 | + }); | |
| 172 | + | |
| 173 | + $("#vlibras-wizard").on("click", "#btn-video", function() { | |
| 174 | + console.debug("Serviço: video"); | |
| 175 | + | |
| 176 | + $("#vlibras-wizard").steps('next'); | |
| 177 | + $("#vlibras-form").addHidden('service', 'video'); | |
| 178 | + | |
| 179 | + return false; | |
| 180 | + }); | |
| 181 | + | |
| 182 | + $("#vlibras-wizard").on("click", "#btn-video-upload", function() { | |
| 183 | + $("#video-upload").click(); | |
| 184 | + | |
| 185 | + return false; | |
| 186 | + }); | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + /* | |
| 191 | + * Validates video and subtitle extension and activate the next button | |
| 192 | + */ | |
| 193 | + $("#vlibras-form #subtitle-upload").change(function(event) { | |
| 194 | + var acceptedFileTypes = ["srt"]; | |
| 195 | + | |
| 196 | + if (validateFileWizard($(this), acceptedFileTypes)) { | |
| 197 | + subtitleFile = event.target.files[0]; | |
| 198 | + } | |
| 199 | + }); | |
| 200 | + | |
| 201 | + $("#vlibras-form #video-upload").change(function(event) { | |
| 202 | + $("#vlibras-form").addHidden('service', 'video'); | |
| 203 | + | |
| 204 | + var acceptedFileTypes = ["flv", "ts", "avi", "mp4", "mov", "webm", "wmv", "mkv"]; | |
| 205 | + | |
| 206 | + if (validateFileWizard($(this), acceptedFileTypes)) { | |
| 207 | + videoFile = event.target.files[0]; | |
| 208 | + }; | |
| 209 | + }); | |
| 210 | + | |
| 211 | + function validateFileWizard(input, acceptedFileTypes) { | |
| 212 | + var isValidFile = checkType(input, acceptedFileTypes); | |
| 213 | + | |
| 214 | + if (isValidFile) { | |
| 215 | + $("#vlibras-wizard").steps('next'); | |
| 216 | + } else { | |
| 217 | + input.val(null); | |
| 218 | + alert("Apenas os formatos abaixo são aceitos:\n\n" + acceptedFileTypes.join(", ")); | |
| 219 | + } | |
| 220 | + | |
| 221 | + return true; | |
| 222 | + } | |
| 223 | +}); | |
| 0 | 224 | \ No newline at end of file | ... | ... |
| 1 | +++ a/app/assets/javascripts/v_libras/requests/rapid.js | |
| ... | ... | @@ -0,0 +1,115 @@ |
| 1 | +/* | |
| 2 | + * jquery-File-Upload | |
| 3 | + */ | |
| 4 | +$(function() { | |
| 5 | + var videoFile; | |
| 6 | + var subtitleFile; | |
| 7 | + | |
| 8 | + function uploadFiles() { | |
| 9 | + if (subtitleFile == null) { | |
| 10 | + files = [videoFile]; | |
| 11 | + params = ['video']; | |
| 12 | + } else { | |
| 13 | + files = [videoFile, subtitleFile]; | |
| 14 | + params = ['video', 'subtitle']; | |
| 15 | + } | |
| 16 | + | |
| 17 | + $('#vlibras-rapid-form').fileupload('send', | |
| 18 | + { files: files, | |
| 19 | + paramName: params }); | |
| 20 | + } | |
| 21 | + | |
| 22 | + $('#vlibras-rapid-form').fileupload({ | |
| 23 | + autoUpload: false, | |
| 24 | + singleFileUploads: false, | |
| 25 | + | |
| 26 | + always: function(e, data) { | |
| 27 | + location.href = data.jqXHR.responseJSON.redirect_to; | |
| 28 | + }, | |
| 29 | + | |
| 30 | + add: function(e, data) { | |
| 31 | + if (data.fileInput[0].name === 'video') { | |
| 32 | + videoFile = data.files[0]; | |
| 33 | + } else if (data.fileInput[0].name === 'subtitle') { | |
| 34 | + subtitleFile = data.files[0]; | |
| 35 | + }; | |
| 36 | + | |
| 37 | + $("#submit-button").unbind('click').on('click', function(event) { | |
| 38 | + $(".field").hide(); | |
| 39 | + $(".progress").show(); | |
| 40 | + $("#submit-button").hide(); | |
| 41 | + $("#vlibras-rapid h2").text("Enviando..."); | |
| 42 | + | |
| 43 | + uploadFiles(); | |
| 44 | + | |
| 45 | + event.preventDefault(); | |
| 46 | + }); | |
| 47 | + } | |
| 48 | + }); | |
| 49 | + | |
| 50 | + $("#vlibras-rapid-form").bind("fileuploadprogress", function (e, data) { | |
| 51 | + var percentage = Math.round(data.loaded / data.total * 100); | |
| 52 | + var bitrate = Math.round(data.bitrate / 8 / 1024 * 100) / 100 + " KB/s"; | |
| 53 | + | |
| 54 | + $("#upload-bar").css("width", percentage + "%"); | |
| 55 | + $("#upload-label").text(percentage + "% (" + bitrate + ")"); | |
| 56 | + }); | |
| 57 | +}); | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | +/* | |
| 62 | + * Radio box service (video or video-subtitle) | |
| 63 | + */ | |
| 64 | + | |
| 65 | +$(function() { | |
| 66 | + | |
| 67 | + $("#url").show(); | |
| 68 | + $("#legend").show(); | |
| 69 | + | |
| 70 | + /* When user press "Back" on the browser */ | |
| 71 | + if ($("#service-video-subtitle")[0].checked) { | |
| 72 | + $("#service-video-subtitle").click(); | |
| 73 | + } | |
| 74 | + | |
| 75 | + if ($("#service-video")[0].checked) { | |
| 76 | + $("#service-video").click(); | |
| 77 | + } | |
| 78 | +}); | |
| 79 | + | |
| 80 | + | |
| 81 | +/* | |
| 82 | + * File type verification | |
| 83 | + */ | |
| 84 | + | |
| 85 | +$(function() { | |
| 86 | + $("#subtitle-upload").change(function() { | |
| 87 | + var acceptedFileTypes = ["srt"]; | |
| 88 | + validateFile($(this), acceptedFileTypes); | |
| 89 | + }); | |
| 90 | + | |
| 91 | + $("#video-upload").change(function() { | |
| 92 | + var acceptedFileTypes = ["flv", "ts", "avi", "mp4", "mov", "webm", "wmv", "mkv"]; | |
| 93 | + validateFile($(this), acceptedFileTypes); | |
| 94 | + }); | |
| 95 | + | |
| 96 | + function validateFile(input, acceptedFileTypes) { | |
| 97 | + var isValidFile = checkType(input, acceptedFileTypes); | |
| 98 | + | |
| 99 | + if (!isValidFile) { | |
| 100 | + input.val(null); | |
| 101 | + alert("Apenas os formatos abaixo são aceitos:\n\n" + acceptedFileTypes.join(", ")); | |
| 102 | + } | |
| 103 | + | |
| 104 | + updateButton(input); | |
| 105 | + | |
| 106 | + return true; | |
| 107 | + } | |
| 108 | + | |
| 109 | + function updateButton(input) { | |
| 110 | + var filename = input.val().split("\\").pop(); | |
| 111 | + var buttonText = "Arquivo: " + filename; | |
| 112 | + | |
| 113 | + $("#" + input[0].id).prev(".button-text").text(buttonText).parent().addClass("btn-info"); | |
| 114 | + } | |
| 115 | +}); | ... | ... |
| 1 | +++ a/app/assets/javascripts/v_libras/requests/shared.js | |
| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | +function checkType(file, acceptedFileTypes) { | |
| 2 | + var ext = file.val().split('.').pop().toLowerCase(); | |
| 3 | + var isValidFile = false; | |
| 4 | + | |
| 5 | + for (var i = 0; i < acceptedFileTypes.length; i++) { | |
| 6 | + if (ext == acceptedFileTypes[i]) { | |
| 7 | + isValidFile = true; | |
| 8 | + break; | |
| 9 | + } | |
| 10 | + } | |
| 11 | + | |
| 12 | + return isValidFile; | |
| 13 | +} | |
| 14 | + | |
| 15 | +// This must be applied to a form (or an object inside a form). | |
| 16 | +// http://stackoverflow.com/questions/2530635/jquery-add-additional-parameters-on-submit-not-ajax | |
| 17 | +jQuery.fn.addHidden = function (name, value) { | |
| 18 | + return this.each(function () { | |
| 19 | + var input = $("<input>").attr("type", "hidden").attr("name", name).val(value); | |
| 20 | + $(this).append($(input)); | |
| 21 | + }); | |
| 22 | +}; | |
| 0 | 23 | \ No newline at end of file | ... | ... |
| 1 | +++ a/app/assets/javascripts/v_libras/requests/workflow.js | |
| ... | ... | @@ -0,0 +1,104 @@ |
| 1 | +function debugTime(time) { | |
| 2 | + if (window.location.href.indexOf("debug") > -1) { | |
| 3 | + return 0.3; | |
| 4 | + } else { | |
| 5 | + return time; | |
| 6 | + }; | |
| 7 | +} | |
| 8 | + | |
| 9 | +var VLibrasLocalization = function() { | |
| 10 | + var _id, _wrapper, _video_wrapper, _video, _options; | |
| 11 | + | |
| 12 | + function _initParams() { | |
| 13 | + _wrapper = $(".wrapper").filter(_id), | |
| 14 | + _video_wrapper = _wrapper.find(".video_wrapper"), | |
| 15 | + _video = _wrapper.find("video"); | |
| 16 | + } | |
| 17 | + | |
| 18 | + function _wrapperConfig() { | |
| 19 | + _wrapper.width(_options.video.width); | |
| 20 | + _wrapper.height(_options.video.height); | |
| 21 | + } | |
| 22 | + | |
| 23 | + function _videoWrapperConfig() { | |
| 24 | + _video_wrapper.css('position', 'absolute'); | |
| 25 | + _video_wrapper.css('z-index', 1); | |
| 26 | + _video_wrapper.width(_options.video.width); | |
| 27 | + _video_wrapper.height(_options.video.height); | |
| 28 | + } | |
| 29 | + | |
| 30 | + function _videoConfig() { | |
| 31 | + _video.css('position', 'relative'); | |
| 32 | + _video.css('z-index', 0); | |
| 33 | + _video.attr('width', _options.video.width); | |
| 34 | + _video.attr('height', _options.video.height); | |
| 35 | + } | |
| 36 | + | |
| 37 | + function _addButtons() { | |
| 38 | + | |
| 39 | + var time_helper = null; | |
| 40 | + | |
| 41 | + var interval = setInterval(function() { | |
| 42 | + var time = Math.round( _video[0].currentTime * 10 ) / 10; | |
| 43 | + | |
| 44 | + if (time !== time_helper) { | |
| 45 | + for (var i = 0; i < _options.buttons.length; i++) | |
| 46 | + _createButton(i, time); | |
| 47 | + | |
| 48 | + time_helper = time; | |
| 49 | + } | |
| 50 | + }, 200); | |
| 51 | + } | |
| 52 | + | |
| 53 | + function _createButton(index, time) { | |
| 54 | + if ((time >= _options.buttons[index].start) && (_options.buttons[index].shown != true)) { | |
| 55 | + _options.buttons[index].shown = true; | |
| 56 | + console.debug("[VLibrasLocalization] showing " + _options.buttons[index]); | |
| 57 | + | |
| 58 | + var image = null; | |
| 59 | + | |
| 60 | + if (_options.buttons[index].clickable === true) { | |
| 61 | + image = $('<a href="#"><img src="' + _options.buttons[index].path + '"></a>'); | |
| 62 | + } else { | |
| 63 | + image = $('<img src="' + _options.buttons[index].path + '">'); | |
| 64 | + } | |
| 65 | + | |
| 66 | + image.attr('id', _options.buttons[index].id); | |
| 67 | + image.data('value', _options.buttons[index].value); | |
| 68 | + image.attr('data-value', _options.buttons[index].value); | |
| 69 | + image.css('position', 'absolute'); | |
| 70 | + image.css('top', _options.buttons[index].y); | |
| 71 | + image.css('left', _options.buttons[index].x); | |
| 72 | + | |
| 73 | + image.hide().appendTo(_video_wrapper).fadeIn(_options.buttons[index].delay); | |
| 74 | + } | |
| 75 | + | |
| 76 | + if ((time >= _options.buttons[index].end) && (_options.buttons[index].hidden != true) && (_options.buttons[index].shown === true)) { | |
| 77 | + console.debug("[VLibrasLocalization] hiding " + _options.buttons[index]); | |
| 78 | + _options.buttons[index].hidden = true; | |
| 79 | + | |
| 80 | + $('#' + _options.buttons[index].id).fadeOut(_options.buttons[index].delay); | |
| 81 | + } | |
| 82 | + } | |
| 83 | + | |
| 84 | + return { | |
| 85 | + init: function(id, optns) { | |
| 86 | + _id = id; | |
| 87 | + _options = optns; | |
| 88 | + | |
| 89 | + _initParams(); | |
| 90 | + _wrapperConfig(); | |
| 91 | + _videoWrapperConfig(); | |
| 92 | + _videoConfig(); | |
| 93 | + _addButtons(); | |
| 94 | + }, | |
| 95 | + | |
| 96 | + play: function() { | |
| 97 | + _video[0].play(); | |
| 98 | + }, | |
| 99 | + | |
| 100 | + stop: function() { | |
| 101 | + _video[0].pause(); | |
| 102 | + } | |
| 103 | + } | |
| 104 | +}; | |
| 0 | 105 | \ No newline at end of file | ... | ... |
| 1 | +++ a/app/assets/javascripts/v_libras/videos/index.js.erb | |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +$(function() { | |
| 2 | + $("a.badge").tooltip(); | |
| 3 | + | |
| 4 | + var dispatcher = new WebSocketRails('191.234.187.152/websocket'); | |
| 5 | + | |
| 6 | + // subscribe to the channel | |
| 7 | + var channel = dispatcher.subscribe('requests_update'); | |
| 8 | + | |
| 9 | + // bind to a channel event | |
| 10 | + // If video is finished, update window on any case | |
| 11 | + channel.bind('callback_called', function(data) { | |
| 12 | + if (data.owner_id === current_user) | |
| 13 | + window.location.href = 'videos'; | |
| 14 | + }); | |
| 15 | + | |
| 16 | + // The other event will only update the window if #modal-wait is closed | |
| 17 | + channel.bind('video_submitted', function(data) { | |
| 18 | + if (! $('#modal-wait').hasClass('in')) { | |
| 19 | + if (data.owner_id === current_user) | |
| 20 | + window.location.href = 'videos'; | |
| 21 | + } | |
| 22 | + }); | |
| 23 | +}); | ... | ... |
| 1 | +++ a/app/assets/stylesheets/active_admin.css.scss | |
| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | +// SASS variable overrides must be declared before loading up Active Admin's styles. | |
| 2 | +// | |
| 3 | +// To view the variables that Active Admin provides, take a look at | |
| 4 | +// `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the | |
| 5 | +// Active Admin source. | |
| 6 | +// | |
| 7 | +// For example, to change the sidebar width: | |
| 8 | +// $sidebar-width: 242px; | |
| 9 | + | |
| 10 | +// Active Admin's got SASS! | |
| 11 | +@import "active_admin/mixins"; | |
| 12 | +@import "active_admin/base"; | |
| 13 | + | |
| 14 | +// Overriding any non-variable SASS must be done after the fact. | |
| 15 | +// For example, to change the default status-tag color: | |
| 16 | +// | |
| 17 | +// .status_tag { background: #6090DB; } | ... | ... |
| 1 | +++ a/app/assets/stylesheets/application.css.scss | |
| ... | ... | @@ -0,0 +1,57 @@ |
| 1 | +/* | |
| 2 | + * This is a manifest file that'll be compiled into application.css, which will include all the files | |
| 3 | + * listed below. | |
| 4 | + * | |
| 5 | + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, | |
| 6 | + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. | |
| 7 | + * | |
| 8 | + * You're free to add application-wide styles to this file and they'll appear at the bottom of the | |
| 9 | + * compiled file so the styles you add here take precedence over styles defined in any styles | |
| 10 | + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new | |
| 11 | + * file per style scope. | |
| 12 | + * | |
| 13 | + *= require 'bootstrap' | |
| 14 | + *= require 'bootstrap_overrides' | |
| 15 | + *= require 'v_libras/videos' | |
| 16 | + *= require 'components/ribbon' | |
| 17 | + *= require 'components/video_player' | |
| 18 | + *= require_self | |
| 19 | + */ | |
| 20 | + | |
| 21 | +.login { | |
| 22 | + padding: 3% 4%; | |
| 23 | + text-align: center; | |
| 24 | + background-color: #68727c; | |
| 25 | + color: #ffffff; | |
| 26 | + | |
| 27 | + -moz-box-shadow: 0 0 1.5px 1.5px #ffffff; | |
| 28 | + -webkit-box-shadow: 0 0 1.5px 1.5px #ffffff; | |
| 29 | + box-shadow: 0 0 1.5px 1.5px #ffffff; | |
| 30 | + | |
| 31 | + h2 { | |
| 32 | + color :#ffffff; | |
| 33 | + text-align: center; | |
| 34 | + margin-bottom: 20px; | |
| 35 | + font-size: 28px; | |
| 36 | + | |
| 37 | + -moz-box-shadow: 0 0 1px 1px #CCC; | |
| 38 | + -webkit-box-shadow: 0 0 1px 1px #CCC; | |
| 39 | + box-shadow: 0 0 1px 1px #CCC; | |
| 40 | + } | |
| 41 | + | |
| 42 | + h3 { | |
| 43 | + text-align:center; | |
| 44 | + color:#ffffff; | |
| 45 | + text-shadow: 1px 1px #AAA; | |
| 46 | + } | |
| 47 | +} | |
| 48 | + | |
| 49 | +.btn-color { | |
| 50 | + background-color: #8a76e7; | |
| 51 | +} | |
| 52 | + | |
| 53 | +#login-video { | |
| 54 | + margin-left: 20%; | |
| 55 | + margin-top: 5%; | |
| 56 | +} | |
| 57 | + | ... | ... |
| 1 | +++ a/app/assets/stylesheets/bootstrap.css.less | |
| ... | ... | @@ -0,0 +1,372 @@ |
| 1 | +@import "twitter/bootstrap/bootstrap"; | |
| 2 | + | |
| 3 | +body { | |
| 4 | + padding-top: 60px; | |
| 5 | +} | |
| 6 | + | |
| 7 | +@import "twitter/bootstrap/responsive"; | |
| 8 | +@import "twitter/bootstrap/sprites"; | |
| 9 | + | |
| 10 | +@iconSpritePath: url("/images/glyphicons-halflings.png"); | |
| 11 | +@iconWhiteSpritePath: url("/images/glyphicons-halflings-white.png"); | |
| 12 | + | |
| 13 | +@navbarBackground: rgb(52, 73, 94); | |
| 14 | +@navbarBackgroundHighlight: rgb(52, 73, 94); | |
| 15 | +@navbarLinkColor: #FFFFFF; | |
| 16 | +@navbarLinkColorHover: #0000000; | |
| 17 | + | |
| 18 | +@linkColor: #888; | |
| 19 | +@linkColorHover: darken(@linkColor, 1%); | |
| 20 | + | |
| 21 | +.auto-margin { | |
| 22 | + margin: auto; | |
| 23 | +} | |
| 24 | + | |
| 25 | +footer { | |
| 26 | + font-size: 15px; | |
| 27 | + margin-top: 20px; | |
| 28 | + background-color: rgba(70, 70, 70, 0.9); | |
| 29 | + color: rgb(221, 221, 221); | |
| 30 | + text-align:center; | |
| 31 | + padding: 2%; | |
| 32 | +} | |
| 33 | + | |
| 34 | +.center_box{ | |
| 35 | + margin-left:10%; | |
| 36 | + width:100%; | |
| 37 | +} | |
| 38 | + | |
| 39 | +.inputs{ width:300px; } | |
| 40 | + | |
| 41 | +/* Red */ | |
| 42 | + | |
| 43 | +.navbar { | |
| 44 | + | |
| 45 | + .brand { | |
| 46 | + font-size: 22px; | |
| 47 | + color:#FFFFFF; | |
| 48 | + } | |
| 49 | + | |
| 50 | + .nav { | |
| 51 | + > li { | |
| 52 | + font-size: 15px; | |
| 53 | + &:focus, &:hover, &:active { | |
| 54 | + background-color: #18BC9C; | |
| 55 | + } | |
| 56 | + } | |
| 57 | + | |
| 58 | + .open { | |
| 59 | + > a, > a:focus, > a:active { | |
| 60 | + &:active, &:focus, &:active { | |
| 61 | + color: #FFFFFF; | |
| 62 | + background-color: #18BC9C; | |
| 63 | + } | |
| 64 | + } | |
| 65 | + } | |
| 66 | + | |
| 67 | + .ul.dropdown-menu, > li { | |
| 68 | + &:active, &:hover, &:focus { | |
| 69 | + background-color: #18BC9C; } | |
| 70 | + } | |
| 71 | + } | |
| 72 | +} | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | +.video{ | |
| 77 | + width:auto; | |
| 78 | + padding-left:220px; | |
| 79 | +} | |
| 80 | + | |
| 81 | +.left{ | |
| 82 | + padding:0px; | |
| 83 | + float:left; | |
| 84 | + width:480px; | |
| 85 | + height:400px; | |
| 86 | + | |
| 87 | +} | |
| 88 | + | |
| 89 | +.center{ | |
| 90 | + text-align:center; | |
| 91 | +} | |
| 92 | + | |
| 93 | +.attention{ | |
| 94 | + background:#FFF; | |
| 95 | + color:#0000FF; | |
| 96 | + padding:0.4%; | |
| 97 | +} | |
| 98 | + | |
| 99 | +.attention:hover{ | |
| 100 | + background:#000; | |
| 101 | + color:#FFF; | |
| 102 | +} | |
| 103 | + | |
| 104 | +.error{ | |
| 105 | + background:#A60707; | |
| 106 | + width:100%; | |
| 107 | + padding:0.4%; | |
| 108 | + color:#FFF; | |
| 109 | + text-decoration:none; | |
| 110 | + -moz-box-shadow: 0 0 5px 5px #CCC; | |
| 111 | + -webkit-box-shadow: 0 0 5px 5px #CCC; | |
| 112 | + box-shadow: 0 0 5px 5px #CCC; | |
| 113 | + text-align:center; | |
| 114 | +} | |
| 115 | + | |
| 116 | +.bold{ | |
| 117 | + font-weight:bold; | |
| 118 | + font-size:15px; | |
| 119 | +} | |
| 120 | + | |
| 121 | +.field{ | |
| 122 | + margin-bottom:20px; | |
| 123 | +} | |
| 124 | + | |
| 125 | +.horizontal-form{ | |
| 126 | + padding-top:20px; | |
| 127 | +} | |
| 128 | + | |
| 129 | +.actions{ | |
| 130 | + margin-top:10px; | |
| 131 | +} | |
| 132 | + | |
| 133 | +.radio { | |
| 134 | + font-size:15px; | |
| 135 | +} | |
| 136 | + | |
| 137 | +label { | |
| 138 | + font-size:18px; | |
| 139 | +} | |
| 140 | + | |
| 141 | +.upload{ | |
| 142 | + margin-top:10px; | |
| 143 | + background-color:#DDD; | |
| 144 | + height:100px; | |
| 145 | + color:#000; | |
| 146 | + text-align: center; | |
| 147 | + | |
| 148 | + -moz-box-shadow: 0 0 1px 1px #888; | |
| 149 | + -webkit-box-shadow: 0 0 1px 1px #888; | |
| 150 | + box-shadow: 0 0 1px 1px #888; | |
| 151 | +} | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | +input { | |
| 158 | + display: inline-block; | |
| 159 | + *display: inline; | |
| 160 | + padding: 0px; | |
| 161 | + margin-bottom: 0; | |
| 162 | + *margin-left: .3em; | |
| 163 | + font-size: 14px; | |
| 164 | + line-height: 20px; | |
| 165 | + *line-height: 20px; | |
| 166 | + color: #333333; | |
| 167 | + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); | |
| 168 | + vertical-align: middle; | |
| 169 | + cursor: pointer; | |
| 170 | + background-color: #DDD; | |
| 171 | + *background-color: #e6e6e6; | |
| 172 | + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); | |
| 173 | + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); | |
| 174 | + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); | |
| 175 | + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); | |
| 176 | + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); | |
| 177 | + background-repeat: repeat-x; | |
| 178 | + border: 1px solid #bbbbbb; | |
| 179 | + border: 0; | |
| 180 | + border-color: #e6e6e6 #e6e6e6 #bfbfbf; | |
| 181 | + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); | |
| 182 | + border-bottom-color: #DDDDDD; | |
| 183 | + -webkit-border-radius: 4px; | |
| 184 | + -moz-border-radius: 4px; | |
| 185 | + border-radius: 4px; | |
| 186 | + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); | |
| 187 | + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); | |
| 188 | + zoom: 1; | |
| 189 | + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); | |
| 190 | + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); | |
| 191 | + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); | |
| 192 | + | |
| 193 | + | |
| 194 | +} | |
| 195 | + | |
| 196 | +button, | |
| 197 | +input, | |
| 198 | +select, | |
| 199 | +textarea { | |
| 200 | + margin: 0; | |
| 201 | + font-size: 100%; | |
| 202 | + vertical-align: middle; | |
| 203 | +} | |
| 204 | + | |
| 205 | +button, | |
| 206 | +input { | |
| 207 | + *overflow: visible; | |
| 208 | + line-height: normal; | |
| 209 | +} | |
| 210 | + | |
| 211 | +button::-moz-focus-inner, | |
| 212 | +input::-moz-focus-inner { | |
| 213 | + padding: 0; | |
| 214 | + border: 0; | |
| 215 | +} | |
| 216 | + | |
| 217 | +button, | |
| 218 | +html input[type="button"], | |
| 219 | +input[type="reset"], | |
| 220 | +input[type="submit"] { | |
| 221 | + cursor: pointer; | |
| 222 | + -webkit-appearance: button; | |
| 223 | +} | |
| 224 | + | |
| 225 | +label, | |
| 226 | +input, | |
| 227 | +button, | |
| 228 | +select, | |
| 229 | +textarea { | |
| 230 | + font-size: 14px; | |
| 231 | + font-weight: normal; | |
| 232 | + line-height: 20px; | |
| 233 | +} | |
| 234 | + | |
| 235 | +input, | |
| 236 | +button, | |
| 237 | +select, | |
| 238 | +textarea { | |
| 239 | + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
| 240 | +} | |
| 241 | + | |
| 242 | +label { | |
| 243 | + display: block; | |
| 244 | + margin-bottom: 5px; | |
| 245 | +} | |
| 246 | + | |
| 247 | +select, | |
| 248 | +textarea, | |
| 249 | +input[type="text"], | |
| 250 | +input[type="password"], | |
| 251 | +input[type="datetime"], | |
| 252 | +input[type="datetime-local"], | |
| 253 | +input[type="date"], | |
| 254 | +input[type="month"], | |
| 255 | +input[type="time"], | |
| 256 | +input[type="week"], | |
| 257 | +input[type="number"], | |
| 258 | +input[type="email"], | |
| 259 | +input[type="url"], | |
| 260 | +input[type="search"], | |
| 261 | +input[type="tel"], | |
| 262 | +input[type="color"], | |
| 263 | +.uneditable-input { | |
| 264 | + display: inline-block; | |
| 265 | + height: 20px; | |
| 266 | + padding: 4px 6px; | |
| 267 | + margin-bottom: 10px; | |
| 268 | + font-size: 14px; | |
| 269 | + line-height: 20px; | |
| 270 | + color: #555555; | |
| 271 | + vertical-align: middle; | |
| 272 | + -webkit-border-radius: 4px; | |
| 273 | + -moz-border-radius: 4px; | |
| 274 | + border-radius: 4px; | |
| 275 | +} | |
| 276 | + | |
| 277 | +input, | |
| 278 | +textarea, | |
| 279 | +.uneditable-input { | |
| 280 | + width: 206px; | |
| 281 | +} | |
| 282 | + | |
| 283 | +textarea { | |
| 284 | + height: auto; | |
| 285 | +} | |
| 286 | + | |
| 287 | +textarea, | |
| 288 | +input[type="text"], | |
| 289 | +input[type="password"], | |
| 290 | +input[type="datetime"], | |
| 291 | +input[type="datetime-local"], | |
| 292 | +input[type="date"], | |
| 293 | +input[type="month"], | |
| 294 | +input[type="time"], | |
| 295 | +input[type="week"], | |
| 296 | +input[type="number"], | |
| 297 | +input[type="email"], | |
| 298 | +input[type="url"], | |
| 299 | +input[type="search"], | |
| 300 | +input[type="tel"], | |
| 301 | +input[type="color"], | |
| 302 | +.uneditable-input { | |
| 303 | + background-color: #ffffff; | |
| 304 | + border: 1px solid #cccccc; | |
| 305 | + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); | |
| 306 | + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); | |
| 307 | + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); | |
| 308 | + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; | |
| 309 | + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; | |
| 310 | + -o-transition: border linear 0.2s, box-shadow linear 0.2s; | |
| 311 | + transition: border linear 0.2s, box-shadow linear 0.2s; | |
| 312 | +} | |
| 313 | + | |
| 314 | +textarea:focus, | |
| 315 | +input[type="text"]:focus, | |
| 316 | +input[type="password"]:focus, | |
| 317 | +input[type="datetime"]:focus, | |
| 318 | +input[type="datetime-local"]:focus, | |
| 319 | +input[type="date"]:focus, | |
| 320 | +input[type="month"]:focus, | |
| 321 | +input[type="time"]:focus, | |
| 322 | +input[type="week"]:focus, | |
| 323 | +input[type="number"]:focus, | |
| 324 | +input[type="email"]:focus, | |
| 325 | +input[type="url"]:focus, | |
| 326 | +input[type="search"]:focus, | |
| 327 | +input[type="tel"]:focus, | |
| 328 | +input[type="color"]:focus, | |
| 329 | +.uneditable-input:focus { | |
| 330 | + border-color: #f56a30; | |
| 331 | + outline: 0; | |
| 332 | + outline: thin dotted 9; | |
| 333 | + /* IE6-9 */ | |
| 334 | + | |
| 335 | + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px #DDDDDD; | |
| 336 | + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px #DDDDDD; | |
| 337 | + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px #DDDDDD; | |
| 338 | +} | |
| 339 | + | |
| 340 | +input[type="radio"], | |
| 341 | +input[type="checkbox"] { | |
| 342 | + margin: 4px 0 0; | |
| 343 | + margin-top: 1px 9; | |
| 344 | + *margin-top: 0; | |
| 345 | + line-height: normal; | |
| 346 | + cursor: pointer; | |
| 347 | +} | |
| 348 | + | |
| 349 | +input[type="file"], | |
| 350 | +input[type="image"], | |
| 351 | +input[type="submit"], | |
| 352 | +input[type="reset"], | |
| 353 | +input[type="button"], | |
| 354 | +input[type="radio"], | |
| 355 | +input[type="checkbox"] { | |
| 356 | + width: auto; | |
| 357 | +} | |
| 358 | + | |
| 359 | +input[type="file"] { | |
| 360 | + width: 100%; | |
| 361 | +} | |
| 362 | + | |
| 363 | +select, | |
| 364 | +input[type="file"] { | |
| 365 | + height: 30px; | |
| 366 | + /* In IE7, the height of the select element cannot be changed by height, only font-size */ | |
| 367 | + | |
| 368 | + *margin-top: 4px; | |
| 369 | + /* For IE7, add top margin to align select with labels */ | |
| 370 | + | |
| 371 | + line-height: 30px; | |
| 372 | +} | ... | ... |
| 1 | +++ a/app/assets/stylesheets/bootstrap_overrides.css.scss | |
| ... | ... | @@ -0,0 +1,93 @@ |
| 1 | +.container-fluid { | |
| 2 | + max-width: 1024px; | |
| 3 | + margin: auto; | |
| 4 | +} | |
| 5 | + | |
| 6 | +body { | |
| 7 | + background: -webkit-linear-gradient(left, #92bbe5, #ddeeff, #92bbe5); | |
| 8 | + background: -o-linear-gradient(left, #92bbe5, #ddeeff, #92bbe5); | |
| 9 | + background: -moz-linear-gradient(left, #92bbe5, #ddeeff, #92bbe5); | |
| 10 | +} | |
| 11 | + | |
| 12 | + | |
| 13 | +.breadcrumb { | |
| 14 | + padding: 7px 14px; | |
| 15 | + margin: 0 0 18px; | |
| 16 | + background-color: #fbfbfb; | |
| 17 | + background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5); | |
| 18 | + background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5); | |
| 19 | + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5)); | |
| 20 | + background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); | |
| 21 | + background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); | |
| 22 | + background-image: linear-gradient(top, #ffffff, #f5f5f5); | |
| 23 | + background-repeat: repeat-x; | |
| 24 | + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0); | |
| 25 | + background-color: #fbfbfb; | |
| 26 | + background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5); | |
| 27 | + background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5); | |
| 28 | + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5)); | |
| 29 | + background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); | |
| 30 | + background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); | |
| 31 | + background-image: linear-gradient(top, #ffffff, #f5f5f5); | |
| 32 | + background-repeat: repeat-x; | |
| 33 | + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0); | |
| 34 | + border: 1px solid #ddd; | |
| 35 | + -webkit-border-radius: 3px; | |
| 36 | + -moz-border-radius: 3px; | |
| 37 | + border-radius: 3px; | |
| 38 | + -webkit-border-radius: 3px; | |
| 39 | + -moz-border-radius: 3px; | |
| 40 | + border-radius: 3px; | |
| 41 | + -webkit-box-shadow: inset 0 1px 0 #ffffff; | |
| 42 | + -moz-box-shadow: inset 0 1px 0 #ffffff; | |
| 43 | + box-shadow: inset 0 1px 0 #ffffff; | |
| 44 | + -webkit-box-shadow: inset 0 1px 0 #ffffff; | |
| 45 | + -moz-box-shadow: inset 0 1px 0 #ffffff; | |
| 46 | + box-shadow: inset 0 1px 0 #ffffff; | |
| 47 | +} | |
| 48 | +.breadcrumb li { | |
| 49 | + display: inline-block; | |
| 50 | + text-shadow: 0 1px 0 #ffffff; | |
| 51 | +} | |
| 52 | +.breadcrumb .divider { | |
| 53 | + padding: 0 5px; | |
| 54 | + color: #999999; | |
| 55 | +} | |
| 56 | +.breadcrumb .active a { | |
| 57 | + color: #333333; | |
| 58 | +} | |
| 59 | + | |
| 60 | +.well { | |
| 61 | + overflow: auto; | |
| 62 | +} | |
| 63 | + | |
| 64 | +.fileinput-button { | |
| 65 | + position: relative; | |
| 66 | + overflow: hidden; | |
| 67 | +} | |
| 68 | + | |
| 69 | +.fileinput-button input { | |
| 70 | + background-color: #8a76e7; | |
| 71 | + position: absolute; | |
| 72 | + top: 0; | |
| 73 | + right: 0; | |
| 74 | + margin: 0; | |
| 75 | + opacity: 0; | |
| 76 | + -ms-filter: 'alpha(opacity=0)'; | |
| 77 | + font-size: 200px; | |
| 78 | + direction: ltr; | |
| 79 | + cursor: pointer; | |
| 80 | +} | |
| 81 | + | |
| 82 | +/* Fix menu */ | |
| 83 | +@media (max-width: 767px) { | |
| 84 | + .nav-collapse.user-menu { | |
| 85 | + float: left; | |
| 86 | + } | |
| 87 | +} | |
| 88 | + | |
| 89 | +@media (max-width: 980px) { | |
| 90 | + .dropdown ul.dropdown-menu { | |
| 91 | + display: block; | |
| 92 | + } | |
| 93 | +} | ... | ... |
| 1 | +++ a/app/assets/stylesheets/components/ribbon.css.scss | |
| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | +$ribbonUpperColor: #2A632B; | |
| 2 | +$ribbonBottomColor: #6D972D; | |
| 3 | + | |
| 4 | +.ribbon-wrapper-green { | |
| 5 | + margin: 10px auto; | |
| 6 | + width: 205px; | |
| 7 | + height: 165px; | |
| 8 | + overflow: hidden; | |
| 9 | + top: -3px; | |
| 10 | + right: -3px; | |
| 11 | + | |
| 12 | + padding-top: 3px; | |
| 13 | +} | |
| 14 | + | |
| 15 | +.ribbon-content img { | |
| 16 | + border-radius: 30px; | |
| 17 | + -webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3); | |
| 18 | + -moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3); | |
| 19 | + box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3); | |
| 20 | + | |
| 21 | + width: 200px; | |
| 22 | + height: 160px; | |
| 23 | +} | |
| 24 | + | |
| 25 | +.ribbon-green { | |
| 26 | + font: bold 15px Sans-Serif; | |
| 27 | + color: #fff; | |
| 28 | + text-align: center; | |
| 29 | + text-shadow: rgba(0, 0, 0, 1) 0px 1px 0px; | |
| 30 | + -webkit-transform: rotate(45deg); | |
| 31 | + -moz-transform: rotate(45deg); | |
| 32 | + -ms-transform: rotate(45deg); | |
| 33 | + -o-transform: rotate(45deg); | |
| 34 | + position: relative; | |
| 35 | + padding: 5px 0; | |
| 36 | + left: 122px; | |
| 37 | + bottom: 148px; | |
| 38 | + width: 110px; | |
| 39 | + | |
| 40 | + background-color: #BFDC7A; | |
| 41 | + background-image: -webkit-gradient(linear, left top, left bottom, from($ribbonUpperColor), to($ribbonBottomColor)); | |
| 42 | + background-image: -webkit-linear-gradient(top, $ribbonUpperColor, $ribbonBottomColor); | |
| 43 | + background-image: -moz-linear-gradient(top, $ribbonUpperColor, $ribbonBottomColor); | |
| 44 | + background-image: -ms-linear-gradient(top, $ribbonUpperColor, $ribbonBottomColor); | |
| 45 | + background-image: -o-linear-gradient(top, $ribbonUpperColor, $ribbonBottomColor); | |
| 46 | + -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.3); | |
| 47 | + -moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.3); | |
| 48 | + box-shadow: 0px 0px 3px rgba(0,0,0,0.3); | |
| 49 | +} | |
| 50 | + | |
| 51 | +.ribbon-green:before, .ribbon-green:after { | |
| 52 | + content: ""; | |
| 53 | + border-top: 3px solid #6e8900; | |
| 54 | + border-left: 3px solid transparent; | |
| 55 | + border-right: 3px solid transparent; | |
| 56 | + position:absolute; | |
| 57 | + bottom: -3px; | |
| 58 | +} | |
| 59 | + | |
| 60 | +.ribbon-green:before { | |
| 61 | + left: 0; | |
| 62 | +} | |
| 63 | +.ribbon-green:after { | |
| 64 | + right: 0; | |
| 65 | +} | |
| 0 | 66 | \ No newline at end of file | ... | ... |
| 1 | +++ a/app/assets/stylesheets/components/video_player.css.scss | |
| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | +.video-instructions { | |
| 2 | + display: block; | |
| 3 | + width: 69.4%; | |
| 4 | + | |
| 5 | + -moz-box-shadow: 0 0 5px 5px #888; | |
| 6 | + -webkit-box-shadow: 0 0 5px 5px #888; | |
| 7 | + box-shadow: 0 0 5px 5px #888; | |
| 8 | +} | |
| 9 | + | |
| 10 | +.video-wizard { | |
| 11 | + max-width: 100%; | |
| 12 | + margin-bottom: 20px; | |
| 13 | + background-color: inherit !important; | |
| 14 | +} | |
| 15 | + | |
| 16 | +.video-vlibras { | |
| 17 | + max-width: 50%; | |
| 18 | + margin: auto; | |
| 19 | +} | |
| 20 | + | |
| 21 | +.video-js { padding-top: 52% } | |
| 22 | +.vjs-fullscreen { padding-top: 0px } | |
| 23 | + | |
| 24 | +#vlibras-wizard { | |
| 25 | + .video-js { padding-top: 0px !important; } | |
| 26 | +} | ... | ... |
| 1 | +++ a/app/assets/stylesheets/v_libras/requests.css.scss | |
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +#vlibras-wizard { | |
| 2 | + #b1_size_big, #b2_size_big, #b1_size_med, #b2_size_med, #b1_size_small, #b2_size_small { | |
| 3 | + opacity: 0.4; | |
| 4 | + | |
| 5 | + &:hover { | |
| 6 | + opacity: 1; | |
| 7 | + } | |
| 8 | + } | |
| 9 | + | |
| 10 | + #b1_size_big, #b2_size_big { | |
| 11 | + width: 350px; | |
| 12 | + img { width: 350px; } | |
| 13 | + z-index: 1; | |
| 14 | + } | |
| 15 | + | |
| 16 | + #b1_size_med, #b2_size_med { | |
| 17 | + width: 280px; | |
| 18 | + img { width: 280px; } | |
| 19 | + z-index: 2; | |
| 20 | + } | |
| 21 | + | |
| 22 | + #b1_size_small, #b2_size_small { | |
| 23 | + width: 220px; | |
| 24 | + img { width: 220px; } | |
| 25 | + z-index: 3; | |
| 26 | + } | |
| 27 | + | |
| 28 | + .actions { | |
| 29 | + display: none; | |
| 30 | + } | |
| 31 | + | |
| 32 | + img { | |
| 33 | + border: 0; | |
| 34 | + } | |
| 35 | + | |
| 36 | + .wrapper { | |
| 37 | + margin: 0 auto; | |
| 38 | + } | |
| 39 | + | |
| 40 | + label { | |
| 41 | + line-height: 32px; | |
| 42 | + } | |
| 43 | +} | |
| 0 | 44 | \ No newline at end of file | ... | ... |
| 1 | +++ a/app/assets/stylesheets/v_libras/videos.css.scss | |
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +.breadcrumb.requests { | |
| 2 | + margin-top: 20px; | |
| 3 | + clear: both; | |
| 4 | +} | |
| 5 | + | |
| 6 | +.table-requests td, .table-requests th { | |
| 7 | + text-align: center; | |
| 8 | +} | |
| 9 | + | |
| 10 | +.table-requests .label { | |
| 11 | + text-transform: lowercase; | |
| 12 | +} | |
| 13 | + | |
| 14 | +.videos-row { | |
| 15 | + margin: 20px 0px; | |
| 16 | +} | |
| 0 | 17 | \ No newline at end of file | ... | ... |
| 1 | +++ a/app/controllers/application_controller.rb | |
| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +class ApplicationController < ActionController::Base | |
| 3 | + # Prevent CSRF attacks by raising an exception. | |
| 4 | + # For APIs, you may want to use :null_session instead. | |
| 5 | + protect_from_forgery with: :exception | |
| 6 | + | |
| 7 | + before_action :configure_permitted_parameters, if: :devise_controller? | |
| 8 | + | |
| 9 | +protected | |
| 10 | + def check_vlibras_api_status | |
| 11 | + unless ApiClient.check_status | |
| 12 | + flash[:error] = t('error.api.offline') | |
| 13 | + end | |
| 14 | + end | |
| 15 | + | |
| 16 | + def configure_permitted_parameters | |
| 17 | + devise_parameter_sanitizer.for(:sign_up) << [ :name, :email, :password, :password_confirmation, :address, :zipcode, :phone ] | |
| 18 | + end | |
| 19 | + | |
| 20 | +end | ... | ... |
| 1 | +++ a/app/controllers/concerns/.keep | ... | ... |
| 1 | +++ a/app/controllers/v_libras/requests_controller.rb | |
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +class VLibras::RequestsController < ApplicationController | |
| 3 | + protect_from_forgery with: :null_session, :only => [ :callback ] | |
| 4 | + | |
| 5 | + before_filter :authenticate_user!, :except => [ :callback ] | |
| 6 | + before_filter :check_vlibras_api_status, :except => [ :callback ] | |
| 7 | + | |
| 8 | + def rapid | |
| 9 | + @request = VLibras::Request.new | |
| 10 | + end | |
| 11 | + | |
| 12 | + def new | |
| 13 | + | |
| 14 | + end | |
| 15 | + | |
| 16 | + def create | |
| 17 | + @request = VLibras::Request.build_from_params(params, current_user) | |
| 18 | + | |
| 19 | + if @request.save | |
| 20 | + @request.perform_request(@request.files) | |
| 21 | + p 'rerouitsme1' | |
| 22 | + | |
| 23 | + flash[:success] = 'Sua requisição foi submetida com sucesso!' | |
| 24 | + | |
| 25 | + render json: { status: 'ok', redirect_to: v_libras_videos_path('video-wait' => true)}, status: 200 | |
| 26 | + else | |
| 27 | + flash[:error] = 'Algo deu errado com a sua requisição. Por favor verifique opções escolhidas.' | |
| 28 | + flash[:warning] = @request.errors.full_messages.to_sentence.humanize | |
| 29 | + | |
| 30 | + # Warning: this code is also present on #perform_request, if the request is successfully done | |
| 31 | + @request.files.values.each { |f| f.file.delete } | |
| 32 | + | |
| 33 | + # same as redirect :back | |
| 34 | + render json: { status: 'error', redirect_to: request.headers["Referer"]}, status: 400 | |
| 35 | + end | |
| 36 | + end | |
| 37 | + | |
| 38 | + def callback | |
| 39 | + ApiClient::CallbackProcessor.process(params) | |
| 40 | + | |
| 41 | + render :text => "OK!" | |
| 42 | + end | |
| 43 | +end | ... | ... |
| 1 | +++ a/app/controllers/v_libras/videos_controller.rb | |
| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +class VLibras::VideosController < InheritedResources::Base | |
| 3 | + actions :show, :destroy | |
| 4 | + | |
| 5 | + before_filter :check_vlibras_api_status, :only => [ :index, :show ] | |
| 6 | + before_filter :authenticate_user! | |
| 7 | + | |
| 8 | + before_filter :mark_as_seen!, :only => [ :show ] | |
| 9 | + | |
| 10 | + def index | |
| 11 | + @videos = current_user.videos.page(params[:page]).per(9) | |
| 12 | + @requests = current_user.requests.limit(6) | |
| 13 | + end | |
| 14 | + | |
| 15 | +protected | |
| 16 | + def mark_as_seen! | |
| 17 | + @video = VLibras::Video.find(params[:id]) | |
| 18 | + @video.mark_as_seen! | |
| 19 | + end | |
| 20 | +end | ... | ... |
| 1 | +++ a/app/helpers/application_helper.rb | |
| ... | ... | @@ -0,0 +1,87 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +module ApplicationHelper | |
| 3 | + | |
| 4 | + def display_base_errors resource | |
| 5 | + return '' if (resource.errors.empty?) or (resource.errors[:base].empty?) | |
| 6 | + messages = resource.errors[:base].map { |msg| content_tag(:p, msg) }.join | |
| 7 | + html = <<-HTML | |
| 8 | + <div class="alert alert-error alert-block"> | |
| 9 | + <button type="button" class="close" data-dismiss="alert">×</button> | |
| 10 | + #{messages} | |
| 11 | + </div> | |
| 12 | + HTML | |
| 13 | + html.html_safe | |
| 14 | + end | |
| 15 | + | |
| 16 | + def bootstrap_class_for(flash_type) | |
| 17 | + case flash_type.to_s | |
| 18 | + when "success" | |
| 19 | + "alert-success" # Green | |
| 20 | + when "error" | |
| 21 | + "alert-danger" # Red | |
| 22 | + when "alert" | |
| 23 | + "alert-warning" # Yellow | |
| 24 | + when "notice" | |
| 25 | + "alert-info" # Blue | |
| 26 | + else | |
| 27 | + flash_type | |
| 28 | + end | |
| 29 | + end | |
| 30 | + | |
| 31 | + def request_status_label(request) | |
| 32 | + classes = [ 'badge' ] | |
| 33 | + | |
| 34 | + status = request.status | |
| 35 | + | |
| 36 | + case status | |
| 37 | + when 'created' | |
| 38 | + when 'processing' | |
| 39 | + classes << 'badge-warning' | |
| 40 | + when 'error' | |
| 41 | + classes << 'badge-important' | |
| 42 | + when 'success' | |
| 43 | + classes << 'badge-success' | |
| 44 | + end | |
| 45 | + | |
| 46 | + content_tag(:a, t(status, scope: 'status'), :class => classes, | |
| 47 | + :data => { 'toggle' => "tooltip" }, :title => request.response) | |
| 48 | + end | |
| 49 | + | |
| 50 | + def html5_video_tag(url, id, classes, data_options = nil, *args) | |
| 51 | + options = args.first || {} | |
| 52 | + | |
| 53 | + options[:id] = id | |
| 54 | + options[:class] = "video-js vjs-default-skin vjs-big-play-centered #{classes}" | |
| 55 | + options[:width] = 'auto' | |
| 56 | + options[:height] = 'auto' | |
| 57 | + options['data-setup'] = data_options if data_options != nil | |
| 58 | + | |
| 59 | + content_tag(:video, options) do | |
| 60 | + if url.class == String | |
| 61 | + content_tag(:source, '', :src => (url + "?t=" + Time.now.getutc.to_i.to_s), :type => mimetype_from_url(url)) | |
| 62 | + else | |
| 63 | + url.each do |v| | |
| 64 | + concat content_tag(:source, '', :src => (v + "?t=" + Time.now.getutc.to_i.to_s), :type => mimetype_from_url(v)) | |
| 65 | + end | |
| 66 | + end | |
| 67 | + end | |
| 68 | + end | |
| 69 | + | |
| 70 | + def mimetype_from_url(url) | |
| 71 | + return 'video/mp4' if url.split('.').last == 'mp4' | |
| 72 | + return 'video/webm' if url.split('.').last == 'webm' | |
| 73 | + | |
| 74 | + 'video/mp4' | |
| 75 | + end | |
| 76 | + | |
| 77 | + def include_videojs_assets | |
| 78 | + content_for(:css) do | |
| 79 | + stylesheet_link_tag "http://vjs.zencdn.net/4.6/video-js.css" | |
| 80 | + end | |
| 81 | + | |
| 82 | + content_for(:js) do | |
| 83 | + javascript_include_tag "http://vjs.zencdn.net/4.6/video.js" | |
| 84 | + end | |
| 85 | + end | |
| 86 | + | |
| 87 | +end | ... | ... |
| 1 | +++ a/app/models/ability.rb | |
| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +class Ability | |
| 3 | + include CanCan::Ability | |
| 4 | + | |
| 5 | + def initialize(user) | |
| 6 | + | |
| 7 | + user ||= User.new | |
| 8 | + | |
| 9 | + if user.is_admin? | |
| 10 | + can :manage, :all | |
| 11 | + end | |
| 12 | + | |
| 13 | + if user.id | |
| 14 | + can :manage, ActiveAdmin::Page, name: 'Dashboard' | |
| 15 | + end | |
| 16 | + | |
| 17 | + # Define abilities for the passed in user here. For example: | |
| 18 | + # | |
| 19 | + # user ||= User.new # guest user (not logged in) | |
| 20 | + # if user.admin? | |
| 21 | + # can :manage, :all | |
| 22 | + # else | |
| 23 | + # can :read, :all | |
| 24 | + # end | |
| 25 | + # | |
| 26 | + # The first argument to `can` is the action you are giving the user | |
| 27 | + # permission to do. | |
| 28 | + # If you pass :manage it will apply to every action. Other common actions | |
| 29 | + # here are :read, :create, :update and :destroy. | |
| 30 | + # | |
| 31 | + # The second argument is the resource the user can perform the action on. | |
| 32 | + # If you pass :all it will apply to every resource. Otherwise pass a Ruby | |
| 33 | + # class of the resource. | |
| 34 | + # | |
| 35 | + # The third argument is an optional hash of conditions to further filter the | |
| 36 | + # objects. | |
| 37 | + # For example, here the user can only update published articles. | |
| 38 | + # | |
| 39 | + # can :update, Article, :published => true | |
| 40 | + # | |
| 41 | + # See the wiki for details: | |
| 42 | + # https://github.com/ryanb/cancan/wiki/Defining-Abilities | |
| 43 | + end | |
| 44 | +end | ... | ... |
| 1 | +++ a/app/models/concerns/.keep | ... | ... |
| 1 | +++ a/app/models/role.rb | |
| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +# == Schema Information | |
| 3 | +# | |
| 4 | +# Table name: roles | |
| 5 | +# | |
| 6 | +# id :integer not null, primary key | |
| 7 | +# name :string(255) | |
| 8 | +# resource_id :integer | |
| 9 | +# resource_type :string(255) | |
| 10 | +# created_at :datetime | |
| 11 | +# updated_at :datetime | |
| 12 | +# | |
| 13 | +# Indexes | |
| 14 | +# | |
| 15 | +# index_roles_on_name (name) | |
| 16 | +# index_roles_on_name_and_resource_type_and_resource_id (name,resource_type,resource_id) | |
| 17 | +# | |
| 18 | + | |
| 19 | +class Role < ActiveRecord::Base | |
| 20 | + has_and_belongs_to_many :users, :join_table => :users_roles | |
| 21 | + belongs_to :resource, :polymorphic => true | |
| 22 | + | |
| 23 | + scopify | |
| 24 | +end | ... | ... |
| 1 | +++ a/app/models/user.rb | |
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +# == Schema Information | |
| 3 | +# | |
| 4 | +# Table name: users | |
| 5 | +# | |
| 6 | +# id :integer not null, primary key | |
| 7 | +# name :string(255) | |
| 8 | +# email :string(255) default(""), not null | |
| 9 | +# encrypted_password :string(255) default(""), not null | |
| 10 | +# reset_password_token :string(255) | |
| 11 | +# reset_password_sent_at :datetime | |
| 12 | +# remember_created_at :datetime | |
| 13 | +# sign_in_count :integer default(0), not null | |
| 14 | +# current_sign_in_at :datetime | |
| 15 | +# last_sign_in_at :datetime | |
| 16 | +# current_sign_in_ip :string(255) | |
| 17 | +# last_sign_in_ip :string(255) | |
| 18 | +# created_at :datetime | |
| 19 | +# updated_at :datetime | |
| 20 | +# address :text | |
| 21 | +# zipcode :string(255) | |
| 22 | +# phone :string(255) | |
| 23 | +# | |
| 24 | +# Indexes | |
| 25 | +# | |
| 26 | +# index_users_on_email (email) UNIQUE | |
| 27 | +# index_users_on_reset_password_token (reset_password_token) UNIQUE | |
| 28 | +# | |
| 29 | + | |
| 30 | +class User < ActiveRecord::Base | |
| 31 | + rolify | |
| 32 | + | |
| 33 | + has_many :requests, :class => VLibras::Request, :foreign_key => :owner_id | |
| 34 | + has_many :videos, :through => :requests, :class => VLibras::Video | |
| 35 | + | |
| 36 | + validates :name, :presence => true | |
| 37 | + | |
| 38 | + # Include default devise modules. Others available are: | |
| 39 | + # :confirmable, :lockable, :timeoutable and :omniauthable | |
| 40 | + devise :database_authenticatable, | |
| 41 | + :recoverable, :rememberable, :trackable, :validatable, | |
| 42 | + :registerable | |
| 43 | +end | ... | ... |
| 1 | +++ a/app/models/v_libras/request.rb | |
| ... | ... | @@ -0,0 +1,93 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +# == Schema Information | |
| 3 | +# | |
| 4 | +# Table name: v_libras_requests | |
| 5 | +# | |
| 6 | +# id :integer not null, primary key | |
| 7 | +# status :string(255) | |
| 8 | +# service_type :string(255) | |
| 9 | +# owner_id :integer | |
| 10 | +# params :text | |
| 11 | +# response :text | |
| 12 | +# created_at :datetime | |
| 13 | +# updated_at :datetime | |
| 14 | +# video_filename :string(255) | |
| 15 | +# | |
| 16 | + | |
| 17 | +class VLibras::Request < ActiveRecord::Base | |
| 18 | + serialize :params | |
| 19 | + attr_accessor :files | |
| 20 | + | |
| 21 | + belongs_to :owner, :class => User | |
| 22 | + | |
| 23 | + has_one :video, :class => VLibras::Video, :dependent => :destroy | |
| 24 | + | |
| 25 | + validates :service_type, | |
| 26 | + presence: true, | |
| 27 | + inclusion: { in: %w(video-legenda video) } | |
| 28 | + | |
| 29 | + validates :status, | |
| 30 | + presence: true, | |
| 31 | + inclusion: { in: %w(created processing error success) } | |
| 32 | + | |
| 33 | + validate :match_files_with_service_type | |
| 34 | + | |
| 35 | + before_validation :default_values | |
| 36 | + | |
| 37 | + default_scope { order('created_at DESC') } | |
| 38 | + | |
| 39 | + def self.build_from_params(params, user) | |
| 40 | + request = self.new | |
| 41 | + | |
| 42 | + request.service_type = params[:service] | |
| 43 | + request.owner = user | |
| 44 | + | |
| 45 | + request.files = {} | |
| 46 | + | |
| 47 | + if params[:video] | |
| 48 | + request.video_filename = params[:video].original_filename | |
| 49 | + video = FileUploader.new | |
| 50 | + video.cache!(params[:video]) | |
| 51 | + request.files.merge!(:video => video) | |
| 52 | + end | |
| 53 | + | |
| 54 | + if params[:subtitle] | |
| 55 | + subtitle = FileUploader.new | |
| 56 | + subtitle.cache!(params[:subtitle]) | |
| 57 | + request.files.merge!(:subtitle => subtitle) | |
| 58 | + end | |
| 59 | + | |
| 60 | + request.params = params[:params] | |
| 61 | + | |
| 62 | + request | |
| 63 | + end | |
| 64 | + | |
| 65 | + def perform_request(files) | |
| 66 | + logger.debug '[VLibras::Request] Starting request' | |
| 67 | + self.update!(status: 'processing') | |
| 68 | + | |
| 69 | + ApiClient::Client.submit(self, files) | |
| 70 | + | |
| 71 | + # Warning: this code is also present on the controller, if there is an error | |
| 72 | + files.values.each { |f| f.file.delete } | |
| 73 | + | |
| 74 | + logger.debug '[VLibras::Request] Request done' | |
| 75 | + end | |
| 76 | + | |
| 77 | +private | |
| 78 | + def match_files_with_service_type | |
| 79 | + return unless files | |
| 80 | + | |
| 81 | + if files[:video].nil? | |
| 82 | + errors.add(:base, 'Você precisa enviar um vídeo.') | |
| 83 | + end | |
| 84 | + | |
| 85 | + if (service_type == 'video-legenda') && files[:subtitle].nil? | |
| 86 | + errors.add(:base, 'Você precisa enviar uma legenda.') | |
| 87 | + end | |
| 88 | + end | |
| 89 | + | |
| 90 | + def default_values | |
| 91 | + self.status ||= 'created' | |
| 92 | + end | |
| 93 | +end | ... | ... |
| 1 | +++ a/app/models/v_libras/video.rb | |
| ... | ... | @@ -0,0 +1,41 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +# == Schema Information | |
| 3 | +# | |
| 4 | +# Table name: v_libras_videos | |
| 5 | +# | |
| 6 | +# id :integer not null, primary key | |
| 7 | +# request_id :integer | |
| 8 | +# url :string(255) | |
| 9 | +# created_at :datetime | |
| 10 | +# updated_at :datetime | |
| 11 | +# seen :boolean | |
| 12 | +# | |
| 13 | + | |
| 14 | +class VLibras::Video < ActiveRecord::Base | |
| 15 | + belongs_to :request, :class => VLibras::Request, :dependent => :delete | |
| 16 | + | |
| 17 | + validates :request_id, :url, :presence => true | |
| 18 | + | |
| 19 | + before_validation :default_values | |
| 20 | + | |
| 21 | + scope :not_seen, -> { where(:seen => false) } | |
| 22 | + | |
| 23 | + def mark_as_seen! | |
| 24 | + self.update!(:seen => true) unless self.seen | |
| 25 | + end | |
| 26 | + | |
| 27 | + def thumb | |
| 28 | + self.url.gsub('flv', 'png') | |
| 29 | + end | |
| 30 | + | |
| 31 | + def url_mp4 | |
| 32 | + self.url.gsub('flv', 'mp4') | |
| 33 | + end | |
| 34 | + | |
| 35 | +protected | |
| 36 | + def default_values | |
| 37 | + self.seen = false if self.seen.nil? | |
| 38 | + | |
| 39 | + return true | |
| 40 | + end | |
| 41 | +end | ... | ... |
| 1 | +++ a/app/uploaders/file_uploader.rb | |
| ... | ... | @@ -0,0 +1,42 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | + | |
| 3 | +class FileUploader < CarrierWave::Uploader::Base | |
| 4 | + storage :file | |
| 5 | + | |
| 6 | + def store_dir | |
| 7 | + "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" | |
| 8 | + end | |
| 9 | + | |
| 10 | + # Provide a default URL as a default if there hasn't been a file uploaded: | |
| 11 | + # def default_url | |
| 12 | + # # For Rails 3.1+ asset pipeline compatibility: | |
| 13 | + # # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_')) | |
| 14 | + # | |
| 15 | + # "/images/fallback/" + [version_name, "default.png"].compact.join('_') | |
| 16 | + # end | |
| 17 | + | |
| 18 | + # Process files as they are uploaded: | |
| 19 | + # process :scale => [200, 300] | |
| 20 | + # | |
| 21 | + # def scale(width, height) | |
| 22 | + # # do something | |
| 23 | + # end | |
| 24 | + | |
| 25 | + # Create different versions of your uploaded files: | |
| 26 | + # version :thumb do | |
| 27 | + # process :resize_to_fit => [50, 50] | |
| 28 | + # end | |
| 29 | + | |
| 30 | + # Add a white list of extensions which are allowed to be uploaded. | |
| 31 | + # For images you might use something like this: | |
| 32 | + # def extension_white_list | |
| 33 | + # %w(jpg jpeg gif png) | |
| 34 | + # end | |
| 35 | + | |
| 36 | + # Override the filename of the uploaded files: | |
| 37 | + # Avoid using model.id or version_name here, see uploader/store.rb for details. | |
| 38 | + # def filename | |
| 39 | + # "something.jpg" if original_filename | |
| 40 | + # end | |
| 41 | + | |
| 42 | +end | ... | ... |
| 1 | +++ a/app/views/devise/registrations/edit.html.haml | |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +%h2 | |
| 2 | + Edit #{resource_name.to_s.humanize} | |
| 3 | += simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-vertical' }) do |f| | |
| 4 | + = f.error_notification | |
| 5 | + = display_base_errors resource | |
| 6 | + = f.input :name, :autofocus => true | |
| 7 | + = f.input :email, :required => true | |
| 8 | + = f.input :password, :autocomplete => "off", :hint => "leave it blank if you don't want to change it", :required => false | |
| 9 | + = f.input :password_confirmation, :required => false | |
| 10 | + = f.input :current_password, :hint => "we need your current password to confirm your changes", :required => true | |
| 11 | + = f.button :submit, 'Update', :class => 'btn-primary' | |
| 12 | +%h3 Cancel my account | |
| 13 | +%p | |
| 14 | + Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete}. | |
| 15 | += link_to "Back", :back | ... | ... |
| 1 | +++ a/app/views/devise/registrations/new.html.haml | |
| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | +.breadcrumb | |
| 2 | + %h2 Cadastrar Usuário | |
| 3 | + | |
| 4 | +.row-fluid | |
| 5 | + //.span5.well | |
| 6 | + //= html5_video_tag('/system/videos/cadastro.mp4', 'video-vlibras', 'video-instructions', | |
| 7 | + // :autoplay => 'autoplay', :loop => 'loop') | |
| 8 | + | |
| 9 | + .span8.well.offset2 | |
| 10 | + %h2 Dados do Usuário | |
| 11 | + | |
| 12 | + = simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| | |
| 13 | + | |
| 14 | + .row-fluid | |
| 15 | + = f.error_notification | |
| 16 | + .span6 | |
| 17 | + = f.input :name, :label => "Nome", :required => true, :autofocus => true | |
| 18 | + = f.input :email, :required => true | |
| 19 | + = f.input :password, :required => true, :label => "Senha" | |
| 20 | + = f.input :password_confirmation, :required => true, :label => "Confirmar Senha" | |
| 21 | + .span6 | |
| 22 | + = f.input :address, :label => "Endereço", :input_html => { :rows => 4 } | |
| 23 | + = f.input :zipcode,:label => "CEP" | |
| 24 | + = f.input :phone, :label => "Telefone" | |
| 25 | + | |
| 26 | + .row{ :style => "margin-top: 20px;" } | |
| 27 | + .span12 | |
| 28 | + %center | |
| 29 | + %p= f.button :submit, "Cadastrar", :class => "btn btn-large btn-primary" | ... | ... |
| 1 | +++ a/app/views/devise/sessions/new.html.haml | |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | += include_videojs_assets | |
| 2 | + | |
| 3 | +.row-fluid | |
| 4 | + .span7 | |
| 5 | + = html5_video_tag(['/system/videos/login.mp4'], | |
| 6 | + 'login-video', 'video-instructions', '{ "autoplay": true }') | |
| 7 | + | |
| 8 | + .span4.offset1.login | |
| 9 | + %h2 Entrar | |
| 10 | + = simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'form-vertical' }) do |f| | |
| 11 | + = f.input :email, :autofocus => true | |
| 12 | + = f.input :password, :label => "Senha", :required => false | |
| 13 | + = f.input :remember_me, :label => "Lembre-me da senha", :as => :boolean if devise_mapping.rememberable? | |
| 14 | + = f.button :submit, "Entrar", { :style=>'background-color: #8a76e7;', :class => 'btn' } | |
| 15 | + = render "devise/shared/links" | ... | ... |
| 1 | +++ a/app/views/devise/shared/_links.html.haml | |
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +- if controller_name != 'sessions' | |
| 2 | + = link_to "Entrar", new_session_path(resource_name), {:style=>'color:#FFFFFF;'} | |
| 3 | + %br/ | |
| 4 | +- if devise_mapping.registerable? && controller_name != 'registrations' | |
| 5 | + = link_to "Cadastrar", new_registration_path(resource_name), {:style=>'color:#FFFFFF;'} | |
| 6 | + %br/ | |
| 7 | +- if devise_mapping.recoverable? && controller_name != 'passwords' | |
| 8 | + = link_to "Esqueceu sua senha?", new_password_path(resource_name), {:style=>'color:#FFFFFF;'} | |
| 9 | + %br/ | |
| 10 | +- if devise_mapping.confirmable? && controller_name != 'confirmations' | |
| 11 | + = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), {:style=>'color:#FFFFFF;'} | |
| 12 | + %br/ | |
| 13 | +- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' | |
| 14 | + = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), {:style=>'color:#FFFFFF;'} | |
| 15 | + %br/ | |
| 16 | +- if devise_mapping.omniauthable? | |
| 17 | + - resource_class.omniauth_providers.each do |provider| | |
| 18 | + = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) | |
| 19 | + %br/ | ... | ... |
| 1 | +++ a/app/views/layouts/_menu.haml | |
| ... | ... | @@ -0,0 +1,60 @@ |
| 1 | +.navbar.navbar-fixed-top | |
| 2 | + .navbar-inner | |
| 3 | + .container-fluid | |
| 4 | + %a.btn.btn-navbar{"data-target" => ".nav-collapse", "data-toggle" => "collapse"} | |
| 5 | + .icon-bar | |
| 6 | + .icon-bar | |
| 7 | + .icon-bar | |
| 8 | + | |
| 9 | + | |
| 10 | + = link_to "VLibras-Vídeo", home_path, :class => "brand" | |
| 11 | + | |
| 12 | + .nav-collapse | |
| 13 | + %ul.nav | |
| 14 | + - if current_user.present? | |
| 15 | + | |
| 16 | + %li.dropdown | |
| 17 | + %a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"} | |
| 18 | + = t('shared.vlibras') | |
| 19 | + - if current_user.videos.not_seen.any? | |
| 20 | + %span.label.label-success Novo vídeo! | |
| 21 | + %strong.caret | |
| 22 | + %ul.dropdown-menu | |
| 23 | + %li | |
| 24 | + = link_to v_libras_videos_path do | |
| 25 | + = t('wikivideos.my_videos') | |
| 26 | + - if current_user.videos.not_seen.any? | |
| 27 | + %span.label.label-success= current_user.videos.not_seen.size | |
| 28 | + %li= link_to t('videos.new'), new_v_libras_request_path | |
| 29 | + %li.divider | |
| 30 | + %li= link_to t('shared.form_alternative'), rapid_v_libras_requests_path | |
| 31 | + | |
| 32 | + %li.dropdown.hidden | |
| 33 | + %a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"} | |
| 34 | + = t('shared.wikilibras') | |
| 35 | + %strong.caret | |
| 36 | + %ul.dropdown-menu | |
| 37 | + %li= link_to t('wikivideos.my_signals'), '#' | |
| 38 | + %li= link_to t('wikivideos.cadastro_sinal'), '#' | |
| 39 | + %li.divider | |
| 40 | + %li= link_to t('wikivideos.dicionario_de_dados'), '#' | |
| 41 | + | |
| 42 | + %li.hidden= link_to t('shared.slibras') | |
| 43 | + | |
| 44 | + %li= link_to t('shared.about'), "http://www.vlibras.com.br", :target => "blank" | |
| 45 | + | |
| 46 | + - if current_user.present? | |
| 47 | + .nav-collapse.pull-right.user-menu | |
| 48 | + %ul.nav | |
| 49 | + %li.dropdown | |
| 50 | + %a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"} | |
| 51 | + = current_user.name | |
| 52 | + %strong.caret | |
| 53 | + %ul.dropdown-menu | |
| 54 | + %li= link_to t('shared.logout'), destroy_user_session_path, :method => 'delete' | |
| 55 | + | |
| 56 | + / | |
| 57 | + <ul class="nav secondary-nav"> | |
| 58 | + <li><haml_loud> link_to image_tag('pt.png'), url_for( :locale => 'pt' ), :title => "Português" </haml_loud></li> | |
| 59 | + <li><haml_loud> link_to image_tag('en.png'), url_for( :locale => 'en' ), :title => 'English' </haml_loud></li> | |
| 60 | + </ul> | ... | ... |
| 1 | +++ a/app/views/layouts/application.html.erb | |
| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | +<!DOCTYPE html> | |
| 2 | +<html> | |
| 3 | +<head> | |
| 4 | + <title>VLibras-Vídeo</title> | |
| 5 | + <%= javascript_include_tag "application" %> | |
| 6 | + <%= yield :js %> | |
| 7 | + | |
| 8 | + <%= yield :javascript_code %> | |
| 9 | + | |
| 10 | + <%= yield :css %> | |
| 11 | + <%= stylesheet_link_tag "application", :media => "all" %> | |
| 12 | + | |
| 13 | + <%= yield :css_code %> | |
| 14 | + | |
| 15 | + <%= csrf_meta_tags %> | |
| 16 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| 17 | + | |
| 18 | + <script type="text/javascript"> | |
| 19 | + document.createElement('video');document.createElement('audio');document.createElement('track'); | |
| 20 | + </script> | |
| 21 | +</head> | |
| 22 | + | |
| 23 | +<body> | |
| 24 | +<%= render 'layouts/menu' %> | |
| 25 | + | |
| 26 | +<div class="container-fluid"> | |
| 27 | + <% if content_for?(:menu) %> | |
| 28 | + <div class="breadcrumb"> | |
| 29 | + <%= yield :menu %> | |
| 30 | + </div> | |
| 31 | + <% end %> | |
| 32 | + | |
| 33 | + <% flash.each do |type, message| %> | |
| 34 | + <div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
| 35 | + <button class="close" data-dismiss="alert">×</button> | |
| 36 | + <%= message %> | |
| 37 | + </div> | |
| 38 | + <% end %> | |
| 39 | + | |
| 40 | + <%= yield %> | |
| 41 | + | |
| 42 | + <footer> | |
| 43 | + <p>VLibras-Vídeo - <%= t('shared.project') %> | |
| 44 | + <a href="http://www.vlibras.com.br" target="_blank">LAVID</a> | | |
| 45 | + © <%= Time.now.year %>. <%= t('shared.copyright') %>.</p> | |
| 46 | + </footer> | |
| 47 | +</div> | |
| 48 | + | |
| 49 | + | |
| 50 | +<%= yield :bottom %> | |
| 51 | + | |
| 52 | +</body> | |
| 53 | +</html> | ... | ... |
| 1 | +++ a/app/views/static/home.haml | ... | ... |
| 1 | +++ a/app/views/v_libras/requests/_position_step.haml | |
| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | +#position-step.wrapper | |
| 2 | + .video_wrapper | |
| 3 | + | |
| 4 | + = html5_video_tag(['/system/videos/workflow/localizacao.mp4'], | |
| 5 | + 'id-4', 'video-wizard', '{ "preload": "none", "controls": false }') | |
| 6 | + | |
| 7 | +- content_for :javascript_code do | |
| 8 | + :javascript | |
| 9 | + $(function () { | |
| 10 | + var optionsPosition = { | |
| 11 | + video: { width: 940, height: 530 }, | |
| 12 | + buttons: [ { id: 'btn-red-light3', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 19.1, x: 440, y: 516, delay: 300, value: null }, | |
| 13 | + { id: 'btn-green-light3', path: '/system/images/video/green-button.png', clickable: false, start: 14.9, end: 999, x: 440, y: 512, delay: 300, value: null }, | |
| 14 | + { id: 'b_loc_1', path: '/system/images/loc/p_1.png', clickable: false, start: 9, end: 9.5, x: 500, y: 350, delay: 300, value: null }, | |
| 15 | + { id: 'b_loc_2', path: '/system/images/loc/p_2.png', clickable: false, start: 11, end: 11.5, x: 330, y: 340, delay: 300, value: null }, | |
| 16 | + { id: 'b_loc_3', path: '/system/images/loc/p_3.png', clickable: false, start: 12.8, end: 13.3, x: 300, y: 40, delay: 300, value: null }, | |
| 17 | + { id: 'b_loc_4', path: '/system/images/loc/p_4.png', clickable: false, start: 14.5, end: 15, x: 530, y: 40, delay: 300, value: null }, | |
| 18 | + { id: 'b_loc_5', path: '/system/images/loc/p_4.png', clickable: true, start: debugTime(15), end: 9999, x: 150, y: 30, delay: 300, value: "top_left" }, | |
| 19 | + { id: 'b_loc_6', path: '/system/images/loc/p_3.png', clickable: true, start: debugTime(15), end: 9999, x: 680, y: 30, delay: 300, value: "top_right" }, | |
| 20 | + { id: 'b_loc_7', path: '/system/images/loc/p_1.png', clickable: true, start: debugTime(15), end: 9999, x: 680, y: 410, delay: 300, value: "bottom_left" }, | |
| 21 | + { id: 'b_loc_8', path: '/system/images/loc/p_2.png', clickable: true, start: debugTime(15), end: 9999, x: 150, y: 410, delay: 300, value: "bottom_right" } | |
| 22 | + ] | |
| 23 | + }; | |
| 24 | + | |
| 25 | + var VLibrasPosition = new VLibrasLocalization(); | |
| 26 | + console.log("POSICAO"); | |
| 27 | + VLibrasPosition.init("#position-step", optionsPosition); | |
| 28 | + }); | ... | ... |
| 1 | +++ a/app/views/v_libras/requests/_service_step.haml | |
| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | +#service-step.wrapper | |
| 2 | + .video_wrapper | |
| 3 | + | |
| 4 | + = html5_video_tag(['/system/videos/workflow/sub_audio.mp4'], | |
| 5 | + 'id-2', 'video-wizard', '{ "preload": "none", "controls": false }') | |
| 6 | + | |
| 7 | + .row-fluid.hide | |
| 8 | + .span1.offset3 | |
| 9 | + = label_tag :video, t('videos.subtitle'), :class => "bold" | |
| 10 | + | |
| 11 | + .span5 | |
| 12 | + = file_field_tag 'subtitle', :id => 'subtitle-upload', | |
| 13 | + :accept => '.srt' | |
| 14 | + | |
| 15 | + | |
| 16 | +- content_for :javascript_code do | |
| 17 | + :javascript | |
| 18 | + $(function () { | |
| 19 | + var optionsService = { | |
| 20 | + video: { width: 940, height: 530 }, | |
| 21 | + buttons: [ { id: 'btn-red-light2', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 8, x: 440, y: 516, delay: 300, value: null }, | |
| 22 | + { id: 'btn-green-light2', path: '/system/images/video/green-button.png', clickable: false, start: 8, end: 999, x: 440, y: 512, delay: 300, value: null }, | |
| 23 | + { id: 'btn-video-legenda', path: '/system/images/sub_audio/p_1.png', clickable: true, start: debugTime(8), end: 9999, x: 415, y: 417, delay: 300 }, | |
| 24 | + ] | |
| 25 | + }; | |
| 26 | + | |
| 27 | + var VLibrasSubAudio = new VLibrasLocalization(); | |
| 28 | + VLibrasSubAudio.init("#service-step", optionsService); | |
| 29 | + }); | ... | ... |
| 1 | +++ a/app/views/v_libras/requests/_size_step.haml | |
| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | +#size-step.wrapper | |
| 2 | + .video_wrapper | |
| 3 | + | |
| 4 | + = html5_video_tag(['/system/videos/workflow/tamanho.mp4'], | |
| 5 | + 'id-3', 'video-wizard', '{ "preload": "none", "controls": false }') | |
| 6 | + | |
| 7 | + | |
| 8 | +- content_for :javascript_code do | |
| 9 | + :javascript | |
| 10 | + $(function () { | |
| 11 | + var optionsSize = { | |
| 12 | + video: { width: 940, height: 530 }, | |
| 13 | + buttons: [ { id: 'btn-red-light4', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 5, x: 440, y: 516, delay: 300, value: null }, | |
| 14 | + { id: 'btn-green-light4', path: '/system/images/video/green-button.png', clickable: false, start: 5, end: 999, x: 440, y: 512, delay: 300, value: null }, | |
| 15 | + { id: 'b1_size_small', path: '/system/images/size/p_1.png', clickable: false, start: 3.8, end: 5, x: 603, y: 379, delay: 300, value: null }, | |
| 16 | + { id: 'b1_size_med', path: '/system/images/size/p_2.png', clickable: false, start: 4.2, end: 5, x: 543, y: 339, delay: 300, value: null }, | |
| 17 | + { id: 'b1_size_big', path: '/system/images/size/p_3.png', clickable: false, start: 4.6, end: 5, x: 473, y: 293, delay: 300, value: null}, | |
| 18 | + { id: 'b2_size_small', path: '/system/images/size/p_1.png', clickable: true, start: debugTime(5), end: 9999, x: 603, y: 379, delay: 300, value: "small" }, | |
| 19 | + { id: 'b2_size_med', path: '/system/images/size/p_2.png', clickable: true, start: debugTime(5), end: 9999, x: 543, y: 339, delay: 300, value: "medium" }, | |
| 20 | + { id: 'b2_size_big', path: '/system/images/size/p_3.png', clickable: true, start: debugTime(5), end: 9999, x: 473, y: 293, delay: 300, value: "large" } | |
| 21 | + ] | |
| 22 | + }; | |
| 23 | + | |
| 24 | + var VLibrasSize = new VLibrasLocalization(); | |
| 25 | + VLibrasSize.init("#size-step", optionsSize); | |
| 26 | + }); | ... | ... |
| 1 | +++ a/app/views/v_libras/requests/_video_step.haml | |
| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | +#video-step.wrapper | |
| 2 | + .video_wrapper | |
| 3 | + | |
| 4 | + = html5_video_tag(['/system/videos/workflow/video.mp4'], | |
| 5 | + 'video-video', 'video-wizard', '{ "autoplay": true, "controls": false } ') | |
| 6 | + | |
| 7 | + .row-fluid.hide | |
| 8 | + .span1.offset3 | |
| 9 | + = label_tag :video, t('videos.url'), :class => "bold" | |
| 10 | + | |
| 11 | + .span5 | |
| 12 | + = file_field_tag 'video', :id => 'video-upload', | |
| 13 | + :accept => '.flv, .ts, .avi, .mp4, .mov, .webm, .wmv, .mkv' | |
| 14 | + | |
| 15 | +.hide | |
| 16 | + = image_tag '/system/images/video/red-button.png' | |
| 17 | + = image_tag '/system/images/video/green-button.png' | |
| 18 | + | |
| 19 | +- content_for :javascript_code do | |
| 20 | + :javascript | |
| 21 | + $(function () { | |
| 22 | + var optionsVideo = { | |
| 23 | + video: { width: 940, height: 530 }, | |
| 24 | + buttons: [ { id: 'btn-red-light1', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 17, x: 440, y: 516, delay: 100, value: null }, | |
| 25 | + { id: 'btn-green-light1', path: '/system/images/video/green-button.png', clickable: false, start: 17, end: 999, x: 440, y: 512, delay: 100, value: null }, | |
| 26 | + { id: 'btn-video-upload', path: '/system/images/video/p_1.png', clickable: true, start: debugTime(17), end: 9999, x: 415, y: 410, delay: 100 } | |
| 27 | + ] | |
| 28 | + }; | |
| 29 | + | |
| 30 | + var VLibrasVideo = new VLibrasLocalization(); | |
| 31 | + VLibrasVideo.init("#video-step", optionsVideo); | |
| 32 | + }); | ... | ... |
| 1 | +++ a/app/views/v_libras/requests/new.haml | |
| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | +:javascript | |
| 2 | + $(function() { | |
| 3 | + $.contra( function() { | |
| 4 | + alert('Bem vindo ao modo debug! Os botões irão aparecer na tela antes do tempo normal.'); | |
| 5 | + window.location.href = window.location.href + "?debug"; | |
| 6 | + }, { code : [ 68, 69, 66, 85, 71 ] } ); | |
| 7 | + }); | |
| 8 | + | |
| 9 | += include_videojs_assets | |
| 10 | + | |
| 11 | +- content_for :js do | |
| 12 | + = javascript_include_tag "jquery.steps.js" | |
| 13 | + = javascript_include_tag "jquery.contra.min.js" | |
| 14 | + = javascript_include_tag "v_libras/requests/shared" | |
| 15 | + = javascript_include_tag "v_libras/requests/new" | |
| 16 | + = javascript_include_tag "v_libras/requests/workflow" | |
| 17 | + | |
| 18 | +- content_for :css do | |
| 19 | + = stylesheet_link_tag "jquery.steps.css" | |
| 20 | + = stylesheet_link_tag "v_libras/requests" | |
| 21 | + | |
| 22 | +.breadcrumb | |
| 23 | + %h3 Novo vídeo | |
| 24 | + | |
| 25 | += form_tag v_libras_requests_path, method: :post, :multipart => true, :id => 'vlibras-form' do |f| | |
| 26 | + .content.row-fluid | |
| 27 | + #vlibras-wizard | |
| 28 | + | |
| 29 | + %h2 Vídeo | |
| 30 | + %section | |
| 31 | + = render :partial => 'video_step' | |
| 32 | + | |
| 33 | + %h2 Legenda | |
| 34 | + %section | |
| 35 | + = render :partial => 'service_step' | |
| 36 | + | |
| 37 | + %h2 Posição | |
| 38 | + %section | |
| 39 | + = render :partial => 'position_step' | |
| 40 | + | |
| 41 | + %h2 Tamanho | |
| 42 | + %section | |
| 43 | + = render :partial => 'size_step' | |
| 44 | + | |
| 45 | + #menu.center.hide | |
| 46 | + = button_tag 'Próximo', :class => "btn btn-large btn-success", :id => 'btn-next', :disabled => true | |
| 47 | + | |
| 48 | + .progress.progress-striped.active.hide{:style => 'position: relative;'} | |
| 49 | + #upload-bar.bar | |
| 50 | + #upload-label.center{:style => 'position: absolute; width: 100%; font-size: 12px;'} | |
| 51 | + | |
| 52 | +.row-fluid | |
| 53 | + #step-service | |
| 54 | + | |
| 55 | + #step-video-upload | |
| 56 | + | |
| 57 | + #step-subtitle-upload | |
| 58 | + | |
| 59 | + #step-size | |
| 60 | + | |
| 61 | + #step-position | ... | ... |
| 1 | +++ a/app/views/v_libras/requests/rapid.haml | |
| ... | ... | @@ -0,0 +1,66 @@ |
| 1 | +- content_for :js do | |
| 2 | + = javascript_include_tag "v_libras/requests/shared" | |
| 3 | + = javascript_include_tag "v_libras/requests/rapid" | |
| 4 | + | |
| 5 | +#vlibras-rapid.row-fluid | |
| 6 | + .span4.offset4.login | |
| 7 | + %h2 | |
| 8 | + = t('videos.new') | |
| 9 | + | |
| 10 | + = form_tag v_libras_requests_path, method: :post, :multipart => true, :id => 'vlibras-rapid-form' do |f| | |
| 11 | + - if @request.errors.any? | |
| 12 | + #error_explanation | |
| 13 | + %p/ | |
| 14 | + %h4 | |
| 15 | + = pluralize(@request.errors.count, "erro") | |
| 16 | + impede o vídeo de ser salvo: | |
| 17 | + %ul | |
| 18 | + - @request.errors.full_messages.each do |msg| | |
| 19 | + %li.error= msg | |
| 20 | + | |
| 21 | + .field.hide | |
| 22 | + = label_tag :service, t('videos.video_type'), :class => 'bold' | |
| 23 | + | |
| 24 | + %label.radio | |
| 25 | + = radio_button_tag :service, 'video-legenda', true, :id => 'service-video-subtitle' | |
| 26 | + Vídeo e legenda (.srt) | |
| 27 | + | |
| 28 | + #url.field | |
| 29 | + = label_tag :video, t('videos.url'), :class => "bold" | |
| 30 | + | |
| 31 | + %span.btn.fileinput-button | |
| 32 | + %i.icon-film | |
| 33 | + %span.button-text Escolha o vídeo... | |
| 34 | + = file_field_tag :video, :prompt => "Arquivo de vídeo", :id => 'video-upload', | |
| 35 | + :accept => '.flv, .ts, .avi, .mp4, .mov, .webm, .wmv, .mkv' | |
| 36 | + | |
| 37 | + #legend.field | |
| 38 | + = label_tag :subtitle, t('videos.subtitle'), :class => "bold" | |
| 39 | + | |
| 40 | + %span.btn.fileinput-button | |
| 41 | + %i.icon-list-alt | |
| 42 | + %span.button-text Escolha a legenda... | |
| 43 | + = file_field_tag :subtitle, :prompt => "Arquivo de legenda", :id => 'subtitle-upload', | |
| 44 | + :accept => '.srt' | |
| 45 | + | |
| 46 | + .field | |
| 47 | + = label_tag 'params[tamanho]', t('videos.window_size'), :class => "bold" | |
| 48 | + = select_tag 'params[tamanho]', options_for_select([['Pequena', 'small'], ['Média', 'medium'], ['Grande', 'large']]) | |
| 49 | + | |
| 50 | + .field | |
| 51 | + %p | |
| 52 | + %b | |
| 53 | + = label_tag 'params[posicao]', t('videos.window_position'), :class => "bold" | |
| 54 | + = select_tag 'params[posicao]', options_for_select([[t('videos.top_left'), | |
| 55 | + 'top_left'], [t('videos.top_right'), 'top_right'], | |
| 56 | + [t('videos.bottom_right'),'bottom_right'], [t('videos.bottom_left'), 'bottom_left']]) | |
| 57 | + | |
| 58 | + .field.hide | |
| 59 | + = label_tag 'params[transparencia]', t('videos.transparency'), :class => "bold" | |
| 60 | + = select_tag 'params[transparencia]', options_for_select([['Opaco', 'opaco'], ['Transparente', 'transparente']]) | |
| 61 | + | |
| 62 | + .progress.progress-striped.active.hide{:style => 'position: relative;'} | |
| 63 | + #upload-bar.bar | |
| 64 | + #upload-label.center{:style => 'position: absolute; width: 100%; font-size: 12px;'} | |
| 65 | + | |
| 66 | + = button_tag "Confirmar", :class => "btn btn-success btn-large actions", :id => 'submit-button' | ... | ... |
| 1 | +++ a/app/views/v_libras/videos/index.haml | |
| ... | ... | @@ -0,0 +1,77 @@ |
| 1 | +#encoding: UTF-8 | |
| 2 | + | |
| 3 | += include_videojs_assets | |
| 4 | + | |
| 5 | +- content_for :js do | |
| 6 | + = javascript_include_tag "v_libras/videos/index" | |
| 7 | + | |
| 8 | +.breadcrumb | |
| 9 | + %h3= t('videos.list') | |
| 10 | + | |
| 11 | +.well | |
| 12 | + - @videos.in_groups_of(3, false) do |group| | |
| 13 | + .row-fluid.text-center.videos-row | |
| 14 | + - for video in group | |
| 15 | + .span4 | |
| 16 | + .ribbon-wrapper-green | |
| 17 | + .ribbon-content | |
| 18 | + = link_to html5_video_tag(video.url_mp4, 'video-vlibras', '', '{ "controls": false, "autoplay": true }'), video | |
| 19 | + - unless video.seen | |
| 20 | + .ribbon-green Novo | |
| 21 | + | |
| 22 | + %div | |
| 23 | + %span | |
| 24 | + = link_to video.url_mp4, class: "btn btn-success" do | |
| 25 | + = content_tag(:span, '', :class => 'icon-download icon-white') | |
| 26 | + Baixar | |
| 27 | + | |
| 28 | + %span | |
| 29 | + = link_to content_tag(:span, '', :class => 'icon-trash icon-white'), v_libras_video_path(video), method: :delete, | |
| 30 | + class: "btn btn-danger", data: { confirm: t('shared.confirm_delete') } | |
| 31 | + | |
| 32 | + | |
| 33 | + .row-fluid.text-center.pagination | |
| 34 | + .row12 | |
| 35 | + = paginate @videos | |
| 36 | + | |
| 37 | + | |
| 38 | +- if @requests.any? | |
| 39 | + .breadcrumb.requests | |
| 40 | + %h4= t('requests.list') | |
| 41 | + | |
| 42 | + .well | |
| 43 | + .row-fluid | |
| 44 | + .span8.offset2 | |
| 45 | + %table.table.table-hover.table-striped.table-requests | |
| 46 | + %thead | |
| 47 | + %tr | |
| 48 | + %th Situação | |
| 49 | + %th Vídeo | |
| 50 | + %th Criado há | |
| 51 | + | |
| 52 | + - @requests.each do |request| | |
| 53 | + %tr | |
| 54 | + %td.span2= request_status_label(request) | |
| 55 | + %td.span5= request.video_filename | |
| 56 | + %td.span5= time_ago_in_words(request.created_at) | |
| 57 | + | |
| 58 | + | |
| 59 | +- if params['video-wait'] | |
| 60 | + #modal-wait.modal.fade | |
| 61 | + .modal-header | |
| 62 | + %button.close{"aria-hidden" => "true", "data-dismiss" => "modal", type: "button"} × | |
| 63 | + %h3 Aguarde... | |
| 64 | + .modal-body | |
| 65 | + = html5_video_tag(['/system/videos/aguarde.mp4'], 'video-wait', 'video-instructions auto-margin', | |
| 66 | + '{ "preload": true, "controls": false, "autoplay": true, "loop": true }') | |
| 67 | + | |
| 68 | + .modal-footer | |
| 69 | + %a.btn{"aria-hidden" => "true", "data-dismiss" => "modal", href: "#"} Fechar | |
| 70 | + | |
| 71 | + - content_for :javascript_code do | |
| 72 | + :javascript | |
| 73 | + current_user = #{current_user.id}; | |
| 74 | + | |
| 75 | + $(function () { | |
| 76 | + $('#modal-wait').modal(); | |
| 77 | + }) | ... | ... |
| 1 | +++ a/app/views/v_libras/videos/show.haml | |
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | += include_videojs_assets | |
| 2 | + | |
| 3 | +.breadcrumb | |
| 4 | + %h3= "Vídeo #{@video.request.video_filename}" | |
| 5 | + | |
| 6 | +.row-fluid | |
| 7 | + .span12.well | |
| 8 | + .video-vlibras.text-center | |
| 9 | + = html5_video_tag(@video.url_mp4, | |
| 10 | + 'video-vlibras', '', '{ "controls": true, "autoplay": false }') | |
| 0 | 11 | \ No newline at end of file | ... | ... |
| 1 | +++ a/config/.env | |
| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | +SECRET_KEY_BASE: 59f3123227a531056f058c06f4c0ac40c072d8b23855c29ee6f4c8cf75176f0ef51cb18e2f41b52246fba93 | |
| 2 | + | |
| 3 | +#DOMAIN_NAME: 191.234.187.152:80 | |
| 4 | +#VLIBRAS_API: 191.234.184.118:80/api/ | |
| 5 | +#VLIBRAS_API_URL: hhtp://191.234.184.118:80/api/ | |
| 6 | + | |
| 7 | +# gmail password | |
| 8 | +# api address... | ... | ... |
| 1 | +++ a/config/Capfile | |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +# Load DSL and Setup Up Stages | |
| 2 | +require 'capistrano/setup' | |
| 3 | + | |
| 4 | +# Includes default deployment tasks | |
| 5 | +require 'capistrano/deploy' | |
| 6 | + | |
| 7 | +# Includes tasks from other gems included in your Gemfile | |
| 8 | +# | |
| 9 | +# For documentation on these, see for example: | |
| 10 | +# | |
| 11 | +# https://github.com/capistrano/rvm | |
| 12 | +# https://github.com/capistrano/rbenv | |
| 13 | +# https://github.com/capistrano/chruby | |
| 14 | +# https://github.com/capistrano/bundler | |
| 15 | +# https://github.com/capistrano/rails | |
| 16 | +# | |
| 17 | +# require 'capistrano/rvm' | |
| 18 | +# require 'capistrano/rbenv' | |
| 19 | +# require 'capistrano/chruby' | |
| 20 | +# require 'capistrano/bundler' | |
| 21 | +# require 'capistrano/rails/assets' | |
| 22 | +# require 'capistrano/rails/migrations' | |
| 23 | + | |
| 24 | +# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. | |
| 25 | +Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } | ... | ... |
| 1 | +++ a/config/application.rb | |
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | + | |
| 3 | +require File.expand_path('../boot', __FILE__) | |
| 4 | + | |
| 5 | +require 'rails/all' | |
| 6 | +require 'rolify/railtie' | |
| 7 | + | |
| 8 | +# Require the gems listed in Gemfile, including any gems | |
| 9 | +# you've limited to :test, :development, or :production. | |
| 10 | +Bundler.require(*Rails.groups) | |
| 11 | + | |
| 12 | +module Vlibras | |
| 13 | + class Application < Rails::Application | |
| 14 | + # Settings in config/environments/* take precedence over those specified here. | |
| 15 | + # Application configuration should go into files in config/initializers | |
| 16 | + # -- all .rb files in that directory are automatically loaded. | |
| 17 | + | |
| 18 | + config.autoload_paths += %W(#{config.root}/lib) | |
| 19 | + | |
| 20 | + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. | |
| 21 | + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. | |
| 22 | + # config.time_zone = 'Central Time (US & Canada)' | |
| 23 | + | |
| 24 | + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. | |
| 25 | + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] | |
| 26 | + config.i18n.enforce_available_locales = false | |
| 27 | + config.i18n.available_locales = ["pt-BR"] | |
| 28 | + config.i18n.default_locale = :'pt-BR' | |
| 29 | + config.encoding = "utf-8" | |
| 30 | + end | |
| 31 | +end | ... | ... |
| 1 | +++ a/config/database.yml | |
| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | +test: | |
| 2 | + adapter: sqlite3 | |
| 3 | + database: db/test.sqlite3 | |
| 4 | + pool: 5 | |
| 5 | + timeout: 5000 | |
| 6 | + | |
| 7 | +#development: | |
| 8 | +# adapter: sqlite3 | |
| 9 | +# database: db/test.sqlite3 | |
| 10 | +# pool: 5 | |
| 11 | +# timeout: 5000 | |
| 12 | + | |
| 13 | +development: | |
| 14 | + adapter: mysql2 | |
| 15 | + encoding: utf8 | |
| 16 | + database: vlibrasvideo | |
| 17 | + username: vlibrasuser | |
| 18 | + password: vlibraspassword | |
| 19 | + host: db | |
| 20 | + | |
| 21 | +production: | |
| 22 | + adapter: mysql2 | |
| 23 | + encoding: utf8 | |
| 24 | + database: vlibrasvideo | |
| 25 | + username: vlibrasuser | |
| 26 | + password: vlibraspassword | |
| 27 | + host: db | ... | ... |
| 1 | +++ a/config/deploy.rb | |
| ... | ... | @@ -0,0 +1,91 @@ |
| 1 | +# Change these | |
| 2 | +server '104.41.35.48', password: 'v1d30-l1v3', port: 22, roles: [:web, :app, :db], primary: true | |
| 3 | + | |
| 4 | +set :repo_url, 'git@git.lavid.ufpb.br:vlibras-web2' | |
| 5 | +set :application, 'vlibrasvideo' | |
| 6 | +set :user, 'deployer' | |
| 7 | +set :password, 'v1d30-l1v3' | |
| 8 | +set :puma_threads, [4, 16] | |
| 9 | +set :puma_workers, 0 | |
| 10 | + | |
| 11 | +# Default branch is :master | |
| 12 | +ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call | |
| 13 | + | |
| 14 | +# Don't change these unless you know what you're doing | |
| 15 | +set :pty, true | |
| 16 | +set :use_sudo, false | |
| 17 | +set :stage, :production | |
| 18 | +set :deploy_via, :remote_cache | |
| 19 | +set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}" | |
| 20 | +set :puma_bind, "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock" | |
| 21 | +set :puma_state, "#{shared_path}/tmp/pids/puma.state" | |
| 22 | +set :puma_pid, "#{shared_path}/tmp/pids/puma.pid" | |
| 23 | +set :puma_access_log, "#{release_path}/log/puma.error.log" | |
| 24 | +set :puma_error_log, "#{release_path}/log/puma.access.log" | |
| 25 | +set :ssh_options, { forward_agent: true, user: fetch(:user), keys: %w(~/.ssh/id_rsa.pub) } | |
| 26 | +set :puma_preload_app, true | |
| 27 | +set :puma_worker_timeout, nil | |
| 28 | +set :puma_init_active_record, true # Change to false when not using ActiveRecord | |
| 29 | + | |
| 30 | +## Defaults: | |
| 31 | +# set :scm, :git | |
| 32 | +# set :branch, :v2 | |
| 33 | +# set :format, :pretty | |
| 34 | +# set :log_level, :debug | |
| 35 | +# set :keep_releases, 5 | |
| 36 | + | |
| 37 | +## Linked Files & Directories (Default None): | |
| 38 | +# Default value for :linked_files is [] | |
| 39 | +set :linked_files, %w{config/database.yml .env} | |
| 40 | + | |
| 41 | +# Default value for linked_dirs is [] | |
| 42 | +set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system} | |
| 43 | + | |
| 44 | +namespace :puma do | |
| 45 | + desc 'Create Directories for Puma Pids and Socket' | |
| 46 | + task :make_dirs do | |
| 47 | + on roles(:app) do | |
| 48 | + execute "mkdir #{shared_path}/tmp/sockets -p" | |
| 49 | + execute "mkdir #{shared_path}/tmp/pids -p" | |
| 50 | + end | |
| 51 | + end | |
| 52 | + | |
| 53 | + before :start, :make_dirs | |
| 54 | +end | |
| 55 | + | |
| 56 | +namespace :deploy do | |
| 57 | + desc "Make sure local git is in sync with remote." | |
| 58 | + task :check_revision do | |
| 59 | + on roles(:app) do | |
| 60 | + unless `git rev-parse HEAD` == `git rev-parse origin/master` | |
| 61 | + puts "WARNING: HEAD is not the same as origin/master" | |
| 62 | + puts "Run `git push` to sync changes." | |
| 63 | + exit | |
| 64 | + end | |
| 65 | + end | |
| 66 | + end | |
| 67 | + | |
| 68 | + desc 'Initial Deploy' | |
| 69 | + task :initial do | |
| 70 | + on roles(:app) do | |
| 71 | + before 'deploy:restart', 'puma:start' | |
| 72 | + invoke 'deploy' | |
| 73 | + end | |
| 74 | + end | |
| 75 | + | |
| 76 | + desc 'Restart application' | |
| 77 | + task :restart do | |
| 78 | + on roles(:app), in: :sequence, wait: 5 do | |
| 79 | + invoke 'puma:restart' | |
| 80 | + end | |
| 81 | + end | |
| 82 | + | |
| 83 | + before :starting, :check_revision | |
| 84 | + after :finishing, :compile_assets | |
| 85 | + after :finishing, :cleanup | |
| 86 | + after :finishing, :restart | |
| 87 | +end | |
| 88 | + | |
| 89 | +# ps aux | grep puma # Get puma pid | |
| 90 | +# kill -s SIGUSR2 pid # Restart puma | |
| 91 | +# kill -s SIGTERM pid # Stop puma | ... | ... |
| 1 | +++ a/config/deploy/production.rb | |
| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | +# Simple Role Syntax | |
| 2 | +# ================== | |
| 3 | +# Supports bulk-adding hosts to roles, the primary server in each group | |
| 4 | +# is considered to be the first unless any hosts have the primary | |
| 5 | +# property set. Don't declare `role :all`, it's a meta role. | |
| 6 | + | |
| 7 | +# role :app, %w{deploy@example.com} | |
| 8 | +# role :web, %w{deploy@example.com} | |
| 9 | +# role :db, %w{deploy@example.com} | |
| 10 | + | |
| 11 | + | |
| 12 | +# Extended Server Syntax | |
| 13 | +# ====================== | |
| 14 | +# This can be used to drop a more detailed server definition into the | |
| 15 | +# server list. The second argument is a, or duck-types, Hash and is | |
| 16 | +# used to set extended properties on the server. | |
| 17 | + | |
| 18 | +# server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value | |
| 19 | + | |
| 20 | + | |
| 21 | +# Custom SSH Options | |
| 22 | +# ================== | |
| 23 | +# You may pass any option but keep in mind that net/ssh understands a | |
| 24 | +# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start). | |
| 25 | +# | |
| 26 | +# Global options | |
| 27 | +# -------------- | |
| 28 | +# set :ssh_options, { | |
| 29 | +# keys: %w(/home/rlisowski/.ssh/id_rsa), | |
| 30 | +# forward_agent: false, | |
| 31 | +# auth_methods: %w(password) | |
| 32 | +# } | |
| 33 | +# | |
| 34 | +# And/or per server (overrides global) | |
| 35 | +# ------------------------------------ | |
| 36 | +# server 'example.com', | |
| 37 | +# user: 'user_name', | |
| 38 | +# roles: %w{web app}, | |
| 39 | +# ssh_options: { | |
| 40 | +# user: 'user_name', # overrides user setting above | |
| 41 | +# keys: %w(/home/user_name/.ssh/id_rsa), | |
| 42 | +# forward_agent: false, | |
| 43 | +# auth_methods: %w(publickey password) | |
| 44 | +# # password: 'please use keys' | |
| 45 | +# } | ... | ... |
| 1 | +++ a/config/deploy/staging.rb | |
| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | +# Simple Role Syntax | |
| 2 | +# ================== | |
| 3 | +# Supports bulk-adding hosts to roles, the primary server in each group | |
| 4 | +# is considered to be the first unless any hosts have the primary | |
| 5 | +# property set. Don't declare `role :all`, it's a meta role. | |
| 6 | + | |
| 7 | +role :app, %w{deploy@example.com} | |
| 8 | +role :web, %w{deploy@example.com} | |
| 9 | +role :db, %w{deploy@example.com} | |
| 10 | + | |
| 11 | + | |
| 12 | +# Extended Server Syntax | |
| 13 | +# ====================== | |
| 14 | +# This can be used to drop a more detailed server definition into the | |
| 15 | +# server list. The second argument is a, or duck-types, Hash and is | |
| 16 | +# used to set extended properties on the server. | |
| 17 | + | |
| 18 | +server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value | |
| 19 | + | |
| 20 | + | |
| 21 | +# Custom SSH Options | |
| 22 | +# ================== | |
| 23 | +# You may pass any option but keep in mind that net/ssh understands a | |
| 24 | +# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start). | |
| 25 | +# | |
| 26 | +# Global options | |
| 27 | +# -------------- | |
| 28 | +# set :ssh_options, { | |
| 29 | +# keys: %w(/home/rlisowski/.ssh/id_rsa), | |
| 30 | +# forward_agent: false, | |
| 31 | +# auth_methods: %w(password) | |
| 32 | +# } | |
| 33 | +# | |
| 34 | +# And/or per server (overrides global) | |
| 35 | +# ------------------------------------ | |
| 36 | +# server 'example.com', | |
| 37 | +# user: 'user_name', | |
| 38 | +# roles: %w{web app}, | |
| 39 | +# ssh_options: { | |
| 40 | +# user: 'user_name', # overrides user setting above | |
| 41 | +# keys: %w(/home/user_name/.ssh/id_rsa), | |
| 42 | +# forward_agent: false, | |
| 43 | +# auth_methods: %w(publickey password) | |
| 44 | +# # password: 'please use keys' | |
| 45 | +# } | ... | ... |
| 1 | +++ a/config/environment.rb | |
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +# Load the Rails application. | |
| 3 | +require File.expand_path('../application', __FILE__) | |
| 4 | + | |
| 5 | +Encoding.default_external = Encoding::UTF_8 | |
| 6 | +Encoding.default_internal = Encoding::UTF_8 | |
| 7 | + | |
| 8 | +# Initialize the Rails application. | |
| 9 | +Rails.application.initialize! | ... | ... |
| 1 | +++ a/config/environments/development.rb | |
| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +Rails.application.configure do | |
| 3 | + # Settings specified here will take precedence over those in config/application.rb. | |
| 4 | + | |
| 5 | + config.assets.enabled = true | |
| 6 | + | |
| 7 | + # In the development environment your application's code is reloaded on | |
| 8 | + # every request. This slows down response time but is perfect for development | |
| 9 | + # since you don't have to restart the web server when you make code changes. | |
| 10 | + config.cache_classes = false | |
| 11 | + | |
| 12 | + # Do not eager load code on boot. | |
| 13 | + config.eager_load = false | |
| 14 | + | |
| 15 | + # Show full error reports and disable caching. | |
| 16 | + config.consider_all_requests_local = true | |
| 17 | + config.action_controller.perform_caching = false | |
| 18 | + | |
| 19 | + # Don't care if the mailer can't send. | |
| 20 | + config.action_mailer.raise_delivery_errors = false | |
| 21 | + | |
| 22 | + # Print deprecation notices to the Rails logger. | |
| 23 | + config.active_support.deprecation = :log | |
| 24 | + | |
| 25 | + # Raise an error on page load if there are pending migrations. | |
| 26 | + config.active_record.migration_error = :page_load | |
| 27 | + | |
| 28 | + # Debug mode disables concatenation and preprocessing of assets. | |
| 29 | + # This option may cause significant delays in view rendering with a large | |
| 30 | + # number of complex assets. | |
| 31 | + config.assets.debug = true | |
| 32 | + | |
| 33 | + config.action_mailer.smtp_settings = { | |
| 34 | + address: "smtp.gmail.com", | |
| 35 | + port: 587, | |
| 36 | + domain: Rails.application.secrets.domain_name, | |
| 37 | + authentication: "plain", | |
| 38 | + enable_starttls_auto: true, | |
| 39 | + user_name: Rails.application.secrets.email_provider_username, | |
| 40 | + password: Rails.application.secrets.email_provider_password | |
| 41 | + } | |
| 42 | + # ActionMailer Config | |
| 43 | + config.action_mailer.default_url_options = { :host => 'localhost:3000' } | |
| 44 | + config.action_mailer.delivery_method = :smtp | |
| 45 | + config.action_mailer.raise_delivery_errors = true | |
| 46 | + | |
| 47 | + # Send email in development mode? | |
| 48 | + config.action_mailer.perform_deliveries = true | |
| 49 | + | |
| 50 | + | |
| 51 | + # Adds additional error checking when serving assets at runtime. | |
| 52 | + # Checks for improperly declared sprockets dependencies. | |
| 53 | + # Raises helpful error messages. | |
| 54 | + config.assets.raise_runtime_errors = true | |
| 55 | + | |
| 56 | + # Raises error for missing translations | |
| 57 | + config.action_view.raise_on_missing_translations = true | |
| 58 | + | |
| 59 | + config.middleware.use Rack::LiveReload | |
| 60 | + | |
| 61 | + # websocket-rails | |
| 62 | + config.middleware.delete Rack::Lock | |
| 63 | +end | ... | ... |
| 1 | +++ a/config/environments/production.rb | |
| ... | ... | @@ -0,0 +1,100 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +Rails.application.configure do | |
| 3 | + # Settings specified here will take precedence over those in config/application.rb. | |
| 4 | + | |
| 5 | + # Code is not reloaded between requests. | |
| 6 | + config.cache_classes = true | |
| 7 | + | |
| 8 | + # Eager load code on boot. This eager loads most of Rails and | |
| 9 | + # your application in memory, allowing both threaded web servers | |
| 10 | + # and those relying on copy on write to perform better. | |
| 11 | + # Rake tasks automatically ignore this option for performance. | |
| 12 | + config.eager_load = true | |
| 13 | + | |
| 14 | + # Full error reports are disabled and caching is turned on. | |
| 15 | + config.consider_all_requests_local = false | |
| 16 | + config.action_controller.perform_caching = true | |
| 17 | + | |
| 18 | + # Enable Rack::Cache to put a simple HTTP cache in front of your application | |
| 19 | + # Add `rack-cache` to your Gemfile before enabling this. | |
| 20 | + # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. | |
| 21 | + # config.action_dispatch.rack_cache = true | |
| 22 | + | |
| 23 | + # Disable Rails's static asset server (Apache or nginx will already do this). | |
| 24 | + config.serve_static_assets = true | |
| 25 | + | |
| 26 | + # Compress JavaScripts and CSS. | |
| 27 | + config.assets.js_compressor = :uglifier | |
| 28 | + # config.assets.css_compressor = :sass | |
| 29 | + | |
| 30 | + # Do not fallback to assets pipeline if a precompiled asset is missed. | |
| 31 | + config.assets.compile = true | |
| 32 | + | |
| 33 | + # Generate digests for assets URLs. | |
| 34 | + config.assets.digest = true | |
| 35 | + | |
| 36 | + # Version of your assets, change this if you want to expire all your assets. | |
| 37 | + config.assets.version = '1.0' | |
| 38 | + | |
| 39 | + # Specifies the header that your server uses for sending files. | |
| 40 | + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache | |
| 41 | + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx | |
| 42 | + | |
| 43 | + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | |
| 44 | + # config.force_ssl = true | |
| 45 | + | |
| 46 | + # Set to :debug to see everything in the log. | |
| 47 | + config.log_level = :info | |
| 48 | + | |
| 49 | + # Prepend all log lines with the following tags. | |
| 50 | + # config.log_tags = [ :subdomain, :uuid ] | |
| 51 | + | |
| 52 | + # Use a different logger for distributed setups. | |
| 53 | + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) | |
| 54 | + | |
| 55 | + # Use a different cache store in production. | |
| 56 | + # config.cache_store = :mem_cache_store | |
| 57 | + | |
| 58 | + # Enable serving of images, stylesheets, and JavaScripts from an asset server. | |
| 59 | + # config.action_controller.asset_host = "http://assets.example.com" | |
| 60 | + | |
| 61 | + # Precompile additional assets. | |
| 62 | + # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. | |
| 63 | + config.assets.precompile = ['*.js', '*.css', '*.css.erb'] | |
| 64 | + | |
| 65 | + # Ignore bad email addresses and do not raise email delivery errors. | |
| 66 | + # Set this to true and configure the email server for immediate delivery to raise delivery errors. | |
| 67 | + # config.action_mailer.raise_delivery_errors = false | |
| 68 | + | |
| 69 | + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to | |
| 70 | + # the I18n.default_locale when a translation cannot be found). | |
| 71 | + config.i18n.fallbacks = true | |
| 72 | + | |
| 73 | + # Send deprecation notices to registered listeners. | |
| 74 | + config.active_support.deprecation = :notify | |
| 75 | + | |
| 76 | + config.action_mailer.smtp_settings = { | |
| 77 | + address: "smtp.gmail.com", | |
| 78 | + port: 587, | |
| 79 | + domain: Rails.application.secrets.domain_name, | |
| 80 | + authentication: "plain", | |
| 81 | + enable_starttls_auto: true, | |
| 82 | + user_name: Rails.application.secrets.email_provider_username, | |
| 83 | + password: Rails.application.secrets.email_provider_password | |
| 84 | + } | |
| 85 | + # ActionMailer Config | |
| 86 | + config.action_mailer.default_url_options = { :host => Rails.application.secrets.domain_name } | |
| 87 | + config.action_mailer.delivery_method = :smtp | |
| 88 | + config.action_mailer.perform_deliveries = true | |
| 89 | + config.action_mailer.raise_delivery_errors = false | |
| 90 | + | |
| 91 | + | |
| 92 | + # Disable automatic flushing of the log to improve performance. | |
| 93 | + # config.autoflush_log = false | |
| 94 | + | |
| 95 | + # Use default logging formatter so that PID and timestamp are not suppressed. | |
| 96 | + config.log_formatter = ::Logger::Formatter.new | |
| 97 | + | |
| 98 | + # Do not dump schema after migrations. | |
| 99 | + config.active_record.dump_schema_after_migration = false | |
| 100 | +end | ... | ... |
| 1 | +++ a/config/environments/test.rb | |
| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +Rails.application.configure do | |
| 3 | + # Settings specified here will take precedence over those in config/application.rb. | |
| 4 | + | |
| 5 | + # The test environment is used exclusively to run your application's | |
| 6 | + # test suite. You never need to work with it otherwise. Remember that | |
| 7 | + # your test database is "scratch space" for the test suite and is wiped | |
| 8 | + # and recreated between test runs. Don't rely on the data there! | |
| 9 | + config.cache_classes = true | |
| 10 | + | |
| 11 | + # Do not eager load code on boot. This avoids loading your whole application | |
| 12 | + # just for the purpose of running a single test. If you are using a tool that | |
| 13 | + # preloads Rails for running tests, you may have to set it to true. | |
| 14 | + config.eager_load = false | |
| 15 | + | |
| 16 | + # Configure static asset server for tests with Cache-Control for performance. | |
| 17 | + config.serve_static_assets = true | |
| 18 | + config.static_cache_control = 'public, max-age=3600' | |
| 19 | + | |
| 20 | + # Show full error reports and disable caching. | |
| 21 | + config.consider_all_requests_local = true | |
| 22 | + config.action_controller.perform_caching = false | |
| 23 | + | |
| 24 | + # Raise exceptions instead of rendering exception templates. | |
| 25 | + config.action_dispatch.show_exceptions = false | |
| 26 | + | |
| 27 | + # Disable request forgery protection in test environment. | |
| 28 | + config.action_controller.allow_forgery_protection = false | |
| 29 | + | |
| 30 | + # Tell Action Mailer not to deliver emails to the real world. | |
| 31 | + # The :test delivery method accumulates sent emails in the | |
| 32 | + # ActionMailer::Base.deliveries array. | |
| 33 | + config.action_mailer.delivery_method = :test | |
| 34 | + | |
| 35 | + # Print deprecation notices to the stderr. | |
| 36 | + config.active_support.deprecation = :stderr | |
| 37 | + | |
| 38 | + # Raises error for missing translations | |
| 39 | + # config.action_view.raise_on_missing_translations = true | |
| 40 | +end | ... | ... |
| 1 | +++ a/config/events.rb | |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +WebsocketRails::EventMap.describe do | |
| 3 | + # You can use this file to map incoming events to controller actions. | |
| 4 | + # One event can be mapped to any number of controller actions. The | |
| 5 | + # actions will be executed in the order they were subscribed. | |
| 6 | + # | |
| 7 | + # Uncomment and edit the next line to handle the client connected event: | |
| 8 | + # subscribe :client_connected, :to => Controller, :with_method => :method_name | |
| 9 | + # | |
| 10 | + # Here is an example of mapping namespaced events: | |
| 11 | + # namespace :product do | |
| 12 | + # subscribe :new, :to => ProductController, :with_method => :new_product | |
| 13 | + # end | |
| 14 | + # The above will handle an event triggered on the client like `product.new`. | |
| 15 | +end | ... | ... |
| 1 | +++ a/config/examples/.env.example | |
| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | +SECRET_KEY_BASE: 59f3123227a531056f058c06f4c0ac40c072d8b23855c29ee6f4c8cf75176f0ef51cb18e2f41b52246fba93 | |
| 2 | +DOMAIN_NAME: # for api callback | |
| 3 | + | |
| 4 | +VLIBRAS_API: | |
| 5 | + | |
| 6 | +# gmail password | |
| 7 | +# api address... | |
| 0 | 8 | \ No newline at end of file | ... | ... |
| 1 | +++ a/config/examples/database.yml | |
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +# SQLite version 3.x | |
| 2 | +# gem install sqlite3 | |
| 3 | +# | |
| 4 | +# Ensure the SQLite 3 gem is defined in your Gemfile | |
| 5 | +# gem 'sqlite3' | |
| 6 | +development: | |
| 7 | + adapter: sqlite3 | |
| 8 | + database: db/development.sqlite3 | |
| 9 | + pool: 5 | |
| 10 | + timeout: 5000 | |
| 11 | + | |
| 12 | +# Warning: The database defined as "test" will be erased and | |
| 13 | +# re-generated from your development database when you run "rake". | |
| 14 | +# Do not set this db to the same as development or production. | |
| 15 | +test: | |
| 16 | + adapter: sqlite3 | |
| 17 | + database: db/test.sqlite3 | |
| 18 | + pool: 5 | |
| 19 | + timeout: 5000 | |
| 0 | 20 | \ No newline at end of file | ... | ... |
| 1 | +++ a/config/initializers/active_admin.rb | |
| ... | ... | @@ -0,0 +1,246 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +ActiveAdmin.setup do |config| | |
| 3 | + | |
| 4 | + # == Site Title | |
| 5 | + # | |
| 6 | + # Set the title that is displayed on the main layout | |
| 7 | + # for each of the active admin pages. | |
| 8 | + # | |
| 9 | + config.site_title = "VLibras" | |
| 10 | + | |
| 11 | + # Set the link url for the title. For example, to take | |
| 12 | + # users to your main site. Defaults to no link. | |
| 13 | + # | |
| 14 | + config.site_title_link = "/admin" | |
| 15 | + | |
| 16 | + # Set an optional image to be displayed for the header | |
| 17 | + # instead of a string (overrides :site_title) | |
| 18 | + # | |
| 19 | + # Note: Aim for an image that's 21px high so it fits in the header. | |
| 20 | + # | |
| 21 | + # config.site_title_image = "logo.png" | |
| 22 | + | |
| 23 | + # == Default Namespace | |
| 24 | + # | |
| 25 | + # Set the default namespace each administration resource | |
| 26 | + # will be added to. | |
| 27 | + # | |
| 28 | + # eg: | |
| 29 | + # config.default_namespace = :hello_world | |
| 30 | + # | |
| 31 | + # This will create resources in the HelloWorld module and | |
| 32 | + # will namespace routes to /hello_world/* | |
| 33 | + # | |
| 34 | + # To set no namespace by default, use: | |
| 35 | + # config.default_namespace = false | |
| 36 | + # | |
| 37 | + # Default: | |
| 38 | + config.default_namespace = :admin | |
| 39 | + # | |
| 40 | + # You can customize the settings for each namespace by using | |
| 41 | + # a namespace block. For example, to change the site title | |
| 42 | + # within a namespace: | |
| 43 | + # | |
| 44 | + # config.namespace :admin do |admin| | |
| 45 | + # admin.site_title = "Custom Admin Title" | |
| 46 | + # end | |
| 47 | + # | |
| 48 | + # This will ONLY change the title for the admin section. Other | |
| 49 | + # namespaces will continue to use the main "site_title" configuration. | |
| 50 | + | |
| 51 | + # == User Authentication | |
| 52 | + # | |
| 53 | + # Active Admin will automatically call an authentication | |
| 54 | + # method in a before filter of all controller actions to | |
| 55 | + # ensure that there is a currently logged in admin user. | |
| 56 | + # | |
| 57 | + # This setting changes the method which Active Admin calls | |
| 58 | + # within the application controller. | |
| 59 | + config.authentication_method = :authenticate_user! | |
| 60 | + | |
| 61 | + # == User Authorization | |
| 62 | + # | |
| 63 | + # Active Admin will automatically call an authorization | |
| 64 | + # method in a before filter of all controller actions to | |
| 65 | + # ensure that there is a user with proper rights. You can use | |
| 66 | + # CanCanAdapter or make your own. Please refer to documentation. | |
| 67 | + config.authorization_adapter = ActiveAdmin::CanCanAdapter | |
| 68 | + | |
| 69 | + # You can customize your CanCan Ability class name here. | |
| 70 | + config.cancan_ability_class = "Ability" | |
| 71 | + | |
| 72 | + # You can specify a method to be called on unauthorized access. | |
| 73 | + # This is necessary in order to prevent a redirect loop which happens | |
| 74 | + # because, by default, user gets redirected to Dashboard. If user | |
| 75 | + # doesn't have access to Dashboard, he'll end up in a redirect loop. | |
| 76 | + # Method provided here should be defined in application_controller.rb. | |
| 77 | + # config.on_unauthorized_access = :access_denied | |
| 78 | + | |
| 79 | + # == Current User | |
| 80 | + # | |
| 81 | + # Active Admin will associate actions with the current | |
| 82 | + # user performing them. | |
| 83 | + # | |
| 84 | + # This setting changes the method which Active Admin calls | |
| 85 | + # (within the application controller) to return the currently logged in user. | |
| 86 | + config.current_user_method = :current_user | |
| 87 | + | |
| 88 | + | |
| 89 | + # == Logging Out | |
| 90 | + # | |
| 91 | + # Active Admin displays a logout link on each screen. These | |
| 92 | + # settings configure the location and method used for the link. | |
| 93 | + # | |
| 94 | + # This setting changes the path where the link points to. If it's | |
| 95 | + # a string, the strings is used as the path. If it's a Symbol, we | |
| 96 | + # will call the method to return the path. | |
| 97 | + # | |
| 98 | + # Default: | |
| 99 | + config.logout_link_path = :destroy_user_session_path | |
| 100 | + | |
| 101 | + # This setting changes the http method used when rendering the | |
| 102 | + # link. For example :get, :delete, :put, etc.. | |
| 103 | + # | |
| 104 | + # Default: | |
| 105 | + # config.logout_link_method = :get | |
| 106 | + | |
| 107 | + | |
| 108 | + # == Root | |
| 109 | + # | |
| 110 | + # Set the action to call for the root path. You can set different | |
| 111 | + # roots for each namespace. | |
| 112 | + # | |
| 113 | + # Default: | |
| 114 | + config.root_to = 'dashboard#index' | |
| 115 | + | |
| 116 | + | |
| 117 | + # == Admin Comments | |
| 118 | + # | |
| 119 | + # This allows your users to comment on any resource registered with Active Admin. | |
| 120 | + # | |
| 121 | + # You can completely disable comments: | |
| 122 | + # config.allow_comments = false | |
| 123 | + # | |
| 124 | + # You can disable the menu item for the comments index page: | |
| 125 | + # config.show_comments_in_menu = false | |
| 126 | + # | |
| 127 | + # You can change the name under which comments are registered: | |
| 128 | + # config.comments_registration_name = 'AdminComment' | |
| 129 | + | |
| 130 | + | |
| 131 | + # == Batch Actions | |
| 132 | + # | |
| 133 | + # Enable and disable Batch Actions | |
| 134 | + # | |
| 135 | + config.batch_actions = true | |
| 136 | + | |
| 137 | + | |
| 138 | + # == Controller Filters | |
| 139 | + # | |
| 140 | + # You can add before, after and around filters to all of your | |
| 141 | + # Active Admin resources and pages from here. | |
| 142 | + # | |
| 143 | + # config.before_filter :do_something_awesome | |
| 144 | + | |
| 145 | + | |
| 146 | + # == Setting a Favicon | |
| 147 | + # | |
| 148 | + # config.favicon = '/assets/favicon.ico' | |
| 149 | + | |
| 150 | + | |
| 151 | + # == Removing Breadcrumbs | |
| 152 | + # | |
| 153 | + # Breadcrumbs are enabled by default. You can customize them for individual | |
| 154 | + # resources or you can disable them globally from here. | |
| 155 | + # | |
| 156 | + # config.breadcrumb = false | |
| 157 | + | |
| 158 | + | |
| 159 | + # == Register Stylesheets & Javascripts | |
| 160 | + # | |
| 161 | + # We recommend using the built in Active Admin layout and loading | |
| 162 | + # up your own stylesheets / javascripts to customize the look | |
| 163 | + # and feel. | |
| 164 | + # | |
| 165 | + # To load a stylesheet: | |
| 166 | + # config.register_stylesheet 'my_stylesheet.css' | |
| 167 | + # | |
| 168 | + # You can provide an options hash for more control, which is passed along to stylesheet_link_tag(): | |
| 169 | + # config.register_stylesheet 'my_print_stylesheet.css', :media => :print | |
| 170 | + # | |
| 171 | + # To load a javascript file: | |
| 172 | + # config.register_javascript 'my_javascript.js' | |
| 173 | + | |
| 174 | + | |
| 175 | + # == CSV options | |
| 176 | + # | |
| 177 | + # Set the CSV builder separator | |
| 178 | + # config.csv_options = { :col_sep => ';' } | |
| 179 | + # | |
| 180 | + # Force the use of quotes | |
| 181 | + # config.csv_options = { :force_quotes => true } | |
| 182 | + | |
| 183 | + | |
| 184 | + # == Menu System | |
| 185 | + # | |
| 186 | + # You can add a navigation menu to be used in your application, or configure a provided menu | |
| 187 | + # | |
| 188 | + # To change the default utility navigation to show a link to your website & a logout btn | |
| 189 | + # | |
| 190 | + # config.namespace :admin do |admin| | |
| 191 | + # admin.build_menu :utility_navigation do |menu| | |
| 192 | + # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank } | |
| 193 | + # admin.add_logout_button_to_menu menu | |
| 194 | + # end | |
| 195 | + # end | |
| 196 | + # | |
| 197 | + # If you wanted to add a static menu item to the default menu provided: | |
| 198 | + # | |
| 199 | + config.namespace :admin do |admin| | |
| 200 | + admin.build_menu :default do |menu| | |
| 201 | + menu.add label: 'Background Jobs Admin', url: '/admin/delayed_job' | |
| 202 | + end | |
| 203 | + end | |
| 204 | + | |
| 205 | + | |
| 206 | + # == Download Links | |
| 207 | + # | |
| 208 | + # You can disable download links on resource listing pages, | |
| 209 | + # or customize the formats shown per namespace/globally | |
| 210 | + # | |
| 211 | + # To disable/customize for the :admin namespace: | |
| 212 | + # | |
| 213 | + # config.namespace :admin do |admin| | |
| 214 | + # | |
| 215 | + # # Disable the links entirely | |
| 216 | + # admin.download_links = false | |
| 217 | + # | |
| 218 | + # # Only show XML & PDF options | |
| 219 | + # admin.download_links = [:xml, :pdf] | |
| 220 | + # | |
| 221 | + # # Enable/disable the links based on block | |
| 222 | + # # (for example, with cancan) | |
| 223 | + # admin.download_links = proc { can?(:view_download_links) } | |
| 224 | + # | |
| 225 | + # end | |
| 226 | + | |
| 227 | + | |
| 228 | + # == Pagination | |
| 229 | + # | |
| 230 | + # Pagination is enabled by default for all resources. | |
| 231 | + # You can control the default per page count for all resources here. | |
| 232 | + # | |
| 233 | + # config.default_per_page = 30 | |
| 234 | + | |
| 235 | + | |
| 236 | + # == Filters | |
| 237 | + # | |
| 238 | + # By default the index screen includes a “Filters” sidebar on the right | |
| 239 | + # hand side with a filter for each attribute of the registered model. | |
| 240 | + # You can enable or disable them for all resources here. | |
| 241 | + # | |
| 242 | + # config.filters = true | |
| 243 | + | |
| 244 | + config.allow_comments = false | |
| 245 | + config.show_comments_in_menu = false | |
| 246 | +end | ... | ... |
| 1 | +++ a/config/initializers/assets.rb | |
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +Rails.application.config.assets.precompile += %w( v_libras/requests/shared.js ) | |
| 3 | +Rails.application.config.assets.precompile += %w( v_libras/requests/rapid.js ) | |
| 4 | +Rails.application.config.assets.precompile += %w( v_libras/requests/new.js ) | |
| 5 | +Rails.application.config.assets.precompile += %w( v_libras/requests/workflow.js ) | |
| 6 | +Rails.application.config.assets.precompile += %w( v_libras/videos/index.js ) | |
| 7 | +Rails.application.config.assets.precompile += %w( jquery.steps.js ) | |
| 8 | +Rails.application.config.assets.precompile += %w( jquery.contra.min.js ) | |
| 9 | + | |
| 10 | +Rails.application.config.assets.precompile += %w( v_libras/requests.css ) | |
| 11 | +Rails.application.config.assets.precompile += %w( jquery.steps.css ) | ... | ... |
| 1 | +++ a/config/initializers/backtrace_silencers.rb | |
| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +# Be sure to restart your server when you modify this file. | |
| 3 | + | |
| 4 | +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. | |
| 5 | +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } | |
| 6 | + | |
| 7 | +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. | |
| 8 | +# Rails.backtrace_cleaner.remove_silencers! | ... | ... |
| 1 | +++ a/config/initializers/can_access_delayed_job_web.rb | |
| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +class CanAccessDelayedJobWeb | |
| 3 | + def self.matches?(request) | |
| 4 | + current_user = request.env['warden'].user | |
| 5 | + return false if current_user.blank? | |
| 6 | + Ability.new(current_user).can? :manage, DelayedJobWeb | |
| 7 | + end | |
| 8 | +end | ... | ... |
| 1 | +++ a/config/initializers/check_env_vars.rb | |
| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +if ENV['DOMAIN_NAME'].nil? || ENV['DOMAIN_NAME'].empty? | |
| 3 | + raise 'DOMAIN_NAME must be set in .env (used for callback url)' | |
| 4 | +end | |
| 5 | + | |
| 6 | +if ENV['VLIBRAS_API_URL'].nil? || ENV['VLIBRAS_API_URL'].empty? | |
| 7 | + raise 'VLIBRAS_API_URL must be set in .env' | |
| 8 | +end | ... | ... |
| 1 | +++ a/config/initializers/devise.rb | |
| ... | ... | @@ -0,0 +1,258 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +# Use this hook to configure devise mailer, warden hooks and so forth. | |
| 3 | +# Many of these configuration options can be set straight in your model. | |
| 4 | +Devise.setup do |config| | |
| 5 | + # The secret key used by Devise. Devise uses this key to generate | |
| 6 | + # random tokens. Changing this key will render invalid all existing | |
| 7 | + # confirmation, reset password and unlock tokens in the database. | |
| 8 | + # config.secret_key = '97effc2d0b60a3b7d51fffe965c758e138db46402da394622c5af00917b2bf649971b6bbc8271fecdd766d953472f53d3bb88a9120806426c03e511b5f23a88c' | |
| 9 | + | |
| 10 | + # ==> Mailer Configuration | |
| 11 | + # Configure the e-mail address which will be shown in Devise::Mailer, | |
| 12 | + # note that it will be overwritten if you use your own mailer class | |
| 13 | + # with default "from" parameter. | |
| 14 | + config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' | |
| 15 | + | |
| 16 | + # Configure the class responsible to send e-mails. | |
| 17 | + # config.mailer = 'Devise::Mailer' | |
| 18 | + | |
| 19 | + # ==> ORM configuration | |
| 20 | + # Load and configure the ORM. Supports :active_record (default) and | |
| 21 | + # :mongoid (bson_ext recommended) by default. Other ORMs may be | |
| 22 | + # available as additional gems. | |
| 23 | + require 'devise/orm/active_record' | |
| 24 | + | |
| 25 | + # ==> Configuration for any authentication mechanism | |
| 26 | + # Configure which keys are used when authenticating a user. The default is | |
| 27 | + # just :email. You can configure it to use [:username, :subdomain], so for | |
| 28 | + # authenticating a user, both parameters are required. Remember that those | |
| 29 | + # parameters are used only when authenticating and not when retrieving from | |
| 30 | + # session. If you need permissions, you should implement that in a before filter. | |
| 31 | + # You can also supply a hash where the value is a boolean determining whether | |
| 32 | + # or not authentication should be aborted when the value is not present. | |
| 33 | + # config.authentication_keys = [ :email ] | |
| 34 | + | |
| 35 | + # Configure parameters from the request object used for authentication. Each entry | |
| 36 | + # given should be a request method and it will automatically be passed to the | |
| 37 | + # find_for_authentication method and considered in your model lookup. For instance, | |
| 38 | + # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. | |
| 39 | + # The same considerations mentioned for authentication_keys also apply to request_keys. | |
| 40 | + # config.request_keys = [] | |
| 41 | + | |
| 42 | + # Configure which authentication keys should be case-insensitive. | |
| 43 | + # These keys will be downcased upon creating or modifying a user and when used | |
| 44 | + # to authenticate or find a user. Default is :email. | |
| 45 | + config.case_insensitive_keys = [ :email ] | |
| 46 | + | |
| 47 | + # Configure which authentication keys should have whitespace stripped. | |
| 48 | + # These keys will have whitespace before and after removed upon creating or | |
| 49 | + # modifying a user and when used to authenticate or find a user. Default is :email. | |
| 50 | + config.strip_whitespace_keys = [ :email ] | |
| 51 | + | |
| 52 | + # Tell if authentication through request.params is enabled. True by default. | |
| 53 | + # It can be set to an array that will enable params authentication only for the | |
| 54 | + # given strategies, for example, `config.params_authenticatable = [:database]` will | |
| 55 | + # enable it only for database (email + password) authentication. | |
| 56 | + # config.params_authenticatable = true | |
| 57 | + | |
| 58 | + # Tell if authentication through HTTP Auth is enabled. False by default. | |
| 59 | + # It can be set to an array that will enable http authentication only for the | |
| 60 | + # given strategies, for example, `config.http_authenticatable = [:database]` will | |
| 61 | + # enable it only for database authentication. The supported strategies are: | |
| 62 | + # :database = Support basic authentication with authentication key + password | |
| 63 | + # config.http_authenticatable = false | |
| 64 | + | |
| 65 | + # If http headers should be returned for AJAX requests. True by default. | |
| 66 | + # config.http_authenticatable_on_xhr = true | |
| 67 | + | |
| 68 | + # The realm used in Http Basic Authentication. 'Application' by default. | |
| 69 | + # config.http_authentication_realm = 'Application' | |
| 70 | + | |
| 71 | + # It will change confirmation, password recovery and other workflows | |
| 72 | + # to behave the same regardless if the e-mail provided was right or wrong. | |
| 73 | + # Does not affect registerable. | |
| 74 | + # config.paranoid = true | |
| 75 | + | |
| 76 | + # By default Devise will store the user in session. You can skip storage for | |
| 77 | + # particular strategies by setting this option. | |
| 78 | + # Notice that if you are skipping storage for all authentication paths, you | |
| 79 | + # may want to disable generating routes to Devise's sessions controller by | |
| 80 | + # passing skip: :sessions to `devise_for` in your config/routes.rb | |
| 81 | + config.skip_session_storage = [:http_auth] | |
| 82 | + | |
| 83 | + # By default, Devise cleans up the CSRF token on authentication to | |
| 84 | + # avoid CSRF token fixation attacks. This means that, when using AJAX | |
| 85 | + # requests for sign in and sign up, you need to get a new CSRF token | |
| 86 | + # from the server. You can disable this option at your own risk. | |
| 87 | + # config.clean_up_csrf_token_on_authentication = true | |
| 88 | + | |
| 89 | + # ==> Configuration for :database_authenticatable | |
| 90 | + # For bcrypt, this is the cost for hashing the password and defaults to 10. If | |
| 91 | + # using other encryptors, it sets how many times you want the password re-encrypted. | |
| 92 | + # | |
| 93 | + # Limiting the stretches to just one in testing will increase the performance of | |
| 94 | + # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use | |
| 95 | + # a value less than 10 in other environments. Note that, for bcrypt (the default | |
| 96 | + # encryptor), the cost increases exponentially with the number of stretches (e.g. | |
| 97 | + # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). | |
| 98 | + config.stretches = Rails.env.test? ? 1 : 10 | |
| 99 | + | |
| 100 | + # Setup a pepper to generate the encrypted password. | |
| 101 | + config.pepper = '2907dad46ee52172663da4398e3197c50517be04581626455d75df94ddc21ea16e57e553e71f0302ccb14f1078582cf7d678dc0bac4c2068da7e25fea0d1896e' | |
| 102 | + config.secret_key = 'de136343dad2a57b136ea61d4bf9841d1490b58093e59295b523a9f729824fa101d5747acb8de947275b2c122656b8daff0df3567393b4b077e5b9fc8515991d' | |
| 103 | + | |
| 104 | + # ==> Configuration for :confirmable | |
| 105 | + # A period that the user is allowed to access the website even without | |
| 106 | + # confirming their account. For instance, if set to 2.days, the user will be | |
| 107 | + # able to access the website for two days without confirming their account, | |
| 108 | + # access will be blocked just in the third day. Default is 0.days, meaning | |
| 109 | + # the user cannot access the website without confirming their account. | |
| 110 | + # config.allow_unconfirmed_access_for = 2.days | |
| 111 | + | |
| 112 | + # A period that the user is allowed to confirm their account before their | |
| 113 | + # token becomes invalid. For example, if set to 3.days, the user can confirm | |
| 114 | + # their account within 3 days after the mail was sent, but on the fourth day | |
| 115 | + # their account can't be confirmed with the token any more. | |
| 116 | + # Default is nil, meaning there is no restriction on how long a user can take | |
| 117 | + # before confirming their account. | |
| 118 | + # config.confirm_within = 3.days | |
| 119 | + | |
| 120 | + # If true, requires any email changes to be confirmed (exactly the same way as | |
| 121 | + # initial account confirmation) to be applied. Requires additional unconfirmed_email | |
| 122 | + # db field (see migrations). Until confirmed, new email is stored in | |
| 123 | + # unconfirmed_email column, and copied to email column on successful confirmation. | |
| 124 | + config.reconfirmable = true | |
| 125 | + | |
| 126 | + # Defines which key will be used when confirming an account | |
| 127 | + # config.confirmation_keys = [ :email ] | |
| 128 | + | |
| 129 | + # ==> Configuration for :rememberable | |
| 130 | + # The time the user will be remembered without asking for credentials again. | |
| 131 | + # config.remember_for = 2.weeks | |
| 132 | + | |
| 133 | + # If true, extends the user's remember period when remembered via cookie. | |
| 134 | + # config.extend_remember_period = false | |
| 135 | + | |
| 136 | + # Options to be passed to the created cookie. For instance, you can set | |
| 137 | + # secure: true in order to force SSL only cookies. | |
| 138 | + # config.rememberable_options = {} | |
| 139 | + | |
| 140 | + # ==> Configuration for :validatable | |
| 141 | + # Range for password length. | |
| 142 | + config.password_length = 6..128 | |
| 143 | + | |
| 144 | + # Email regex used to validate email formats. It simply asserts that | |
| 145 | + # one (and only one) @ exists in the given string. This is mainly | |
| 146 | + # to give user feedback and not to assert the e-mail validity. | |
| 147 | + # config.email_regexp = /\A[^@]+@[^@]+\z/ | |
| 148 | + | |
| 149 | + # ==> Configuration for :timeoutable | |
| 150 | + # The time you want to timeout the user session without activity. After this | |
| 151 | + # time the user will be asked for credentials again. Default is 30 minutes. | |
| 152 | + # config.timeout_in = 30.minutes | |
| 153 | + | |
| 154 | + # If true, expires auth token on session timeout. | |
| 155 | + # config.expire_auth_token_on_timeout = false | |
| 156 | + | |
| 157 | + # ==> Configuration for :lockable | |
| 158 | + # Defines which strategy will be used to lock an account. | |
| 159 | + # :failed_attempts = Locks an account after a number of failed attempts to sign in. | |
| 160 | + # :none = No lock strategy. You should handle locking by yourself. | |
| 161 | + # config.lock_strategy = :failed_attempts | |
| 162 | + | |
| 163 | + # Defines which key will be used when locking and unlocking an account | |
| 164 | + # config.unlock_keys = [ :email ] | |
| 165 | + | |
| 166 | + # Defines which strategy will be used to unlock an account. | |
| 167 | + # :email = Sends an unlock link to the user email | |
| 168 | + # :time = Re-enables login after a certain amount of time (see :unlock_in below) | |
| 169 | + # :both = Enables both strategies | |
| 170 | + # :none = No unlock strategy. You should handle unlocking by yourself. | |
| 171 | + # config.unlock_strategy = :both | |
| 172 | + | |
| 173 | + # Number of authentication tries before locking an account if lock_strategy | |
| 174 | + # is failed attempts. | |
| 175 | + # config.maximum_attempts = 20 | |
| 176 | + | |
| 177 | + # Time interval to unlock the account if :time is enabled as unlock_strategy. | |
| 178 | + # config.unlock_in = 1.hour | |
| 179 | + | |
| 180 | + # Warn on the last attempt before the account is locked. | |
| 181 | + # config.last_attempt_warning = false | |
| 182 | + | |
| 183 | + # ==> Configuration for :recoverable | |
| 184 | + # | |
| 185 | + # Defines which key will be used when recovering the password for an account | |
| 186 | + # config.reset_password_keys = [ :email ] | |
| 187 | + | |
| 188 | + # Time interval you can reset your password with a reset password key. | |
| 189 | + # Don't put a too small interval or your users won't have the time to | |
| 190 | + # change their passwords. | |
| 191 | + config.reset_password_within = 6.hours | |
| 192 | + | |
| 193 | + # ==> Configuration for :encryptable | |
| 194 | + # Allow you to use another encryption algorithm besides bcrypt (default). You can use | |
| 195 | + # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, | |
| 196 | + # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) | |
| 197 | + # and :restful_authentication_sha1 (then you should set stretches to 10, and copy | |
| 198 | + # REST_AUTH_SITE_KEY to pepper). | |
| 199 | + # | |
| 200 | + # Require the `devise-encryptable` gem when using anything other than bcrypt | |
| 201 | + # config.encryptor = :sha512 | |
| 202 | + | |
| 203 | + # ==> Scopes configuration | |
| 204 | + # Turn scoped views on. Before rendering "sessions/new", it will first check for | |
| 205 | + # "users/sessions/new". It's turned off by default because it's slower if you | |
| 206 | + # are using only default views. | |
| 207 | + # config.scoped_views = false | |
| 208 | + | |
| 209 | + # Configure the default scope given to Warden. By default it's the first | |
| 210 | + # devise role declared in your routes (usually :user). | |
| 211 | + # config.default_scope = :user | |
| 212 | + | |
| 213 | + # Set this configuration to false if you want /users/sign_out to sign out | |
| 214 | + # only the current scope. By default, Devise signs out all scopes. | |
| 215 | + # config.sign_out_all_scopes = true | |
| 216 | + | |
| 217 | + # ==> Navigation configuration | |
| 218 | + # Lists the formats that should be treated as navigational. Formats like | |
| 219 | + # :html, should redirect to the sign in page when the user does not have | |
| 220 | + # access, but formats like :xml or :json, should return 401. | |
| 221 | + # | |
| 222 | + # If you have any extra navigational formats, like :iphone or :mobile, you | |
| 223 | + # should add them to the navigational formats lists. | |
| 224 | + # | |
| 225 | + # The "*/*" below is required to match Internet Explorer requests. | |
| 226 | + # config.navigational_formats = ['*/*', :html] | |
| 227 | + | |
| 228 | + # The default HTTP method used to sign out a resource. Default is :delete. | |
| 229 | + config.sign_out_via = :delete | |
| 230 | + | |
| 231 | + # ==> OmniAuth | |
| 232 | + # Add a new OmniAuth provider. Check the wiki for more information on setting | |
| 233 | + # up on your models and hooks. | |
| 234 | + # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' | |
| 235 | + | |
| 236 | + # ==> Warden configuration | |
| 237 | + # If you want to use other strategies, that are not supported by Devise, or | |
| 238 | + # change the failure app, you can configure them inside the config.warden block. | |
| 239 | + # | |
| 240 | + # config.warden do |manager| | |
| 241 | + # manager.intercept_401 = false | |
| 242 | + # manager.default_strategies(scope: :user).unshift :some_external_strategy | |
| 243 | + # end | |
| 244 | + | |
| 245 | + # ==> Mountable engine configurations | |
| 246 | + # When using Devise inside an engine, let's call it `MyEngine`, and this engine | |
| 247 | + # is mountable, there are some extra configurations to be taken into account. | |
| 248 | + # The following options are available, assuming the engine is mounted as: | |
| 249 | + # | |
| 250 | + # mount MyEngine, at: '/my_engine' | |
| 251 | + # | |
| 252 | + # The router that invoked `devise_for`, in the example above, would be: | |
| 253 | + # config.router_name = :my_engine | |
| 254 | + # | |
| 255 | + # When using omniauth, Devise cannot automatically set Omniauth path, | |
| 256 | + # so you need to do it manually. For the users scope, it would be: | |
| 257 | + # config.omniauth_path_prefix = '/my_engine/users/auth' | |
| 258 | +end | ... | ... |
| 1 | +++ a/config/initializers/filter_parameter_logging.rb | |
| ... | ... | @@ -0,0 +1,5 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +# Be sure to restart your server when you modify this file. | |
| 3 | + | |
| 4 | +# Configure sensitive parameters which will be filtered from the log file. | |
| 5 | +Rails.application.config.filter_parameters += [:password] | ... | ... |
| 1 | +++ a/config/initializers/inflections.rb | |
| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +# Be sure to restart your server when you modify this file. | |
| 3 | + | |
| 4 | +# Add new inflection rules using the following format. Inflections | |
| 5 | +# are locale specific, and you may define rules for as many different | |
| 6 | +# locales as you wish. All of these examples are active by default: | |
| 7 | +# ActiveSupport::Inflector.inflections(:en) do |inflect| | |
| 8 | +# inflect.plural /^(ox)$/i, '\1en' | |
| 9 | +# inflect.singular /^(ox)en/i, '\1' | |
| 10 | +# inflect.irregular 'person', 'people' | |
| 11 | +# inflect.uncountable %w( fish sheep ) | |
| 12 | +# end | |
| 13 | + | |
| 14 | +# These inflection rules are supported but not enabled by default: | |
| 15 | +# ActiveSupport::Inflector.inflections(:en) do |inflect| | |
| 16 | +# inflect.acronym 'RESTful' | |
| 17 | +# end | ... | ... |
| 1 | +++ a/config/initializers/rolify.rb | |
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +Rolify.configure do |config| | |
| 3 | + # By default ORM adapter is ActiveRecord. uncomment to use mongoid | |
| 4 | + # config.use_mongoid | |
| 5 | + | |
| 6 | + # Dynamic shortcuts for User class (user.is_admin? like methods). Default is: false | |
| 7 | + # Enable this feature _after_ running rake db:migrate as it relies on the roles table | |
| 8 | + config.use_dynamic_shortcuts | |
| 9 | +end | ... | ... |
| 1 | +++ a/config/initializers/websocket_rails.rb | |
| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +WebsocketRails.setup do |config| | |
| 3 | + | |
| 4 | + # Uncomment to override the default log level. The log level can be | |
| 5 | + # any of the standard Logger log levels. By default it will mirror the | |
| 6 | + # current Rails environment log level. | |
| 7 | + config.log_level = :debug | |
| 8 | + | |
| 9 | + # Uncomment to change the default log file path. | |
| 10 | + # config.log_path = "#{Rails.root}/log/websocket_rails.log" | |
| 11 | + | |
| 12 | + # Set to true if you wish to log the internal websocket_rails events | |
| 13 | + # such as the keepalive `websocket_rails.ping` event. | |
| 14 | + # config.log_internal_events = false | |
| 15 | + | |
| 16 | + # Change to true to enable standalone server mode | |
| 17 | + # Start the standalone server with rake websocket_rails:start_server | |
| 18 | + # * Requires Redis | |
| 19 | + config.standalone = true | |
| 20 | + config.standalone_port = 80 | |
| 21 | + | |
| 22 | + # Change to true to enable channel synchronization between | |
| 23 | + # multiple server instances. | |
| 24 | + # * Requires Redis. | |
| 25 | + config.synchronize = true | |
| 26 | + | |
| 27 | + # Prevent Thin from daemonizing (default is true) | |
| 28 | + # config.daemonize = false | |
| 29 | + | |
| 30 | + # Uncomment and edit to point to a different redis instance. | |
| 31 | + # Will not be used unless standalone or synchronization mode | |
| 32 | + # is enabled. | |
| 33 | + config.redis_options = {:host => 'redis', :port => '6379'} | |
| 34 | + | |
| 35 | + # By default, all subscribers in to a channel will be removed | |
| 36 | + # when that channel is made private. If you don't wish active | |
| 37 | + # subscribers to be removed from a previously public channel | |
| 38 | + # when making it private, set the following to true. | |
| 39 | + # config.keep_subscribers_when_private = false | |
| 40 | + | |
| 41 | + # Set to true if you wish to broadcast channel subscriber_join and | |
| 42 | + # subscriber_part events. All subscribers of a channel will be | |
| 43 | + # notified when other clients join and part the channel. If you are | |
| 44 | + # using the UserManager, the current_user object will be sent along | |
| 45 | + # with the event. | |
| 46 | + # config.broadcast_subscriber_events = true | |
| 47 | + | |
| 48 | + # Used as the key for the WebsocketRails.users Hash. This method | |
| 49 | + # will be called on the `current_user` object in your controller | |
| 50 | + # if one exists. If `current_user` does not exist or does not | |
| 51 | + # respond to the identifier, the key will default to `connection.id` | |
| 52 | + # config.user_identifier = :id | |
| 53 | + | |
| 54 | + # Uncomment and change this option to override the class associated | |
| 55 | + # with your `current_user` object. This class will be used when | |
| 56 | + # synchronization is enabled and you trigger events from background | |
| 57 | + # jobs using the WebsocketRails.users UserManager. | |
| 58 | + # config.user_class = User | |
| 59 | + | |
| 60 | + # Supporting HTTP streaming on Internet Explorer versions 8 & 9 | |
| 61 | + # requires CORS to be enabled for GET "/websocket" request. | |
| 62 | + # List here the origin domains allowed to perform the request. | |
| 63 | + # config.allowed_origins = ['http://localhost:3000'] | |
| 64 | + | |
| 65 | +end | ... | ... |
| 1 | +++ a/config/initializers/wrap_parameters.rb | |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +# -*- encoding : utf-8 -*- | |
| 2 | +# Be sure to restart your server when you modify this file. | |
| 3 | + | |
| 4 | +# This file contains settings for ActionController::ParamsWrapper which | |
| 5 | +# is enabled by default. | |
| 6 | + | |
| 7 | +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. | |
| 8 | +ActiveSupport.on_load(:action_controller) do | |
| 9 | + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) | |
| 10 | +end | |
| 11 | + | |
| 12 | +# To enable root element in JSON for ActiveRecord objects. | |
| 13 | +# ActiveSupport.on_load(:active_record) do | |
| 14 | +# self.include_root_in_json = true | |
| 15 | +# end | ... | ... |
| 1 | +++ a/config/locales/devise.en.yml | |
| ... | ... | @@ -0,0 +1,59 @@ |
| 1 | +# Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
| 2 | + | |
| 3 | +en: | |
| 4 | + devise: | |
| 5 | + confirmations: | |
| 6 | + confirmed: "Your account was successfully confirmed." | |
| 7 | + send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." | |
| 8 | + 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." | |
| 9 | + failure: | |
| 10 | + already_authenticated: "You are already signed in." | |
| 11 | + inactive: "Your account is not activated yet." | |
| 12 | + invalid: "Invalid email or password." | |
| 13 | + locked: "Your account is locked." | |
| 14 | + last_attempt: "You have one more attempt before your account will be locked." | |
| 15 | + not_found_in_database: "Invalid email or password." | |
| 16 | + timeout: "Your session expired. Please sign in again to continue." | |
| 17 | + unauthenticated: "You need to sign in or sign up before continuing." | |
| 18 | + unconfirmed: "You have to confirm your account before continuing." | |
| 19 | + mailer: | |
| 20 | + confirmation_instructions: | |
| 21 | + subject: "Confirmation instructions" | |
| 22 | + reset_password_instructions: | |
| 23 | + subject: "Reset password instructions" | |
| 24 | + unlock_instructions: | |
| 25 | + subject: "Unlock Instructions" | |
| 26 | + omniauth_callbacks: | |
| 27 | + failure: "Could not authenticate you from %{kind} because \"%{reason}\"." | |
| 28 | + success: "Successfully authenticated from %{kind} account." | |
| 29 | + passwords: | |
| 30 | + 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." | |
| 31 | + send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." | |
| 32 | + 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." | |
| 33 | + updated: "Your password was changed successfully. You are now signed in." | |
| 34 | + updated_not_active: "Your password was changed successfully." | |
| 35 | + registrations: | |
| 36 | + destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." | |
| 37 | + signed_up: "Welcome! You have signed up successfully." | |
| 38 | + signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." | |
| 39 | + signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." | |
| 40 | + 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." | |
| 41 | + 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." | |
| 42 | + updated: "You updated your account successfully." | |
| 43 | + sessions: | |
| 44 | + signed_in: "Signed in successfully." | |
| 45 | + signed_out: "Signed out successfully." | |
| 46 | + unlocks: | |
| 47 | + send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." | |
| 48 | + send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes." | |
| 49 | + unlocked: "Your account has been unlocked successfully. Please sign in to continue." | |
| 50 | + errors: | |
| 51 | + messages: | |
| 52 | + already_confirmed: "was already confirmed, please try signing in" | |
| 53 | + confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" | |
| 54 | + expired: "has expired, please request a new one" | |
| 55 | + not_found: "not found" | |
| 56 | + not_locked: "was not locked" | |
| 57 | + not_saved: | |
| 58 | + one: "1 error prohibited this %{resource} from being saved:" | |
| 59 | + other: "%{count} errors prohibited this %{resource} from being saved:" | ... | ... |
| 1 | +++ a/config/locales/devise.pt-BR.yml | |
| ... | ... | @@ -0,0 +1,57 @@ |
| 1 | +pt-BR: | |
| 2 | + devise: | |
| 3 | + confirmations: | |
| 4 | + confirmed: A sua conta foi confirmada com sucesso. Você está autenticado. | |
| 5 | + send_instructions: Dentro de minutos, você receberá um email com as instruções de confirmação da sua conta. | |
| 6 | + send_paranoid_instructions: Se o seu email existir em nosso banco de dados, você receberá um email com instruções sobre como confirmar sua conta em alguns minutos. | |
| 7 | + failure: | |
| 8 | + already_authenticated: Você já está autenticado. | |
| 9 | + inactive: A sua conta ainda não foi ativada. | |
| 10 | + invalid: Email ou senha inválidos. | |
| 11 | + last_attempt: Você tem mais uma única tentativa antes de sua conta ser bloqueada. | |
| 12 | + locked: A sua conta está bloqueada. | |
| 13 | + not_found_in_database: Email ou senha inválidos. | |
| 14 | + timeout: A sua sessão expirou, por favor, faça login novamente para continuar. | |
| 15 | + unauthenticated: Para continuar, faça login ou registre-se. | |
| 16 | + unconfirmed: Antes de continuar, confirme a sua conta. | |
| 17 | + mailer: | |
| 18 | + confirmation_instructions: | |
| 19 | + subject: Instruções de confirmação | |
| 20 | + reset_password_instructions: | |
| 21 | + subject: Instruções de reinicialização de senha | |
| 22 | + unlock_instructions: | |
| 23 | + subject: Instruções de desbloqueio | |
| 24 | + omniauth_callbacks: | |
| 25 | + failure: Não foi possível autorizar de uma conta de %{kind} porque "%{reason}". | |
| 26 | + success: Autorizado com sucesso de uma conta de %{kind}. | |
| 27 | + passwords: | |
| 28 | + no_token: Você não pode acessar esta página sem estar logado. Se você veio de um email de lembre de senha, por favor certifique-se de ter digitado a URL corretamente. | |
| 29 | + send_instructions: Dentro de minutos, você receberá um email com as instruções de reinicialização da sua senha. | |
| 30 | + send_paranoid_instructions: Se o seu email existir em nosso banco de dados, você receberá um email com um link para recuperação da senha. | |
| 31 | + updated: A sua senha foi alterada com sucesso. Você está autenticado. | |
| 32 | + updated_not_active: Sua senha foi alterada com sucesso. | |
| 33 | + registrations: | |
| 34 | + destroyed: Adeus! A sua conta foi cancelada com sucesso. Esperamos vê-lo novamente em breve. | |
| 35 | + signed_up: Bem vindo! Você realizou seu registro com sucesso. | |
| 36 | + signed_up_but_inactive: Você se inscreveu com sucesso, porém nós não podemos autenticá-lo porque sua conta ainda não foi ativada. | |
| 37 | + signed_up_but_locked: Você se inscreveu com sucesso. Porém nós não podemos autenticá-lo porque sua conta está bloqueada. | |
| 38 | + signed_up_but_unconfirmed: Uma mensagem com um link de confirmação foi enviada para o seu e-mail. Por favor, acesse o link para ativar sua conta. | |
| 39 | + update_needs_confirmation: Sua conta foi atualizada com sucesso, mas nós precisamos verificar o novo endereço de email. Por favor, verifique seu email e clique no link de confirmação para finalizar confirmando o seu novo email. | |
| 40 | + updated: A sua conta foi atualizada com sucesso. | |
| 41 | + sessions: | |
| 42 | + signed_in: Login efetuado com sucesso. | |
| 43 | + signed_out: Logout efetuado com sucesso. | |
| 44 | + unlocks: | |
| 45 | + send_instructions: Dentro de minutos, você receberá um email com instruções de desbloqueio da sua conta. | |
| 46 | + send_paranoid_instructions: Se sua conta existir em nosso banco de dados, você receberá em breve um email com instruções para desbloquear ela. | |
| 47 | + unlocked: A sua conta foi desbloqueada com sucesso. Você está autenticado. | |
| 48 | + errors: | |
| 49 | + messages: | |
| 50 | + already_confirmed: já foi confirmado | |
| 51 | + confirmation_period_expired: É necessário ser confirmado dentro do período %{period}, por favor requisite um novo usuário. | |
| 52 | + expired: expirou, por favor solicite uma nova | |
| 53 | + not_found: não encontrado | |
| 54 | + not_locked: não foi bloqueado | |
| 55 | + not_saved: | |
| 56 | + one: 'Não foi possível salvar %{resource}: 1 erro' | |
| 57 | + other: 'Não foi possível salvar %{resource}: %{count} erros.' | |
| 0 | 58 | \ No newline at end of file | ... | ... |