Skip to content

Commit

Permalink
Admin buttons and uniform header style for #138.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Huerta committed Aug 24, 2014
1 parent 53816fa commit fc685cb
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 79 deletions.
3 changes: 1 addition & 2 deletions app/views/admin/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
<div class="section">
<div class="container">
<h1>Admin ALL the Things</h1>
<p>Pay no attention to us behind the curtain.</p>
<br>
<ul>
<li><%= link_to 'Manage venues like a BOSS', venues_path %></li><br>
<li><%= link_to 'Manage participants like a BOSS', participants_path %></li><br>
<li><%= link_to 'Manage projects like a BOSS', projects_path %></li><br>
<li><%= link_to 'Manage events on main page with a special link which is visible only to organizers', events_path %></li><br>
<li><%= link_to 'Manage events on main page with a special link which is visible only to organizers', root_path %></li><br>
<li><%= link_to 'Organize the organizers (org level admin only)', organizers_path %></li><br>
</ul>
</div>
Expand Down
3 changes: 1 addition & 2 deletions app/views/events/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>Editing Event</h1>
Expand Down
25 changes: 10 additions & 15 deletions app/views/events/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div class="space"></div>
<div class="section" id="events-page">
<div class="container">
<ul id="events" class="sixteen columns">
Expand All @@ -14,20 +15,14 @@
<% end %>
</ul>
</div>
<br>
</div>
<!--
<div class="section">
<div class="container" id="contact">
<div class="sixteen columns">
To contact us about bringing Art Hack Day to your city or providing sponsorship, contact us at <b>arthackday at gmail dot com</b>.
</div>
</div>
</div> -->

<div class="section">
<% if organizer_signed_in? %>
<%= link_to 'New Event', new_event_path %>
<% end %>
</div>

<% if organizer_signed_in? %>
<div class="section">
<div class="container">
<div class="sixteen columns">
<%= link_to 'New Event', new_event_path, class: 'admin-button' %>
</div>
</div>
</div>
<% end %>
8 changes: 7 additions & 1 deletion app/views/events/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,13 @@
</div>

<% if organizer_signed_in? %>
<%= link_to 'Edit', edit_event_path(@event) %>
<div class="section">
<div class="container">
<div class="sixteen columns">
<%= link_to 'Edit', edit_event_path(@event), class: 'admin-button' %>
</div>
</div>
</div>
<% end %>

<script type="text/javascript"></script>
49 changes: 20 additions & 29 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,37 +52,28 @@
<div class="sixteen columns section-header">
<h4>Events _ most recent</h4>
</div>

<% if organizer_signed_in? %>
<div class="sixteen columns" style="margin-bottom:40px;">
<%= link_to 'New Event', new_event_path, class: 'admin-button' %>
</div>
<% end %>
<ul id="events" class="sixteen columns">
<% @events.each do |event| %>
<%= link_to(event) do %>

<li <%= event.upcoming? ? 'class=upcoming' : nil %>>
<div class="event-wrapper">
<div class="left-event"><h2><%= event.theme%></h2></div>
<div class="right-event">
<div class="event-page"><h4> <%= event.hackathon_start.strftime('%^B') %> <%= event.hackathon_start.strftime('%-d') %>-<%= event.hackathon_end.strftime('%-d') %>, <%= event.hackathon_start.strftime('%^Y') %></h4></div>
<div class="event-page-time"><h4><%= event.venue.nil? ? "TBA" : event.venue.city %>_<%= event.venue.nil? ? "TBA" : event.venue.name %></h4></div>
</div>
</div>

</li>
<% end %>
<% if organizer_signed_in? %>
<span><%= link_to 'Show', event %></span>
<span><%= link_to 'Edit', edit_event_path(event) %></span>
<br><br><br><br><br>
<% end %>
<%= link_to(event) do %>
<li <%= event.upcoming? ? 'class=upcoming' : nil %>>
<div class="event-wrapper">
<div class="left-event"><h2><%= event.theme %></h2></div>
<div class="right-event">
<div class="event-page"><h4> <%= event.hackathon_start.strftime('%^B') %> <%= event.hackathon_start.strftime('%-d') %>-<%= event.hackathon_end.strftime('%-d') %>, <%= event.hackathon_start.strftime('%^Y') %></h4></div>
<div class="event-page-time"><h4><%= event.venue.nil? ? "TBA" : event.venue.city %>_<%= event.venue.nil? ? "TBA" : event.venue.name %></h4></div>
</div>
</div>
</li>
<% end %>
<% if organizer_signed_in? %>
<%= link_to "Edit #{event.theme}", edit_event_path(event), class: 'admin-button' %>
<% end %>
<% end %>
</ul>
</div>
<br>
</div>

