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 ActiveAdmin | |
| module Views | |
| class IndexAsTable < ActiveAdmin::Component | |
| def editable_text_column resource, attr | |
| val = resource.send(attr) | |
| val = " " if val.blank? | |
| html = %{ | |
| <div id='editable_text_column_#{resource.id}' | |
| class='editable_text_column' |
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
| ActiveAdmin.register Article do | |
| index do | |
| selectable_column | |
| id_column | |
| column :name, :sortable => :name do |resource| | |
| editable_text_column resource, :name | |
| end | |
| column :article_type | |
| column :created_at | |
| column :updated_at |
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
| input.editable_text_column { | |
| background-color: #FBFF8C; | |
| border: 1px none #FBFF8C; | |
| box-shadow: 0 2px 19px #AAAAAA; | |
| color: black; | |
| display: none; | |
| font-family: serif; | |
| font-size: 1em; | |
| font-style: italic; |
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
| ActiveAdmin.register Article do | |
| index do | |
| selectable_column | |
| id_column | |
| column :name, :sortable => :name do |resource| | |
| editable_text_column resource, :name | |
| end | |
| column 'Type', :sortable => :article_type do |resource| | |
| column_select(resource, :article_type, ["News", "Story", "Case Study", "Business"]) | |
| end |
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 ActiveAdmin | |
| module Views | |
| class IndexAsTable < ActiveAdmin::Component | |
| include CustomHelper | |
| def column_select resource, attr, list | |
| val = resource.send(attr) | |
| html = _select list, val, { "attrs" => %{ | |
| data-path='#{resource.class.name.tableize}' |
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 CustomHelper | |
| def _select set, selected, options={} | |
| style = "margin:0;padding:0;#{options["style"]}" | |
| selected = options["default"] if selected.blank? | |
| cache = options["cache"] || nil | |
| id = options["id"] || nil | |
| id ||= "ch#{ch_uniq_id}" unless cache.blank? |
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
| var admin = { | |
| init: function(){ | |
| admin.set_admin_selectable_events(); | |
| }, | |
| set_admin_selectable_events: function(){ | |
| $("select.admin-selectable").live("change", function(e){ | |
| var path = $( e.currentTarget ).attr("data-path"); |
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 ThreadPool | |
| attr_accessor :threads, :max_size, :wait_time_to_free, :name | |
| def initialize max_size=4 | |
| @max_size = max_size | |
| @threads = [] | |
| @wait_time_to_free = 0.1 | |
| end | |
| def start *args, &block |
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
| window.admin ||= {} | |
| $.extend window.admin, | |
| lightbox: | |
| show: (options) -> | |
| options = {} unless options | |
| buttonDone = options.buttonDone or "Done" | |
| buttonCancel = options.buttonCancel or "Cancel" | |
| focus = options.focus or "input" |
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
| body.active_admin #modal_shadow{ | |
| z-index: 999998; | |
| position:fixed; | |
| top: 0px; left: 0px; | |
| height:100%; width: 100%; | |
| background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2NsampKAwAFAgHu04pC4AAAAABJRU5ErkJggg==) repeat; | |
| display:none; | |
| padding: 0; margin: 0; | |
| } |