kuppayam 0.1.34 → 0.1.35

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 (177) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/favicon.png +0 -0
  3. data/app/assets/javascripts/{jquery_with_ujs.js → jquery_and_family.js} +3 -2
  4. data/app/assets/javascripts/kuppayam.js +13 -0
  5. data/app/assets/javascripts/kuppayam/utilities.js +3 -3
  6. data/app/assets/stylesheets/jquery_and_family.css +14 -0
  7. data/app/assets/stylesheets/kuppayam/custom.css +73 -0
  8. data/app/helpers/kuppayam_helper.rb +6 -2
  9. data/app/helpers/render_helper.rb +6 -2
  10. data/app/helpers/resource_helper.rb +44 -5
  11. data/app/helpers/resource_view_helper.rb +123 -35
  12. data/app/models/concerns/publishable.rb +1 -0
  13. data/app/models/image/base.rb +3 -3
  14. data/app/views/kuppayam/images/_multiple_images.html.erb +6 -4
  15. data/app/views/kuppayam/workflows/default/create.js.erb +81 -0
  16. data/app/views/kuppayam/workflows/default/destroy.js.erb +32 -0
  17. data/app/views/kuppayam/workflows/default/edit.js.erb +21 -0
  18. data/app/views/kuppayam/workflows/default/index.js.erb +43 -0
  19. data/app/views/kuppayam/workflows/default/new.js.erb +21 -0
  20. data/app/views/kuppayam/workflows/default/row.js.erb +50 -0
  21. data/app/views/kuppayam/workflows/default/show.js.erb +17 -0
  22. data/app/views/kuppayam/workflows/default/update.js.erb +73 -0
  23. data/app/views/kuppayam/workflows/parrot/create.js.erb +8 -1
  24. data/app/views/kuppayam/workflows/parrot/index.js.erb +9 -1
  25. data/app/views/kuppayam/workflows/parrot/new.js.erb +1 -1
  26. data/app/views/kuppayam/workflows/parrot/row.js.erb +8 -1
  27. data/app/views/kuppayam/workflows/parrot/update.js.erb +8 -1
  28. data/app/views/kuppayam/workflows/peacock/create.js.erb +8 -1
  29. data/app/views/kuppayam/workflows/peacock/index.js.erb +9 -1
  30. data/app/views/kuppayam/workflows/peacock/row.js.erb +8 -1
  31. data/app/views/kuppayam/workflows/peacock/update.js.erb +8 -1
  32. data/app/views/layouts/dashboard/_items.html.erb +1 -1
  33. data/app/views/layouts/kuppayam/_head.html.erb +2 -2
  34. data/app/views/layouts/kuppayam/_sidebar.html.erb +1 -1
  35. data/app/views/layouts/kuppayam/admin.html.erb +1 -1
  36. data/app/views/layouts/kuppayam/document_upload.html.erb +1 -1
  37. data/app/views/layouts/kuppayam/image_upload.html.erb +1 -1
  38. data/lib/generators/kuppayam/templates/views/_index.html.erb +1 -1
  39. data/lib/generators/kuppayam/templates/views/_row.html.erb +1 -1
  40. data/lib/kuppayam/engine.rb +1 -1
  41. data/lib/kuppayam/version.rb +1 -1
  42. data/vendor/assets/jquery-ui/AUTHORS.txt +333 -0
  43. data/vendor/assets/jquery-ui/LICENSE.txt +43 -0
  44. data/vendor/assets/jquery-ui/external/jquery/jquery.js +11008 -0
  45. data/vendor/assets/jquery-ui/images/ui-icons_444444_256x240.png +0 -0
  46. data/vendor/assets/jquery-ui/images/ui-icons_555555_256x240.png +0 -0
  47. data/vendor/assets/jquery-ui/images/ui-icons_777620_256x240.png +0 -0
  48. data/vendor/assets/jquery-ui/images/ui-icons_777777_256x240.png +0 -0
  49. data/vendor/assets/jquery-ui/images/ui-icons_cc0000_256x240.png +0 -0
  50. data/vendor/assets/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
  51. data/vendor/assets/jquery-ui/index.html +559 -0
  52. data/vendor/assets/jquery-ui/jquery-ui.css +1312 -0
  53. data/vendor/assets/jquery-ui/jquery-ui.js +18706 -0
  54. data/vendor/assets/jquery-ui/jquery-ui.min.css +7 -0
  55. data/vendor/assets/jquery-ui/jquery-ui.min.js +13 -0
  56. data/vendor/assets/jquery-ui/jquery-ui.structure.css +886 -0
  57. data/vendor/assets/jquery-ui/jquery-ui.structure.min.css +5 -0
  58. data/vendor/assets/jquery-ui/jquery-ui.theme.css +443 -0
  59. data/vendor/assets/jquery-ui/jquery-ui.theme.min.css +5 -0
  60. data/vendor/assets/jquery-ui/package.json +74 -0
  61. data/vendor/assets/jquery-validation/additional-methods.js +1158 -0
  62. data/vendor/assets/jquery-validation/additional-methods.min.js +8 -0
  63. data/vendor/assets/{javascripts/jquery-validate → jquery-validation}/jquery.validate.js +615 -371
  64. data/vendor/assets/jquery-validation/jquery.validate.min.js +4 -0
  65. data/vendor/assets/jquery/jquery-3.2.1.min.js +4 -0
  66. data/vendor/assets/stylesheets/xenon-core.css +16 -16
  67. metadata +45 -122
  68. data/vendor/assets/javascripts/jquery-validate/additional-methods.js +0 -928
  69. data/vendor/assets/javascripts/jquery-validate/additional-methods.min.js +0 -4
  70. data/vendor/assets/javascripts/jquery-validate/index.html +0 -0
  71. data/vendor/assets/javascripts/jquery-validate/jquery.validate.min.js +0 -4
  72. data/vendor/assets/javascripts/jquery-validate/localization/messages_ar.js +0 -33
  73. data/vendor/assets/javascripts/jquery-validate/localization/messages_ar.min.js +0 -4
  74. data/vendor/assets/javascripts/jquery-validate/localization/messages_bg.js +0 -33
  75. data/vendor/assets/javascripts/jquery-validate/localization/messages_bg.min.js +0 -4
  76. data/vendor/assets/javascripts/jquery-validate/localization/messages_ca.js +0 -33
  77. data/vendor/assets/javascripts/jquery-validate/localization/messages_ca.min.js +0 -4
  78. data/vendor/assets/javascripts/jquery-validate/localization/messages_cs.js +0 -33
  79. data/vendor/assets/javascripts/jquery-validate/localization/messages_cs.min.js +0 -4
  80. data/vendor/assets/javascripts/jquery-validate/localization/messages_da.js +0 -30
  81. data/vendor/assets/javascripts/jquery-validate/localization/messages_da.min.js +0 -4
  82. data/vendor/assets/javascripts/jquery-validate/localization/messages_de.js +0 -30
  83. data/vendor/assets/javascripts/jquery-validate/localization/messages_de.min.js +0 -4
  84. data/vendor/assets/javascripts/jquery-validate/localization/messages_el.js +0 -33
  85. data/vendor/assets/javascripts/jquery-validate/localization/messages_el.min.js +0 -4
  86. data/vendor/assets/javascripts/jquery-validate/localization/messages_es.js +0 -36
  87. data/vendor/assets/javascripts/jquery-validate/localization/messages_es.min.js +0 -4
  88. data/vendor/assets/javascripts/jquery-validate/localization/messages_es_AR.js +0 -37
  89. data/vendor/assets/javascripts/jquery-validate/localization/messages_es_AR.min.js +0 -4
  90. data/vendor/assets/javascripts/jquery-validate/localization/messages_et.js +0 -31
  91. data/vendor/assets/javascripts/jquery-validate/localization/messages_et.min.js +0 -4
  92. data/vendor/assets/javascripts/jquery-validate/localization/messages_eu.js +0 -33
  93. data/vendor/assets/javascripts/jquery-validate/localization/messages_eu.min.js +0 -4
  94. data/vendor/assets/javascripts/jquery-validate/localization/messages_fa.js +0 -36
  95. data/vendor/assets/javascripts/jquery-validate/localization/messages_fa.min.js +0 -4
  96. data/vendor/assets/javascripts/jquery-validate/localization/messages_fi.js +0 -31
  97. data/vendor/assets/javascripts/jquery-validate/localization/messages_fi.min.js +0 -4
  98. data/vendor/assets/javascripts/jquery-validate/localization/messages_fr.js +0 -59
  99. data/vendor/assets/javascripts/jquery-validate/localization/messages_fr.min.js +0 -4
  100. data/vendor/assets/javascripts/jquery-validate/localization/messages_gl.js +0 -38
  101. data/vendor/assets/javascripts/jquery-validate/localization/messages_gl.min.js +0 -4
  102. data/vendor/assets/javascripts/jquery-validate/localization/messages_he.js +0 -33
  103. data/vendor/assets/javascripts/jquery-validate/localization/messages_he.min.js +0 -4
  104. data/vendor/assets/javascripts/jquery-validate/localization/messages_hr.js +0 -33
  105. data/vendor/assets/javascripts/jquery-validate/localization/messages_hr.min.js +0 -4
  106. data/vendor/assets/javascripts/jquery-validate/localization/messages_hu.js +0 -32
  107. data/vendor/assets/javascripts/jquery-validate/localization/messages_hu.min.js +0 -4
  108. data/vendor/assets/javascripts/jquery-validate/localization/messages_id.js +0 -32
  109. data/vendor/assets/javascripts/jquery-validate/localization/messages_id.min.js +0 -4
  110. data/vendor/assets/javascripts/jquery-validate/localization/messages_is.js +0 -31
  111. data/vendor/assets/javascripts/jquery-validate/localization/messages_is.min.js +0 -4
  112. data/vendor/assets/javascripts/jquery-validate/localization/messages_it.js +0 -36
  113. data/vendor/assets/javascripts/jquery-validate/localization/messages_it.min.js +0 -4
  114. data/vendor/assets/javascripts/jquery-validate/localization/messages_ja.js +0 -33
  115. data/vendor/assets/javascripts/jquery-validate/localization/messages_ja.min.js +0 -4
  116. data/vendor/assets/javascripts/jquery-validate/localization/messages_ka.js +0 -33
  117. data/vendor/assets/javascripts/jquery-validate/localization/messages_ka.min.js +0 -4
  118. data/vendor/assets/javascripts/jquery-validate/localization/messages_kk.js +0 -33
  119. data/vendor/assets/javascripts/jquery-validate/localization/messages_kk.min.js +0 -4
  120. data/vendor/assets/javascripts/jquery-validate/localization/messages_ko.js +0 -33
  121. data/vendor/assets/javascripts/jquery-validate/localization/messages_ko.min.js +0 -4
  122. data/vendor/assets/javascripts/jquery-validate/localization/messages_lt.js +0 -33
  123. data/vendor/assets/javascripts/jquery-validate/localization/messages_lt.min.js +0 -4
  124. data/vendor/assets/javascripts/jquery-validate/localization/messages_lv.js +0 -33
  125. data/vendor/assets/javascripts/jquery-validate/localization/messages_lv.min.js +0 -4
  126. data/vendor/assets/javascripts/jquery-validate/localization/messages_my.js +0 -33
  127. data/vendor/assets/javascripts/jquery-validate/localization/messages_my.min.js +0 -4
  128. data/vendor/assets/javascripts/jquery-validate/localization/messages_nl.js +0 -43
  129. data/vendor/assets/javascripts/jquery-validate/localization/messages_nl.min.js +0 -4
  130. data/vendor/assets/javascripts/jquery-validate/localization/messages_no.js +0 -33
  131. data/vendor/assets/javascripts/jquery-validate/localization/messages_no.min.js +0 -4
  132. data/vendor/assets/javascripts/jquery-validate/localization/messages_pl.js +0 -33
  133. data/vendor/assets/javascripts/jquery-validate/localization/messages_pl.min.js +0 -4
  134. data/vendor/assets/javascripts/jquery-validate/localization/messages_pt_BR.js +0 -37
  135. data/vendor/assets/javascripts/jquery-validate/localization/messages_pt_BR.min.js +0 -4
  136. data/vendor/assets/javascripts/jquery-validate/localization/messages_pt_PT.js +0 -37
  137. data/vendor/assets/javascripts/jquery-validate/localization/messages_pt_PT.min.js +0 -4
  138. data/vendor/assets/javascripts/jquery-validate/localization/messages_ro.js +0 -33
  139. data/vendor/assets/javascripts/jquery-validate/localization/messages_ro.min.js +0 -4
  140. data/vendor/assets/javascripts/jquery-validate/localization/messages_ru.js +0 -33
  141. data/vendor/assets/javascripts/jquery-validate/localization/messages_ru.min.js +0 -4
  142. data/vendor/assets/javascripts/jquery-validate/localization/messages_si.js +0 -33
  143. data/vendor/assets/javascripts/jquery-validate/localization/messages_si.min.js +0 -4
  144. data/vendor/assets/javascripts/jquery-validate/localization/messages_sk.js +0 -30
  145. data/vendor/assets/javascripts/jquery-validate/localization/messages_sk.min.js +0 -4
  146. data/vendor/assets/javascripts/jquery-validate/localization/messages_sl.js +0 -33
  147. data/vendor/assets/javascripts/jquery-validate/localization/messages_sl.min.js +0 -4
  148. data/vendor/assets/javascripts/jquery-validate/localization/messages_sr.js +0 -33
  149. data/vendor/assets/javascripts/jquery-validate/localization/messages_sr.min.js +0 -4
  150. data/vendor/assets/javascripts/jquery-validate/localization/messages_sr_lat.js +0 -33
  151. data/vendor/assets/javascripts/jquery-validate/localization/messages_sr_lat.min.js +0 -4
  152. data/vendor/assets/javascripts/jquery-validate/localization/messages_sv.js +0 -31
  153. data/vendor/assets/javascripts/jquery-validate/localization/messages_sv.min.js +0 -4
  154. data/vendor/assets/javascripts/jquery-validate/localization/messages_th.js +0 -33
  155. data/vendor/assets/javascripts/jquery-validate/localization/messages_th.min.js +0 -4
  156. data/vendor/assets/javascripts/jquery-validate/localization/messages_tj.js +0 -33
  157. data/vendor/assets/javascripts/jquery-validate/localization/messages_tj.min.js +0 -4
  158. data/vendor/assets/javascripts/jquery-validate/localization/messages_tr.js +0 -33
  159. data/vendor/assets/javascripts/jquery-validate/localization/messages_tr.min.js +0 -4
  160. data/vendor/assets/javascripts/jquery-validate/localization/messages_uk.js +0 -33
  161. data/vendor/assets/javascripts/jquery-validate/localization/messages_uk.min.js +0 -4
  162. data/vendor/assets/javascripts/jquery-validate/localization/messages_vi.js +0 -33
  163. data/vendor/assets/javascripts/jquery-validate/localization/messages_vi.min.js +0 -4
  164. data/vendor/assets/javascripts/jquery-validate/localization/messages_zh.js +0 -33
  165. data/vendor/assets/javascripts/jquery-validate/localization/messages_zh.min.js +0 -4
  166. data/vendor/assets/javascripts/jquery-validate/localization/messages_zh_TW.js +0 -34
  167. data/vendor/assets/javascripts/jquery-validate/localization/messages_zh_TW.min.js +0 -4
  168. data/vendor/assets/javascripts/jquery-validate/localization/methods_de.js +0 -22
  169. data/vendor/assets/javascripts/jquery-validate/localization/methods_de.min.js +0 -4
  170. data/vendor/assets/javascripts/jquery-validate/localization/methods_es_CL.js +0 -22
  171. data/vendor/assets/javascripts/jquery-validate/localization/methods_es_CL.min.js +0 -4
  172. data/vendor/assets/javascripts/jquery-validate/localization/methods_fi.js +0 -22
  173. data/vendor/assets/javascripts/jquery-validate/localization/methods_fi.min.js +0 -4
  174. data/vendor/assets/javascripts/jquery-validate/localization/methods_nl.js +0 -19
  175. data/vendor/assets/javascripts/jquery-validate/localization/methods_nl.min.js +0 -4
  176. data/vendor/assets/javascripts/jquery-validate/localization/methods_pt.js +0 -19
  177. data/vendor/assets/javascripts/jquery-validate/localization/methods_pt.min.js +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a352caff29b3c515dcd72a6342e059d3d8c269178737dce02b019a598596ac9
