kuppayam 0.1.5dev4 → 0.1.5
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/kuppayam.js +0 -3
- data/app/assets/javascripts/kuppayam/utilities.js +0 -28
- data/app/assets/stylesheets/kuppayam.css +0 -1
- data/app/controllers/kuppayam/base_controller.rb +1 -11
- data/app/controllers/kuppayam/documents_controller.rb +0 -4
- data/app/helpers/breadcrumbs_helper.rb +1 -1
- data/app/helpers/filter_helper.rb +3 -9
- data/app/helpers/render_helper.rb +2 -11
- data/app/helpers/resource_helper.rb +3 -13
- data/app/models/kuppayam/application_record.rb +0 -3
- data/app/uploaders/document_uploader.rb +3 -3
- data/app/views/kuppayam/documents/create.html.erb +1 -1
- data/app/views/kuppayam/documents/edit.js.erb +1 -1
- data/app/views/kuppayam/documents/new.js.erb +1 -1
- data/app/views/kuppayam/documents/update.html.erb +1 -1
- data/app/views/kuppayam/images/create.html.erb +2 -2
- data/app/views/kuppayam/images/crop.html.erb +1 -1
- data/app/views/kuppayam/images/edit.js.erb +3 -3
- data/app/views/kuppayam/images/new.js.erb +1 -1
- data/app/views/kuppayam/images/update.html.erb +3 -3
- data/app/views/kuppayam/import_data/new.js.erb +1 -1
- data/app/views/kuppayam/import_data/update.html.erb +1 -1
- data/app/views/kuppayam/workflows/parrot/create.js.erb +6 -11
- data/app/views/kuppayam/workflows/parrot/edit.js.erb +1 -1
- data/app/views/kuppayam/workflows/parrot/new.js.erb +2 -2
- data/app/views/kuppayam/workflows/parrot/row.js.erb +1 -1
- data/app/views/kuppayam/workflows/parrot/update.js.erb +5 -10
- data/app/views/kuppayam/workflows/peacock/create.js.erb +6 -11
- data/app/views/kuppayam/workflows/peacock/edit.js.erb +2 -2
- data/app/views/kuppayam/workflows/peacock/new.js.erb +2 -2
- data/app/views/kuppayam/workflows/peacock/row.js.erb +1 -1
- data/app/views/kuppayam/workflows/peacock/update.js.erb +6 -11
- data/app/views/layouts/kuppayam/_footer.html.erb +0 -1
- data/app/views/layouts/kuppayam/_head.html.erb +1 -1
- data/app/views/layouts/kuppayam/_overlays.html.erb +47 -0
- data/app/views/layouts/kuppayam/_sidebar.html.erb +0 -3
- data/app/views/layouts/kuppayam/admin.html.erb +6 -63
- data/app/views/layouts/kuppayam/blank.html.erb +5 -62
- data/app/views/layouts/kuppayam/document_upload.html.erb +2 -3
- data/app/views/layouts/kuppayam/image_upload.html.erb +2 -3
- data/config/initializers/kuppayam_validators.rb +76 -0
- data/config/locales/kuppayam/general.yml +0 -1
- data/lib/kuppayam/action_view/form_helper.rb +1 -1
- data/lib/kuppayam/action_view/theme_helper.rb +1 -1
- data/lib/kuppayam/engine.rb +0 -2
- data/lib/kuppayam/version.rb +1 -1
- metadata +6 -33
- data/app/views/kuppayam/filters/_display_dropdown_filters.html.erb +0 -11
- data/app/views/kuppayam/filters/_display_filters.html.erb +0 -29
- data/app/views/kuppayam/http_status/404.html.erb +0 -1
- data/app/views/layouts/kuppayam/_horizontal_menu.html.erb +0 -932
- data/app/views/layouts/kuppayam/layout_horizontal_menu.html.erb +0 -116
- data/app/views/layouts/kuppayam/print_a4.html.erb +0 -32
- data/config/initializers/importer.rb +0 -156
- data/config/initializers/validators.rb +0 -78
- data/vendor/assets/stylesheets/custom.css +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4676b3dd1e5b1e1aa4cdfb38d0f58ac27b4663db
|
|
4
|
+
data.tar.gz: e9b098bb964226ce769cdf72a457ec32edd5fabe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9ecdb776c31b557709fee68bb6d7c1decf1d85329c4e11af9caa92f369ccdd56e8eeef81a48c4b1c72ae48ba94827991d6b3608759dbfa7125109b2748cbbf60
|
|
7
|
+
data.tar.gz: 3cab488cff39fc704688367d3e83bd4c553a38dcac07a1032f346c9bb884cf4332476d84df366cee978c2afbd9e0623f73dbd01272e8965929863f31acc33cf8
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
//
|
|
13
13
|
//= require kuppayam/utilities.js
|
|
14
14
|
//= require bootstrap.min.js
|
|
15
|
-
//= require moment.min.js
|
|
16
15
|
//= require TweenMax.min.js
|
|
17
16
|
//= require resizeable.js
|
|
18
17
|
//= require joinable.js
|
|
@@ -22,7 +21,5 @@
|
|
|
22
21
|
//= require wysihtml5/lib/js/wysihtml5-0.3.0.js
|
|
23
22
|
//= require wysihtml5/src/bootstrap-wysihtml5.js
|
|
24
23
|
//= require toastr/toastr.min.js
|
|
25
|
-
//= require daterangepicker/daterangepicker.js
|
|
26
|
-
//= require multiselect/js/jquery.multi-select.js
|
|
27
24
|
|
|
28
25
|
|
|
@@ -10,31 +10,10 @@ function sendAjaxRequest(url, mType){
|
|
|
10
10
|
jQuery.ajax({type: methodType, dataType:"script", url:url});
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
var imageUploadModalId = "div_modal_image_upload";
|
|
14
13
|
var genericModalId = "div_modal_generic";
|
|
15
14
|
var largeModalId = "div_modal_large";
|
|
16
15
|
var messageModalId = "div_modal_message";
|
|
17
16
|
|
|
18
|
-
// Call this function by passing model Id, heading and a bodyContent.
|
|
19
|
-
// it will pop up bootstrap 3 modal.
|
|
20
|
-
function showImageUploadModal(heading, bodyContent, showHeading){
|
|
21
|
-
$('#' + imageUploadModalId + ' .modal-header .modal-title').text(heading);
|
|
22
|
-
$('#' + imageUploadModalId + ' div.modal-body-main').html(bodyContent);
|
|
23
|
-
$('#' + imageUploadModalId).modal({show: true, backdrop: 'static', keyboard: false});
|
|
24
|
-
|
|
25
|
-
if(showHeading){
|
|
26
|
-
$('#' + imageUploadModalId + ' .modal-header').show();
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
$('#' + imageUploadModalId + ' .modal-header').hide();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
setTimeout(function() {
|
|
33
|
-
$('#' + imageUploadModalId).modal('handleUpdate'); //Update backdrop on modal show
|
|
34
|
-
$('#' + imageUploadModalId).scrollTop(0); //reset modal to top position
|
|
35
|
-
}, 1000);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
17
|
// Call this function by passing model Id, heading and a bodyContent.
|
|
39
18
|
// it will pop up bootstrap 3 modal.
|
|
40
19
|
function showGenericModal(heading, bodyContent, showHeading){
|
|
@@ -93,13 +72,6 @@ function showMessageModal(heading, message, modalId){
|
|
|
93
72
|
}, 1000);
|
|
94
73
|
}
|
|
95
74
|
|
|
96
|
-
function closeImageUploadModal(modalId){
|
|
97
|
-
$('#' + imageUploadModalId).modal('hide');
|
|
98
|
-
|
|
99
|
-
showAndHideModals();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
75
|
function closeGenericModal(modalId){
|
|
104
76
|
$('#' + genericModalId).modal('hide');
|
|
105
77
|
|
|
@@ -3,15 +3,13 @@ module Kuppayam
|
|
|
3
3
|
|
|
4
4
|
protect_from_forgery with: :exception
|
|
5
5
|
rescue_from ActionController::InvalidAuthenticityToken, :with => :handle_invalid_authenticity_token
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
layout 'kuppayam/admin'
|
|
8
8
|
|
|
9
|
-
before_action :get_nested_resource_objects
|
|
10
9
|
before_action :set_locale, :stylesheet_filename, :javascript_filename,
|
|
11
10
|
:set_default_title, :set_navs, :parse_pagination_params,
|
|
12
11
|
:configure_filters, :configure_notification, :configure_breadcrumbs
|
|
13
12
|
|
|
14
|
-
|
|
15
13
|
include ParamsParserHelper
|
|
16
14
|
include RenderHelper
|
|
17
15
|
|
|
@@ -46,14 +44,6 @@ module Kuppayam
|
|
|
46
44
|
{ locale: I18n.locale }
|
|
47
45
|
end
|
|
48
46
|
|
|
49
|
-
# This is more like a hooker method which is called
|
|
50
|
-
# before all other before_action method.
|
|
51
|
-
# This method can be overriden by inherited controller classes
|
|
52
|
-
# An e.g: would be to call a method to get @store object from params[:store_id]
|
|
53
|
-
# The object @store has to be initiated before the breadcrumbs or set_title methods are called
|
|
54
|
-
def get_nested_resource_objects
|
|
55
|
-
end
|
|
56
|
-
|
|
57
47
|
def stylesheet_filename
|
|
58
48
|
@stylesheet_filename = "kuppayam"
|
|
59
49
|
end
|
|
@@ -21,7 +21,7 @@ module BreadcrumbsHelper
|
|
|
21
21
|
# Initialize @links in your controller action
|
|
22
22
|
def breadcrumb
|
|
23
23
|
if @breadcrumbs && @breadcrumbs.has_key?(:links) && @breadcrumbs[:links].any?
|
|
24
|
-
content_tag(:div, class: "breadcrumb-env
|
|
24
|
+
content_tag(:div, class: "breadcrumb-env") do
|
|
25
25
|
content_tag(:ol, class: "breadcrumb bc-1") do
|
|
26
26
|
li_array = []
|
|
27
27
|
@breadcrumbs[:links].each do |item|
|
|
@@ -3,6 +3,7 @@ module FilterHelper
|
|
|
3
3
|
|
|
4
4
|
def configure_filters
|
|
5
5
|
configure_filter_settings
|
|
6
|
+
configure_filter_ui_settings
|
|
6
7
|
configure_filter_param_mapping
|
|
7
8
|
end
|
|
8
9
|
|
|
@@ -97,8 +98,6 @@ module FilterHelper
|
|
|
97
98
|
options = rpf[:options] || {}
|
|
98
99
|
parse_reference_filter_from_params(rpf[:filter_name], rpf[:filter_class], options)
|
|
99
100
|
end if filter_settings.has_key?(:reference_filters)
|
|
100
|
-
|
|
101
|
-
configure_filter_ui_settings
|
|
102
101
|
end
|
|
103
102
|
|
|
104
103
|
# Use this method to create a filter if the value is in a variable
|
|
@@ -330,15 +329,10 @@ module FilterHelper
|
|
|
330
329
|
end
|
|
331
330
|
selected_text = filter_options[:select_label] unless selected_text
|
|
332
331
|
|
|
333
|
-
# Clone the existing filters
|
|
332
|
+
# Clone the existing filters firs
|
|
334
333
|
# remove the filters which are to be removed and add which are to be added
|
|
335
334
|
# Also remove the filter which is currently selected
|
|
336
|
-
|
|
337
|
-
unless filter_options[:current_filters].blank?
|
|
338
|
-
temp_filters = {}
|
|
339
|
-
else
|
|
340
|
-
temp_filters = filter_options[:current_filters].clone
|
|
341
|
-
end
|
|
335
|
+
temp_filters = filter_options[:current_filters].clone
|
|
342
336
|
temp_filters.merge!(filter_options[:filters_to_add])
|
|
343
337
|
temp_filters.reject!{|k,v| filter_options[:filters_to_remove].include?(k)}
|
|
344
338
|
temp_filters.reject!{|k,v| k == filter_name.to_sym }
|
|
@@ -7,9 +7,6 @@ module RenderHelper
|
|
|
7
7
|
end
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
# TODO - This is still not fixed.
|
|
11
|
-
# May be it will work on Ajax Request and show sign in pop up.
|
|
12
|
-
# This is not working for HTTP direct requests
|
|
13
10
|
def handle_invalid_authenticity_token
|
|
14
11
|
heading = I18n.t("status.invalid_token.heading")
|
|
15
12
|
message = I18n.t("status.invalid_token.message")
|
|
@@ -18,10 +15,7 @@ module RenderHelper
|
|
|
18
15
|
notifyError('#{heading}','#{message}');
|
|
19
16
|
eos
|
|
20
17
|
respond_to do |format|
|
|
21
|
-
format.html {
|
|
22
|
-
#redirect_to root_path
|
|
23
|
-
render template: '/kuppayam/404', layout: 'kuppayam/blank', :status => 404
|
|
24
|
-
}
|
|
18
|
+
format.html { render :status => 404 }
|
|
25
19
|
format.js { render text: js_message }
|
|
26
20
|
end
|
|
27
21
|
end
|
|
@@ -44,10 +38,7 @@ module RenderHelper
|
|
|
44
38
|
|
|
45
39
|
def render_accordingly
|
|
46
40
|
respond_to do |format|
|
|
47
|
-
format.html {
|
|
48
|
-
get_collections
|
|
49
|
-
render :index
|
|
50
|
-
}
|
|
41
|
+
format.html { get_collections and render params[:action].to_sym }
|
|
51
42
|
format.js {
|
|
52
43
|
view_path = @resource_options && @resource_options[:view_path] ? "#{@resource_options[:js_view_path]}/#{params[:action]}" : params[:action].to_sym
|
|
53
44
|
render view_path
|
|
@@ -64,7 +64,7 @@ module ResourceHelper
|
|
|
64
64
|
@r_object.destroy
|
|
65
65
|
get_collections
|
|
66
66
|
set_flash_message(I18n.t('success.deleted'), :success)
|
|
67
|
-
set_notification(
|
|
67
|
+
set_notification(false, I18n.t('status.success'), I18n.t('success.deleted', item: default_item_name.titleize))
|
|
68
68
|
@destroyed = true
|
|
69
69
|
else
|
|
70
70
|
message = I18n.t('errors.failed_to_delete', item: default_item_name.titleize)
|
|
@@ -114,11 +114,7 @@ module ResourceHelper
|
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
def default_collection_name
|
|
117
|
-
|
|
118
|
-
params[:controller].split("/").last
|
|
119
|
-
rescue
|
|
120
|
-
:items
|
|
121
|
-
end
|
|
117
|
+
params[:controller].split("/").last
|
|
122
118
|
end
|
|
123
119
|
|
|
124
120
|
def default_item_name
|
|
@@ -126,11 +122,7 @@ module ResourceHelper
|
|
|
126
122
|
end
|
|
127
123
|
|
|
128
124
|
def default_class
|
|
129
|
-
|
|
130
|
-
default_collection_name.singularize.camelize.constantize
|
|
131
|
-
rescue
|
|
132
|
-
nil
|
|
133
|
-
end
|
|
125
|
+
default_collection_name.singularize.camelize.constantize
|
|
134
126
|
end
|
|
135
127
|
|
|
136
128
|
def resource_controller_configuration
|
|
@@ -145,8 +137,6 @@ module ResourceHelper
|
|
|
145
137
|
item_name: default_item_name,
|
|
146
138
|
class: default_class,
|
|
147
139
|
layout: :table,
|
|
148
|
-
show_modal_after_create: true,
|
|
149
|
-
show_modal_after_update: true,
|
|
150
140
|
view_path: "/kuppayam/workflows/peacock",
|
|
151
141
|
js_view_path: "/kuppayam/workflows/peacock"
|
|
152
142
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
|
-
class
|
|
3
|
+
class ImageUploader < CarrierWave::Uploader::Base
|
|
4
4
|
|
|
5
5
|
# Override the directory where uploaded files will be stored.
|
|
6
6
|
# This is a sensible default for uploaders that are meant to be mounted:
|
|
7
7
|
def store_dir
|
|
8
|
-
"
|
|
8
|
+
"uploads/#{Rails.env}/#{model.class.to_s.underscore}/#{model.id}"
|
|
9
9
|
end
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
def cache_dir
|
|
12
12
|
Rails.root.join 'tmp/uploads'
|
|
13
13
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%= content_for :javascript_footer do %>
|
|
2
2
|
<script type="text/javascript">
|
|
3
|
-
this.parent.
|
|
3
|
+
this.parent.closeGenericModal();
|
|
4
4
|
|
|
5
5
|
//var heading = "Crop Document";
|
|
6
6
|
//var bodyContent = "<%#= escape_javascript(render(:partial=>"crop_form")) %>";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Show the new form in the right box.
|
|
2
2
|
heading = "Upload Document";
|
|
3
3
|
bodyContent = "<%= escape_javascript(render(:partial=>'form')) %>";
|
|
4
|
-
showGenericModal(heading, bodyContent
|
|
4
|
+
showGenericModal(heading, bodyContent);
|
|
5
5
|
|
|
6
6
|
// When the document upload form is submitted, the server response will appear in this iframe -->
|
|
7
7
|
var $div = $('<iframe id="iframe_document" name="iframe_document" width="100%" style="display:none"></iframe>').appendTo('body');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Show the new form in the right box.
|
|
2
2
|
heading = "Upload Document";
|
|
3
3
|
bodyContent = "<%= escape_javascript(render(:partial=>'form')) %>";
|
|
4
|
-
showGenericModal(heading, bodyContent
|
|
4
|
+
showGenericModal(heading, bodyContent);
|
|
5
5
|
|
|
6
6
|
// When the document upload form is submitted, the server response will appear in this iframe -->
|
|
7
7
|
var $div = $('<iframe id="iframe_document" name="iframe_document" width="100%" style="display:none"></iframe>').appendTo('body');
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
// var heading = "Crop Document";
|
|
6
6
|
// var bodyContent = "<%#= escape_javascript(render(:partial=>'crop_form')) %>";
|
|
7
|
-
// this.parent.showGenericModal(heading, bodyContent
|
|
7
|
+
// this.parent.showGenericModal(heading, bodyContent);
|
|
8
8
|
// this.parent.cropDocument("form_crop_photo");
|
|
9
9
|
|
|
10
10
|
this.parent.$(".<%= @resource.id %>-large-document").attr("src", "<%= @document.document.large.url %>");
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
var bodyContent = "<%= escape_javascript(render(:partial=>'form')) %>";
|
|
13
13
|
|
|
14
|
-
this.parent.
|
|
14
|
+
this.parent.showGenericModal(heading, bodyContent);
|
|
15
15
|
|
|
16
16
|
<%
|
|
17
17
|
text = "You have few errors. They have been highlighted."
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<% else %>
|
|
24
24
|
|
|
25
|
-
this.parent.
|
|
25
|
+
this.parent.closeGenericModal();
|
|
26
26
|
|
|
27
27
|
//var heading = "Crop Image";
|
|
28
28
|
//var bodyContent = "<%#= escape_javascript(render(:partial=>"crop_form")) %>";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%= content_for :javascript_footer do %>
|
|
2
2
|
<script type="text/javascript">
|
|
3
|
-
this.parent.
|
|
3
|
+
this.parent.closeGenericModal();
|
|
4
4
|
|
|
5
5
|
this.parent.$(".<%= @resource.id %>-large-image").attr("src", "<%= @image.image.large.url %>");
|
|
6
6
|
this.parent.$(".<%= @resource.id %>-small-image").attr("src", "<%= @image.image.small.url %>");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<% if @image_type %>
|
|
2
|
-
|
|
2
|
+
heading = "Edit <%= @image_type.split('::').last.titleize %>";
|
|
3
3
|
<% else %>
|
|
4
|
-
|
|
4
|
+
heading = "Edit Image";
|
|
5
5
|
<% end %>
|
|
6
6
|
|
|
7
7
|
bodyContent = "<%= escape_javascript(render(:partial=>'form')) %>";
|
|
8
|
-
|
|
8
|
+
showGenericModal(heading, bodyContent);
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
bodyContent = "<%= escape_javascript(render(:partial=>'form')) %>";
|
|
13
13
|
|
|
14
|
-
this.parent.
|
|
14
|
+
this.parent.showGenericModal(heading, bodyContent);
|
|
15
15
|
|
|
16
16
|
<%
|
|
17
17
|
text = "You have few errors. They have been highlighted."
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
|
|
23
23
|
<% else %>
|
|
24
24
|
|
|
25
|
-
this.parent.
|
|
25
|
+
this.parent.closeGenericModal();
|
|
26
26
|
|
|
27
27
|
// var heading = "Crop Image";
|
|
28
28
|
// var bodyContent = "<%#= escape_javascript(render(:partial=>'crop_form')) %>";
|
|
29
|
-
// this.parent.showGenericModal(heading, bodyContent
|
|
29
|
+
// this.parent.showGenericModal(heading, bodyContent);
|
|
30
30
|
// this.parent.cropImage("form_crop_photo");
|
|
31
31
|
|
|
32
32
|
this.parent.$(".<%= @resource.id %>-large-image").attr("src", "<%= @image.image.large.url %>");
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
heading = "Import Data";
|
|
6
6
|
<% end %>
|
|
7
7
|
bodyContent = "<%= escape_javascript(render(:partial=>'form')) %>";
|
|
8
|
-
showGenericModal(heading, bodyContent
|
|
8
|
+
showGenericModal(heading, bodyContent);
|
|
9
9
|
|
|
10
10
|
// When the document upload form is submitted, the server response will appear in this iframe -->
|
|
11
11
|
var $div = $('<iframe id="iframe_document" name="iframe_document" width="100%" style="display:none"></iframe>').appendTo('body');
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
// var heading = "Crop Document";
|
|
6
6
|
// var bodyContent = "<%#= escape_javascript(render(:partial=>'crop_form')) %>";
|
|
7
|
-
// this.parent.showGenericModal(heading, bodyContent
|
|
7
|
+
// this.parent.showGenericModal(heading, bodyContent);
|
|
8
8
|
// this.parent.cropDocument("form_crop_photo");
|
|
9
9
|
|
|
10
10
|
this.parent.$(".<%= @resource.id %>-large-document").attr("src", "<%= @document.document.large.url %>");
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
<% if @r_object.errors.blank? %>
|
|
2
2
|
|
|
3
3
|
// Inserting the row on top of the table and highlighting it
|
|
4
|
-
$('#div_<%= @resource_options[:item_name] %>_index table > tbody').prepend("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: {@resource_options[:item_name].to_sym => @r_object, i: -1})) %>")
|
|
4
|
+
$('#div_<%= @resource_options[:item_name] %>_index table > tbody').prepend("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: {@resource_options[:item_name].to_sym => @r_object, i: -1})) %>")
|
|
5
5
|
$("#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>").css("background-color", "#fffddd");
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
showGenericModal(heading, bodyContent, false);
|
|
12
|
-
<% else %>
|
|
13
|
-
// Closing the modal if it is opened
|
|
14
|
-
closeGenericModal();
|
|
15
|
-
<% end %>
|
|
7
|
+
// Showing the saved data in the modal
|
|
8
|
+
var heading = "<%= raw @r_object.try(:display_name) %>";
|
|
9
|
+
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/show")) %>";
|
|
10
|
+
showGenericModal(heading, bodyContent, false);
|
|
16
11
|
|
|
17
12
|
// Showing Growl Like Message
|
|
18
13
|
notifySuccess("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>");
|
|
@@ -22,7 +17,7 @@
|
|
|
22
17
|
// Reload the form with errors
|
|
23
18
|
var heading = "Add an <%= @resource_options[:collection_name] %>";
|
|
24
19
|
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
|
|
25
|
-
showGenericModal(heading, bodyContent
|
|
20
|
+
showGenericModal(heading, bodyContent);
|
|
26
21
|
|
|
27
22
|
// Show Main Error Message on the form
|
|
28
23
|
<% error_message = content_tag(:div, I18n.t('errors.errors_highlighted'), class: "alert alert-danger mt-20") %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Load the form
|
|
2
2
|
var heading = "Edit '<%= raw @r_object.try(:display_name) %>'";
|
|
3
3
|
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
|
|
4
|
-
showGenericModal(heading, bodyContent
|
|
4
|
+
showGenericModal(heading, bodyContent);
|
|
5
5
|
|
|
6
6
|
// Initialize WYSIHTML Editor
|
|
7
7
|
$(".wysihtml5").wysihtml5(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Load the form
|
|
2
|
-
var heading = "Add <%= @resource_options[:collection_name]
|
|
2
|
+
var heading = "Add <%= @resource_options[:collection_name] %>";
|
|
3
3
|
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
|
|
4
|
-
showGenericModal(heading, bodyContent
|
|
4
|
+
showGenericModal(heading, bodyContent);
|
|
5
5
|
|
|
6
6
|
// Initialize WYSIHTML Editor
|
|
7
7
|
$(".wysihtml5").wysihtml5(
|