Commit 2bbad4c7 authored by Michael Raskin's avatar Michael Raskin

Syncing from Monotone at 20190819-024843. Last commit message was new design. final

parent 64f6766d
......@@ -36,7 +36,7 @@
(defparameter *html-spoilers*
'(
"<span style='display:none'>[это не должно быть видно this should be hidden]</span>"
"<span hidden>[ this should be hidden это не должно быть видно ]</span>"
"<span hidden style='display:none'>[ this should be hidden это не должно быть видно ]</span>"
"<!-- -= > 2+3 -->"
)
)
......@@ -47,7 +47,7 @@
(spoiler (random-of *html-spoilers*))
)
(if (listp expr)
(format nil "<~a>~a (<~a>~A</~a> ~A ~A<~a>)"
(format nil "<~a>~a(<~a>~A</~a> ~A ~A</~a>)"
modifier
spoiler
modifier
......
......@@ -961,6 +961,10 @@
(defun field-extra-render-env (obj field)
(declare (ignorable obj))
(case (-> field :html-input-type)
((:checkbox)
`(
:display-name ,(-> field :display-name)
))
((:raw-output :raw-output-required)
`(
:content ,(-> field :content)
......@@ -988,6 +992,19 @@
:br
,(-> field :br)
))
((:radiobutton-multy)
`(:options
,(iter (for x in (multifuncall (-> field :options)))
(for xl := (if (listp x) x (list x x)))
(collect
`(
:code-name ,(first xl)
:display-name ,(second xl)
:html-attributes ,(-> field :html-attributes)
)))
:br
,(-> field :br)
))
((:file)
`(
:hide-file-value ,(-> field :hide-file-value)
......
<input type="checkbox" name="<% @var html-name %>" <% @if value %>checked="checked"<% @endif %>
<% @loop html-attributes %><% @var name %>="<% @var value %>"<% @endloop %> />
<input type="checkbox" name="<% @var html-name %>" id="<% @var html-name %>"
<% (if (equal (emb-env :value) "да") (progn %>checked="checked"<% )) %>
<% @loop html-attributes %><% @var name %>="<% @var value %>"<% @endloop %> /><label for="<% @var html-name %>" id="field_<% @var html-name %>" ><% @var extra-data/display-name -escape raw %></label>
<input type="text"
name="<% @var html-name %>"
class="tcal"
placeholder="0000-00-00"
class="datepickerTimeField"
id="field_<% @var html-name %>"
placeholder="ГГГГ-ММ-ДД"
value="<% @var value -escape html %>"
pattern="^[0-9]{4}-0[1-9]-[0-2][0-9]$|^[0-9]{4}-0[1,3-9]-3[0-1]$|^[0-9]{4}-1[0-2]-[0-2][0-9]$|^[0-9]{4}-1[0-2]-3[0-1]$"
onblur="this.placeholder='0000-00-00'"
onblur="this.placeholder='ГГГГ-ММ-ДД'"
<% @loop html-attributes %>
<% @var name %>="<% @var value %>"
<% @endloop %>
......
<div class="input_div download" id="field_<% @var html-name %>">
<input type="file" name="<% @var html-name %>" value="<% @var value -escape html %>"
<% @loop html-attributes %><% @var name %>="<% @var value %>"<% @endloop %> />
<% @if extra-data/hide-file-value %><% @ifnotempty value %>(загружен)<% @else %>(нет)<% @endif %><% @else %><% @ifnotempty value %>(<% @var value %>)<% @endif %><% @endunless %>
<span><% @if extra-data/hide-file-value %><% @ifnotempty value %>(загружен)<% @else %>(нет)<% @endif %><% @else %><% @ifnotempty value %>(<% @var value %>)<% @endif %><% @endif %>
</span></div>
<input type="hidden" name="<% @var html-name %>" value="<% @var value -escape html %>" />
<input type="hidden" name="<% @var html-name %>" id="field_<% @var html-name %>" value="<% @var value -escape html %>" />
<input type="text"
name="<% @var html-name %>"
id="field_<% @var html-name %>"
class="bfh-phone"
value="<% @var value -escape html %>"
<% @loop html-attributes %>
......
<input type="password" name="<% @var html-name %>" value="<% @var value -escape html %>"
<input type="password" name="<% @var html-name %>" value="<% @var value -escape html %>" id="field_<% @var html-name %>"
<% @loop html-attributes %><% @var name %>="<% @var value %>"<% @endloop %> />
<input type="text"
name="<% @var html-name %>"
id="field_<% @var html-name %>"
class="bfh-phone"
value="<% @var value -escape html %>"
onfocus="{if (this.value == '') {this.value = '8 (';}; this.placeholder='';}"
......
<% @set escape=html %>
<% (let ((value (emb-env :value)) (name (emb-env :html-name))
(br (emb-env-path :extra-data/br))) %>
<div class="input_div" id="field_<%= name %>">
<% @loop extra-data/options %>
<input name="<%= name %>" value="<% @var code-name -escape html %>"
<% (if (equal (format nil "~a" (emb-env :code-name)) (format nil "~a" value)) %>checked="checked" selected="selected"<% ) %>
<% @loop html-attributes %><% @var name %>="<% @var value %>"<% @endloop %>
type="radio" id="multy_<%= (if (equal "м" (emb-env :code-name)) "m" "f" ) %>"><label for="multy_<%= (if (equal "м" (emb-env :code-name)) "m" "f" ) %>"><% @if /entries-literal %><% @var display-name -escape raw %><% @else %><% @var display-name -escape html %><% @endif %></label>
<% @endloop %>
<div style="clear:both"></div>
</div>
<% ) %>
......@@ -2,12 +2,15 @@
<% (let ((value (emb-env :value)) (name (emb-env :html-name))
(br (emb-env-path :extra-data/br))) %>
<div class="input_div" id="field_<%= name %>">
<% @loop extra-data/options %>
<span class="radiobutton-option-span-<%= (format nil "~a" name) %>"><input
type="radio" name="<%= name %>" value="<% @var code-name -escape html %>"
<input type="radio" name="<%= name %>" value="<% @var code-name -escape html %>"
id="field_<% @var code-name -escape html %>"
<% (if (equal (format nil "~a" (emb-env :code-name)) (format nil "~a" value)) %>checked="checked" selected="selected"<% ) %>
<% @loop html-attributes %><% @var name %>="<% @var value %>"<% @endloop %> />
<% @if /entries-literal %><% @var display-name -escape raw %><% @else %><% @var display-name -escape html %><% @endif %> <span style="width: 1em;"> </span></span>
<label for="field_<% @var code-name -escape html %>">
<% @if /entries-literal %><% @var display-name -escape raw %><% @else %><% @var display-name -escape html %><% @endif %></label>
<% (when br %><br /><% ) %>
<% @endloop %>
</div>
<% ) %>
<input type="hidden" name="<% @var html-name %>" value="<% @var value -escape html %>" />
<input type="hidden" name="<% @var html-name %>" id="field_<% @var html-name %>" value="<% @var value -escape html %>" />
<span <% @loop html-attributes %><% @var name %>="<% @var value %>"<% @endloop %> >
<% @var value -escape html %></span>
<b>v</b><input type="text"
name="<% @var html-name %>"
edata="<% @var html-name %>"
class="bfh-phone"
data-format='dd.ddd.ddd'
value="<% @var value -escape html %>"
......
<div class="input_div search"
id="field_<% @var html-name %>" >
<input type="text"
name="<% @var html-name %>"
class="search srch bfh-phone"
value="<% @var value -escape html %>"
<% @loop html-attributes %>
<% @var name %>="<% @var value %>"
<% @endloop %>
/>
<a target="_" href="/register/find-school"></a></div>
<select name="<% @var html-name %>" value="<% @var value -escape html %>"
<select id="field_<% @var html-name %>" name="<% @var html-name %>" value="<% @var value -escape html %>">
<% @loop html-attributes %><% @var name %>="<% @var value %>"<% @endloop %> >
<% (let ((value (emb-env :value))) %>
<% @loop extra-data/options %>
......@@ -8,3 +8,5 @@
<% @endloop %>
<% ) %>
</select>
<input type="text" name="<% @var html-name %>" value="<% @var value -escape html %>"
id="field_<% @var html-name %>"
<% @loop html-attributes %><% @var name %>="<% @var value %>"<% @endloop %> />
<textarea name="<% @var html-name %>" value="<% @var value -escape html %>"
<% @loop html-attributes %><% @var name %>="<% @var value %>"<% @endloop %> ><% @var value -escape html %></textarea>
<textarea name="<% @var html-name %>"
id="field_<% @var html-name %>"
<% @loop html-attributes %><% @var name %>="<% @var value %>" <% @endloop %> ><% @var value -escape html %></textarea>
......@@ -6,6 +6,7 @@
(
:cl-utilities
:iterate
:yason
:cl-ppcre
:parse-number
:cl-emb
......
......@@ -71,6 +71,10 @@
#:truncate-string
#:*multibyte-encodings*
#:plist-list
#:plist-json
#:list-json
)
)
......@@ -639,3 +643,33 @@
"ucs-2le" "ucs-4le" "ucs2le" "ucs4le"
"ucs-2be" "ucs-4be" "ucs2be" "ucs4be"
))
(declaim (inline safe-endp))
(defun safe-endp (x)
(declare (optimize safety))
(endp x))
(defun plist-list (plist)
"Returns an list containing the same keys and values as the
property list PLIST in the same order."
(let (llist)
(do ((tail plist (cddr tail)))
((safe-endp tail) (nreverse llist))
(push (list (car tail) (cadr tail)) llist))))
(defun plist-json (plist)
(with-output-to-string (s)
(yason:encode
(mccme-helpers/parsetype:list-to-ht
(plist-list plist))
s)))
(defun list-json (llist)
(with-output-to-string (s)
(yason:encode
(mccme-helpers/parsetype:list-to-ht
llist)
s)))
......@@ -9,31 +9,31 @@
(def-and-set-var russia-regions
`(
(0 "нет")
(1 "республика Адыгея")
(2 "республика Башкортостан")
(3 "республика Бурятия")
(4 "республика Алтай")
(5 "республика Дагестан")
(6 "республика Ингушетия")
;(7 "республика Кабардино-Балкария")
(1 "Республика Адыгея")
(2 "Республика Башкортостан")
(3 "Республика Бурятия")
(4 "Республика Алтай")
(5 "Республика Дагестан")
(6 "Республика Ингушетия")
;(7 "Республика Кабардино-Балкария")
(7 "Кабардино-Балкарская республика")
(8 "республика Калмыкия")
;(9 "республика Карачаево-Черкесия")
(8 "Республика Калмыкия")
;(9 "Республика Карачаево-Черкесия")
(9 "Карачаево-Черкесская республика")
(10 "республика Карелия")
(11 "республика Коми")
(12 "республика Марий Эл")
(13 "республика Мордовия")
(14 "республика Саха-Якутия")
(15 "республика Северная Осетия")
(16 "республика Татарстан")
(17 "республика Тыва")
;(18 "республика Удмуртия")
(10 "Республика Карелия")
(11 "Республика Коми")
(12 "Республика Марий Эл")
(13 "Республика Мордовия")
(14 "Республика Саха-Якутия")
(15 "Республика Северная Осетия")
(16 "Республика Татарстан")
(17 "Республика Тыва")
;(18 "Республика Удмуртия")
(18 "Удмуртская республика")
(19 "республика Хакасия")
;(20 "республика Чечня")
(19 "Республика Хакасия")
;(20 "Республика Чечня")
(20 "Чеченская республика")
(21 "республика Чувашия")
(21 "Республика Чувашия")
(22 "Алтайский край")
(23 "Краснодарский край")
(24 "Красноярский край")
......@@ -95,7 +95,7 @@
;(80 "Забайкальский край")
;(81 "Пермский край")
;(82 "Камчатский край")
(82 "республика Крым")
(82 "Республика Крым")
(83 "Ненецкий автономный округ")
;(84 "Красноярский край")
;(85 "Иркутская область")
......
......@@ -649,3 +649,4 @@
(defun to-getf-struct (obj)
(reduce 'append (map-generic obj 'identity)))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment