Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed to bootstrap 2

  • Loading branch information...
commit 1a5fb76d9a700d44d458d9ed53a0ccf5b0b2adf6 1 parent 05a1292
Ian Bishop authored
View
3  Gemfile
@@ -24,7 +24,8 @@ gem 'jquery-rails'
gem 'mongo_mapper'
gem 'bson_ext'
-gem 'gmaps4rails'
+gem 'less-rails-bootstrap'
+
gem 'kaminari'
#Gems used for scheduled hacker news searches
gem 'rufus-scheduler'
View
17 Gemfile.lock
@@ -41,6 +41,8 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.2.0)
+ commonjs (0.2.0)
+ therubyracer (~> 0.9.9)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.3.0)
@@ -51,8 +53,6 @@ GEM
rack (>= 1.1.0, < 2)
faraday_middleware (0.7.0)
faraday (~> 0.7.3)
- gmaps4rails (1.4.3)
- json
hacker_news_search (0.0.4)
faraday (~> 0.7.4)
faraday_middleware (~> 0.7.0)
@@ -71,6 +71,15 @@ GEM
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
+ less (2.0.9)
+ commonjs (~> 0.2.0)
+ therubyracer (~> 0.9.9)
+ less-rails (2.1.5)
+ actionpack (>= 3.1)
+ less (~> 2.0.7)
+ less-rails-bootstrap (2.0.2)
+ less-rails (~> 2.1.0)
+ libv8 (3.3.10.4)
mail (2.4.1)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -140,6 +149,8 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
stemmer (1.0.1)
+ therubyracer (0.9.9)
+ libv8 (~> 3.3.10)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
@@ -156,10 +167,10 @@ PLATFORMS
DEPENDENCIES
bson_ext
coffee-rails (~> 3.2.1)
- gmaps4rails
hacker_news_search
jquery-rails
kaminari
+ less-rails-bootstrap
mongo_mapper
nokogiri
rails (= 3.2.0)
View
24 \
@@ -0,0 +1,24 @@
+class PostsController < ApplicationController
+ # GET /posts
+ # GET /posts.json
+ def index
+ @posts = Post.sort(:created.desc).page(params[:page]).per(20)
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render json: @posts }
+ end
+ end
+
+ # GET /posts/1
+ # GET /posts/1.json
+ def show
+ @post = Post.where(:id => params[:id]).first
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.json { render json: @post }
+ end
+ end
+
+end
View
2  app/assets/javascripts/application.js
@@ -13,4 +13,4 @@
//= require jquery
//= require jquery_ujs
//= require_tree .
-//= require gmaps4rails/googlemaps.js
+//= require twitter/bootstrap
View
8 app/assets/javascripts/posts.js.coffee
@@ -1,11 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
-
-$ ->
- GMap4Rails.callback ->
- if Gmaps4Rails.markers.length == 1
- Gmaps4Rails.map.setZoom(2)
- else
- Gmaps4Rails.map_options.auto_zoom = true
- Gmaps4Rails.adjust_map_to_bounds()
View
3  app/assets/stylesheets/application.css
@@ -10,6 +10,5 @@
*
*= require_self
*= require_tree .
- *= require bootstrap.min
- *= require gmaps4rails
+ *= require twitter/bootstrap
*/
View
0  app/assets/stylesheets/home.css.scss → app/assets/stylesheets/home.css.less
File renamed without changes
View
1  app/assets/stylesheets/posts.css.less
@@ -0,0 +1 @@
+@import "twitter/bootstrap/responsive";
View
3  app/assets/stylesheets/posts.css.scss
@@ -1,3 +0,0 @@
-// Place all the styles related to the Posts controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
View
2  app/controllers/posts_controller.rb
@@ -14,8 +14,6 @@ def index
# GET /posts/1.json
def show
@post = Post.where(:id => params[:id]).first
- @prev_page = params[:page]
- @json = @post.to_gmaps4rails
respond_to do |format|
format.html # show.html.erb
View
2  app/jobs/parsers/company.rb
@@ -36,7 +36,7 @@ def parse(post, urls)
#proper_noun_candidate = best_proper_noun(post)
#return proper_noun_candidate unless proper_noun_candidate.nil?
- 'unknown'
+ nil
end
# last attempt at a shoddy heuristic
View
27 app/models/post.rb
@@ -1,34 +1,35 @@
class Post
include MongoMapper::Document
- include Gmaps4rails::ActsAsGmappable
key :company, String
key :author, String
key :content, String
key :location, String
key :positions, Array
- key :create_ts, String
+ key :created, Time
key :intern, Boolean
key :remote, Boolean
key :honeb, Boolean
- key :latitude, Float
- key :longitude, Float
- key :address, String
- key :gmaps, Boolean
key :emails, Array
key :urls, Array
key :technologies, Array
timestamps!
- acts_as_gmappable :lat => 'latitude', :lon => 'longitude', :process_geocoding => true,
- :check_process => :prevent_geocoding,
- :address => 'address', :normalized_address => 'address'
+ def pretty_created
+ self.created.strftime("%B %e, %Y")
+ end
+
+ def pretty_positions
+ self.positions.join("/")
+ end
- def prevent_geocoding
- address.blank? || (!lat.blank? && !lon.blank?)
+ def pretty_technologies
+ self.technologies.join("/")
end
- def gmaps4rails_address
- self.location
+ def pretty_emails
+ return self.emails.map do |email|
+ email = email.gsub(/\./, ' [ dot ] ').gsub(/@/, ' [ at ] ')
+ end
end
end
View
18 app/views/posts/index.html.erb
@@ -3,8 +3,7 @@
<li class="active">Jobs</li>
</ul>
-
-<table class="zebra-striped">
+<table class="table table-striped table-bordered">
<tr>
<th></th>
<th>Position</th>
@@ -18,21 +17,20 @@
<tr onclick="location.href='<%= post_path(post) %>'">
<td>
<% if post.intern %>
- <span class="label success">Intern</span>
+ <span class="label label-success">Intern</span>
<% end %>
<% if post.remote %>
- <span class="label important">Remote</span>
+ <span class="label label-important">Remote</span>
<% end %>
<% if post.honeb %>
- <span class="label notice">H1B</span>
+ <span class="label label-info">H1B</span>
<% end %>
</td>
- <td><%= post.position %></td>
+ <td><%= post.pretty_positions %></td>
<td><%= post.company %></td>
- <td><%= post.technologies.join(", ") %></td>
- <td><%= post.locations.join(", ") %></td>
- <%# ugh i know, i don't want to talk about it %>
- <td><%= post.created.strftime("%B %e, %Y") %></td>
+ <td><%= post.pretty_technologies %></td>
+ <td><%= post.location %></td>
+ <td><%= post.pretty_created %></td>
</tr>
<% end %>
</table>
View
39 app/views/posts/show.html.erb
@@ -1,6 +1,8 @@
+<div class="row">
+ <div class="span-12">
<ul class="breadcrumb">
<li><%= link_to "Jobs", posts_path %><span class="divider">/</span></li>
- <li class="active"><%= "#{@post.position} at #{@post.company}" %></li>
+ <li class="active"><%= "#{@post.pretty_positions} at #{@post.company}" %></li>
</ul>
<% if !notice.blank? %>
@@ -10,25 +12,30 @@
</div>
<% end %>
-<h1><%= @post.position %> at <%= @post.company %></h1>
+<h1>
+ <% if @post.positions.length > 0 and !@post.company.nil?%>
+ <%= @post.pretty_positions %> at <%= @post.company %>
+ <% elsif @post.positions.length > 0 %>
+ <%= @post.pretty_positions %>
+ <% elsif !@post.company.nil? %>
+ <%= @post.company %>
+ <% end %>
+</h1>
-<div class="row">
- <div class="span11">
-
<p>
<% if @post.intern %>
- <span class="label success">Intern</span>
+ <span class="label label-success">Intern</span>
<% end %>
<% if @post.remote %>
- <span class="label important">Remote</span>
+ <span class="label label-important">Remote</span>
<% end %>
<% if @post.honeb %>
- <span class="label notice">H1B</span>
+ <span class="label label-info">H1B</span>
<% end %>
</p>
<p>
- <b>Position:</b>
- <%= @post.position %>
+ <b>Positions:</b>
+ <%= @post.pretty_positions %>
</p>
<p>
<b>Company:</b>
@@ -36,8 +43,8 @@
</p>
<p>
<b>Technologies:</b>
- <%= @post.technologies.join(', ') %>
- </p>
+ <%= @post.pretty_technologies %>
+ </p>
<p>
<b>Location:</b>
<%= @post.location %>
@@ -54,7 +61,7 @@
<p>
<b>Contact(s):</b>
<ul>
- <% @post.emails.each do |email| %>
+ <% @post.pretty_emails.each do |email| %>
<li><%= email %></li>
<% end %>
</ul>
@@ -68,8 +75,6 @@
</ul>
</p>
</div>
- <div class="span5">
- <%= gmaps4rails(@json)
- %>
- </div>
+</div>
+</div>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.