Socket
Book a DemoInstallSign in
Socket

gridomatic

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gridomatic

0.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

= gridomatic

  • http://github.com/cmdjohnson/gridomatic

== DESCRIPTION:

Easy floatable grid structures for Rails.

Don't have too much data to display but still need to fill up that screen?

Why don't you present your data in a grid of boxes. Provided you color them right, boxes are very easy to the eyes because the mind understands its structure. Add to that custom coloring, (e.g. each controller can have its own color) background images and clickable boxes and you have a navigation that is not only great looking, but is also very easy to use on touchpad-enabled devices such as an iPad.

This is what it looks like: https://github.com/cmdjohnson/gridomatic/blob/master/screenshots/overview.png

== SYNOPSIS:

A simple box with heading

= render_box :heading => "foo" do

  • "bar"

Screenshot: https://github.com/cmdjohnson/gridomatic/blob/master/screenshots/single-box.png

Create a clickable box (no heading this time):

Create a bunch of boxes that all look the same, except for one

  • array = Array.new(7)
  • array[5] = { :heading => "wrong, ", :content => "i feel different", :heading_color => "red", :background_color => "orange", :link => "http://www.google.com/" } = render_boxes array, :template => { :float_left => true, :heading => "same", :content => "stuff every day" }

Screenshot: https://github.com/cmdjohnson/gridomatic/blob/master/screenshots/multi-box-with-override.png

The render_box method accepts the following options:

options:

- content (string)

- heading (string)

- float_left (true/false)

- text_align_center (true/false)

- highlight (true/false)

- background_image (url)

- bigfont (true/false)

- heading_color (color name, e.g. 'red')

- background_color (color name, e.g. 'blue')

- inner_div_style (css style, e.g. "width: 382px; height: 281px;")

- outer_div_style (same)

- heading_style (same)

- height (css style unit, e.g. "100px" or "6em")

- solid_background (true/false)

You can wrap an tag around the box and it will have a:hover CSS enabled, e.g.

= render_box do

- "bar"

== REQUIREMENTS:

Rails 2.3 or above, tested with 2.3.12.

== INSTALL:

Copy the file gridomatic_helper.rb to your app/helpers folder and copy gridomatic.css to your public/stylesheets folder.

You need to reference the gridomatic.css in your application layout, i.e. app/views/layouts/application.html.erb:

The reference must be placed within the section.

There is a gem version available, but I don't even use it.

== LIMITATIONS:

Unfortunately, you cannot use multiple lines to concatenate them. For instance,

=> "baz"

Will always return "baz" because that's the return value. This is against HAML's idea that you should be able to concatenate anything you put right underneath each other. Ruby blocks simply have a single return value and, as far as I know, are not aware of the difference between "foo" "bar" "baz" or "baz" -- they will only see "baz".

== OTHER NOTES:

In this description, I've used HAML examples for the view, but this ofcourse depends on your own preference. In ERB, a simple box would be rendered as such:

<%= render_box :heading => "foo" do %> <%- "bar" %> <%- end %>

Don't forget the 'end' tag which is required by ERB.

== LICENSE:

(The MIT License)

Copyright (c) 2011 Commander Johnson commanderjohnson@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FAQs

Package last updated on 31 Aug 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.