This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#admin-members-form | |
= form_for [:admin, @member] do |f| | |
.row | |
.input-field.col.s12.l9 | |
i.material-icons.prefix email | |
= f.email_field :email, class: 'validate' | |
= f.label :email | |
.row |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#admin-members-new | |
- unless @member.errors.empty? | |
ul.hide | |
- @member.errors.full_messages.each do |msg| | |
li.u-toast = msg | |
.row | |
.col.s12.m9 | |
.section | |
#p-title.col.s12.scrollspy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#admin-members-edit | |
- unless @member.errors.empty? | |
ul.hide | |
- @member.errors.full_messages.each do |msg| | |
li.u-toast = msg | |
.row | |
.col.s12.m9 | |
.section | |
#p-title.col.s12.scrollspy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MaterializeRenderer < SimpleNavigation::Renderer::Base | |
def render(item_container) | |
data = hash_render(item_container) | |
list = [] | |
data.each do |item| | |
unless item[:items] | |
options = { class: "waves-effect waves-teal #{item[:class].present? ? item[:class] : ''}" } | |
options[:method] = item[:method] if item[:method] | |
a = link_to item[:name], item[:url], options | |
li = content_tag :li, a, class: (item[:selected] ? 'active' : '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
ACTIVE = { | |
welcome: [ { welcome: %w(index ) } ], | |
new_book: [ { books: %w(new create ) } ], | |
books: [ { books: %w(index edit show update destroy) }, ], | |
} | |
def hl(key) | |
actives = ACTIVE[key] || [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AvatarUploader < CarrierWave::Uploader::Base | |
include CarrierWave::MiniMagick | |
storage :file | |
def store_dir | |
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" | |
end | |
process :resize_to_limit => [500, 500] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
en: | |
errors: | |
messages: | |
carrierwave_processing_error: failed to be processed | |
carrierwave_integrity_error: is not of an allowed file type | |
carrierwave_download_error: could not be downloaded | |
extension_white_list_error: "You are not allowed to upload %{extension} files, allowed types: %{allowed_types}" | |
extension_black_list_error: "You are not allowed to upload %{extension} files, prohibited types: %{prohibited_types}" | |
mime_type_pattern_white_list_error: "You are not allowed to upload %{content_type} files" | |
mime_type_pattern_black_list_error: "You are not allowed to upload %{content_type} files" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready -> | |
if !$('.p-image-url').text() or $('.p-hidden-remove').val() is '1' | |
$('.p-image').attr('src', '').hide() | |
$('.p-icon').show() | |
$('.p-delete').hide() | |
$('.p-preview').click (e) -> | |
btn = $(@) | |
e and e.preventDefault() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path('../boot', __FILE__) | |
require 'active_model/railtie' | |
require 'active_job/railtie' | |
require 'active_record/railtie' | |
require 'action_controller/railtie' | |
require 'action_mailer/railtie' | |
require 'action_view/railtie' | |
require 'sprockets/railtie' |