├── Rakefile ├── lib ├── generators │ └── mindapp │ │ ├── templates │ │ ├── app │ │ │ ├── models │ │ │ │ ├── .gitkeep │ │ │ │ ├── mindapp │ │ │ │ │ ├── role.rb │ │ │ │ │ ├── module.rb │ │ │ │ │ ├── notice.rb │ │ │ │ │ ├── service.rb │ │ │ │ │ ├── runseq.rb │ │ │ │ │ ├── xmain.rb │ │ │ │ │ └── doc.rb │ │ │ │ ├── identity.rb │ │ │ │ ├── user.rb │ │ │ │ └── param.rb │ │ │ ├── helpers │ │ │ │ ├── admins_helper.rb │ │ │ │ ├── devs_helper.rb │ │ │ │ └── users_helper.rb │ │ │ ├── controllers │ │ │ │ ├── devs_controller.rb │ │ │ │ ├── identities_controller.rb │ │ │ │ ├── admins_controller.rb │ │ │ │ ├── users_controller.rb │ │ │ │ ├── sessions_controller.rb │ │ │ │ └── mindapp_controller.rb │ │ │ ├── views │ │ │ │ ├── mindapp │ │ │ │ │ ├── pending.haml │ │ │ │ │ ├── _model.md │ │ │ │ │ ├── _pending_home.haml │ │ │ │ │ ├── _modul.md │ │ │ │ │ ├── index.html.haml │ │ │ │ │ ├── help.haml │ │ │ │ │ ├── _activity.md │ │ │ │ │ ├── logs.haml │ │ │ │ │ ├── search.haml │ │ │ │ │ ├── error_logs.haml │ │ │ │ │ ├── _service.md │ │ │ │ │ ├── feed.rss.builder │ │ │ │ │ ├── _pending_page.haml │ │ │ │ │ ├── _menu.haml │ │ │ │ │ ├── _menu_mm.haml │ │ │ │ │ ├── doc.md │ │ │ │ │ ├── _static.haml │ │ │ │ │ ├── run_form.haml │ │ │ │ │ ├── run_output.haml │ │ │ │ │ └── status.haml │ │ │ │ ├── layouts │ │ │ │ │ ├── application.haml │ │ │ │ │ ├── gmail.html.erb │ │ │ │ │ ├── _page.haml │ │ │ │ │ ├── mobile.html.erb │ │ │ │ │ ├── utf8.html.erb │ │ │ │ │ ├── _head.html.erb │ │ │ │ │ ├── _top.html.erb │ │ │ │ │ ├── print.html.erb │ │ │ │ │ ├── mobilejq.html.erb │ │ │ │ │ └── _full.haml │ │ │ │ ├── users │ │ │ │ │ ├── user │ │ │ │ │ │ └── enter_user.html.erb │ │ │ │ │ ├── pwd │ │ │ │ │ │ └── enter.html.erb │ │ │ │ │ └── index.haml │ │ │ │ ├── admins │ │ │ │ │ └── edit_role │ │ │ │ │ │ ├── edit_role.html.erb │ │ │ │ │ │ └── select_user.html.erb │ │ │ │ ├── mindapp_mailer │ │ │ │ │ └── gmail.html.erb │ │ │ │ ├── sessions │ │ │ │ │ └── new.html.erb │ │ │ │ └── identities │ │ │ │ │ └── new.html.erb │ │ │ ├── assets │ │ │ │ ├── images │ │ │ │ │ ├── add.png │ │ │ │ │ ├── cog.png │ │ │ │ │ ├── new.gif │ │ │ │ │ ├── new.png │ │ │ │ │ ├── anchor.png │ │ │ │ │ ├── cancel.png │ │ │ │ │ ├── clock.png │ │ │ │ │ ├── cross.png │ │ │ │ │ ├── delete.png │ │ │ │ │ ├── help.png │ │ │ │ │ ├── house.png │ │ │ │ │ ├── logout.png │ │ │ │ │ ├── page.png │ │ │ │ │ ├── pencil.png │ │ │ │ │ ├── report.png │ │ │ │ │ ├── tick.png │ │ │ │ │ ├── user.png │ │ │ │ │ ├── account.png │ │ │ │ │ ├── calendar.png │ │ │ │ │ ├── page_pdf.png │ │ │ │ │ ├── printer.png │ │ │ │ │ ├── refresh.png │ │ │ │ │ ├── rssmall.png │ │ │ │ │ ├── ajax-loader.gif │ │ │ │ │ ├── arrow_left.png │ │ │ │ │ ├── arrow_right.png │ │ │ │ │ ├── chart_bar.png │ │ │ │ │ ├── page_attach.png │ │ │ │ │ ├── page_green.png │ │ │ │ │ ├── page_output.png │ │ │ │ │ ├── view_code.png │ │ │ │ │ ├── control_play.png │ │ │ │ │ ├── external-link.png │ │ │ │ │ ├── logo_mindapp.png │ │ │ │ │ ├── arrow_turn_left.png │ │ │ │ │ ├── arrow_turn_right.png │ │ │ │ │ ├── ajax-loader-circle.gif │ │ │ │ │ ├── application_double.png │ │ │ │ │ ├── application_form_edit.png │ │ │ │ │ └── control_fastforward.png │ │ │ │ ├── stylesheets │ │ │ │ │ ├── images │ │ │ │ │ │ ├── bg.png │ │ │ │ │ │ ├── del2.png │ │ │ │ │ │ ├── ff.png │ │ │ │ │ │ ├── rss3.png │ │ │ │ │ │ ├── rss4.png │ │ │ │ │ │ ├── cancel.png │ │ │ │ │ │ ├── close.png │ │ │ │ │ │ ├── deli4.png │ │ │ │ │ │ ├── fbook.png │ │ │ │ │ │ ├── tech3.png │ │ │ │ │ │ ├── tech4.png │ │ │ │ │ │ ├── down-left.png │ │ │ │ │ │ ├── overlay.png │ │ │ │ │ │ ├── search_bg.png │ │ │ │ │ │ ├── stumble2.png │ │ │ │ │ │ ├── stumble4.png │ │ │ │ │ │ ├── tab-left.png │ │ │ │ │ │ ├── tab-right.png │ │ │ │ │ │ ├── twitter3.png │ │ │ │ │ │ ├── twitter4.png │ │ │ │ │ │ ├── ajax-loader.png │ │ │ │ │ │ ├── button_blue.png │ │ │ │ │ │ ├── button_red.png │ │ │ │ │ │ ├── down-right.png │ │ │ │ │ │ ├── button_black.png │ │ │ │ │ │ ├── icons-18-black.png │ │ │ │ │ │ ├── icons-18-white.png │ │ │ │ │ │ ├── icons-36-black.png │ │ │ │ │ │ ├── icons-36-white.png │ │ │ │ │ │ ├── icon-search-black.png │ │ │ │ │ │ ├── ui-anim_basic_16x16.gif │ │ │ │ │ │ ├── ui-icons_217bc0_256x240.png │ │ │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ │ │ ├── ui-icons_454545_256x240.png │ │ │ │ │ │ ├── ui-icons_469bdd_256x240.png │ │ │ │ │ │ ├── ui-icons_6da8d5_256x240.png │ │ │ │ │ │ ├── ui-icons_888888_256x240.png │ │ │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ │ │ ├── ui-icons_d8e7f3_256x240.png │ │ │ │ │ │ ├── ui-icons_f9bd01_256x240.png │ │ │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ │ │ ├── ui-bg_flat_55_fbec88_40x100.png │ │ │ │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ │ │ ├── ui-bg_glass_75_d0e5f5_1x400.png │ │ │ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ │ │ │ ├── ui-bg_glass_85_dfeffc_1x400.png │ │ │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ │ │ ├── ui-bg_gloss-wave_55_5c9ccc_500x100.png │ │ │ │ │ │ ├── ui-bg_inset-hard_100_f5f8f9_1x100.png │ │ │ │ │ │ ├── ui-bg_inset-hard_100_fcfdfd_1x100.png │ │ │ │ │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ │ │ ├── indicator.gif │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── sarabun.eot │ │ │ │ │ │ ├── sarabun.ttf │ │ │ │ │ │ ├── sarabun.woff │ │ │ │ │ │ ├── sarabun_bold.ttf │ │ │ │ │ │ ├── sarabun_italic.ttf │ │ │ │ │ │ ├── sarabun_bolditalic.ttf │ │ │ │ │ │ ├── thsarabunnew-webfont.eot │ │ │ │ │ │ ├── thsarabunnew-webfont.ttf │ │ │ │ │ │ ├── thsarabunnew-webfont.woff │ │ │ │ │ │ ├── thsarabunnew_bold-webfont.eot │ │ │ │ │ │ ├── thsarabunnew_bold-webfont.ttf │ │ │ │ │ │ ├── thsarabunnew_bold-webfont.woff │ │ │ │ │ │ ├── thsarabunnew_italic-webfont.eot │ │ │ │ │ │ ├── thsarabunnew_italic-webfont.ttf │ │ │ │ │ │ ├── thsarabunnew_italic-webfont.woff │ │ │ │ │ │ ├── thsarabunnew_bolditalic-webfont.eot │ │ │ │ │ │ ├── thsarabunnew_bolditalic-webfont.ttf │ │ │ │ │ │ ├── thsarabunnew_bolditalic-webfont.woff │ │ │ │ │ │ └── thsarabunnew.css │ │ │ │ │ ├── devs.css.scss │ │ │ │ │ ├── users.css.scss │ │ │ │ │ ├── admins.css.scss │ │ │ │ │ ├── application.css.scss │ │ │ │ │ ├── sarabun.css │ │ │ │ │ ├── jquery.mobile.grids.collapsible.css │ │ │ │ │ ├── jquery.mobile.splitview.css │ │ │ │ │ ├── mindapp.css │ │ │ │ │ └── jquery.mobile.datebox.css │ │ │ │ └── javascripts │ │ │ │ │ ├── admins.js.coffee │ │ │ │ │ ├── devs.js.coffee │ │ │ │ │ ├── users.js.coffee │ │ │ │ │ ├── disable_enter_key.js │ │ │ │ │ ├── mindapp.js │ │ │ │ │ ├── application.js │ │ │ │ │ ├── iscroll-wrapper.js │ │ │ │ │ └── jquery.mobile.splitview.js │ │ │ ├── mailers │ │ │ │ └── mindapp_mailer.rb │ │ │ └── mindapp │ │ │ │ ├── template │ │ │ │ └── view.html.erb │ │ │ │ └── index.mm │ │ ├── spec │ │ │ ├── controllers │ │ │ │ ├── devs_controller_spec.rb │ │ │ │ ├── admins_controller_spec.rb │ │ │ │ └── users_controller_spec.rb │ │ │ ├── helpers │ │ │ │ ├── devs_helper_spec.rb │ │ │ │ ├── users_helper_spec.rb │ │ │ │ └── admins_helper_spec.rb │ │ │ └── spec_helper.rb │ │ ├── cloudinary.yml │ │ ├── seeds.rb │ │ └── mindapp.yml │ │ ├── USAGE │ │ ├── mongoid_generator.rb │ │ └── install_generator.rb ├── mindapp │ ├── version.rb │ ├── railtie.rb │ └── helpers.rb ├── mindapp.rb └── tasks │ └── mindapp.rake ├── Gemfile ├── .gitignore ├── LICENSE.txt ├── mindapp.gemspec └── README.md /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/mindapp/version.rb: -------------------------------------------------------------------------------- 1 | module Mindapp 2 | VERSION = "0.0.8" 3 | end 4 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/helpers/admins_helper.rb: -------------------------------------------------------------------------------- 1 | module AdminsHelper 2 | end 3 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/helpers/devs_helper.rb: -------------------------------------------------------------------------------- 1 | module DevsHelper 2 | end 3 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in mindapp.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/controllers/devs_controller.rb: -------------------------------------------------------------------------------- 1 | class DevsController < ApplicationController 2 | end 3 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/views/mindapp/pending.haml: -------------------------------------------------------------------------------- 1 | = render :partial=>"pending_page", :locals=>{:xmains=>@xmains} 2 | -------------------------------------------------------------------------------- /lib/mindapp.rb: -------------------------------------------------------------------------------- 1 | require "mindapp/version" 2 | require 'mindapp/railtie' 3 | 4 | module Mindapp 5 | # Your code goes here... 6 | end 7 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/spec/controllers/devs_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe DevsController do 4 | 5 | end 6 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/spec/controllers/admins_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe AdminsController do 4 | 5 | end 6 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/spec/controllers/users_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe UsersController do 4 | 5 | end 6 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/add.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/cog.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/new.gif -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/new.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/anchor.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/cancel.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/clock.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/cross.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/delete.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/help.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/house.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/house.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/logout.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/page.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/pencil.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/report.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/tick.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/user.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/account.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/calendar.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/page_pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/page_pdf.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/printer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/printer.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/refresh.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/rssmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/rssmall.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/ajax-loader.gif -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/arrow_left.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/arrow_right.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/chart_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/chart_bar.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/page_attach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/page_attach.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/page_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/page_green.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/page_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/page_output.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/view_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/view_code.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/control_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/control_play.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/external-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/external-link.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/logo_mindapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/logo_mindapp.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/views/layouts/application.haml: -------------------------------------------------------------------------------- 1 | - if request.accept=="text/html, */*; q=0.01" 2 | = render "layouts/page" 3 | - else 4 | = render "layouts/full" 5 | -------------------------------------------------------------------------------- /lib/generators/mindapp/USAGE: -------------------------------------------------------------------------------- 1 | Description: 2 | Explain the generator 3 | 4 | Example: 5 | rails generate new Thing 6 | 7 | This will create: 8 | what/will/it/create 9 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/arrow_turn_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/arrow_turn_left.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/arrow_turn_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/arrow_turn_right.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/bg.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/del2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/del2.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ff.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/rss3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/rss3.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/rss4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/rss4.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/indicator.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/indicator.gif -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/ajax-loader-circle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/ajax-loader-circle.gif -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/application_double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/application_double.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun.eot -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun.ttf -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/cancel.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/close.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/deli4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/deli4.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/fbook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/fbook.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/tech3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/tech3.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/tech4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/tech4.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/views/mindapp/_model.md: -------------------------------------------------------------------------------- 1 | 2 | ### <%= model %> 3 | 4 | <% model_file= "#{Rails.root}/app/models/#{model}.rb" %> 5 | <%= code_div File.read(model_file) %> 6 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/application_form_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/application_form_edit.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/images/control_fastforward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/images/control_fastforward.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun.woff -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/down-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/down-left.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/overlay.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/search_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/search_bg.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/stumble2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/stumble2.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/stumble4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/stumble4.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/tab-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/tab-left.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/tab-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/tab-right.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/twitter3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/twitter3.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/twitter4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/twitter4.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun_bold.ttf -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ajax-loader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ajax-loader.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/button_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/button_blue.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/button_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/button_red.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/down-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/down-right.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/controllers/identities_controller.rb: -------------------------------------------------------------------------------- 1 | class IdentitiesController < ApplicationController 2 | def new 3 | @identity = env['omniauth.identity'] 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun_italic.ttf -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/button_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/button_black.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/icons-18-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/icons-18-black.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/icons-18-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/icons-18-white.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/icons-36-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/icons-36-black.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/icons-36-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/icons-36-white.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun_bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/sarabun_bolditalic.ttf -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.eot -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.ttf -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/icon-search-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/icon-search-black.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-anim_basic_16x16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-anim_basic_16x16.gif -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.woff -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.eot -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.ttf -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_217bc0_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_217bc0_256x240.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_469bdd_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_469bdd_256x240.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_6da8d5_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_6da8d5_256x240.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_d8e7f3_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_d8e7f3_256x240.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_f9bd01_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-icons_f9bd01_256x240.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.woff -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.eot -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.ttf -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.woff -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_flat_55_fbec88_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_flat_55_fbec88_40x100.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_75_d0e5f5_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_75_d0e5f5_1x400.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_85_dfeffc_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_85_dfeffc_1x400.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.eot -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.ttf -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.woff -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.rbc 3 | .bundle 4 | .config 5 | .yardoc 6 | Gemfile.lock 7 | InstalledFiles 8 | _yardoc 9 | coverage 10 | doc/ 11 | lib/bundler/man 12 | pkg 13 | rdoc 14 | spec/reports 15 | test/tmp 16 | test/version_tmp 17 | tmp 18 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_inset-hard_100_f5f8f9_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_inset-hard_100_f5f8f9_1x100.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_inset-hard_100_fcfdfd_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_inset-hard_100_fcfdfd_1x100.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/devs.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the devs controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/songrit/mindapp/HEAD/lib/generators/mindapp/templates/app/assets/stylesheets/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/users.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/views/layouts/gmail.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | <%= yield %> 8 | 9 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/stylesheets/admins.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the admins controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/views/users/user/enter_user.html.erb: -------------------------------------------------------------------------------- 1 | <% 2 | user = current_user 3 | %> 4 |6 | <%= label_tag :role, "Role" %> 7 | <%= text_field_tag :role, user.role %> 8 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/models/mindapp/role.rb: -------------------------------------------------------------------------------- 1 | # -*- encoding : utf-8 -*- 2 | class Mindapp::Role 3 | include Mongoid::Document 4 | include Mongoid::Timestamps 5 | field :code, :type => String 6 | field :name, :type => String 7 | belongs_to :user 8 | end 9 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/views/mindapp_mailer/gmail.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | <%= raw @ui %> 8 | 9 | 10 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/controllers/admins_controller.rb: -------------------------------------------------------------------------------- 1 | class AdminsController < ApplicationController 2 | def update_role 3 | user = User.find_by :code=> $xvars["select_user"]["code"] 4 | user.update_attribute :role, $xvars["edit_role"]["role"] 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/mailers/mindapp_mailer.rb: -------------------------------------------------------------------------------- 1 | class MindappMailer < ActionMailer::Base 2 | default from: "from@example.com" 3 | def gmail(ui, to="", subject="", from="") 4 | @ui = ui 5 | mail(:to => to, :subject => subject, :from => from) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/views/mindapp/_pending_home.haml: -------------------------------------------------------------------------------- 1 | #pending{"data-role" => "page"} 2 | %div{"data-role" => "header" , "data-backbtn"=>"false"} 3 | %h1 Pending Tasks 4 | %div{"data-role" => "content"} 5 | = render :partial => "pending_page", :locals=>{:xmains=>@xmains} 6 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/javascripts/admins.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/javascripts/devs.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/assets/javascripts/users.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /lib/generators/mindapp/templates/app/views/admins/edit_role/select_user.html.erb: -------------------------------------------------------------------------------- 1 |
");
25 | $("input").keypress(function (evt) {
26 | //Deterime where our character code is coming from within the event
27 | var charCode = evt.charCode || evt.keyCode;
28 | if (charCode == 13) { //Enter key's keycode
29 | alert("Please click the button");
30 | return false;
31 | }
32 | });
33 | });
34 | $( document ).one( "pagechange", function(){
35 | $('input[type="file"]').textinput({theme: 'c'});
36 | });
37 |
38 |
--------------------------------------------------------------------------------
/lib/generators/mindapp/templates/app/views/mindapp/run_output.haml:
--------------------------------------------------------------------------------
1 | .head
2 | - @title= @xmain.name
3 | = step(@runseq.form_step, @xvars['total_form_steps'])
4 | #title(style='text-align:right;')= "คลิ้กข้อความ '#{@runseq.name}' เพื่อจัดพิมพ์เอกสาร"
5 | %p
6 | =javascript_include_tag "disable_enter_key"
7 | = form_tag({ :action => 'end_output' } , {:multipart => true, :onKeyPress=>'return disableEnterKey(event)', :class=>'formtastic'}) do
8 | = hidden_field_tag 'xmain_id', @xmain.id
9 | = hidden_field_tag 'runseq_id', @runseq.id
10 | = hidden_field_tag 'step', @xvars[:current_step]
11 | #output_link
12 | = link_to @runseq.name, url_for(:controller=>'mindapp', :action=>'document', :id=>@doc.id), :target=>'_blank'
13 | %p
14 | .label
15 | = image_tag "cog.png"
16 | = t "documents"
17 | %table{:width=>"100%"}
18 | %tr{:style=>"color:white; background-color:#6A6A6A;"}
19 | %th= t "id"
20 | %th= t "document"
21 | %th= t "file name"
22 | %th= t "user"
23 | %th= t "date"
24 | - @xmain.docs.each do |doc|
25 | - next unless doc.display
26 | %tr
27 | %td= doc.id
28 | %td
29 | - if doc.content_type=='output'
30 | = image_tag 'page_output.png'
31 | - else
32 | = image_tag 'page_attach.png'
33 | = link_to_blank align_text(doc.name), :controller=>"mindapp", :action=>:document, :id=>doc.id
34 | %td= doc.filename
35 | %td= doc.user.name
36 | %td= date_thai doc.updated_at
37 | = submit_tag @message
38 | %p
39 |
--------------------------------------------------------------------------------
/lib/generators/mindapp/templates/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # This file is copied to spec/ when you run 'rails generate rspec:install'
2 | ENV["RAILS_ENV"] ||= 'test'
3 | require File.expand_path("../../config/environment", __FILE__)
4 | require 'rspec/rails'
5 | require 'rspec/autorun'
6 |
7 | # Requires supporting ruby files with custom matchers and macros, etc,
8 | # in spec/support/ and its subdirectories.
9 | Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
10 |
11 | RSpec.configure do |config|
12 | # ## Mock Framework
13 | #
14 | # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
15 | #
16 | # config.mock_with :mocha
17 | # config.mock_with :flexmock
18 | # config.mock_with :rr
19 |
20 | # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
21 | config.fixture_path = "#{::Rails.root}/spec/fixtures"
22 |
23 | # If you're not using ActiveRecord, or you'd prefer not to run each of your
24 | # examples within a transaction, remove the following line or assign false
25 | # instead of true.
26 | config.use_transactional_fixtures = true
27 |
28 | # If true, the base class of anonymous controllers will be inferred
29 | # automatically. This will be the default behavior in future versions of
30 | # rspec-rails.
31 | config.infer_base_class_for_anonymous_controllers = false
32 |
33 | # Run specs in random order to surface order dependencies. If you find an
34 | # order dependency and want to debug it, you can fix the order by providing
35 | # the seed, which is printed after each run.
36 | # --seed 1234
37 | config.order = "random"
38 | end
39 |
--------------------------------------------------------------------------------
/lib/generators/mindapp/templates/app/assets/stylesheets/sarabun.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'TH SarabunPSK';
3 | src: url('fonts/thsarabunnew-webfont.eot');
4 | src: url('fonts/thsarabunnew-webfont.eot?#iefix') format('embedded-opentype'),
5 | url('fonts/thsarabunnew-webfont.woff') format('woff'),
6 | url('fonts/thsarabunnew-webfont.ttf') format('truetype');
7 | font-weight: normal;
8 | font-style: normal;
9 | }
10 | @font-face {
11 | font-family: 'TH SarabunPSK';
12 | font-style: normal;
13 | font-weight: bold;
14 | src: url('fonts/thsarabunnew_bold-webfont.eot');
15 | src: url('fonts/thsarabunnew_bold-webfont.eot?#iefix') format('embedded-opentype'),
16 | url('fonts/thsarabunnew_bold-webfont.woff') format('woff'),
17 | url('fonts/thsarabunnew_bold-webfont.ttf') format('truetype');
18 | }
19 | @font-face {
20 | font-family: 'TH SarabunPSK';
21 | font-style: italic;
22 | font-weight: bold;
23 | src: url('fonts/thsarabunnew_bolditalic-webfont.eot');
24 | src: url('fonts/thsarabunnew_bolditalic-webfont.eot?#iefix') format('embedded-opentype'),
25 | url('fonts/thsarabunnew_bolditalic-webfont.woff') format('woff'),
26 | url('fonts/thsarabunnew_bolditalic-webfont.ttf') format('truetype');
27 | }
28 | @font-face {
29 | font-family: 'TH SarabunPSK';
30 | font-style: italic;
31 | font-weight: normal;
32 | src: url('fonts/thsarabunnew_italic-webfont.eot');
33 | src: url('fonts/thsarabunnew_italic-webfont.eot?#iefix') format('embedded-opentype'),
34 | url('fonts/thsarabunnew_italic-webfont.woff') format('woff'),
35 | url('fonts/thsarabunnew_italic-webfont.ttf') format('truetype');
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/mindapp.gemspec:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | lib = File.expand_path('../lib', __FILE__)
3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4 | require 'mindapp/version'
5 |
6 | Gem::Specification.new do |gem|
7 | gem.name = "mindapp"
8 | gem.version = Mindapp::VERSION
9 | gem.authors = ["Korakot Leemakdej"]
10 | gem.email = ["songrit@gmail.com"]
11 | gem.summary = %q{generate Ruby on Rails app from mind map}
12 | gem.description = %q{generate Ruby on Rails app from mind map}
13 | gem.homepage = "https://github.com/songrit/mindapp"
14 |
15 | gem.files = `git ls-files`.split($/)
16 | gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17 | gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18 | gem.require_paths = ["lib"]
19 | gem.license = 'MIT'
20 |
21 | # gem.add_dependency('mongo', '= 1.5.1')
22 | # gem.add_dependency('bson_ext', '= 1.5.1')
23 | # gem.add_dependency('mongoid')
24 |
25 | # gem.add_dependency('nokogiri') # for mindapp/doc
26 | # gem.add_dependency('haml-rails')
27 | # gem.add_dependency('mail')
28 | # gem.add_dependency('prawn')
29 | # gem.add_dependency('redcarpet')
30 | # gem.add_dependency('bcrypt-ruby', '=3.0.0')
31 | # gem.add_dependency('omniauth-identity')
32 | # gem.add_dependency('cloudinary')
33 | # gem.add_dependency('kaminari')
34 | # gem.add_development_dependency('debugger')
35 | # gem.add_development_dependency('rspec')
36 | # gem.add_development_dependency('rspec-rails')
37 | # gem.add_development_dependency('better_errors')
38 | # gem.add_development_dependency('binding_of_caller')
39 | end
40 |
--------------------------------------------------------------------------------
/lib/generators/mindapp/templates/app/assets/stylesheets/fonts/thsarabunnew.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'THSarabunNew';
3 | src: url('thsarabunnew-webfont.eot');
4 | src: url('thsarabunnew-webfont.eot?#iefix') format('embedded-opentype'),
5 | url('thsarabunnew-webfont.woff') format('woff'),
6 | url('thsarabunnew-webfont.ttf') format('truetype');
7 | font-weight: normal;
8 | font-style: normal;
9 |
10 | }
11 |
12 | @font-face {
13 | font-family: 'THSarabunNew';
14 | src: url('thsarabunnew_bolditalic-webfont.eot');
15 | src: url('thsarabunnew_bolditalic-webfont.eot?#iefix') format('embedded-opentype'),
16 | url('thsarabunnew_bolditalic-webfont.woff') format('woff'),
17 | url('thsarabunnew_bolditalic-webfont.ttf') format('truetype');
18 | font-weight: bold;
19 | font-style: italic;
20 |
21 | }
22 |
23 | @font-face {
24 | font-family: 'THSarabunNew';
25 | src: url('thsarabunnew_italic-webfont.eot');
26 | src: url('thsarabunnew_italic-webfont.eot?#iefix') format('embedded-opentype'),
27 | url('thsarabunnew_italic-webfont.woff') format('woff'),
28 | url('thsarabunnew_italic-webfont.ttf') format('truetype');
29 | font-weight: normal;
30 | font-style: italic;
31 |
32 | }
33 |
34 | @font-face {
35 | font-family: 'THSarabunNew';
36 | src: url('thsarabunnew_bold-webfont.eot');
37 | src: url('thsarabunnew_bold-webfont.eot?#iefix') format('embedded-opentype'),
38 | url('thsarabunnew_bold-webfont.woff') format('woff'),
39 | url('thsarabunnew_bold-webfont.ttf') format('truetype');
40 | font-weight: bold;
41 | font-style: normal;
42 |
43 | }
44 |
45 | .thsarabunnew{
46 | font-family: 'THSarabunNew', sans-serif;
47 | }
--------------------------------------------------------------------------------
/lib/generators/mindapp/templates/app/views/mindapp/status.haml:
--------------------------------------------------------------------------------
1 | %table{:width=>"100%"}
2 | %tr{:style=>"color:white; background-color:#6A6A6A;"}
3 | %th Status
4 | %th Step
5 | %th Starter
6 | %th Begin
7 | %th End
8 | - @xmain.runseqs.form_action.each do |r|
9 | %tr
10 | - if @xmain.status=='X'
11 | %td{:align=>'center'}= image_tag 'cancel.png'
12 | - else
13 | %td{:align=>'center'}= status_icon(r.status)
14 | %td= r.name
15 | %td{:align=>'center'}
16 | - if r.role.blank? && @xvars[:action]
17 | - u = @xvars[:action][:assign].blank? ? ' ' : User.find(@xvars[:action][:assign]).full_name
18 | = u
19 | - if @xvars[:action][:final]=='n'
20 | %td{:align=>'center'} -
21 | %td{:align=>'center'} -
22 | - else
23 | - if r.start
24 | %td= r.start.strftime('%c')
25 | - else
26 | %td{:align=>'center'} -
27 | - if r.stop
28 | %td= r.stop.strftime('%c')
29 | - else
30 | %td{:align=>'center'} -
31 | - else
32 | = role_name r.role
33 | - if r.start
34 | %td= r.start.strftime('%c')
35 | - else
36 | %td{:align=>'center'} -
37 | - if r.stop
38 | %td= r.stop.strftime('%c')
39 | - else
40 | %td{:align=>'center'} -
41 | .label
42 | = image_tag "cog.png"
43 | Document
44 | %table{:width=>"100%"}
45 | %tr{:style=>"color:white; background-color:#6A6A6A;"}
46 | %th Document
47 | %th Name
48 | %th User
49 | %th Date
50 | - @xmain.docs.each do |doc|
51 | - next unless doc.display
52 | %tr
53 | %td
54 | - if doc.content_type=='output'
55 | = image_tag 'page_output.png'
56 | - else
57 | = image_tag 'page_attach.png'
58 | = link_to align_text(doc.name), "/engine/document/#{doc.id}", :target=>'_blank'
59 | %td= doc.filename
60 | %td= doc.user.try(:full_name)
61 | %td= doc.created_at.strftime('%c')
62 |
--------------------------------------------------------------------------------
/lib/generators/mindapp/templates/app/assets/stylesheets/jquery.mobile.grids.collapsible.css:
--------------------------------------------------------------------------------
1 | /* my addition to supply convertible grids based on www.cssgrid.net by Andy Taylor */
2 | /* ==================================================================================================================== */
3 | /* ! The 1140px Grid V2 by Andy Taylor \ http://cssgrid.net \ http://www.twitter.com/andytlr \ http://www.andytlr.com */
4 | /* ==================================================================================================================== */
5 | .row, .fixedrow {
6 | width: 100%;
7 | margin: 0 auto;
8 | overflow: hidden;
9 | }
10 |
11 | .span1, .span2, .span3, .span4, .span5, .span6, .span7, .span8, .span9, .span10, .span11 {
12 | margin-right: 3.8%;
13 | float: left;
14 | min-height: 1px;
15 | }
16 |
17 | .row .span1, .fixedrow .span1 {
18 | width: 4.85%;
19 | }
20 |
21 | .row .span2, .fixedrow .span2 {
22 | width: 13.45%;
23 | }
24 |
25 | .row .span3, .fixedrow .span3 {
26 | width: 22.05%;
27 | }
28 |
29 | .row .span4, .fixedrow .span4 {
30 | width: 30.75%;
31 | }
32 |
33 | .row .span5, .fixedrow .span5 {
34 | width: 39.45%;
35 | }
36 |
37 | .row .span6, .fixedrow .span6 {
38 | width: 48%;
39 | }
40 |
41 | .row .span7, .fixedrow .span7 {
42 | width: 56.75%;
43 | }
44 |
45 | .row .span8, .fixedrow .span8 {
46 | width: 65.4%;
47 | }
48 |
49 | .row .span9, .fixedrow .span9 {
50 | width: 74.05%;
51 | }
52 |
53 | .row .span10, .fixedrow .span10 {
54 | width: 82.7%;
55 | }
56 |
57 | .row .span11, .fixedrow .span11 {
58 | width: 91.35%;
59 | }
60 |
61 | .row .span12, .fixedrow .span12 {
62 | width: 100%;
63 | float: left;
64 | }
65 |
66 | .row .prepend1, .fixedrow .prepend1 {
67 |
68 | }
69 |
70 | .last {
71 | margin-right: 0px;
72 | }
73 |
74 | img, object, embed {
75 | max-width: 100%;
76 | }
77 |
78 | img {
79 | height: auto;
80 | }
81 |
82 |
83 | /* touchscreens */
84 | @media (min-width:768px) {
85 | .touch body {
86 | font-size: 1em;
87 | line-height: normal;
88 | }
89 |
90 |
91 | /* Smaller screens */
92 | body {
93 | font-size: 0.9em;
94 | line-height: normal;
95 | }
96 | }
97 |
98 | /* Mobile */
99 | @media (max-width:480px) {
100 | body {
101 | font-size: 1em;
102 | -webkit-text-size-adjust: none;
103 | }
104 |
105 | .row, body {
106 | width: 100%;
107 | min-width: 0;
108 | margin-left: 0px;
109 | margin-right: 0px;
110 | padding-left: 0px;
111 | padding-right: 0px;
112 | }
113 |
114 | .row .span1, .row .span2, .row .span3, .row .span4, .row .span5, .row .span6, .row .span7, .row .span8, .row .span9, .row .span10, .row .span11, .row .span12 {
115 | width: auto;
116 | float: none;
117 | margin-left: 0px;
118 | margin-right: 0px;
119 | padding-left: 20px;
120 | padding-right: 20px;
121 | }
122 | }
--------------------------------------------------------------------------------
/lib/generators/mindapp/templates/app/assets/stylesheets/jquery.mobile.splitview.css:
--------------------------------------------------------------------------------
1 | body {
2 | visibility: hidden;
3 | }
4 |
5 | .ui-panel {
6 | -moz-box-shadow: 0 0 12px rgba(0,0,0,.6);
7 | -webkit-box-shadow: 0 0 12px rgba(0,0,0,.6);
8 | box-shadow: 0 0 12px rgba(0,0,0,.6);
9 | }
10 |
11 | div[data-id="main"] {
12 | z-index: 9999;
13 | }
14 |
15 | .ui-mobile body {
16 | visibility: visible;
17 | }
18 |
19 | .ui-panel-left {
20 | position:absolute;
21 | left:0;
22 | top:0;
23 | bottom:0;
24 | }
25 |
26 | .ui-panel-right {
27 | position:absolute;
28 | right:0;
29 | top:0;
30 | bottom:0;
31 | }
32 |
33 | .ui-crumbs {
34 | max-width: 25%;
35 | }
36 |
37 | .splitview .ui-splitview-hidden {
38 | display:none;
39 | }
40 |
41 | @media (min-width:480px) {
42 | .splitview body {
43 | margin: 0;
44 | }
45 |
46 | .splitview .ui-page{
47 | bottom: 0;
48 | }
49 |
50 | .splitview .ui-header {
51 | position:absolute;
52 | top:0;
53 | bottom:auto;
54 | left:0;
55 | right:0;
56 | z-index: 1000;
57 | }
58 |
59 | .splitview .ui-footer {
60 | position:absolute;
61 | top:auto;
62 | bottom:0;
63 | left:0;
64 | right:0;
65 | z-index:1000;
66 | }
67 |
68 | .splitview .ui-content {
69 | position:absolute;
70 | top:40px;
71 | bottom:0;
72 | left:0;
73 | right:0;
74 | overflow:auto;
75 | -webkit-overflow-scrolling:touch;
76 | z-index:1;
77 | }
78 | }
79 |
80 | /************************************************************************************************************
81 | popover css for portrait orientation, modified from
82 | http://www.cagintranet.com/archive/create-an-ipad-like-dropdown-popover/
83 | ************************************************************************************************************/
84 | .panel-popover .popover_triangle {left:7px;}
85 | .panel-popover {
86 | color: black;
87 | display:none;
88 | font-weight: normal;
89 | line-height: 1;
90 | cursor: auto;
91 | position: absolute;
92 | top:55px;
93 | left:10px;
94 | background-color: white;
95 | z-index:5000000;
96 | border: 3px solid black;
97 | border-radius: 4px;
98 | -webkit-border-radius: 4px;
99 | -moz-border-radius: 4px;
100 | border-radius: 4px;
101 | -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
102 | -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
103 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
104 | -webkit-transition: opacity 0.25s linear;
105 | -moz-transition: opacity 0.25s linear;
106 | transition: opacity 0.25s linear;
107 | overflow-x:visible;
108 | height:80%;
109 | }
110 |
111 | .panel-popover > .popover_triangle {
112 | position: absolute;
113 | top: -34px;
114 | font-size: 0px;
115 | line-height: 0%;
116 | width: 0px;
117 | border-top: 16px solid rgba(0,0,0,0);
118 | border-left: 16px solid rgba(0,0,0,0);
119 | border-right: 16px solid rgba(0,0,0,0);
120 | border-bottom: 16px solid black;
121 | }
122 |
123 | .panel-popover div[data-role="page"] {
124 | height: inherit;
125 | overflow-y:auto;
126 | }
127 |
128 | /**********************************************************************************************************
129 | CSS animations for panel resize using new data-width attribute.
130 | **********************************************************************************************************/
131 |
--------------------------------------------------------------------------------
/lib/generators/mindapp/templates/app/assets/stylesheets/mindapp.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 1em;
3 | }
4 | .map {
5 | margin-bottom: 1em;
6 | }
7 | .map img {
8 | max-width: none !important;
9 | }
10 | #output_link {
11 | text-align:center;
12 | border: 3px solid #999;
13 | background-color: #ddd;
14 | height: 80px;
15 | padding-top: 10px;
16 | }
17 | #output_link a {
18 | font-size:36pt;
19 | }
20 | #tooltip{
21 | position:absolute;
22 | border:1px solid #333;
23 | background:#f7f5d1;
24 | padding:2px 5px;
25 | color:#333;
26 | display:none;
27 | }
28 | #notice {
29 | color: #F90609;
30 | background-color: #EBD1D1;
31 | font-weight: bolder;
32 | padding-left: 10px;
33 | }
34 | .step {
35 | /*display: table-row;*/
36 | margin-top: 20px;
37 | margin-bottom: 20px;
38 | }
39 | .steps_more {
40 | font-size: 40px;
41 | font-weight: bold;
42 | vertical-align: middle;
43 | color: white;
44 | width: 80px;
45 | height: 80px;
46 | background:url(images/button_blue.png) no-repeat;
47 | display: table-cell;
48 | text-align:center;
49 | }
50 | .step_now {
51 | font-size: 40px;
52 | font-weight: bold;
53 | vertical-align: middle;
54 | color: white;
55 | width: 80px;
56 | height: 80px;
57 | background:url(images/button_red.png) no-repeat;
58 | display: table-cell;
59 | text-align:center;
60 | }
61 | .steps_done {
62 | font-size: 40px;
63 | font-weight: bold;
64 | vertical-align: middle;
65 | color: white;
66 | width: 80px;
67 | height: 80px;
68 | background:url(images/button_black.png) no-repeat;
69 | display: table-cell;
70 | text-align:center;
71 | }
72 | #title {
73 | font-size: 16pt;
74 | font-weight: bold;
75 | }
76 | #subtitle {
77 | font-weight: bold;
78 | text-align:right;
79 | }
80 |
81 | .ui-btn-inner { padding: 2px 25px; }
82 | .ui-btn-up-c,
83 | .ui-btn-hover-c,
84 | .ui-btn-down-c {
85 | font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
86 | /*font-size: 110%;*/
87 | }
88 | .ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li { padding: 7px 75px 7px 15px; display: block; }
89 | .ui-link-inherit { font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;}
90 | label.ui-input-text {
91 | font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
92 | /*font-size: 110%;*/
93 | text-shadow: none;
94 | }
95 | label.ui-select {
96 | font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
97 | /*font-size: 110%;*/
98 | text-shadow: none;
99 | }
100 | .ui-body-c {
101 | font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
102 | /*font-size: 1.4em;*/
103 | text-shadow: none;
104 | }
105 | .ui-header .ui-title, .ui-footer .ui-title { font-family: 'TH SarabunPSK'; text-align: center; display: block; margin: .2em 90px .3em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; }
106 |
107 | .flickr_pagination {
108 | text-align: center;
109 | padding: .3em; }
110 | .flickr_pagination a, .flickr_pagination span {
111 | padding: .2em .5em; }
112 | .flickr_pagination span.disabled {
113 | color: #AAA; }
114 | .flickr_pagination span.current {
115 | font-weight: bold;
116 | color: #FF0084; }
117 | .flickr_pagination a {
118 | border: 1px solid #DDDDDD;
119 | color: #0063DC;
120 | text-decoration: none; }
121 | .flickr_pagination a:hover, .flickr_pagination a:focus {
122 | border-color: #003366;
123 | background: #0063DC;
124 | color: white; }
125 | .flickr_pagination .page_info {
126 | color: #aaa;
127 | padding-top: .8em; }
128 | .flickr_pagination .prev_page, .flickr_pagination .next_page {
129 | border-width: 2px; }
130 | .flickr_pagination .prev_page {
131 | margin-right: 1em; }
132 | .flickr_pagination .next_page {
133 | margin-left: 1em; }
134 |
135 |
--------------------------------------------------------------------------------
/lib/generators/mindapp/templates/app/assets/stylesheets/jquery.mobile.datebox.css:
--------------------------------------------------------------------------------
1 | /* jQuery-Mobile-DateBox Plugin
2 | * contains all plugin styles
3 | */
4 |
5 | /* Base input element Styles */
6 |
7 | /*.ui-input-datebox { width: 95%; background-image: none; padding: .4em; line-height: 1.4; font-size: 16px; display: block; width: 95%; padding-top: 0px; padding-bottom: 0px; padding-right: .4em; }*/
8 | .ui-input-datebox { width: 60%; background-image: none; padding: .4em; line-height: 1.4; font-size: 16px; display: inline-block; padding-top: 0px; padding-bottom: 0px; padding-right: .4em; }
9 | .ui-input-datebox input { width: 70% !important; border: 1px solid transparent !important; vertical-align: middle; display: inline-block !important; background-color: transparent; zoom: 1; *display: inline; }
10 | .ui-input-datebox input:focus { outline: none;}
11 | .min-width-480px .ui-input-datebox { width: 60%; display: inline-block; zoom:1; *display: inline; }
12 |
13 | /* Calendar Mode Styles */
14 |
15 | .ui-datebox-gridheader { text-align: center; }
16 | .ui-datebox-gridheader h4 { text-align: center; display: inline-block; margin-top: 10px; margin-bottom: 10px; zoom:1; *display: inline;}
17 | .ui-datebox-gridplus { float: right; }
18 | .ui-datebox-gridminus { float: left; }
19 | .ui-datebox-gridrow { margin-left: 5px; margin-right: 5px; }
20 | .ui-datebox-grid { clear: both; margin-bottom: 5px; }
21 | .ui-datebox-griddate { width: 36px; height: 30px; display: inline-block; vertical-align: middle; text-align: center; line-height: 30px; font-weight: bold; font-size: 12px; zoom:1; *display: inline;}
22 | .ui-datebox-griddate-empty { border: 1px solid transparent; color: #888; }
23 | .ui-datebox-griddate-label { height: 15px !important; line-height: 15px !important; color: black;}
24 |
25 | /* Android Mode Styles */
26 |
27 | .ui-datebox-header h4 { margin-top: 5px; margin-bottom: 5px; text-align: center; }
28 | .ui-datebox-controls { text-align: center; }
29 | .ui-datebox-controls div { width: 77px; text-align: center; display: inline-block; zoom: 1; *display: inline;}
30 | .ui-datebox-scontrols { text-align: center; }
31 | .ui-datebox-scontrols div { width: 55px; text-align: center; display: inline-block; zoom: 1; *display: inline;}
32 | .ui-datebox-scontrols .ui-datebox-sinput { width: 68px; }
33 | .ui-datebox-scontrols .ui-datebox-sinput input { width: 48px; text-align: center; }
34 | .ui-datebox-input { width: 74px !important; margin-left: 1px; margin-right: 1px; text-align: center !important; display: inline-block !important; zoom:1; *display: inline; }
35 |
36 | /* Slide Mode Styles */
37 |
38 | .ui-datebox-sliderow-d { margin-bottom: 5px; text-align: center; height: 40px; width: 280px; overflow: hidden;}
39 | .ui-datebox-sliderow-ym { margin-bottom: 5px; text-align: center; height: 32px; width: 280px; overflow: hidden;}
40 | .ui-datebox-sliderow-hi { text-align: center; height: 32px; width: 280px; overflow: hidden;}
41 | .ui-datebox-sliderow-int { display: inline-block; white-space: nowrap;}
42 |
43 | .ui-datebox-slideyear { text-align: center; display: inline-block; zoom:1; *display:inline; width: 84px; vertical-align: middle; line-height: 30px; height: 30px; font-size: 14px; font-weight: bold; }
44 | .ui-datebox-slidemonth { text-align: center; display: inline-block; zoom:1; *display:inline; width: 51px; vertical-align: middle; line-height: 30px; height: 30px; font-size: 12px; font-weight: bold; }
45 | .ui-datebox-slideday { text-align: center; display: inline-block; zoom:1; *display:inline; width: 32px; vertical-align: middle; line-height: 20px; height: 38px; font-size: 14px; font-weight: bold; }
46 | .ui-datebox-slidehour { text-align: center; display: inline-block; zoom:1; *display:inline; width: 32px; vertical-align: middle; line-height: 22px; height: 24px; font-size: 14px; font-weight: bold; }
47 | .ui-datebox-slidemins { text-align: center; display: inline-block; zoom:1; *display:inline; width: 32px; vertical-align: middle; line-height: 22px; height: 24px; font-size: 14px; font-weight: bold; }
48 | .ui-datebox-slidearrow { text-align: center; display: inline-block; zoom:1; *display:inline; width: 10px; vertical-align: middle; line-height: 38px; height: 38px; font-size: 10px; font-weight: bold; }
49 | .ui-datebox-slidewday { font-size: 10px; font-weight: normal; }
50 |
51 | /* Flip Mode Styles */
52 | .ui-datebox-flipcontent { text-align: center; height: 125px; margin-bottom: -40px;}
53 | .ui-datebox-flipcontent div { margin-left: 3px; margin-right: 3px; width: 77px; height: 120px; display: inline-block; text-align: center; zoom: 1; *display: inline; overflow: hidden;}
54 | .ui-datebox-flipcenter { border: 1px solid #eee; height: 40px; margin-left: 10px; margin-right: 10px; position: relative; top: -45px;}
55 | .ui-datebox-flipcontent ul { list-style-type: none; display: inline; }
56 | .ui-datebox-flipcontent li { height: 30px; }
57 | .ui-datebox-flipcontent li span { margin-top: 7px; display: block; }
58 | /* Shared Styles */
59 |
60 | .ui-datebox-container { border: 5px solid #111 !important; width: 280px; }
61 | .ui-datebox-screen { position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; }
62 | .ui-datebox-screen-modal { background-color: black; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); }
63 | .ui-datebox-hidden { display: none; }
64 | .ui-dialog .ui-datebox-container { border: none !important; }
65 | .ui-dialog-datebox .ui-content { padding: 5px !important;}
66 |
--------------------------------------------------------------------------------
/lib/generators/mindapp/install_generator.rb:
--------------------------------------------------------------------------------
1 | module Mindapp
2 | module Generators
3 | class InstallGenerator < Rails::Generators::Base
4 | desc "Install mindapp component to existing Rails app "
5 | def self.source_root
6 | File.dirname(__FILE__) + "/templates"
7 | end
8 |
9 | def setup_routes
10 | route "root :to => 'mindapp#index'"
11 | # route "match '/mindapp/init/:module/:service(/:id)' => 'Mindapp#init'"
12 |
13 | route "resources :identities"
14 | route "resources :sessions"
15 | route "post '/auth/:provider/callback' => 'sessions#create'"
16 | route "get '/auth/failure' => 'sessions#failure'"
17 | route "get '/logout' => 'sessions#destroy', :as => 'logout'"
18 | route "get ':controller(/:action(/:id))(.:format)'"
19 | route "post ':controller(/:action(/:id))(.:format)'"
20 | end
21 |
22 | def setup_env
23 | create_file 'README.md', ''
24 | # bug in mongo ruby driver 1.6.1, wait for mongoid 2.4.7
25 | # gem "mongo", "1.5.1"
26 | # gem "bson_ext", "1.5.1"
27 | # gem "mongoid"
28 | # run "bundle install"
29 | # generate "rspec:install"
30 | inject_into_file 'config/application.rb', :after => 'require "active_resource/railtie"' do
31 | "\nrequire 'mongoid/railtie'\n"
32 | "\nrequire 'rexml/document'\n"
33 | end
34 | application do
35 | %q{
36 | # Mindapp default
37 | config.generators do |g|
38 | g.orm :mongoid
39 | g.template_engine :haml
40 | g.test_framework :rspec
41 | g.integration_tool :rspec
42 | end
43 | # gmail config
44 | config.action_mailer.delivery_method = :smtp
45 | config.action_mailer.smtp_settings = {
46 | :address => "smtp.gmail.com",
47 | :port => 587,
48 | :user_name => 'user@gmail.com',
49 | :password => 'secret',
50 | :authentication => 'plain',
51 | :enable_starttls_auto => true }
52 | config.action_mailer.raise_delivery_errors = true
53 | config.action_mailer.perform_deliveries = true
54 | }
55 | end
56 | initializer "mindapp.rb" do
57 | %q{# encoding: utf-8
58 | MM = "#{Rails.root}/app/mindapp/index.mm"
59 | DEFAULT_TITLE = 'Mindapp'
60 | DEFAULT_HEADER = 'Mindapp'
61 | GMAP = true
62 | NEXT = "Next >"
63 | # comment IMAGE_LOCATION to use cloudinary (specify params in config/cloudinary.yml)
64 | IMAGE_LOCATION = "upload"
65 | # for debugging
66 | # DONT_SEND_MAIL = true
67 | }
68 | end
69 |
70 | inject_into_file 'config/environment.rb', :after => "initialize!" do
71 | "\n\n# hack to fix cloudinary error https://github.com/archiloque/rest-client/issues/141" +
72 | "\nclass Hash\n remove_method :read\nrescue\nend"
73 | end
74 | inject_into_file 'config/environments/development.rb', :after => 'config.action_mailer.raise_delivery_errors = false' do
75 | "\n config.action_mailer.default_url_options = { :host => 'localhost:3000' }"
76 | end
77 | inject_into_file 'config/environments/production.rb', :after => 'config.assets.compile = false' do
78 | "\n config.assets.compile = true"
79 | end
80 | end
81 |
82 | def setup_omniauth
83 | # gem 'bcrypt-ruby', '~> 3.0.0'
84 | # gem 'omniauth-identity'
85 | initializer "omniauth.rb" do
86 | %q{
87 | Rails.application.config.middleware.use OmniAuth::Builder do
88 | provider :identity,
89 | :fields => [:code, :email],
90 | :on_failed_registration=> lambda { |env|
91 | IdentitiesController.action(:new).call(env)
92 | }
93 | end
94 | }
95 | end
96 | end
97 |
98 | def setup_app
99 | inside("public") { run "mv index.html index.html.bak" }
100 | inside("app/views/layouts") { run "mv application.html.erb application.html.erb.bak" }
101 | inside("app/assets/javascripts") { run "mv application.js application.js.bak" }
102 | inside("app/assets/stylesheets") { run "mv application.css application.css.bak" }
103 | directory "app"
104 | end
105 |
106 | def gen_user
107 | # copy_file "seeds.rb","db/seeds.rb"
108 | end
109 |
110 | def gen_image_store
111 | copy_file "cloudinary.yml","config/cloudinary.yml"
112 | empty_directory "upload" # create upload directory just in case
113 | end
114 |
115 | def setup_gems
116 | gem "mongo", '~> 2.2'
117 | gem "bson", '~> 4.0'
118 | # gem "mongo", '1.5.1'
119 | # gem "bson_ext", '1.5.1'
120 | # gem 'mongoid', '~> 4.0.0'
121 | # for Rails 5
122 | gem 'mongoid', github: 'mongodb/mongoid'
123 | # gem "mongoid"
124 | gem "nokogiri" # use for mindapp/doc
125 | # gem "rmagick", :require => "RMagick", :platform => "ruby"
126 | gem 'haml-rails'
127 | gem "mail"
128 | gem "prawn"
129 | gem "redcarpet"
130 | gem 'bcrypt-ruby', '~> 3.0.0'
131 | gem 'omniauth-identity'
132 | gem 'cloudinary'
133 | gem 'kaminari'
134 | gem_group :development, :test do
135 | gem "rspec"
136 | gem "rspec-rails"
137 | gem "better_errors"
138 | gem "binding_of_caller"
139 | end
140 | end
141 |
142 | def finish
143 | puts "Mindapp installation finish, please run bundle install again to install additional gems. Then run rails generate mindapp:mongoid"
144 | end
145 |
146 | end
147 | end
148 | end
149 |
--------------------------------------------------------------------------------
/lib/generators/mindapp/templates/app/mindapp/index.mm:
--------------------------------------------------------------------------------
1 |
83 |
--------------------------------------------------------------------------------
/lib/tasks/mindapp.rake:
--------------------------------------------------------------------------------
1 | require 'mindapp'
2 | require 'mindapp/helpers'
3 | include Mindapp::Helpers
4 |
5 | @btext= "# mindapp begin"
6 | @etext= "# mindapp end"
7 |
8 | namespace :mindapp do
9 | desc "generate models from mm"
10 | task :update=> :environment do
11 | @app= get_app
12 | process_models
13 | process_controllers
14 | gen_views
15 | end
16 |
17 | desc "generate admin user"
18 | task :seed=> :environment do
19 | unless Identity.where(code:"admin").exists?
20 | identity= Identity.create :code => "admin", :email => "admin@test.com", :password => "secret",
21 | :password_confirmation => "secret"
22 | User.create :provider => "identity", :uid => identity.id.to_s, :code => identity.code,
23 | :email => identity.email, :role => "M,A,D"
24 | end
25 | end
26 |
27 | desc "cancel all pending tasks"
28 | task :cancel=> :environment do
29 | Mindapp::Xmain.update_all "status='X'", "status='I' or status='R'"
30 | end
31 | end
32 |
33 | # ----------------------------
34 | def gen_views
35 | t = ["*** generate ui ***"]
36 | Mindapp::Module.all.each do |m|
37 | m.services.each do |s|
38 | next if s.code=='link'
39 | dir ="app/views/#{s.module.code}"
40 | unless File.exists?(dir)
41 | Dir.mkdir(dir)
42 | t << "create directory #{dir}"
43 | end
44 | dir ="app/views/#{s.module.code}/#{s.code}"
45 | unless File.exists?(dir)
46 | Dir.mkdir(dir)
47 | t << "create directory #{dir}"
48 | end
49 | xml= REXML::Document.new(s.xml)
50 | xml.elements.each('*/node') do |activity|
51 | icon = activity.elements['icon']
52 | next unless icon
53 | action= freemind2action(icon.attributes['BUILTIN'])
54 | next unless ui_action?(action)
55 | code_name = activity.attributes["TEXT"].to_s
56 | next if code_name.comment?
57 | code= name2code(code_name)
58 | if action=="pdf"
59 | f= "app/views/#{s.module.code}/#{s.code}/#{code}.pdf.prawn"
60 | else
61 | f= "app/views/#{s.module.code}/#{s.code}/#{code}.html.erb"
62 | end
63 | unless File.exists?(f)
64 | FileUtils.cp "app/mindapp/template/view.html.erb", f
65 | # ff=File.open(f, 'w'); ff.close
66 | t << "create file #{f}"
67 | end
68 | end
69 | end
70 | end
71 | puts t.join("\n")
72 | end
73 | def process_controllers
74 | process_services
75 | modules= Mindapp::Module.all
76 | modules.each do |m|
77 | next if controller_exists?(m.code)
78 | system("rails generate controller #{m.code}")
79 | end
80 | end
81 |
82 | def process_models
83 | # app= get_app
84 | # t= ["process models"]
85 | models= @app.elements["//node[@TEXT='models']"] || REXML::Document.new
86 | models.each_element('node') do |model|
87 | # t << "= "+model.attributes["TEXT"]
88 | model_name= model.attributes["TEXT"]
89 | next if model_name.comment?
90 | model_code= name2code(model_name)
91 | model_file= "#{Rails.root}/app/models/#{model_code}.rb"
92 | if File.exists?(model_file)
93 | doc= File.read(model_file)
94 | else
95 | system("rails generate model #{model_code}")
96 | doc= File.read(model_file)
97 | end
98 | doc = add_utf8(doc)
99 | attr_hash= make_fields(model)
100 | doc = add_mindapp(doc, attr_hash)
101 | # t << "modified: #{model_file}"
102 | File.open(model_file, "w") do |f|
103 | f.puts doc
104 | end
105 | end
106 | # puts t.join("\n")
107 | end
108 |
109 | def add_mindapp(doc, attr_hash)
110 | if doc =~ /#{@btext}/
111 | s1,s2,s3= doc.partition(/ #{@btext}.*#{@etext}\n/m)
112 | s2= ""
113 | else
114 | s1,s2,s3= doc.partition("include Mongoid::Document\n")
115 | end
116 | doc= s1+s2+ <<-EOT
117 | #{@btext}
118 | include Mongoid::Timestamps
119 | EOT
120 | attr_hash.each do |a|
121 | # doc+= "\n*****"+a.to_s+"\n"
122 | if a[:edit]
123 | doc += " #{a[:text]}\n"
124 | else
125 | doc += " field :#{a[:code]}, :type => #{a[:type].capitalize}\n"
126 | end
127 | end
128 | doc += " #{@etext}\n"
129 | doc + s3
130 | end
131 |
132 | def add_utf8(doc)
133 | unless doc =~ /encoding\s*:\s*utf-8/
134 | doc.insert 0, "# encoding: utf-8\n"
135 | else
136 | doc
137 | end
138 | end
139 |
140 | # inspect all nodes that has attached file (2 cases) and replace relative path with absolute path
141 | def make_folders_absolute(f,tt)
142 | tt.elements.each("//node") do |nn|
143 | if nn.attributes['LINK']
144 | nn.attributes['LINK']= File.expand_path(File.dirname(f))+"/#{nn.attributes['LINK']}"
145 | end
146 | end
147 | end
148 | def name2code(s)
149 | # rather not ignore # symbol cause it could be comment
150 | code, name = s.split(':')
151 | code.downcase.strip.gsub(' ','_').gsub(/[^#_\/a-zA-Z0-9]/,'')
152 | end
153 | def model_exists?(model)
154 | File.exists? "#{Rails.root}/app/models/#{model}.rb"
155 | end
156 | def make_fields(n)
157 | # s= field string used by generate model cli (old style mindapp)
158 | s= ""
159 | # h= hash :code, :type, :edit, :text
160 | h= []
161 | n.each_element('node') do |nn|
162 | text = nn.attributes['TEXT']
163 | icon = nn.elements['icon']
164 | edit= (icon && icon.attribute('BUILTIN').value=="edit")
165 | next if text.comment? && !edit
166 |
167 | # sometimes freemind puts all fields inside a blank node
168 | unless text.empty?
169 | k,v= text.split(/:\s*/,2)
170 | v ||= 'string'
171 | v= 'float' if v=~/double/i
172 | s << " #{name2code(k.strip)}:#{v.strip} "
173 | h << {:code=>name2code(k.strip), :type=>v.strip, :edit=>edit, :text=>text}
174 | else
175 | nn.each_element('node') do |nnn|
176 | icon = nnn.elements['icon']
177 | edit1= (icon && icon.attribute('BUILTIN').value=="edit")
178 | text1 = nnn.attributes['TEXT']
179 | next if text1 =~ /\#.*/
180 | k,v= text1.split(/:\s*/,2)
181 | v ||= 'string'
182 | v= 'float' if v=~/double/i
183 | s << " #{name2code(k.strip)}:#{v.strip} "
184 | h << {:code=>name2code(k.strip), :type=>v.strip, :edit=>edit1, :text=>text1}
185 | end
186 | end
187 | end
188 | # f
189 | h
190 | end
191 |
192 | # ----------------------------
193 | class String
194 | def comment?
195 | self[0]=='#'
196 | # self[0]==35 # check if first char is #
197 | end
198 | def to_code
199 | s= self.dup
200 | s.downcase.strip.gsub(' ','_').gsub(/[^#_\/a-zA-Z0-9]/,'')
201 | end
202 | end
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Mindapp
2 |
3 | I like to develop application using Ruby on Rails. I find that most of my projects has some common tasks such as basic design, user administration, logging, workflow, etc. So I decide to use mind map to act as a language to explain what I want and have the tool generates the application that conform to standard framework so I can then customize everything later on. Mind map is used in design phase where it generates models and controller, in execution phase where it controls the work flow, and also use to generate documentation. System Analyst could use mind map to communicate with technical team to align their requirements and help in development.
4 |
5 | ## Changelog
6 |
7 | * v0.0.8 update for Rails 5
8 |
9 | ## Prerequisites
10 |
11 | These versions works for sure but others may do.
12 |
13 | * Ruby 2.3.0
14 | * Rails 5.0.0
15 | * MongoDB
16 | * Freemind 0.9
17 |
18 | ## Convention
19 |
20 | * database is MongoDB
21 | * images stored in upload directory, unset IMAGE_LOCATION in `initializer/mindapp.rb` to use Cloudinary
22 | * mail use Gmail SMTP, config in `config/application.rb`
23 | * authentication use omniauth-identity
24 |
25 | ## Sample Application
26 |
27 | Supposed we want to create ecommerce web site, first create a Rails
28 | app without ActiveRecord
29 |
30 | $ rails new shop --skip-test-unit --skip-bundle --skip-active-record
31 |
32 | add mindapp to your Gemfile:
33 |
34 | gem 'mindapp'
35 |
36 | depend on your operating system, you may need to uncomment
37 |
38 | gem 'therubyracer', :platforms => :ruby
39 |
40 | install gems
41 |
42 | $ bundle
43 |
44 | generate mindapp application
45 |
46 | $ rails generate mindapp:install
47 |
48 | Then run bundle again to install additional gems added by mindapp
49 |
50 | $ bundle
51 |
52 | configure mongoid
53 |
54 | $ rails generate mindapp:mongoid
55 |
56 | Please make sure mongod is running then create admin user
57 |
58 | $ rake mindapp:seed
59 |
60 | now the application is ready, start it as any Rails application
61 |
62 | $ rails server
63 |
64 | go to http://localhost:3000, click *Sign In* on the left menu, and enter user name `admin` and password `secret`
65 |
66 | 
67 |
68 | Now open file `app/mindapp/index.mm` using Freemind
69 |
70 | 
71 |
72 | The 3 main branches are
73 |
74 | * models - this defines all the models to use in the application
75 | * services - this defines services which will be come the menu on the left of the screen. There will be 2 levels; the first sub branch is the main menu (modules) and the second sub branch is the sub menu (services)
76 | * roles - this defines role for all users
77 |
78 | ### models
79 |
80 | Fiirst, we need to create some product so we click on models we'll see 2 models person and address. These are sample only. You can delete them or modify them however you want. We'll take a look at them first
81 |
82 | 
83 |
84 | The first sub branch (e.g. person) is the model name. According to Rails convention, this should be a singular word. The next sub branch are columns in the database. Let's take a look at each:
85 |
86 | * `fname` - this create a column (field) called fname which is a String by default
87 | * `sex: integer` - this create a column called sex, it is integer so must be explicity defined. The next sub branch (1: male) is disregarded by Mindapp so we can put whatever we want. Here I just put some reminder.
88 | * `belongs_to :address` - here we have  icon. this means whatever text on this line will be added as is to the model Mindapp generates. You use this to specify anything you want such as association, index, remarks in code, etc. according to mongoid gem. To draw the icon, rest mouse on the branch and hit <Alt-I>.
89 | * `dob: date` - use any type that mongoid provides.
90 | * `photo` - for file field, just use String here. Mindapp will receive the binary file and store in file system or cloudinary then generate a url link to it.
91 |
92 | In this example we just want a product model, so delete the person and address model and add a product branch like so
93 |
94 | 
95 |
96 | Save the mind map then run:
97 |
98 | rake mindapp:update
99 |
100 | This will create file `app/models/product.rb`. In this file, note the comment lines `# mindapp begin` and ` # mindapp end`. Everything inside these comments will get overwritten when you change the models branch in the mind map so if you need to put anything inside here, use the mind map instead. You can add anything outside these comment lines which will be preserved when doing mindapp:update.
101 |
102 | ### services
103 |
104 | Next we'll add some product into the database, we'll first take a look at the services branch, which already has 3 sub branches; users, admins, and devs. Unlike models person and address branches, these branches are actively used by the system so I recommend that you leave them alone. Let's open the users branch
105 |
106 | 
107 |
108 | The text `users:User` on the sub branch has these implications:
109 |
110 | * `users` correspond to `app/controllers/users_controller.rb` which already exist when you do rails generate mindapp:install. New branch will create new controller if not exist. In Mindapp term, this will be called module.
111 | * `User` will create entry in main menu on the left of the screen. You don't see it in the screenshot above because it's controlled by the sub branch `role:m` which means this menu only available for login member. If you already signed in as admin, you should see it now.
112 |
113 | The next sub branches has the following:
114 |
115 | * `role: m` - means that this module (menu) is available only to user who has role m (if you open the role branch now will see that role m is member). All registered user has role m by default. User who is not log on would not be able to access this module.
116 | * `link:info: /users` - means that this is a link, the format is link: *submenu label* : *url* where submenu label is the text to show in the submenu and url is the link to go to, in this case, it woud go to http://localhost:3000/users which will perform index action of UsersController.
117 | * `user:edit` the branch that do not start with role:, rule:, nor link: will be a Mindapp service. You will then specify the sequence of the execution as in this example there are 3 sub branches - enter_user, update_user, and rule:login? Let's take a look at them:
118 |
119 | * `enter_user:edit` - the first step is to display a form to input user information, this is accompanied by icon  which means user interface screen. and will correspond to a view file `app/views/users/user/enter_user.html.erb` where `/users` comes from the module name (the sub branch of services), `/user` comes from the service name (the sub branch of users), and `enter_user.html.erb` comes from the first part of this branch. The `edit` after the colon is just a description of this step. This branch also has sub branch `rule:login? && own_xmain?` which specify rule for this step that the user must be login and can continue this task if he is the one who started it. *task* in here means each instance of service.
120 | * `update_user` - this icon  means to execute method update_user within `users_controller.rb`
121 |
122 | Armed with this knowledge, we are ready to add new product into our application like so:
123 |
124 | 
125 |
126 | To generate controller and views we save this mind map and run
127 |
128 | rake mindapp:update
129 |
130 | open file `app/views/products/add/enter.html.erb` you'll see some sample view already in there but commented. edit the file so it look like this
131 |
132 | 
133 |
134 | Note that we do not specify form_tag and submit_tag, these will be supplied by Mindapp.
135 |
136 | then open file `app/controllers/products_controller.rb` and add `create` method as follow. The method name has to be correspond to the  branch.
137 |
138 | 
139 |
140 |
141 | ... to be continued ...
142 |
143 | ## Contributing
144 |
145 | 1. Fork it
146 | 2. Create your feature branch (`git checkout -b my-new-feature`)
147 | 3. Commit your changes (`git commit -am 'Add some feature'`)
148 | 4. Push to the branch (`git push origin my-new-feature`)
149 | 5. Create new Pull Request
150 |
--------------------------------------------------------------------------------
/lib/mindapp/helpers.rb:
--------------------------------------------------------------------------------
1 | # -*- encoding : utf-8 -*-
2 | module Mindapp
3 | module Helpers
4 | require "rexml/document"
5 | include REXML
6 | # methods from application_controller
7 | def b(s)
8 | "#{s}".html_safe
9 | end
10 | def date_thai(d= Time.now, options={})
11 | unless d
12 | ""
13 | else
14 | y = d.year+543
15 | if options[:monthfull] || options[:month_full]
16 | mh= ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฏาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม']
17 | else
18 | mh= ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.']
19 | end
20 | if options[:dateonly] || options[:date_only]
21 | d.day.to_s+" "+mh[d.month-1]+" "+y.to_s
22 | else
23 | d.day.to_s+" "+mh[d.month-1]+" "+y.to_s+" เวลา "+sprintf("%02d",d.hour.to_s)+":"+sprintf("%02d",d.min.to_s)
24 | end
25 | end
26 | end
27 | def link_to_blank(body, url_options = {}, html_options = {})
28 | link_to(body, url_options, html_options.merge(target: "_blank"))
29 | end
30 | def code_text(s) # old def code(s)
31 | "#{s}".html_safe
32 | end
33 | def refresh_to(url='/', option={})
34 | if option[:alert]
35 | ma_log option[:alert]
36 | end
37 | render :text => ""
38 | end
39 | def read_binary(path)
40 | File.open path, "rb" do |f| f.read end
41 | end
42 | def redirect_to_root
43 | redirect_to root_path
44 | end
45 | def get_option(opt, runseq=@runseq)
46 | xml= REXML::Document.new(runseq.xml).root
47 | url=''
48 | xml.each_element('///node') do |n|
49 | text= n.attributes['TEXT']
50 | url= text if text =~/^#{opt}:\s*/
51 | end
52 | c, h= url.split(':', 2)
53 | opt= h ? h.strip : false
54 | end
55 | def ma_comment?(s)
56 | s[0]==35
57 | end
58 | def get_ip
59 | request.env['HTTP_X_FORWARDED_FOR'] || request.env['REMOTE_ADDR']
60 | end
61 | def get_default_role
62 | default_role= Mindapp::Role.where(:code =>'default').first
63 | return default_role ? default_role.name.to_s : ''
64 | end
65 | def name2code(s)
66 | # rather not ignore # symbol cause it could be comment
67 | code, name = s.split(':')
68 | code.downcase.strip.gsub(' ','_').gsub(/[^#_\/a-zA-Z0-9]/,'')
69 | end
70 | def name2camel(s)
71 | s.gsub(' ','_').camelcase
72 | end
73 | def true_action?(s)
74 | %w(call ws redirect invoke email).include? s
75 | end
76 | def set_global
77 | $xmain= @xmain ; $runseq = @runseq ; $user = current_user ; $xvars= @xmain.xvars; $ip = request.env["REMOTE_ADDR"]
78 | end
79 | def authorize? # use in pending tasks
80 | @runseq= @xmain.runseqs.find @xmain.current_runseq
81 | return false unless @runseq
82 | @user = current_user
83 | set_global
84 | return false unless eval(@runseq.rule) if @runseq.rule
85 | return true if true_action?(@runseq.action)
86 | # return false if check_wait
87 | return true if @runseq.role.blank?
88 | unless @runseq.role.empty?
89 | return false unless @user.role
90 | return @user.role.upcase.split(',').include?(@runseq.role.upcase)
91 | end
92 | return true
93 | end
94 | def authorize_init? # use when initialize new transaction
95 | # check module role
96 | mrole = @service.module.role
97 | return false if mrole && !current_user
98 | return false if mrole && !current_user.has_role(mrole)
99 |
100 | # check step 1 role
101 | xml= @service.xml
102 | step1 = REXML::Document.new(xml).root.elements['node']
103 | role= get_option_xml("role", step1) || ""
104 | # rule= get_option_xml("rule", step1) || true
105 | return true if role==""
106 | unless current_user
107 | return role.blank?
108 | else
109 | return false unless current_user.role
110 | return current_user.has_role(role)
111 | end
112 | end
113 | def ma_log(message)
114 | Mindapp::Notice.create :message => ERB::Util.html_escape(message.gsub("`","'")),
115 | :unread=> true, :ip=> ($ip || request.env["REMOTE_ADDR"])
116 | # if session[:user_id]
117 | # Mindapp::Notice.create :message => ERB::Util.html_escape(message.gsub("`","'")),
118 | # :user_id => $user.id, :unread=> true, :ip=> env["REMOTE_ADDR"]
119 | # else
120 | # Mindapp::Notice.create :message => ERB::Util.html_escape(message.gsub("`","'")),
121 | # :unread=> true, :ip=> env["REMOTE_ADDR"]
122 | # end
123 | end
124 |
125 | alias :ma_notice :ma_log
126 |
127 | # methods from application_helper
128 | def markdown(text)
129 | erbified = ERB.new(text.html_safe).result(binding)
130 | red = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
131 | red.render(erbified).html_safe
132 | end
133 | def align_text(s, pixel=3)
134 | "#{s}".html_safe
135 | end
136 | def status_icon(status)
137 | case status
138 | when 'R'
139 | image_tag 'user.png'
140 | when 'F'
141 | image_tag 'tick.png'
142 | when 'I'
143 | image_tag 'control_play.png'
144 | when 'E'
145 | image_tag 'logout.png'
146 | when 'X'
147 | image_tag 'cross.png'
148 | else
149 | image_tag 'cancel.png'
150 | end
151 | end
152 | def role_name(code)
153 | role= Mindapp::Role.where(code:code).first
154 | return role ? role.name : ""
155 | end
156 | def uncomment(s)
157 | s.sub(/^#\s/,'')
158 | end
159 | def code_div(s)
160 | " #{s}".html_safe
161 | end
162 | def ajax?(s)
163 | return s.match('file_field') ? false : true
164 | end
165 | def step(s, total) # square text
166 | s = (s==0)? 1: s.to_i
167 | total = total.to_i
168 | out ="