mirror of https://github.com/E-Almqvist/hsf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
802 B
25 lines
802 B
3 years ago
|
.calc-wrapper
|
||
|
article.calculator
|
||
|
h1 Evil Calculator
|
||
|
|
||
|
.calc-equ-wrapper
|
||
|
form action="/calculate" method="post"
|
||
|
input type="number" name="number1" placeholder="Number #1"
|
||
|
select name="op"
|
||
|
option value="+" selected="selected" = "+"
|
||
|
option value="-" = "-"
|
||
|
option value="*" = "*"
|
||
|
option value="/" = "/"
|
||
|
input type="number" name="number2" placeholder="Number #2"
|
||
|
input type="submit" value="Calculate!"
|
||
|
label = "= #{session[:calc_result]}"
|
||
|
|
||
|
article.history
|
||
|
- if( session[:history] != nil ) then
|
||
|
h2 History
|
||
|
ul
|
||
|
- session[:history].reverse_each do |c|
|
||
|
li
|
||
|
p = "#{c[:number1]} #{c[:op]} #{c[:number2]} = #{c[:result]}"
|
||
|
|