Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
Home page updates
Browse files Browse the repository at this point in the history
* Do not show welcome message to logged in user (Only for Guests)
* Update styles of welcome msg to make it more compact
* Remove upper margin from flash message

#582
  • Loading branch information
jessieay committed Jun 3, 2016
1 parent aa5a61c commit ccf7ea8
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 28 deletions.
8 changes: 2 additions & 6 deletions app/assets/stylesheets/_uswds-overrides.scss
Expand Up @@ -2,12 +2,8 @@
* so a little loving help below:
* */

.usa-font-lead p {
font-size: $base-font-size;

@include media($small-screen) {
font-size: $lead-font-size;
}
.usa-alert {
margin: 0;
}

.usa-button.usa-button-green,
Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/blocks/_header.scss
Expand Up @@ -64,7 +64,6 @@ nav.usa-site-navbar a {

@include media($small-screen) {
font-size: 3rem;

}
}

Expand All @@ -84,7 +83,6 @@ nav.usa-site-navbar a {
width: 100%;
}


.header-row {
display: table-row;
width: 100%;
Expand Down
8 changes: 3 additions & 5 deletions app/assets/stylesheets/blocks/_intro.scss
@@ -1,10 +1,8 @@
// Todo: determine if this can be removed

.intro-text {
margin-top: 0;
}

.intro {
background: #222;
padding: 40px 40px;
.usa-font-lead p {
margin: 0.5rem;
font-size: $base-font-size;
}
1 change: 0 additions & 1 deletion app/assets/stylesheets/blocks/_previous-winners.scss
Expand Up @@ -120,7 +120,6 @@
}
}


.winners-list-item .issue-bids-info-item {
float: right;
margin-right: 0;
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/auctions_controller.rb
Expand Up @@ -7,7 +7,7 @@ def index

respond_to do |format|
format.html do
sam_status_message_for(flash)
@auctions.sam_status_message_for(flash)
end
format.json do
render json: published_auctions, each_serializer: AuctionSerializer
Expand Down Expand Up @@ -36,8 +36,4 @@ def previous_winners
def published_auctions
@_published_auctions ||= AuctionQuery.new.public_index
end

def sam_status_message_for(flash)
current_user.decorate.sam_status_message_for_auctions_index(flash)
end
end
4 changes: 4 additions & 0 deletions app/presenters/guest_presenter.rb
Expand Up @@ -18,4 +18,8 @@ def win_header_partial
def nav_drawer_submenu_partial
"components/guest_nav_drawer_submenu"
end

def welcome_message_partial
'components/welcome_message'
end
end
4 changes: 4 additions & 0 deletions app/presenters/user_presenter.rb
Expand Up @@ -31,6 +31,10 @@ def nav_drawer_submenu_partial
"components/user_nav_drawer_submenu"
end

def welcome_message_partial
'components/null'
end

def small_business_label
if model.sam_accepted?
small_business? ? 'Yes' : 'No'
Expand Down
8 changes: 8 additions & 0 deletions app/view_models/auctions_index_view_model.rb
Expand Up @@ -20,6 +20,14 @@ def auction_view_models
end
end

def sam_status_message_for(flash)
current_user.decorate.sam_status_message_for_auctions_index(flash)
end

def welcome_message_partial
current_user.decorate.welcome_message_partial
end

def auctions_list_partial
if auctions.empty?
'empty_auctions'
Expand Down
10 changes: 1 addition & 9 deletions app/views/auctions/index.html.erb
Expand Up @@ -5,15 +5,7 @@
<meta name="twitter:data2" value="<%= @auctions.upcoming_auction_count %>">
<% end %>
<section class="slab-intro usa-width-full">
<div class="usa-grid">
<h1 class="intro-text">Welcome!</h1>
<div class="usa-font-lead">
<p>The Micro-purchase Marketplace is the place to bid on open-source issues from the 18F team. <a class="link-highlighted" href="https://18f.gsa.gov/2015/11/06/micro-purchase-lessons/">Learn more about this experiment <icon class="fa fa-angle-double-right"></icon></a></p>
<p>Be sure to <a class="link-highlighted" href="<%= login_path %>">register your company</a> before placing a bid. If you have any questions, please email us at <a class="link-highlighted" href="mailto:micropurchase@gsa.gov">micropurchase@gsa.gov</a>.</p>
</div>
</div>
</section>
<%= render partial: @auctions.welcome_message_partial %>

<section class="usa-grid">
<h2>Auctions</h2>
Expand Down
22 changes: 22 additions & 0 deletions app/views/components/_welcome_message.html.erb
@@ -0,0 +1,22 @@
<section class="slab-intro usa-width-full">
<div class="usa-grid">
<h1 class="intro-text">Welcome!</h1>
<div class="usa-font-lead">
<p>
The Micro-purchase Marketplace is the place to bid on open-source issues
from the 18F team.
<%= link_to 'Learn more about this experiment <icon class="fa fa-angle-double-right">'.html_safe,
"https://18f.gsa.gov/2015/11/06/micro-purchase-lessons/" ,
target: '_blank' %>
</p>

<p>
Be sure to
<%= link_to 'register your company', login_path %>
before placing a bid. If you have any questions, please email us at
<%= mail_to 'micropurchase@gsa.gov' %>.
</p>
</div>
</div>
</section>

0 comments on commit ccf7ea8

Please sign in to comment.