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 SchedulePanel < Netzke::Basepack::BorderLayoutPanel | |
js_property :header, false | |
def configuration | |
school_id = super[:school_id] || component_session[:selected_school_id].to_i | |
component_session[:selected_school_id] = school_id | |
subjects_store = Subject.order(:title).all.collect {|c|[c.id,c.title]} | |
school = School.find(school_id) | |
classroom_store = school.classrooms.order(:number,:letter).collect {|c|[c.id,c.title]} | |
period_store = school.type_period.periods.order(:title).collect {|c|[c.id,c.title]} | |
teacher_store = school.teachers.order(:full_name).map(&:full_name) |
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 JournalPanel < Netzke::Basepack::BorderLayoutPanel | |
js_property :header, false | |
def configuration | |
school_id = super[:school_id] || component_session[:selected_school_id].to_i | |
component_session[:selected_school_id] = school_id | |
school = School.find(school_id) | |
classroom_store = school.classrooms.order(:number,:letter).collect {|c|[c.id,c.title]} | |
super.merge( | |
:tbar => [{xtype: 'tbtext', :text => "#{I18n.t(:journal)} - #{school.title}, #{I18n.t('activerecord.attributes.classroom.title')}: "}, ' ', | |
{:name => :classroom, :id => :classroom, :xtype => :combo, :editable => false, :trigger_action => :all, |
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
module Blackbumer | |
class JournalSubjectTabPanel < Netzke::Base | |
js_base_class "Ext.TabPanel" | |
def final_config | |
tabs = stored_tabs.map { |tab| {:layout => :fit, :name => tab[:name], :title => tab[:title], :items => [ tab[:name].to_sym.component]} } || [] | |
orig = super | |
orig.merge( | |
:items => tabs | |
) | |
end |
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 ScheduleGrid < Netzke::Basepack::GridPanel | |
#.... | |
# i think it's too annoing click "add row" button if you add many rows in grid | |
# this addition to gridpanel allow you add a row automaticaly | |
# when you finished edit last row and hit tab or enter | |
js_method :walk_cells, <<-JS | |
function(row, col, step, fn, scope) { | |
var cell = #{js_full_class_name}.superclass.walkCells.apply(this, arguments); | |
if (!cell&&step>0) { |
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 VoipRateApp < Netzke::Basepack::SimpleApp | |
def configuration | |
orig = super | |
orig.merge(:items => [{ | |
:region => :center, | |
:class_name => "Basepack::GridPanel", | |
:model => "Rate", | |
:enable_edit_in_form => false, | |
:rows_per_page => 50, |
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 Dashboard < Netzke::Base | |
ex = Netzke::Core.ext_path.join("examples/desktop/js") | |
js_include ex.join("Desktop.js"), ex.join("App.js") , ex.join("FitAllLayout.js"), ex.join("Module.js") | |
js_include ex.join("ShortcutModel.js"), ex.join("StartMenu.js"), ex.join("TaskBar.js"), ex.join("Wallpaper.js") | |
js_base_class "Ext.ux.desktop.App" | |
js_mixin :main | |
end |
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
# app/models/my_model.rb | |
module MyApp | |
module Model | |
def self.included(base) | |
base.send :include, Mongoid::Document | |
base.send :include, Mongoid::Timestamps | |
base.send :include, ActiveAdmin::Mongoid::Patches | |
end | |
end |
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
# your-engine/lib/magic/rails/engine.rb | |
module Magic | |
module Rails | |
module Engine | |
## | |
# Automatically append all of the current engine's routes to the main | |
# application's route set. This needs to be done for ALL functional tests that | |
# use engine routes, since the mounted routes don't work during tests. | |
# |
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
@import "active_admin/mixins" | |
@import "active_admin/components/links" | |
body | |
@include global-reset | |
@import "active_admin/typography" | |
@import "active_admin/header" | |
@import "active_admin/forms" | |
@import "active_admin/components/comments" | |
@import "active_admin/components/flash_messages" |
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
#!/usr/bin/env bash | |
uninstall() { | |
list=`gem list --no-versions` | |
for gem in $list; do | |
gem uninstall $gem -aIx | |
done | |
gem list | |
gem install bundler | |
} |
OlderNewer