Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Include rails assets in API

  • Loading branch information...
commit 6f14b6191f5e53a8cbe56eeb2806572d88c6436a 1 parent 55a6e94
@josepjaume josepjaume authored
View
16 app/assets/stylesheets/_empresaula_bar.sass
@@ -0,0 +1,16 @@
+@import empresaula_colors
+@import empresaula_buttons
+
+#empresaula_bar
+ background: #333
+ padding: 5px 5px
+ a
+ +button-dark-gray
+ display: inline-block
+ padding: 5px 10px
+
+ #admin_button
+ float: right
+ select
+ display: inline-block
+ margin: 0px
View
4 app/assets/stylesheets/_empresaula_base.sass
@@ -0,0 +1,4 @@
+@import empresaula_colors
+@import empresaula_bar
+@import empresaula_buttons
+@import empresaula_footer
View
167 app/assets/stylesheets/_empresaula_buttons.sass
@@ -0,0 +1,167 @@
+@charset "UTF-8"
+@import compass/css3/gradient
+@import compass/css3/box-shadow
+@import "compass/css3/border-radius"
+
+=button-base
+ +border-radius(3px)
+ outline: none
+ &:hover
+ cursor: pointer
+ &::-moz-focus-inner
+ border: 0
+
+=button-denarius($base: #7fbf4d)
+ +button-base
+ background: $base
+ background: -moz-linear-gradient(0% 100% 90deg, darken($base, 5%), lighten($base, 2%))
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(lighten($base, 5%)), to(darken($base, 2%)))
+ border: 1px solid lighten($base, 2%)
+ border-bottom: 1px solid darken($base, 5%)
+ -moz-box-shadow: inset 0 1px 0 0 $base + #170b20
+ -webkit-box-shadow: inset 0 1px 0 0 $base + #170b20
+ box-shadow: inset 0 1px 0 0 $base + #170b20
+ color: white !important
+ font-size: 11px
+ font-weight: bold
+ padding: 8px 8px
+ text-align: center
+ text-decoration: none !important
+ text-shadow: 0 -1px 0 $base - #332f2c
+ &:hover, &:focus
+ background: #76b347
+ background: -moz-linear-gradient(0% 100% 90deg, $base - #21211f, $base - #090c06)
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from($base - #090c06), to($base - #21211f))
+ -moz-box-shadow: inset 0 1px 0 0 $base - #0e001a
+ -webkit-box-shadow: inset 0 1px 0 0 $base - #0e001a
+ box-shadow: inset 0 1px 0 0 $base - #0e001a
+ &:active, &.selected
+ border: 1px solid $base - #242622
+ border-bottom: 1px solid $base - #2c3326
+ -moz-box-shadow: inset 0 0 8px 4px $base - #2b3324
+ -webkit-box-shadow: inset 0 0 8px 4px $base - #2b3324
+ box-shadow: inset 0 0 8px 4px $base - #2b3324
+ &:focus
+ text-decoration: underline !important
+
+=button-denarius-blue
+ +button-denarius($color-base)
+
+=button-denarius-yellow
+ +button-base
+ background: #dfd8ac
+ background: -moz-linear-gradient(0% 100% 90deg, #ccbf77, #dfd8ac)
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#dfd8ac), to(#ccbf77))
+ border: 1px solid #ccbf77
+ border-bottom: 1px solid #ad9f51
+ -moz-box-shadow: inset 0 1px 0 0 #ede1a1
+ -webkit-box-shadow: inset 0 1px 0 0 #ede1a1
+ box-shadow: inset 0 1px 0 0 #ede1a1
+ color: white
+ font-size: 11px
+ font-weight: bold
+ padding: 8px 8px
+ text-align: center
+ text-shadow: 0 -1px 0 #84732d
+ &:hover
+ background: #bfac5b
+ background: -moz-linear-gradient(0% 100% 90deg, #cec18d, #bfac5b)
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#cec18d), to(#bfac5b))
+ -moz-box-shadow: inset 0 1px 0 0 #d3c99f
+ -webkit-box-shadow: inset 0 1px 0 0 #d3c99f
+ box-shadow: inset 0 1px 0 0 #d3c99f
+ &:active
+ border: 1px solid #ad9f51
+ border-bottom: 1px solid #a59555
+ -moz-box-shadow: inset 0 0 8px 4px #af9f5a
+ -webkit-box-shadow: inset 0 0 8px 4px #af9f5a
+ box-shadow: inset 0 0 8px 4px #af9f5a
+
+=button-denarius-brown
+ +button-base
+ background: #dfd8ac
+ background: -moz-linear-gradient(0% 100% 90deg, #ccbf77, #dfd8ac)
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#dfd8ac), to(#ccbf77))
+ border: 1px solid #ccbf77
+ border-bottom: 1px solid #ad9f51
+ -moz-box-shadow: inset 0 1px 0 0 #ede1a1
+ -webkit-box-shadow: inset 0 1px 0 0 #ede1a1
+ box-shadow: inset 0 1px 0 0 #ede1a1
+ color: white
+ font-size: 11px
+ font-weight: bold
+ padding: 8px 8px
+ text-align: center
+ text-shadow: 0 -1px 0 #84732d
+ &:hover
+ background: #bfac5b
+ background: -moz-linear-gradient(0% 100% 90deg, #cec18d, #bfac5b)
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#cec18d), to(#bfac5b))
+ -moz-box-shadow: inset 0 1px 0 0 #d3c99f
+ -webkit-box-shadow: inset 0 1px 0 0 #d3c99f
+ box-shadow: inset 0 1px 0 0 #d3c99f
+ &:active
+ border: 1px solid #ad9f51
+ border-bottom: 1px solid #a59555
+ -moz-box-shadow: inset 0 0 8px 4px #af9f5a
+ -webkit-box-shadow: inset 0 0 8px 4px #af9f5a
+ box-shadow: inset 0 0 8px 4px #af9f5a
+
+=button-clean-gray
+ +button-base
+ background: #eeeeee
+ +background-image(linear-gradient($color-5 + #111111, $color-5))
+ border: 1px solid #dddddd
+ border-bottom: 1px solid #cccccc
+ color: #555555
+ font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif
+ font-size: 11px
+ font-weight: bold
+ line-height: 1
+ padding: 8px 8px
+ text-align: center
+ text-shadow: 0 1px 0 #eeeeee
+ display: inline-block
+ text-decoration: none
+ &:hover
+ background: $color-5
+ +background-image(linear-gradient($color-5 + #111111, $color-5))
+ border: 1px solid #dddddd
+ border-bottom: 1px solid #cccccc
+ text-shadow: 0 1px 0 white
+ &:active, &.selected
+ border: 1px solid #dddddd
+ border-bottom: 1px solid #cccccc
+ +box-shadow(($color-5 - #111111) 0px 0px 5px 2px inset)
+ +background-image(linear-gradient($color-5 - #101010, $color-5 - #1a1a1a))
+
+=button-dark-gray
+ +button-clean-gray
+ background: #444444
+ color: white
+ background: -moz-linear-gradient(0% 100% 90deg, #666666, #444444)
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#666666), to(#444444))
+ border: 1px solid #555555
+ border-bottom: 1px solid #555555
+ font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif
+ font-size: 11px
+ font-weight: bold
+ line-height: 1
+ padding: 8px 8px
+ text-align: center
+ text-shadow: 0 1px 0 #444444
+ display: inline-block
+ text-decoration: none
+ &:hover
+ background: #888888
+ background: -moz-linear-gradient(0% 100% 90deg, #888888, #666666)
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#888888), to(#666666))
+ border: 1px solid #666666
+ border-bottom: 1px solid #555555
+ text-shadow: 0 1px 0 #333333
+ &:active
+ border: 1px solid #777777
+ border-bottom: 1px solid #777777
+ -moz-box-shadow: inset 0 0 5px 2px #777777
+ -webkit-box-shadow: inset 0 0 5px 2px #777777
+ box-shadow: inset 0 0 5px 2px #999999
View
6 app/assets/stylesheets/_empresaula_colors.sass
@@ -0,0 +1,6 @@
+$color-base: #598AB7
+$color-1: $color-base
+$color-2: $color-base + #995800 - #0000b2
+$color-3: $color-base - #356591
+$color-5: $color-base + #8e623a
+$color-6: $color-base - #1d2830
View
21 app/assets/stylesheets/_empresaula_footer.sass
@@ -0,0 +1,21 @@
+@import "compass/layout/sticky-footer"
+@include sticky-footer(54px, "#wrapper", "#wrapper_footer", "#footer")
+
+#footer
+ height: 53px
+ overflow: hidden
+ line-height: 53px
+ border-top: 1px solid #cccccc
+ background-color: $color-5
+ text-align: center
+ ul
+ margin: 0px
+ padding: 0px
+ li
+ display: inline-block
+ margin: 0px 20px
+ a
+ display: inline-block
+ padding: 0px 5px
+ overflow: hidden
+ background-color: $color-5
View
15 app/views/application/_footer.html.slim
@@ -0,0 +1,15 @@
+footer#footer
+ ul
+ li Copyright Empresaula 2011
+ li=link_to 'info@empresaula.com', 'mailto:info@empresaula.com'
+ li
+ =t 'made_by'
+ a href='http://codegram.com' target='blank' Codegram
+ li#language-switcher
+ -locales = [['Català', 'ca'], ['Español', 'es']]
+ form action=request.path method='get'
+ =select_tag :locale, options_for_select(locales, I18n.locale.to_s)
+ javascript:
+ $("#language-switcher select").change(function(){
+ $(this).parents('form').submit();
+ });
View
1  lib/empresaula-api/controller.rb
@@ -1 +1,2 @@
require_relative 'controller/authentication'
+require_relative 'controller/localization'
View
19 lib/empresaula-api/controller/localization.rb
@@ -0,0 +1,19 @@
+module Empresaula
+ module API
+ module Controller
+ module Localization
+ def self.included(base)
+ base.class_eval do
+ before_filter :set_locale
+ end
+ end
+
+ def set_locale
+ session[:locale] = params[:locale] if params[:locale]
+ I18n.locale = session[:locale] if session[:locale]
+ end
+
+ end
+ end
+ end
+end
View
2  lib/empresaula-api/railtie.rb
@@ -1,6 +1,6 @@
module Empresaula
module API
- class Railtie < Rails::Railtie
+ class Engine < Rails::Engine
initializer "empresaula_api.add_cached_resource" do
require 'cached_resource'
Empresaula::API::Resource::User.class_eval do
Please sign in to comment.
Something went wrong with that request. Please try again.