Giter Club home page Giter Club logo

bhf's Introduction

bhf


https://github.com/antpaw/bhf

http://antpaw.github.io/bhf/

gem 'bhf'

# config/initializers
Bhf.configure do |config|
  config.on_login_fail = :login_url
end
mount Bhf::Engine, at: 'bhf'

get 'admin', to: 'admin#login', as: :admin
class AdminController < ApplicationController
  http_basic_authenticate_with name: 'admin', password: 'bhf'
  def login
    session[:is_admin] = true
    redirect_to bhf.root_url
  end
end
class Bhf::ApplicationController < ActionController::Base
  protect_from_forgery
  before_filter :authenticate_user!
  include Bhf::Extension::ApplicationController
  def check_admin_account
    current_user.is_admin?
  end
end

Bhf.configure do |config|
end

# schema.rb
create_table "", force: true do |t|
  t.string "identifier"
  t.string "name"
  t.datetime "created_at", null: false
  t.datetime "updated_at", null: false
end
# user.rb
create_table "roles_users", id: false, force: true do |t|
  t.integer "role_id"
  t.integer "user_id"
end

# config/initializers/bhf.rb
config.css << 'my_custom_bhf'

# routes.rb
Bhf::Engine.routes.draw do
  patch 'stadium/entries/:id', to: 'tournaments#stadium_update', defaults: {platform: 'stadium'}
  get 'tournamnts/entries/new', to: 'tournaments#new', defaults: {platform: 'tournaments'}
end

# app/controllers/bhf/tournament_controller.rb
class Bhf::TournamentsController < Bhf::EntriesController
  def new
    @object.save
    redirect_to edit_entry_path(@platform.name, @object)
  end
  def stadium_update
  end
end

# application.rb
config.i18n.default_locale = :de
config.i18n.fallbacks = [:en]

config.time_zone = 'Berlin'


#routes.rb
mount Bhf::Engine, at: 'bhf/:bhf_area', as: :bhf, defaults: { bhf_area: 'main' }
get 'bhf', to: 'application#redirect_to_users_bhf_area', as: :bhf_help
#schma.rb
create_table "areas", force: true do |t|
  t.string "identifier"
  t.string "name"
  t.string "link"
  t.datetime "created_at", null: false
  t.datetime "updated_at", null: false
end
create_table "areas_users", id: false, true do |t|
  t.integer "area_id"
  t.integer "user_id"
end

#user.rb
class User < ActiveRecord::Base
  has_and_belongs_to_many :areas
  def bhf_area
    areas
  end
end

#application_controller.rb
class ApplicationController < ActionController::Base
  def redirect_to_users_bhf_area
    r = if current_user
      current_user.bhf_areas.first.identifier
    else
      'main'
    end
    redirect_to bhf.root_url(bhf_area: r)
  end
end
pages:
- my_page:
  - my_model:
  this project (lowcase)
  
pages:
- statics:
  - statics:
tatic
-posts:
  - posts:
    table:
      source: all_posts
      display: [id, headline, subheadline, content, category, published, published_at]
    form:
      display: [id, category, author, headline, subheadline, content, published, published_at]
      types:
        content: markdown
- settings:
  - category:
  -authors:
    table:
      sortable: position
      hide_delete: true
    from:
      display: [id, name, job_title, email]
      
pages:
- page:
  - authors:
    cutom_link: entry_path

pages:
- page:
  - best_authors:
    model: authors

pages:
- posts:
  - posts:
    form:
      display: [id, name, demo_checkbox]
   
= node f, field do
  = f.hidden_field :test
  = field.name
  
window.addEvent('bhfDomChunkReady', function(scope){
  console.log(scope);
});

pages:
- settings:
  - author:
    form:
      display: [_id, name, job_title, email, categories]
      links:
        categories: best_categories
  - best_categories:
    model: Category
    
.bhf_edit
  display: block
  float: right
  width: 40px
  height: 40px
  text-indent: 100%
  white-space: nowrap
  overflow: hidden
  background: image-url('bhf_pen.svg') no-repeat center center
  background-size: 80%
  border: 2px solid transparent
  border-radius: 5px
  padding: 5px
  &:hover
    border-color: #38A5E9

bhf's People

Contributors

takagotch avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.