hobo_w2ui 0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/Gemfile +14 -0
  4. data/Gemfile.lock +93 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.markdown +36 -0
  7. data/Rakefile +32 -0
  8. data/VERSION +1 -0
  9. data/app/helpers/hobo_w2ui_helper.rb +2 -0
  10. data/hobo_w2ui.gemspec +0 -0
  11. data/lib/hobo_w2ui.rb +14 -0
  12. data/lib/hobo_w2ui/railtie.rb +7 -0
  13. data/lib/hobo_w2ui/version.rb +3 -0
  14. data/lib/tasks/hobo_w2ui_tasks.rake +4 -0
  15. data/taglibs/hobo_w2ui.dryml +2 -0
  16. data/taglibs/installation_test.dryml +26 -0
  17. data/taglibs/w2ui-index-table.dryml +124 -0
  18. data/test/dummy/README.rdoc +28 -0
  19. data/test/dummy/Rakefile +6 -0
  20. data/test/dummy/app/assets/images/.keep +0 -0
  21. data/test/dummy/app/assets/javascripts/application.js +13 -0
  22. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  23. data/test/dummy/app/controllers/application_controller.rb +5 -0
  24. data/test/dummy/app/controllers/concerns/.keep +0 -0
  25. data/test/dummy/app/helpers/application_helper.rb +2 -0
  26. data/test/dummy/app/mailers/.keep +0 -0
  27. data/test/dummy/app/models/.keep +0 -0
  28. data/test/dummy/app/models/concerns/.keep +0 -0
  29. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  30. data/test/dummy/bin/bundle +3 -0
  31. data/test/dummy/bin/rails +4 -0
  32. data/test/dummy/bin/rake +4 -0
  33. data/test/dummy/config.ru +4 -0
  34. data/test/dummy/config/application.rb +23 -0
  35. data/test/dummy/config/boot.rb +5 -0
  36. data/test/dummy/config/database.yml +25 -0
  37. data/test/dummy/config/environment.rb +5 -0
  38. data/test/dummy/config/environments/development.rb +29 -0
  39. data/test/dummy/config/environments/production.rb +80 -0
  40. data/test/dummy/config/environments/test.rb +36 -0
  41. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  42. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  43. data/test/dummy/config/initializers/inflections.rb +16 -0
  44. data/test/dummy/config/initializers/mime_types.rb +5 -0
  45. data/test/dummy/config/initializers/secret_token.rb +12 -0
  46. data/test/dummy/config/initializers/session_store.rb +3 -0
  47. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  48. data/test/dummy/config/locales/en.yml +23 -0
  49. data/test/dummy/config/routes.rb +56 -0
  50. data/test/dummy/lib/assets/.keep +0 -0
  51. data/test/dummy/log/.keep +0 -0
  52. data/test/dummy/public/404.html +58 -0
  53. data/test/dummy/public/422.html +58 -0
  54. data/test/dummy/public/500.html +57 -0
  55. data/test/dummy/public/favicon.ico +0 -0
  56. data/test/hobo_w2ui_test.rb +7 -0
  57. data/test/test_helper.rb +15 -0
  58. data/vendor/assets/images/.gitkeep +0 -0
  59. data/vendor/assets/javascripts/hobo_w2ui.js +1 -0
  60. data/vendor/assets/javascripts/w2ui-1.5.0.js +14639 -0
  61. data/vendor/assets/stylesheets/hobo_w2ui.css +3 -0
  62. data/vendor/assets/stylesheets/w2ui-1.5.0.css +2867 -0
  63. metadata +168 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 92852651e4c45f674cc29b8f6f5e4689358ed0f9