4
- data.tar.gz: e13179c91259d1ed567f9bcd00ae3ce66ba06a366af9179a42f70dc8df6168f2
3
+ metadata.gz: b07f4a9bbc33507b9212ea13eefad20a68e91efeda2d4855b3fd8e6ec3916125
4
+ data.tar.gz: febaff0b510fcdb71f064c1947dd79bbeedbe35e7993c68b380a406243268581
5
5
  SHA512:
6
- metadata.gz: 674713b2449709ef9c33cd97bc73f6f32812aedcc35d016ba64656592a39b4db96254272cc0812d7e0f4c5f7bdc41a233dee7d7ad967c73660c131f20ed3d435
7
- data.tar.gz: 272b39e8ed9ed5edefb391c16e348224083f1e8edb0d0ebb20f0c810d4672533f0433863e9c7e13f8c9e191cf20b252d59f07ba4ed8951e50399a806d8077154
6
+ metadata.gz: d8ae7064ae64b52bd62241eb27d4246df8f9d5aed5ad266691912b6c8a7ba05f387fb718648ff3fc04983af908b6ba00abb313d7819e6705cb38e9f0364601ea
7
+ data.tar.gz: c1e20d6dc6c3ae96d9e1f2c029e6830a5fcddd034def60ed8339c91bf4541583fc8ff936097bb8db5cb0bfd42a32d57f0a17a7572c81c034ccbc025ce715ef64
@@ -10,6 +10,7 @@
10
10
  // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
11
  // about supported directives.
12
12
  //
13
- //= require jquery-1.11.1.min.js
14
- //= require jquery-validate/jquery.validate.min.js
13
+ //= require jquery3
15
14
  //= require jquery_ujs
15
+ //= require jquery-ui.min.js
16
+ //= require jquery.validate.min.js
@@ -24,6 +24,19 @@
24
24
  //= require toastr/toastr.min.js
25
25
  //= require daterangepicker/daterangepicker.js
26
26
  //= require multiselect/js/jquery.multi-select.js
27
+ //= require uikit/js/addons/autocomplete.js
27
28
  //= require tagsinput/bootstrap-tagsinput.min.js
29
+ //= require_self
28
30
 
31
+ if ( $(window).width() > 739) {
32
+ //Add your javascript for large screens here
33
+ }
34
+ else {
35
+ //Add your javascript for small screens here
36
+
37
+ // This is to fix the dropdown-issue on lower screens
38
+ // This issue is happeneing dueto the class collapsed which is required for large resolutions only
39
+ // Hence we are removing it at the run time.
40
+ $(".sidebar-menu").first().removeClass("collapsed")
41
+ }
29
42
 
@@ -134,7 +134,7 @@ function notifySuccess(title, message){
134
134
  var opts = {
135
135
  "closeButton": true,
136
136
  "debug": false,
137
- "positionClass": "toast-bottom-right",
137
+ "positionClass": "toast-bottom-left",
138
138
  "onclick": null,
139
139
  "showDuration": "300",
140
140
  "hideDuration": "1000",
@@ -153,7 +153,7 @@ function notifyError(title, message){
153
153
  var opts = {
154
154
  "closeButton": true,
155
155
  "debug": false,
156
- "positionClass": "toast-bottom-right",
156
+ "positionClass": "toast-bottom-left",
157
157
  "onclick": null,
158
158
  "showDuration": "300",
159
159
  "hideDuration": "1000",
@@ -172,7 +172,7 @@ function notifyInfo(title, message){
172
172
  var opts = {
173
173
  "closeButton": true,
174
174
  "debug": false,
175
- "positionClass": "toast-bottom-right",
175
+ "positionClass": "toast-bottom-left",
176
176
  "onclick": null,
177
177
  "showDuration": "300",
178
178
  "hideDuration": "1000",
@@ -0,0 +1,14 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require jquery-ui.min.css
14
+ */
@@ -7,6 +7,13 @@
7
7
  .alert p {color: #fff !important}
8
8
  .alert .close {color: #fff !important}
9
9
 
10
+ .alert.alert-default {
11
+ background-color: #efefef;
12
+ border-color: #d2d2d2;
13
+ color: #333;
14
+ width: 100%;
15
+ }
16
+
10
17
  .btn.btn-default.btn-only-hover,
11
18
  .btn.btn-white.btn-only-hover,
12
19
  .btn.btn-danger.btn-only-hover,
@@ -69,3 +76,69 @@
69
76
  .form-horizontal .form-inputs label.kuppayam-label {padding-top: 0px; font-size: 12px; color: #a2a2a2;}
70
77
  .modal .modal-dialog .modal-content {padding:20px; border: 4px solid darkgray;}
71
78
  .modal .modal-dialog .modal-content .modal-header { padding-bottom: 5px; border-bottom-width: 1px; margin-bottom:10px;}
79
+
80
+
81
+ /*Responsive Design*/
82
+ @media (min-width: 240px) and (max-width: 479px) {
83
+ .page-container .main-content {
84
+ padding: 0px !important;
85
+ }
86
+ .nav.nav-tabs + .tab-content {
87
+ margin-bottom: 0px !important;
88
+ padding: 10px !important;
89
+ }
90
+ .page-container .main-content .page-title {
91
+ margin: 0px !important;
92
+ }
93
+ .logo img{
94
+ margin-bottom: 0px;
95
+ width: 140px !important;
96
+ }
97
+ #div_page_content_main {
98
+ margin:20px;
99
+ }
100
+ .xe-widget.xe-vertical-counter {
101
+ padding: 0px;
102
+ padding-top: 0px;
103
+ min-height: 150px !important;
104
+ }
105
+ .xe-widget.xe-vertical-counter .xe-label{
106
+ padding-top: 0px;
107
+ }
108
+ .xe-widget.xe-vertical-counter .xe-label span{
109
+ font-size:10px !important;
110
+ }
111
+ .page-container .main-content .main-footer {
112
+ border-top: 0px solid #ddd !important;
113
+ font-size: 12px !important;
114
+ margin: 0px 0px 20px 0px !important;
115
+ }
116
+ .page-container .main-content .main-footer .footer-text{
117
+ margin-right: -30px;
118
+ }
119
+ }
120
+
121
+ /* Table Enhancements */
122
+ .tabular-item .item-title {
123
+ color: #4b4b4b;
124
+ font-size: 14px;
125
+ font-weight: normal;
126
+ font-family: Arial;
127
+ border-bottom: 1px solid #f1f1f1;
128
+ padding-bottom: 5px;
129
+ margin-bottom: 10px;
130
+ }
131
+ .tabular-item .item-detail {color:#000;font-size:17px;font-weight:normal;font-family:Lato;}
132
+
133
+ /* The following syle is used in pages / sections */
134
+ .kuppayam-feed {
135
+ margin: 0px 0px 10px 0px;
136
+ padding: 20px;
137
+ border: 1px solid #f1f1f1;
138
+ }
139
+ .kuppayam-feed .action-links a {
140
+ float: left;
141
+ font-size: 11px;
142
+ padding: 4px 0px;
143
+ margin-left: 20px;
144
+ }
@@ -21,12 +21,16 @@ module KuppayamHelper
21
21
  # <% end %>
22
22
  # <% end %>
23
23
  # <div class="cl"></div>
24
+ # paginate @meta_tags , params: { controller: "dhatu/meta_tags", action: 'index', page_id: @page.id }, remote: true
24
25
  # ---------------------------
25
- def paginate_kuppayam(collection, remote=true)
26
+ def paginate_kuppayam(collection, **options)
27
+ options.reverse_merge!(
28
+ remote: true
29
+ )
26
30
  return "" if collection.empty?
27
31
  clear_tag(10) +
28
32
  content_tag(:div, :class=>"pull-right") do
29
- paginate(collection, :remote => remote)
33
+ paginate(collection, options)
30
34
  end +
31
35
  clear_tag(10)
32
36
  end
@@ -45,8 +45,12 @@ module RenderHelper
45
45
  def render_accordingly
46
46
  respond_to do |format|
47
47
  format.html {
48
- get_collections
49
- render :index
48
+ if params[:action].to_sym == :show
49
+ render :show
50
+ else
51
+ get_collections
52
+ render :index
53
+ end
50
54
  }
51
55
  format.js {
52
56
  view_path = @resource_options && @resource_options[:view_path] ? "#{@resource_options[:js_view_path]}/#{params[:action]}" : params[:action].to_sym
@@ -185,14 +185,53 @@ module ResourceHelper
185
185
  {
186
186
  page_title: "Page Title | Kuppayam",
187
187
  current_nav: "kuppayam/current_page",
188
+
189
+ # Resource Names
190
+ class: default_class,
188
191
  collection_name: default_collection_name,
189
192
  item_name: default_item_name,
190
- class: default_class,
191
- layout: :table,
193
+
194
+ # Conditions
195
+ get_collections_after_save_resource: true,
192
196
  show_modal_after_create: true,
193
197
  show_modal_after_update: true,
194
- view_path: "/kuppayam/workflows/peacock",
195
- js_view_path: "/kuppayam/workflows/peacock"
198
+
199
+ # Model Size can be large or generic
200
+ form_model_size: :generic,
201
+ show_model_size: :large,
202
+
203
+ # Layout can be table or feed
204
+ # table uses html tables and feed uses div based boxes
205
+ layout: :table,
206
+
207
+ # "/kuppayam/workflows/default"
208
+ #
209
+ # Default partial opens show and form partial according to the model_size configuration
210
+ # It also respect the configuration layout and refresh the page element on both cases - i.e layout is table or feed
211
+
212
+ # "/kuppayam/workflows/peacock"
213
+ # "/kuppayam/workflows/parrot"
214
+ #
215
+ # Peacock & Parrot are old ways of doing things and it respects certail configurations
216
+ # Peacock opens show and form partials in large popup where as Parrot opens it in small
217
+ # Both Peacock and Parrot expect table based layout and will reload a single row after create / update
218
+
219
+ # Mention all checkbox fields so that it will resource controller will set that value to be false when the update action is called
220
+ # if @resource_options[:checkbox_fields] && @resource_options[:checkbox_fields].any?
221
+ # @resource_options[:checkbox_fields].each do |field|
222
+ # @r_object.write_attribute(field, false)
223
+ # end
224
+ # end
225
+ # This is a tricky solution to update bolean fields which are shown as checkbox.
226
+ checkbox_fields: [],
227
+
228
+ # Rendering Paths
229
+ view_path: "/path/to/partials",
230
+ js_view_path: "/kuppayam/workflows/default",
231
+
232
+ # Additional Configurations
233
+ load_wysihtml5: false,
234
+ tagsinput: false
196
235
  }
197
236
  end
198
237
 
@@ -234,7 +273,7 @@ module ResourceHelper
234
273
  def save_resource
235
274
  if @r_object.valid?
236
275
  @r_object.save
237
- get_collections if @resource_options[:layout] = :table
276
+ get_collections if @resource_options[:get_collections_after_save_resource]
238
277
  set_flash_message(I18n.translate("forms.save", item: default_item_name.titleize), :success)
239
278
  end
240
279
  set_resource_notification(@r_object)
@@ -16,7 +16,7 @@ module ResourceViewHelper
16
16
  end
17
17
  end
18
18
 
19
- def display_thumbnail_small(object, **options)
19
+ def display_thumbnail(object, **options)
20
20
  options.reverse_merge!(
21
21
  method_name: "cover_image.image.small.url",
22
22
  image_class: "img-rectangle",
@@ -57,16 +57,29 @@ module ResourceViewHelper
57
57
  end
58
58
 
59
59
  def display_publishable_links(object, **options)
60
+
61
+ begin
62
+ object_publish_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "published")
63
+ object_unpublish_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "unpublished")
64
+ object_remove_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "removed")
65
+ object_archive_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "archived")
66
+ rescue
67
+ object_publish_url = ""
68
+ object_unpublish_url = ""
69
+ object_remove_url = ""
70
+ object_archive_url = ""
71
+ end
72
+
60
73
  options.reverse_merge!(
61
74
  publish_icon: 'fa fa-check-square',
62
75
  unpublish_icon: 'fa fa-square',
63
76
  remove_icon: 'fa fa-close',
64
77
  archive_icon: 'fa fa-archive',
65
78
 
66
- publish_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "published"),
67
- unpublish_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "unpublished"),
68
- remove_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "removed"),
69
- archive_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "archived"),
79
+ publish_link: object_publish_url,
80
+ unpublish_link: object_unpublish_url,
81
+ remove_link: object_remove_url,
82
+ archive_link: object_archive_url,
70
83
 
71
84
  publish_text: "Publish",
72
85
  unpublish_text: "UnPublish",
@@ -94,16 +107,29 @@ module ResourceViewHelper
94
107
  end
95
108
 
96
109
  def display_readable_links(object, **options)
110
+
111
+ begin
112
+ object_read_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "read")
113
+ object_unread_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "unread")
114
+ object_remove_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "removed")
115
+ object_archive_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "archived")
116
+ rescue
117
+ object_read_url = ""
118
+ object_unread_url = ""
119
+ object_remove_url = ""
120
+ object_archive_url = ""
121
+ end
122
+
97
123
  options.reverse_merge!(
98
124
  read_icon: 'fa fa-check-square-o',
99
125
  unread_icon: 'fa fa-square-o',
100
126
  remove_icon: 'fa fa-trash',
101
127
  archive_icon: 'fa fa-archive',
102
128
 
103
- read_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "read"),
104
- unread_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "unread"),
105
- remove_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "removed"),
106
- archive_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "archived"),
129
+ read_link: object_read_url,
130
+ unread_link: object_unread_url,
131
+ remove_link: object_remove_url,
132
+ archive_link: object_archive_url,
107
133
 
