This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget -c http://www.famfamfam.com/lab/icons/silk/famfamfam_silk_icons_v013.zip | |
unzip famfamfam_silk_icons_v013.zip | |
rm readme.html | |
rm readme.txt | |
cd icons | |
mv * ../public/images/web-app-theme/ | |
cd .. | |
rm -R icons | |
rm famfamfam_silk_icons_v013.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Removendo as paginas que nao iremos utilizar | |
run "rm README" | |
run "rm doc/README_FOR_APP" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/robots.txt" | |
#Colando a rota padrao | |
route %(map.root :controller => "dashboard") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pt-BR: | |
# formatos de data e hora | |
date: | |
formats: | |
default: "%d/%m/%Y" | |
short: "%d de %B" | |
long: "%d de %B de %Y" | |
day_names: [Domingo, Segunda, Terça, Quarta, Quinta, Sexta, Sábado] | |
abbr_day_names: [Dom, Seg, Ter, Qua, Qui, Sex, Sáb] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Filters added to this controller apply to all controllers in the application. | |
# Likewise, all the methods added will be available for all controllers. | |
class ApplicationController < ActionController::Base | |
helper :all # include all helpers, all the time | |
protect_from_forgery # See ActionController::RequestForgeryProtection for details | |
#BREADCRUMBS | |
before_filter :trail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Backend::DashboardController < ApplicationController | |
layout "backend" | |
def index | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# exportação de TODOS os dados no formato xml e json | |
def export | |
@ufs = Uf.find(:all, :order => "uf") | |
prawnto :prawn => {:page_layout => :landscape} | |
respond_to do |format| | |
format.xml { render :xml => @ufs } | |
format.json { render :json => @ufs } | |
format.csv do | |
@output_encoding = 'ISO-8859-1' | |
@filename = "ufs.csv" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pdf.stroke_color "CCCCCC" | |
pdf.font "Helvetica", :size => 14 | |
pdf.text @uf.uf.to_s, :size => 30, :style => :bold | |
pdf.stroke_horizontal_rule | |
pdf.move_down(20) | |
pdf.text "Id: " + @uf.id.to_s | |
pdf.text "Uf: " + @uf.uf.to_s | |
pdf.text "Sigla: " + @uf.sigla.to_s | |
if [email protected]_content_type.index("image/gif") && (@uf.bandeira_content_type.index("image/png") || @uf.bandeira_content_type.index("image/jpeg") || @uf.bandeira_content_type.index("image/jpg")) | |
pdf.image "#{RAILS_ROOT}/public/images/" + @uf.bandeira.to_s.gsub(/\?.[0-9]*/,""), :at => [500, 480] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'prawn/layout' | |
require 'prawn/format' | |
bill_address = @order.bill_address | |
ship_address = @order.ship_address | |
font "Helvetica" | |
image Spree::PrintInvoice::Config[:print_invoice_logo_path], :at => [0,720], :scale => 0.65 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Infelizmente não é possível colocar todas as regras... | |
# | |
# http://pt.wikipedia.org/wiki/Plural e | |
# http://pt.wikipedia.org/wiki/Singular | |
module Inflector | |
ActiveSupport::Inflector.inflections do |inflect| | |
inflect.clear | |
inflect.plural(/$/, 's') | |
inflect.plural(/(s)$/i, '\1') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pt-BR: | |
new: "novo" | |
edit: "editar" | |
show: "detalhes" |
OlderNewer