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
12
paramecio2/libraries/templates/utils/accept.phtml
Normal file
12
paramecio2/libraries/templates/utils/accept.phtml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
${question_text}: <input type="button" value="Yes" id="accept"/>
|
||||
<script language="javascript">
|
||||
|
||||
$('#accept').click( function () {
|
||||
|
||||
location.href='${url_redirect|n}'
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<%block name="form">
|
||||
</%block>
|
||||
4
paramecio2/libraries/templates/utils/admin.phtml
Normal file
4
paramecio2/libraries/templates/utils/admin.phtml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
${show_flash_message()|n}
|
||||
<!--<h1>${admin.title}</h1>-->
|
||||
<p><a href="${add_get_parameters(admin.url, op_admin='1')}">${lang('common', 'add_item', 'Add new item')}</a></p>
|
||||
${admin.list.show()|n}
|
||||
21
paramecio2/libraries/templates/utils/insertform.phtml
Normal file
21
paramecio2/libraries/templates/utils/insertform.phtml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<p><a href="${admin.url_redirect}">${admin.text_home|n}</a> >> \
|
||||
% if id!='0':
|
||||
${title_edit} \
|
||||
%else:
|
||||
${title_edit} \
|
||||
%endif
|
||||
<%
|
||||
|
||||
enctype_txt=''
|
||||
|
||||
if enctype:
|
||||
enctype_txt='enctype="multipart/form-data"'
|
||||
|
||||
%>
|
||||
</p>
|
||||
<form method="post" action="${url_action}" ${enctype_txt|n}>
|
||||
<h2>${title_edit}</h2>
|
||||
<span class="error">${model.query_error}</span>
|
||||
${ form|n }
|
||||
<p><input type="submit" value="${lang('common', 'send', 'Send') }"></p>
|
||||
</form>
|
||||
135
paramecio2/libraries/templates/utils/list.phtml
Normal file
135
paramecio2/libraries/templates/utils/list.phtml
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
<%def name="select_field(field)">
|
||||
% if simplelist.search_field==field:
|
||||
selected \
|
||||
% endif
|
||||
</%def>
|
||||
<%def name="set_css_arrow(simplelist, field)">
|
||||
% if simplelist.order_field==field:
|
||||
<i class="fa fa-arrow-${simplelist.order_class[simplelist.order]}" aria-hidden="true"></i>
|
||||
% endif
|
||||
</%def>
|
||||
% if simplelist.yes_search:
|
||||
<div class="form">
|
||||
<form method="get" action="${simplelist.url}">
|
||||
${lang('common','search', 'Search')}: <input type="text" name="search_text" value="${simplelist.search_text|n}">
|
||||
<select name="search_field">
|
||||
% for field in simplelist.search_fields:
|
||||
<option value="${simplelist.model.fields[field].name}" ${select_field(field)}>${simplelist.model.fields[field].label}</option>
|
||||
% endfor
|
||||
</select>
|
||||
<input type="submit" value="${lang('common', 'search', 'Search')}" />
|
||||
</form>
|
||||
</div>
|
||||
% endif
|
||||
% if not simplelist.table_div:
|
||||
|
||||
<table class="table_list" id="${simplelist.model.name}_table">
|
||||
<tr class="title_list">
|
||||
% for field in simplelist.fields_showed:
|
||||
<td class="${simplelist.model.fields[field].name}_td"><a href="${add_get_parameters(simplelist.url, order_field=field, begin_page=simplelist.begin_page, order=simplelist.change_order[field], search_text=simplelist.search_text, search_field=simplelist.search_field)}" class="">${set_css_arrow(simplelist, field)}${simplelist.model.fields[field].label}</a></td>
|
||||
% endfor
|
||||
% for extra_field in simplelist.arr_extra_fields:
|
||||
<td class="options_td">${ extra_field }</td>
|
||||
% endfor
|
||||
</tr>
|
||||
<%
|
||||
pos=0
|
||||
%>
|
||||
% for row in list:
|
||||
<%
|
||||
if not 'pos' in row:
|
||||
row['pos']=pos
|
||||
%>
|
||||
<tr class="row_list">
|
||||
% for field in simplelist.fields_showed:
|
||||
% if simplelist.model.fields[field].escape==True:
|
||||
%if type(simplelist.model.fields[field]).__name__!='ForeignKeyField':
|
||||
<td class="${simplelist.model.fields[field].name}_td">${simplelist.model.fields[field].show_formatted(row[field])}</td>
|
||||
% else:
|
||||
<td class="${simplelist.model.fields[field].name}_td">${simplelist.model.fields[field].show_formatted(row[field])}${str(simplelist.model.fields[field].related_model.fields[simplelist.model.fields[field].named_field].show_formatted(row[field]))}</td>
|
||||
% endif
|
||||
% else:
|
||||
%if type(simplelist.model.fields[field]).__name__!='ForeignKeyField':
|
||||
<td class="${simplelist.model.fields[field].name}_td">${str(simplelist.model.fields[field].show_formatted(row[field]))|n}</td>
|
||||
% else:
|
||||
<td class="${simplelist.model.fields[field].name}_td">${str(simplelist.model.fields[field].related_model.fields[simplelist.model.fields[field].named_field].show_formatted(row[field]))|n}</td>
|
||||
% endif
|
||||
% endif
|
||||
% endfor
|
||||
|
||||
% for extra_field_func in simplelist.arr_extra_options:
|
||||
<td class="options_td">${ simplelist.set_options(extra_field_func, row)|n }</td>
|
||||
% endfor
|
||||
</tr>
|
||||
<%
|
||||
pos+=1
|
||||
%>
|
||||
% endfor
|
||||
</table>
|
||||
|
||||
% else:
|
||||
|
||||
<%
|
||||
|
||||
size_td=round(100/(len(simplelist.fields_showed)+len(simplelist.arr_extra_options)))
|
||||
|
||||
%>
|
||||
|
||||
<div class="table_list" id="${simplelist.model.name}_table">
|
||||
<div class="${simplelist.model.name}_tr tr_list_div">
|
||||
% for field in simplelist.fields_showed:
|
||||
<div class="${simplelist.model.fields[field].name}_td fields_span_title" style="width: ${size_td}%;"><a href="${add_get_parameters(simplelist.url, order_field=field, begin_page=simplelist.begin_page, order=simplelist.change_order[field], search_text=simplelist.search_text, search_field=simplelist.search_field)}" class="">${set_css_arrow(simplelist, field)}${simplelist.model.fields[field].label}</a></div>
|
||||
% endfor
|
||||
% for extra_field in simplelist.arr_extra_fields:
|
||||
<div class="fields_span_title options_td" style="width: ${size_td}%;">${ extra_field }</div>
|
||||
% endfor
|
||||
</div>
|
||||
<div class="table_rows ${simplelist.model.name}_table_rows" id="${simplelist.model.name}_table_rows">
|
||||
<%
|
||||
pos=0
|
||||
%>
|
||||
% for row in list:
|
||||
<div id="${simplelist.model.name}_table_${row['id']}" class="${simplelist.model.name}_table_row" style="clear: both;overflow: hidden;">
|
||||
<%
|
||||
if not 'pos' in row:
|
||||
row['pos']=pos
|
||||
%>
|
||||
|
||||
% for field in simplelist.fields_showed:
|
||||
% if simplelist.model.fields[field].escape==True:
|
||||
<div class="${simplelist.model.fields[field].name}_td fields_span_table_data" style="width: ${size_td}%;">
|
||||
%if type(simplelist.model.fields[field]).__name__!='ForeignKeyField':
|
||||
${simplelist.model.fields[field].show_formatted(row[field])}
|
||||
% else:
|
||||
${str(simplelist.model.fields[field].related_model.fields[simplelist.model.fields[field].named_field].show_formatted(row[field]))}
|
||||
% endif
|
||||
</div>
|
||||
% else:
|
||||
<div class="${simplelist.model.fields[field].name}_td fields_span_table_data" style="width: ${size_td}%;">
|
||||
%if type(simplelist.model.fields[field]).__name__!='ForeignKeyField':
|
||||
${str(simplelist.model.fields[field].show_formatted(row[field]))|n}
|
||||
% else:
|
||||
${str(simplelist.model.fields[field].related_model.fields[simplelist.model.fields[field].named_field].show_formatted(row[field]))|n}
|
||||
% endif
|
||||
</div>
|
||||
% endif
|
||||
% endfor
|
||||
|
||||
% for extra_field_func in simplelist.arr_extra_options:
|
||||
<div class="options_td fields_span_table_data" style="width: ${size_td}%;">${ simplelist.set_options(extra_field_func, row)|n }</div>
|
||||
% endfor
|
||||
<%
|
||||
pos+=1
|
||||
%>
|
||||
</div>
|
||||
% endfor
|
||||
</div>
|
||||
<br clear="all" />
|
||||
</div>
|
||||
|
||||
% endif
|
||||
<p>
|
||||
% if pages!='':
|
||||
${lang('common', 'pages', 'Pages')}: ${pages|n}
|
||||
% endif
|
||||
</p>
|
||||
85
paramecio2/libraries/templates/utils/translations.phtml
Normal file
85
paramecio2/libraries/templates/utils/translations.phtml
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<div id="container_translation">
|
||||
<div class="flash" style="display:none;">${lang('admin', 'translation_saved_sucessfully', 'Translation saved sucessfully')}</div>
|
||||
<br />
|
||||
<form method="get" action="">
|
||||
${lang('admin', 'modules', 'Modules')}
|
||||
${form_module.form()|n}
|
||||
<input type="submit" value="${lang('admin', 'change_module_to_translate', 'Change module to translate')}" />
|
||||
</form>
|
||||
<div id="saving" style="display:none;"><i class="fa fa-circle-o-notch fa-2x fa-spin fa-fw"></i> ${lang('admin', 'saving_translation', 'Saving translation')}</div>
|
||||
<form method="post" action="#" id="send_text">
|
||||
% if len(arr_i18n_form):
|
||||
|
||||
<p><input type="submit" value="${lang('admin', 'send', 'Send')}" /></p>
|
||||
|
||||
% for i18n_form in arr_i18n_form:
|
||||
|
||||
<p>${i18n_form.form()|n}</p>
|
||||
|
||||
% endfor
|
||||
|
||||
<p><input type="submit" value="${lang('admin', 'send', 'Send')}" /></p>
|
||||
|
||||
% endif
|
||||
${csrf_token("csrf_token")|n}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$('#send_text').submit( function () {
|
||||
|
||||
$('#send_text').hide();
|
||||
$('#saving').show();
|
||||
|
||||
url="${make_admin_url('lang/translations',{'module_admin': selected_module, 'op': '1'})}";
|
||||
|
||||
/*data=$(this).serializeArray().reduce(function(obj, item) {
|
||||
obj[item.name] = item.value;
|
||||
return obj;
|
||||
}, {});*/
|
||||
|
||||
data=$(this).serialize()
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: data,
|
||||
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
success: function (data) {
|
||||
|
||||
$('#saving').hide();
|
||||
|
||||
if(!data.error) {
|
||||
|
||||
$('#send_text').show();
|
||||
$('.flash').show();
|
||||
|
||||
setTimeout(function () {
|
||||
|
||||
$(".flash").fadeOut(1000)
|
||||
|
||||
}, 3000);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
alert('Error: cannot update the translations');
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
error: function (data) {
|
||||
|
||||
alert(JSON.stringify(data));
|
||||
$('#send_text').show();
|
||||
|
||||
},
|
||||
dataType: 'json'
|
||||
});
|
||||
|
||||
return false;
|
||||
|
||||
});
|
||||
</script>
|
||||
8
paramecio2/libraries/templates/utils/verify_delete.phtml
Normal file
8
paramecio2/libraries/templates/utils/verify_delete.phtml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<form method="post" action="${add_get_parameters(url, id=item_id, op_admin=op_admin, verified=verified)}">
|
||||
<div class="form">
|
||||
<!-- <input type="hidden" name="id" value="${item_id}">
|
||||
<input type="hidden" name="op_admin" value="${op_admin}">
|
||||
<input type="hidden" name="verified" value="${verified}">-->
|
||||
<input type="submit" value="${lang('common', 'delete_item_you_sure', 'Are you sure for delete this item?')}" />
|
||||
</div>
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue