Added first files for admin and login/signup in admin
This commit is contained in:
parent
e0ed00af8c
commit
d9b62719d7
139 changed files with 18408 additions and 4 deletions
33
paramecio2/libraries/templates/forms/colorform.phtml
Normal file
33
paramecio2/libraries/templates/forms/colorform.phtml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
${add_js_home_local('jquery.min.js', 'admin')}
|
||||
${add_js_home_local('spectrum.js', 'admin')}
|
||||
${add_css_home_local('spectrum.css', 'admin')}
|
||||
<%
|
||||
|
||||
|
||||
form.default_value=str(hex(int(form.default_value))).replace('0x', '')
|
||||
|
||||
c=len(form.default_value)
|
||||
|
||||
if(c<6):
|
||||
repeat=6-c
|
||||
form.default_value=('0'*repeat)+form.default_value
|
||||
|
||||
form.default_value='#'+form.default_value
|
||||
|
||||
%>
|
||||
|
||||
<input type='text' id="${form.name_field_id}_field_form" name="${form.name}" value="${form.default_value}" />
|
||||
<script>
|
||||
$("#${form.name_field_id}_field_form").spectrum({
|
||||
allowEmpty: true
|
||||
});
|
||||
|
||||
$("#${form.name_field_id}_field_form").closest('form').submit( function () {
|
||||
|
||||
var t=$("#${form.name_field_id}_field_form").spectrum("get");
|
||||
|
||||
$('#${form.name_field_id}_field_form').val(t.toHexString());
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
71
paramecio2/libraries/templates/forms/dateform.phtml
Normal file
71
paramecio2/libraries/templates/forms/dateform.phtml
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
${add_js_home_local('jquery.min.js', 'admin')}
|
||||
|
||||
<input type="number" min="1" max="31" name="${form}_day" id="time_${form}_day" class="form_day" value="${d}" size="2" maxlength="2"/>
|
||||
<input type="number" min="1" max="12" name="${form}_month" id="time_${form}_month" class="form_month" value="${m}" size="2" maxlength="2"/>
|
||||
<input type="number" name="${form}_year" id="time_${form}_year" class="form_year" value="${y}" size="4" maxlength="4"/>
|
||||
% if yes_time==True:
|
||||
<input type="text" min="0" max="23" name="${form}_hour" id="time_${form}_hour" class="form_hour" value="${h}" size="2" maxlength="2"/>
|
||||
<input type="text" min="0" max="60" name="${form}_minute" id="time_${form}_minute" class="form_minute" value="${min}" size="2" maxlength="2"/>
|
||||
<input type="text" min="0" max="60" name="${form}_second" id="time_${form}_second" class="form_second" value="${s}" size="2" maxlength="2"/>
|
||||
% endif
|
||||
<input type="hidden" name="${form}" id="time_${form}" value="" />
|
||||
|
||||
<script language="javascript">
|
||||
$(document).submit(function () {
|
||||
|
||||
year=$("#time_${form}_year").val().toString();
|
||||
month=$("#time_${form}_month").val().toString();
|
||||
day=$("#time_${form}_day").val().toString();
|
||||
|
||||
year=add_extra_length(year, 4);
|
||||
month=add_extra_length(month, 2);
|
||||
day=add_extra_length(day, 2);
|
||||
|
||||
final_time=year+month+day
|
||||
|
||||
% if yes_time==True:
|
||||
hour=$("#time_${form}_hour").val().toString();
|
||||
minute=$("#time_${form}_minute").val().toString();
|
||||
second=$("#time_${form}_second").val().toString();
|
||||
|
||||
hour=add_extra_length(hour, 2);
|
||||
minute=add_extra_length(minute, 2);
|
||||
second=add_extra_length(second, 2);
|
||||
|
||||
final_time+=final_time;
|
||||
|
||||
% else:
|
||||
|
||||
final_time+='000000';
|
||||
|
||||
% endif
|
||||
|
||||
|
||||
$("#time_${form}").val(final_time);
|
||||
|
||||
});
|
||||
|
||||
function add_extra_length(str_number, total_length)
|
||||
{
|
||||
|
||||
if(str_number.length<total_length)
|
||||
{
|
||||
c=total_length-str_number.length;
|
||||
|
||||
extra_number='';
|
||||
|
||||
for(x=0;x<c;x++)
|
||||
{
|
||||
|
||||
extra_number+='0';
|
||||
|
||||
}
|
||||
|
||||
str_number=extra_number+str_number;
|
||||
}
|
||||
|
||||
return str_number;
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
12
paramecio2/libraries/templates/forms/fileform.phtml
Normal file
12
paramecio2/libraries/templates/forms/fileform.phtml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<%
|
||||
|
||||
import os
|
||||
|
||||
name_file=os.path.basename(form.default_value)
|
||||
|
||||
%>
|
||||
<input type="file" name="${form.name}_file" id="${form.name}_file_field_form" />
|
||||
% if name_file:
|
||||
${name_file}
|
||||
% endif
|
||||
<input type="hidden" name="${form.name}" id="${form.name}_field_form" value="${form.default_value}"/>
|
||||
61
paramecio2/libraries/templates/forms/i18nform.phtml
Normal file
61
paramecio2/libraries/templates/forms/i18nform.phtml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
${add_js_home_local('tools.js', 'admin')}
|
||||
<%
|
||||
|
||||
choose=''
|
||||
|
||||
%>
|
||||
<div id="languages_form">
|
||||
<%def name="select_lang(i18n, lang_selected)">
|
||||
% if i18n==lang_selected:
|
||||
<%
|
||||
return "choose_flag"
|
||||
%>
|
||||
% else:
|
||||
<%
|
||||
return "no_choose_flag"
|
||||
%>
|
||||
% endif
|
||||
</%def>
|
||||
<%def name="hide_lang(i18n, lang_selected)">
|
||||
% if i18n!=lang_selected:
|
||||
style="display:none;"
|
||||
% endif
|
||||
</%def>
|
||||
<input type="hidden" name="${real_name_form}" id="${name_form}_i18n_value" value="" />
|
||||
% if lang_selected!=None:
|
||||
% for i18n in arr_i18n:
|
||||
|
||||
${form.change_name(name_form+'_'+i18n)}
|
||||
<%
|
||||
form.default_value=default_value[i18n]
|
||||
%>
|
||||
<span id="${name_form}_${i18n}_switch" class="${name_form}_i18n_form">${form.form()|n}</span> <a class="choose_flag ${name_form}_i18n_flag lang_form" id="${name_form}_${i18n}_element" href="#"><img src="${make_media_url_module('images/languages/'+i18n+'.png', 'admin')}" alt="${name_form}_${i18n}"/></a>
|
||||
% endfor
|
||||
% endif
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
//In submit convert in json
|
||||
|
||||
$(".${name_form}_i18n_flag").closest('form').submit( function () {
|
||||
|
||||
arr_i18n={}
|
||||
|
||||
$(".${name_form}_i18n_form").each(function () {
|
||||
|
||||
var lang=$(this).attr('id').replace('${name_form}_','').replace('_switch', '');
|
||||
|
||||
var child_input=$('#${name_form}_'+lang+'_form');
|
||||
|
||||
arr_i18n[lang]=child_input.val();
|
||||
|
||||
});
|
||||
|
||||
document.getElementById("${name_form}_i18n_value").value=JSON.stringify(arr_i18n);
|
||||
|
||||
return true;
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
5
paramecio2/libraries/templates/forms/modelform.html
Normal file
5
paramecio2/libraries/templates/forms/modelform.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<div class="form">
|
||||
{% for form in forms.values() %}
|
||||
<p><label>{{form.label|safe}}</label>{{form.form()}}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
21
paramecio2/libraries/templates/forms/modelform.phtml
Normal file
21
paramecio2/libraries/templates/forms/modelform.phtml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<%def name="check_required(required)">
|
||||
% if required:
|
||||
${'*'} \
|
||||
% endif
|
||||
</%def>
|
||||
<%def name="help(help, name)">
|
||||
% if help:
|
||||
<i class="fa fa-question-circle tooltip" data-tooltip-content="#tooltip_${name}_content" style="cursor:pointer;"></i> \
|
||||
<div class="tooltip_templates" style="display:none;"><div id="tooltip_${name}_content">${help|n}</div></div>
|
||||
% endif
|
||||
</%def>
|
||||
<div class="form">
|
||||
% for form in forms.values():
|
||||
% if form.type!='hidden':
|
||||
<p><label>${form.label} ${check_required(form.required)} ${help(form.help, form.name)}</label>${form.form()|n} <span class="error" id="${form.name}_error">${form.txt_error}</span></p>
|
||||
% else:
|
||||
${form.form()|n}
|
||||
% endif
|
||||
% endfor
|
||||
${csrf_token()|n}
|
||||
</div>
|
||||
22
paramecio2/libraries/templates/forms/texthtmlform.phtml
Normal file
22
paramecio2/libraries/templates/forms/texthtmlform.phtml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<p>
|
||||
<textarea name="${form.name}" id="${form.name_field_id}">
|
||||
${form.default_value}
|
||||
</textarea>
|
||||
</p>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#${form.name_field_id}',
|
||||
height: 500,
|
||||
menubar: true,
|
||||
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists textcolor wordcount imagetools contextmenu colorpicker textpattern',
|
||||
toolbar: 'formatselect | fontsizeselect bold italic underline strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat',
|
||||
fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt 48pt 64pt 100pt 120pt",
|
||||
content_css: '//www.tinymce.com/css/codepen.min.css',
|
||||
setup: function (editor) {
|
||||
editor.on('change', function () {
|
||||
tinymce.triggerSave();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
${add_js_home_local('tinymce/tinymce.min.js', 'admin')}
|
||||
Loading…
Add table
Add a link
Reference in a new issue