Initial commit

This commit is contained in:
zhugl
2015-07-30 13:01:42 +08:00
commit dfe9774fb1
122 changed files with 12088 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
{% extends "admin/index.html" %}
{% load i18n %}
{% block bodyclass %}{{ block.super }} app-{{ app_label }}{% endblock %}
{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
{% for app in app_lib %}
| {% if app.is_current %} {{app.name}} {% else %}<a href="{{ app.app_url }}">{{ app.name }}</a> {% endif %}
{% endfor %}
</div>
{% endblock %}
{% endif %}
{% block sidebar %}{% endblock %}
+91
View File
@@ -0,0 +1,91 @@
{% load i18n admin_static %}<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" />
{% block extrastyle %}{% endblock %}
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% static "admin/css/ie.css" %}{% endblock %}" /><![endif]-->
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>
<script type="text/javascript">window.__admin_utc_offset__ = "{% filter escapejs %}{% now "Z" %}{% endfilter %}";</script>
{% block extrahead %}{% endblock %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
</head>
{% load i18n %}
<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}">
<!-- Container -->
<div id="container">
{% if not is_popup %}
<!-- Header -->
<div id="header">
<div id="branding">
{% block branding %}{% endblock %}
</div>
{% block usertools %}
{% if has_permission %}
<div id="user-tools">
{% block welcome-msg %}
{% trans 'Welcome,' %}
<strong>{% firstof user.get_short_name user.get_username %}</strong>.
{% endblock %}
{% block userlinks %}
<a href="/admin/workflow/todolist">{% trans 'workflow todo' %}</a> /
{% if site_url %}
<a href="/admin/basedata/document">{% trans 'document' %}</a> /
{% endif %}
{% if user.is_active and user.is_staff %}
{% url 'django-admindocs-docroot' as docsroot %}
{% if docsroot %}
<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
{% endif %}
{% endif %}
{% if user.has_usable_password %}
<a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
{% endif %}
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
{% endblock %}
</div>
{% endif %}
{% endblock %}
{% block nav-global %}{% endblock %}
</div>
<!-- END Header -->
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
{% if title %} &rsaquo; {{ title }}{% endif %}
</div>
{% endblock %}
{% endif %}
{% block messages %}
{% if messages %}
<ul class="messagelist">{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
{% endfor %}</ul>
{% endif %}
{% endblock messages %}
<!-- Content -->
<div id="content" class="{% block coltype %}colM{% endblock %}">
{% block pretitle %}{% endblock %}
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
{% block content %}
{% block object-tools %}{% endblock %}
{{ content }}
{% endblock %}
{% block sidebar %}{% endblock %}
<br class="clear" />
</div>
<!-- END Content -->
{% block footer %}<div id="footer"></div>{% endblock %}
</div>
<!-- END Container -->
</body>
</html>
+148
View File
@@ -0,0 +1,148 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls admin_static admin_modify %}
{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{{ media }}
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block coltype %}colM{% endblock %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %}
{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
&rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
</div>
{% endblock %}
{% endif %}
{% block content %}<div id="content-main">
{% block object-tools %}
{% if change %}{% if not is_popup %}
<ul class="object-tools">
{% block object-tools-items %}
<li>
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
<a href="{% add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>
</li>
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif %}
{% endblock %}
</ul>
{% endif %}{% endif %}
{% endblock %}
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
{% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %}
{% if show_workflow_line%}
<fieldset class="module aligned workflow">
<h2>{% trans "workflow approve" %}</h2>
<div style="padding:10px">
{% if can_restart %}
<a class="button" href="restart/{{workflow_instance.id}}" id="workflow_restart">{% trans "restart workflow" %}</a>
<p style="float:right;color:#666">{% trans "your apply has been denied,you can restart a new apply" %}</p>
{% else %}
<label class="control"><input type="radio" name="operation" value="1" checked> {% trans "agree" %}</label>
<label class="control"><input type="radio" name="operation" value="3"> {% trans "deny" %}</label>
<label class="control"><input type="radio" name="operation" value="4"> {% trans "terminate" %}</label>
<a class="button" href="approve/1" id="workflow_approve">{% trans "submit" %}</a>
{% endif %}
</div>
</fieldset>
{% endif %}
{% if errors %}
<p class="errornote">
{% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
</p>
{{ adminform.form.non_field_errors }}
{% endif %}
{% block field_sets %}
{% for fieldset in adminform %}
{% include "admin/includes/fieldset.html" %}
{% endfor %}
{% endblock %}
{% block after_field_sets %}{% endblock %}
{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include inline_admin_formset.opts.template %}
{% endfor %}
{% endblock %}
{% block after_related_objects %}{% endblock %}
{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
{% block admin_change_form_document_ready %}
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('.add-another').click(function(e) {
e.preventDefault();
showAddAnotherPopup(this);
});
$('.related-lookup').click(function(e) {
e.preventDefault();
showRelatedObjectLookupPopup(this);
});
{% if adminform and add %}
$('form#{{ opts.model_name }}_form :input:visible:enabled:first').focus()
{% endif %}
{% if workflow_modal %}
{% if workflow_instance %}
workflow_modal = "{{ workflow_modal.code }}";
workflow_instance = "{{ workflow_instance.code }}";
$('tr.add-row').hide();
{% if can_edit %}
$('a.deletelink').hide();
$("#workflow_submit").hide();
$("input[name='_addanother']").hide();
$("input[name='_continue']").hide();
{% else %}
$('input,select,textarea').attr('disabled','true');
$('div.submit-row').hide();
$('.workflow input,.workflow select').removeAttr("disabled");
$("#workflow_submit").hide();
{% endif %}
{% endif %}
{% else %}
$("#workflow_submit").hide();
{% endif %}
{% if extra_buttons %}
{% for button in extra_buttons %}
$("<a href='{{button.href}}' class='button'>{{button.title}}</a>").insertAfter("#workflow_submit");
{% endfor %}
{% endif %}
{% if readonly %}
$('input,select,textarea').attr('disabled',true);
$('div.submit-row').hide();
$('tr.add-row').hide();
{% endif %}
try{
$("div.inline-group table tbody tr.form-row").removeClass('has_original');
$("div.inline-group table tbody tr.form-row td:first-child").find('p').hide();
}catch(e){
}
});
})(django.jQuery);
</script>
{% endblock %}
{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
</div>
</form></div>
{% endblock %}
+110
View File
@@ -0,0 +1,110 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_static %}
{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />
{% endblock %}
{% block coltype %}colMS{% endblock %}
{% block bodyclass %}{{ block.super }} dashboard{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
{% for app in maxi_app_list %}
| <a href="{{ app.app_url }}">{{ app.name }}</a>
{% endfor %}
</div>
{% endblock %}
{% block content %}
<div id="content-main">
{% if maxi_app_list %}
{% for app in maxi_app_list %}
<div class="app-{{ app.app_label }} module">
<table>
<caption>
<a href="{{ app.app_url }}" class="section" title="{% blocktrans with name=app.name %}Models in the {{ name }} application{% endblocktrans %}">{{ app.name }}</a>
</caption>
{% for model in app.models %}
<tr class="model-{{ model.object_name|lower }}">
{% if model.admin_url %}
<th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
{% else %}
<th scope="row">{{ model.name }}</th>
{% endif %}
{% if model.add_url %}
<td><a href="{{ model.add_url }}" class="addlink">{% trans 'Add' %}</a></td>
{% else %}
<td>&nbsp;</td>
{% endif %}
{% if model.admin_url %}
<td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Change' %}</a></td>
{% else %}
<td>&nbsp;</td>
{% endif %}
</tr>
{% endfor %}
</table>
</div>
{% endfor %}
{% else %}
<p>{% trans "You don't have permission to edit anything." %}</p>
{% endif %}
</div>
{% endblock %}
{% block sidebar %}
<div id="content-related" style="width:18em">
<div class="module">
<h2><a href="workflow/todolist" style="float:right">更多</a>我的待办</h2>
{% if not todolist %}
<p>无待办任务</p>
{% else %}
<ul class="actionlist">
{% for todo in todolist%}
<li class="changelink">
{{todo.href}}<br/>
<span class="mini quiet">{{todo.submitter}} {{todo.start_time}}</span>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="module" id="recent-actions-module">
<h2>{% trans 'Recent Actions' %}</h2>
<h3>{% trans 'My Actions' %}</h3>
{% load log %}
{% get_admin_log 10 as admin_log for_user user %}
{% if not admin_log %}
<p>{% trans 'None available' %}</p>
{% else %}
<ul class="actionlist">
{% for entry in admin_log %}
<li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
{% if entry.is_deletion or not entry.get_admin_url %}
{{ entry.object_repr }}
{% else %}
<a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
{% endif %}
<br/>
{% if entry.content_type %}
<span class="mini quiet">{% filter capfirst %}{{ entry.content_type }}{% endfilter %}</span>
{% else %}
<span class="mini quiet">{% trans 'Unknown content' %}</span>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% endblock %}
@@ -0,0 +1,167 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls admin_static admin_modify %}
{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{{ media }}
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block coltype %}colM{% endblock %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %}
{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
&rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
</div>
{% endblock %}
{% endif %}
{% block content %}<div id="content-main">
{% block object-tools %}
{% if change %}{% if not is_popup %}
<ul class="object-tools">
{% block object-tools-items %}
<li>
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
<a href="{% add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>
</li>
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif %}
{% endblock %}
</ul>
{% endif %}{% endif %}
{% endblock %}
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
{% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %}
{% if show_workflow_line%}
<fieldset class="module aligned workflow">
<h2>{% trans "workflow approve" %}</h2>
<div style="padding:10px">
{% if can_restart %}
<a class="button" href="restart/{{workflow_instance.id}}" id="workflow_restart">{% trans "restart workflow" %}</a>
<p style="float:right;color:#666">{% trans "your apply has been denied,you can restart a new apply" %}</p>
{% else %}
<label class="control"><input type="radio" name="operation" value="1" checked> {% trans "agree" %}</label>
<label class="control"><input type="radio" name="operation" value="3"> {% trans "deny" %}</label>
<label class="control"><input type="radio" name="operation" value="4"> {% trans "terminate" %}</label>
<a class="button" href="approve/1" id="workflow_submit">{% trans "submit" %}</a>
{% endif %}
</div>
</fieldset>
{% endif %}
{% if errors %}
<p class="errornote">
{% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
</p>
{{ adminform.form.non_field_errors }}
{% endif %}
{% block field_sets %}
{% for fieldset in adminform %}
{% include "admin/includes/fieldset.html" %}
{% endfor %}
{% endblock %}
{% block after_field_sets %}{% endblock %}
{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include inline_admin_formset.opts.template %}
{% endfor %}
{% endblock %}
{% block after_related_objects %}{% endblock %}
{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
{% block admin_change_form_document_ready %}
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('.add-another').click(function(e) {
e.preventDefault();
showAddAnotherPopup(this);
});
$('.related-lookup').click(function(e) {
e.preventDefault();
showRelatedObjectLookupPopup(this);
});
{% if adminform and add %}
$('form#{{ opts.model_name }}_form :input:visible:enabled:first').focus()
{% endif %}
{% if workflow_modal %}
{% if workflow_instance %}
workflow_modal = "{{ workflow_modal.code }}";
workflow_instance = "{{ workflow_instance.code }}";
$('tr.add-row').hide();
$('input,select,textarea').attr('disabled','true');
$('div.submit-row').hide();
$('.workflow input,.workflow select').removeAttr("disabled");
$("#workflow_submit").hide();
{% endif %}
{% else %}
$("#workflow_submit").hide();
{% endif %}
{% if extra_buttons %}
{% for button in extra_buttons %}
$("<a href='{{button.href}}' class='button'>{{button.title}}</a>").insertAfter("#workflow_submit");
{% endfor %}
{% endif %}
{% if readonly %}
$('input,select,textarea').attr('disabled',true);
$('div.submit-row').hide();
$('tr.add-row').hide();
{% endif %}
});
})(django.jQuery);
</script>
{% endblock %}
{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
</div>
</form></div>
{% if detail %}
<h1 style="margin-top:15px">{% trans "InOut History" %}</h1>
<div class="module">
<table id="workflow-history">
<thead>
<tr>
<th scope="col">{% trans 'execute time' %}</th>
<th scope="col">{% trans 'plus or minus prop' %}</th>
<th scope="col">{% trans 'price' %}</th>
<th scope="col">{% trans 'count' %}</th>
<th scope="col">{% trans 'measure' %}</th>
<th scope="col">{% trans 'status' %}</th>
<th scope="col">{% trans 'source' %}</th>
</tr>
</thead>
<tbody>
{% for item in detail %}
<tr>
<th scope="row">{{ item.event_time|date:"DATETIME_FORMAT" }}</th>
<td class="col">{{ item.prop }}</td>
<td class="col">{{ item.price }}</td>
<td class="col">{{ item.cnt }}</td>
<td class="col">{{ item.measure }}</td>
<td class="col">{% if item.status %} {% trans 'EXECUTED'%} {% endif %}</td>
<td class="col">{{ item.source }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{% endblock %}
@@ -0,0 +1,136 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls admin_static admin_modify %}
{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{{ media }}
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block coltype %}colM{% endblock %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %}
{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
&rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
</div>
{% endblock %}
{% endif %}
{% block content %}<div id="content-main">
{% block object-tools %}
{% if change %}{% if not is_popup %}
<ul class="object-tools">
{% block object-tools-items %}
<li>
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
<a href="{% add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>
</li>
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif %}
{% endblock %}
</ul>
{% endif %}{% endif %}
{% endblock %}
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
{% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %}
{% if show_workflow_line%}
<fieldset class="module aligned workflow">
<h2>{% trans "workflow approve" %}</h2>
<div style="padding:10px">
{% if can_restart %}
<a class="button" href="restart/{{workflow_instance.id}}" id="workflow_restart">{% trans "restart workflow" %}</a>
<p style="float:right;color:#666">{% trans "your apply has been denied,you can restart a new apply" %}</p>
{% else %}
<label class="control"><input type="radio" name="operation" value="1" checked> {% trans "agree" %}</label>
<label class="control"><input type="radio" name="operation" value="3"> {% trans "deny" %}</label>
<label class="control"><input type="radio" name="operation" value="4"> {% trans "terminate" %}</label>
<a class="button" href="approve/1" id="workflow_submit">{% trans "submit" %}</a>
{% endif %}
</div>
</fieldset>
{% endif %}
{% if errors %}
<p class="errornote">
{% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
</p>
{{ adminform.form.non_field_errors }}
{% endif %}
{% block field_sets %}
{% for fieldset in adminform %}
{% include "admin/includes/fieldset.html" %}
{% endfor %}
{% endblock %}
{% block after_field_sets %}{% endblock %}
{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include inline_admin_formset.opts.template %}
{% endfor %}
{% endblock %}
{% block after_related_objects %}{% endblock %}
{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
{% block admin_change_form_document_ready %}
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('.add-another').click(function(e) {
e.preventDefault();
showAddAnotherPopup(this);
});
$('.related-lookup').click(function(e) {
e.preventDefault();
showRelatedObjectLookupPopup(this);
});
$("div.inline-group tr").removeClass("has_original");
$("td.original p").hide();
{% if adminform and add %}
$('form#{{ opts.model_name }}_form :input:visible:enabled:first').focus()
{% endif %}
{% if workflow_modal %}
{% if workflow_instance %}
workflow_modal = "{{ workflow_modal.code }}";
workflow_instance = "{{ workflow_instance.code }}";
$('tr.add-row').hide();
$('input,select').attr('disabled','true');
$('div.submit-row').hide();
$('.workflow input,.workflow select').removeAttr("disabled");
$("#workflow_submit").hide();
{% endif %}
{% else %}
$("#workflow_submit").hide();
{% endif %}
{% if extra_buttons %}
{% for button in extra_buttons %}
$("<a href='{{button.href}}' class='button'>{{button.title}}</a>").insertAfter("#workflow_submit");
{% endfor %}
{% endif %}
{% if readonly %}
$('input,select').attr('disabled',true);
$('div.submit-row').hide();
$('tr.add-row').hide();
{% endif %}
});
})(django.jQuery);
</script>
{% endblock %}
{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
</div>
</form></div>
{% endblock %}
@@ -0,0 +1,27 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} delete-confirmation{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
&rsaquo; {% if action_name %}{{action_name}} {% else %} {% trans 'action' %}{% endif %}
</div>
{% endblock %}
{% block content %}
<p> {% trans 'Are your sure to execute the operations?' %} </p>
<form action="" method="post">{% csrf_token %}
<div>
<input type="hidden" name="post" value="yes" />
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
<input type="submit" value="{% trans "Yes, I'm sure" %}" />
<a href="#" onclick="window.history.back(); return false;" class="button cancel-link">{% trans "No, take me back" %}</a>
</div>
</form>
{% endblock %}
@@ -0,0 +1,137 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls admin_static admin_modify %}
{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{{ media }}
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block coltype %}colM{% endblock %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %}
{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
&rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
</div>
{% endblock %}
{% endif %}
{% block content %}<div id="content-main">
{% block object-tools %}
{% if change %}{% if not is_popup %}
<ul class="object-tools">
{% block object-tools-items %}
<li>
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
<a href="{% add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>
</li>
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif %}
{% endblock %}
</ul>
{% endif %}{% endif %}
{% endblock %}
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
{% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %}
{% if show_workflow_line%}
<fieldset class="module aligned workflow">
<h2>{% trans "workflow approve" %}</h2>
<div style="padding:10px">
{% if can_restart %}
<a class="button" href="restart/{{workflow_instance.id}}" id="workflow_restart">{% trans "restart workflow" %}</a>
<p style="float:right;color:#666">{% trans "your apply has been denied,you can restart a new apply" %}</p>
{% else %}
<label class="control"><input type="radio" name="operation" value="1" checked> {% trans "agree" %}</label>
<label class="control"><input type="radio" name="operation" value="3"> {% trans "deny" %}</label>
<label class="control"><input type="radio" name="operation" value="4"> {% trans "terminate" %}</label>
<a class="button" href="approve/1" id="workflow_submit">{% trans "submit" %}</a>
{% endif %}
</div>
</fieldset>
{% endif %}
{% if errors %}
<p class="errornote">
{% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
</p>
{{ adminform.form.non_field_errors }}
{% endif %}
{% block field_sets %}
{% for fieldset in adminform %}
{% include "admin/includes/fieldset.html" %}
{% endfor %}
{% endblock %}
{% block after_field_sets %}{% endblock %}
{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include inline_admin_formset.opts.template %}
{% endfor %}
{% endblock %}
{% block after_related_objects %}{% endblock %}
{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
{% block admin_change_form_document_ready %}
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('.add-another').click(function(e) {
e.preventDefault();
showAddAnotherPopup(this);
});
$('.related-lookup').click(function(e) {
e.preventDefault();
showRelatedObjectLookupPopup(this);
});
$("div.inline-group tr").removeClass("has_original");
$("td.original p").hide();
{% if adminform and add %}
$('form#{{ opts.model_name }}_form :input:visible:enabled:first').focus()
{% endif %}
{% if workflow_modal %}
{% if workflow_instance %}
workflow_modal = "{{ workflow_modal.code }}";
workflow_instance = "{{ workflow_instance.code }}";
$('tr.add-row').hide();
$('input,select,textarea').attr('disabled','true');
$('div.submit-row').hide();
$('.workflow input,.workflow select').removeAttr("disabled");
$("#workflow_submit").hide();
{% endif %}
{% else %}
$("#workflow_submit").hide();
{% endif %}
{% if extra_buttons %}
{% for button in extra_buttons %}
$("<a href='{{button.href}}' class='button'>{{button.title}}</a>").insertAfter("#workflow_submit");
{% endfor %}
{% endif %}
{% if readonly %}
$('input,select,textarea').attr('disabled',true);
$('div.submit-row').hide();
$('tr.add-row').hide();
{% endif %}
$('div.inline-group select').attr('disabled',true);
});
})(django.jQuery);
</script>
{% endblock %}
{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
</div>
</form></div>
{% endblock %}
@@ -0,0 +1,27 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} delete-confirmation{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
&rsaquo; {% trans 'action' %}
</div>
{% endblock %}
{% block content %}
<p> {% trans 'Are your sure to execute the check out operations?' %} </p>
<form action="" method="post">{% csrf_token %}
<div>
<input type="hidden" name="post" value="yes" />
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
<input type="submit" value="{% trans "Yes, I'm sure" %}" />
<a href="#" onclick="window.history.back(); return false;" class="button cancel-link">{% trans "No, take me back" %}</a>
</div>
</form>
{% endblock %}
+82
View File
@@ -0,0 +1,82 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls %}
{% block extrastyle %}
<link rel="stylesheet" type="text/css" href="/static/css/maximus.css" />
{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
&rsaquo; {% trans 'History' %}
</div>
{% endblock %}
{% block content %}
<div id="content-main">
<div class="module">
{% if action_list %}
<table id="change-history">
<thead>
<tr>
<th scope="col">{% trans 'Date/time' %}</th>
<th scope="col">{% trans 'User' %}</th>
<th scope="col">{% trans 'Action' %}</th>
</tr>
</thead>
<tbody>
{% for action in action_list %}
<tr>
<th scope="row">{{ action.action_time|date:"DATETIME_FORMAT" }}</th>
<td>{{ action.user.get_username }}{% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}</td>
<td>{{ action.change_message }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{% trans "This object doesn't have a change history. It probably wasn't added via this admin site." %}</p>
{% endif %}
</div>
{% if history_list %}
<h1 style="margin-top:15px">{% trans "Workflow History" %}</h1>
<div class="module">
<table id="workflow-history">
<thead>
<tr>
<th scope="col">{% trans 'Date/time' %}</th>
<th scope="col">{% trans 'User' %}</th>
<th scope="col">{% trans 'node' %}</th>
<th scope="col">{% trans 'Action' %}</th>
<th scope="col">{% trans 'Workflow Memo' %}</th>
</tr>
</thead>
<tbody>
{% for history in history_list %}
<tr>
<th scope="row">{{ history.pro_time|date:"DATETIME_FORMAT" }}</th>
<td class="col">{{ history.user.get_username }}{% if history.user.get_full_name %} ({{ history.user.get_full_name }}){% endif %}</td>
<td class="col">{{ history.get_node_desc }}</td>
<td class="col">{{ history.get_action_desc }}</td>
<td>{{ history.get_memo_desc }}</td>
</tr>
{% endfor %}
{% if todo_list %}
{% for todo in todo_list %}
<tr>
<th scope="row">{% if todo.is_read %}{{ todo.read_time|date:"DATETIME_FORMAT" }}{% endif %}</th>
<td class="col">{{ todo.user.get_username }}{% if todo.user.get_full_name %} ({{ todo.user.get_full_name }}){% endif %}</td>
<td class="col">{{ todo.node.name }}</td>
<td class="col">{% if todo.is_read %} {% trans 'already read' %} {% else %} {% trans 'unread' %} {% endif %}</td>
<td></td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
{% endif %}
</div>
{% endblock %}
@@ -0,0 +1,173 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls admin_static admin_modify %}
{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{{ media }}
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block coltype %}colM{% endblock %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %}
{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
&rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
</div>
{% endblock %}
{% endif %}
{% block content %}<div id="content-main">
{% block object-tools %}
{% if change %}{% if not is_popup %}
<ul class="object-tools">
{% block object-tools-items %}
<li>
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
<a href="{% add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>
</li>
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif %}
{% endblock %}
</ul>
{% endif %}{% endif %}
{% endblock %}
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
{% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %}
{% if show_workflow_line%}
<fieldset class="module aligned workflow">
<h2>{% trans "workflow approve" %}</h2>
<div style="padding:10px">
{% if can_restart %}
<a class="button" href="restart/{{workflow_instance.id}}" id="workflow_restart">{% trans "restart workflow" %}</a>
<p style="float:right;color:#666">{% trans "your apply has been denied,you can restart a new apply" %}</p>
{% else %}
<label class="control"><input type="radio" name="operation" value="1" checked> {% trans "agree" %}</label>
<label class="control"><input type="radio" name="operation" value="3"> {% trans "deny" %}</label>
<label class="control"><input type="radio" name="operation" value="4"> {% trans "terminate" %}</label>
<a class="button" href="approve/1" id="workflow_approve">{% trans "submit" %}</a>
{% endif %}
</div>
</fieldset>
{% endif %}
{% if errors %}
<p class="errornote">
{% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
</p>
{{ adminform.form.non_field_errors }}
{% endif %}
{% block field_sets %}
{% for fieldset in adminform %}
{% include "admin/includes/fieldset.html" %}
{% endfor %}
{% endblock %}
{% block after_field_sets %}{% endblock %}
{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include inline_admin_formset.opts.template %}
{% endfor %}
{% endblock %}
{% block after_related_objects %}{% endblock %}
{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
{% block admin_change_form_document_ready %}
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('.add-another').click(function(e) {
e.preventDefault();
showAddAnotherPopup(this);
});
$('.related-lookup').click(function(e) {
e.preventDefault();
showRelatedObjectLookupPopup(this);
});
{% if adminform and add %}
$('form#{{ opts.model_name }}_form :input:visible:enabled:first').focus()
{% endif %}
{% if workflow_modal %}
{% if workflow_instance %}
workflow_modal = "{{ workflow_modal.code }}";
workflow_instance = "{{ workflow_instance.code }}";
$('tr.add-row').hide();
{% if can_edit %}
$('a.deletelink').hide();
$("#workflow_submit").hide();
$("input[name='_addanother']").hide();
$("input[name='_continue']").hide();
{% else %}
$('input,select,textarea').attr('disabled','true');
$('div.submit-row').hide();
$('.workflow input,.workflow select').removeAttr("disabled");
$("#workflow_submit").hide();
{% endif %}
{% endif %}
{% else %}
$("#workflow_submit").hide();
{% endif %}
{% if extra_buttons %}
{% for button in extra_buttons %}
$("<a href='{{button.href}}' class='button'>{{button.title}}</a>").insertAfter("#workflow_submit");
{% endfor %}
{% endif %}
{% if readonly %}
$('input,select,textarea').attr('disabled',true);
$('div.submit-row').hide();
$('tr.add-row').hide();
{% endif %}
try{
$("div.inline-group table tbody tr.form-row").removeClass('has_original');
$("div.inline-group table tbody tr.form-row td:first-child").find('p').hide();
}catch(e){
}
});
$('#id_classification').bind('change',function(){
var c = $("select[name='classification'] option:selected").val();
//alert(c);
if(c=='R' || c=='Q'){
$("label[for='id_service']").removeClass('required');
$('#woitem_set-group').hide();
$('#woextravalue_set-group').hide();
$('div.field-service').hide();
$('div.field-detail').hide();
}else{
$('#woitem_set-group').show();
$('#woextravalue_set-group').show();
$('div.field-service').show();
if(c=='D'){
$("label[for='id_service']").removeClass('required');
$('div.field-detail').show();
}
if(c=='S'){
$('div.field-detail').hide();
$("label[for='id_service']").addClass('required');
}
}
});
$('#woextravalue_set-group').hide();
})(django.jQuery);
</script>
{% endblock %}
{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
</div>
</form></div>
{% endblock %}
+18
View File
@@ -0,0 +1,18 @@
{% load i18n admin_urls %}
<div class="submit-row">
{% if show_save %}<input type="submit" value="{% trans 'Save' %}" class="default" name="_save" />{% endif %}
<a href="start" class="button" id="workflow_submit">{% trans "submit" %}</a>
{% for button in extra_buttons %}
<a href="{{button.href}}" class="button">{{button.title}}</a>
{% endfor %}
{{extra_buttons}}
{% if show_delete_link %}
{% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %}
<p class="deletelink-box"><a href="{% add_preserved_filters delete_url %}" class="deletelink">{% trans "Delete" %}</a>
</p>
{% endif %}
{% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" />{% endif %}
{% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" />{% endif %}
{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" />{% endif %}
</div>
@@ -0,0 +1,164 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls admin_static admin_modify %}
{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{{ media }}
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block coltype %}colM{% endblock %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %}
{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
&rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
</div>
{% endblock %}
{% endif %}
{% block content %}<div id="content-main">
{% block object-tools %}
{% if change %}{% if not is_popup %}
<ul class="object-tools">
{% block object-tools-items %}
<li>
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
<a href="{% add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>
</li>
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif %}
{% endblock %}
</ul>
{% endif %}{% endif %}
{% endblock %}
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
{% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %}
{% if show_workflow_line%}
<fieldset class="module aligned workflow">
<h2>{% trans "workflow approve" %}</h2>
<div style="padding:10px">
{% if can_restart %}
<a class="button" href="restart/{{workflow_instance.id}}" id="workflow_restart">{% trans "restart workflow" %}</a>
<p style="float:right;color:#666">{% trans "your apply has been denied,you can restart a new apply" %}</p>
{% else %}
<label class="control"><input type="radio" name="operation" value="1" checked> {% trans "agree" %}</label>
<label class="control"><input type="radio" name="operation" value="3"> {% trans "deny" %}</label>
<label class="control"><input type="radio" name="operation" value="4"> {% trans "terminate" %}</label>
<a class="button" href="approve/1" id="workflow_approve">{% trans "submit" %}</a>
{% endif %}
</div>
</fieldset>
{% endif %}
{% if errors %}
<p class="errornote">
{% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
</p>
{{ adminform.form.non_field_errors }}
{% endif %}
{% block field_sets %}
{% for fieldset in adminform %}
{% include "admin/includes/fieldset.html" %}
{% endfor %}
{% endblock %}
{% block after_field_sets %}{% endblock %}
{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include inline_admin_formset.opts.template %}
{% endfor %}
{% endblock %}
{% block after_related_objects %}{% endblock %}
{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
{% block admin_change_form_document_ready %}
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('.add-another').click(function(e) {
e.preventDefault();
showAddAnotherPopup(this);
});
$('.related-lookup').click(function(e) {
e.preventDefault();
showRelatedObjectLookupPopup(this);
});
{% if adminform and add %}
$('form#{{ opts.model_name }}_form :input:visible:enabled:first').focus()
{% endif %}
{% if workflow_modal %}
{% if workflow_instance %}
workflow_modal = "{{ workflow_modal.code }}";
workflow_instance = "{{ workflow_instance.code }}";
$('tr.add-row').hide();
$('input,select,textarea').attr('disabled','true');
$('div.submit-row').hide();
$('.workflow input,.workflow select').removeAttr("disabled");
$("#workflow_submit").hide();
{% endif %}
{% else %}
$("#workflow_submit").hide();
{% endif %}
{% if extra_buttons %}
{% for button in extra_buttons %}
$("<a href='{{button.href}}' class='button'>{{button.title}}</a>").insertAfter("#workflow_submit");
{% endfor %}
{% endif %}
{% if readonly %}
$('input,select,textarea').attr('disabled',true);
$('div.submit-row').hide();
$('tr.add-row').hide();
{% endif %}
try{
$("div.inline-group table tbody tr.form-row").removeClass('has_original');
$("div.inline-group table tbody tr.form-row td:first-child").find('p').hide();
}catch(e){
}
});
$("input[name='handler_type']").bind('click',function(){
v = $("input[name='handler_type']:checked").val();
if(v==1){
$('div.field-users').show();
$('div.field-positions').hide();
$('div.field-roles').hide();
}else if(v==2){
$('div.field-users').hide();
$('div.field-positions').show();
$('div.field-roles').hide();
}else if(v==3){
$('div.field-users').hide();
$('div.field-positions').hide();
$('div.field-roles').show();
}else if(v==4){
$('div.field-users').hide();
$('div.field-positions').hide();
$('div.field-roles').hide();
}
});
$('div.field-users').show();
$('div.field-positions').hide();
$('div.field-roles').hide();
})(django.jQuery);
</script>
{% endblock %}
{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
</div>
</form></div>
{% endblock %}
@@ -0,0 +1,67 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="/static/css/maximus.css" />{% endblock %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} delete-confirmation{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
&rsaquo; {% trans 'workflow approve' %}
</div>
{% endblock %}
{% block content %}
{% if operation == '4' %}
<p>{% trans "Are you sure to terminate the request?" %}</p>
{% elif operation == '3' %}
<p>{% trans "Are you sure to deny the request?" %}</p>
{% else %}
<p>{% blocktrans with escaped_object=object %}Are you sure you want to submit the {{ object_name }} "{{ escaped_object }}"? {% endblocktrans %}</p>
{% endif%}
<h3> {{ workflow_modal.code }} {{ workflow_modal.name }} </h3>
<form action="" method="post">{% csrf_token %}
{% if is_stop_node %}
<p> {% trans "current node is stop node,click the submit button to complete it" %} </p>
{% else %}
{% for node_user in node_users %}
{% if node_user.node == 'start'%}
<p class="next-node">{% trans "back to start node" %}</p>
{%else%}
<p class="next-node">{% trans "next node" %}{{ node_user.node.name }}</p>
{% endif%}
{% if next_node_description %}
<p class="tooltip">{% trans "attention" %}{{next_node_description}}</p>
{% endif %}
{% if node_has_users %}
<ul class="node-users">
{% for user in node_user.users %}
<li><input type="checkbox" name="{{checkbox_name}}" value="{{user.id}}" checked> {{user.last_name}}{{user.first_name}}</li>
{% endfor %}
</ul>
{% else %}
<p>{% trans "No user was configured to handle this node"%}</p>
{% endif %}
{% endfor%}
{% endif%}
{% if is_stop_node or node_has_users%}
<label style="display:block">{% trans "Workflow Memo" %}</label>
<textarea name="memo" rows="3" cols="80"></textarea>
<div class="workflow_approve_command">
<input type="hidden" name="post" value="yes" />
<input type="hidden" name="oper_type" value="{{operation}}" />
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
<input type="submit" value="{% trans "Yes, I'm sure" %}" />
<a href="#" onclick="window.history.back(); return false;" class="button cancel-link">{% trans "No, take me back" %}</a>
</div>
{% else %}
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
<a href="#" onclick="window.history.back(); return false;" class="button cancel-link">{% trans "No, take me back" %}</a>
{% endif %}
</form>
{% endblock %}
@@ -0,0 +1,46 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} delete-confirmation{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
&rsaquo; {% trans 'submit' %}
</div>
{% endblock %}
{% block content %}
{% if has_workflow %}
<p>{% blocktrans with escaped_object=object %}Are you sure you want to submit the {{ object_name }} "{{ escaped_object }}"? {% endblocktrans %}</p>
<h3> {{ workflow_modal.code }} {{ workflow_modal.name }} </h3>
<form action="" method="post">{% csrf_token %}
{% if next_node %}
<p class="next-node">{% trans "next node" %}{{ next_node.name }}</p>
{% if has_next_user %}
<ul class="node-users">
{% for user in next_users %}
<li><input type="checkbox" name="{{checkbox_name}}" value="{{user.id}}" checked> {{user.last_name}}{{user.first_name}}</li>
{% endfor %}
</ul>
{% else %}
<p>{% trans "No user was configured to handle this node"%}</p>
{% endif %}
{% endif %}
<div>
<input type="hidden" name="post" value="yes" />
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %}
<input type="submit" value="{% trans "Yes, I'm sure" %}" />
<a href="#" onclick="window.history.back(); return false;" class="button cancel-link">{% trans "No, take me back" %}</a>
</div>
</form>
{% else %}
<p>{% trans "you needs to config a workflow model for this content type" %}</p>
<a href="#" onclick="window.history.back(); return false;" class="button cancel-link">{% trans "OK" %}</a>
{% endif %}
{% endblock %}