Skip to content

add dismissable banner to link to Assembly #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ gem 'uglifier', '>= 1.0.3'
gem 'autoprefixer-rails'
gem 'jquery-rails', '= 2.0.3'
gem 'rails-assets-font-awesome'
gem 'rails-assets-jquery-cookie', '1.4.0'
gem 'rails-assets-jquery-dropdown'

# Two Client-side JS frameworks. Yep, first one to refactor out the other wins.
Expand Down
31 changes: 17 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
GIT
remote: git://github.com/emberjs/ember-rails.git
revision: 5e5a398f3c67c3a3b84b7513b93b22bf81055cc9
specs:
ember-rails (0.15.0)
active_model_serializers
barber (>= 0.4.1)
ember-data-source (>= 1.0.0.beta.5)
ember-source (>= 1.1.0)
execjs (>= 1.2)
handlebars-source (> 1.0.0)
jquery-rails (>= 1.0.17)
railties (>= 3.1)

GIT
remote: git://github.com/nixme/jazz_hands.git
revision: 5e4b48f145883ecb14b55bf04eacc28ac9662676
Expand All @@ -38,6 +24,20 @@ GIT
mime-types (>= 1.25, < 3.0)
rest-client (~> 1.4)

GIT
remote: git://github.com/emberjs/ember-rails.git
revision: 5e5a398f3c67c3a3b84b7513b93b22bf81055cc9
specs:
ember-rails (0.15.0)
active_model_serializers
barber (>= 0.4.1)
ember-data-source (>= 1.0.0.beta.5)
ember-source (>= 1.1.0)
execjs (>= 1.2)
handlebars-source (> 1.0.0)
jquery-rails (>= 1.0.17)
railties (>= 3.1)

GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
Expand Down Expand Up @@ -492,6 +492,8 @@ GEM
railties (= 3.2.19)
rails-assets-font-awesome (4.1.0)
rails-assets-jquery (1.8.3.1)
rails-assets-jquery-cookie (1.4.0)
rails-assets-jquery (>= 1.2)
rails-assets-jquery-dropdown (1.0.5)
rails-assets-jquery (~> 1.8.0)
rails-erd (1.1.0)
Expand Down Expand Up @@ -777,6 +779,7 @@ DEPENDENCIES
quiet_assets
rails (~> 3.2)
rails-assets-font-awesome
rails-assets-jquery-cookie (= 1.4.0)
rails-assets-jquery-dropdown
rails-erd
rails_12factor
Expand Down
16 changes: 16 additions & 0 deletions app/assets/javascripts/dismissable.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#= require jquery-cookie

$ ->
$('[data-dismissable]').each ->
$el = $(@)
key = "dismissed-#{$el.data('dismissable')}"

if $.cookie(key) == "true"
$el.hide()
else
$el.fadeIn()

$('.js-dismiss', $el).click (e)->
e.preventDefault()
$.cookie(key, "true")
$el.fadeOut()
7 changes: 4 additions & 3 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"normailze", "tipTip", "new-new-home", "error";

@import 'jquery-dropdown';
@import 'backgrounds';

.user-mosaic, .team-mosiac {
float: left;
Expand All @@ -22,7 +23,8 @@ body, input, submit, textarea, a, span {
}

.logo {
margin-top: 31px;
margin-top: 11px;
margin-bottom: 15px;
float: left;
width: 182px;
height: 27px;
Expand Down Expand Up @@ -101,7 +103,6 @@ h4 {
float: right;
li {
display: inline-block;
line-height: 100px;
margin-left: 30px;
&:first-child {
margin: 0px;
Expand Down Expand Up @@ -2042,4 +2043,4 @@ input[type=file].safari5-upload-hack {
line-height: 2em;
min-width: 70px
}
}
}
74 changes: 74 additions & 0 deletions app/assets/stylesheets/backgrounds.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Stolen from Bootsrap 3
.container:before, .container:after {
content: " ";
display: table;
}

.container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
width: 1170px;
}

.row {
margin-right: -15px;
margin-left: -15px;
}

.row:before, .row:after {
content: " ";
display: table;
}
.row:after {
clear: both;
}

.col-md-12 {
width: 100%;
float: left;
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
}

.bg-primary {
background-color: #428bca;
color: #fff;
}

.text-center {
text-align: center;
}

.announcement {
.asm-brand {
opacity: 0.3;
width: 30px;
height: 26px;
position: absolute;
margin-left: -36px;
margin-top: 6px;
}

.close {
opacity: 0.4;
&:hover {
opacity: 1.0;
}
text-decoration: none;

padding-left: 15px;
}

p {
line-height: 40px;

a {
color: #fff;
text-decoration: underline;
}
}
}
1 change: 1 addition & 0 deletions app/views/application/_nav_bar.slim
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ header#masthead
li = link_to(t('sign_in'), signin_path, class: signin_nav_class)
li = link_to(t('register'), signin_path, class: signup_nav_class)

= render partial: 'shared/assembly_banner'
18 changes: 18 additions & 0 deletions app/views/shared/_assembly_banner.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div class="bg-primary" data-dismissable="announcement" style="display:none">
<div class="container">
<div class="row">
<div class="announcement col-md-12">
<p class="text-center">
<img src="https://treasure.assembly.com/assets/brand/inverse@2x.png" class="asm-brand">
Coderwall is an open project on Assembly so now you can help build it!
<a href="https://assembly.com/coderwall/chat"> Jump in and get started.</a>
<a class="js-dismiss close" href="#close">x</a>
</p>
</div>
</div>
</div>
</div>

<% content_for :javascript do %>
<%= javascript_include_tag 'dismissable' %>
<% end %>