This file contains 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 FrontController < ApplicationController | |
protect_from_forgery with: :exception | |
protect_from_forgery except: :ajax | |
include Front::CommonHelper | |
include Front::PagesHelper | |
include Front::SearchHelper | |
include Front::HtmlHelper | |
include PageMethods | |
before_action :check_status_site |
This file contains 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 Admin::User < ActiveRecord::Base | |
has_one :profile , :class_name => "Admin::Profile", :foreign_key => "user_id", dependent: :destroy | |
has_many :assigned_user, :class_name => "Admin::AssignedUser", dependent: :destroy | |
has_many :assigned_site, -> {where(:is_disabled => 0)}, :class_name => "Admin::AssignedUser", dependent: :destroy | |
has_many :sites, :class_name => "Admin::Site", :through => :assigned_site | |
has_many :permission, :class_name => "Admin::Permission", :dependent => :destroy | |
has_many :admin_group, :class_name => "Admin::AdminGroup", :through => :assigned_user | |
has_many :visitor_group, :class_name => "Admin::VisitorGroup", :through => :assigned_user |
This file contains 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
#publication_uploader | |
{ | |
.progress{ | |
height: 40px; | |
line-height: 40px; | |
background: #ccc; | |
.progress-bar{ | |
font-size: 16px; | |
font-style: italic; | |
line-height: 40px; |
This file contains 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
<?php | |
class Company_Controller extends FD_Management | |
{ | |
function __construct() | |
{ | |
parent::__construct(); | |
$this->useLayout("fastdevelphp/backend"); | |
} | |
/** |
This file contains 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 'net-ldap' | |
class CustomActiveDirectory | |
def initialize(host, port, base, username, pass) | |
@ldap = connect(host, port, base, username, pass) | |
end | |
def connected? | |
begin | |
return @ldap.bind | |
rescue |
This file contains 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
/* ------------------ fonts -------------------*/ | |
@font-face { | |
font-family: 'Union-Regular'; | |
src: url('../font/unionregular.eot'); | |
src: url('../font/unionregular.eot?#iefix') format('embedded-opentype'), | |
url('../font/unionregular.woff') format('woff'), | |
url('../font/unionregular.ttf') format('truetype'), | |
url('../font/unionregular.svg#unionregular') format('svg'); | |
font-weight: normal; | |
font-style: normal; |
This file contains 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
<h1><%= @post.the_title %></h1> | |
<div> | |
<%= raw @post.the_content %> | |
</div> | |
<hr> | |
<h2>Custom fields here:</h2> | |
<div> | |
Author name: <%= @post.get_field('author-name') %> | |
</div> |
This file contains 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
pt_layout = current_site.post_types.where(slug: "camaleon_layout").first || current_site.post_types.create(name: "Layout", slug: "camaleon_layout", data_options: {has_summary: false, has_picture: false }) | |
pt_layout.add_field({name: "Sub title", slug: "sub_title"}, {field_key: "text_box", translate: true}) | |
pt_layout.add_field({name: "Background Image", slug: "bg", description: "Size (1900px x 900px)."}, {field_key: "image"}) | |
pt_layout.add_field({name: "Background color", slug: "bg_color", description: ""}, {field_key: "colorpicker", color_format: "rgba"}) | |
pt_layout.add_field({name: "Pattern", slug: "pattern", description: "Permit to show square pattern as a background."}, {field_key: "checkbox"}) | |
ids << pt_layout.id | |
pt_layout.add_post(title: "Home Slider", post_order: 1, content: "Here will be shown the home slider", settings: {has_keywords: false, skip_fields: ["sub_title", "pattern", "bg", "bg_color"], default_template: "home/banner"}) | |
pt_layout.add_post(title: "Features", post_order: 2, con |
This file contains 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
# config/initializers/paper_trail.rb | |
PaperTrail::Model.module_eval do | |
# return an array of changes for specific attribute (old to newer) | |
# Sample use: Subscriber.find(2).history_from_audits_for(:first_name) | |
# Sample result: [{version: <PaperTrail::Version>, model: <Subscriber>}, {version: <PaperTrail::Version>, model: <MyModel>},....] | |
# Sample print: Subscriber.find(2).history_from_audits_for(:first_name).map{|item| item[:model].first_name } | |
# Required: Diffing Versions of paper trail | |
def history_from_audits_for(attr_name) | |
res = [] | |
self.versions.each do |v| |
This file contains 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
<!-- /my_theme/views/admin/settings.html.erb --> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h3 class="panel-title"><%= t('.top_offer', default: 'Top Offer') %></h3> | |
</div> | |
<div class="panel-body"> | |
<div class="form-group"> | |
<label><%= t('.top_offer_product', default: 'Offer Product') %></label><br> | |
<%= select_tag "theme_option[top_offer]", options_from_collection_for_select(post_type.posts.public_posts.decorate, :id, :the_title, current_theme.get_option('top_offer')), include_blank: true, class: 'form-control' %> | |
</div> |
OlderNewer