<!-- <div class="section">
<div class="container" id="contact">
<div class="sixteen columns">
To contact us about bringing Art Hack Day to your city or providing sponsorship, contact us at <b>arthackday at gmail dot com</b>.
</div>
</div>
</div> -->
</div>
10 changes: 9 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,16 @@
<% end %>
<% #= params[:controller].inspect %>
<% if params[:controller] === "projects" ||
params[:controller] === "participants" ||
params[:controller] === "projects" ||
params[:controller] === "venues" ||
params[:controller] === "organizers" ||
params[:controller] === "admin" ||
params[:controller] === "devise/sessions" ||
params[:controller] === "admin" %>
params[:controller] === "devise/confirmations" ||
params[:controller] === "devise/passwords" ||
params[:controller] === "devise/registrations" ||
params[:controller] === "devise/unlocks" %>
<% show_dark_text = true %>
<% end %>
<div class="nav-left">
Expand Down
3 changes: 1 addition & 2 deletions app/views/organizers/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>Editing organizer</h1>
Expand Down
3 changes: 1 addition & 2 deletions app/views/organizers/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>Listing organizers</h1>
Expand Down
3 changes: 1 addition & 2 deletions app/views/participants/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>Editing participant</h1>
Expand Down
3 changes: 1 addition & 2 deletions app/views/participants/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>Listing participants</h1>
Expand Down
3 changes: 1 addition & 2 deletions app/views/participants/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>New participant</h1>
Expand Down
3 changes: 1 addition & 2 deletions app/views/projects/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>Editing project</h1>
Expand Down
3 changes: 1 addition & 2 deletions app/views/projects/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container" id="projects-listing">
<h1>Listing projects</h1>
Expand Down
3 changes: 1 addition & 2 deletions app/views/projects/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>New project</h1>
Expand Down
7 changes: 3 additions & 4 deletions app/views/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<a><p>@captDaylight</p></a>
</div>
</div>-->
<% if organizer_signed_in? %>
<%= link_to 'Edit', edit_project_path(@project), class: 'admin-button' %>
<% end %>
</div>
<div class="two-thirds column" id="project-contents">
<!-- Photos using paperclip gem -->
Expand All @@ -68,9 +71,5 @@
<% end %>
</div>
</div>
<% if organizer_signed_in? %>
<%= link_to 'Edit', edit_project_path(@project) %>
<% end %>
</div>
<br>
</div>
3 changes: 1 addition & 2 deletions app/views/venues/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>Editing venue</h1>
Expand Down
3 changes: 1 addition & 2 deletions app/views/venues/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>Listing venues</h1>
Expand Down
3 changes: 1 addition & 2 deletions app/views/venues/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="admin-header">
</header>
<div class="space"></div>
<div class="section">
<div class="container">
<h1>New venue</h1>
Expand Down
27 changes: 24 additions & 3 deletions public/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
width: 100%;
text-align:center;
color: #fff;
background-color: #000;
background-image: url('/img/header_backgrounds/gibson.gif');
background-color:rgb(80, 0, 255);
/*background-image: url('/img/header_backgrounds/gibson.gif');
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-size: cover;*/
/*margin-top: -10px;*/
margin-bottom: 50px;
}
Expand Down Expand Up @@ -104,4 +104,25 @@

small {
font-size:12px;
}

/* Admin access buttons when logged in as an admin */
.admin-button, .admin-button:visited {
padding:10px 20px;
border-style:solid;
border-width:1px;
font-size:13px;
text-transform:uppercase;
border-color:rgb(255, 51, 51);
color:rgb(255, 51, 51);
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
-webkit-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}

.admin-button:hover {
background-color:rgb(255, 51, 51);
color:#FFF;
}

0 comments on commit fc685cb

Please sign in to comment.