108
134
  read_text: "Read",
109
135
  unread_text: "Unread",
@@ -131,12 +157,21 @@ module ResourceViewHelper
131
157
  end
132
158
 
133
159
  def display_featurable_links(object, **options)
160
+
161
+ begin
162
+ object_feature_url = url_for(action: 'mark_as_featured', controller: object.class.to_s.tableize, id: object.id)
163
+ object_unfeature_url = url_for(action: 'remove_from_featured', controller: object.class.to_s.tableize, id: object.id)
164
+ rescue
165
+ object_feature_url = ""
166
+ object_unfeature_url = ""
167
+ end
168
+
134
169
  options.reverse_merge!(
135
170
  feature_icon: 'fa fa-star',
136
171
  unfeature_icon: 'fa fa-star-o',
137
172
 
138
- feature_link: url_for(action: 'mark_as_featured', controller: object.class.to_s.tableize, id: object.id),
139
- unfeature_link: url_for(action: 'remove_from_featured', controller: object.class.to_s.tableize, id: object.id),
173
+ feature_link: object_feature_url,
174
+ unfeature_link: object_unfeature_url,
140
175
 
141
176
  feature_text: "Mark as Featured",
142
177
  unfeature_text: "Remove from Featured",
@@ -158,12 +193,21 @@ module ResourceViewHelper
158
193
  end
159
194
 
160
195
  def display_manage_links(object, current_user, **options)
196
+
197
+ begin
198
+ object_edit_url = url_for(action: "edit", controller: object.class.to_s.tableize, id: object.id)
199
+ object_delete_url = url_for(action: "destroy", controller: object.class.to_s.tableize, id: object.id)
200
+ rescue
201
+ object_edit_url = ""
202
+ object_delete_url = ""
203
+ end
204
+
161
205
  options.reverse_merge!(
162
206
  edit_icon: 'fa fa-edit',
163
207
  delete_icon: 'fa fa-trash',
164
208
 
165
- edit_link: url_for(action: "edit", controller: object.class.to_s.tableize, id: object.id),
166
- delete_link: url_for(action: "destroy", controller: object.class.to_s.tableize, id: object.id),
209
+ edit_link: object_edit_url,
210
+ delete_link: object_delete_url,
167
211
 
168
212
  edit_text: "Edit",
169
213
  delete_text: "Delete",
@@ -187,16 +231,29 @@ module ResourceViewHelper
187
231
  end
188
232
 
189
233
  def display_publishable_buttons(object, **options)
234
+
235
+ begin
236
+ object_publish_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "published")
237
+ object_unpublish_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "unpublished")
238
+ object_remove_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "removed")
239
+ object_archive_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "archived")
240
+ rescue
241
+ object_publish_url = ""
242
+ object_unpublish_url = ""
243
+ object_remove_url = ""
244
+ object_archive_url = ""
245
+ end
246
+
190
247
  options.reverse_merge!(
191
248
  publish_icon: 'fa fa-check-square',
192
249
  unpublish_icon: 'fa fa-square',
193
250
  remove_icon: 'fa fa-close',
194
251
  archive_icon: 'fa fa-archive',
195
252
 
196
- publish_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "published"),
197
- unpublish_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "unpublished"),
198
- remove_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "removed"),
199
- archive_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "archived"),
253
+ publish_link: object_publish_url,
254
+ unpublish_link: object_unpublish_url,
255
+ remove_link: object_remove_url,
256
+ archive_link: object_archive_url,
200
257
 
