Skip to content

Commit

Permalink
use asset pipeline and go the full route with sass and compass
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Nov 8, 2012
1 parent d4143e6 commit f378f86
Show file tree
Hide file tree
Showing 128 changed files with 102 additions and 523 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ public/developer
tmp/appdata-factory.xml
.idea
public/assets
tmp/sass-cache
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ gem 'jquery-rails'
gem 'memcache-client'
gem 'sqlite3'
gem 'minitest'

group :assets do
gem 'sass-rails' # if running rails 3.1 or greater
gem 'compass-rails'
end


15 changes: 15 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,21 @@ GEM
multi_json (~> 1.0)
arel (3.0.2)
builder (3.0.0)
chunky_png (1.2.6)
compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
compass-rails (1.0.3)
compass (>= 0.12.2, < 0.14)
delayed_job (3.0.3)
activesupport (~> 3.0)
delayed_job_active_record (0.3.2)
activerecord (> 2.1.0)
delayed_job (~> 3.0.0)
erubis (2.7.0)
fast_gettext (0.6.9)
fssm (0.2.9)
gettext (2.3.0)
locale
gettext_i18n_rails (0.7.1)
Expand Down Expand Up @@ -88,6 +96,11 @@ GEM
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
sass (3.2.1)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
Expand All @@ -106,6 +119,7 @@ PLATFORMS
ruby

DEPENDENCIES
compass-rails
delayed_job (> 3.0)
delayed_job_active_record
gettext (>= 1.9.3)
Expand All @@ -117,5 +131,6 @@ DEPENDENCIES
nokogiri
rails (~> 3.2.1)
rails-i18n
sass-rails
sqlite3
xmlhash (>= 1.2.2)
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//
//= require bento/global-navigation.js
//= require jquery.cookie
//= require jquery.pjax

// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
var divs_shown = false;
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/bento/global-navigation.js
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*/
@import "compass";
@import "bento/reset";
@import "bento/960";
@import "bento/base";

@import "style";

1 change: 1 addition & 0 deletions app/assets/stylesheets/bento/960.css
1 change: 1 addition & 0 deletions app/assets/stylesheets/bento/base.css
1 change: 1 addition & 0 deletions app/assets/stylesheets/bento/reset.css
5 changes: 5 additions & 0 deletions app/assets/stylesheets/ie.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Welcome to Compass. Use this file to write IE specific override styles.
* Import this file using the following HTML or equivalent:
* <!--[if IE]>
* <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
* <![endif]--> */
3 changes: 3 additions & 0 deletions app/assets/stylesheets/print.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* Welcome to Compass. Use this file to define print styles.
* Import this file using the following HTML or equivalent:
* <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" /> */
6 changes: 6 additions & 0 deletions app/assets/stylesheets/screen.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Welcome to Compass.
* In this file you should write your main styles. (or centralize your imports)
* Import this file using the following HTML or equivalent:
* <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */

@import "compass/reset";
File renamed without changes.
4 changes: 4 additions & 0 deletions app/controllers/order_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ def index
redirect_to :action => "new"
end

def show
redirect_to :action => "new"
end

def pause
end

Expand Down
6 changes: 3 additions & 3 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<link rel="search" type="application/opensearchdescription+xml" title="openSUSE Software" href="/search_software.xml" />

<%= stylesheet_link_tag "/themes/bento/css/style.css", "software" %>
<%= stylesheet_link_tag "application" %>
<link href="http://static.opensuse.org/themes/bento/images/favicon.png" rel="shortcut icon" />
<%= javascript_include_tag "http://static.opensuse.org/themes/bento/js/jquery.js", "jquery-ui-1.8.18.custom.min", "jrails", "jquery.cookie", "application", "jquery.pjax" %>
<%= javascript_include_tag "/themes/bento/js/l10n/global-navigation-data-#{@lang || "en"}.js", "/themes/bento/js/global-navigation.js" %>
<%= javascript_include_tag "application" %>
<%= javascript_include_tag "/themes/bento/js/l10n/global-navigation-data-#{@lang || "en"}.js" %>
<%= yield :content_for_head %>

Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/download.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

