Report abuse

poll template, renders both form and results


			

Anketa

<%= escape(poll['title']) %>

    <% foreach(poll['options'] as $option): %>
  • <% if(poll['results']): $ratio = round($option['votes'] / poll['votes_total'] *100); $ratio_display = round($option['votes'] / poll['votes_max'] *100); %> <%= $option['label'] %>: <%= $ratio %>% <% else: %> <% endif %>
  • <% endforeach %>

<% if(!poll['results']): %> <% else: %>Ukupno glasova: <%= poll['votes_total'] %> <% endif %>

styles (css)


			
form.poll {
	margin:20px 7px 0 24px;
	padding:0 6px 2px 6px;
	font-size:90%;
	background:white url(bgr-anketa.png) no-repeat bottom;
	}
form.poll h2 { color:white;
	background:transparent url(bgr-anketa-top.png) no-repeat top;
	padding:0.3em 6px;
	margin:0 -6px 0.2em -6px;
	font-size:1.2em;
	}
form.poll ul { margin:0.6em 0; }
form.poll span.result {
	display:block; margin:0.1em 0 0.2em 0;
	background:#DDD;
}
form.poll span.result span {
	display:block;
	height:3px; background:#487852;
	border-top:2px solid #789B7F;
}