Sha256: f6f14c4d2b0b7db3e8f6993d05fb89a0ee2c403bb0f9166cd8031f29cb101708

Contents?: true

Size: 1.78 KB

Versions: 6

Compression:

Stored size: 1.78 KB

Contents

<!doctype html>
<html>
  <head>
    <title>Ruby Pinyin CGIForm example</title>
    <style type='text/css'>
      body {
        font-family: sans-serif;
      }

      div#wrap {
        width: 40%;
        margin: 0 auto;
      }

      table {
        width: 100%;
      }      
      div#converted_text {
        border: 1px dotted #000;
      }

      textarea {
	width: 100%;
	height: 10em;
	margin: 0 auto;
      }
    </style>
  </head>
  <body>
    <div id='wrap'> 
    <h2>Pinyin example application</h2>	
    <h3>Enter some pinyin text and choose your format</h3>	
    <table>
      <form method='post'>
        <tr>
          <td colspan='2'>
            <textarea name='pinyin'><%=params['pinyin'].first if params['pinyin'] != []%></textarea>
          </td>
        </tr>

        <tr><td>From</td><td>To</td></tr>
        <% Pinyin::Conversions::All.each do |f|%>
          <tr>
            <td><input type='radio' name='from' value='<%=f%>'><%=f.capitalize%></input></td>
            <td><input type='radio' name='to' value='<%=f%>'><%=f.capitalize%></input></td>
          </tr>
        <% end %>
        <tr><td>From tone</td><td>To tone</td></tr>
        <% Pinyin::Tones::All.each do |f|%>
          <tr>
            <td><input type='radio' name='from_tone' value='<%=f%>'><%=f.capitalize%></input></td>
            <td><input type='radio' name='to_tone' value='<%=f%>'><%=f.capitalize%></input></td>
          </tr>
        <% end %>
        <tr>
          <td><input type='submit'></input></td>
          <td>&nbsp;</td>
        </tr>
      </form>
    </table>
    <% if @converted %>
      <h2>Converted:</h2>
      <div id='converted_text'>
        <%= @converted %>
      </div>
    <% end %>  
    </div>
  </body>
</html>

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
arnebrasseur-pinyin-0.1.5 examples/cgiform/template.rhtml
ting-0.3.0 examples/cgiform/template.rhtml
ting-0.2.1 examples/cgiform/template.rhtml
ting-0.2.0 examples/cgiform/template.rhtml
pinyin-0.0.1 examples/cgiform/template.rhtml
pinyin-0.1.4 examples/cgiform/template.rhtml