Skip to content

Commit

Permalink
updated assets initializer so that it copies over the bootstrap glyph…
Browse files Browse the repository at this point in the history
…icons and tinymce skins into the public folder
  • Loading branch information
briri committed Apr 11, 2023
1 parent 7167e83 commit 01dd934
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
20 changes: 10 additions & 10 deletions app/views/org_admin/conditions/_webhook_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@
</button>
</div>
<div class="modal-body mx-3">
<div class="md-form mb-5">
<i class="fas fa-user prefix grey-text"></i>
<div class="md-form mb-5 prefix grey-text">
<i class="fa-solid fa-user"></i>
<%= label_tag name_start + "[webhook-name]", _('Name'), {'data-error': 'wrong', 'data-success': 'right'} %>
<%= text_field_tag name_start + "[webhook-name]", nil, class: 'form-control validate' %>
</div>

<div class="md-form mb-5">
<i class="fas fa-envelope prefix grey-text"></i> <!-- mdbootstrap should have treatment for bad input for this -->
<div class="md-form mb-5 prefix grey-text">
<i class="fa-solid fa-envelope"></i> <!-- mdbootstrap should have treatment for bad input for this -->
<%= label_tag name_start + "[webhook-email]", _('Email'), {'data-error': 'wrong', 'data-success': 'right'} %>
<%= email_field_tag name_start + "[webhook-email]", nil, placeholder: _('[email protected]'), class: 'form-control validate' %>
</div>

<div class="md-form mb-5">
<i class="fas fa-tag prefix grey-text"></i>
<div class="md-form mb-5 prefix grey-text">
<i class="fa-solid fa-tag"></i>
<%= label_tag name_start + "[webhook-subject]", _('Subject'), {'data-error': 'wrong', 'data-success': 'right'} %>
<%= text_field_tag name_start + "[webhook-subject]", nil, class: 'form-control validate' %>
</div>

<div class="md-form">
<i class="fas fa-pencil prefix grey-text"></i>
<div class="md-form prefix grey-text">
<i class="fa-solid fa-pencil"></i>
<%= label_tag name_start + "[webhook-message]", _('Message'), {'data-error': 'wrong', 'data-success': 'right'} %>
<%= text_area_tag name_start + "[webhook-message]", nil, placeholder: _('Email content'), class: 'form-control md-textarea', rows: 4 %>
</div>
</div>
<div class="modal-footer d-flex justify-content-center">
<button class="btn btn-default discard" data-dismiss="modal"><%= _('Discard ') %><i class="fas fa-trash-o ml-1"></i></button>
<button class="btn btn-default" ><%= _('Save ') %><i class="fas fa-paper-plane-o ml-1"></i></button>
<button class="btn btn-default discard" data-dismiss="modal"><%= _('Discard ') %><i class="fa-solid fa-trash-can"></i></button>
<button class="btn btn-default" ><%= _('Save ') %><i class="fa-solid fa-paper-plane"></i></button>
</div>
</div>
</div>
Expand Down
13 changes: 13 additions & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,16 @@
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )

# Bootstrap and TinyMCE expect their files to live in a specific place, so copy them over
puts "Copying Bootstrap glyphicons to the public directory ..."
source_dir = Dir.glob(Rails.root.join('node_modules', 'bootstrap', 'fonts', 'glyphicons-halflings-regular.*'))
destination_dir = Rails.root.join('public', 'fonts', 'bootstrap')
Dir.mkdir(destination_dir) unless Dir.exists?(destination_dir)
FileUtils.cp_r(source_dir, destination_dir)

puts "Copying TinyMCE skins to the public directory ..."
source_dir = Dir.glob(Rails.root.join('node_modules', 'tinymce', 'skins', 'ui', 'oxide'))
destination_dir = Rails.root.join('public', 'tinymce', 'skins')
Dir.mkdir(destination_dir) unless Dir.exists?(destination_dir)
FileUtils.cp_r(source_dir, destination_dir)
Empty file removed public/fonts/.keep
Empty file.
7 changes: 0 additions & 7 deletions public/tinymce/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion public/tinymce/tinymce.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
a {
color: #000;
}
}
}

0 comments on commit 01dd934

Please sign in to comment.