From 05508cafb88c5a45b7ef67eac7e650d53834e92c Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 2 Aug 2017 17:07:55 +0800 Subject: [PATCH] first commit for template store --- .gitignore | 8 + Gemfile | 15 + MIT-LICENSE | 20 + README.rdoc | 3 + Rakefile | 37 ++ app/assets/images/ruling_template/.keep | 0 .../ruling_template/colorpicker/Thumbs.db | Bin 0 -> 19968 bytes .../ruling_template/colorpicker/blank.gif | Bin 0 -> 49 bytes .../colorpicker/colorpicker_background.png | Bin 0 -> 1897 bytes .../colorpicker/colorpicker_hex.png | Bin 0 -> 532 bytes .../colorpicker/colorpicker_hsb_b.png | Bin 0 -> 970 bytes .../colorpicker/colorpicker_hsb_h.png | Bin 0 -> 1012 bytes .../colorpicker/colorpicker_hsb_s.png | Bin 0 -> 1171 bytes .../colorpicker/colorpicker_indic.gif | Bin 0 -> 86 bytes .../colorpicker/colorpicker_overlay.png | Bin 0 -> 10355 bytes .../colorpicker/colorpicker_rgb_b.png | Bin 0 -> 970 bytes .../colorpicker/colorpicker_rgb_g.png | Bin 0 -> 1069 bytes .../colorpicker/colorpicker_rgb_r.png | Bin 0 -> 1066 bytes .../colorpicker/colorpicker_select.gif | Bin 0 -> 78 bytes .../colorpicker/colorpicker_submit.png | Bin 0 -> 984 bytes .../colorpicker/custom_background.png | Bin 0 -> 1916 bytes .../colorpicker/custom_hex.png | Bin 0 -> 562 bytes .../colorpicker/custom_hsb_b.png | Bin 0 -> 1097 bytes .../colorpicker/custom_hsb_h.png | Bin 0 -> 970 bytes .../colorpicker/custom_hsb_s.png | Bin 0 -> 1168 bytes .../colorpicker/custom_indic.gif | Bin 0 -> 86 bytes .../colorpicker/custom_rgb_b.png | Bin 0 -> 1008 bytes .../colorpicker/custom_rgb_g.png | Bin 0 -> 1069 bytes .../colorpicker/custom_rgb_r.png | Bin 0 -> 1018 bytes .../colorpicker/custom_submit.png | Bin 0 -> 997 bytes .../ruling_template/colorpicker/select.png | Bin 0 -> 506 bytes .../ruling_template/colorpicker/select2.png | Bin 0 -> 518 bytes .../ruling_template/colorpicker/slider.png | Bin 0 -> 315 bytes app/assets/images/ruling_template/npa.png | Bin 0 -> 9202 bytes .../ruling_template/application.js | 13 + .../ruling_template/colorpicker.js | 484 ++++++++++++++++++ .../ruling_template/application.css | 15 + .../ruling_template/colorpicker.css | 161 ++++++ .../stylesheets/ruling_template/template.scss | 286 +++++++++++ .../admin/ruling_templates_controller.rb | 97 ++++ .../ruling_templates_controller.rb | 4 + .../ruling_template/application_helper.rb | 4 + app/models/r_template.rb | 27 + app/models/template_image_file.rb | 10 + app/models/template_psd_file.rb | 8 + .../admin/ruling_templates/_form.html.erb | 190 +++++++ .../admin/ruling_templates/_template.html.erb | 12 + .../admin/ruling_templates/edit.html.erb | 5 + .../admin/ruling_templates/index.html.erb | 39 ++ app/views/admin/ruling_templates/new.html.erb | 5 + .../admin/ruling_templates/show.html.erb | 144 ++++++ .../ruling_templates/upload_files.html.erb | 369 +++++++++++++ app/views/ruling_templates/index.html.erb | 0 bin/rails | 12 + config/locales/en.yml | 9 + config/locales/zh_tw.yml | 9 + config/routes.rb | 22 + lib/ruling_template.rb | 4 + lib/ruling_template/engine.rb | 34 ++ lib/ruling_template/version.rb | 3 + lib/tasks/ruling_template_tasks.rake | 4 + ruling_template.gemspec | 20 + test/dummy/README.rdoc | 28 + test/dummy/Rakefile | 6 + test/dummy/app/assets/images/.keep | 0 .../app/assets/javascripts/application.js | 13 + .../app/assets/stylesheets/application.css | 15 + .../app/controllers/application_controller.rb | 5 + test/dummy/app/controllers/concerns/.keep | 0 test/dummy/app/helpers/application_helper.rb | 2 + test/dummy/app/mailers/.keep | 0 test/dummy/app/models/.keep | 0 test/dummy/app/models/concerns/.keep | 0 .../app/views/layouts/application.html.erb | 14 + test/dummy/bin/bundle | 3 + test/dummy/bin/rails | 4 + test/dummy/bin/rake | 4 + test/dummy/bin/setup | 29 ++ test/dummy/config.ru | 4 + test/dummy/config/application.rb | 26 + test/dummy/config/boot.rb | 5 + test/dummy/config/database.yml | 25 + test/dummy/config/environment.rb | 5 + test/dummy/config/environments/development.rb | 41 ++ test/dummy/config/environments/production.rb | 79 +++ test/dummy/config/environments/test.rb | 42 ++ test/dummy/config/initializers/assets.rb | 11 + .../initializers/backtrace_silencers.rb | 7 + .../config/initializers/cookies_serializer.rb | 3 + .../initializers/filter_parameter_logging.rb | 4 + test/dummy/config/initializers/inflections.rb | 16 + test/dummy/config/initializers/mime_types.rb | 4 + .../config/initializers/session_store.rb | 3 + .../to_time_preserves_timezone.rb | 10 + .../config/initializers/wrap_parameters.rb | 14 + test/dummy/config/locales/en.yml | 23 + test/dummy/config/routes.rb | 4 + test/dummy/config/secrets.yml | 22 + test/dummy/lib/assets/.keep | 0 test/dummy/log/.keep | 0 test/dummy/public/404.html | 67 +++ test/dummy/public/422.html | 67 +++ test/dummy/public/500.html | 66 +++ test/dummy/public/favicon.ico | 0 test/integration/navigation_test.rb | 8 + test/ruling_template_test.rb | 7 + test/test_helper.rb | 21 + 107 files changed, 2780 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 MIT-LICENSE create mode 100644 README.rdoc create mode 100644 Rakefile create mode 100644 app/assets/images/ruling_template/.keep create mode 100755 app/assets/images/ruling_template/colorpicker/Thumbs.db create mode 100755 app/assets/images/ruling_template/colorpicker/blank.gif create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_background.png create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_hex.png create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_hsb_b.png create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_hsb_h.png create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_hsb_s.png create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_indic.gif create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_overlay.png create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_rgb_b.png create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_rgb_g.png create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_rgb_r.png create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_select.gif create mode 100755 app/assets/images/ruling_template/colorpicker/colorpicker_submit.png create mode 100755 app/assets/images/ruling_template/colorpicker/custom_background.png create mode 100755 app/assets/images/ruling_template/colorpicker/custom_hex.png create mode 100755 app/assets/images/ruling_template/colorpicker/custom_hsb_b.png create mode 100755 app/assets/images/ruling_template/colorpicker/custom_hsb_h.png create mode 100755 app/assets/images/ruling_template/colorpicker/custom_hsb_s.png create mode 100755 app/assets/images/ruling_template/colorpicker/custom_indic.gif create mode 100755 app/assets/images/ruling_template/colorpicker/custom_rgb_b.png create mode 100755 app/assets/images/ruling_template/colorpicker/custom_rgb_g.png create mode 100755 app/assets/images/ruling_template/colorpicker/custom_rgb_r.png create mode 100755 app/assets/images/ruling_template/colorpicker/custom_submit.png create mode 100755 app/assets/images/ruling_template/colorpicker/select.png create mode 100755 app/assets/images/ruling_template/colorpicker/select2.png create mode 100755 app/assets/images/ruling_template/colorpicker/slider.png create mode 100644 app/assets/images/ruling_template/npa.png create mode 100644 app/assets/javascripts/ruling_template/application.js create mode 100755 app/assets/javascripts/ruling_template/colorpicker.js create mode 100644 app/assets/stylesheets/ruling_template/application.css create mode 100755 app/assets/stylesheets/ruling_template/colorpicker.css create mode 100644 app/assets/stylesheets/ruling_template/template.scss create mode 100644 app/controllers/admin/ruling_templates_controller.rb create mode 100644 app/controllers/ruling_templates_controller.rb create mode 100644 app/helpers/ruling_template/application_helper.rb create mode 100644 app/models/r_template.rb create mode 100644 app/models/template_image_file.rb create mode 100644 app/models/template_psd_file.rb create mode 100644 app/views/admin/ruling_templates/_form.html.erb create mode 100644 app/views/admin/ruling_templates/_template.html.erb create mode 100644 app/views/admin/ruling_templates/edit.html.erb create mode 100644 app/views/admin/ruling_templates/index.html.erb create mode 100644 app/views/admin/ruling_templates/new.html.erb create mode 100644 app/views/admin/ruling_templates/show.html.erb create mode 100644 app/views/admin/ruling_templates/upload_files.html.erb create mode 100644 app/views/ruling_templates/index.html.erb create mode 100755 bin/rails create mode 100644 config/locales/en.yml create mode 100644 config/locales/zh_tw.yml create mode 100644 config/routes.rb create mode 100644 lib/ruling_template.rb create mode 100644 lib/ruling_template/engine.rb create mode 100644 lib/ruling_template/version.rb create mode 100644 lib/tasks/ruling_template_tasks.rake create mode 100644 ruling_template.gemspec create mode 100644 test/dummy/README.rdoc create mode 100644 test/dummy/Rakefile create mode 100644 test/dummy/app/assets/images/.keep create mode 100644 test/dummy/app/assets/javascripts/application.js create mode 100644 test/dummy/app/assets/stylesheets/application.css create mode 100644 test/dummy/app/controllers/application_controller.rb create mode 100644 test/dummy/app/controllers/concerns/.keep create mode 100644 test/dummy/app/helpers/application_helper.rb create mode 100644 test/dummy/app/mailers/.keep create mode 100644 test/dummy/app/models/.keep create mode 100644 test/dummy/app/models/concerns/.keep create mode 100644 test/dummy/app/views/layouts/application.html.erb create mode 100755 test/dummy/bin/bundle create mode 100755 test/dummy/bin/rails create mode 100755 test/dummy/bin/rake create mode 100755 test/dummy/bin/setup create mode 100644 test/dummy/config.ru create mode 100644 test/dummy/config/application.rb create mode 100644 test/dummy/config/boot.rb create mode 100644 test/dummy/config/database.yml create mode 100644 test/dummy/config/environment.rb create mode 100644 test/dummy/config/environments/development.rb create mode 100644 test/dummy/config/environments/production.rb create mode 100644 test/dummy/config/environments/test.rb create mode 100644 test/dummy/config/initializers/assets.rb create mode 100644 test/dummy/config/initializers/backtrace_silencers.rb create mode 100644 test/dummy/config/initializers/cookies_serializer.rb create mode 100644 test/dummy/config/initializers/filter_parameter_logging.rb create mode 100644 test/dummy/config/initializers/inflections.rb create mode 100644 test/dummy/config/initializers/mime_types.rb create mode 100644 test/dummy/config/initializers/session_store.rb create mode 100644 test/dummy/config/initializers/to_time_preserves_timezone.rb create mode 100644 test/dummy/config/initializers/wrap_parameters.rb create mode 100644 test/dummy/config/locales/en.yml create mode 100644 test/dummy/config/routes.rb create mode 100644 test/dummy/config/secrets.yml create mode 100644 test/dummy/lib/assets/.keep create mode 100644 test/dummy/log/.keep create mode 100644 test/dummy/public/404.html create mode 100644 test/dummy/public/422.html create mode 100644 test/dummy/public/500.html create mode 100644 test/dummy/public/favicon.ico create mode 100644 test/integration/navigation_test.rb create mode 100644 test/ruling_template_test.rb create mode 100644 test/test_helper.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de5d954 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.bundle/ +log/*.log +pkg/ +test/dummy/db/*.sqlite3 +test/dummy/db/*.sqlite3-journal +test/dummy/log/*.log +test/dummy/tmp/ +test/dummy/.sass-cache diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..698836d --- /dev/null +++ b/Gemfile @@ -0,0 +1,15 @@ +source 'https://rubygems.org' + +# Declare your gem's dependencies in ruling_template.gemspec. +# Bundler will treat runtime dependencies like base dependencies, and +# development dependencies will be added by default to the :development group. +gemspec + +# Declare any dependencies that are still in development here instead of in +# your gemspec. These might include edge Rails or gems from your path or +# Git. Remember to move these dependencies to your gemspec before releasing +# your gem to rubygems.org. + +# To use a debugger +# gem 'byebug', group: [:development, :test] + diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..d33f7d5 --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright 2017 Harry Bomrah + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..f337915 --- /dev/null +++ b/README.rdoc @@ -0,0 +1,3 @@ += RulingTemplate + +This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..933a343 --- /dev/null +++ b/Rakefile @@ -0,0 +1,37 @@ +begin + require 'bundler/setup' +rescue LoadError + puts 'You must `gem install bundler` and `bundle install` to run rake tasks' +end + +require 'rdoc/task' + +RDoc::Task.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'RulingTemplate' + rdoc.options << '--line-numbers' + rdoc.rdoc_files.include('README.rdoc') + rdoc.rdoc_files.include('lib/**/*.rb') +end + +APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +load 'rails/tasks/engine.rake' + + +load 'rails/tasks/statistics.rake' + + + +Bundler::GemHelper.install_tasks + +require 'rake/testtask' + +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.libs << 'test' + t.pattern = 'test/**/*_test.rb' + t.verbose = false +end + + +task default: :test diff --git a/app/assets/images/ruling_template/.keep b/app/assets/images/ruling_template/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/images/ruling_template/colorpicker/Thumbs.db b/app/assets/images/ruling_template/colorpicker/Thumbs.db new file mode 100755 index 0000000000000000000000000000000000000000..d396c36dd87185c82fdc303e5736e526634ec549 GIT binary patch literal 19968 zcmeI32|QI>|Npm{$UM)5C{syfJV~ZpNkT{}WKNPO>WC1L5S2ovWX?P%;|WFPF=GiC z%W!a<^Z%ai@YM6%=id9f&+GO3{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izYAbVMNLf<54aLS0d zvq5Ka!G(Z4EMmoMz97*+A6$&1>fO}Wo632M^N<_MnU%Jgw~UaJ$B8eD<7IfXD?f+f zLU+G;jPB@_HR)1i!$M*XGOfzbRTDeu`Y@aOD1#TU8OrM)yWFv7TwdXIMq7l|2}rlf zr_U{z1g!A}ewQ8}c!^412*Y_BoLu#HsT#{`>p^{n6(0if$~PEqQR8Z|a$mmkx|Y?K zA7TKbeT^Uast9|!ez=E=nr!oQ+UWe-P5Gj>T;Oe&_dN`S(7jG6yue}J^T7o z*W$}<9*b{2npGKaD}OBDe_a?|H?NiV1^r=+(=~p@C-KGgh05ZPacpXGz(P@3(e12* zbeJO#G+9~&DzfNY>Fh|Ltj$Y2csQN9XW literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/colorpicker_background.png b/app/assets/images/ruling_template/colorpicker/colorpicker_background.png new file mode 100755 index 0000000000000000000000000000000000000000..8401572f1939a1a24c1963513573b0194ad36ee0 GIT binary patch literal 1897 zcmY*a3pATo9RCoHhLk=v9+hya?P*IB^(tbYgf7-$bhEY|(I?UtUPi9vs#R ziy#P&{yr@fLG&2ly2iu^RFBrRRp1Ms>i=nK7%MiF8HO#xOG2 z_n6)YVr)vMq5IN*f2sWccT3)gRvu2oXh6my%^v}*O;ra5-< zrfBywZT3aSz8bWP1#@=ep&&&2r%2Xx zddEiY1@l}|b6YxdaO6Q`RJq3)wtKZi&2z5yNzot36|pnd_gApH!?MH9gq?hIkpDQ? zoi#k4#OM3Qvsl*nW+NM0+h-~TfAN~J`Np!FYfHA<4F{vc3Gd`y^@%F1#Ljo6xgBMf z>q*?e(2(gjbtEPC06P3(T2t>_N`opfT&(A|#nr9ubq;Roe8EGc50&a+@Ca&D8N&V5 zfWzVZ*wTW^c5k?}vCRiBX+63NTRRx9IULPb=kLtbG7G2PR9LSNtF=j!&s8JxkH+I- zofPjPqCAy{x*V^kY%4z8I+~=}5Ut2+RB9hQnF-=Yy8f)_*S6oz?C#RkmvpMq7QP(o zbZ!bUKi!a-F8i&JTjM>>TAUAmd?)cz-HnW2PWdWk#$QRa^0SMsE*Ei8-<`C&zPP^R zdHWR`(Q|r$)T?{(gtteqpleg1llyjZ0ZVLw8leHw(a;G~vcN1Y>6s-e44f7NN&vzO zSzky!K z<_U2aPpuI;9PaSb&;Ej+#b@gJvw)$&8ZCQ!O0HDG-5Ryk0-~ziB-tPWKJK=>?ocx|gRt#KYNSCK| zmrMW=4om~tMIU%ONCY$t9RcY(kaUNR#1=v%^?pW-QzJnZCkAr|iCQDD687K8FZ`q_ zi57h%KMX!lwtAe@@x)l}04zNB(A4Qum^BC!^1cdZ=xa=ei3OvQ+5@W08>NszykE}f zv?z;H%6*$BjvuB;iP6rpc{~#`#C$juv62eaJ-(#wzbS@&`|x8xR0#<2lFZ9l84oq~ z)RtYb1_uH_On@$HmKKWl$={|vFVC?D2S?ere)+Ii3ZCYJc1u{wg0CgRowk%p6z-vm z25al~YDe{K&MKf#`#$i4g$_`C3_gpv%r}IrbhdU7n7ws`iL~u?7mnTC+5f*Z3oqn> z!F~y5)zR3`!AmrFCO)o-qINJDjGjk AumAu6 literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/colorpicker_hex.png b/app/assets/images/ruling_template/colorpicker/colorpicker_hex.png new file mode 100755 index 0000000000000000000000000000000000000000..4e532d7c65393fe56d7463e1da3faa591f03de84 GIT binary patch literal 532 zcmV+v0_**WP)h+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaA2nn^@KRCwC#n6YcZKorKmBnM{5VnN~}9ReD%Nhj%)e@2UckI?wn+*F*3;85I( zxENdy>|*I~AlHjh(Li4w_e~$k1>TSMlH7e>k|a?SftQq0B8sB@e$Nc7)9DBRzVCyb z1b`q2c!CKbZg`U5o2itl0Sv%)yQM?b>-9{KyTHhep8?|QckHZYvzcW~5d<@9^YvHp ztN^T5E7MqasmZKO0Qfo_tQD_Cp^cRCbkSPY3PWmOrwUtP=mYq!Xf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Yuc{?08g~^-7;vm)Bpeg07*qoM6N<$g2&OnRsaA1 literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/colorpicker_hsb_h.png b/app/assets/images/ruling_template/colorpicker/colorpicker_hsb_h.png new file mode 100755 index 0000000000000000000000000000000000000000..3977ed9f21e3186eefd37b198a7cc3f8de6c69cb GIT binary patch literal 1012 zcmVh+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaA4dPzh1Z?xtc9W|d^8%pySrl!Jsywq01yZSfWhDafa5q;(RrSK!_25Mnz_o6R-Q8VL6wU6+%F4pRf-Q$MI@dS4=mAHh)9FT|@$~eByOWcX z!Cq-b_?cFRh?(5s;V}d2mk4K?&4-6bIBX^iheAZrO{%IS z0YIfv$z`+F(Rl#Sb=`U9^73-C*$nbL0E`QQVHk#CxMmUxbFA4+=9etvc4lVg#bpWz zInPX|)2gcCza|_G>$(mIxn`0I%UGFA#{CZCigR#qP_0(EKmY)WdwYgq^vWbf{@jo* zE^s3|JL^F2F_(#niAW>@0HNVwp65~TOfr++9V?g3RwW5{t@J$$rn?^>GJgkDFu7a~ z0J4_L6actnGO6o2dKt1Tm&@fyBr-HKgb=#EzCJrUYqeSQ+^ z@p#6tJ$H`nQONIahe-%W5W9r2sHGI!dV# zn9t`wEiLs)_< zqd%&uZ8MDk?wUrxmh*4WOQjM3lu9KVI=x0fd;SdeWoPH>w{N(;v%SrL5$IU%>swn} z&Ykoc0rTVI;o%`}Y;JDa?=Z*_rV$WDQ4~e15wPVDEf~Cg-q^s9M@L8IPO6Q7wKmq* z*8yN{ZOu_IR2l)>*Xq^PRofnVjezF$`JY}R@TxaQ3XQ;rsVRc!#0$pj@kcMZ?m6r9 i8Ue%TbFitZe+B@uIz19ZnQ%P-0000P)h+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaA58A(JzRCwC#nn6h0U=+t+YIIeCZ8N0REt9otS9j@(Ajt5v?W7gKqX!Ee2!alT z*{jEbDCoQ>c=RY9Hf%t4)YgLZFxlE#lxYuB4{FKmYLj+{XqP4>>D<09+4?7kkiL)i zCw=+8yx$khX0s6l0a_EoFgQUFr>Ccyv)*xTdJ9d`TAin3TNEXx9h36D@HluRbgX0xZi|M`m->2&(y;zATt zUtgb2rxE!!7z{#JcW)%jt^)w9^msr~9*-v;i!CfHcs!of)m5L*$Fi&_47G}h;x`gy z*8u=lD!{P5zCN4HW;7V?-@EsXVF2Ld*VWaPbRbERt*xy_qcI!~ z@9yrBBxyFAg#ir>4MLasI!M{&seDmP)0v*(}F#R;yKycq%MgFbV-Kmy2at z6btolO5PRDr@!4Z$8p@>z3aEPu8Q|{ty*UoMyqW#X);+#XFW~m>+vyeF`IXyQO#NJ zbh~RrKwCuMN$DHKAJ?Z?3}IWn844lt{j9sYMg;ybB7j=*MBv)`?T7$s$rFKV>l!5j zc-gjXW@g6ebar)h4ST%+u)Mq+iA1Vh>;hK~hoekI)rdfi2>c2WDBo(VtgHlsL7oWA z&(HHjpvo(k$QAFtqAp4OL_n^=BM3sifqK^6t;x3f;LDd95%>>@z}MsBc8bzsTdm2i z6abo=n^j5#I^FK)FJH<8eAw7fFA-2=n(8G26ji+};bGxL%+uSO z+~1duRQyKZk=2THHElK;WdhRY=jtT_oYMBcdWk?qZ;mP?0uS5U5n4xHFiI<+dadUb l@49-4fb1urmzm6u0RTq3k6f>52*3aU002ovPDHLkV1hB)7U=*0 literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/colorpicker_indic.gif b/app/assets/images/ruling_template/colorpicker/colorpicker_indic.gif new file mode 100755 index 0000000000000000000000000000000000000000..f9fa95e2825eadd2d779ad270a71eddb94f94748 GIT binary patch literal 86 zcmZ?wbhEHbRA%60n8?6jX=xc99sU3Re+C8y#h)yU3=B*RIzTo9NS=X7-KS;c>A7MD o3b%A+G;E1+{h2#gG;NlJnPP?C%HXh+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaAe`AI}URCwC#eanvINRp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f1;4BRErLrH%ycnUr}i1xc5&CUZIL!(hh2Q% zVF85G$M?@|k?AL{c>H{+ImGMXwj@$S=VZlAuSDZz>MOkG?7UARP-F?H8dhbST)uG< z!K%^C=xT3K)>BF8i_z#$*_L=tD-o(3rHb2TQLIjdRp13+D1+sl!FqSlDp%v5IX1KR zE?#KMWB2aZOo25Spwjj?2I^fftq$5!4|=7?T)FV8`(!$;3Z&1t5Em}EcrwM}0M5Ww z-e&^BrF~uiYbyeJ`Q(WrcWTO3Cq^s)!3r0Of5txavt8_lKMNF-lT|rk)oAr81HO2o ztKQCk%draku>xSNOf71K!B`oTPaB*n9lUv!RxZM~$7%(XD-rkIv9hSU;RTQC-7E9m z_pA)~3P9g^PYW!Us@AN$Z{?y`0Y+$hym$e&j0)cY$}1;-^=h&guB=zD$d|} z_Zb(`yU}a`yg3zq62Mlt+}<6q&m6or<-uo2fw#utm5BUF(Xb9ITHWv9)mH{ug#2>Z zK&9)+K9#}q#er=r|KDVMK0T561VDQ6b7#P6U)~Mxt5@GENx_@c^yydbzcHKqvw^g1 zGZjC#ed)b_`TzOP{2K~q RdwKu>002ovPDHLkV1myV#+d*B literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/colorpicker_rgb_b.png b/app/assets/images/ruling_template/colorpicker/colorpicker_rgb_b.png new file mode 100755 index 0000000000000000000000000000000000000000..dfac595d017e279ff670df2c816e02d922660d9f GIT binary patch literal 970 zcmV;*12z1KP)h+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaA4P)S5VRCwC#nn6n&K^TU=-E6Jmny{kAgHdYMnDn-IF?jG$4BqP9gMtMis0Dw8 zAV{dW=nt@ez?%dVDIU_2gRqI_5Em~-k8ZNXWV1btZa3MO4c19#+Wqh_Zf2N=;hoLQ zLzrMN$n!kVR;sFUJkQ_V-BE`=I5@}w0L!vKVQ~Q9@px!O=Q!>KBXRE#RaJ4J1Hkq5 zH74#rAmB*#N9cI-&+9?5X8Zj7{P_5|^XQH{u=yKC6vb33b$ff;+uIw9#SFtZ zJw0vcV;BZjbSqURlaVB;VRjAxerlS1&~!NI`5fVIQh?ryB; zCRH|X*Y~znJyFxHP3oeqGU3e&1O9;`*C3*9*=)dr#lP& zn<{s4fg0h-$-2z|0F15BXa1p~(a}*s5CEWXbyYJAdmo&O{#YpD48vSpURq~=HZW^z zYn4ic=lPM5k&}~?zi?i#P(>mU00>*Q=~G~A=!rx^QIxK(E{0+5@9$+<_W68FXS3cg z9in$e&*$@{Qpx;xe0;nc^Q+Ji{h4jrtW!Iut3V(?BD!Pgx=!e-({Wy>6NMqMNDj~M~n z)!GO=qQA@t;I7t2;1S(50Ji7R-H^E z;Fxt5y+yKp{*YWFP<>kUy}douSY2JE!wBfrD*F4hvVtJ@ z_xH_*L>mEXHkOx{0bprq$rczQjer>#REvv?4Nu550(w0tO-7)tlOusf;N935Ms)0f sary=%7ro}V>f{=MmOlY4Yuc{?08g~^-7;vm)Bpeg07*qoM6N<$g2&OnRsaA1 literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/colorpicker_rgb_g.png b/app/assets/images/ruling_template/colorpicker/colorpicker_rgb_g.png new file mode 100755 index 0000000000000000000000000000000000000000..72b32760a5c40b7ab834d176ac588750a06f13f2 GIT binary patch literal 1069 zcmV+|1k(G7P)h+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaA4vq?ljRCwC#na@w+KorMcp|EVXQK$+YM6*gzHqnN7BF59kyLV$Gkwjyn8-M%_ zE{RbNUKIZauO4)ds|T|oT-ef(s1a0_$f>a^t?r@HEtF8AJM1*eOAln2$@}v7PN(lv zVqjo^rfD!+2!cS;G+ihZOeejotBV8xi^T#a3=#mWR;yX1lO*|ym8f@!APA_W1Hk3w zB_iEkuh&r3o1~-lLnG2_dVP3!cw}V6=kpbd#Y`r1aB$FM>4rPdqTFGsf@RrABvLAs z_V)IUj*iC1$ET;KtLC7VuFaK9CiU4#0Js;$s%4Xtll%Mo+uPgi?d>#8=kxjb`T6VX zYnRih&Uxo>AeFAF`pIzskVqr~Lqpo^765pv442ErFwDvEaR>5>mzrVKEiOMUN%>sbW=d;^vxor09`ug(nG5}<=S@G^porYX_`AU~VE3z!TGDK12 zc|IHtTS-zB#k2Esx7%GV#GgQ4^p{X9P7p+z=e5~u7zO}#c6JsQ7vu3b&+`;T_4M>` z9GA&t7={6YXue?rfdBvuX|^c<5G>0+K0fLf%ChWqI(vJ2Z8lpnnM|cp%5P9_w|2W7 z>1kS1l^S-tomBpdnunPn2&bo~4-XFj(BI$hKzujU8^&M)%d(Orp*X1D81+?=O8VFB zIa!wfZPi~d9gF96vq~2P!K`gH<8pO-Jf@R=lh2dg9?y?N!gSI{gTWRNFc%T{RQW{l z*CWMo2;1uKCntz>kA*@lBG4iNxDWx@ z)`lq&7!3wLPfXOA@a^yrUm{@0H1Q<@4N1q72$V`Cvl4;&Z#A$c0u5CiPaZTH69Gx%^@W86{U8at z_Fg3dSGk-*1b!6?u~UR@?manP6sovBm$~8BD1qf>UcbEU>Hn@ zfYuw~a2Nn)W@dDT!IB76y{(>_nyMPXmk7v4umABS0u4PmVn_r&_Vpo@j@&Rtryjo2 npA4&xFA;ctuJh%cDE=M*G)vtq^hrv*00000NkvXXu0mjffA{0B literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/colorpicker_rgb_r.png b/app/assets/images/ruling_template/colorpicker/colorpicker_rgb_r.png new file mode 100755 index 0000000000000000000000000000000000000000..4855fe03f8ea8d88b4f8ae625c7958eea65208ac GIT binary patch literal 1066 zcmV+_1l9YAP)h+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaA4ut`KgRCwC#nL$e%K@`W|#$^*@2)1ijA*P`i*Vs!8o}|Yj_z@}|6buN87D4dl zS;)b(p0whp5G)M=FI7^gQ8aB#6dSZ+h!%w1Y;?1+hmFg+nRFn+=R+9LJG1n=PBo8cw>y;UEFPWHNyPjRb(ErY56GCrR=VBT=6aj^j{C z2Y}PlQ$)I5E>~4mPm+!{9%_-UkM*gkDWxt5LNprP-`}sZ^r|P&B!6Kv=J9woH#gVT z*4Ee8bGcj~5O6x38Xwfs)pPCb?dfMH0U$33`jPQ?{QUg<*V)k*x3{;YrDbbti|2U@V!3Kl zRCTj#GL@3+Y**KVSOqeE%ahy@p z>gUg%wKI(2q+et*WIMxri^U8lz0dD&5CLNmfmf=FKMMPvNFYqBzie+K(*3%>zd-~V zL;x2efZ8e(fs*tF5oi#B1`)uT2$WAXLZQ&n(GgA41VQBU`NhRWQ51QeZ*Fd`W2iq+ zC9AKVB^iPU{58STq)rq?Q52=WX&5rCK1rt=MBqOp0vDN#+vPH1T5ZUz6aegYJElaS z&+mUTFi^oE5)R`_1gbJke2G9!((xn$q9_`b2vmO6z?uluwCZ>gfvT~NFA}u zJ+zYaydY?bOazXPk7GMK??WM;=NX3ieRZYrsgLwvFbDv_U{E6+Um_sgKZCuSp8l}3 zB-f`^k&G`9D5zq6Vq!wyh%XUP9v_#Nm*vX%__#5MfK({RB``K7i(FY*Q5vx(0tHD@ z%IN4Q0E~=`C@okM0nKam@bIvv1z#c{ReS!&mk88!bHtDcymY$}N=F_r<$jdLkY231 k>i80YySoaVIYIa{0Hu_2rW%yutN;K207*qoM6N<$f_Z=6i~s-t literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/colorpicker_select.gif b/app/assets/images/ruling_template/colorpicker/colorpicker_select.gif new file mode 100755 index 0000000000000000000000000000000000000000..599f7f13a6854d198f501588948ffcf97bf9f365 GIT binary patch literal 78 zcmZ?wbhEHbij|08)1sO8@`> literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/colorpicker_submit.png b/app/assets/images/ruling_template/colorpicker/colorpicker_submit.png new file mode 100755 index 0000000000000000000000000000000000000000..7f4c0825f53cc4faba8fc9e043502276765da1f5 GIT binary patch literal 984 zcmV;}11J26P)h+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaA4UP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?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/custom_hsb_h.png b/app/assets/images/ruling_template/colorpicker/custom_hsb_h.png new file mode 100755 index 0000000000000000000000000000000000000000..a217e9218e6a512b507a35e8a6141f0e56193439 GIT binary patch literal 970 zcmV;*12z1KP)h+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaA4P)S5VRCwC#m|aK|K^(yUyEA+4?d5?fXd;=M7I&7CAQ1#X&_j>CL_YN-gn@+F zgHSIeAw>3IK|;|7L=oge5IzJ#A^0E&>G?(8=|!HGo*#L7AKu<>4|8pMd)HkZt+#{w zXC7weW^aBB|Jj-SF*9F$o1tx>E$qcMycycAC@-ZBJ@9=M1Art+Kw)425XHpaLf3nT z*o$qs(c_|+-@n%!JfIWz{MV(NRK`u1oK!3sq$xeUk30*0rTO&r;Lz}xX3Q?2XDLZ^ zNtQLm=b0`ovGcrzGy{tZJ8^M;iCsNLZ*=us&BvV@!eqi&`J(hE1%Vf=JRxLR*23X^ zHtTjcstkxmW4fX%R1Gc%0Gw!YjZb;hvts~YStk9-f%l(m0w0fy0I;#P!Y~ZOFd0Yc z6v|xg8E^fO8d9H}oln`OnfJJ7mbVJzw2DT;EXx*f%c_Y}(B({td#$~-(d7^m2>@v8 zyhBz%)<4CSQ06-3bdbu#v?m=s^TUgQAW80>SVT-DWO+Bqe^ZT5c^X^}GWW!^H|6DM z{2&`t&HcxOX}{XxtgBuQu9KfyE}VDPRTnB@)bzR0U55`X2iGIf82PEXs$7=k;M$J@ zqW{A-4Q++h&2S`|@upE=bVXp?Ee;`O5dSyi! z_6LF|n~ze5J~HYyjR0NfpC{*ZC2Op&)zJu?In|^S_t5Z|X#`9oU=$;ucVssLNp#Z) zm`1=f0;Ul#jllmj0z<=NR2qTWnkv%>>_H8 zN}^l&B27_@0BI^lKr=??RZm8DS1SN?ceNr_7}^MstN?&p_nzJCxJ2r=d!JKa1US_; z?df}&-f3JTfPWoH*RQmY%H4;rv~L($))vJGczsJ=-;&x0XvXM>ju9#M``?gN>ukHI zbY@GK!e7T#7lFRVZvo)JlL2+7ag6|%dL;F~c&F(xt`Sh)F!UJ#{5Lm80~&$3`EU8J sdf~SzMzo^mJOqtv1hQW_1cCoK0IhW09jn*o82|tP07*qoM6N<$g4YtalK=n! literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/custom_hsb_s.png b/app/assets/images/ruling_template/colorpicker/custom_hsb_s.png new file mode 100755 index 0000000000000000000000000000000000000000..7826b415077be23ed1b1bf05b2da62d4aa5b1c67 GIT binary patch literal 1168 zcmV;B1aJF^P)h+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaA57D+@wRCwC#nQcf@Q5eUc-Fr6Onu3&AF^rild$UyX1q~x8l(L`*3O@uvFO(o; z_5wxr@*$1tgY{vMl7$6QeMqAy6e1xqkX2R|TUIxmtGu(iIrnyNAC8Ud=Dmt?_1xOS z`EYjbGoJs>o;~L|ziI4tJI8S#VLo05L|S~@48(C$eTIg-ib~hV#^6c%;`soO zlezfi8;3YL0sx8%PiTw9QdL!zm6bIwEpOSPl&u?AQj2Q*-QCgA(fXtl0Cw!$vnn?|%wceFNYM&oFvQ9@3=R%a03eJUpBbjP zxp`q)T3K1y!+W<%Hg9jJw`vg*Mw-&Q9tyNHEd`IT=#UEpqjD~4E z^RfC@Z$F3^H8z_~ryHfSWm(qgbTa*XVcv?&bj$btfnHa?*um@dDVpmsF>?L3*Xu+0 zyNG<2kdR<9neuc7gy{DU#-ng495vU+K24>ZIF9oRKKZ>NR5}3gyyPRArjJ2 zf+9GneqF87jYgx)wVGJz@o_T{>vs3KTv8sMfSye0b7#*&eJ)p4MuzH$z|-elQ6iu& zBJkq1T~TGrm!v941lAN}Dx|xuy)#M#qC|icBA~R%6M*&npp9OT#pigC=nPp5g7fdQCeDBTwIKaKxO%EOa#U(w2IzM!^(@?E$JU80&VS` zsw4ubW>b_1{D(wfc2d$OhEe0SngVs&z)y})BJlKi*ZoJ2WgLpv7LrQ@Xd0=N2vB3; zSaOMgR;yDh5zy*l)Jg<&+6m=42}FRVDYX&-MAM;h_SjzWOGMK|6M@hlJ|_?D1b{O~ zcb%xIR|gRYCCsVwSC1dqf#;_$G^l_GXhlEMv$c(piwF||u`vwu!e-l0Qj(pWefUUx zZQbpLdh413tIzMB(#G&_!c^|xjwk0X-;976L=pjnXgn@jo3O}(`?iG^i6#O_)CkmG zxeWl9>h6da$t42Xkw=pC+TE}fa*4p0M-sV20F9?}B#;Q$d%jF+*QfVdjmwBCrAMCe isv!dMU5CLC`)2?-k0%YdqHBTx0000b%7 literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/colorpicker/custom_rgb_b.png b/app/assets/images/ruling_template/colorpicker/custom_rgb_b.png new file mode 100755 index 0000000000000000000000000000000000000000..80764e5d6dd8aac3c5ef87d83b45d29780af1fe9 GIT binary patch literal 1008 zcmVh+v*8l*BQUCyPMF0TmW&i*=2LJ#e`2#0~ zRsaA4c1c7*RCwC#nrlcDK^(y6c4ze-dVNsvS$Lk7-d#%KDZNO9B8i}H)rSZIAqqt8 z0YMQxK1gMO7GYLYP(hF%0x2*QLy#1V@^M=3*;VR^9(UeDy}aA)!`iamU9KIiH$ywj zhuOK=n;*mfzdQ50Qw)ExxjjCBThS(Jpxfh1O-aHI-9F`j004$z0EPtu00M#F|Aj7f zhG-Kt;^>QkKy=@(+mI#^_t>{dQ7Uu;MwBWt`i+KWzHKxWRFsz@h)w_i7?usGHrkT0 zKD)TsoR@FvXls4b(GxyKYINaT<}LZ*vqJ!YN*N!1=fMNzxw_27Kw#GGrD;0r$o{Em zr*Oc+f?rZ}o~pp02LO~789ois!r37JfFKm%ceb>?)2NlMS?`CQ&YGI)1dVFi;abap z;i(3Ot;S6{u01$1wk*~o=Qus0RH+$;@h{9dT^@(i9mA9r5-&q%BL(iMs>(uxJ`fB( zYkAvrw{d&PJy!bo78ZWG&G~w+(Qlzc)0AaHD_6$tGgjLqx8AwgnFK+EkC766sd6FC zva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#9{gzl=qFW|hX6M^<+t`|yc1Y?-gyyEotInm#MOm!f^^y*-dYoVJ8o0wy4TmX zR?7dfn;bc9{iI8VpES5yofZaYh;TjCpK_UhilywQPp{V&o!)zNr-EuAP#7%xRC{Am z6GR!1|0e8}W%vqnuQi`zyC%VuOt~~QLec?j5=hH8t&PuqF6Zm0mDYFhgqkAab@NoR n(3#>M@3IhYo&TccjBE_r(UXjnZhw#mdW^x-)z4*}Q$iB}AxU+4 literal 0 HcmV?d00001 diff --git a/app/assets/images/ruling_template/npa.png b/app/assets/images/ruling_template/npa.png new file mode 100644 index 0000000000000000000000000000000000000000..58b8f774b8854f646a00f685b63215c1b8451585 GIT binary patch literal 9202 zcmeHt=Rcco*uJgQXsM!Riw-S{nnkNxv#1dxV#a8x-PoHJ{SvJfv31x4)!2I^G_i_= z5L=8GMTv^>q;GzI!|(Gvz2DsTi|fA5^K)LubsWd_Ij_WLMmp@QS6FFiXxR01ADdF& zWEvXUq;pKvFDBu8%QQ5iGe$uzYVb*bUVjX`%Mw-rfue4o~Ro!<20iJSkhv+YttKj-qVe!45VUg3%}qD}8J< z?0)nGrYyM&{z^QG)m;xUxqRp74fzuqvsneK97TynY;n;=Y(3M4uh}c^Uhu!c)b-Ge z$!V*oi^+m7p^=;3vEUZHY@nGV{cY-?#OS-jAERN-rPa|q)ImKD`JVrHh#{Cybg)tf zIf=5}a}gzaNxpP=O${siFYLb}|AW-O4fKDJF6uDT@#-6n8Tlt0Zs<;qfa>LU@oGzc z!?D7zs!y_Kk6l%;HBiLyrgx;x>7SuU>Bz%wk#sG=g$w9U9FUS_QD&9CUDSh9-{VtU z`>BEkg))1lf%L)HpB>?rMa~XU-#n-4WM?`#BYrI#M;?tHMzo(C2+Rtd{)!ig6d(`B zYy9RzHMXB@dZU6-%1GICk>fe$#XYd_9&Ay0Po5Wbwwuuo;_!!cC#f7$Qmc+bs zNH8&>HC^=I8GQ%D1n18!0*QZ4wj(1|ewaYzh^wkZzu#X(!ZEYwr57oip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;yZVo?hk|3% z1_t;mQ~Sqbgs3ydl>4E{>e%VNkAE075koHGQkIOALAu$IV4kqFPLIGaq3ZoW#-FbA z0qVtF^+uNv=+@g+wPL~n2b2)2qC=a&hnP;E?BH>(Vqw-UvrTUEcr!qlkPgvgWoz|l z{IzG5=348Qy+ATKw4%|&7CPZR&+s@iytdQVAz^mrDI(bPGmej>4~(w1ravv-3w&bf z<52B=08hp#b+#OqG?YN$PTiFC%aYKRGjA`mlSr&%ib7yzFeA;yR;2AfD($t>`O~PuS&f?qRWVfqw#LQ)(QQe3IPR3x9%vq1mzqs4 ze}F$n`f5eFlx;Xj8uZLP#ue;9=da41_Q{%hZ`*S2?n(H>v#GrJ zx7_(v8NNi5KxOUnqwTYOh|YCF`yy7)U1!BRz1`OLlp4X7RvH`^ok{Jwx>-D!u#vyu zU!Sft=jtj-%(Fgm@E)M{P=Pa1*_qL>P}lv~Rt0J^)gzeR%az(=%^c@Ez*1YUmCNi6 z|0eifS_7kJ&wkO+&{zJw3-AvU|MtZ{ZutM6AJ3SB+MoM?BVb$9yF4^{PmCVJA34PQ E55Kzhga7~l literal 0 HcmV?d00001 diff --git a/app/assets/javascripts/ruling_template/application.js b/app/assets/javascripts/ruling_template/application.js new file mode 100644 index 0000000..8913b40 --- /dev/null +++ b/app/assets/javascripts/ruling_template/application.js @@ -0,0 +1,13 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require_tree . diff --git a/app/assets/javascripts/ruling_template/colorpicker.js b/app/assets/javascripts/ruling_template/colorpicker.js new file mode 100755 index 0000000..10a2b22 --- /dev/null +++ b/app/assets/javascripts/ruling_template/colorpicker.js @@ -0,0 +1,484 @@ +/** + * + * Color picker + * Author: Stefan Petre www.eyecon.ro + * + * Dual licensed under the MIT and GPL licenses + * + */ +(function ($) { + var ColorPicker = function () { + var + ids = {}, + inAction, + charMin = 65, + visible, + tpl = '
', + defaults = { + eventName: 'click', + onShow: function () {}, + onBeforeShow: function(){}, + onHide: function () {}, + onChange: function () {}, + onSubmit: function () {}, + color: 'ff0000', + livePreview: true, + flat: false + }, + fillRGBFields = function (hsb, cal) { + var rgb = HSBToRGB(hsb); + $(cal).data('colorpicker').fields + .eq(1).val(rgb.r).end() + .eq(2).val(rgb.g).end() + .eq(3).val(rgb.b).end(); + }, + fillHSBFields = function (hsb, cal) { + $(cal).data('colorpicker').fields + .eq(4).val(hsb.h).end() + .eq(5).val(hsb.s).end() + .eq(6).val(hsb.b).end(); + }, + fillHexFields = function (hsb, cal) { + $(cal).data('colorpicker').fields + .eq(0).val(HSBToHex(hsb)).end(); + }, + setSelector = function (hsb, cal) { + $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100})); + $(cal).data('colorpicker').selectorIndic.css({ + left: parseInt(150 * hsb.s/100, 10), + top: parseInt(150 * (100-hsb.b)/100, 10) + }); + }, + setHue = function (hsb, cal) { + $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10)); + }, + setCurrentColor = function (hsb, cal) { + $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb)); + }, + setNewColor = function (hsb, cal) { + $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb)); + }, + keyDown = function (ev) { + var pressedKey = ev.charCode || ev.keyCode || -1; + if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) { + return false; + } + var cal = $(this).parent().parent(); + if (cal.data('colorpicker').livePreview === true) { + change.apply(this); + } + }, + change = function (ev) { + var cal = $(this).parent().parent(), col; + if (this.parentNode.className.indexOf('_hex') > 0) { + cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value)); + } else if (this.parentNode.className.indexOf('_hsb') > 0) { + cal.data('colorpicker').color = col = fixHSB({ + h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10), + s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10), + b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10) + }); + } else { + cal.data('colorpicker').color = col = RGBToHSB(fixRGB({ + r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10), + g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10), + b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10) + })); + } + if (ev) { + fillRGBFields(col, cal.get(0)); + fillHexFields(col, cal.get(0)); + fillHSBFields(col, cal.get(0)); + } + setSelector(col, cal.get(0)); + setHue(col, cal.get(0)); + setNewColor(col, cal.get(0)); + cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]); + }, + blur = function (ev) { + var cal = $(this).parent().parent(); + cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus'); + }, + focus = function () { + charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65; + $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus'); + $(this).parent().addClass('colorpicker_focus'); + }, + downIncrement = function (ev) { + var field = $(this).parent().find('input').focus(); + var current = { + el: $(this).parent().addClass('colorpicker_slider'), + max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255), + y: ev.pageY, + field: field, + val: parseInt(field.val(), 10), + preview: $(this).parent().parent().data('colorpicker').livePreview + }; + $(document).bind('mouseup', current, upIncrement); + $(document).bind('mousemove', current, moveIncrement); + }, + moveIncrement = function (ev) { + ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10)))); + if (ev.data.preview) { + change.apply(ev.data.field.get(0), [true]); + } + return false; + }, + upIncrement = function (ev) { + change.apply(ev.data.field.get(0), [true]); + ev.data.el.removeClass('colorpicker_slider').find('input').focus(); + $(document).unbind('mouseup', upIncrement); + $(document).unbind('mousemove', moveIncrement); + return false; + }, + downHue = function (ev) { + var current = { + cal: $(this).parent(), + y: $(this).offset().top + }; + current.preview = current.cal.data('colorpicker').livePreview; + $(document).bind('mouseup', current, upHue); + $(document).bind('mousemove', current, moveHue); + }, + moveHue = function (ev) { + change.apply( + ev.data.cal.data('colorpicker') + .fields + .eq(4) + .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10)) + .get(0), + [ev.data.preview] + ); + return false; + }, + upHue = function (ev) { + fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); + fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); + $(document).unbind('mouseup', upHue); + $(document).unbind('mousemove', moveHue); + return false; + }, + downSelector = function (ev) { + var current = { + cal: $(this).parent(), + pos: $(this).offset() + }; + current.preview = current.cal.data('colorpicker').livePreview; + $(document).bind('mouseup', current, upSelector); + $(document).bind('mousemove', current, moveSelector); + }, + moveSelector = function (ev) { + change.apply( + ev.data.cal.data('colorpicker') + .fields + .eq(6) + .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10)) + .end() + .eq(5) + .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10)) + .get(0), + [ev.data.preview] + ); + return false; + }, + upSelector = function (ev) { + fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); + fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); + $(document).unbind('mouseup', upSelector); + $(document).unbind('mousemove', moveSelector); + return false; + }, + enterSubmit = function (ev) { + $(this).addClass('colorpicker_focus'); + }, + leaveSubmit = function (ev) { + $(this).removeClass('colorpicker_focus'); + }, + clickSubmit = function (ev) { + var cal = $(this).parent(); + var col = cal.data('colorpicker').color; + cal.data('colorpicker').origColor = col; + setCurrentColor(col, cal.get(0)); + cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el); + }, + show = function (ev) { + var cal = $('#' + $(this).data('colorpickerId')); + cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]); + var pos = $(this).offset(); + var viewPort = getViewport(); + var top = pos.top + this.offsetHeight; + var left = pos.left; + if (top + 176 > viewPort.t + viewPort.h) { + top -= this.offsetHeight + 176; + } + if (left + 356 > viewPort.l + viewPort.w) { + left -= 356; + } + cal.css({left: left + 'px', top: top + 'px'}); + if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) { + cal.show(); + } + $(document).bind('mousedown', {cal: cal}, hide); + return false; + }, + hide = function (ev) { + if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) { + if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) { + ev.data.cal.hide(); + } + $(document).unbind('mousedown', hide); + } + }, + isChildOf = function(parentEl, el, container) { + if (parentEl == el) { + return true; + } + if (parentEl.contains) { + return parentEl.contains(el); + } + if ( parentEl.compareDocumentPosition ) { + return !!(parentEl.compareDocumentPosition(el) & 16); + } + var prEl = el.parentNode; + while(prEl && prEl != container) { + if (prEl == parentEl) + return true; + prEl = prEl.parentNode; + } + return false; + }, + getViewport = function () { + var m = document.compatMode == 'CSS1Compat'; + return { + l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft), + t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop), + w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth), + h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight) + }; + }, + fixHSB = function (hsb) { + return { + h: Math.min(360, Math.max(0, hsb.h)), + s: Math.min(100, Math.max(0, hsb.s)), + b: Math.min(100, Math.max(0, hsb.b)) + }; + }, + fixRGB = function (rgb) { + return { + r: Math.min(255, Math.max(0, rgb.r)), + g: Math.min(255, Math.max(0, rgb.g)), + b: Math.min(255, Math.max(0, rgb.b)) + }; + }, + fixHex = function (hex) { + var len = 6 - hex.length; + if (len > 0) { + var o = []; + for (var i=0; i -1) ? hex.substring(1) : hex), 16); + return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)}; + }, + HexToHSB = function (hex) { + return RGBToHSB(HexToRGB(hex)); + }, + RGBToHSB = function (rgb) { + var hsb = { + h: 0, + s: 0, + b: 0 + }; + var min = Math.min(rgb.r, rgb.g, rgb.b); + var max = Math.max(rgb.r, rgb.g, rgb.b); + var delta = max - min; + hsb.b = max; + if (max != 0) { + + } + hsb.s = max != 0 ? 255 * delta / max : 0; + if (hsb.s != 0) { + if (rgb.r == max) { + hsb.h = (rgb.g - rgb.b) / delta; + } else if (rgb.g == max) { + hsb.h = 2 + (rgb.b - rgb.r) / delta; + } else { + hsb.h = 4 + (rgb.r - rgb.g) / delta; + } + } else { + hsb.h = -1; + } + hsb.h *= 60; + if (hsb.h < 0) { + hsb.h += 360; + } + hsb.s *= 100/255; + hsb.b *= 100/255; + return hsb; + }, + HSBToRGB = function (hsb) { + var rgb = {}; + var h = Math.round(hsb.h); + var s = Math.round(hsb.s*255/100); + var v = Math.round(hsb.b*255/100); + if(s == 0) { + rgb.r = rgb.g = rgb.b = v; + } else { + var t1 = v; + var t2 = (255-s)*v/255; + var t3 = (t1-t2)*(h%60)/60; + if(h==360) h = 0; + if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3} + else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3} + else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3} + else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3} + else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3} + else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3} + else {rgb.r=0; rgb.g=0; rgb.b=0} + } + return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)}; + }, + RGBToHex = function (rgb) { + var hex = [ + rgb.r.toString(16), + rgb.g.toString(16), + rgb.b.toString(16) + ]; + $.each(hex, function (nr, val) { + if (val.length == 1) { + hex[nr] = '0' + val; + } + }); + return hex.join(''); + }, + HSBToHex = function (hsb) { + return RGBToHex(HSBToRGB(hsb)); + }, + restoreOriginal = function () { + var cal = $(this).parent(); + var col = cal.data('colorpicker').origColor; + cal.data('colorpicker').color = col; + fillRGBFields(col, cal.get(0)); + fillHexFields(col, cal.get(0)); + fillHSBFields(col, cal.get(0)); + setSelector(col, cal.get(0)); + setHue(col, cal.get(0)); + setNewColor(col, cal.get(0)); + }; + return { + init: function (opt) { + opt = $.extend({}, defaults, opt||{}); + if (typeof opt.color == 'string') { + opt.color = HexToHSB(opt.color); + } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) { + opt.color = RGBToHSB(opt.color); + } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) { + opt.color = fixHSB(opt.color); + } else { + return this; + } + return this.each(function () { + if (!$(this).data('colorpickerId')) { + var options = $.extend({}, opt); + options.origColor = opt.color; + var id = 'collorpicker_' + parseInt(Math.random() * 1000); + $(this).data('colorpickerId', id); + var cal = $(tpl).attr('id', id); + if (options.flat) { + cal.appendTo(this).show(); + } else { + cal.appendTo(document.body); + } + options.fields = cal + .find('input') + .bind('keyup', keyDown) + .bind('change', change) + .bind('blur', blur) + .bind('focus', focus); + cal + .find('span').bind('mousedown', downIncrement).end() + .find('>div.colorpicker_current_color').bind('click', restoreOriginal); + options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector); + options.selectorIndic = options.selector.find('div div'); + options.el = this; + options.hue = cal.find('div.colorpicker_hue div'); + cal.find('div.colorpicker_hue').bind('mousedown', downHue); + options.newColor = cal.find('div.colorpicker_new_color'); + options.currentColor = cal.find('div.colorpicker_current_color'); + cal.data('colorpicker', options); + cal.find('div.colorpicker_submit') + .bind('mouseenter', enterSubmit) + .bind('mouseleave', leaveSubmit) + .bind('click', clickSubmit); + fillRGBFields(options.color, cal.get(0)); + fillHSBFields(options.color, cal.get(0)); + fillHexFields(options.color, cal.get(0)); + setHue(options.color, cal.get(0)); + setSelector(options.color, cal.get(0)); + setCurrentColor(options.color, cal.get(0)); + setNewColor(options.color, cal.get(0)); + if (options.flat) { + cal.css({ + position: 'relative', + display: 'block' + }); + } else { + $(this).bind(options.eventName, show); + } + } + }); + }, + showPicker: function() { + return this.each( function () { + if ($(this).data('colorpickerId')) { + show.apply(this); + } + }); + }, + hidePicker: function() { + return this.each( function () { + if ($(this).data('colorpickerId')) { + $('#' + $(this).data('colorpickerId')).hide(); + } + }); + }, + setColor: function(col) { + if (typeof col == 'string') { + col = HexToHSB(col); + } else if (col.r != undefined && col.g != undefined && col.b != undefined) { + col = RGBToHSB(col); + } else if (col.h != undefined && col.s != undefined && col.b != undefined) { + col = fixHSB(col); + } else { + return this; + } + return this.each(function(){ + if ($(this).data('colorpickerId')) { + var cal = $('#' + $(this).data('colorpickerId')); + cal.data('colorpicker').color = col; + cal.data('colorpicker').origColor = col; + fillRGBFields(col, cal.get(0)); + fillHSBFields(col, cal.get(0)); + fillHexFields(col, cal.get(0)); + setHue(col, cal.get(0)); + setSelector(col, cal.get(0)); + setCurrentColor(col, cal.get(0)); + setNewColor(col, cal.get(0)); + } + }); + } + }; + }(); + $.fn.extend({ + ColorPicker: ColorPicker.init, + ColorPickerHide: ColorPicker.hidePicker, + ColorPickerShow: ColorPicker.showPicker, + ColorPickerSetColor: ColorPicker.setColor + }); +})(jQuery) \ No newline at end of file diff --git a/app/assets/stylesheets/ruling_template/application.css b/app/assets/stylesheets/ruling_template/application.css new file mode 100644 index 0000000..f9cd5b3 --- /dev/null +++ b/app/assets/stylesheets/ruling_template/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/app/assets/stylesheets/ruling_template/colorpicker.css b/app/assets/stylesheets/ruling_template/colorpicker.css new file mode 100755 index 0000000..11f0843 --- /dev/null +++ b/app/assets/stylesheets/ruling_template/colorpicker.css @@ -0,0 +1,161 @@ +.colorpicker { + width: 356px; + height: 176px; + overflow: hidden; + position: absolute; + background: url(/assets/ruling_template/colorpicker/colorpicker_background.png); + font-family: Arial, Helvetica, sans-serif; + display: none; +} +.colorpicker_color { + width: 150px; + height: 150px; + left: 14px; + top: 13px; + position: absolute; + background: #f00; + overflow: hidden; + cursor: crosshair; +} +.colorpicker_color div { + position: absolute; + top: 0; + left: 0; + width: 150px; + height: 150px; + background: url(/assets/ruling_template/colorpicker/colorpicker_overlay.png); +} +.colorpicker_color div div { + position: absolute; + top: 0; + left: 0; + width: 11px; + height: 11px; + overflow: hidden; + background: url(/assets/ruling_template/colorpicker/colorpicker_select.gif); + margin: -5px 0 0 -5px; +} +.colorpicker_hue { + position: absolute; + top: 13px; + left: 171px; + width: 35px; + height: 150px; + cursor: n-resize; +} +.colorpicker_hue div { + position: absolute; + width: 35px; + height: 9px; + overflow: hidden; + background: url(/assets/ruling_template/colorpicker/colorpicker_indic.gif) left top; + margin: -4px 0 0 0; + left: 0px; +} +.colorpicker_new_color { + position: absolute; + width: 60px; + height: 30px; + left: 213px; + top: 13px; + background: #f00; +} +.colorpicker_current_color { + position: absolute; + width: 60px; + height: 30px; + left: 283px; + top: 13px; + background: #f00; +} +.colorpicker input { + background-color: transparent; + border: 1px solid transparent; + position: absolute; + font-size: 10px; + font-family: Arial, Helvetica, sans-serif; + color: #898989; + top: 4px; + right: 11px; + text-align: right; + margin: 0; + padding: 0; + height: 11px; +} +.colorpicker_hex { + position: absolute; + width: 72px; + height: 22px; + background: url(/assets/ruling_template/colorpicker/colorpicker_hex.png) top; + left: 212px; + top: 142px; +} +.colorpicker_hex input { + right: 6px; +} +.colorpicker_field { + height: 22px; + width: 62px; + background-position: top; + position: absolute; +} +.colorpicker_field span { + position: absolute; + width: 12px; + height: 22px; + overflow: hidden; + top: 0; + right: 0; + cursor: n-resize; +} +.colorpicker_rgb_r { + background-image: url(/assets/ruling_template/colorpicker/colorpicker_rgb_r.png); + top: 52px; + left: 212px; +} +.colorpicker_rgb_g { + background-image: url(/assets/ruling_template/colorpicker/colorpicker_rgb_g.png); + top: 82px; + left: 212px; +} +.colorpicker_rgb_b { + background-image: url(/assets/ruling_template/colorpicker/colorpicker_rgb_b.png); + top: 112px; + left: 212px; +} +.colorpicker_hsb_h { + background-image: url(/assets/ruling_template/colorpicker/colorpicker_hsb_h.png); + top: 52px; + left: 282px; +} +.colorpicker_hsb_s { + background-image: url(/assets/ruling_template/colorpicker/colorpicker_hsb_s.png); + top: 82px; + left: 282px; +} +.colorpicker_hsb_b { + background-image: url(/assets/ruling_template/colorpicker/colorpicker_hsb_b.png); + top: 112px; + left: 282px; +} +.colorpicker_submit { + position: absolute; + width: 22px; + height: 22px; + background: url(/assets/ruling_template/colorpicker/colorpicker_submit.png) top; + left: 322px; + top: 142px; + overflow: hidden; +} +.colorpicker_focus { + background-position: center; +} +.colorpicker_hex.colorpicker_focus { + background-position: bottom; +} +.colorpicker_submit.colorpicker_focus { + background-position: bottom; +} +.colorpicker_slider { + background-position: bottom; +} diff --git a/app/assets/stylesheets/ruling_template/template.scss b/app/assets/stylesheets/ruling_template/template.scss new file mode 100644 index 0000000..2b122f4 --- /dev/null +++ b/app/assets/stylesheets/ruling_template/template.scss @@ -0,0 +1,286 @@ +ul#template-holder { + list-style: none; + li.template { + display: inline-block; + margin: 15px 5px; + width: 250px; + max-height: 400px; + background-color: #cecece; + + img { + padding: 10px; + width: 230px; + } + + div.template-title{ + font-size: 20px; + text-align: center; + background-color: rgba(0,0,0, 0.5); + padding: 5px; + + a{ + color: #fff; + text-decoration: none; + } + + &:hover{ + background-color: rgba(100,100,100,0.5); + a{ + color: #000; + } + } + + } + } +} + +.customWidget { + top: 0; + left: 0; + width: 36px; + height: 36px; + background: url(/assets/ruling_template/colorpicker/select2.png); + display: inline-block; + margin-right: 10px; + div.color-holder { + position: relative; + top: 4px; + left: 4px; + width: 28px; + height: 28px; + background: url(/assets/ruling_template/colorpicker/select2.png) center; + } +} +.colorpicker input { + color: #0000ff; + width: 50px; +} + +#fileupload { + position: relative; + clear: both; + overflow: hidden; + margin: 10px 0 15px; + height: 254px; + border: 1px solid #d4d4d4; + border-radius: 4px; + background-color: #FDFDFD; + /*-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, .15) inset; + box-shadow: 0px 0px 10px rgba(0, 0, 0, .15) inset;*/ + table { + margin: 0; + } + .fileupload-buttonbar { + .navbar { + margin-bottom: 0; + .add-photo { + border: none; + border-right: 1px solid #d4d4d4; + background-color: transparent; + padding: 10px 15px 10px; + color: #777777; + text-decoration: none; + text-shadow: 0 1px 0 #ffffff; + &:hover { + color: #333333; + text-decoration: none; + background-color: #EDEDED; + } + } + .fileinput-button { + position: relative; + overflow: hidden; + input { + position: absolute; + top: 0; + right: 0; + margin: 0; + font-size: 23px; + opacity: 0; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: alpha(opacity=0); + cursor: pointer; + -webkit-transform: translate(-300px, 0) scale(4); + -moz-transform: translate(-300px, 0) scale(4); + -ms-transform: translate(-300px, 0) scale(4); + -o-transform: translate(-300px, 0) scale(4); + transform: translate(-300px, 0) scale(4); + direction: ltr; + } + } + } + .navbar-inner { + border-width: 0 0 1px; + border-radius: 4px 4px 0 0; + padding: 0; + } + } + + + .fileupload-progress{ + position: relative; + z-index: 3; + .progress { + position: absolute; + right: 0; + left: 0; + margin-bottom: 0; + height: 5px; + border-radius: 0; + background-color: transparent; + background-image: none; + } + .progress-success.progress-striped{ + .bar { + background-color: #0088CC; + } + } + .progress-extended { + position: absolute; + top: 1px; + right: 0; + padding-right: 15px; + color: #0088CC; + text-align: right; + text-shadow: 0 1px 0 #ffffff; + letter-spacing: -0.1em; + font-size: 12px; + font-family: 'Varela Round', sans-serif; + line-height: 40px; + } + } + + #dropzone { + margin: 15px 10px 10px; + padding: 30px; + text-align: center; + font-size: 2em; + font-family: 'Raleway'; + line-height: 1.2em; + color: #e4e4e4; + div[data-icons] { + font-size: 4em; + height: 70px; + padding-top: 30px; + text-shadow: 0px -1px 0px #ececec; + color: #f5f5f5; + } + &.drop{ + position: absolute; + top: 37px; + left: 0; + right: 0; + bottom: 0; + border: 2px dashed #0088CC; + border-radius: 10px; + color: #0088CC; + background-color: #FFFFFF; + z-index: 0; + div[data-icons] { + text-shadow: 0px -1px 0px #0c5f80; + color: #0088CC; + } + } + &.fade{ + opacity: .3; + } + &.in { + opacity: .7; + z-index: 2; + border-color: #faa732; + color: #faa732; + div[data-icons] { + text-shadow: 0px -1px 0px #a28a10; + color: #faa732; + } + } + } + + #file-list { + position: relative; + z-index: 1; + height: 209px; + margin: 2px 0; + .pane { + margin-right: 2px; + } + .files { + margin: 0; + padding: 10px 14px 10px 10px; + list-style: none; + } + .files > li { + padding: 10px; + } + .files > li:nth-child(even) { + background-color: #e9e9e9; + border-radius: 3px; + } + .files ul { + position: relative; + margin: 0; + padding: 0; + list-style: none; + li { + float: left; + } + li.action-bnt { + float: right; + } + } + .preview { + width: 80px; + min-height: 1px; + margin-right: 10px; + text-align: center; + } + .name { + width: 150px; + max-width: 250px; + margin-left: 15px; + } + .progress { + position: absolute; + left: -5px; + right: -5px; + bottom: -5px; + margin-bottom: 0; + height: 5px; + box-shadow: none; + background-color: transparent; + background-image: none; + } + .size { + width: 80px; + } + .action-bnt { + text-align: right; + } + } +} + +.preview-image-area{ + border: 1px dashed #cecece; + border-radius: 10px; + width: auto; + min-height: 250px; + padding: 15px; + cursor: move; + .uploaded-image{ + display: inline-block; + margin-right: 10px; + max-width: 200px; + margin-bottom: 10px; + text-align: center; + img{ + width: 200px; + } + a{ + margin-top: 5px; + } + } +} + +#psdfileupload{ + margin: 0 0; +} diff --git a/app/controllers/admin/ruling_templates_controller.rb b/app/controllers/admin/ruling_templates_controller.rb new file mode 100644 index 0000000..0300b6c --- /dev/null +++ b/app/controllers/admin/ruling_templates_controller.rb @@ -0,0 +1,97 @@ +class Admin::RulingTemplatesController < OrbitAdminController + + def index + @templates = RTemplate.all.desc(:created_at).page(params[:page]).per(10) + end + + def new + @template = RTemplate.new + end + + def edit + @template = RTemplate.find(params[:id]) + end + + def create + template = RTemplate.new(template_params) + template.save + redirect_to upload_files_admin_ruling_template_path(template.id) + end + + def update + template = RTemplate.find(params[:id]) + template.update_attributes(template_params) + template.save + redirect_to upload_files_admin_ruling_template_path(template.id) + end + + def show + @template = RTemplate.find(params[:id]) + render :layout => false + end + + def upload_files + @template = RTemplate.find(params[:id]) + end + + def upload_image + template = RTemplate.find(params[:id]) + image = TemplateImageFile.new(template_image_params) + image.order = (template.template_image_files.max(:order) + 1 rescue 0) + image.r_template = template + image.save + render :json => {"files" => [{"thumbnail_url"=>image.image_file.thumb.url}]}.to_json + end + + def change_image_order + image_ids = params[:images] + image_ids.each_with_index do |img, idx| + image = TemplateImageFile.find(img) + image.order = idx + image.save + end + render :json => {"success" => true}.to_json + end + + def delete_image + image = TemplateImageFile.find(params[:id]) + image.destroy + render :json => {"success" => true}.to_json + end + + def upload_temp_file + filepath = params[:path] + file = params[:psdfile] + File.open(filepath,"ab"){ |f| f.write(file.read) } + render :json => {"success" => true}.to_json + end + + def get_temp_dir_name + dirname = Digest::MD5.hexdigest(Time.now.to_s) + directory = "public/ruling_template/#{dirname}" + FileUtils.mkdir_p(directory) unless File.exists?(directory) + path_to_file = "#{directory}/#{params[:filename]}" + File.open(path_to_file,"w") + template = RTemplate.find(params[:id]) + if !template.template_psd_file.nil? && !template.template_psd_file.psd_zip.url.nil? + template.template_psd_file.destroy + end + psd = TemplatePsdFile.new + psd.psd_zip = Rails.root.join(path_to_file).open + psd.r_template = template + psd.save + FileUtils.remove_dir(directory) + render :json => {"psd_id" => psd.id.to_s, "path" => psd.psd_zip.path}.to_json + end + + private + + def template_params + params.require(:r_template).permit! + end + + def template_image_params + params.require(:template_image_file).permit! + end + +end \ No newline at end of file diff --git a/app/controllers/ruling_templates_controller.rb b/app/controllers/ruling_templates_controller.rb new file mode 100644 index 0000000..d4b1774 --- /dev/null +++ b/app/controllers/ruling_templates_controller.rb @@ -0,0 +1,4 @@ +class RulingTemplatesController < ApplicationController + def index + end +end \ No newline at end of file diff --git a/app/helpers/ruling_template/application_helper.rb b/app/helpers/ruling_template/application_helper.rb new file mode 100644 index 0000000..0c048b0 --- /dev/null +++ b/app/helpers/ruling_template/application_helper.rb @@ -0,0 +1,4 @@ +module RulingTemplate + module ApplicationHelper + end +end diff --git a/app/models/r_template.rb b/app/models/r_template.rb new file mode 100644 index 0000000..dc7d340 --- /dev/null +++ b/app/models/r_template.rb @@ -0,0 +1,27 @@ +class RTemplate + include Mongoid::Document + include Mongoid::Timestamps + include OrbitModel::Status + include OrbitTag::Taggable + include OrbitCategory::Categorizable + include Slug + + + field :title, as: :slug_title, :localize => true + field :description, :localize => true + field :price, :type => Integer + field :allowed, :type => Boolean, :default => true + field :user_id + field :colors, :type => Array, :default => [] + field :sold, :type => Boolean, :default => false + + + mount_uploader :template_zip, AssetUploader + + has_many :template_image_files, :autosave => true, :dependent => :destroy + has_one :template_psd_file, :autosave => true, :dependent => :destroy + + accepts_nested_attributes_for :template_image_files, :allow_destroy => true + accepts_nested_attributes_for :template_psd_file, :allow_destroy => true + +end \ No newline at end of file diff --git a/app/models/template_image_file.rb b/app/models/template_image_file.rb new file mode 100644 index 0000000..72257e8 --- /dev/null +++ b/app/models/template_image_file.rb @@ -0,0 +1,10 @@ +class TemplateImageFile + include Mongoid::Document + include Mongoid::Timestamps + + mount_uploader :image_file, GalleryUploader + + field :order, :type => Integer, :default => 0 + + belongs_to :r_template +end \ No newline at end of file diff --git a/app/models/template_psd_file.rb b/app/models/template_psd_file.rb new file mode 100644 index 0000000..ecd1b28 --- /dev/null +++ b/app/models/template_psd_file.rb @@ -0,0 +1,8 @@ +class TemplatePsdFile + include Mongoid::Document + include Mongoid::Timestamps + + mount_uploader :psd_zip, AssetUploader + + belongs_to :r_template +end \ No newline at end of file diff --git a/app/views/admin/ruling_templates/_form.html.erb b/app/views/admin/ruling_templates/_form.html.erb new file mode 100644 index 0000000..f722ceb --- /dev/null +++ b/app/views/admin/ruling_templates/_form.html.erb @@ -0,0 +1,190 @@ +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%#= stylesheet_link_tag "lib/fileupload" %> + <%= stylesheet_link_tag "lib/main-list" %> + <%= stylesheet_link_tag "ruling_template/template" %> + <%= stylesheet_link_tag "ruling_template/colorpicker" %> +<% end %> +<% content_for :page_specific_javascript do %> + <%#= javascript_include_tag "lib/bootstrap-fileupload" %> + <%#= javascript_include_tag "lib/bootstrap-datetimepicker" %> + <%#= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> + <%= javascript_include_tag "lib/file-type" %> + <%= javascript_include_tag "lib/module-area" %> + <%= javascript_include_tag "ruling_template/colorpicker" %> +<% end %> + +
+ + + + + +
+ +
+
+ +
+ <%= select_category(f, @module_app) %> +
+
+
+ <%= f.label :price, t("ruling_template.price"), :class => "control-label muted" %> +
+ <%= f.number_field :price, :min => 0, :step => 1000 %> +
+
+
+ <%= f.label :colors, t("ruling_template.colors"), :class => "control-label muted" %> + +
+
+ <% if !@template.new_record? && !@template.colors.empty? %> + <% @template.colors.each do |color| %> +
+
+ +
+ <% end %> + <% end %> +
+
+
+
+ +
+
+ +
+ + + +
+
+
+ +
+
+ + <%= select_tags(f, @module_app) %> +
+ +
+
+ + + + +
+ <% @site_in_use_locales.each_with_index do |locale, i| %> +
"> + +
+ +
+ <%= f.fields_for :title_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t(:title), value: (@template.title_translations[locale] rescue nil) %> + <% end %> +
+
+ +
+ +
+
+ <%= f.fields_for :description_translations do |f| %> + <%= f.text_area locale, rows: 5, class: "input-block-level", value: (@template.description_translations[locale] rescue nil) %> + <% end %> +
+
+
+
+ <% end %> +
+
+ + +
+ <%= f.hidden_field :user_id, :value => current_user.id.to_s %> + <%= f.submit t('ruling_template.upload_files'), class: 'btn btn-primary' %> + <%= t("cancel") %> +
+ \ No newline at end of file diff --git a/app/views/admin/ruling_templates/_template.html.erb b/app/views/admin/ruling_templates/_template.html.erb new file mode 100644 index 0000000..5d132d3 --- /dev/null +++ b/app/views/admin/ruling_templates/_template.html.erb @@ -0,0 +1,12 @@ +
  • + + <% if template.template_image_files.empty? %> + + <% else %> + + <% end %> + + +
  • \ No newline at end of file diff --git a/app/views/admin/ruling_templates/edit.html.erb b/app/views/admin/ruling_templates/edit.html.erb new file mode 100644 index 0000000..27750f9 --- /dev/null +++ b/app/views/admin/ruling_templates/edit.html.erb @@ -0,0 +1,5 @@ +<%= form_for @template, url: admin_ruling_template_path(@template.id), html: {class: "form-horizontal main-forms", :id => "template-form"} do |f| %> +
    + <%= render :partial => 'form', locals: {f: f} %> +
    +<% end %> \ No newline at end of file diff --git a/app/views/admin/ruling_templates/index.html.erb b/app/views/admin/ruling_templates/index.html.erb new file mode 100644 index 0000000..88b495b --- /dev/null +++ b/app/views/admin/ruling_templates/index.html.erb @@ -0,0 +1,39 @@ +<%= csrf_meta_tags %> +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "ruling_template/template" %> +<% end %> +
      + <%= render :partial => "template", :collection => @templates %> +
    + + + \ No newline at end of file diff --git a/app/views/admin/ruling_templates/new.html.erb b/app/views/admin/ruling_templates/new.html.erb new file mode 100644 index 0000000..b968f98 --- /dev/null +++ b/app/views/admin/ruling_templates/new.html.erb @@ -0,0 +1,5 @@ +<%= form_for @template, url: admin_ruling_templates_path, html: {class: "form-horizontal main-forms", :id => "template-form"} do |f| %> +
    + <%= render :partial => 'form', locals: {f: f} %> +
    +<% end %> \ No newline at end of file diff --git a/app/views/admin/ruling_templates/show.html.erb b/app/views/admin/ruling_templates/show.html.erb new file mode 100644 index 0000000..225731d --- /dev/null +++ b/app/views/admin/ruling_templates/show.html.erb @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Template Number<%= @template.uid %>
    Created On<%= @template.created_at.strftime("%Y-%m-%d") %>
    Author<%= User.find(@template.user_id).name rescue "Deleted User" %>
    Category<%= @template.category.title rescue "" %>
    Description<%= @template.description %>
    Price<%= @template.price %> NTD.
    Published + <% if @template.allowed %> + Published + <% else %> + Not Published + <% end %> +
    Sold + <% if @template.sold %> + Sold + <% else %> + Not Sold + <% end %> +
    Colors +
      + <% @template.colors.each do |color| %> +
    • + <% end %> +
    +
    Colors +
      + <% @template.tags.each do |tag| %> +
    • <%= tag.name %>
    • + <% end %> +
    +
    Preview + <% if @template.template_image_files.empty? %> + No preview available. + <% else %> +
      + <% @template.template_image_files.each do |image| %> +
    • + <% end %> +
    + <% end %> +
    PSD + <% if @template.template_psd_file.nil? %> + No PSD available. + <% else %> + Download PSD + <% end %> +
    Template Zip + <% if @template.template_zip.nil? || @template.template_zip.url.nil? %> + No template available. + <% else %> + Download Template + <% end %> +
    \ No newline at end of file diff --git a/app/views/admin/ruling_templates/upload_files.html.erb b/app/views/admin/ruling_templates/upload_files.html.erb new file mode 100644 index 0000000..17dc3e1 --- /dev/null +++ b/app/views/admin/ruling_templates/upload_files.html.erb @@ -0,0 +1,369 @@ +<%= csrf_meta_tags %> +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "ruling_template/template" %> + +<% end %> +
    +

    <%= @template.title %>

    + <% if !@template.template_image_files.empty? %> + +
      + <% @template.template_image_files.asc(:order).each do |image| %> +
    • + + Delete +
    • + <% end %> +
    + <% end %> +
    + +
    + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    + Drop files here +
    + +
    + +
    +
    + +
    +
    +
    +
    + +
    + <% if !@template.template_psd_file.nil? && !@template.template_psd_file.psd_zip.url.nil? %> + Click here to download PSD + <% end %> + +
    + + + Select PSD File + + + + + + +
    +
    +
    +
    +
    +
    +
    + +
    + <% if !@template.template_zip.url.nil? %> + Click here to download Template + <% end %> + + <%= form_for @template, url: admin_ruling_template_path(@template.id) do |f| %> + + + Select Template File + <%= f.file_field :template_zip %> + + + <% end %> +
    +
    + Edit Template + Templates +
    +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/jquery-ui-sortable.min" %> + <%= javascript_include_tag "file-upload/vendor/jquery.ui.widget.js" %> + <%= javascript_include_tag "file-upload/tmpl.min.js" %> + <%= javascript_include_tag "file-upload/load-image.min.js" %> + <%= javascript_include_tag "file-upload/canvas-to-blob.min.js" %> + <%= javascript_include_tag "file-upload/jquery.iframe-transport.js" %> + <%= javascript_include_tag "file-upload/jquery.fileupload.js" %> + <%= javascript_include_tag "file-upload/jquery.fileupload-fp.js" %> + <%= javascript_include_tag "file-upload/jquery.fileupload-ui.js" %> + <%= javascript_include_tag "file-upload/drop-zone.js" %> + +<% end %> + + + + + \ No newline at end of file diff --git a/app/views/ruling_templates/index.html.erb b/app/views/ruling_templates/index.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..86833a8 --- /dev/null +++ b/bin/rails @@ -0,0 +1,12 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. + +ENGINE_ROOT = File.expand_path('../..', __FILE__) +ENGINE_PATH = File.expand_path('../../lib/ruling_template/engine', __FILE__) + +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) + +require 'rails/all' +require 'rails/engine/commands' diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..835411c --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,9 @@ +en: + ruling_template: + ruling_template: Templates + all: All + new: New Template + price: Price + upload_files: Upload Files + colors: Colors + add_color: Add Color \ No newline at end of file diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml new file mode 100644 index 0000000..b248714 --- /dev/null +++ b/config/locales/zh_tw.yml @@ -0,0 +1,9 @@ +zh_tw: + ruling_template: + ruling_template: Templates + all: All + new: New Template + price: Price + upload_files: Upload Files + colors: Colors + add_color: Add Color \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..cb6f67d --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,22 @@ +Rails.application.routes.draw do + + locales = Site.first.in_use_locales rescue I18n.available_locales + + scope "(:locale)", locale: Regexp.new(locales.join("|")) do + namespace :admin do + resources :ruling_templates do + member do + get "upload_files" + post "upload_image" + get "get_temp_dir_name" + delete "delete_image" + end + collection do + post "change_image_order" + post "upload_temp_file" + end + end + end + end + +end diff --git a/lib/ruling_template.rb b/lib/ruling_template.rb new file mode 100644 index 0000000..9b89497 --- /dev/null +++ b/lib/ruling_template.rb @@ -0,0 +1,4 @@ +require "ruling_template/engine" + +module RulingTemplate +end diff --git a/lib/ruling_template/engine.rb b/lib/ruling_template/engine.rb new file mode 100644 index 0000000..d39c651 --- /dev/null +++ b/lib/ruling_template/engine.rb @@ -0,0 +1,34 @@ +module RulingTemplate + class Engine < ::Rails::Engine + initializer "ruling_template" do + OrbitApp.registration "ruling_template", :type => "ModuleApp" do + module_label "ruling_template.ruling_template" + base_url File.expand_path File.dirname(__FILE__) + categorizable + authorizable + frontend_enabled + # data_count 1..30 + # set_keyword_contstraints ["/cpanel/"] + side_bar do + head_label_i18n 'ruling_template.ruling_template', icon_class: "icons-palette" + available_for "users" + active_for_controllers (['admin/ruling_templates']) + head_link_path "admin_ruling_templates_path" + + context_link 'ruling_template.all', + :link_path=>"admin_ruling_templates_path" , + :priority=>1, + :active_for_action=>{'admin/ruling_templates'=>"index"}, + :available_for => 'users' + + context_link 'ruling_template.new', + :link_path=>"new_admin_ruling_template_path" , + :priority=>1, + :active_for_action=>{'admin/ruling_templates'=>"new"}, + :available_for => 'users' + + end + end + end + end +end diff --git a/lib/ruling_template/version.rb b/lib/ruling_template/version.rb new file mode 100644 index 0000000..d3ce725 --- /dev/null +++ b/lib/ruling_template/version.rb @@ -0,0 +1,3 @@ +module RulingTemplate + VERSION = "0.0.1" +end diff --git a/lib/tasks/ruling_template_tasks.rake b/lib/tasks/ruling_template_tasks.rake new file mode 100644 index 0000000..7980724 --- /dev/null +++ b/lib/tasks/ruling_template_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :ruling_template do +# # Task goes here +# end diff --git a/ruling_template.gemspec b/ruling_template.gemspec new file mode 100644 index 0000000..817b989 --- /dev/null +++ b/ruling_template.gemspec @@ -0,0 +1,20 @@ +$:.push File.expand_path("../lib", __FILE__) + +# Maintain your gem's version: +require "ruling_template/version" + +# Describe your gem and declare its dependencies: +Gem::Specification.new do |s| + s.name = "ruling_template" + s.version = RulingTemplate::VERSION + s.authors = ["Harry Bomrah"] + s.email = ["harry@rulingcom.com"] + s.homepage = "http://www.rulingcom.com" + s.summary = "Module for Templates" + s.description = "Module for Templates" + s.license = "MIT" + + s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] + s.test_files = Dir["test/**/*"] + +end diff --git a/test/dummy/README.rdoc b/test/dummy/README.rdoc new file mode 100644 index 0000000..dd4e97e --- /dev/null +++ b/test/dummy/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/test/dummy/Rakefile b/test/dummy/Rakefile new file mode 100644 index 0000000..ba6b733 --- /dev/null +++ b/test/dummy/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Rails.application.load_tasks diff --git a/test/dummy/app/assets/images/.keep b/test/dummy/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/assets/javascripts/application.js b/test/dummy/app/assets/javascripts/application.js new file mode 100644 index 0000000..8913b40 --- /dev/null +++ b/test/dummy/app/assets/javascripts/application.js @@ -0,0 +1,13 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require_tree . diff --git a/test/dummy/app/assets/stylesheets/application.css b/test/dummy/app/assets/stylesheets/application.css new file mode 100644 index 0000000..f9cd5b3 --- /dev/null +++ b/test/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/test/dummy/app/controllers/application_controller.rb b/test/dummy/app/controllers/application_controller.rb new file mode 100644 index 0000000..d83690e --- /dev/null +++ b/test/dummy/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception +end diff --git a/test/dummy/app/controllers/concerns/.keep b/test/dummy/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/helpers/application_helper.rb b/test/dummy/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/test/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/test/dummy/app/mailers/.keep b/test/dummy/app/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/models/.keep b/test/dummy/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/models/concerns/.keep b/test/dummy/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/views/layouts/application.html.erb b/test/dummy/app/views/layouts/application.html.erb new file mode 100644 index 0000000..593a778 --- /dev/null +++ b/test/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Dummy + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> + <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/test/dummy/bin/bundle b/test/dummy/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/test/dummy/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/test/dummy/bin/rails b/test/dummy/bin/rails new file mode 100755 index 0000000..5191e69 --- /dev/null +++ b/test/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/test/dummy/bin/rake b/test/dummy/bin/rake new file mode 100755 index 0000000..1724048 --- /dev/null +++ b/test/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/test/dummy/bin/setup b/test/dummy/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /dev/null +++ b/test/dummy/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/test/dummy/config.ru b/test/dummy/config.ru new file mode 100644 index 0000000..bd83b25 --- /dev/null +++ b/test/dummy/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb new file mode 100644 index 0000000..21690aa --- /dev/null +++ b/test/dummy/config/application.rb @@ -0,0 +1,26 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +Bundler.require(*Rails.groups) +require "ruling_template" + +module Dummy + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end + diff --git a/test/dummy/config/boot.rb b/test/dummy/config/boot.rb new file mode 100644 index 0000000..6266cfc --- /dev/null +++ b/test/dummy/config/boot.rb @@ -0,0 +1,5 @@ +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) + +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) diff --git a/test/dummy/config/database.yml b/test/dummy/config/database.yml new file mode 100644 index 0000000..1c1a37c --- /dev/null +++ b/test/dummy/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/test/dummy/config/environment.rb b/test/dummy/config/environment.rb new file mode 100644 index 0000000..ee8d90d --- /dev/null +++ b/test/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb new file mode 100644 index 0000000..b55e214 --- /dev/null +++ b/test/dummy/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb new file mode 100644 index 0000000..5c1b32e --- /dev/null +++ b/test/dummy/config/environments/production.rb @@ -0,0 +1,79 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb new file mode 100644 index 0000000..1c19f08 --- /dev/null +++ b/test/dummy/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/test/dummy/config/initializers/assets.rb b/test/dummy/config/initializers/assets.rb new file mode 100644 index 0000000..01ef3e6 --- /dev/null +++ b/test/dummy/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/test/dummy/config/initializers/backtrace_silencers.rb b/test/dummy/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/test/dummy/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/test/dummy/config/initializers/cookies_serializer.rb b/test/dummy/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/test/dummy/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/test/dummy/config/initializers/filter_parameter_logging.rb b/test/dummy/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/test/dummy/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/test/dummy/config/initializers/inflections.rb b/test/dummy/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/test/dummy/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/test/dummy/config/initializers/mime_types.rb b/test/dummy/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/test/dummy/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/test/dummy/config/initializers/session_store.rb b/test/dummy/config/initializers/session_store.rb new file mode 100644 index 0000000..e766b67 --- /dev/null +++ b/test/dummy/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_dummy_session' diff --git a/test/dummy/config/initializers/to_time_preserves_timezone.rb b/test/dummy/config/initializers/to_time_preserves_timezone.rb new file mode 100644 index 0000000..8674be3 --- /dev/null +++ b/test/dummy/config/initializers/to_time_preserves_timezone.rb @@ -0,0 +1,10 @@ +# Be sure to restart your server when you modify this file. + +# Preserve the timezone of the receiver when calling to `to_time`. +# Ruby 2.4 will change the behavior of `to_time` to preserve the timezone +# when converting to an instance of `Time` instead of the previous behavior +# of converting to the local system timezone. +# +# Rails 5.0 introduced this config option so that apps made with earlier +# versions of Rails are not affected when upgrading. +ActiveSupport.to_time_preserves_timezone = true diff --git a/test/dummy/config/initializers/wrap_parameters.rb b/test/dummy/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..33725e9 --- /dev/null +++ b/test/dummy/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/test/dummy/config/locales/en.yml b/test/dummy/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/test/dummy/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb new file mode 100644 index 0000000..9f86626 --- /dev/null +++ b/test/dummy/config/routes.rb @@ -0,0 +1,4 @@ +Rails.application.routes.draw do + + mount RulingTemplate::Engine => "/ruling_template" +end diff --git a/test/dummy/config/secrets.yml b/test/dummy/config/secrets.yml new file mode 100644 index 0000000..cb03ec7 --- /dev/null +++ b/test/dummy/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: f229dd4974549a2d096402bd823f542d6e54df0f015422f7d7b954cb10e65c0256cff830c0972a9e736c007f69b4a0e972812f3a04bff16852ebd31e8089c27b + +test: + secret_key_base: 4fc4affd84263342fb1abb9eabbdab71ed9a5ca805f67c671e31b28f626e5a4aa808b169e6cac7ad02638ee862458836caeb0972694a912ddc66497affeb2638 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/test/dummy/lib/assets/.keep b/test/dummy/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/log/.keep b/test/dummy/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/public/404.html b/test/dummy/public/404.html new file mode 100644 index 0000000..b612547 --- /dev/null +++ b/test/dummy/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
    +
    +

    The page you were looking for doesn't exist.

    +

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

    +
    +

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

    +
    + + diff --git a/test/dummy/public/422.html b/test/dummy/public/422.html new file mode 100644 index 0000000..a21f82b --- /dev/null +++ b/test/dummy/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
    +
    +

    The change you wanted was rejected.

    +

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

    +
    +

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

    +
    + + diff --git a/test/dummy/public/500.html b/test/dummy/public/500.html new file mode 100644 index 0000000..061abc5 --- /dev/null +++ b/test/dummy/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
    +
    +

    We're sorry, but something went wrong.

    +
    +

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

    +
    + + diff --git a/test/dummy/public/favicon.ico b/test/dummy/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/navigation_test.rb b/test/integration/navigation_test.rb new file mode 100644 index 0000000..f5d1ec2 --- /dev/null +++ b/test/integration/navigation_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class NavigationTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end + diff --git a/test/ruling_template_test.rb b/test/ruling_template_test.rb new file mode 100644 index 0000000..b34d52f --- /dev/null +++ b/test/ruling_template_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class RulingTemplateTest < ActiveSupport::TestCase + test "truth" do + assert_kind_of Module, RulingTemplate + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..763f88f --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,21 @@ +# Configure Rails Environment +ENV["RAILS_ENV"] = "test" + +require File.expand_path("../../test/dummy/config/environment.rb", __FILE__) +ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)] +ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__) +require "rails/test_help" + +# Filter out Minitest backtrace while allowing backtrace from other libraries +# to be shown. +Minitest.backtrace_filter = Minitest::BacktraceFilter.new + +# Load support files +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } + +# Load fixtures from the engine +if ActiveSupport::TestCase.respond_to?(:fixture_path=) + ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) + ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path + ActiveSupport::TestCase.fixtures :all +end