201
258
  publish_text: "Publish",
202
259
  unpublish_text: "UnPublish",
@@ -224,16 +281,29 @@ module ResourceViewHelper
224
281
  end
225
282
 
226
283
  def display_readable_buttons(object, **options)
284
+
285
+ begin
286
+ object_read_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "read")
287
+ object_unread_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "unread")
288
+ object_remove_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "removed")
289
+ object_archive_url = url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "archived")
290
+ rescue
291
+ object_read_url = ""
292
+ object_unread_url = ""
293
+ object_remove_url = ""
294
+ object_archive_url = ""
295
+ end
296
+
227
297
  options.reverse_merge!(
228
298
  read_icon: 'fa fa-check-square-o',
229
299
  unread_icon: 'fa fa-square-o',
230
300
  remove_icon: 'fa fa-trash',
231
301
  archive_icon: 'fa fa-archive',
232
302
 
233
- read_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "read"),
234
- unread_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "unread"),
235
- remove_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "removed"),
236
- archive_link: url_for(action: 'update_status', controller: object.class.to_s.tableize, id: object.id, status: "archived"),
303
+ read_link: object_read_url,
304
+ unread_link: object_unread_url,
305
+ remove_link: object_remove_url,
306
+ archive_link: object_archive_url,
237
307
 