<%= stylesheet_link_tag "/themes/bento/css/style.css", "software" %>
<link href="http://static.opensuse.org/themes/bento/images/favicon.png" rel="shortcut icon" />
<%= javascript_include_tag "http://static.opensuse.org/themes/bento/js/jquery.js", "jrails.js", "application.js" %>
<%= javascript_include_tag "/themes/bento/js/l10n/global-navigation-data-#{@lang || "en"}.js", "/themes/bento/js/global-navigation.js" %>
<%= javascript_include_tag ""application" %>
<%= javascript_include_tag "/themes/bento/js/l10n/global-navigation-data-#{@lang || "en"}.js" %>
<%= yield :content_for_head %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/main/_change_install.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<button name="medium" value="<%= medium %>" style="width: 630px; margin-bottom: 20px; background: #ccc" class="changeiso">
<div>
<p>
<%= image_tag "/images/" + medium + "_icon.png", :style=> "width: 64px; height: 64px; margin: 5x; float: left", :alt=>"", :width => 64, :height => 64 %>
<%= image_tag medium + "_icon.png", :style=> "width: 64px; height: 64px; margin: 5x; float: left", :alt=>"", :width => 64, :height => 64 %>
<span style="font-size: 120%; font-weight: bold; height: 60px"><%= shorttext %></span>
<br/>
<span style="font-size: 90%; font-weight: 500"><%= longtext %></span>
Expand All @@ -18,7 +18,7 @@

<div id="ci_<%= medium %>" class="hidden changeiso script_only <%= if @medium == medium then 'medium_selected' else 'medium_unselected' end %> ">
<%= if @medium == medium then iclass='icon_selected' else iclass='icon_unselected' end
image_tag("/images/" + medium + "_icon.png", :alt => "", :id => "icon_" + medium, :class => iclass) %>
image_tag(medium + "_icon.png", :alt => "", :id => "icon_" + medium, :class => iclass) %>
<div>
<span style="font-size: 120%; font-weight: bold"><%= shorttext %></span>
<br/>
Expand Down
2 changes: 1 addition & 1 deletion app/views/main/_download_link.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a class="iso_<%= id %>" href="<%= @directory %>/iso/openSUSE-<%= @isos[iso] %>.iso">
<%= image_tag "/images/dot_media.png", :alt => _("Download"), :title => _("Click to Download"), :width => 26, :height => 26 %>
<%= image_tag "dot_media.png", :alt => _("Download"), :title => _("Click to Download"), :width => 26, :height => 26 %>
</a>
<a class="iso_<%= id %>" href="<%= @directory %>/iso/openSUSE-<%= @isos[iso] %>.iso"><%= text -%></a>

Expand Down
4 changes: 2 additions & 2 deletions app/views/main/_options.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div>
<form id="downloadForm" action="/main/download" style="height: 10em">
<div id="downloadMethodDiv">
<h4><%=_("Download Method")%> <%= image_tag '/images/help-browser.png', :id => "downloadMethodHelpPopup", :class => "help_icon", :alt => "?", :width => 16, :height => 16 %></h4>
<h4><%=_("Download Method")%> <%= image_tag 'help-browser.png', :id => "downloadMethodHelpPopup", :class => "help_icon", :alt => "?", :width => 16, :height => 16 %></h4>
<div>
<label class="l_change"><input id="p_http" name="protocol" value="http" checked="checked" type="radio" class="changeiso"/><%=_("Direct Link")%></label>
<label class="l_change" id="l_torrent"><input id="p_torrent" name="protocol" value="torrent" type="radio" class="changeiso"/><%=_("BitTorrent")%></label>
Expand Down Expand Up @@ -34,7 +34,7 @@
</div>

<div id="TypeOfComputerDiv">
<h4><%= _("Type of Computer") %> <%= image_tag '/images/help-browser.png', :id => "architectureTypeHelpPopup", :class=>"help_icon", :alt=>"?", :width => 16, :height => 16 %></h4>
<h4><%= _("Type of Computer") %> <%= image_tag 'help-browser.png', :id => "architectureTypeHelpPopup", :class=>"help_icon", :alt=>"?", :width => 16, :height => 16 %></h4>

<div>
<label id="l_i686" class="l_change"><input id="i686" name="arch" value="i686" checked="checked" type="radio" class="changeiso" /><%=_("32&nbsp;Bit&nbsp;PC")%></label>
Expand Down
2 changes: 1 addition & 1 deletion app/views/main/download.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var myiso = '';
var directory = "<%= @directory %>";
var isos = new Array();
<% @isos.each { |key, value| %>
<%= "isos['#{key}'] = '#{value}';" %>
<%= raw "isos['#{key}'] = '#{value}';" %>
<% } %>

function changeiso () {
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Application < Rails::Application
config.active_record.whitelist_attributes = true

# Enable the asset pipeline
config.assets.enabled = false
config.assets.enabled = true

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
Expand Down
2 changes: 2 additions & 0 deletions config/compass.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Require any additional compass plugins here.
project_type = :rails
8 changes: 5 additions & 3 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
config.cache_store = :memory_store
end

# Add your username + password for the api here
CONFIG['api_username'] = "wiki_hermes"
CONFIG['api_password'] = "w_h_p1"
if defined? CONFIG
# Add your username + password for the api here
CONFIG['api_username'] = "wiki_hermes"
CONFIG['api_password'] = "w_h_p1"
end
Loading

0 comments on commit f378f86

Please sign in to comment.