caboose-cms 0.9.229 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/assets/javascripts/caboose/admin.js +1 -1
- data/app/assets/javascripts/caboose/admin/application.js +20 -0
- data/app/assets/javascripts/caboose/admin_main.js +13 -3
- data/app/assets/javascripts/caboose/admin_media_index.js +158 -161
- data/app/assets/javascripts/caboose/application.js +7 -8
- data/app/assets/javascripts/caboose/block_content_controller_dragdrop.js +4 -60
- data/app/assets/javascripts/caboose/block_modal_controllers/block_dd_modal_controller.js +2 -3
- data/app/assets/javascripts/caboose/block_modal_controllers/media_modal_controller.js +6 -17
- data/app/assets/javascripts/caboose/model/all.js +1 -5
- data/app/assets/stylesheets/caboose/admin/_config.scss +102 -0
- data/app/assets/stylesheets/caboose/admin/application.css +11 -0
- data/app/assets/stylesheets/caboose/admin/component.css +183 -0
- data/app/assets/stylesheets/caboose/admin/froala.min.css +91 -0
- data/app/assets/stylesheets/caboose/admin/ie.scss +67 -0
- data/app/assets/stylesheets/caboose/admin/integrations/main.scss +6 -0
- data/app/assets/stylesheets/caboose/admin/integrations/shopify.scss +128 -0
- data/app/assets/stylesheets/caboose/admin/jquery-ui-subnav-theme.min.css +5 -0
- data/app/assets/stylesheets/caboose/admin/layout.scss +150 -0
- data/app/assets/stylesheets/caboose/admin/main.scss +34 -0
- data/app/assets/stylesheets/caboose/admin/modules/body.scss +176 -0
- data/app/assets/stylesheets/caboose/admin/modules/buttons.scss +120 -0
- data/app/assets/stylesheets/caboose/admin/modules/countdown.css +21 -0
- data/app/assets/stylesheets/caboose/admin/modules/crumbtrail.scss +80 -0
- data/app/assets/stylesheets/caboose/admin/modules/data_table.scss +92 -0
- data/app/assets/stylesheets/caboose/admin/modules/footer.scss +62 -0
- data/app/assets/stylesheets/caboose/admin/modules/forms.scss +72 -0
- data/app/assets/stylesheets/caboose/admin/modules/functions.scss +31 -0
- data/app/assets/stylesheets/caboose/admin/modules/grid.scss +108 -0
- data/app/assets/stylesheets/caboose/admin/modules/header.scss +77 -0
- data/app/assets/stylesheets/caboose/admin/modules/headings.scss +38 -0
- data/app/assets/stylesheets/caboose/admin/modules/main_nav.scss +73 -0
- data/app/assets/stylesheets/caboose/admin/modules/message_boxes.scss +55 -0
- data/app/assets/stylesheets/caboose/admin/modules/model_binder.scss +189 -0
- data/app/assets/stylesheets/caboose/admin/modules/navigation.scss +261 -0
- data/app/assets/stylesheets/caboose/admin/modules/order_bumps.scss +57 -0
- data/app/assets/stylesheets/caboose/admin/modules/pager.scss +34 -0
- data/app/assets/stylesheets/caboose/admin/modules/product_images.scss +21 -0
- data/app/assets/stylesheets/caboose/admin/modules/products.css +86 -0
- data/app/assets/stylesheets/caboose/admin/modules/search.scss +49 -0
- data/app/assets/stylesheets/caboose/admin/modules/selects.scss +12 -0
- data/app/assets/stylesheets/caboose/admin/modules/subnav_tabs.scss +34 -0
- data/app/assets/stylesheets/caboose/admin/modules/tabs.scss +140 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/block_anchors.scss +48 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/block_overlays.scss +182 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/device_selector.scss +65 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/froala.scss +81 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/group_overlay.scss +115 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/layout.scss +128 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/main.scss +18 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/modal.scss +11 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/preview.scss +25 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/publish.scss +25 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/revisions.scss +58 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/subnav.scss +273 -0
- data/app/assets/stylesheets/caboose/admin/page_edit/top_nav.scss +109 -0
- data/app/assets/stylesheets/caboose/admin/pages/assets_index.css +48 -0
- data/app/assets/stylesheets/caboose/admin/pages/block_edit_image.css.scss +386 -0
- data/app/assets/stylesheets/caboose/admin/pages/media_index.css.scss +300 -0
- data/app/assets/stylesheets/caboose/admin/pages/new_block.css +9 -0
- data/app/assets/stylesheets/caboose/admin/pages/page_edit.scss +960 -0
- data/app/assets/stylesheets/caboose/admin/pages/page_edit_content.scss +103 -0
- data/app/assets/stylesheets/caboose/admin/pages/pages_index.scss +79 -0
- data/app/assets/stylesheets/caboose/admin/pages/post_edit_content.css +46 -0
- data/app/assets/stylesheets/caboose/admin/print.css +3 -0
- data/app/assets/stylesheets/caboose/admin/slack.scss +51 -0
- data/app/assets/stylesheets/caboose/admin_block_edit_image.css.scss +1 -2
- data/app/assets/stylesheets/caboose/admin_edit_page_content_dragdrop.scss +15 -71
- data/app/assets/stylesheets/caboose/admin_main.css.scss +29 -25
- data/app/assets/stylesheets/caboose/admin_media_index.css.scss +5 -26
- data/app/assets/stylesheets/caboose/application.css +5 -11
- data/app/assets/stylesheets/caboose/login.scss +0 -1
- data/app/assets/stylesheets/caboose/modal_main.css +19 -21
- data/app/assets/stylesheets/caboose/model_binder.css +4 -13
- data/app/assets/stylesheets/caboose/page_bar_generator.css +1 -2
- data/app/controllers/caboose/admin_controller.rb +4 -3
- data/app/controllers/caboose/application_controller.rb +19 -16
- data/app/controllers/caboose/assets_controller.rb +65 -0
- data/app/controllers/caboose/block_types_controller.rb +6 -8
- data/app/controllers/caboose/cart_controller.rb +2 -2
- data/app/controllers/caboose/fonts_controller.rb +2 -139
- data/app/controllers/caboose/invoices_controller.rb +4 -5
- data/app/controllers/caboose/login_logs_controller.rb +7 -5
- data/app/controllers/caboose/media_categories_controller.rb +2 -16
- data/app/controllers/caboose/media_controller.rb +11 -14
- data/app/controllers/caboose/pages_controller.rb +42 -104
- data/app/controllers/caboose/posts_controller.rb +7 -53
- data/app/controllers/caboose/products_controller.rb +1 -1
- data/app/controllers/caboose/sites_controller.rb +6 -25
- data/app/controllers/caboose/sns_controller.rb +3 -3
- data/app/controllers/caboose/themes_controller.rb +0 -30
- data/app/controllers/caboose/users_controller.rb +10 -17
- data/app/controllers/caboose/variants_controller.rb +9 -9
- data/app/models/caboose/ab_variant.rb +1 -1
- data/app/models/caboose/asset.rb +23 -0
- data/app/models/caboose/asset_manager.rb +92 -0
- data/app/models/caboose/asset_manifest.rb +91 -0
- data/app/models/caboose/block.rb +24 -100
- data/app/models/caboose/block_cache.rb +105 -0
- data/app/models/caboose/block_cache_file.rb +22 -0
- data/app/models/caboose/block_cache_image.rb +53 -0
- data/app/models/caboose/block_type.rb +3 -4
- data/app/models/caboose/block_type_category.rb +2 -2
- data/app/models/caboose/block_type_parser.rb +1 -1
- data/app/models/caboose/block_type_source.rb +2 -2
- data/app/models/caboose/calendar_event_group.rb +2 -2
- data/app/models/caboose/category.rb +2 -2
- data/app/models/caboose/comment_routes.rb +8 -7
- data/app/models/caboose/core_plugin.rb +3 -4
- data/app/models/caboose/export.rb +1 -1
- data/app/models/caboose/font.rb +2 -7
- data/app/models/caboose/font_variant.rb +0 -12
- data/app/models/caboose/invoice.rb +14 -14
- data/app/models/caboose/line_item.rb +4 -4
- data/app/models/caboose/media.rb +4 -15
- data/app/models/caboose/media_category.rb +7 -5
- data/app/models/caboose/modification.rb +2 -2
- data/app/models/caboose/page.rb +54 -325
- data/app/models/caboose/page_bar_generator.rb +10 -20
- data/app/models/caboose/page_cache.rb +12 -0
- data/app/models/caboose/page_cacher.rb +137 -0
- data/app/models/caboose/post.rb +8 -108
- data/app/models/caboose/product.rb +5 -5
- data/app/models/caboose/product_image.rb +1 -1
- data/app/models/caboose/role.rb +2 -2
- data/app/models/caboose/schema.rb +72 -73
- data/app/models/caboose/site.rb +1 -203
- data/app/models/caboose/theme.rb +5 -70
- data/app/views/caboose/admin/_content.html.erb +44 -0
- data/app/views/caboose/admin/_fonts.html.erb +47 -0
- data/app/views/caboose/admin/_footer.html.erb +1 -0
- data/app/views/caboose/admin/_header.html.erb +12 -0
- data/app/views/caboose/admin/_icons.html.erb +6 -0
- data/app/views/caboose/admin/_mobile_navigation.html.erb +22 -0
- data/app/views/caboose/admin/_post.html.erb +74 -0
- data/app/views/caboose/admin/index.html.erb +33 -36
- data/app/views/caboose/block_types/admin_edit.html.erb +8 -6
- data/app/views/caboose/blocks/_file.html.erb +2 -2
- data/app/views/caboose/blocks/_ga.html.erb +2 -1
- data/app/views/caboose/blocks/_image.html.erb +0 -4
- data/app/views/caboose/blocks/_render_function.html.erb +4 -9
- data/app/views/caboose/fonts/admin_index.html.erb +10 -55
- data/app/views/caboose/invoices_mailer/customer_status_updated.html.erb +14 -5
- data/app/views/caboose/login_logs/admin_index_for_user.html.erb +1 -1
- data/app/views/caboose/media/admin_index.html.erb +24 -14
- data/app/views/caboose/my_account/index.html.erb +0 -1
- data/app/views/caboose/pages/_admin_header.html.erb +0 -5
- data/app/views/caboose/pages/admin_edit_content.html.erb +2 -6
- data/app/views/caboose/pages/admin_edit_general.html.erb +4 -32
- data/app/views/caboose/pages/admin_new_old.html.erb +46 -0
- data/app/views/caboose/pages/test.html.erb +64 -0
- data/app/views/caboose/posts/_admin_header.html.erb +0 -5
- data/app/views/caboose/posts/admin_delete_form.html.erb +1 -1
- data/app/views/caboose/posts/admin_edit_content.html.erb +2 -6
- data/app/views/caboose/products/admin_group_variants.html.erb +1 -1
- data/app/views/caboose/products/admin_sort.html copy.erb +1 -1
- data/app/views/caboose/sites/admin_edit.html.erb +0 -21
- data/app/views/caboose/themes/admin_edit.html.erb +3 -7
- data/app/views/caboose/users/_admin_header.html.erb +0 -4
- data/app/views/caboose/users/admin_edit_roles.html.erb +0 -1
- data/app/views/caboose/variants/admin_group.html.erb +1 -1
- data/app/views/layouts/caboose/admin.html.erb +2 -9
- data/app/views/layouts/caboose/application.html.erb +92 -62
- data/config/routes.rb +1 -4
- data/lib/caboose/version.rb +1 -1
- data/lib/tasks/caboose.rake +14 -3
- metadata +238 -57
- data/app/controllers/caboose/change_logs_controller.rb +0 -13
- data/app/models/caboose/change_log.rb +0 -97
- data/app/views/caboose/blocks/_cached_block.html.erb +0 -28
- data/app/views/caboose/change_logs/admin_index.html.erb +0 -65
- data/app/views/caboose/fonts/admin_family_edit.html.erb +0 -63
- data/app/views/caboose/fonts/admin_family_index.html.erb +0 -42
- data/app/views/caboose/fonts/admin_variant_edit.html.erb +0 -84
- data/app/views/caboose/pages/admin_change_logs.html.erb +0 -56
- data/app/views/caboose/pages/compiled_asset.css.erb +0 -0
- data/app/views/caboose/pages/compiled_asset.js.erb +0 -0
- data/app/views/caboose/posts/admin_change_logs.html.erb +0 -56
- data/app/views/caboose/sites/compiled_asset.css.erb +0 -0
- data/app/views/caboose/sites/compiled_asset.js.erb +0 -0
- data/app/views/caboose/themes/admin_error_log.html.erb +0 -9
- data/app/views/caboose/themes/admin_js.html.erb +0 -131
- data/app/views/caboose/users/admin_change_logs.html.erb +0 -63
- data/app/views/layouts/caboose/css.css.erb +0 -44
- data/app/views/layouts/caboose/footer_css.css.erb +0 -41
- data/app/views/layouts/caboose/footer_js.js.erb +0 -31
- data/app/views/layouts/caboose/js.js.erb +0 -34
@@ -1,13 +0,0 @@
|
|
1
|
-
module Caboose
|
2
|
-
class ChangeLogsController < Caboose::ApplicationController
|
3
|
-
|
4
|
-
# @route GET /admin/logs
|
5
|
-
def admin_index
|
6
|
-
return unless user_is_allowed('logs', 'view')
|
7
|
-
mc = "Media Category"
|
8
|
-
@logs = ChangeLog.where(:site_id => @site.id).where('(is_field = false and (action = ? OR action = ?)) OR (action != ? and action != ?) OR (is_field = true AND description ILIKE (?))','added','deleted','added','deleted',"%#{mc}%").order('timestamp desc, id desc').limit(500)
|
9
|
-
render :layout => 'caboose/admin'
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
@@ -1,97 +0,0 @@
|
|
1
|
-
module Caboose
|
2
|
-
class ChangeLog < ActiveRecord::Base
|
3
|
-
self.table_name = 'change_logs'
|
4
|
-
|
5
|
-
belongs_to :site
|
6
|
-
belongs_to :page
|
7
|
-
belongs_to :post
|
8
|
-
belongs_to :block
|
9
|
-
belongs_to :user
|
10
|
-
belongs_to :media
|
11
|
-
|
12
|
-
attr_accessible :id,
|
13
|
-
:site_id,
|
14
|
-
:page_id,
|
15
|
-
:post_id,
|
16
|
-
:block_id,
|
17
|
-
:block_parent_id,
|
18
|
-
:media_id,
|
19
|
-
:user_id,
|
20
|
-
:is_field,
|
21
|
-
:description,
|
22
|
-
:action,
|
23
|
-
:timestamp,
|
24
|
-
:old_value,
|
25
|
-
:new_value,
|
26
|
-
:old_parent_id,
|
27
|
-
:new_parent_id,
|
28
|
-
:old_sort_order,
|
29
|
-
:new_sort_order
|
30
|
-
|
31
|
-
|
32
|
-
def describe_old_position
|
33
|
-
b = self.block
|
34
|
-
par = self.old_parent_id.blank? ? false : Caboose::Block.where(:id => self.old_parent_id).first
|
35
|
-
desc = ""
|
36
|
-
pos = par && par.block_type && par.block_type.name == 'flex_grid_unit' ? par.sort_order + 1 : nil
|
37
|
-
desc += par.block_type.description + " #{pos} -> " if par && par.block_type
|
38
|
-
desc += "position #{self.old_sort_order}"
|
39
|
-
return desc
|
40
|
-
end
|
41
|
-
|
42
|
-
def describe_new_position
|
43
|
-
b = self.block
|
44
|
-
par = self.new_parent_id.blank? ? Caboose::Block.where(:id => self.old_parent_id).first : Caboose::Block.where(:id => self.new_parent_id).first
|
45
|
-
desc = ""
|
46
|
-
pos = par && par.block_type && par.block_type.name == 'flex_grid_unit' ? par.sort_order + 1 : nil
|
47
|
-
desc += par.block_type.description + " #{pos} -> " if par && par.block_type
|
48
|
-
desc += "position #{self.new_sort_order}"
|
49
|
-
return desc
|
50
|
-
end
|
51
|
-
|
52
|
-
def describe_action
|
53
|
-
return 'added' if self.action == 'added'
|
54
|
-
if !self.old_value.nil? && !self.new_value.nil? && self.old_value != self.new_value
|
55
|
-
return 'edited'
|
56
|
-
elsif !self.old_sort_order.nil? && !self.new_sort_order.nil? && self.old_sort_order != self.new_sort_order
|
57
|
-
return 'moved'
|
58
|
-
elsif !self.old_parent_id.nil? && !self.new_parent_id.nil? && self.old_parent_id != self.new_parent_id
|
59
|
-
return 'moved'
|
60
|
-
else
|
61
|
-
return self.action
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def describe_old
|
66
|
-
if self.describe_action == 'moved'
|
67
|
-
return self.describe_old_position
|
68
|
-
elsif self.describe_action == 'edited'
|
69
|
-
return self.old_value == 'EMPTY' ? '' : self.old_value
|
70
|
-
elsif self.describe_action == 'deleted'
|
71
|
-
ov = self.old_value == 'EMPTY' ? '' : self.old_value
|
72
|
-
opts = ['Title','Text']
|
73
|
-
desc = Caboose::ChangeLog.where("block_parent_id is not null").where(:block_parent_id => self.block_id).where(:description => opts).first
|
74
|
-
return desc ? desc.old_value : ov
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def describe_new
|
79
|
-
block = Caboose::Block.where(:id => self.block_id).first if !self.block_id.blank?
|
80
|
-
if self.describe_action == 'moved'
|
81
|
-
return self.describe_new_position
|
82
|
-
elsif self.describe_action == 'edited'
|
83
|
-
return self.new_value == 'EMPTY' ? '' : self.new_value
|
84
|
-
elsif self.describe_action == 'added'
|
85
|
-
nv = self.new_value.blank? ? (self.old_value == 'EMPTY' ? '' : self.old_value) : (self.new_value == 'EMPTY' ? '' : self.new_value)
|
86
|
-
if block
|
87
|
-
nv = block.cv(false,'text') if block.child('text')
|
88
|
-
nv = block.cv(false,'title') if block.child('title')
|
89
|
-
nv = Caboose::Media.title_for_id(block.child('image_src').media_id) if block.child('image_src') && block.child('image_src').media_id && !block.child('image_src').media_id.blank?
|
90
|
-
nv = block.cv(false,'heading_text') if block.child('heading_text')
|
91
|
-
end
|
92
|
-
return nv
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
end
|
97
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<%== ERB.new(render_function).result(self.instance_eval { binding }) %>
|
2
|
-
|
3
|
-
<% if caboose_js && caboose_js.length > 1 %>
|
4
|
-
<% caboose_js.to_a.each_with_index do |js, ind| %>
|
5
|
-
<% next if ind == 0 %>
|
6
|
-
<% content_for :js do %>
|
7
|
-
<% begin %>
|
8
|
-
<% block.cached_js = ERB.new(js).result(self.instance_eval { binding }) %>
|
9
|
-
<% block.save %>
|
10
|
-
<% rescue %>
|
11
|
-
<% Caboose.log("JS ERROR for block #{block.id}") %>
|
12
|
-
<% end %>
|
13
|
-
<% end %>
|
14
|
-
<% end %>
|
15
|
-
<% end %>
|
16
|
-
<% if caboose_css && caboose_css.length > 1 %>
|
17
|
-
<% caboose_css.to_a.each_with_index do |css, ind| %>
|
18
|
-
<% next if ind == 0 %>
|
19
|
-
<% content_for :css do %>
|
20
|
-
<% begin %>
|
21
|
-
<% block.cached_css = ERB.new(css).result(self.instance_eval { binding }) %>
|
22
|
-
<% block.save %>
|
23
|
-
<% rescue %>
|
24
|
-
<% Caboose.log("CSS ERROR for block #{block.id}") %>
|
25
|
-
<% end %>
|
26
|
-
<% end %>
|
27
|
-
<% end %>
|
28
|
-
<% end %>
|
@@ -1,65 +0,0 @@
|
|
1
|
-
<h1>Recent Changes</h1>
|
2
|
-
|
3
|
-
<div style="padding-right:30px;">
|
4
|
-
<table cellpadding="0" cellspacing="0">
|
5
|
-
<thead>
|
6
|
-
<tr>
|
7
|
-
<th>User</th>
|
8
|
-
<th>Resource</th>
|
9
|
-
<th>Title</th>
|
10
|
-
<th>Date</th>
|
11
|
-
<th>Action</th>
|
12
|
-
<th>Field</th>
|
13
|
-
<th>Old Value</th>
|
14
|
-
<th>New Value</th>
|
15
|
-
</tr>
|
16
|
-
</thead>
|
17
|
-
<% @logs.each do |log| %>
|
18
|
-
<%
|
19
|
-
res = log.page_id ? Caboose::Page.where(:id => log.page_id).first : (log.post_id ? Caboose::Post.where(:id => log.post_id).first : (log.media_id ? Caboose::Media.where(:id => log.media_id).first : nil))
|
20
|
-
res_type = log.page_id ? "Page" : (log.post_id ? "Post" : (log.description.include?('Media Category') && log.media_id ? ('Media Category') : (log.media_id ? "Media" : nil)))
|
21
|
-
res_title = res ? (log.page_id ? res.title : (log.post_id ? res.title : (log.description.include?('Media Category') && log.media_id ? (log.description.gsub('Media Category: ','')) : (log.media_id ? Caboose::Media.title_for_id(res.id) : "N/A")))) : log.description.gsub("Media Category: ","")
|
22
|
-
%>
|
23
|
-
<tr>
|
24
|
-
<td><%= log.user ? log.user.username : "N/A" %></td>
|
25
|
-
<td><%= res_type %></td>
|
26
|
-
<td><%= res_title %></td>
|
27
|
-
<td><%= log.timestamp.in_time_zone('Central Time (US & Canada)').strftime('%-m/%-d/%y, %l:%M%P') %></td>
|
28
|
-
<td><%= log.describe_action %></td>
|
29
|
-
<td><%= log.description.blank? ? '' : log.description.gsub("Media Category: ",'') %></td>
|
30
|
-
<td><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_old.blank? && log.describe_old.include?('</')) ? "<pre>" : "" %><%= log.describe_old %><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_old.blank? && log.describe_old.include?('</')) ? "</pre>" : "" %></td>
|
31
|
-
<td><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_new.blank? && log.describe_new.include?('</')) ? "<pre>" : "" %><%= log.describe_new %><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_new.blank? && log.describe_new.include?('</')) ? "</pre>" : "" %></td>
|
32
|
-
</tr>
|
33
|
-
<% end %>
|
34
|
-
</table>
|
35
|
-
</div>
|
36
|
-
|
37
|
-
|
38
|
-
<% content_for :caboose_css do %>
|
39
|
-
<style>
|
40
|
-
table {
|
41
|
-
width: 100%;
|
42
|
-
}
|
43
|
-
table tr {
|
44
|
-
|
45
|
-
}
|
46
|
-
table td, table th {
|
47
|
-
font-family: "Roboto";
|
48
|
-
font-weight: 300;
|
49
|
-
font-size: 13px;
|
50
|
-
padding: 6px 8px 6px 4px;
|
51
|
-
text-align: left;
|
52
|
-
max-width: 200px;
|
53
|
-
border-bottom: 1px solid #eaeaea;
|
54
|
-
}
|
55
|
-
td pre {
|
56
|
-
overflow: hidden;
|
57
|
-
white-space: pre-line;
|
58
|
-
font-size: 12px;
|
59
|
-
font-family: monospace;
|
60
|
-
}
|
61
|
-
table th {
|
62
|
-
font-weight: bold;
|
63
|
-
}
|
64
|
-
</style>
|
65
|
-
<% end %>
|
@@ -1,63 +0,0 @@
|
|
1
|
-
<h1>Edit Font Family</h1>
|
2
|
-
|
3
|
-
<h2><%= @ff.name %></h2>
|
4
|
-
<h4>Variants</h4>
|
5
|
-
|
6
|
-
<ul>
|
7
|
-
<% @ff.font_variants.order(:sort_order).each do |var| %>
|
8
|
-
<li><a href="/admin/font-variants/<%= var.id %>"><%= var.variant %></a></li>
|
9
|
-
<% end %>
|
10
|
-
<li style="margin-top:15px;"><a href="#" onclick="new_variant();return false;">New Variant</a></li>
|
11
|
-
</ul>
|
12
|
-
|
13
|
-
<div id="new-variant">
|
14
|
-
<h5>Add New Font Variant</h5>
|
15
|
-
<form method="POST" action="/admin/font-variants">
|
16
|
-
<input type="hidden" name="family_id" value="<%= @ff.id %>" />
|
17
|
-
<input style="width:200px;" id="var" type="text" name="variant" placeholder="Variant Name" />
|
18
|
-
<a href="#" id="submit-variant" class="caboose-btn">Add</a>
|
19
|
-
<div style="margin-top:5px;" id="message"></div>
|
20
|
-
</form>
|
21
|
-
</div>
|
22
|
-
|
23
|
-
|
24
|
-
<br /><br />
|
25
|
-
<a href="/admin/font-families" class="caboose-btn">Back</a>
|
26
|
-
|
27
|
-
<% content_for :caboose_js do %>
|
28
|
-
<script>
|
29
|
-
function new_variant() {
|
30
|
-
$("#new-variant").slideToggle();
|
31
|
-
}
|
32
|
-
$("#submit-variant").click(function(e) {
|
33
|
-
e.preventDefault();
|
34
|
-
$.ajax({
|
35
|
-
url: '/admin/font-variants',
|
36
|
-
type: 'post',
|
37
|
-
data: {
|
38
|
-
family_id: <%= @ff.id %>,
|
39
|
-
variant: $("#var").val()
|
40
|
-
},
|
41
|
-
success: function(resp) {
|
42
|
-
if (resp.error) $('#message').html("<p class='note error'>" + resp.error + "</p>");
|
43
|
-
if (resp.redirect) window.location = resp.redirect;
|
44
|
-
}
|
45
|
-
});
|
46
|
-
});
|
47
|
-
</script>
|
48
|
-
<% end %>
|
49
|
-
|
50
|
-
<% content_for :caboose_css do %>
|
51
|
-
<style>
|
52
|
-
#new-variant {
|
53
|
-
padding: 15px;
|
54
|
-
border: 1px solid gray;
|
55
|
-
width: 400px;
|
56
|
-
background: #dfffd2;
|
57
|
-
display: none;
|
58
|
-
}
|
59
|
-
#new-variant h5 {
|
60
|
-
margin: 0 0 8px 0;
|
61
|
-
}
|
62
|
-
</style>
|
63
|
-
<% end %>
|
@@ -1,42 +0,0 @@
|
|
1
|
-
<h1>Font Families</h1>
|
2
|
-
|
3
|
-
<div id='fonts'></div>
|
4
|
-
|
5
|
-
<% content_for :caboose_css do %>
|
6
|
-
<style>
|
7
|
-
table.data {
|
8
|
-
margin-right: 20px;
|
9
|
-
}
|
10
|
-
</style>
|
11
|
-
<% end %>
|
12
|
-
|
13
|
-
<% content_for :caboose_js do %>
|
14
|
-
<%= javascript_include_tag 'caboose/model/all' %>
|
15
|
-
<script type='text/javascript'>
|
16
|
-
|
17
|
-
$(document).ready(function() {
|
18
|
-
var that = this;
|
19
|
-
var table = new IndexTable({
|
20
|
-
form_authenticity_token: '<%= form_authenticity_token %>',
|
21
|
-
container: 'fonts',
|
22
|
-
base_url: '/admin/font-families',
|
23
|
-
allow_bulk_edit: false,
|
24
|
-
allow_bulk_import: false,
|
25
|
-
allow_duplicate: false,
|
26
|
-
allow_bulk_delete: false,
|
27
|
-
after_add: 'redirect',
|
28
|
-
fields: [
|
29
|
-
{ name: 'name' , sort: 'name' , show: true , editable: false, bulk_edit: false, nice_name: 'Name' , type: 'text' , value: function(site) { return site.name; }, width: 400 }
|
30
|
-
],
|
31
|
-
search_fields: [
|
32
|
-
{ name: 'name_like', nice_name: 'Name', type: 'text', width: 400 }
|
33
|
-
],
|
34
|
-
new_model_text: 'New Font Familiy',
|
35
|
-
new_model_fields: [
|
36
|
-
{ name: 'name', nice_name: 'Name', type: 'text', width: 400 }
|
37
|
-
],
|
38
|
-
});
|
39
|
-
});
|
40
|
-
|
41
|
-
</script>
|
42
|
-
<% end %>
|
@@ -1,84 +0,0 @@
|
|
1
|
-
|
2
|
-
<h1>Edit Font Variant</h1>
|
3
|
-
|
4
|
-
<h4><%= @variant.font_family.name %></h4>
|
5
|
-
<p><div id='fontvariant_<%= @variant.id %>_variant' ></div></p>
|
6
|
-
<p><div id='fontvariant_<%= @variant.id %>_style' ></div></p>
|
7
|
-
<p><div id='fontvariant_<%= @variant.id %>_weight' ></div></p>
|
8
|
-
<p><div id='fontvariant_<%= @variant.id %>_sort_order' ></div></p>
|
9
|
-
<p><div id='fontvariant_<%= @variant.id %>_ttf_url' ></div></p>
|
10
|
-
|
11
|
-
<div class="file-wrapper">
|
12
|
-
<div id='fontvariant_<%= @variant.id %>_ttf_file' ></div>
|
13
|
-
<p class="current">Current file: <%= @variant.ttf_file_file_name.blank? ? "None" : @variant.ttf_file_file_name %></p>
|
14
|
-
</div>
|
15
|
-
<div class="file-wrapper">
|
16
|
-
<div id='fontvariant_<%= @variant.id %>_woff_file' ></div>
|
17
|
-
<p class="current">Current file: <%= @variant.woff_file_file_name.blank? ? "None" : @variant.woff_file_file_name %></p>
|
18
|
-
</div>
|
19
|
-
|
20
|
-
|
21
|
-
<div id='message'></div>
|
22
|
-
|
23
|
-
<a class="caboose-btn" href="/admin/font-families/<%= @variant.font_family_id %>">Back</a>
|
24
|
-
|
25
|
-
|
26
|
-
<% content_for :caboose_js do %>
|
27
|
-
<%= javascript_include_tag "caboose/model/all" %>
|
28
|
-
<script type="text/javascript">
|
29
|
-
|
30
|
-
$(document).ready(function() {
|
31
|
-
m = new ModelBinder({
|
32
|
-
name: 'FontVariant',
|
33
|
-
id: <%= @variant.id %>,
|
34
|
-
update_url: '/admin/font-variants/<%= @variant.id %>',
|
35
|
-
authenticity_token: '<%= form_authenticity_token %>',
|
36
|
-
attributes: [
|
37
|
-
{ name: 'variant' , nice_name: 'Name' , type: 'text' , value: <%= raw Caboose.json(@variant.variant ) %>, width: 500 },
|
38
|
-
{ name: 'style' , nice_name: 'Style' , type: 'text' , value: <%= raw Caboose.json(@variant.style ) %>, width: 500 },
|
39
|
-
{ name: 'weight' , nice_name: 'Weight' , type: 'text' , value: <%= raw Caboose.json(@variant.weight ) %>, width: 500 },
|
40
|
-
{ name: 'sort_order' , nice_name: 'Sort Order' , type: 'text' , value: <%= raw Caboose.json(@variant.sort_order ) %>, width: 500 },
|
41
|
-
{ name: 'ttf_url' , nice_name: 'TTF URL (deprecated)' , type: 'text' , value: <%= raw Caboose.json(@variant.ttf_url ) %>, width: 800 },
|
42
|
-
{ name: 'ttf_file' , nice_name: 'TTF File' , type: 'file' , value: <%= raw Caboose.json(@variant.ttf_file ? @variant.ttf_file.url : 'No File') %>, width: 800, update_url: '/admin/font-variants/<%= @variant.id %>/ttf-file' },
|
43
|
-
{ name: 'woff_file' , nice_name: 'WOFF File' , type: 'file' , value: <%= raw Caboose.json(@variant.woff_file ? @variant.woff_file.url : 'No File') %>, width: 800, update_url: '/admin/font-variants/<%= @variant.id %>/woff-file' }
|
44
|
-
]
|
45
|
-
});
|
46
|
-
});
|
47
|
-
|
48
|
-
</script>
|
49
|
-
<% end %>
|
50
|
-
|
51
|
-
|
52
|
-
<% content_for :caboose_css do %>
|
53
|
-
<style>
|
54
|
-
.file-wrapper {
|
55
|
-
position: relative;
|
56
|
-
right: 9px;
|
57
|
-
}
|
58
|
-
.file-wrapper::after {
|
59
|
-
content: ".";
|
60
|
-
visibility: hidden;
|
61
|
-
display: block;
|
62
|
-
height: 0;
|
63
|
-
clear: both;
|
64
|
-
}
|
65
|
-
.file-wrapper .mb_placeholder span {
|
66
|
-
font-size: 15px;
|
67
|
-
position: relative;
|
68
|
-
bottom: 7px;
|
69
|
-
}
|
70
|
-
.file-wrapper .mb_container {
|
71
|
-
display: inline-block;
|
72
|
-
width: auto;
|
73
|
-
}
|
74
|
-
.current {
|
75
|
-
color: #0357FF;
|
76
|
-
font-size: 13px;
|
77
|
-
padding-left: 10px;
|
78
|
-
position: relative;
|
79
|
-
bottom: 33px;
|
80
|
-
margin-top: 0;
|
81
|
-
display: inline-block;
|
82
|
-
}
|
83
|
-
</style>
|
84
|
-
<% end %>
|
@@ -1,56 +0,0 @@
|
|
1
|
-
<%= render :partial => 'caboose/pages/admin_header' %>
|
2
|
-
|
3
|
-
<div style="padding-right:30px;">
|
4
|
-
<table cellpadding="0" cellspacing="0">
|
5
|
-
<thead>
|
6
|
-
<tr>
|
7
|
-
<th>User</th>
|
8
|
-
<th>Date</th>
|
9
|
-
<th>Action</th>
|
10
|
-
<th>Field</th>
|
11
|
-
<th>Old Value</th>
|
12
|
-
<th>New Value</th>
|
13
|
-
</tr>
|
14
|
-
</thead>
|
15
|
-
<% @logs.each do |log| %>
|
16
|
-
<tr>
|
17
|
-
<td><%= log.user.username %></td>
|
18
|
-
<td><%= log.timestamp.in_time_zone('Central Time (US & Canada)').strftime('%-m/%-d/%y, %l:%M%P') %></td>
|
19
|
-
<td><%= log.describe_action %></td>
|
20
|
-
<td><%= log.description %></td>
|
21
|
-
<td><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_old.blank? && log.describe_old.include?('</')) ? "<pre>" : "" %><%= log.describe_old %><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_old.blank? && log.describe_old.include?('</')) ? "</pre>" : "" %></td>
|
22
|
-
<td><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_new.blank? && log.describe_new.include?('</')) ? "<pre>" : "" %><%= log.describe_new %><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_new.blank? && log.describe_new.include?('</')) ? "</pre>" : "" %></td>
|
23
|
-
</tr>
|
24
|
-
<% end %>
|
25
|
-
</table>
|
26
|
-
</div>
|
27
|
-
|
28
|
-
|
29
|
-
<% content_for :caboose_css do %>
|
30
|
-
<style>
|
31
|
-
table {
|
32
|
-
width: 100%;
|
33
|
-
}
|
34
|
-
table tr {
|
35
|
-
|
36
|
-
}
|
37
|
-
table td, table th {
|
38
|
-
font-family: "Roboto";
|
39
|
-
font-weight: 300;
|
40
|
-
font-size: 13px;
|
41
|
-
padding: 6px 8px 6px 4px;
|
42
|
-
text-align: left;
|
43
|
-
max-width: 200px;
|
44
|
-
border-bottom: 1px solid #eaeaea;
|
45
|
-
}
|
46
|
-
td pre {
|
47
|
-
overflow: hidden;
|
48
|
-
white-space: pre-line;
|
49
|
-
font-size: 12px;
|
50
|
-
font-family: monospace;
|
51
|
-
}
|
52
|
-
table th {
|
53
|
-
font-weight: bold;
|
54
|
-
}
|
55
|
-
</style>
|
56
|
-
<% end %>
|