Skip to content
Open
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
11 changes: 11 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ def sortable(column, title=nil)
direction = (column == sort_column or join_column == sort_column) && sort_direction == "asc" ? "desc" : "asc"
link_to title, params.permit!.merge({:sort => column, :direction => direction}), {:class => css_class}
end

def title
if content_for?(:title)
# allows the title to be set in the view by using t(".title")
content_for :title
else
# look up translation key based on controller path, action name and .title
# this works identical to the built-in lazy lookup
t("#{ controller_path.tr('/', '.') }.#{ action_name }.title", default: :site_name)
end
end
end
5 changes: 2 additions & 3 deletions app/views/check_ins/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to new_network_event_path, class: 'btn btn-primary' do %>
<span class="glyphicon glyphicon-plus"></span>
New Event
<% end %>
<h1>Listing events</h1>
</div>
<% end %>


<div class="table-responsive">
Expand Down
5 changes: 2 additions & 3 deletions app/views/check_ins/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div class="page-header">
<h1>Member Check In</h1>
<% content_for :page_header do %>
<%= hidden_field_tag "network_event_id", @network_event_id %>
<%= hidden_field_tag "level", @level %>
<%= hidden_field_tag "participation_type", 'checked_in' %>
</div>
<% end %>

<div class="table-responsive">
<table class="check-in-table table table-striped table-bordered table-hover">
Expand Down
5 changes: 2 additions & 3 deletions app/views/cohorts/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to cohorts_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,7 +7,6 @@
<span class="glyphicon glyphicon-info-sign"></span>
Show
<% end %>
<h1>Editing cohort</h1>
</div>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/cohorts/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to new_cohort_path, class: 'btn btn-primary' do %>
<span class="glyphicon glyphicon-plus"></span>
New Cohort
<% end %>
<h1>Listing cohorts</h1>
</div>
<% end %>

<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
Expand Down
5 changes: 2 additions & 3 deletions app/views/cohorts/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to cohorts_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
<% end %>
<h1>New cohort</h1>
</div>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/cohorts/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to cohorts_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,8 +7,7 @@
<span class="glyphicon glyphicon-pencil"></span>
Edit
<% end %>
<h1>Show cohort</h1>
</div>
<% end %>

<dl class="dl-horizontal text-left">
<dt>Name:</dt>
Expand Down
5 changes: 2 additions & 3 deletions app/views/common_tasks/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to common_tasks_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,7 +7,6 @@
<span class="glyphicon glyphicon-info-sign"></span>
Show
<% end %>
<h1>Editing common task</h1>
</div>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/common_tasks/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to new_common_task_path, class: 'btn btn-primary' do %>
<span class="glyphicon glyphicon-plus"></span>
New Common task
<% end %>
<h1>Listing common tasks</h1>
</div>
<% end %>

<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
Expand Down
5 changes: 2 additions & 3 deletions app/views/common_tasks/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to common_tasks_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
<% end %>
<h1>New common task</h1>
</div>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/common_tasks/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to common_tasks_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,8 +7,7 @@
<span class="glyphicon glyphicon-pencil"></span>
Edit
<% end %>
<h1>Show common tasks</h1>
</div>
<% end %>

<dl class="dl-horizontal">
<dt>Name:</dt>
Expand Down
5 changes: 2 additions & 3 deletions app/views/communications/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to members_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,7 +7,6 @@
<span class="glyphicon glyphicon-info-sign"></span>
Show
<% end %>
<h1>Editing communication</h1>
</div>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/communications/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to new_member_communication_path, class: 'btn btn-primary' do %>
<span class="glyphicon glyphicon-plus"></span>
New Communication
<% end %>
<h1>Listing communications</h1>
</div>
<% end %>

<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
Expand Down
7 changes: 3 additions & 4 deletions app/views/communications/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to member_path(@member), class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
<% end %>
<h1><%= @member.name %></h1>
<h1>New communication</h1>
</div>
<%= content_for :title, t(".title", name: @member.name) %>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/communications/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to member_path(@member), class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,8 +7,7 @@
<span class="glyphicon glyphicon-pencil"></span>
Edit
<% end %>
<h1>Show communication</h1>
</div>
<% end %>

<dl class="dl-horizontal">
<dt>Date:</dt>
Expand Down
5 changes: 2 additions & 3 deletions app/views/extracurricular_activities/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to extracurricular_activities_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,7 +7,6 @@
<span class="glyphicon glyphicon-info-sign"></span>
Show
<% end %>
<h1>Editing extracurricular activity</h1>
</div>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/extracurricular_activities/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to new_extracurricular_activity_path, class: 'btn btn-primary' do %>
<span class="glyphicon glyphicon-plus"></span>
New Extracurricular activity
<% end %>
<h1>Listing extracurricular activities</h1>
</div>
<% end %>

<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
Expand Down
5 changes: 2 additions & 3 deletions app/views/extracurricular_activities/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to extracurricular_activities_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
<% end %>
<h1>New extracurricular activity</h1>
</div>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/extracurricular_activities/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to extracurricular_activities_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,8 +7,7 @@
<span class="glyphicon glyphicon-pencil"></span>
Edit
<% end %>
<h1>Show extracurricular activity</h1>
</div>
<% end %>

<dl class="dl-horizontal">
<dt>Name:</dt>
Expand Down
5 changes: 2 additions & 3 deletions app/views/graduating_classes/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to graduating_classes_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,7 +7,6 @@
<span class="glyphicon glyphicon-info-sign"></span>
Show
<% end %>
<h1>Editing graduating class</h1>
</div>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/graduating_classes/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to new_graduating_class_path, class: 'btn btn-primary' do %>
<span class="glyphicon glyphicon-plus"></span>
New Graduating Class
<% end %>
<h1>Listing graduating classes</h1>
</div>
<% end %>

<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
Expand Down
5 changes: 2 additions & 3 deletions app/views/graduating_classes/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to graduating_classes_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,8 +7,7 @@
<span class="glyphicon glyphicon-pencil"></span>
Edit
<% end %>
<h1>Show graduating class</h1>
</div>
<% end %>

<dl class="dl-horizontal text-left">
<dt>Year:</dt>
Expand Down
5 changes: 2 additions & 3 deletions app/views/identities/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to identities_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,7 +7,6 @@
<span class="glyphicon glyphicon-info-sign"></span>
Show
<% end %>
<h1>Editing identity</h1>
</div>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/identities/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to new_identity_path, class: 'btn btn-primary' do %>
<span class="glyphicon glyphicon-plus"></span>
New Identity
<% end %>
<h1>Listing identities</h1>
</div>
<% end %>

<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
Expand Down
5 changes: 2 additions & 3 deletions app/views/identities/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to identities_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
<% end %>
<h1>New identity</h1>
</div>
<% end %>

<%= render 'form' %>
5 changes: 2 additions & 3 deletions app/views/identities/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to identities_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,8 +7,7 @@
<span class="glyphicon glyphicon-pencil"></span>
Edit
<% end %>
<h1>Show identity</h1>
</div>
<% end %>

<dl class="dl-horizontal">
<dt>Name:</dt>
Expand Down
6 changes: 6 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
<div class="container">

<div class="network-template">
<% if content_for? :page_header %>
<div class="page-header">
<%= yield :page_header %>
<h1><%= title %></h1>
</div>
<% end %>
<%= yield %>
</div>

Expand Down
5 changes: 2 additions & 3 deletions app/views/locations/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-header">
<% content_for :page_header do %>
<%= link_to locations_path, class: 'btn btn-default' do %>
<span class="glyphicon glyphicon-list-alt"></span>
Back
Expand All @@ -7,7 +7,6 @@
<span class="glyphicon glyphicon-info-sign"></span>
Show
<% end %>
<h1>Editing location</h1>
</div>
<% end %>

<%= render 'form' %>
Loading