Skip to content

Commit

Permalink
convert app layout and story partial to slim
Browse files Browse the repository at this point in the history
  • Loading branch information
JuddL333 committed Jun 28, 2013
1 parent ce2fb1d commit 6c10fcd
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 18 deletions.
4 changes: 3 additions & 1 deletion app/assets/stylesheets/application.css.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@

@lightYellow: #fdfcf7;
@darkYellow: darken(@lightYellow, 50%);
@lightGray: #f9f9f9;

body {
background: url(/assets/cork.png) top left;
// background: url(/assets/cork.png) top left;
background: @lightGray;
}

.score{
Expand Down
19 changes: 13 additions & 6 deletions app/assets/stylesheets/bootstrap_and_overrides.css.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "twitter/bootstrap/bootstrap";
body { padding-top: 10px; }
body { padding-top: 80px; }

@import "twitter/bootstrap/responsive";

Expand All @@ -15,10 +15,17 @@ body { padding-top: 10px; }
@fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");
@import "fontawesome/font-awesome";

@yellowMustard: #c4ac31;
@yellowMustard: #df9b53;
@vegasRed: #db3c21;
@vegasBlue: #407fd3;
@lightGray: #f9f9f9;

@linkColor: #b13131;
@navbarBackground: fade(white, 0%);
@navbarBackgroundHighlight: fade(white, 0%);
@linkColor: @vegasRed;

//nav bar
@navbarLinkColor: @lightGray;
@navbarBackground: fade(@vegasBlue, 80%);
@navbarBackgroundHighlight: fade(@vegasBlue, 80%);
@dropdownLinkBackgroundHover: @yellowMustard;
@dropdownLinkColorHover: @white;
@dropdownLinkColorHover: @white;
@navbarHeight: 60px;
121 changes: 121 additions & 0 deletions app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
doctype html
html
head
meta name="viewport" content="width=device-width, initial-scale=1.0"
title= content_for?(:title) ? yield(:title) : "#VegasTech Bulletin Board"
meta name="author" content="#VegasTech Bulletin Board"
= stylesheet_link_tag "application", :media => "all"

link rel='apple-touch-icon-precomposed' href="#{asset_path('apple-touch-icon-57x57.png')}"
link rel='apple-touch-icon-precomposed' sizes="72x72" href="#{asset_path('apple-touch-icon-72x72.png') }"
link rel='apple-touch-icon-precomposed' sizes="114x114" href="#{asset_path('apple-touch-icon-114x114.png') }"
link rel="icon" type="image/png" href="#{asset_path('apple-touch-icon-114x114.png') }"

link(href='https://fonts.googleapis.com/css?family=Lato:100,200,300,400,700' rel='stylesheet' type='text/css')

=csrf_meta_tags

/[if lt IE 9]
script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"
= stylesheet_link_tag('application', media: 'all')

body
.container
.row
.offset1.span10.offset1
center
h1= link_to('#VegasTech Bulletin Board', root_url)

.navbar.navbar-fixed-top
.navbar-inner
.container
a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse"
span class="icon-bar"
span class="icon-bar"
span class="icon-bar"

a class="brand visible-phone" href="/">#VegasTech BB

.container.nav-collapse
ul.nav.pull-right
li= link_to "Current", root_url
li= link_to "Recent", recent_path
li= link_to "Events", tag_path('1')
li= link_to "Q&A", tag_path('2')
li= link_to "Advice", tag_path('3')
/ li= link_to "Photos", photos_path
li= link_to "Best of week", best_of_week_path
li= link_to "Jobs", "http://hirevegastech.com", target: 'new'
/ li.dropdown.visible-desktop
/ = link_to "Calendars", '#', :class => 'dropdown-toggle', "data-toggle" => "dropdown"
/ ul.dropdown-menu
/ li= link_to 'VegasTech.com Events Calendar', 'http://vegastech.com/events/', target: 'new'
/ li= link_to 'TBAN Events Calendar', 'https://www.tban.com/events/', target: 'new'
/ li= link_to 'Work In Progress Calendar', 'http://www.workinprogress.lv/event-calendar/', target: 'new'
li= link_to "Whining", tag_path('4')

li.dropdown.visible-desktop
= link_to "Coworking <b class='caret'></b>".html_safe, '#', :class => 'dropdown-toggle', "data-toggle" => "dropdown"
ul.dropdown-menu
li= link_to 'CoBiz Coworking', 'http://cobizcoworking.com/', target: 'new'
li= link_to 'The InNEVation Center', 'http://innevation.com/', target: 'new'
li= link_to 'Work In Progress', 'http://workinprogress.lv/', target: 'new'

li.dropdown.visible-desktop
= link_to("RSS <b class='caret'></b>".html_safe, '#', class: 'dropdown-toggle', 'data-toggle' => 'dropdown')
ul.dropdown-menu
li= link_to('Reaching 5 Points', rss_path(5), target: 'new')
li= link_to('Reaching 10 Points', rss_path(10), target: 'new')
li= link_to('Reaching 20 Points', rss_path(20), target: 'new')

li.hidden-desktop= link_to 'VegasTech.com Events Calendar', 'http://vegastech.com/events/', target: 'new'
li.hidden-desktop= link_to 'Work In Progress', 'http://workinprogress.lv/events/', target: 'new'
li.hidden-desktop= link_to 'TBAN Events Calendar', 'http://www.tban.us/calendar/', target: 'new'

- if logged_in?

li.dropdown.visible-desktop
= link_to "<i class='icon-user icon-white'></i> My Account <b class='caret'></b>".html_safe, '#', :class => 'dropdown-toggle', "data-toggle" => "dropdown"
ul.dropdown-menu

li= link_to(current_user.twitter_handle, '#')
li.divider
li= link_to "Sign out", "/sessions/destroy", method: 'delete'
- else
li= link_to(image_tag('bird_black_16_0.png', class: 'black_bird') + "Sign in", "/auth/twitter")

.container
.content
.row
.offset1.span10.offset1
- unless flash[:notice].blank?
.alert.alert-success.fade.in
a class="close" data-dismiss="alert" href="&times;"
h3= flash[:notice]

- if logged_in?
.alert.alert-info.hidden-desktop
center
= "Currently signed in as #{current_user.twitter_handle}"

= yield

.container
.row
.span12
.footer
p.logos
= link_to(image_tag(asset_path('lvrug_logo.png')), 'http://lvrug.org', target: '_blank')

p &copy; #{Date.today.year} - A Project by #{link_to('The Las Vegas Ruby User Group', 'http://lvrug.org', target: '_blank')} ( #{link_to('@LVRUG', 'http://twitter.com/lvrug', target: '_blank') }). Hosted at the #{link_to('Switch SuperNAP', 'http://www.switchlv.com', target: 'blank')}


/ Javascripts
/ ==================================================
/ Placed at the end of the document so the pages load faster
= javascript_include_tag('application')
= render 'shared/google_analytics'


Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
<div class="container">
<div class="row">
<div class="offset1 span10 offset1">
<h1><%= link_to('#VegasTech Bulletin Board', root_url) %></h1>

<div class="navbar">
<center>
<h1><%= link_to('#VegasTech Bulletin Board', root_url) %></h1>
</center>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
Expand All @@ -36,22 +37,23 @@

<div class="container nav-collapse">
<ul class="nav">
<li><%= link_to "Current", root_url %></li>
<li><%= link_to "Recent", recent_path %></li>
<li><%= link_to "Events", tag_path('1') %></li>
<li><%= link_to "Questions", tag_path('2') %></li>
<li><%= link_to "Q&A", tag_path('2') %></li>
<li><%= link_to "Advice", tag_path('3') %></li>
<li><%= link_to "Whining", tag_path('4') %></li>
<!-- <li><%= link_to "Photos", photos_path %></li> -->
<li><%= link_to "Recent", recent_path %></li>
<li><%= link_to "Best of week", best_of_week_path %></li>
<li><%= link_to "Jobs", "http://hirevegastech.com", target: 'new' %></li>
<!-- <li><%= link_to "Best of week", best_of_week_path %></li>
--> <li><%= link_to "Jobs", "http://hirevegastech.com", target: 'new' %></li>
<li class='dropdown visible-desktop'><%= link_to "Calendars", '#', :class => 'dropdown-toggle', "data-toggle" => "dropdown" %>
<ul class = 'dropdown-menu'>
<li><%= link_to 'VegasTech.com Events Calendar', 'http://vegastech.com/events/', target: 'new' %></li>
<li><%= link_to 'TBAN Events Calendar', 'https://www.tban.com/events/', target: 'new' %></li>
<li><%= link_to 'Work In Progress Calendar', 'http://www.workinprogress.lv/event-calendar/', target: 'new' %></li>
</ul>
</li>
<li class='dropdown visible-desktop'><%= link_to "Coworking", '#', :class => 'dropdown-toggle', "data-toggle" => "dropdown" %>
<li class='dropdown visible-desktop'><%= link_to "Coworking <b class='caret'></b>".html_safe, '#', :class => 'dropdown-toggle', "data-toggle" => "dropdown" %>
<ul class = 'dropdown-menu'>
<li><%= link_to 'CoBiz Coworking', 'http://cobizcoworking.com/', target: 'new' %></li>
<li><%= link_to 'The InNEVation Center', 'http://innevation.com/', target: 'new' %></li>
Expand Down
14 changes: 14 additions & 0 deletions app/views/shared/_google_analytics.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Beging Google Analytics Code -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33716623-1']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
2 changes: 1 addition & 1 deletion app/views/shared/_story_index.html.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1 What's happening in #VegasTech
h2 What's happening in #VegasTech

- @stories.each do |story|
= render partial: 'stories/story', :locals => { :story => story }
Expand Down
2 changes: 0 additions & 2 deletions app/views/stories/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@

.form-actions
= f.submit "Update", class: 'btn'

i.date-time
File renamed without changes.
61 changes: 61 additions & 0 deletions app/views/stories/_story.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.story data-id="#{story.id}" data-score="#{story.score}"
.row
.content
= image_tag(asset_path('pin.png'), class: 'left-pin visible-desktop')
= image_tag(asset_path('pin.png'), class: 'right-pin visible-desktop')
= image_tag(asset_path('pin.png'), class: 'center-pin hidden-desktop')

.span7
= auto_link(story.content, url_target: '_blank').html_safe
.metadata
a href="= link_from_handle(story.twitter_handle) " target="_blank"
image_tag story.twitter_profile_image_url

span.handle= link_to(story.twitter_handle, link_from_handle(story.twitter_handle), target: '_blank')
span.age
= link_to("#{time_ago_in_words(story.tweeted_at)} ago".html_safe, link_from_story(story), target: 'blank')

span.comments
= link_to("#{story.comments.size.to_i} Comments", story_path(story))

- if current_user && current_user.admin?
span.comments
= link_to("Add Tags", edit_story_path(story))

.span2
- if current_user && !current_user.voted_on?(story)
= link_to("<i class='icon-thumbs-up icon-white'></i>".html_safe, "#retweet-modal-#{story.twitter_id}", 'data-toggle' => 'modal', class: 'vote')
- elsif current_user && current_user.voted_on?(story)
.vote
i.icon-ok.icon-white
- else current_user
= link_to("<i class='icon-thumbs-up icon-white'></i>".html_safe, '/auth/twitter', class: 'vote')

.rank #{story.vote_count} points
.score #{story.score.to_f}

br.clear

.modal.hide id={'retweet-modal-' + story.twitter_id}
.modal-header
button type="button" class="close" data-dismiss="modal"
| ×
h3 Would you like to retweet this as well?

.modal-body
.story
.content
= auto_link(story.content, url_target: '_blank').html_safe
.metadata
a href="#{link_from_handle(story.twitter_handle)}" target="_blank"
= image_tag(story.twitter_profile_image_url)
span.handle
=link_to(story.twitter_handle, link_from_handle(story.twitter_handle), target: '_blank')
span.age
= link_to("#{time_ago_in_words(story.tweeted_at)} ago".html_safe, link_from_story(story), target: 'blank')

.modal-footer
= link_to('Just Vote', story_votes_path(story), 'data-dismiss' => 'modal', class: 'btn', method: 'post', remote: true)
= link_to("Vote &amp; Retweet <i class = 'icon-retweet'></i>".html_safe, story_votes_path(story, retweet: 1), 'data-dismiss' => 'modal', class: 'btn btn-inverse', method: 'post', remote: true)


0 comments on commit 6c10fcd

Please sign in to comment.