4
+ data.tar.gz: ed189cbf18194128efc4f8aca5de415163495d12
5
+ SHA512:
6
+ metadata.gz: 1e0aa518ee35420adefcc9457728854af2b6a7a50b7d8895460dc1236483146b594597430b4464874cfec0ce5b0f31e2e6efd4fbbdd9a6aa19cdba41f3a61964
7
+ data.tar.gz: c702a04fce799b7bd33df89e1fb893252d8f0dc5ccd960472afe99407e818c30248aadd85c05958aa28199bee74b14e7c0e9483f9e3768c2592f4ce2da2b12ef
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ test/dummy/db/*.sqlite3
5
+ test/dummy/db/*.sqlite3-journal
6
+ test/dummy/log/*.log
7
+ test/dummy/tmp/
8
+ test/dummy/.sass-cache
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Declare your gem's dependencies in hobo_w2ui.gemspec.
4
+ # Bundler will treat runtime dependencies like base dependencies, and
5
+ # development dependencies will be added by default to the :development group.
6
+ gemspec
7
+
8
+ # Declare any dependencies that are still in development here instead of in
9
+ # your gemspec. These might include edge Rails or gems from your path or
10
+ # Git. Remember to move these dependencies to your gemspec before releasing
11
+ # your gem to rubygems.org.
12
+
13
+ # To use debugger
14
+ # gem 'debugger'
data/Gemfile.lock ADDED
@@ -0,0 +1,93 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ hobo_w2ui (0.0.1)
5
+ hobo (~> 2.1.1)
6
+ rails (~> 4.0.9)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (4.0.10)
12
+ actionpack (= 4.0.10)
13
+ mail (~> 2.5, >= 2.5.4)
14
+ actionpack (4.0.10)
15
+ activesupport (= 4.0.10)
16
+ builder (~> 3.1.0)
17
+ erubis (~> 2.7.0)
18
+ rack (~> 1.5.2)
19
+ rack-test (~> 0.6.2)
20
+ activemodel (4.0.10)
21
+ activesupport (= 4.0.10)
22
+ builder (~> 3.1.0)
23
+ activerecord (4.0.10)
24
+ activemodel (= 4.0.10)
25
+ activerecord-deprecated_finders (~> 1.0.2)
26
+ activesupport (= 4.0.10)
27
+ arel (~> 4.0.0)
28
+ activerecord-deprecated_finders (1.0.3)
29
+ activesupport (4.0.10)
30
+ i18n (~> 0.6, >= 0.6.9)
31
+ minitest (~> 4.2)
32
+ multi_json (~> 1.3)
33
+ thread_safe (~> 0.1)
34
+ tzinfo (~> 0.3.37)
35
+ arel (4.0.2)
36
+ builder (3.1.4)
37
+ dryml (2.1.1)
38
+ actionpack (~> 4.0.2)
39
+ hobo_support (= 2.1.1)
40
+ erubis (2.7.0)
41
+ hike (1.2.3)
42
+ hobo (2.1.1)
43
+ dryml (= 2.1.1)
44
+ hobo_fields (= 2.1.1)
45
+ hobo_support (= 2.1.1)
46
+ hobo_will_paginate
47
+ hobo_fields (2.1.1)
48
+ hobo_support (= 2.1.1)
49
+ hobo_support (2.1.1)
50
+ rails (~> 4.0.2)
51
+ hobo_will_paginate (2.1.1)
52
+ i18n (0.6.11)
53
+ mail (2.6.1)
54
+ mime-types (>= 1.16, < 3)
55
+ mime-types (2.4.3)
56
+ minitest (4.7.5)
57
+ multi_json (1.10.1)
58
+ rack (1.5.2)
59
+ rack-test (0.6.2)
60
+ rack (>= 1.0)
61
+ rails (4.0.10)
62
+ actionmailer (= 4.0.10)
63
+ actionpack (= 4.0.10)
64
+ activerecord (= 4.0.10)
65
+ activesupport (= 4.0.10)
66
+ bundler (>= 1.3.0, < 2.0)
67
+ railties (= 4.0.10)
68
+ sprockets-rails (~> 2.0)
69
+ railties (4.0.10)
70
+ actionpack (= 4.0.10)
71
+ activesupport (= 4.0.10)
72
+ rake (>= 0.8.7)
73
+ thor (>= 0.18.1, < 2.0)
74
+ rake (10.3.2)
75
+ sprockets (2.12.2)
76
+ hike (~> 1.2)
77
+ multi_json (~> 1.0)
78
+ rack (~> 1.0)
79
+ tilt (~> 1.1, != 1.3.0)
80
+ sprockets-rails (2.2.0)
81
+ actionpack (>= 3.0)
82
+ activesupport (>= 3.0)
83
+ sprockets (>= 2.8, < 4.0)
84
+ thor (0.19.1)
85
+ thread_safe (0.3.4)
86
+ tilt (1.4.1)
87
+ tzinfo (0.3.42)
88
+
89
+ PLATFORMS
90
+ ruby
91
+
92
+ DEPENDENCIES
93
+ hobo_w2ui!
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2014 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,36 @@
1
+ This is a plugin for [Hobo](http://hobocentral.net) that integrates [w2ui](http://w2ui.com/web/) with Hobo.
2
+
3
+ ### Installation
4
+
5
+ Add this to your Gemfile
6
+
7
+ gem "hobo_w2ui", :git => "git://github.com/informatom/hobo_w2ui.git"
8
+
9
+ Run bundle to get the gems
10
+
11
+ bundle
12
+
13
+ Add to your front.scss: (or whereever you want it available)
14
+
15
+ *= require hobo_w2ui
16
+
17
+ Add to your front.js: (or whereever you want it available)
18
+
19
+ //= require hobo_w2ui
20
+
21
+ Add to your application.dryml (or whereever you want it available)
22
+
23
+ <include gem='hobo_w2ui'/>
24
+
25
+ To test if the installation was successful, you can use the DRYML-Tag
26
+
27
+ <w2ui-test/>
28
+
29
+ which outputs a static table to check, if the aasets and the taglibs
30
+ are loaded correctly.
31
+
32
+ The source for this plugin lives at git://github.com/informatom/hobo_w2ui. Pull requests are welcome.
33
+
34
+ ### License
35
+
36
+ See MIT-LICENSE
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'HoboW2ui'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+ Bundler::GemHelper.install_tasks
21
+
22
+ require 'rake/testtask'
23
+
24
+ Rake::TestTask.new(:test) do |t|
25
+ t.libs << 'lib'
26
+ t.libs << 'test'
27
+ t.pattern = 'test/**/*_test.rb'
28
+ t.verbose = false
29
+ end
30
+
31
+
32
+ task default: :test
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1
@@ -0,0 +1,2 @@
1
+ module HoboW2uiHelper
2
+ end
data/hobo_w2ui.gemspec ADDED
Binary file
data/lib/hobo_w2ui.rb ADDED
@@ -0,0 +1,14 @@
1
+ module HoboW2ui
2
+
3
+ @@root = Pathname.new File.expand_path('../..', __FILE__)
4
+ def self.root; @@root; end
5
+
6
+ EDIT_LINK_BASE = 'https://github.com/my_github_username/hobo_w2ui/edit/master'
7
+
8
+ if defined?(Rails)
9
+ require 'hobo_w2ui/railtie'
10
+
11
+ class Engine < ::Rails::Engine
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ require 'hobo_w2ui'
2
+ require 'rails'
3
+
4
+ module HoboW2ui
5
+ class Railtie < Rails::Railtie
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module HoboW2ui
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :hobo_w2ui do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,2 @@
1
+ <%# tag definitions for the hobo_w2ui plugin %>
2
+ <include src="*"/>
@@ -0,0 +1,26 @@
1
+ <def tag="w2ui-test">
2
+ <div id="grid" style="height:175px; "></div>
3
+
4
+ <script>
5
+ $(function () {
6
+ $('#grid').w2grid({
7
+ name: 'grid',
8
+ header: 'List of Names',
9
+ columns: [
10
+ { field: 'fname', caption: 'First Name', size: '30%' },
11
+ { field: 'lname', caption: 'Last Name', size: '30%' },
12
+ { field: 'email', caption: 'Email', size: '40%' },
13
+ { field: 'sdate', caption: 'Start Date', size: '120px' }
14
+ ],
15
+ records: [
16
+ { recid: 1, fname: "Peter", lname: "Jeremia", email: 'peter@mail.com', sdate: '2/1/2010' },
17
+ { recid: 2, fname: "Bruce", lname: "Wilkerson", email: 'bruce@mail.com', sdate: '6/1/2010' },
18
+ { recid: 3, fname: "John", lname: "McAlister", email: 'john@mail.com', sdate: '1/16/2010' },
19
+ { recid: 4, fname: "Ravi", lname: "Zacharies", email: 'ravi@mail.com', sdate: '3/13/2007' },
20
+ { recid: 5, fname: "William", lname: "Dembski", email: 'will@mail.com', sdate: '9/30/2011' },
21
+ { recid: 6, fname: "David", lname: "Peterson", email: 'david@mail.com', sdate: '4/5/2010' }
22
+ ]
23
+ });
24
+ });
25
+ </script>
26
+ </def>
@@ -0,0 +1,124 @@
1
+ <def tag="w2ui-index-table" attrs="model, columns, sizes, searches, subsite, async, sort, sortdir">
2
+ <set wtuicolumns="&columns.split(%r{,\s*})" />
3
+ <set wtuicolumnsizes="&sizes.split(%r{,\s*})" />
4
+ <set wtuisearches="&searches.split(%r{,\s*})" />
5
+ <set prefix="& subsite ? '/' + subsite + '/' : '/'" />
6
+
7
+ <div id="w2ui-index-table"
8
+ style="height: 800px;">
9
+ </div>
10
+
11
+ <script>
12
+ $('#w2ui-index-table').w2grid({
13
+ name: 'w2oui-index-table',
14
+ multiSelect : false,
15
+ <if test="&async">
16
+ multiSearch: false,
17
+ </if>
18
+ method: 'GET',
19
+ show: {
20
+ header: true,
21
+ toolbar: true,
22
+ footer: true
23
+ },
24
+ header: "<%= eval(model).model_name.human(count: 100) %>",
25
+ <if test="&async">
26
+ url: "<%= prefix + eval(model).model_name.plural %>" + ".json",
27
+ </if>
28
+ toolbar: {
29
+ items: [
30
+ {
31
+ type: 'button',
32
+ id: 'show',
33
+ caption: "<%= I18n.t('hobo.actions.show', model: eval(model).model_name.human) %>",
34
+ img: 'fa fa-lg fa-eye'
35
+ },
36
+ {
37
+ type: 'button',
38
+ id: 'edit',
39
+ caption: " <%= I18n.t('hobo.actions.edit', model: eval(model).model_name.human) %>",
40
+ img: 'fa fa-lg fa-edit'
41
+ },
42
+ {
43
+ type: 'button',
44
+ id: 'delete',
45
+ caption: " <%= I18n.t('hobo.actions.delete', model: eval(model).model_name.human) %>",
46
+ img: 'fa fa-lg fa-trash'
47
+ }
48
+ ],
49
+ onClick: function (target, data) {
50
+ var selection = w2ui['w2oui-index-table'].getSelection()
51
+ switch(target) {
52
+ case "show":
53
+ if (selection[0]) {
54
+ document.location = "<%= prefix + eval(model).model_name.plural + '/' %>" + selection[0]
55
+ } else {
56
+ w2alert('<%= I18n.t("mercator.content_manager.no_content_element_selected") %>')
57
+ }
58
+ break
59
+ case "edit":
60
+ if (selection[0]) {
61
+ document.location = "<%= prefix + eval(model).model_name.plural + '/' %>" + selection[0] + "/edit"
62
+ } else {
63
+ w2alert('<%= I18n.t("mercator.content_manager.no_content_element_selected") %>')
64
+ }
65
+ break
66
+ case "delete":
67
+ if (selection[0]) {
68
+ w2confirm('<%= I18n.t("hobo.messages.confirm") %>', function (button) {
69
+ if (button =='Yes') {
70
+ $.ajax({
71
+ url: "<%= prefix + eval(model).model_name.plural + '/' %>" + selection[0] + ".json",
72
+ type: "DELETE"
73
+ }).done( function() {
74
+ w2ui["w2oui-index-table"].load("<%= prefix + eval(model).model_name.plural %>" + ".json")
75
+ })
76
+ }
77
+ })
78
+ } else {
79
+ w2alert('<%= I18n.t("mercator.content_manager.no_content_element_selected") %>')
80
+ }
81
+ break
82
+ }
83
+ }
84
+ },
85
+
86
+ columns: [
87
+ {
88
+ field: 'recid',
89
+ caption: 'ID',
90
+ size: '20',
91
+ sortable: true,
92
+ hidden: true ,
93
+ attr: "align=center"
94
+ },
95
+ <% wtuicolumns.zip(wtuicolumnsizes).each do |column, size| %>
96
+ {
97
+ field: "#{column}",
98
+ caption: "<%= eval(model).human_attribute_name(column.to_sym) %>",
99
+ size: "#{size}",
100
+ sortable: true,
101
+ },
102
+ <% end %>
103
+ ],
104
+
105
+ searches: [
106
+ <repeat with="&wtuisearches">
107
+ {
108
+ field: "#{this}",
109
+ caption: "#{this}",
110
+ type: 'text'
111
+ },
112
+ </repeat>
113
+ ],
114
+
115
+ sortData: [{
116
+ field: '#{sort}',
117
+ direction: '#{sortdir || "ASC"}'
118
+ }]
119
+ })
120
+ <unless test="&async">
121
+ w2ui["w2oui-index-table"].load("<%= prefix + eval(model).model_name.plural %>" + ".json")
122
+ </unless>
123
+ </script>
124
+ </def>
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.