238
308
  read_text: "Mark as Read",
239
309
  unread_text: "Mark as Unread",
@@ -261,12 +331,21 @@ module ResourceViewHelper
261
331
  end
262
332
 
263
333
  def display_featurable_buttons(object, **options)
334
+
335
+ begin
336
+ object_feature_url = url_for(action: 'mark_as_featured', controller: object.class.to_s.tableize, id: object.id)
337
+ object_unfeature_url = url_for(action: 'remove_from_featured', controller: object.class.to_s.tableize, id: object.id)
338
+ rescue
339
+ object_feature_url = ""
340
+ object_unfeature_url = ""
341
+ end
342
+
264
343
  options.reverse_merge!(
265
344
  feature_icon: 'fa fa-star',
266
345
  unfeature_icon: 'fa fa-star-o',
267
346
 
268
- feature_link: url_for(action: 'mark_as_featured', controller: object.class.to_s.tableize, id: object.id),
269
- unfeature_link: url_for(action: 'remove_from_featured', controller: object.class.to_s.tableize, id: object.id),
347
+ feature_link: object_feature_url,
348
+ unfeature_link: object_unfeature_url,
270
349
 
271
350
  feature_text: "Mark as Featured",
272
351
  unfeature_text: "Remove from Featured",
@@ -288,19 +367,28 @@ module ResourceViewHelper
288
367
  end
289
368
 
290
369
  def display_manage_buttons(object, **options)
370
+
371
+ begin
372
+ object_edit_url = url_for(action: "edit", controller: object.class.to_s.tableize, id: object.id)
373
+ object_delete_url = url_for(action: "destroy", controller: object.class.to_s.tableize, id: object.id)
374
+ rescue
375
+ object_edit_url = ""
376
+ object_delete_url = ""
377
+ end
378
+
291
379
  options.reverse_merge!(
292
- edit_icon: 'fa fa-edit',
293
- delete_icon: 'fa fa-trash',
294
-
295
- edit_link: url_for(action: "edit", controller: object.class.to_s.tableize, id: object.id),
296
- delete_link: url_for(action: "destroy", controller: object.class.to_s.tableize, id: object.id),
297
-
298
- edit_text: "Edit",
299
- delete_text: "Delete",
300
-
301
- edit_class: "btn btn-block btn-success",
302
- delete_class: "btn btn-block btn-danger btn-only-hover"
303
- )
380
+ edit_icon: 'fa fa-edit',
381
+ delete_icon: 'fa fa-trash',
382
+
383
+ edit_link: object_edit_url,
384
+ delete_link: object_delete_url,
385
+
386
+ edit_text: "Edit",
387
+ delete_text: "Delete",
388
+
389
+ edit_class: "btn btn-block btn-success",
390
+ delete_class: "btn btn-block btn-danger btn-only-hover"
391
+ )
304
392
  links = []
305
393
  links << link_to(raw("<i class=\"#{options[:edit_icon]} mr-5\"></i> #{options[:edit_text]}"), options[:edit_link], remote: true, role: "menuitem", tabindex: "-1", class: options[:edit_class]) if object.can_be_edited?
306
394
  links << link_to(raw("<i class=\"#{options[:delete_icon]} mr-5\"></i> #{options[:delete_text]}"), options[:delete_link], method: 'DELETE', remote: true, role: "menuitem", tabindex: "-1", class: options[:delete_class]) if object.can_be_deleted?