22adb4d5fd
The primary license of the project is changing to: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later with some specific files to be licensed under the one of two licenses: CC0-1.0 LGPL-3.0-or-later This commit is one of the many steps to relicense the entire codebase. Documentation granting permission for this relicensing (from all past contributors who hold copyrights) is on file with Software Freedom Conservancy, Inc.
15 lines
690 B
Text
15 lines
690 B
Text
<%- # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later -%>
|
|
<%# use like this: render 'components/radio', label: 'Banana chips', name: 'fave_snacks' %>
|
|
<%# you can pass in an optional key for 'def'ing values to it %>
|
|
<%# if you have a set of radios, consider using components/_radio_set %>
|
|
|
|
<% value = label.downcase.tr(" ", "_") %>
|
|
<% id = "radio_#{name}_#{value}" %>
|
|
<% change ||= false %>
|
|
<% key ? change = "(def '#{key}' '#{value}')" : key = false %>
|
|
|
|
<input type="radio" id="<%= id %>" name="<%= name %>" value="<%= value %>">
|
|
<% if change %>
|
|
<!--= on 'change' <%= change.html_safe %> -->
|
|
<% end %>
|
|
<label for="<%= id %>"><%= label %></label>
|