Skip to content

Instantly share code, notes, and snippets.

@mega1meyers
Created February 21, 2019 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mega1meyers/dd45845a39ec7a821a509f408ebd7faa to your computer and use it in GitHub Desktop.
Save mega1meyers/dd45845a39ec7a821a509f408ebd7faa to your computer and use it in GitHub Desktop.
An Agenda document in Ruby ERB
<!DOCTYPE html>
<html>
<head>
<META HTTP-EQUIV=“Content-Type” CONTENT=“text/html; charset="UTF-8">
<style>
body {
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
line-height: 20px;
margin: .25in;
font-size: 14px;
}
td {
/*page-break-inside: avoid;*/
}
table, figure {
margin: 0px 0;
border: none;
border-collapse: collapse;
table-layout: fixed;
width: 100%; /* must have this set */
}
/* div{page-break-inside: avoid;} */
.page-break {
display:block;
clear:both;
page-break-after:always;
page-break-inside: avoid;
}
.container{
margin:0px auto;
/* border: red solid 2px; <-- for troubleshooting */
}
.sectionTitleNumber{
width: 35px;
vertical-align: top;
text-align: left;
font-weight: bold;
}
.underline{
text-decoration: underline;
}
.sectionTitleText{
}
.itemNumber{
width: 47px;
vertical-align: top;
text-align: left;
}
.itemText{
text-align: justify;
}
.attachment{text-align: left;}
.attachment a{
font-weight: normal;
text-decoration: none;
}
.h2{
font-size: 20pt;
text-align: center;
}
.meetingInfo{
text-align: center;
}
.indent{
margin-left: 30px;
}
.stdText{
text-decoration: none !important;
page-break-inside: avoid;
text-align: justify;
}
.stdTxtindent{
margin-left:75px
}
.custField{
}
.header{
font-weight: bold;
font-size: 14pt;
}
.center{
text-align: center;
}
.footer{
border: solid 2px black;
font-size:8pt;
padding:15px;
line-height:14px;
page-break-inside: avoid;
}
.footer a{
color:#000;
}
.footer th{
font-weight: normal;
}
.notice{
text-align:center;
margin-bottom:-10px;
}
.notice span{
font-weight:bold;
font-size:9pt;
margin-bottom:0px;
}
.itemRow {
/*page-break-inside: avoid;*/
/* margin-top: 5px; */
}
</style>
</head>
<body>
<br>
<br>
<table class="header">
<tbody>
<tr style="border-bottom: 4px solid black;">
<td valign="bottom" style="padding-bottom: 6px;">
Agenda
</td>
<td valign="bottom" style="text-align:right;padding-bottom: 15px;">
<img width="155px" src=<%= @data.site_info.logo.url %> alt="Meeting logo">
</td>
</tr>
<tr>
<td valign="top">
<% if @data.meeting.description != "" %>
<% @data.meeting.description.split("\n").each do |descript| %>
<%= descript %><br>
<% end %>
<% else %>
Arlington <%= @data.meeting.name %><br>
<%= @data.meeting_type.title %>
<% end %>
</td>
<td valign="top" style="text-align:right;">
Council Briefing Room<br>
101 W. Abram Street<br>
3rd Floor
</td>
</tr>
</tbody>
</table>
<div class="header center">
<%= Date.parse(@data.meeting.starttime).strftime("%A, %B %e, %Y") %><br>
<%= Time.parse(@data.meeting.starttime).strftime("%l:%M %p") %>
<br><br>
</div>
<table>
<tr>
<td class="sectionTitleNumber"></td>
<td class="sectionTitleText"></td>
</tr>
<% @data.agenda.item.each do |section| %>
<tr>
<% if (section.custom_agenda_number && section.custom_agenda_number != "") || (section.number && section.number != "") %>
<td class="sectionTitleNumber">
<strong>
<% if @data.custom_agenda_numbering %>
<%= section.custom_agenda_number %>.
<% else section.number %>
<%= section.number %>.
<% end %>
</strong>
</td>
<% end %>
<% if (section.custom_agenda_number && section.custom_agenda_number != "") || (section.number && section.number != "") %>
<td class="sectionTitleText">
<% else %>
<td class="sectionTitleText" colspan="2">
<% end %>
<span class="underline"><strong><%= section.title %></strong></span>
<% if section.standard_text && section.standard_text != "" %>
<% section.standard_text.split("\n").each do |stdtext| %>
<div class="stdText">
<%= stdtext %>
</div>
<% end %>
<% end %>
<div><br></div>
<% if section.item1 && !section.item1.empty? %>
<% section.item1. each do |item| %>
<table>
<tr class="itemRow">
<!-- <div class="itemDiv"> -->
<td class="itemNumber">
<strong>
<%= @data.custom_agenda_numbering ? item.agenda_section_items1[0].custom_agenda_number : item.number1 %>
</strong>
</td>
<!--
<% if (item.agenda_section_items1[0].custom_agenda_number && item.agenda_section_items1[0].custom_agenda_number != "") || (item.number1 && item.number1 != "") %>
<td class="itemNumber">
<strong>
<%= @data.custom_agenda_numbering ? item.agenda_section_items1[0].custom_agenda_number : item.number1 %>
</strong>
</td>
<% end %>-->
<!-- <% if (item.agenda_section_items1[0].custom_agenda_number && item.agenda_section_items1[0].custom_agenda_number != "") || (item.number1 && item.number1 != "") %>
<td class="itemText">
<% else %>
<td colspan="2" class="itemText">
<% end %> -->
<td class="itemText">
<%= item.title1 %>
<% if item.attachments1.empty? %>
<!-- <div><br></div> -->
<% end %>
<!--
<% if item.suggested_action1 && item.suggested_action1 !="" %>
<strong>Suggested Action: </strong> <%= item.suggested_action1 %>
<% end %>
custom fields
<% custom_fields = item.custom_fields1.marshal_dump if !item.custom_fields1.empty? %>
<% if custom_fields && (!custom_fields.nil? || !custom_fields.empty?) %>
<% if !custom_fields.values.all? {|val| val == "" } %>
<% custom_fields.each do |field, value| %>
<% if value && value != "" %>
<br> <span class="custField"><strong><%= field %>:</strong></span> <%= value %>
<% end %>
<% end %>
<br>
<% end %>
<% end %>
custom fields-->
<!--attachments -->
<% if item.attachments1 %>
<% item.attachments1.each do |attachment| %>
<div class="attachment">
<a href=<%= "#{attachment.url}" %>><%= attachment.name%></a>
</div>
<% end %>
<% end %>
<div title="space after item loop" ><br></div>
</td>
<!-- </div> -->
</tr>
</table>
<% end %> <!-- closing section.item1 each -->
<% end %> <!-- closing section.item if -->
</td>
</tr>
<% end %><!-- closing section loop -->
</table>
<div class="footer">
<div class="notice"><span>NOTICE</span></div>
<ul>
<li>The Arlington City Hall is wheelchair accessible. For accommodations or sign interpretive services, please call 817-459-6100 no later than 24 hours in advance.</li>
<li>Council meetings are broadcast live on Arlington’s Government Channel and rebroadcast throughout the week at the following times:</li>
</ul>
<table class="center">
<thead>
<tr>
<th></th>
<th>Afternoon meetings</th>
<th>Evening Meetings</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sunday</td>
<td>1:00 p.m.</td>
<td>6:00 p.m.</td>
</tr>
<tr>
<td>Wednesday</td>
<td>1:30 p.m.</td>
<td>6:30 a.m.</td>
</tr>
<tr>
<td>Saturday</td>
<td>6:00 p.m.</td>
<td>6:30 a.m.</td>
</tr>
</tbody>
</table>
<ul>
<li>The Council agenda can be viewed on the City’s website at <a href="http://www.arlington-tx.gov/" target="_blank">www.Arlingtontx.gov</a></li>
<li>For a complete Arlington Government Channel program schedule, please visit <a href="http://www.Arlingtontx.gov/broadcast" target="_blank">www.Arlingtontx.gov/broadcast</a></li>
</ul>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment