code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
# -*- coding: utf-8 -*- from django.conf import settings from django.utils.cache import patch_cache_control from google.appengine.runtime.apiproxy_errors import CapabilityDisabledError from google.appengine.ext import db from ragendja.template import render_to_response from ragendja.views import server_error, maintenance LOGIN_REQUIRED_PREFIXES = getattr(settings, 'LOGIN_REQUIRED_PREFIXES', ()) NO_LOGIN_REQUIRED_PREFIXES = getattr(settings, 'NO_LOGIN_REQUIRED_PREFIXES', ()) class LoginRequiredMiddleware(object): """ Redirects to login page if request path begins with a LOGIN_REQURED_PREFIXES prefix. You can also specify NO_LOGIN_REQUIRED_PREFIXES which take precedence. """ def process_request(self, request): for prefix in NO_LOGIN_REQUIRED_PREFIXES: if request.path.startswith(prefix): return None for prefix in LOGIN_REQUIRED_PREFIXES: if request.path.startswith(prefix) and \ not request.user.is_authenticated(): from django.contrib.auth.views import redirect_to_login return redirect_to_login(request.get_full_path()) return None class NoHistoryCacheMiddleware(object): """ If user is authenticated we disable browser caching of pages in history. """ def process_response(self, request, response): if 'Expires' not in response and \ 'Cache-Control' not in response and \ hasattr(request, 'session') and \ request.user.is_authenticated(): patch_cache_control(response, no_store=True, no_cache=True, must_revalidate=True, max_age=0) return response class ErrorMiddleware(object): """Displays a default template on CapabilityDisabledError.""" def process_exception(self, request, exception): if isinstance(exception, CapabilityDisabledError): return maintenance(request) elif isinstance(exception, db.Timeout): return server_error(request)
100uhaco
trunk/GAE/common/appenginepatch/ragendja/middleware.py
Python
asf20
2,050
# -*- coding: utf-8 -*- from settings import * import sys if '%d' in MEDIA_URL: MEDIA_URL = MEDIA_URL % MEDIA_VERSION if '%s' in ADMIN_MEDIA_PREFIX: ADMIN_MEDIA_PREFIX = ADMIN_MEDIA_PREFIX % MEDIA_URL TEMPLATE_DEBUG = DEBUG MANAGERS = ADMINS # You can override Django's or some apps' locales with these folders: if os.path.exists(os.path.join(COMMON_DIR, 'locale_overrides_common')): INSTALLED_APPS += ('locale_overrides_common',) if os.path.exists(os.path.join(PROJECT_DIR, 'locale_overrides')): INSTALLED_APPS += ('locale_overrides',) # Add admin interface media files if necessary if 'django.contrib.admin' in INSTALLED_APPS: INSTALLED_APPS += ('django_aep_export.admin_media',) # Always add Django templates (exported from zip) INSTALLED_APPS += ( 'django_aep_export.django_templates', ) # Convert all COMBINE_MEDIA to lists for key, value in COMBINE_MEDIA.items(): if not isinstance(value, list): COMBINE_MEDIA[key] = list(value) # Add start markers, so apps can insert JS/CSS at correct position def add_app_media(combine, *appmedia): if on_production_server: return COMBINE_MEDIA.setdefault(combine, []) if '!START!' not in COMBINE_MEDIA[combine]: COMBINE_MEDIA[combine].insert(0, '!START!') index = COMBINE_MEDIA[combine].index('!START!') COMBINE_MEDIA[combine][index:index] = appmedia def add_uncombined_app_media(app): """Copy all media files directly""" if on_production_server: return path = os.path.join( os.path.dirname(__import__(app, {}, {}, ['']).__file__), 'media') app = app.rsplit('.', 1)[-1] for root, dirs, files in os.walk(path): for file in files: if file.endswith(('.css', '.js')): base = os.path.join(root, file)[len(path):].replace(os.sep, '/').lstrip('/') target = '%s/%s' % (app, base) add_app_media(target, target) if have_appserver or on_production_server: check_app_imports = None else: def check_app_imports(app): before = sys.modules.keys() __import__(app, {}, {}, ['']) after = sys.modules.keys() added = [key[len(app)+1:] for key in after if key not in before and key.startswith(app + '.') and key[len(app)+1:]] if added: import logging logging.warn('The app "%(app)s" contains imports in ' 'its __init__.py (at least %(added)s). This can cause ' 'strange bugs due to recursive imports! You should ' 'either do the import lazily (within functions) or ' 'ignore the app settings/urlsauto with ' 'IGNORE_APP_SETTINGS and IGNORE_APP_URLSAUTO in ' 'your settings.py.' % {'app': app, 'added': ', '.join(added)}) # Import app-specific settings _globals = globals() class _Module(object): def __setattr__(self, key, value): _globals[key] = value def __getattribute__(self, key): return _globals[key] def __hasattr__(self, key): return key in _globals settings = _Module() for app in INSTALLED_APPS: # This is an optimization. Django's apps don't have special settings. # Also, allow for ignoring some apps' settings. if app.startswith('django.') or app.endswith('.*') or \ app == 'appenginepatcher' or app in IGNORE_APP_SETTINGS: continue try: # First we check if __init__.py doesn't import anything if check_app_imports: check_app_imports(app) __import__(app + '.settings', {}, {}, ['']) except ImportError: pass # Remove start markers for key, value in COMBINE_MEDIA.items(): if '!START!' in value: value.remove('!START!') try: from settings_overrides import * except ImportError: pass
100uhaco
trunk/GAE/common/appenginepatch/ragendja/settings_post.py
Python
asf20
3,930
# -*- coding: utf-8 -*- from django.db.models import signals from django.http import Http404 from django.utils import simplejson from google.appengine.ext import db from ragendja.pyutils import getattr_by_path from random import choice from string import ascii_letters, digits def get_filters(*filters): """Helper method for get_filtered.""" if len(filters) % 2 == 1: raise ValueError('You must supply an even number of arguments!') return zip(filters[::2], filters[1::2]) def get_filtered(data, *filters): """Helper method for get_xxx_or_404.""" for filter in get_filters(*filters): data.filter(*filter) return data def get_object(model, *filters_or_key, **kwargs): if kwargs.get('key_name'): item = model.get_by_key_name(kwargs.get('key_name'), parent=kwargs.get('parent')) elif kwargs.get('id'): item = model.get_by_id(kwargs.get('id'), parent=kwargs.get('parent')) elif len(filters_or_key) > 1: item = get_filtered(model.all(), *filters_or_key).get() else: error = None if isinstance(filters_or_key[0], (tuple, list)): error = [None for index in range(len(filters_or_key[0]))] try: item = model.get(filters_or_key[0]) except (db.BadKeyError, db.KindError): return error return item def get_object_or_404(model, *filters_or_key, **kwargs): item = get_object(model, *filters_or_key, **kwargs) if not item: raise Http404('Object does not exist!') return item def get_object_list(model, *filters): return get_filtered(model.all(), *filters) def get_list_or_404(model, *filters): data = get_object_list(model, *filters) if not data.count(1): raise Http404('No objects found!') return data KEY_NAME_PREFIX = 'k' def generate_key_name(*values): """ Escapes a string such that it can be used safely as a key_name. You can pass multiple values in order to build a path. """ return KEY_NAME_PREFIX + '/'.join( [value.replace('%', '%1').replace('/', '%2') for value in values]) def transaction(func): """Decorator that always runs the given function in a transaction.""" def _transaction(*args, **kwargs): return db.run_in_transaction(func, *args, **kwargs) # In case you need to run it without a transaction you can call # <func>.non_transactional(...) _transaction.non_transactional = func return _transaction @transaction def db_add(model, key_name, parent=None, **kwargs): """ This function creates an object transactionally if it does not exist in the datastore. Otherwise it returns None. """ existing = model.get_by_key_name(key_name, parent=parent) if not existing: new_entity = model(parent=parent, key_name=key_name, **kwargs) new_entity.put() return new_entity return None def db_create(model, parent=None, key_name_format=u'%s', non_transactional=False, **kwargs): """ Creates a new model instance with a random key_name and puts it into the datastore. """ func = non_transactional and db_add.non_transactional or db_add charset = ascii_letters + digits while True: # The key_name is 16 chars long. Make sure that the first char doesn't # begin with a digit. key_name = key_name_format % (choice(ascii_letters) + ''.join([choice(charset) for i in range(15)])) result = func(model, key_name, parent=parent, **kwargs) if result: return result def prefetch_references(object_list, references, cache=None): """ Dereferences the given (Key)ReferenceProperty fields of a list of objects in as few get() calls as possible. """ if object_list and references: if not isinstance(references, (list, tuple)): references = (references,) model = object_list[0].__class__ targets = {} # Collect models and keys of all reference properties. # Storage format of targets: models -> keys -> instance, property for name in set(references): property = getattr(model, name) is_key_reference = isinstance(property, KeyReferenceProperty) if is_key_reference: target_model = property.target_model else: target_model = property.reference_class prefetch = targets.setdefault(target_model.kind(), (target_model, {}))[1] for item in object_list: if is_key_reference: # Check if we already dereferenced the property if hasattr(item, '_ref_cache_for_' + property.target_name): continue key = getattr(item, property.target_name) if property.use_key_name and key: key = db.Key.from_path(target_model.kind(), key) else: if ReferenceProperty.is_resolved(property, item): continue key = property.get_value_for_datastore(item) if key: # Check if we already have a matching item in cache if cache: found_cached = None for cached_item in cache: if cached_item.key() == key: found_cached = cached_item if found_cached: setattr(item, name, found_cached) continue # No item found in cache. Retrieve it. key = str(key) prefetch[key] = prefetch.get(key, ()) + ((item, name),) for target_model, prefetch in targets.values(): prefetched_items = target_model.get(prefetch.keys()) for prefetched, group in zip(prefetched_items, prefetch.values()): for item, reference in group: # If prefetched is None we only update the cache if not prefetched: property = getattr(model, reference) if isinstance(property, KeyReferenceProperty): setattr(item, '_ref_cache_for_' + property.target_name, None) else: continue setattr(item, reference, prefetched) return object_list # Deprecated due to uglyness! :) class KeyReferenceProperty(object): """ Creates a cached accessor for a model referenced by a string property that stores a str(key) or key_name. This is useful if you need to work with the key of a referenced object, but mustn't get() it from the datastore. You can also integrate properties of the referenced model into the referencing model, so you don't need to dereference the model within a transaction. Note that if the referenced model's properties change you won't be notified, automatically. """ def __init__(self, property, model, use_key_name=True, integrate={}): if isinstance(property, basestring): self.target_name = property else: # Monkey-patch the target property, so we can monkey-patch the # model class, so we can detect when the user wants to set our # KeyReferenceProperty via the model constructor. # What an ugly hack; but this is the simplest implementation. :( # One alternative would be to implement a proxy model that # provides direct access to the key, but this won't work with # isinstance(). Maybe that's an option for Python 3000. # Yet another alternative would be to force the user to choose # either .key_name or .reference manually. That's rather ugly, too. self.target_name = None myself = self old_config = property.__property_config__ def __property_config__(model_class, property_name): myself.target_name = property_name my_name = None for key, value in model_class.__dict__.items(): if value is myself: my_name = key break old_init = model_class.__init__ def __init__(self, *args, **kwargs): if my_name in kwargs: setattr(self, my_name, kwargs[my_name]) kwargs[property_name] = getattr(self, property_name) for destination, source in myself.integrate.items(): integrate_value = None if kwargs[my_name]: try: property = getattr(self.__class__, source) except: property = None if property and isinstance(property, db.ReferenceProperty): integrate_value = property.get_value_for_datastore(self) else: integrate_value = getattr_by_path( kwargs[my_name], source) kwargs[destination] = integrate_value old_init(self, *args, **kwargs) model_class.__init__ = __init__ old_config(model_class, property_name) property.__property_config__ = __property_config__ self.target_model = model self.use_key_name = use_key_name self.integrate = integrate def __get__(self, instance, unused): if instance is None: return self attr = getattr(instance, self.target_name) cache = getattr(instance, '_ref_cache_for_' + self.target_name, None) if not cache: cache_key = cache elif self.use_key_name: cache_key = cache.key().name() else: cache_key = str(cache.key()) if attr != cache_key: if self.use_key_name: cache = self.target_model.get_by_key_name(attr) else: cache = self.target_model.get(attr) setattr(instance, '_ref_cache_for_' + self.target_name, cache) return cache def __set__(self, instance, value): if value and not isinstance(value, db.Model): raise ValueError('You must supply a Model instance.') if not value: key = None elif self.use_key_name: key = value.key().name() else: key = str(value.key()) setattr(instance, '_ref_cache_for_' + self.target_name, value) setattr(instance, self.target_name, key) for destination, source in self.integrate.items(): integrate_value = None if value: try: property = getattr(value.__class__, source) except: property = None if property and isinstance(property, db.ReferenceProperty): integrate_value = property.get_value_for_datastore(value) else: integrate_value = getattr_by_path(value, source) setattr(instance, destination, integrate_value) # Don't use this, yet. It's not part of the official API! class ReferenceProperty(db.ReferenceProperty): def __init__(self, reference_class, integrate={}, **kwargs): self.integrate = integrate super(ReferenceProperty, self).__init__(reference_class, **kwargs) @classmethod def is_resolved(cls, property, instance): try: if not hasattr(instance, property.__id_attr_name()) or \ not getattr(instance, property.__id_attr_name()): return True return bool(getattr(instance, property.__resolved_attr_name())) except: import logging logging.exception('ReferenceProperty implementation changed! ' 'Update ragendja.dbutils.ReferenceProperty.' 'is_resolved! Exception was:') return False def __set__(self, instance, value): super(ReferenceProperty, self).__set__(instance, value) for destination, source in self.integrate.items(): integrate_value = None if value: try: property = getattr(value.__class__, source) except: property = None if property and isinstance(property, db.ReferenceProperty): integrate_value = property.get_value_for_datastore(value) else: integrate_value = getattr_by_path(value, source) setattr(instance, destination, integrate_value) def to_json_data(model_instance, property_list): """ Converts a models into dicts for use with JSONResponse. You can either pass a single model instance and get a single dict or a list of models and get a list of dicts. For security reasons only the properties in the property_list will get added. If the value of the property has a json_data function its result will be added, instead. """ if hasattr(model_instance, '__iter__'): return [to_json_data(item, property_list) for item in model_instance] json_data = {} for property in property_list: property_instance = None try: property_instance = getattr(model_instance.__class__, property.split('.', 1)[0]) except: pass key_access = property[len(property.split('.', 1)[0]):] if isinstance(property_instance, db.ReferenceProperty) and \ key_access in ('.key', '.key.name'): key = property_instance.get_value_for_datastore(model_instance) if key_access == '.key': json_data[property] = str(key) else: json_data[property] = key.name() continue value = getattr_by_path(model_instance, property, None) value = getattr_by_path(value, 'json_data', value) json_data[property] = value return json_data def _get_included_cleanup_entities(entities, rels_seen, to_delete, to_put): # Models can define a CLEANUP_REFERENCES attribute if they have # reference properties that must get geleted with the model. include_references = getattr(entities[0], 'CLEANUP_REFERENCES', None) if include_references: if not isinstance(include_references, (list, tuple)): include_references = (include_references,) prefetch_references(entities, include_references) for entity in entities: for name in include_references: subentity = getattr(entity, name) to_delete.append(subentity) get_cleanup_entities(subentity, rels_seen=rels_seen, to_delete=to_delete, to_put=to_put) def get_cleanup_entities(instance, rels_seen=None, to_delete=None, to_put=None): if not instance or getattr(instance, '__handling_delete', False): return [], [], [] if to_delete is None: to_delete = [] if to_put is None: to_put = [] if rels_seen is None: rels_seen = [] # Delete many-to-one relations for related in instance._meta.get_all_related_objects(): # Check if we already have fetched some of the entities seen = (instance.key(), related.opts, related.field.name) if seen in rels_seen: continue rels_seen.append(seen) entities = getattr(instance, related.get_accessor_name(), related.model.all().filter(related.field.name + ' =', instance)) entities = entities.fetch(501) for entity in entities[:]: # Check if we might already have fetched this entity for item in to_delete: if item.key() == entity.key(): entities.remove(entity) break for item in to_put: if item.key() == entity.key(): to_put.remove(item) break to_delete.extend(entities) if len(to_delete) > 200: raise Exception("Can't delete so many entities at once!") if not entities: continue for entity in entities: get_cleanup_entities(entity, rels_seen=rels_seen, to_delete=to_delete, to_put=to_put) _get_included_cleanup_entities(entities, rels_seen, to_delete, to_put) # Clean up many-to-many relations for related in instance._meta.get_all_related_many_to_many_objects(): seen = (instance.key(), related.opts, related.field.name) if seen in rels_seen: continue rels_seen.append(seen) entities = getattr(instance, related.get_accessor_name(), related.model.all().filter(related.field.name + ' =', instance)) entities = entities.fetch(501) for entity in entities[:]: # Check if we might already have fetched this entity for item in to_put + to_delete: if item.key() == entity.key(): entities.remove(entity) entity = item break # We assume that data is a list. Remove instance from the list. data = getattr(entity, related.field.name) data = [item for item in data if (isinstance(item, db.Key) and item != instance.key()) or item.key() != instance.key()] setattr(entity, related.field.name, data) to_put.extend(entities) if len(to_put) > 200: raise Exception("Can't change so many entities at once!") return rels_seen, to_delete, to_put def cleanup_relations(instance, **kwargs): if getattr(instance, '__handling_delete', False): return rels_seen, to_delete, to_put = get_cleanup_entities(instance) _get_included_cleanup_entities((instance,), rels_seen, to_delete, to_put) for entity in [instance] + to_delete: entity.__handling_delete = True if to_delete: db.delete(to_delete) for entity in [instance] + to_delete: del entity.__handling_delete if to_put: db.put(to_put) class FakeModel(object): """A fake model class which is stored as a string. This can be useful if you need to emulate some model whose entities get generated by syncdb and are never modified afterwards. For example: ContentType and Permission. Use this with FakeModelProperty and FakeModelListProperty (the latter simulates a many-to-many relation). """ # Important: If you want to change your fields at a later point you have # to write a converter which upgrades your datastore schema. fields = ('value',) def __init__(self, **kwargs): if sorted(kwargs.keys()) != sorted(self.fields): raise ValueError('You have to pass the following values to ' 'the constructor: %s' % ', '.join(self.fields)) for key, value in kwargs.items(): setattr(self, key, value) class _meta(object): installed = True def get_value_for_datastore(self): return simplejson.dumps([getattr(self, field) for field in self.fields]) @property def pk(self): return self.get_value_for_datastore() @property def id(self): return self.pk @classmethod def load(cls, value): return simplejson.loads(value) @classmethod def make_value_from_datastore(cls, value): return cls(**dict(zip(cls.fields, cls.load(value)))) def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, ' | '.join([unicode(getattr(self, field)) for field in self.fields])) class FakeModelProperty(db.Property): data_type = basestring def __init__(self, model, raw=False, *args, **kwargs): self.raw = raw self.model = model super(FakeModelProperty, self).__init__(*args, **kwargs) def validate(self, value): if isinstance(value, basestring): value = self.make_value_from_datastore(value) if not isinstance(value, self.model): raise db.BadValueError('Value must be of type %s' % self.model.__name__) if self.validator is not None: self.validator(value) return value def get_value_for_datastore(self, model_instance): fake_model = getattr(model_instance, self.name) if not fake_model: return None if not self.indexed: return db.Text(fake_model.get_value_for_datastore()) return fake_model.get_value_for_datastore() def make_value_from_datastore(self, value): if not value: return None return self.model.make_value_from_datastore(unicode(value)) def get_value_for_form(self, instance): return self.get_value_for_datastore(instance) def make_value_from_form(self, value): return value def __set__(self, model_instance, value): if isinstance(value, basestring): value = self.make_value_from_datastore(value) super(FakeModelProperty, self).__set__(model_instance, value) @classmethod def get_fake_defaults(self, fake_model, multiple=False, **kwargs): from ragendja import forms form = multiple and forms.FakeModelMultipleChoiceField or \ forms.FakeModelChoiceField defaults = {'form_class': form, 'fake_model': fake_model} defaults.update(kwargs) return defaults def get_form_field(self, **kwargs): if self.raw: from django import forms defaults = kwargs defaults['widget'] = forms.TextInput(attrs={'size': 80}) else: defaults = FakeModelProperty.get_fake_defaults(self.model, **kwargs) return super(FakeModelProperty, self).get_form_field(**defaults) class FakeModelListProperty(db.ListProperty): fake_item_type = basestring def __init__(self, model, *args, **kwargs): self.model = model if not kwargs.get('indexed', True): self.fake_item_type = db.Text super(FakeModelListProperty, self).__init__( self.__class__.fake_item_type, *args, **kwargs) def validate(self, value): new_value = [] for item in value: if isinstance(item, basestring): item = self.make_value_from_datastore([item])[0] if not isinstance(item, self.model): raise db.BadValueError('Value must be of type %s' % self.model.__name__) new_value.append(item) if self.validator is not None: self.validator(new_value) return new_value def get_value_for_datastore(self, model_instance): fake_models = getattr(model_instance, self.name) if not self.indexed: return [db.Text(fake_model.get_value_for_datastore()) for fake_model in fake_models] return [fake_model.get_value_for_datastore() for fake_model in fake_models] def make_value_from_datastore(self, value): return [self.model.make_value_from_datastore(unicode(item)) for item in value] def get_value_for_form(self, instance): return self.get_value_for_datastore(instance) def make_value_from_form(self, value): return value def get_form_field(self, **kwargs): defaults = FakeModelProperty.get_fake_defaults(self.model, multiple=True, **kwargs) defaults['required'] = False return super(FakeModelListProperty, self).get_form_field(**defaults) class KeyListProperty(db.ListProperty): """Simulates a many-to-many relation using a list property. On the model level you interact with keys, but when used in a ModelForm you get a ModelMultipleChoiceField (as if it were a ManyToManyField).""" def __init__(self, reference_class, *args, **kwargs): self._reference_class = reference_class super(KeyListProperty, self).__init__(db.Key, *args, **kwargs) @property def reference_class(self): if isinstance(self._reference_class, basestring): from django.db import models self._reference_class = models.get_model( *self._reference_class.split('.', 1)) return self._reference_class def validate(self, value): new_value = [] for item in value: if isinstance(item, basestring): item = db.Key(item) if isinstance(item, self.reference_class): item = item.key() if not isinstance(item, db.Key): raise db.BadValueError('Value must be a key or of type %s' % self.reference_class.__name__) new_value.append(item) return super(KeyListProperty, self).validate(new_value) def get_form_field(self, **kwargs): from django import forms defaults = {'form_class': forms.ModelMultipleChoiceField, 'queryset': self.reference_class.all(), 'required': False} defaults.update(kwargs) return super(KeyListProperty, self).get_form_field(**defaults)
100uhaco
trunk/GAE/common/appenginepatch/ragendja/dbutils.py
Python
asf20
25,961
#!/usr/bin/env python if __name__ == '__main__': from common.appenginepatch.aecmd import setup_env setup_env(manage_py_env=True) # Recompile translation files from mediautils.compilemessages import updatemessages updatemessages() # Generate compressed media files for manage.py update import sys from mediautils.generatemedia import updatemedia if len(sys.argv) >= 2 and sys.argv[1] == 'update': updatemedia(True) import settings from django.core.management import execute_manager execute_manager(settings)
100uhaco
trunk/GAE/common/appenginepatch/manage.py
Python
asf20
566
from ragendja.settings_post import settings settings.add_app_media('combined-%(LANGUAGE_CODE)s.js', 'jquery/jquery.js', 'jquery/jquery.fixes.js', 'jquery/jquery.ajax-queue.js', 'jquery/jquery.bgiframe.js', 'jquery/jquery.livequery.js', 'jquery/jquery.form.js', )
100uhaco
trunk/GAE/common/jquery/settings.py
Python
asf20
287
(function($) { /* Fix fadeIn and fadeOut cleartype bug in IE. */ $.fn.originalFadeIn = $.fn.fadeIn $.fn.fadeIn = function(speed, callback) { $(this).originalFadeIn(speed, function() { if(jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter'); if(callback != undefined) callback(); }); }; $.fn.originalFadeOut = $.fn.fadeOut $.fn.fadeOut = function(speed, callback) { $(this).originalFadeOut(speed, function() { if(jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter'); if(callback != undefined) callback(); }); }; /* Set better default values that work the same with every browser. */ $.ajaxSetup({cache: false, timeout: 10000}); /* If a POST request doesn't contain any data we have to add at least an * empty string, so content-length gets set. Some servers refuse to accept * the request, otherwise. */ $(document).ajaxSend(function(evt, request, options) { if (options['type'] == 'POST' && options['data'] == null) options['data'] = ''; }); })(jQuery);
100uhaco
trunk/GAE/common/jquery/media/jquery.fixes.js
JavaScript
asf20
1,098
/*! * Ajax Queue Plugin * * Homepage: http://jquery.com/plugins/project/ajaxqueue * Documentation: http://docs.jquery.com/AjaxQueue */ /** <script> $(function(){ jQuery.ajaxQueue({ url: "test.php", success: function(html){ jQuery("ul").append(html); } }); jQuery.ajaxQueue({ url: "test.php", success: function(html){ jQuery("ul").append(html); } }); jQuery.ajaxSync({ url: "test.php", success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); } }); jQuery.ajaxSync({ url: "test.php", success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); } }); }); </script> <ul style="position: absolute; top: 5px; right: 5px;"></ul> */ /* * Queued Ajax requests. * A new Ajax request won't be started until the previous queued * request has finished. */ jQuery.ajaxQueue = function(o){ var _old = o.complete; o.complete = function(){ if ( _old ) _old.apply( this, arguments ); jQuery.dequeue( jQuery.ajaxQueue, "ajax" ); }; jQuery([ jQuery.ajaxQueue ]).queue("ajax", function(){ jQuery.ajax( o ); }); }; /* * Synced Ajax requests. * The Ajax request will happen as soon as you call this method, but * the callbacks (success/error/complete) won't fire until all previous * synced requests have been completed. */ jQuery.ajaxSync = function(o){ var fn = jQuery.ajaxSync.fn, data = jQuery.ajaxSync.data, pos = fn.length; fn[ pos ] = { error: o.error, success: o.success, complete: o.complete, done: false }; data[ pos ] = { error: [], success: [], complete: [] }; o.error = function(){ data[ pos ].error = arguments; }; o.success = function(){ data[ pos ].success = arguments; }; o.complete = function(){ data[ pos ].complete = arguments; fn[ pos ].done = true; if ( pos == 0 || !fn[ pos-1 ] ) for ( var i = pos; i < fn.length && fn[i].done; i++ ) { if ( fn[i].error ) fn[i].error.apply( jQuery, data[i].error ); if ( fn[i].success ) fn[i].success.apply( jQuery, data[i].success ); if ( fn[i].complete ) fn[i].complete.apply( jQuery, data[i].complete ); fn[i] = null; data[i] = null; } }; return jQuery.ajax(o); }; jQuery.ajaxSync.fn = []; jQuery.ajaxSync.data = [];
100uhaco
trunk/GAE/common/jquery/media/jquery.ajax-queue.js
JavaScript
asf20
2,189
/*! * jquery.bgiframe * Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * $LastChangedDate$ * $Rev$ * * Version 2.1.1 */ (function($){ /** * The bgiframe is chainable and applies the iframe hack to get * around zIndex issues in IE6. It will only apply itself in IE6 * and adds a class to the iframe called 'bgiframe'. The iframe * is appeneded as the first child of the matched element(s) * with a tabIndex and zIndex of -1. * * By default the plugin will take borders, sized with pixel units, * into account. If a different unit is used for the border's width, * then you will need to use the top and left settings as explained below. * * NOTICE: This plugin has been reported to cause perfromance problems * when used on elements that change properties (like width, height and * opacity) a lot in IE6. Most of these problems have been caused by * the expressions used to calculate the elements width, height and * borders. Some have reported it is due to the opacity filter. All * these settings can be changed if needed as explained below. * * @example $('div').bgiframe(); * @before <div><p>Paragraph</p></div> * @result <div><iframe class="bgiframe".../><p>Paragraph</p></div> * * @param Map settings Optional settings to configure the iframe. * @option String|Number top The iframe must be offset to the top * by the width of the top border. This should be a negative * number representing the border-top-width. If a number is * is used here, pixels will be assumed. Otherwise, be sure * to specify a unit. An expression could also be used. * By default the value is "auto" which will use an expression * to get the border-top-width if it is in pixels. * @option String|Number left The iframe must be offset to the left * by the width of the left border. This should be a negative * number representing the border-left-width. If a number is * is used here, pixels will be assumed. Otherwise, be sure * to specify a unit. An expression could also be used. * By default the value is "auto" which will use an expression * to get the border-left-width if it is in pixels. * @option String|Number width This is the width of the iframe. If * a number is used here, pixels will be assume. Otherwise, be sure * to specify a unit. An experssion could also be used. * By default the value is "auto" which will use an experssion * to get the offsetWidth. * @option String|Number height This is the height of the iframe. If * a number is used here, pixels will be assume. Otherwise, be sure * to specify a unit. An experssion could also be used. * By default the value is "auto" which will use an experssion * to get the offsetHeight. * @option Boolean opacity This is a boolean representing whether or not * to use opacity. If set to true, the opacity of 0 is applied. If * set to false, the opacity filter is not applied. Default: true. * @option String src This setting is provided so that one could change * the src of the iframe to whatever they need. * Default: "javascript:false;" * * @name bgiframe * @type jQuery * @cat Plugins/bgiframe * @author Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) */ $.fn.bgIframe = $.fn.bgiframe = function(s) { // This is only for IE6 if ( $.browser.msie && /6.0/.test(navigator.userAgent) ) { s = $.extend({ top : 'auto', // auto == .currentStyle.borderTopWidth left : 'auto', // auto == .currentStyle.borderLeftWidth width : 'auto', // auto == offsetWidth height : 'auto', // auto == offsetHeight opacity : true, src : 'javascript:false;' }, s || {}); var prop = function(n){return n&&n.constructor==Number?n+'px':n;}, html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+ 'style="display:block;position:absolute;z-index:-1;'+ (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+ 'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+ 'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+ 'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+ 'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+ '"/>'; return this.each(function() { if ( $('> iframe.bgiframe', this).length == 0 ) this.insertBefore( document.createElement(html), this.firstChild ); }); } return this; }; })(jQuery);
100uhaco
trunk/GAE/common/jquery/media/jquery.bgiframe.js
JavaScript
asf20
4,849
/*! Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Version: 1.0.3 * Requires jQuery 1.1.3+ * Docs: http://docs.jquery.com/Plugins/livequery */ (function($) { $.extend($.fn, { livequery: function(type, fn, fn2) { var self = this, q; // Handle different call patterns if ($.isFunction(type)) fn2 = fn, fn = type, type = undefined; // See if Live Query already exists $.each( $.livequery.queries, function(i, query) { if ( self.selector == query.selector && self.context == query.context && type == query.type && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) ) // Found the query, exit the each loop return (q = query) && false; }); // Create new Live Query if it wasn't found q = q || new $.livequery(this.selector, this.context, type, fn, fn2); // Make sure it is running q.stopped = false; // Run it immediately for the first time q.run(); // Contnue the chain return this; }, expire: function(type, fn, fn2) { var self = this; // Handle different call patterns if ($.isFunction(type)) fn2 = fn, fn = type, type = undefined; // Find the Live Query based on arguments and stop it $.each( $.livequery.queries, function(i, query) { if ( self.selector == query.selector && self.context == query.context && (!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped ) $.livequery.stop(query.id); }); // Continue the chain return this; } }); $.livequery = function(selector, context, type, fn, fn2) { this.selector = selector; this.context = context || document; this.type = type; this.fn = fn; this.fn2 = fn2; this.elements = []; this.stopped = false; // The id is the index of the Live Query in $.livequery.queries this.id = $.livequery.queries.push(this)-1; // Mark the functions for matching later on fn.$lqguid = fn.$lqguid || $.livequery.guid++; if (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++; // Return the Live Query return this; }; $.livequery.prototype = { stop: function() { var query = this; if ( this.type ) // Unbind all bound events this.elements.unbind(this.type, this.fn); else if (this.fn2) // Call the second function for all matched elements this.elements.each(function(i, el) { query.fn2.apply(el); }); // Clear out matched elements this.elements = []; // Stop the Live Query from running until restarted this.stopped = true; }, run: function() { // Short-circuit if stopped if ( this.stopped ) return; var query = this; var oEls = this.elements, els = $(this.selector, this.context), nEls = els.not(oEls); // Set elements to the latest set of matched elements this.elements = els; if (this.type) { // Bind events to newly matched elements nEls.bind(this.type, this.fn); // Unbind events to elements no longer matched if (oEls.length > 0) $.each(oEls, function(i, el) { if ( $.inArray(el, els) < 0 ) $.event.remove(el, query.type, query.fn); }); } else { // Call the first function for newly matched elements nEls.each(function() { query.fn.apply(this); }); // Call the second function for elements no longer matched if ( this.fn2 && oEls.length > 0 ) $.each(oEls, function(i, el) { if ( $.inArray(el, els) < 0 ) query.fn2.apply(el); }); } } }; $.extend($.livequery, { guid: 0, queries: [], queue: [], running: false, timeout: null, checkQueue: function() { if ( $.livequery.running && $.livequery.queue.length ) { var length = $.livequery.queue.length; // Run each Live Query currently in the queue while ( length-- ) $.livequery.queries[ $.livequery.queue.shift() ].run(); } }, pause: function() { // Don't run anymore Live Queries until restarted $.livequery.running = false; }, play: function() { // Restart Live Queries $.livequery.running = true; // Request a run of the Live Queries $.livequery.run(); }, registerPlugin: function() { $.each( arguments, function(i,n) { // Short-circuit if the method doesn't exist if (!$.fn[n]) return; // Save a reference to the original method var old = $.fn[n]; // Create a new method $.fn[n] = function() { // Call the original method var r = old.apply(this, arguments); // Request a run of the Live Queries $.livequery.run(); // Return the original methods result return r; } }); }, run: function(id) { if (id != undefined) { // Put the particular Live Query in the queue if it doesn't already exist if ( $.inArray(id, $.livequery.queue) < 0 ) $.livequery.queue.push( id ); } else // Put each Live Query in the queue if it doesn't already exist $.each( $.livequery.queries, function(id) { if ( $.inArray(id, $.livequery.queue) < 0 ) $.livequery.queue.push( id ); }); // Clear timeout if it already exists if ($.livequery.timeout) clearTimeout($.livequery.timeout); // Create a timeout to check the queue and actually run the Live Queries $.livequery.timeout = setTimeout($.livequery.checkQueue, 20); }, stop: function(id) { if (id != undefined) // Stop are particular Live Query $.livequery.queries[ id ].stop(); else // Stop all Live Queries $.each( $.livequery.queries, function(id) { $.livequery.queries[ id ].stop(); }); } }); // Register core DOM manipulation methods $.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove'); // Run Live Queries when the Document is ready $(function() { $.livequery.play(); }); // Save a reference to the original init method var init = $.prototype.init; // Create a new init method that exposes two new properties: selector and context $.prototype.init = function(a,c) { // Call the original init and save the result var r = init.apply(this, arguments); // Copy over properties if they exist already if (a && a.selector) r.context = a.context, r.selector = a.selector; // Set properties if ( typeof a == 'string' ) r.context = c || document, r.selector = a; // Return the result return r; }; // Give the init function the jQuery prototype for later instantiation (needed after Rev 4091) $.prototype.init.prototype = $.prototype; })(jQuery);
100uhaco
trunk/GAE/common/jquery/media/jquery.livequery.js
JavaScript
asf20
6,688
/* * jQuery Form Plugin * version: 2.24 (10-MAR-2009) * @requires jQuery v1.2.2 or later * * Examples and documentation at: http://malsup.com/jquery/form/ * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ ;(function($) { /* Usage Note: ----------- Do not use both ajaxSubmit and ajaxForm on the same form. These functions are intended to be exclusive. Use ajaxSubmit if you want to bind your own submit handler to the form. For example, $(document).ready(function() { $('#myForm').bind('submit', function() { $(this).ajaxSubmit({ target: '#output' }); return false; // <-- important! }); }); Use ajaxForm when you want the plugin to manage all the event binding for you. For example, $(document).ready(function() { $('#myForm').ajaxForm({ target: '#output' }); }); When using ajaxForm, the ajaxSubmit function will be invoked for you at the appropriate time. */ /** * ajaxSubmit() provides a mechanism for immediately submitting * an HTML form using AJAX. */ $.fn.ajaxSubmit = function(options) { // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) if (!this.length) { log('ajaxSubmit: skipping submit process - no element selected'); return this; } if (typeof options == 'function') options = { success: options }; // clean url (don't include hash vaue) var url = this.attr('action') || window.location.href; url = (url.match(/^([^#]+)/)||[])[1]; url = url || ''; options = $.extend({ url: url, type: this.attr('method') || 'GET' }, options || {}); // hook for manipulating the form data before it is extracted; // convenient for use with rich editors like tinyMCE or FCKEditor var veto = {}; this.trigger('form-pre-serialize', [this, options, veto]); if (veto.veto) { log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); return this; } // provide opportunity to alter form data before it is serialized if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { log('ajaxSubmit: submit aborted via beforeSerialize callback'); return this; } var a = this.formToArray(options.semantic); if (options.data) { options.extraData = options.data; for (var n in options.data) { if(options.data[n] instanceof Array) { for (var k in options.data[n]) a.push( { name: n, value: options.data[n][k] } ); } else a.push( { name: n, value: options.data[n] } ); } } // give pre-submit callback an opportunity to abort the submit if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { log('ajaxSubmit: submit aborted via beforeSubmit callback'); return this; } // fire vetoable 'validate' event this.trigger('form-submit-validate', [a, this, options, veto]); if (veto.veto) { log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); return this; } var q = $.param(a); if (options.type.toUpperCase() == 'GET') { options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; options.data = null; // data is null for 'get' } else options.data = q; // data is the query string for 'post' var $form = this, callbacks = []; if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); // perform a load on the target only if dataType is not provided if (!options.dataType && options.target) { var oldSuccess = options.success || function(){}; callbacks.push(function(data) { $(options.target).html(data).each(oldSuccess, arguments); }); } else if (options.success) callbacks.push(options.success); options.success = function(data, status) { for (var i=0, max=callbacks.length; i < max; i++) callbacks[i].apply(options, [data, status, $form]); }; // are there files to upload? var files = $('input:file', this).fieldValue(); var found = false; for (var j=0; j < files.length; j++) if (files[j]) found = true; // options.iframe allows user to force iframe mode if (options.iframe || found) { // hack to fix Safari hang (thanks to Tim Molendijk for this) // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d if (options.closeKeepAlive) $.get(options.closeKeepAlive, fileUpload); else fileUpload(); } else $.ajax(options); // fire 'notify' event this.trigger('form-submit-notify', [this, options]); return this; // private function for handling file uploads (hat tip to YAHOO!) function fileUpload() { var form = $form[0]; if ($(':input[name=submit]', form).length) { alert('Error: Form elements must not be named "submit".'); return; } var opts = $.extend({}, $.ajaxSettings, options); var s = jQuery.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts); var id = 'jqFormIO' + (new Date().getTime()); var $io = $('<iframe id="' + id + '" name="' + id + '" src="about:blank" />'); var io = $io[0]; $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' }); var xhr = { // mock object aborted: 0, responseText: null, responseXML: null, status: 0, statusText: 'n/a', getAllResponseHeaders: function() {}, getResponseHeader: function() {}, setRequestHeader: function() {}, abort: function() { this.aborted = 1; $io.attr('src','about:blank'); // abort op in progress } }; var g = opts.global; // trigger ajax global events so that activity/block indicators work like normal if (g && ! $.active++) $.event.trigger("ajaxStart"); if (g) $.event.trigger("ajaxSend", [xhr, opts]); if (s.beforeSend && s.beforeSend(xhr, s) === false) { s.global && jQuery.active--; return; } if (xhr.aborted) return; var cbInvoked = 0; var timedOut = 0; // add submitting element to data if we know it var sub = form.clk; if (sub) { var n = sub.name; if (n && !sub.disabled) { options.extraData = options.extraData || {}; options.extraData[n] = sub.value; if (sub.type == "image") { options.extraData[name+'.x'] = form.clk_x; options.extraData[name+'.y'] = form.clk_y; } } } // take a breath so that pending repaints get some cpu time before the upload starts setTimeout(function() { // make sure form attrs are set var t = $form.attr('target'), a = $form.attr('action'); // update form attrs in IE friendly way form.setAttribute('target',id); if (form.getAttribute('method') != 'POST') form.setAttribute('method', 'POST'); if (form.getAttribute('action') != opts.url) form.setAttribute('action', opts.url); // ie borks in some cases when setting encoding if (! options.skipEncodingOverride) { $form.attr({ encoding: 'multipart/form-data', enctype: 'multipart/form-data' }); } // support timout if (opts.timeout) setTimeout(function() { timedOut = true; cb(); }, opts.timeout); // add "extra" data to form if provided in options var extraInputs = []; try { if (options.extraData) for (var n in options.extraData) extraInputs.push( $('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />') .appendTo(form)[0]); // add iframe to doc and submit the form $io.appendTo('body'); io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false); form.submit(); } finally { // reset attrs and remove "extra" input elements form.setAttribute('action',a); t ? form.setAttribute('target', t) : $form.removeAttr('target'); $(extraInputs).remove(); } }, 10); var nullCheckFlag = 0; function cb() { if (cbInvoked++) return; io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false); var ok = true; try { if (timedOut) throw 'timeout'; // extract the server response from the iframe var data, doc; doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document; if ((doc.body == null || doc.body.innerHTML == '') && !nullCheckFlag) { // in some browsers (cough, Opera 9.2.x) the iframe DOM is not always traversable when // the onload callback fires, so we give them a 2nd chance nullCheckFlag = 1; cbInvoked--; setTimeout(cb, 100); return; } xhr.responseText = doc.body ? doc.body.innerHTML : null; xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; xhr.getResponseHeader = function(header){ var headers = {'content-type': opts.dataType}; return headers[header]; }; if (opts.dataType == 'json' || opts.dataType == 'script') { var ta = doc.getElementsByTagName('textarea')[0]; xhr.responseText = ta ? ta.value : xhr.responseText; } else if (opts.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) { xhr.responseXML = toXml(xhr.responseText); } data = $.httpData(xhr, opts.dataType); } catch(e){ ok = false; $.handleError(opts, xhr, 'error', e); } // ordering of these callbacks/triggers is odd, but that's how $.ajax does it if (ok) { opts.success(data, 'success'); if (g) $.event.trigger("ajaxSuccess", [xhr, opts]); } if (g) $.event.trigger("ajaxComplete", [xhr, opts]); if (g && ! --$.active) $.event.trigger("ajaxStop"); if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error'); // clean up setTimeout(function() { $io.remove(); xhr.responseXML = null; }, 100); }; function toXml(s, doc) { if (window.ActiveXObject) { doc = new ActiveXObject('Microsoft.XMLDOM'); doc.async = 'false'; doc.loadXML(s); } else doc = (new DOMParser()).parseFromString(s, 'text/xml'); return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null; }; }; }; /** * ajaxForm() provides a mechanism for fully automating form submission. * * The advantages of using this method instead of ajaxSubmit() are: * * 1: This method will include coordinates for <input type="image" /> elements (if the element * is used to submit the form). * 2. This method will include the submit element's name/value data (for the element that was * used to submit the form). * 3. This method binds the submit() method to the form for you. * * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely * passes the options argument along after properly binding events for submit elements and * the form itself. */ $.fn.ajaxForm = function(options) { return this.ajaxFormUnbind().bind('submit.form-plugin',function() { $(this).ajaxSubmit(options); return false; }).each(function() { // store options in hash $(":submit,input:image", this).bind('click.form-plugin',function(e) { var form = this.form; form.clk = this; if (this.type == 'image') { if (e.offsetX != undefined) { form.clk_x = e.offsetX; form.clk_y = e.offsetY; } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin var offset = $(this).offset(); form.clk_x = e.pageX - offset.left; form.clk_y = e.pageY - offset.top; } else { form.clk_x = e.pageX - this.offsetLeft; form.clk_y = e.pageY - this.offsetTop; } } // clear form vars setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 10); }); }); }; // ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm $.fn.ajaxFormUnbind = function() { this.unbind('submit.form-plugin'); return this.each(function() { $(":submit,input:image", this).unbind('click.form-plugin'); }); }; /** * formToArray() gathers form element data into an array of objects that can * be passed to any of the following ajax functions: $.get, $.post, or load. * Each object in the array has both a 'name' and 'value' property. An example of * an array for a simple login form might be: * * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] * * It is this array that is passed to pre-submit callback functions provided to the * ajaxSubmit() and ajaxForm() methods. */ $.fn.formToArray = function(semantic) { var a = []; if (this.length == 0) return a; var form = this[0]; var els = semantic ? form.getElementsByTagName('*') : form.elements; if (!els) return a; for(var i=0, max=els.length; i < max; i++) { var el = els[i]; var n = el.name; if (!n) continue; if (semantic && form.clk && el.type == "image") { // handle image inputs on the fly when semantic == true if(!el.disabled && form.clk == el) a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); continue; } var v = $.fieldValue(el, true); if (v && v.constructor == Array) { for(var j=0, jmax=v.length; j < jmax; j++) a.push({name: n, value: v[j]}); } else if (v !== null && typeof v != 'undefined') a.push({name: n, value: v}); } if (!semantic && form.clk) { // input type=='image' are not found in elements array! handle them here var inputs = form.getElementsByTagName("input"); for(var i=0, max=inputs.length; i < max; i++) { var input = inputs[i]; var n = input.name; if(n && !input.disabled && input.type == "image" && form.clk == input) a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); } } return a; }; /** * Serializes form data into a 'submittable' string. This method will return a string * in the format: name1=value1&amp;name2=value2 */ $.fn.formSerialize = function(semantic) { //hand off to jQuery.param for proper encoding return $.param(this.formToArray(semantic)); }; /** * Serializes all field elements in the jQuery object into a query string. * This method will return a string in the format: name1=value1&amp;name2=value2 */ $.fn.fieldSerialize = function(successful) { var a = []; this.each(function() { var n = this.name; if (!n) return; var v = $.fieldValue(this, successful); if (v && v.constructor == Array) { for (var i=0,max=v.length; i < max; i++) a.push({name: n, value: v[i]}); } else if (v !== null && typeof v != 'undefined') a.push({name: this.name, value: v}); }); //hand off to jQuery.param for proper encoding return $.param(a); }; /** * Returns the value(s) of the element in the matched set. For example, consider the following form: * * <form><fieldset> * <input name="A" type="text" /> * <input name="A" type="text" /> * <input name="B" type="checkbox" value="B1" /> * <input name="B" type="checkbox" value="B2"/> * <input name="C" type="radio" value="C1" /> * <input name="C" type="radio" value="C2" /> * </fieldset></form> * * var v = $(':text').fieldValue(); * // if no values are entered into the text inputs * v == ['',''] * // if values entered into the text inputs are 'foo' and 'bar' * v == ['foo','bar'] * * var v = $(':checkbox').fieldValue(); * // if neither checkbox is checked * v === undefined * // if both checkboxes are checked * v == ['B1', 'B2'] * * var v = $(':radio').fieldValue(); * // if neither radio is checked * v === undefined * // if first radio is checked * v == ['C1'] * * The successful argument controls whether or not the field element must be 'successful' * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). * The default value of the successful argument is true. If this value is false the value(s) * for each element is returned. * * Note: This method *always* returns an array. If no valid value can be determined the * array will be empty, otherwise it will contain one or more values. */ $.fn.fieldValue = function(successful) { for (var val=[], i=0, max=this.length; i < max; i++) { var el = this[i]; var v = $.fieldValue(el, successful); if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) continue; v.constructor == Array ? $.merge(val, v) : val.push(v); } return val; }; /** * Returns the value of the field element. */ $.fieldValue = function(el, successful) { var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); if (typeof successful == 'undefined') successful = true; if (successful && (!n || el.disabled || t == 'reset' || t == 'button' || (t == 'checkbox' || t == 'radio') && !el.checked || (t == 'submit' || t == 'image') && el.form && el.form.clk != el || tag == 'select' && el.selectedIndex == -1)) return null; if (tag == 'select') { var index = el.selectedIndex; if (index < 0) return null; var a = [], ops = el.options; var one = (t == 'select-one'); var max = (one ? index+1 : ops.length); for(var i=(one ? index : 0); i < max; i++) { var op = ops[i]; if (op.selected) { var v = op.value; if (!v) // extra pain for IE... v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value; if (one) return v; a.push(v); } } return a; } return el.value; }; /** * Clears the form data. Takes the following actions on the form's input fields: * - input text fields will have their 'value' property set to the empty string * - select elements will have their 'selectedIndex' property set to -1 * - checkbox and radio inputs will have their 'checked' property set to false * - inputs of type submit, button, reset, and hidden will *not* be effected * - button elements will *not* be effected */ $.fn.clearForm = function() { return this.each(function() { $('input,select,textarea', this).clearFields(); }); }; /** * Clears the selected form elements. */ $.fn.clearFields = $.fn.clearInputs = function() { return this.each(function() { var t = this.type, tag = this.tagName.toLowerCase(); if (t == 'text' || t == 'password' || tag == 'textarea') this.value = ''; else if (t == 'checkbox' || t == 'radio') this.checked = false; else if (tag == 'select') this.selectedIndex = -1; }); }; /** * Resets the form data. Causes all form elements to be reset to their original value. */ $.fn.resetForm = function() { return this.each(function() { // guard against an input with the name of 'reset' // note that IE reports the reset function as an 'object' if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) this.reset(); }); }; /** * Enables or disables any matching elements. */ $.fn.enable = function(b) { if (b == undefined) b = true; return this.each(function() { this.disabled = !b; }); }; /** * Checks/unchecks any matching checkboxes or radio buttons and * selects/deselects and matching option elements. */ $.fn.selected = function(select) { if (select == undefined) select = true; return this.each(function() { var t = this.type; if (t == 'checkbox' || t == 'radio') this.checked = select; else if (this.tagName.toLowerCase() == 'option') { var $sel = $(this).parent('select'); if (select && $sel[0] && $sel[0].type == 'select-one') { // deselect all other options $sel.find('option').selected(false); } this.selected = select; } }); }; // helper fn for console logging // set $.fn.ajaxSubmit.debug to true to enable debug logging function log() { if ($.fn.ajaxSubmit.debug && window.console && window.console.log) window.console.log('[jquery.form] ' + Array.prototype.join.call(arguments,'')); }; })(jQuery);
100uhaco
trunk/GAE/common/jquery/media/jquery.form.js
JavaScript
asf20
23,133
{% extends "databrowse/base_site.html" %} {% block title %}Databrowse{% endblock %} {% block bodyid %}homepage{% endblock %} {% block content %} {% for model in model_list %} <div class="modelgroup {% cycle 'even' 'odd' %}"> <h2><a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a></h2> <p> {% for object in model.sample_objects %} <a href="{{ object.url }}">{{ object }}</a>, {% endfor %} <a class="more" href="{{ model.url }}">More &rarr;</a> </p> </div> {% endfor %} {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/homepage.html
HTML
asf20
530
{% extends "databrowse/base_site.html" %} {% block title %}{{ field.verbose_name|capfirst }} calendar{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / <a href="../">Calendars</a> / By {{ field.verbose_name }}</div> <h1>{{ model.verbose_name_plural|capfirst }} by {{ field.verbose_name }}</h1> <ul class="objectlist"> {% for year in date_list %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ year.year }}/">{{ year.year }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/calendar_main.html
HTML
asf20
590
{% extends "databrowse/base_site.html" %} {% block title %}{{ model.verbose_name_plural|capfirst }} with {{ field.field.verbose_name }} {{ value }}{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / <a href="../../">Fields</a> / <a href="../">By {{ field.field.verbose_name }}</a> / {{ value }}</div> <h1>{{ object_list.count }} {% if object_list.count|pluralize %}{{ model.verbose_name_plural }}{% else %}{{ model.verbose_name }}{% endif %} with {{ field.field.verbose_name }} {{ value }}</h1> <ul class="objectlist"> {% for object in object_list %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ object.url }}">{{ object }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/fieldchoice_detail.html
HTML
asf20
791
{% extends "databrowse/base_site.html" %} {% block title %}{{ model.verbose_name_plural|capfirst }}{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / {{ model.verbose_name_plural|capfirst }}</div> <h1>{{ model.objects.count }} {% if model.objects.count|pluralize %}{{ model.verbose_name_plural }}{% else %}{{ model.verbose_name }}{% endif %}</h1> {{ plugin_html }} <ul class="objectlist"> {% for object in model.objects %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ object.url }}">{{ object }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/model_detail.html
HTML
asf20
596
{% extends "databrowse/base_site.html" %} {% block title %}{{ object.model.verbose_name|capfirst }}: {{ object }}{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ object.model.url }}">{{ object.model.verbose_name_plural|capfirst }}</a> / {{ object }}</div> <h1>{{ object.model.verbose_name|capfirst }}: {{ object }}</h1> <table class="objectinfo"> {% for field in object.fields %} <tr class="{% cycle 'odd' 'even' %}"> <th>{{ field.field.verbose_name|capfirst }}</th> <td> {% if field.urls %} {% for value, url in field.urls %} {% if url %}<a href="{{ url }}">{% endif %}{{ value }}{% if url %}</a>{% endif %}{% if not forloop.last %}, {% endif %} {% endfor %} {% else %}None{% endif %} </td> </tr> {% endfor %} </table> {% for related_object in object.related_objects %} <div class="related"> <h2>Appears in "{{ related_object.related_field }}" in the following {{ related_object.model.verbose_name_plural }}:</h2> {% if related_object.object_list %} <ul class="objectlist"> {% for object in related_object.object_list %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ object.url }}">{{ object }}</a></li> {% endfor %} </ul> {% else %} <p class="quiet">(None)</p> {% endif %} </div> {% endfor %} {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/object_detail.html
HTML
asf20
1,306
{% extends "databrowse/base_site.html" %} {% block title %}{{ model.verbose_name_plural|capfirst }} by {{ field.field.verbose_name }}{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / <a href="../">Fields</a> / By {{ field.field.verbose_name }}</div> <h1>{{ model.verbose_name_plural|capfirst }} by {{ field.field.verbose_name }}</h1> <ul class="objectlist"> {% for object in object_list %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ object|iriencode }}/">{{ object }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/fieldchoice_list.html
HTML
asf20
639
{% extends "databrowse/base_site.html" %} {% block title %}{{ model.verbose_name_plural|capfirst }} by {{ field.field.verbose_name }}: {{ value }}{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / <a href="{{ field.url }}">By {{ field.field.verbose_name }}</a> / {{ value }}</div> <h1>{{ model.verbose_name_plural|capfirst }} by {{ field.field.verbose_name }}: {{ value }}</h1> <ul class="objectlist"> {% for object in object_list %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ object.url }}">{{ object }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/choice_detail.html
HTML
asf20
675
{% extends "databrowse/base_site.html" %} {% block title %}Calendars{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / Calendars</div> <h1>Calendars</h1> <ul class="objectlist"> {% for field in field_list %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ field.name }}/">{{ model.verbose_name_plural|capfirst }} by {{ field.verbose_name }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/calendar_homepage.html
HTML
asf20
506
{% extends "databrowse/base_site.html" %} {% block title %}{{ model.verbose_name_plural|capfirst }} with {{ field.verbose_name }} in {{ year }}{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / <a href="../../">Calendars</a> / <a href="../">By {{ field.verbose_name }}</a> / {{ year }}</div> <h1>{{ model.verbose_name_plural|capfirst }} with {{ field.verbose_name }} in {{ year }}</h1> <ul class="objectlist"> {% for month in date_list %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ month|date:"M"|lower }}/">{{ month|date:"F" }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/calendar_year.html
HTML
asf20
699
{% extends "databrowse/base_site.html" %} {% block title %}{{ model.verbose_name_plural|capfirst }} with {{ field.verbose_name }} {{ day|date:"F j, Y" }}{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / <a href="../../../../">Calendars</a> / <a href="../../../">By {{ field.verbose_name }}</a> / <a href="../../">{{ day.year }}</a> / <a href="../">{{ day|date:"F" }}</a> / {{ day.day }}</div> <h1>{{ object_list.count }} {% if object_list.count|pluralize %}{{ model.verbose_name_plural }}{% else %}{{ model.verbose_name }}{% endif %} with {{ field.verbose_name }} on {{ day|date:"F j, Y" }}</h1> <ul class="objectlist"> {% for object in object_list %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ object.url }}">{{ object }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/calendar_day.html
HTML
asf20
894
{% extends "databrowse/base_site.html" %} {% block title %}{{ model.verbose_name_plural|capfirst }} by {{ field.field.verbose_name }}{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / By {{ field.field.verbose_name }}</div> <h1>{{ model.verbose_name_plural|capfirst }} by {{ field.field.verbose_name }}</h1> <ul class="objectlist"> {% for choice in field.choices %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ choice.url }}">{{ choice.label }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/choice_list.html
HTML
asf20
613
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> <head> <title>{% block title %}{% endblock %}</title> {% block style %} <style type="text/css"> * { margin:0; padding:0; } body { background:#eee; color:#333; font:76%/1.6 "Lucida Grande","Bitstream Vera Sans",Verdana,sans-serif; } a { color: #5b80b2; text-decoration:none; } a:hover { text-decoration:underline; } a img { border:none; } h1 { font-size:1.8em; color:#666; margin:0.4em 0 0.2em 0; } h2 { font-size:1.5em; color:#666; margin:1em 0 0.2em 0; } p { margin:0.5em 0 1em 0; } .odd { background-color:#EDF3FE; } .quiet { color:#666; } /* FILTERS */ .filter { color:#999; font-size:0.9em; float:left; margin-bottom:10px; margin-right:20px; } .filter strong { color:#666; } /* OBJECT LISTS */ .objectlist { clear:both; margin:0 -20px; color:#666; } .objectlist li a { display:block; padding:1em 20px; } .objectlist li a:hover { background:#5b80b2; color:#3B5572; color:#fff; text-decoration:none; } .related h2 { font-size: 1em; margin-bottom: 0.6em; } .related .objectlist li a { padding: 0.6em 20px; } .related .objectlist li.odd { background:#eee; } /* OBJECT DETAIL */ .objectinfo { border-collapse:collapse; color:#666; margin:0 -20px; } .objectinfo td, .objectinfo th { padding:1em 20px; vertical-align:top; } .objectinfo td { width:100%; } .objectinfo th { text-align:left; white-space:nowrap; } /* MODEL GROUPS */ .modelgroup { color:#999; font-size:0.9em; margin:0 -20px; } .modelgroup h2 { font-size:1.2em; margin:0; } .modelgroup h2 a { display: block; padding: 0.83em 20px; } .modelgroup h2 a:hover { text-decoration: none; color: #fff; } .modelgroup p { float:left; margin:-2.65em 0 0 14em; position:relative; } .modelgroup p a { white-space:nowrap; } .modelgroup a.more { color:#999; } .modelgroup:hover { background:#5b80b2; color:#becfe5; } .modelgroup:hover p a { color:#becfe5; } .modelgroup:hover a { color:#fff; } .modelgroup:hover a.more { color:#fff; } /* BREADCRUMBS */ #breadcrumbs { padding:10px 0; color:#999; font-size:0.9em; } /* HEADER */ #header a { display:block; background:#eee; color:#676868; padding:10px 20px; font-weight:bold; font-size:1em; text-decoration:none; border-bottom:1px solid #ddd; } #header a:hover { text-decoration:underline; } /* CONTENT */ #content { background:#fff; border-bottom:1px solid #ddd; padding:0 20px; } </style> {% endblock %} {% block extrahead %}{% endblock %} </head> <body id="{% block bodyid %}page{% endblock %}"> <div id="header"><a href="{{ root_url }}">{% block databrowse_title %}Databrowse{% endblock %}</a></div> <div id="content"> {% block content %}{% endblock %} </div> </body> </html>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/base.html
HTML
asf20
2,828
{% extends "databrowse/base_site.html" %} {% block title %}Browsable fields in {{ model.verbose_name_plural }}{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / Fields</div> <h1>Browsable fields in {{ model.verbose_name_plural }}</h1> <ul class="objectlist"> {% for field in field_list %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ field.name }}/">{{ model.verbose_name_plural|capfirst }} by {{ field.verbose_name }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/fieldchoice_homepage.html
HTML
asf20
587
{% extends "databrowse/base_site.html" %} {% block title %}{{ model.verbose_name_plural|capfirst }} with {{ field.verbose_name }} in {{ month|date:"F Y" }}{% endblock %} {% block content %} <div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / <a href="../../../">Calendars</a> / <a href="../../">By {{ field.verbose_name }}</a> / <a href="../">{{ month.year }}</a> / {{ month|date:"F" }}</div> <h1>{{ object_list.count }} {% if object_list.count|pluralize %}{{ model.verbose_name_plural }}{% else %}{{ model.verbose_name }}{% endif %} with {{ field.verbose_name }} on {{ day|date:"F Y" }}</h1> <ul class="objectlist"> {% for object in object_list %} <li class="{% cycle 'odd' 'even' %}"><a href="{{ object.url }}">{{ object }}</a></li> {% endfor %} </ul> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/calendar_month.html
HTML
asf20
854
{% extends "databrowse/base.html" %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/databrowse/base_site.html
HTML
asf20
37
{% extends "admin/index.html" %} {% load i18n %} {% if not is_popup %} {% block breadcrumbs %} <div class="breadcrumbs"><a href="../"> {% trans "Home" %}</a> &rsaquo; {% for app in app_list %} {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %} {% endfor %}</div>{% endblock %} {% endif %} {% block sidebar %}{% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/app_index.html
HTML
asf20
347
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{% trans "Home" %}</a> &rsaquo; {% trans "Server error" %}</div>{% endblock %} {% block title %}{% trans 'Server error (500)' %}{% endblock %} {% block content %} <h1>{% trans 'Server Error <em>(500)</em>' %}</h1> <p>{% trans "There's been an error. It's been reported to the site administrators via e-mail and should be fixed shortly. Thanks for your patience." %}</p> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/500.html
HTML
asf20
502
{% load adminmedia %} {% load i18n %} {% if cl.search_fields %} <div id="toolbar"><form id="changelist-search" action="" method="get"> <div><!-- DIV needed for valid HTML --> <label for="searchbar"><img src="{% admin_media_prefix %}img/admin/icon_searchbox.png" alt="Search" /></label> <input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" /> <input type="submit" value="{% trans 'Go' %}" /> {% if show_result_count %} <span class="small quiet">{% blocktrans count cl.result_count as counter %}1 result{% plural %}{{ counter }} results{% endblocktrans %} (<a href="?{% if cl.is_popup %}pop=1{% endif %}">{% blocktrans with cl.full_result_count as full_result_count %}{{ full_result_count }} total{% endblocktrans %}</a>)</span> {% endif %} {% for pair in cl.params.items %} {% ifnotequal pair.0 search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endifnotequal %} {% endfor %} </div> </form></div> <script type="text/javascript">document.getElementById("searchbar").focus();</script> {% endif %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/search_form.html
HTML
asf20
1,068
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %} <div class="breadcrumbs"> <a href="../../../../">{% trans "Home" %}</a> &rsaquo; <a href="../../../">{{ app_label|capfirst }}</a> &rsaquo; <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo; <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo; {% trans 'Delete' %} </div> {% endblock %} {% block content %} {% if perms_lacking %} <p>{% blocktrans with object as escaped_object %}Deleting the {{ object_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}</p> <ul> {% for obj in perms_lacking %} <li>{{ obj }}</li> {% endfor %} </ul> {% else %} <p>{% blocktrans with object as escaped_object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktrans %}</p> <ul>{{ deleted_objects|unordered_list }}</ul> <form action="" method="post"> <div> <input type="hidden" name="post" value="yes" /> <input type="submit" value="{% trans "Yes, I'm sure" %}" /> </div> </form> {% endif %} {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/delete_confirmation.html
HTML
asf20
1,290
{% extends "admin/base_site.html" %} {% load adminmedia admin_list i18n %} {% block stylesheet %}{% admin_media_prefix %}css/changelists.css{% endblock %} {% block bodyclass %}change-list{% endblock %} {% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> &rsaquo; <a href="../">{{ app_label|capfirst }}</a> &rsaquo; {{ cl.opts.verbose_name_plural|capfirst }}</div>{% endblock %}{% endif %} {% block coltype %}flex{% endblock %} {% block content %} <div id="content-main"> {% block object-tools %} {% if has_add_permission %} <ul class="object-tools"><li><a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}</a></li></ul> {% endif %} {% endblock %} <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist"> {% block search %}{% search_form cl %}{% endblock %} {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %} {% block filters %} {% if cl.has_filters %} <div id="changelist-filter"> <h2>{% trans 'Filter' %}</h2> {% for spec in cl.filter_specs %} {% admin_list_filter cl spec %} {% endfor %} </div> {% endif %} {% endblock %} {% block result_list %}{% result_list cl %}{% endblock %} {% block pagination %}{% pagination cl %}{% endblock %} </div> </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/change_list.html
HTML
asf20
1,369
{% load i18n %} <div class="submit-row" {% if is_popup %}style="overflow: auto;"{% endif %}> {% if show_save %}<input type="submit" value="{% trans 'Save' %}" class="default" name="_save" {{ onclick_attrib }}/>{% endif %} {% if show_delete_link %}<p class="deletelink-box"><a href="delete/" class="deletelink">{% trans "Delete" %}</a></p>{% endif %} {% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" {{ onclick_attrib }}/>{%endif%} {% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" {{ onclick_attrib }} />{% endif %} {% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" {{ onclick_attrib }}/>{% endif %} </div>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/submit_line.html
HTML
asf20
790
{% extends "admin/change_form.html" %} {% load i18n %} {% block after_field_sets %} <p>{% trans "First, enter a username and password. Then, you'll be able to edit more user options." %}</p> <fieldset class="module aligned"> <div class="form-row"> {{ form.username.errors }} {# TODO: get required class on label_tag #} <label for="id_username" class="required">{% trans 'Username' %}:</label> {{ form.username }} <p class="help">{{ form.username.help_text }}</p> </div> <div class="form-row"> {{ form.password1.errors }} {# TODO: get required class on label_tag #} <label for="id_password1" class="required">{% trans 'Password' %}:</label> {{ form.password1 }} </div> <div class="form-row"> {{ form.password2.errors }} {# TODO: get required class on label_tag #} <label for="id_password2" class="required">{% trans 'Password (again)' %}:</label> {{ form.password2 }} <p class="help">{% trans 'Enter the same password as above, for verification.' %}</p> </div> <script type="text/javascript">document.getElementById("id_username").focus();</script> </fieldset> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/auth/user/add_form.html
HTML
asf20
1,105
{% extends "admin/base_site.html" %} {% load i18n admin_modify adminmedia %} {% block extrahead %}{{ block.super }} <script type="text/javascript" src="../../../../jsi18n/"></script> {% endblock %} {% block stylesheet %}{% admin_media_prefix %}css/forms.css{% endblock %} {% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} {% block breadcrumbs %}{% if not is_popup %} <div class="breadcrumbs"> <a href="../../../../">{% trans "Home" %}</a> &rsaquo; <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo; <a href="../">{{ original|truncatewords:"18" }}</a> &rsaquo; {% trans 'Change password' %} </div> {% endif %}{% endblock %} {% block content %}<div id="content-main"> <form action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %} <div> {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %} {% if form.errors %} <p class="errornote"> {% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} </p> {% endif %} <p>{% blocktrans with original.username as username %}Enter a new password for the user <strong>{{ username }}</strong>.{% endblocktrans %}</p> <fieldset class="module aligned"> <div class="form-row"> {{ form.password1.errors }} {# TODO: get required class on label_tag #} <label for="id_password1" class="required">{% trans 'Password' %}:</label> {{ form.password1 }} </div> <div class="form-row"> {{ form.password2.errors }} {# TODO: get required class on label_tag #} <label for="id_password2" class="required">{% trans 'Password (again)' %}:</label> {{ form.password2 }} <p class="help">{% trans 'Enter the same password as above, for verification.' %}</p> </div> </fieldset> <div class="submit-row"> <input type="submit" value="{% trans 'Change password' %}" class="default" /> </div> <script type="text/javascript">document.getElementById("id_password1").focus();</script> </div> </form></div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/auth/user/change_password.html
HTML
asf20
2,107
{% extends "admin/base_site.html" %} {% load i18n admin_modify adminmedia %} {% block extrahead %}{{ block.super }} <script type="text/javascript" src="../../../jsi18n/"></script> {{ media }} {% endblock %} {% block stylesheet %}{% admin_media_prefix %}css/forms.css{% endblock %} {% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %} {% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} {% block breadcrumbs %}{% if not is_popup %} <div class="breadcrumbs"> <a href="../../../">{% trans "Home" %}</a> &rsaquo; <a href="../../">{{ app_label|capfirst|escape }}</a> &rsaquo; {% if has_change_permission %}<a href="../">{{ 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> {% endif %}{% endblock %} {% block content %}<div id="content-main"> {% block object-tools %} {% if change %}{% if not is_popup %} <ul class="object-tools"><li><a href="history/" class="historylink">{% trans "History" %}</a></li> {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%} </ul> {% endif %}{% endif %} {% endblock %} <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %} <div> {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %} {% if save_on_top %}{% submit_row %}{% endif %} {% if errors %} <p class="errornote"> {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} </p> <ul class="errorlist">{% for error in adminform.form.non_field_errors %}<li>{{ error }}</li>{% endfor %}</ul> {% endif %} {% for fieldset in adminform %} {% include "admin/includes/fieldset.html" %} {% endfor %} {% block after_field_sets %}{% endblock %} {% for inline_admin_formset in inline_admin_formsets %} {% include inline_admin_formset.opts.template %} {% endfor %} {% block after_related_objects %}{% endblock %} {% submit_row %} {% if add %} <script type="text/javascript">document.getElementById("{{ adminform.first_field.auto_id }}").focus();</script> {% endif %} {# JavaScript for prepopulated fields #} {% prepopulated_fields_js %} </div> </form></div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/change_form.html
HTML
asf20
2,592
{% load i18n %} <h3>{% blocktrans with title as filter_title %} By {{ filter_title }} {% endblocktrans %}</h3> <ul> {% for choice in choices %} <li{% if choice.selected %} class="selected"{% endif %}> <a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a></li> {% endfor %} </ul>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/filter.html
HTML
asf20
304
{% load admin_list %} {% load i18n %} <p class="paginator"> {% if pagination_required %} {% for i in page_range %} {% paginator_number cl i %} {% endfor %} {% endif %} {{ cl.result_count }} {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %} {% if show_all_url %}&nbsp;&nbsp;<a href="{{ show_all_url }}" class="showall">{% trans 'Show all' %}</a>{% endif %} </p>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/pagination.html
HTML
asf20
432
{% extends "admin/base_site.html" %} {% block content %} <div id="content-main"> <form action="" method="post"> {% if form.errors %} <p class="errornote">Your template had {{ form.errors|length }} error{{ form.errors|pluralize }}:</p> {% endif %} <fieldset class="module aligned"> <div class="form-row{% if form.errors.site %} error{% endif %} required"> {{ form.errors.site }} <h4><label for="id_site">{{ form.site.label }}:</label> {{ form.site }}</h4> </div> <div class="form-row{% if form.errors.template %} error{% endif %} required"> {{ form.errors.template }} <h4><label for="id_template">{{ form.template.label }}:</label> {{ form.template }}</h4> </div> </fieldset> <div class="submit-row"> <input type="submit" value="Check for errors" class="default" /> </div> </form> </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/template_validator.html
HTML
asf20
830
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %} <div class="breadcrumbs"> <a href="../../../../">{% trans 'Home' %}</a> &rsaquo; <a href="../../../">{{ app_label|capfirst }}</a> &rsaquo; <a href="../../">{{ module_name }}</a> &rsaquo; <a href="../">{{ 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.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> </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/object_history.html
HTML
asf20
1,295
{% load i18n %} <div class="inline-group"> <h2>{{ inline_admin_formset.opts.verbose_name_plural|title }}</h2> {{ inline_admin_formset.formset.management_form }} {{ inline_admin_formset.formset.non_form_errors }} {% for inline_admin_form in inline_admin_formset %} <div class="inline-related {% if forloop.last %}last-related{% endif %}"> <h3><b>{{ inline_admin_formset.opts.verbose_name|title }}:</b>&nbsp;{% if inline_admin_form.original %}{{ inline_admin_form.original }}{% else %} #{{ forloop.counter }}{% endif %} {% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}<span class="delete">{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}</span>{% endif %} </h3> {% if inline_admin_form.show_url %} <p><a href="../../../r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a></p> {% endif %} {% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %} {% for fieldset in inline_admin_form %} {% include "admin/includes/fieldset.html" %} {% endfor %} {{ inline_admin_form.pk_field.field }} {{ inline_admin_form.fk_field.field }} </div> {% endfor %} {# <ul class="tools"> #} {# <li><a class="add" href="">Add another {{ inline_admin_formset.opts.verbose_name|title }}</a></li> #} {# </ul> #} </div>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/edit_inline/stacked.html
HTML
asf20
1,414
{% load i18n %} <div class="inline-group"> <div class="tabular inline-related {% if forloop.last %}last-related{% endif %}"> {{ inline_admin_formset.formset.management_form }} <fieldset class="module"> <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2> {{ inline_admin_formset.formset.non_form_errors }} <table> <thead><tr> {% for field in inline_admin_formset.fields %} {% if not field.is_hidden %} <th {% if forloop.first %}colspan="2"{% endif %}>{{ field.label|capfirst }}</th> {% endif %} {% endfor %} {% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %} </tr></thead> {% for inline_admin_form in inline_admin_formset %} {% if inline_admin_form.form.non_field_errors %} <tr><td colspan="{{ inline_admin_form.field_count }}">{{ inline_admin_form.form.non_field_errors }}</td></tr> {% endif %} <tr class="{% cycle row1,row2 %} {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}"> <td class="original"> {% if inline_admin_form.original or inline_admin_form.show_url %}<p> {% if inline_admin_form.original %} {{ inline_admin_form.original }}{% endif %} {% if inline_admin_form.show_url %}<a href="../../../r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a>{% endif %} </p>{% endif %} {{ inline_admin_form.pk_field.field }} {{ inline_admin_form.fk_field.field }} {% spaceless %} {% for fieldset in inline_admin_form %} {% for line in fieldset %} {% for field in line %} {% if field.is_hidden %} {{ field.field }} {% endif %} {% endfor %} {% endfor %} {% endfor %} {% endspaceless %} </td> {% for fieldset in inline_admin_form %} {% for line in fieldset %} {% for field in line %} <td class="{{ field.field.name }}"> {{ field.field.errors.as_ul }} {{ field.field }} </td> {% endfor %} {% endfor %} {% endfor %} {% if inline_admin_formset.formset.can_delete %} <td class="delete">{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}</td> {% endif %} </tr> {% endfor %} </table> </fieldset> </div> {# <ul class="tools"> #} {# <li><a class="add" href="">Add another {{ inline_admin_formset.opts.verbose_name|title }}</a></li> #} {# </ul> #} </div>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/edit_inline/tabular.html
HTML
asf20
2,732
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> <head> <title>{% block title %}{% endblock %}</title> <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" /> {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %} {% block extrastyle %}{% endblock %} {% 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> {% if user.is_authenticated and user.is_staff %} <div id="user-tools">{% trans 'Welcome,' %} <strong>{% firstof user.first_name user.username %}</strong>. {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}<a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div> {% endif %} {% block nav-global %}{% endblock %} </div> <!-- END Header --> {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{% trans 'Home' %}</a>{% if title %} &rsaquo; {{ title }}{% endif %}</div>{% endblock %} {% endif %} {% if messages %} <ul class="messagelist">{% for message in messages %}<li>{{ message }}</li>{% endfor %}</ul> {% endif %} <!-- 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>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/base.html
HTML
asf20
2,533
{% extends "admin/base_site.html" %} {% load i18n %} {% block title %}{% trans 'Page not found' %}{% endblock %} {% block content %} <h2>{% trans 'Page not found' %}</h2> <p>{% trans "We're sorry, but the requested page could not be found." %}</p> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/404.html
HTML
asf20
268
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans 'Home' %}</a> &rsaquo; {{ title }}</div>{% endblock %} {% block content %} <p>{% trans "Something's wrong with your database installation. Make sure the appropriate database tables have been created, and make sure the database is readable by the appropriate user." %}</p> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/invalid_setup.html
HTML
asf20
416
{% extends "admin/base_site.html" %} {% load i18n %} {% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/login.css{% endblock %} {% block bodyclass %}login{% endblock %} {% block content_title %}{% endblock %} {% block breadcrumbs %}{% endblock %} {% block content %} {% if error_message %} <p class="errornote">{{ error_message }}</p> {% endif %} <div id="content-main"> <form action="{{ app_path }}" method="post" id="login-form"> <div class="form-row"> <label for="id_username">{% trans 'Username:' %}</label> <input type="text" name="username" id="id_username" /> </div> <div class="form-row"> <label for="id_password">{% trans 'Password:' %}</label> <input type="password" name="password" id="id_password" /> <input type="hidden" name="this_is_the_login_form" value="1" /> </div> <div class="submit-row"> <label>&nbsp;</label><input type="submit" value="{% trans 'Log in' %}" /> </div> </form> <script type="text/javascript"> document.getElementById('id_username').focus() </script> </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/login.html
HTML
asf20
1,063
{% if results %} <table cellspacing="0"> <thead> <tr> {% for header in result_headers %}<th{{ header.class_attrib }}> {% if header.sortable %}<a href="{{ header.url }}">{% endif %} {{ header.text|capfirst }} {% if header.sortable %}</a>{% endif %}</th>{% endfor %} </tr> </thead> <tbody> {% for result in results %} <tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr> {% endfor %} </tbody> </table> {% endif %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/change_list_results.html
HTML
asf20
449
{% if show %} <div class="xfull"> <ul class="toplinks"> {% if back %}<li class="date-back"><a href="{{ back.link }}">&lsaquo; {{ back.title }}</a></li>{% endif %} {% for choice in choices %} <li> {% if choice.link %}<a href="{{ choice.link }}">{% endif %}{{ choice.title }}{% if choice.link %}</a>{% endif %}</li> {% endfor %} </ul><br class="clear" /> </div> {% endif %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/date_hierarchy.html
HTML
asf20
372
{% extends "admin/base_site.html" %} {% load i18n %} {% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css{% endblock %} {% block coltype %}colMS{% endblock %} {% block bodyclass %}dashboard{% endblock %} {% block breadcrumbs %}{% endblock %} {% block content %} <div id="content-main"> {% if app_list %} {% for app in app_list %} <div class="module"> <table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}"> <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</a></caption> {% for model in app.models %} <tr> {% if model.perms.change %} <th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th> {% else %} <th scope="row">{{ model.name }}</th> {% endif %} {% if model.perms.add %} <td><a href="{{ model.admin_url }}add/" class="addlink">{% trans 'Add' %}</a></td> {% else %} <td>&nbsp;</td> {% endif %} {% if model.perms.change %} <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"> <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 not entry.is_deletion %}<a href="{{ entry.get_admin_url }}">{% endif %}{{ entry.object_repr }}{% if not entry.is_deletion %}</a>{% endif %}<br /><span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span></li> {% endfor %} </ul> {% endif %} </div> </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/index.html
HTML
asf20
2,581
<script type="text/javascript"> {% for field in prepopulated_fields %} document.getElementById("{{ field.field.auto_id }}").onchange = function() { this._changed = true; }; {% for dependency in field.dependencies %} document.getElementById("{{ dependency.auto_id }}").onkeyup = function() { var e = document.getElementById("{{ field.field.auto_id }}"); if (!e._changed) { e.value = URLify({% for innerdep in field.dependencies %}document.getElementById("{{ innerdep.auto_id }}").value{% if not forloop.last %} + ' ' + {% endif %}{% endfor %}, {{ field.field.field.max_length|default_if_none:"50" }}); } } {% endfor %} {% endfor %} </script>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/prepopulated_fields_js.html
HTML
asf20
677
{% extends "admin/base.html" %} {% load i18n %} {% block title %}{{ title }} | {% trans 'Django site admin' %}{% endblock %} {% block branding %} <h1 id="site-name">{% trans 'Django administration' %}</h1> {% endblock %} {% block nav-global %}{% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/base_site.html
HTML
asf20
261
<fieldset class="module aligned {{ fieldset.classes }}"> {% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %} {% if fieldset.description %}<div class="description">{{ fieldset.description|safe }}</div>{% endif %} {% for line in fieldset %} <div class="form-row{% if line.errors %} errors{% endif %} {% for field in line %}{{ field.field.name }} {% endfor %} "> {{ line.errors }} {% for field in line %} <div{% if not line.fields|length_is:"1" %} class="field-box"{% endif %}> {% if field.is_checkbox %} {{ field.field }}{{ field.label_tag }} {% else %} {{ field.label_tag }}{{ field.field }} {% endif %} {% if field.field.field.help_text %}<p class="help">{{ field.field.field.help_text|safe }}</p>{% endif %} </div> {% endfor %} </div> {% endfor %} </fieldset>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin/includes/fieldset.html
HTML
asf20
889
{% extends "base.html" %} {% block content %} <h1>Preview your submission</h1> <table> {% for field in form %} <tr> <th>{{ field.label }}:</th> <td>{{ field.data }}</td> </tr> {% endfor %} </table> <p>Security hash: {{ hash_value }}</p> <form action="" method="post"> {% for field in form %}{{ field.as_hidden }} {% endfor %} <input type="hidden" name="{{ stage_field }}" value="2" /> <input type="hidden" name="{{ hash_field }}" value="{{ hash_value }}" /> <p><input type="submit" value="Submit" /></p> </form> <h1>Or edit it again</h1> <form action="" method="post"> <table> {{ form }} </table> <input type="hidden" name="{{ stage_field }}" value="1" /> <p><input type="submit" value="Preview" /></p> </form> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/formtools/preview.html
HTML
asf20
734
{% extends "base.html" %} {% block content %} {% if form.errors %}<h1>Please correct the following errors</h1>{% else %}<h1>Submit</h1>{% endif %} <form action="" method="post"> <table> {{ form }} </table> <input type="hidden" name="{{ stage_field }}" value="1" /> <p><input type="submit" value="Preview" /></p> </form> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/formtools/form.html
HTML
asf20
339
{% autoescape off %}{% block vars %}var map;{% endblock %} {% block functions %}{% endblock %} {% block load %}function {{ load_func }}(){ if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("{{ dom_id }}")); map.setCenter(new GLatLng({{ center.1 }}, {{ center.0 }}), {{ zoom }}); {% block controls %}map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl());{% endblock %} {% if calc_zoom %}var bounds = new GLatLngBounds(); var tmp_bounds = new GLatLngBounds();{% endif %} {% for kml_url in kml_urls %}var kml{{ forloop.counter }} = new GGeoXml("{{ kml_url }}"); map.addOverlay(kml{{ forloop.counter }});{% endfor %} {% for polygon in polygons %}var poly{{ forloop.counter }} = new {{ polygon }}; map.addOverlay(poly{{ forloop.counter }}); {% for event in polygon.events %}GEvent.addListener(poly{{ forloop.parentloop.counter }}, {{ event }});{% endfor %} {% if calc_zoom %}tmp_bounds = poly{{ forloop.counter }}.getBounds(); bounds.extend(tmp_bounds.getSouthWest()); bounds.extend(tmp_bounds.getNorthEast());{% endif %}{% endfor %} {% for polyline in polylines %}var polyline{{ forloop.counter }} = new {{ polyline }}; map.addOverlay(polyline{{ forloop.counter }}); {% for event in polyline.events %}GEvent.addListener(polyline{{ forloop.parentloop.counter }}, {{ event }}); {% endfor %} {% if calc_zoom %}tmp_bounds = polyline{{ forloop.counter }}.getBounds(); bounds.extend(tmp_bounds.getSouthWest()); bounds.extend(tmp_bounds.getNorthEast());{% endif %}{% endfor %} {% for marker in markers %}var marker{{ forloop.counter }} = new {{ marker }}; map.addOverlay(marker{{ forloop.counter }}); {% for event in marker.events %}GEvent.addListener(marker{{ forloop.parentloop.counter }}, {{ event }}); {% endfor %} {% if calc_zoom %}bounds.extend(marker{{ forloop.counter }}.getLatLng()); {% endif %}{% endfor %} {% if calc_zoom %}map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));{% endif %} {% block load_extra %}{% endblock %} }else { alert("Sorry, the Google Maps API is not compatible with this browser."); } } {% endblock %}{% endautoescape %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/gis/google/js/google-map.js
JavaScript
asf20
2,205
{% block extrastyle %} <style type="text/css"> #{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; } #{{ id }}_map .aligned label { float:inherit; } #{{ id }}_admin_map { position: relative; vertical-align: top; float: left; } {% if not display_wkt %}#{{ id }} { display: none; }{% endif %} .olControlEditingToolbar .olControlModifyFeatureItemActive { background-image: url("{{ admin_media_prefix }}img/gis/move_vertex_on.png"); background-repeat: no-repeat; } .olControlEditingToolbar .olControlModifyFeatureItemInactive { background-image: url("{{ admin_media_prefix }}img/gis/move_vertex_off.png"); background-repeat: no-repeat; } </style> <!--[if IE]> <style type="text/css"> /* This fixes the the mouse offset issues in IE. */ #{{ id }}_admin_map { position: static; vertical-align: top; } /* `font-size: 0` fixes the 1px border between tiles, but borks LayerSwitcher. Thus, this is disabled until a better fix is found. #{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; font-size: 0; } */ </style> <![endif]--> {% endblock %} <span id="{{ id }}_admin_map"> <script type="text/javascript"> //<![CDATA[ {% block openlayers %}{% include "gis/admin/openlayers.js" %}{% endblock %} //]]> </script> <div id="{{ id }}_map"></div> <a href="javascript:{{ module }}.clearFeatures()">Delete all Features</a> {% if display_wkt %}<p> WKT debugging window:</p>{% endif %} <textarea id="{{ id }}" class="vWKTField required" cols="150" rows="10" name="{{ field_name }}">{{ wkt }}</textarea> <script type="text/javascript">{% block init_function %}{{ module }}.init();{% endblock %}</script> </span>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/gis/admin/openlayers.html
HTML
asf20
1,679
{% extends "gis/admin/openlayers.js" %} {% block base_layer %}new OpenLayers.Layer.OSM.Mapnik("OpenStreetMap (Mapnik)");{% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/gis/admin/osm.js
JavaScript
asf20
135
{% extends "gis/admin/openlayers.html" %} {% block openlayers %}{% include "gis/admin/osm.js" %}{% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/gis/admin/osm.html
HTML
asf20
110
{# Author: Justin Bronn, Travis Pinney & Dane Springmeyer #} {% block vars %}var {{ module }} = {}; {{ module }}.map = null; {{ module }}.controls = null; {{ module }}.panel = null; {{ module }}.re = new RegExp("^SRID=\d+;(.+)", "i"); {{ module }}.layers = {}; {{ module }}.wkt_f = new OpenLayers.Format.WKT(); {{ module }}.is_collection = {{ is_collection|yesno:"true,false" }}; {{ module }}.collection_type = '{{ collection_type }}'; {{ module }}.is_linestring = {{ is_linestring|yesno:"true,false" }}; {{ module }}.is_polygon = {{ is_polygon|yesno:"true,false" }}; {{ module }}.is_point = {{ is_point|yesno:"true,false" }}; {% endblock %} {{ module }}.get_ewkt = function(feat){return 'SRID={{ srid }};' + {{ module }}.wkt_f.write(feat);} {{ module }}.read_wkt = function(wkt){ // OpenLayers cannot handle EWKT -- we make sure to strip it out. // EWKT is only exposed to OL if there's a validation error in the admin. var match = {{ module }}.re.exec(wkt); if (match){wkt = match[1];} return {{ module }}.wkt_f.read(wkt); } {{ module }}.write_wkt = function(feat){ if ({{ module }}.is_collection){ {{ module }}.num_geom = feat.geometry.components.length;} else { {{ module }}.num_geom = 1;} document.getElementById('{{ id }}').value = {{ module }}.get_ewkt(feat); } {{ module }}.add_wkt = function(event){ // This function will sync the contents of the `vector` layer with the // WKT in the text field. if ({{ module }}.is_collection){ var feat = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.{{ geom_type }}()); for (var i = 0; i < {{ module }}.layers.vector.features.length; i++){ feat.geometry.addComponents([{{ module }}.layers.vector.features[i].geometry]); } {{ module }}.write_wkt(feat); } else { // Make sure to remove any previously added features. if ({{ module }}.layers.vector.features.length > 1){ old_feats = [{{ module }}.layers.vector.features[0]]; {{ module }}.layers.vector.removeFeatures(old_feats); {{ module }}.layers.vector.destroyFeatures(old_feats); } {{ module }}.write_wkt(event.feature); } } {{ module }}.modify_wkt = function(event){ if ({{ module }}.is_collection){ if ({{ module }}.is_point){ {{ module }}.add_wkt(event); return; } else { // When modifying the selected components are added to the // vector layer so we only increment to the `num_geom` value. var feat = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.{{ geom_type }}()); for (var i = 0; i < {{ module }}.num_geom; i++){ feat.geometry.addComponents([{{ module }}.layers.vector.features[i].geometry]); } {{ module }}.write_wkt(feat); } } else { {{ module }}.write_wkt(event.feature); } } // Function to clear vector features and purge wkt from div {{ module }}.deleteFeatures = function(){ {{ module }}.layers.vector.removeFeatures({{ module }}.layers.vector.features); {{ module }}.layers.vector.destroyFeatures(); } {{ module }}.clearFeatures = function (){ {{ module }}.deleteFeatures(); document.getElementById('{{ id }}').value = ''; {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}), {{ default_zoom }}); } // Add Select control {{ module }}.addSelectControl = function(){ var select = new OpenLayers.Control.SelectFeature({{ module }}.layers.vector, {'toggle' : true, 'clickout' : true}); {{ module }}.map.addControl(select); select.activate(); } {{ module }}.enableDrawing = function(){ {{ module }}.map.getControlsByClass('OpenLayers.Control.DrawFeature')[0].activate();} {{ module }}.enableEditing = function(){ {{ module }}.map.getControlsByClass('OpenLayers.Control.ModifyFeature')[0].activate();} // Create an array of controls based on geometry type {{ module }}.getControls = function(lyr){ {{ module }}.panel = new OpenLayers.Control.Panel({'displayClass': 'olControlEditingToolbar'}); var nav = new OpenLayers.Control.Navigation(); var draw_ctl; if ({{ module }}.is_linestring){ draw_ctl = new OpenLayers.Control.DrawFeature(lyr, OpenLayers.Handler.Path, {'displayClass': 'olControlDrawFeaturePath'}); } else if ({{ module }}.is_polygon){ draw_ctl = new OpenLayers.Control.DrawFeature(lyr, OpenLayers.Handler.Polygon, {'displayClass': 'olControlDrawFeaturePolygon'}); } else if ({{ module }}.is_point){ draw_ctl = new OpenLayers.Control.DrawFeature(lyr, OpenLayers.Handler.Point, {'displayClass': 'olControlDrawFeaturePoint'}); } {% if modifiable %} var mod = new OpenLayers.Control.ModifyFeature(lyr, {'displayClass': 'olControlModifyFeature'}); {{ module }}.controls = [nav, draw_ctl, mod]; {% else %} {{ module }}.controls = [nav, darw_ctl]; {% endif %} } {{ module }}.init = function(){ {% block map_options %}// The options hash, w/ zoom, resolution, and projection settings. var options = { {% autoescape off %}{% for item in map_options.items %} '{{ item.0 }}' : {{ item.1 }}{% if not forloop.last %},{% endif %} {% endfor %}{% endautoescape %} };{% endblock %} // The admin map for this geometry field. {{ module }}.map = new OpenLayers.Map('{{ id }}_map', options); // Base Layer {{ module }}.layers.base = {% block base_layer %}new OpenLayers.Layer.WMS( "{{ wms_name }}", "{{ wms_url }}", {layers: '{{ wms_layer }}'} );{% endblock %} {{ module }}.map.addLayer({{ module }}.layers.base); {% block extra_layers %}{% endblock %} {% if is_linestring %}OpenLayers.Feature.Vector.style["default"]["strokeWidth"] = 3; // Default too thin for linestrings. {% endif %} {{ module }}.layers.vector = new OpenLayers.Layer.Vector(" {{ field_name }}"); {{ module }}.map.addLayer({{ module }}.layers.vector); // Read WKT from the text field. var wkt = document.getElementById('{{ id }}').value; if (wkt){ // After reading into geometry, immediately write back to // WKT <textarea> as EWKT (so that SRID is included). var admin_geom = {{ module }}.read_wkt(wkt); {{ module }}.write_wkt(admin_geom); if ({{ module }}.is_collection){ // If geometry collection, add each component individually so they may be // edited individually. for (var i = 0; i < {{ module }}.num_geom; i++){ {{ module }}.layers.vector.addFeatures([new OpenLayers.Feature.Vector(admin_geom.geometry.components[i].clone())]); } } else { {{ module }}.layers.vector.addFeatures([admin_geom]); } // Zooming to the bounds. {{ module }}.map.zoomToExtent(admin_geom.geometry.getBounds()); } else { {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}), {{ default_zoom }}); } // This allows editing of the geographic fields -- the modified WKT is // written back to the content field (as EWKT, so that the ORM will know // to transform back to original SRID). {{ module }}.layers.vector.events.on({"featuremodified" : {{ module }}.modify_wkt}); {{ module }}.layers.vector.events.on({"featureadded" : {{ module }}.add_wkt}); {% block controls %} // Map controls: // Add geometry specific panel of toolbar controls {{ module }}.getControls({{ module }}.layers.vector); {{ module }}.panel.addControls({{ module }}.controls); {{ module }}.map.addControl({{ module }}.panel); {{ module }}.addSelectControl(); // Then add optional visual controls {% if mouse_position %}{{ module }}.map.addControl(new OpenLayers.Control.MousePosition());{% endif %} {% if scale_text %}{{ module }}.map.addControl(new OpenLayers.Control.Scale());{% endif %} {% if layerswitcher %}{{ module }}.map.addControl(new OpenLayers.Control.LayerSwitcher());{% endif %} // Then add optional behavior controls {% if not scrollable %}{{ module }}.map.getControlsByClass('OpenLayers.Control.Navigation')[0].disableZoomWheel();{% endif %} {% endblock %} if (wkt){ {{ module }}.enableEditing(); } else { {{ module }}.enableDrawing(); } }
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/gis/admin/openlayers.js
JavaScript
asf20
8,015
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}</div>{% endblock %} {% block title %}{% trans "Password reset" %}{% endblock %} {% block content %} <h1>{% trans "Password reset" %}</h1> <p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}</p> <form action="" method="post"> {{ form.email.errors }} <p><label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }} <input type="submit" value="{% trans 'Reset my password' %}" /></p> </form> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/registration/password_reset_form.html
HTML
asf20
679
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}</div>{% endblock %} {% block title %}{% trans 'Password reset complete' %}{% endblock %} {% block content %} <h1>{% trans 'Password reset complete' %}</h1> <p>{% trans "Your password has been set. You may go ahead and log in now." %}</p> <p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/registration/password_reset_complete.html
HTML
asf20
498
{% load i18n %}{% autoescape off %} {% trans "You're receiving this e-mail because you requested a password reset" %} {% blocktrans %}for your user account at {{ site_name }}{% endblocktrans %}. {% trans "Please go to the following page and choose a new password:" %} {% block reset_link %} {{ protocol }}://{{ domain }}{% url django.contrib.auth.views.password_reset_confirm uidb36=uid, token=token %} {% endblock %} {% trans "Your username, in case you've forgotten:" %} {{ user.username }} {% trans "Thanks for using our site!" %} {% blocktrans %}The {{ site_name }} team{% endblocktrans %} {% endautoescape %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/registration/password_reset_email.html
HTML
asf20
618
{% extends "admin/base_site.html" %} {% load i18n %} {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}{% trans 'Change password' %} / <a href="../../logout/">{% trans 'Log out' %}</a>{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password change' %}</div>{% endblock %} {% block title %}{% trans 'Password change successful' %}{% endblock %} {% block content %} <h1>{% trans 'Password change successful' %}</h1> <p>{% trans 'Your password was changed.' %}</p> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/registration/password_change_done.html
HTML
asf20
660
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}</div>{% endblock %} {% block title %}{% trans 'Password reset successful' %}{% endblock %} {% block content %} <h1>{% trans 'Password reset successful' %}</h1> <p>{% trans "We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly." %}</p> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/registration/password_reset_done.html
HTML
asf20
509
{% extends "admin/base_site.html" %} {% load i18n %} {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %} {% trans 'Change password' %} / <a href="../logout/">{% trans 'Log out' %}</a>{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password change' %}</div>{% endblock %} {% block title %}{% trans 'Password change' %}{% endblock %} {% block content %} <h1>{% trans 'Password change' %}</h1> <p>{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p> <form action="" method="post"> {{ form.old_password.errors }} <p class="aligned wide"><label for="id_old_password">{% trans 'Old password:' %}</label>{{ form.old_password }}</p> {{ form.new_password1.errors }} <p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p> {{ form.new_password2.errors }} <p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p> <p><input type="submit" value="{% trans 'Change my password' %}" /></p> </form> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/registration/password_change_form.html
HTML
asf20
1,307
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a></div>{% endblock %} {% block content %} <p>{% trans "Thanks for spending some quality time with the Web site today." %}</p> <p><a href="../">{% trans 'Log in again' %}</a></p> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/registration/logged_out.html
HTML
asf20
334
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset confirmation' %}</div>{% endblock %} {% block title %}{% trans 'Password reset' %}{% endblock %} {% block content %} {% if validlink %} <h1>{% trans 'Enter new password' %}</h1> <p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p> <form action="" method="post"> {{ form.new_password1.errors }} <p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p> {{ form.new_password2.errors }} <p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p> <p><input type="submit" value="{% trans 'Change my password' %}" /></p> </form> {% else %} <h1>{% trans 'Password reset unsuccessful' %}</h1> <p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %} {% endif %} {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/registration/password_reset_confirm.html
HTML
asf20
1,103
{% extends "comments/base.html" %} {% load i18n %} {% block title %}{% trans "Thanks for flagging" %}.{% endblock %} {% block content %} <h1>{% trans "Thanks for taking the time to improve the quality of discussion on our site" %}.</h1> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/flagged.html
HTML
asf20
256
{% extends "comments/base.html" %} {% load i18n %} {% block title %}{% trans "Approve a comment" %}{% endblock %} {% block content %} <h1>{% trans "Really make this comment public?" %}</h1> <blockquote>{{ comment|linebreaks }}</blockquote> <form action="." method="post"> <input type="hidden" name="next" value="{{ next }}" id="next" /> <p class="submit"> <input type="submit" name="submit" value="{% trans "Approve" %}" /> or <a href="{{ comment.permalink }}">cancel</a> </p> </form> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/approve.html
HTML
asf20
528
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Comment post not allowed (400)</title> <meta name="robots" content="NONE,NOARCHIVE" /> <style type="text/css"> html * { padding:0; margin:0; } body * { padding:10px 20px; } body * * { padding:0; } body { font:small sans-serif; background:#eee; } body>div { border-bottom:1px solid #ddd; } h1 { font-weight:normal; margin-bottom:.4em; } h1 span { font-size:60%; color:#666; font-weight:normal; } table { border:none; border-collapse: collapse; width:100%; } td, th { vertical-align:top; padding:2px 3px; } th { width:12em; text-align:right; color:#666; padding-right:.5em; } #info { background:#f6f6f6; } #info ol { margin: 0.5em 4em; } #info ol li { font-family: monospace; } #summary { background: #ffc; } #explanation { background:#eee; border-bottom: 0px none; } </style> </head> <body> <div id="summary"> <h1>Comment post not allowed <span>(400)</span></h1> <table class="meta"> <tr> <th>Why:</th> <td>{{ why }}</td> </tr> </table> </div> <div id="info"> <p> The comment you tried to post to this view wasn't saved because something tampered with the security information in the comment form. The message above should explain the problem, or you can check the <a href="http://docs.djangoproject.com/en/dev/ref/contrib/comments/">comment documentation</a> for more help. </p> </div> <div id="explanation"> <p> You're seeing this error because you have <code>DEBUG = True</code> in your Django settings file. Change that to <code>False</code>, and Django will display a standard 400 error page. </p> </div> </body> </html>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/400-debug.html
HTML
asf20
1,906
{% extends "comments/base.html" %} {% load i18n %} {% block title %}{% trans "Thanks for commenting" %}.{% endblock %} {% block content %} <h1>{% trans "Thank you for your comment" %}.</h1> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/posted.html
HTML
asf20
209
{% extends "comments/base.html" %} {% load i18n %} {% block title %}{% trans "Preview your comment" %}{% endblock %} {% block content %} {% load comments %} <form action="{% comment_form_target %}" method="post"> {% if form.errors %} <h1>{% blocktrans count form.errors|length as counter %}Please correct the error below{% plural %}Please correct the errors below{% endblocktrans %}</h1> {% else %} <h1>{% trans "Preview your comment" %}</h1> <blockquote>{{ comment|linebreaks }}</blockquote> <p> {% trans "and" %} <input type="submit" name="submit" class="submit-post" value="{% trans "Post your comment" %}" id="submit" /> {% trans "or make changes" %}: </p> {% endif %} {% for field in form %} {% if field.is_hidden %} {{ field }} {% else %} <p {% if field.errors %} class="error"{% endif %} {% ifequal field.name "honeypot" %} style="display:none;"{% endifequal %}> {% if field.errors %}{{ field.errors }}{% endif %} {{ field.label_tag }} {{ field }} </p> {% endif %} {% endfor %} <p class="submit"> <input type="submit" name="submit" class="submit-post" value="{% trans "Post" %}" /> <input type="submit" name="preview" class="submit-preview" value="{% trans "Preview" %}" /> </p> </form> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/preview.html
HTML
asf20
1,367
{% load comments i18n %} <form action="{% comment_form_target %}" method="post"> {% for field in form %} {% if field.is_hidden %} {{ field }} {% else %} <p {% if field.errors %} class="error"{% endif %} {% ifequal field.name "honeypot" %} style="display:none;"{% endifequal %}> {% if field.errors %}{{ field.errors }}{% endif %} {{ field.label_tag }} {{ field }} </p> {% endif %} {% endfor %} <p class="submit"> <input type="submit" name="post" class="submit-post" value="{% trans "Post" %}" /> <input type="submit" name="preview" class="submit-preview" value="{% trans "Preview" %}" /> </p> </form>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/form.html
HTML
asf20
678
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>{% block title %}{% endblock %}</title> </head> <body> {% block content %}{% endblock %} </body> </html>
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/base.html
HTML
asf20
261
{% extends "admin/change_list.html" %} {% load adminmedia i18n %} {% block title %}{% trans "Comment moderation queue" %}{% endblock %} {% block extrahead %} {{ block.super }} <style type="text/css" media="screen"> p#nocomments { font-size: 200%; text-align: center; border: 1px #ccc dashed; padding: 4em; } td.actions { width: 11em; } td.actions form { display: inline; } td.actions form input.submit { width: 5em; padding: 2px 4px; margin-right: 4px;} td.actions form input.approve { background: green; color: white; } td.actions form input.remove { background: red; color: white; } </style> {% endblock %} {% block branding %} <h1 id="site-name">{% trans "Comment moderation queue" %}</h1> {% endblock %} {% block breadcrumbs %}{% endblock %} {% block content %} {% if empty %} <p id="nocomments">{% trans "No comments to moderate" %}.</p> {% else %} <div id="content-main"> <div class="module" id="changelist"> <table cellspacing="0"> <thead> <tr> <th>{% trans "Action" %}</th> <th>{% trans "Name" %}</th> <th>{% trans "Comment" %}</th> <th>{% trans "Email" %}</th> <th>{% trans "URL" %}</th> <th>{% trans "Authenticated?" %}</th> <th>{% trans "IP Address" %}</th> <th class="sorted desc">{% trans "Date posted" %}</th> </tr> </thead> <tbody> {% for comment in comments %} <tr class="{% cycle 'row1' 'row2' %}"> <td class="actions"> <form action="{% url comments-approve comment.pk %}" method="post"> <input type="hidden" name="next" value="{% url comments-moderation-queue %}" /> <input class="approve submit" type="submit" name="submit" value="{% trans "Approve" %}" /> </form> <form action="{% url comments-delete comment.pk %}" method="post"> <input type="hidden" name="next" value="{% url comments-moderation-queue %}" /> <input class="remove submit" type="submit" name="submit" value="{% trans "Remove" %}" /> </form> </td> <td>{{ comment.name }}</td> <td>{{ comment.comment|truncatewords:"50" }}</td> <td>{{ comment.email }}</td> <td>{{ comment.url }}</td> <td> <img src="{% admin_media_prefix %}img/admin/icon-{% if comment.user %}yes{% else %}no{% endif %}.gif" alt="{% if comment.user %}{% trans "yes" %}{% else %}{% trans "no" %}{% endif %}" /> </td> <td>{{ comment.ip_address }}</td> <td>{{ comment.submit_date|date:"F j, P" }}</td> </tr> {% endfor %} </tbody> </table> </div> </div> {% endif %} {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/moderation_queue.html
HTML
asf20
2,772
{% extends "comments/base.html" %} {% load i18n %} {% block title %}{% trans "Flag this comment" %}{% endblock %} {% block content %} <h1>{% trans "Really flag this comment?" %}</h1> <blockquote>{{ comment|linebreaks }}</blockquote> <form action="." method="post"> <input type="hidden" name="next" value="{{ next }}" id="next" /> <p class="submit"> <input type="submit" name="submit" value="{% trans "Flag" %}" /> or <a href="{{ comment.permalink }}">cancel</a> </p> </form> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/flag.html
HTML
asf20
514
{% extends "comments/base.html" %} {% load i18n %} {% block title %}{% trans "Thanks for approving" %}.{% endblock %} {% block content %} <h1>{% trans "Thanks for taking the time to improve the quality of discussion on our site" %}.</h1> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/approved.html
HTML
asf20
257
{% extends "comments/base.html" %} {% load i18n %} {% block title %}{% trans "Thanks for removing" %}.{% endblock %} {% block content %} <h1>{% trans "Thanks for taking the time to improve the quality of discussion on our site" %}.</h1> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/deleted.html
HTML
asf20
256
{% extends "comments/base.html" %} {% load i18n %} {% block title %}{% trans "Remove a comment" %}{% endblock %} {% block content %} <h1>{% trans "Really remove this comment?" %}</h1> <blockquote>{{ comment|linebreaks }}</blockquote> <form action="." method="post"> <input type="hidden" name="next" value="{{ next }}" id="next" /> <p class="submit"> <input type="submit" name="submit" value="{% trans "Remove" %}" /> or <a href="{{ comment.permalink }}">cancel</a> </p> </form> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/comments/delete.html
HTML
asf20
517
{% extends "admin/base_site.html" %} {% load i18n %} {% block coltype %}colSM{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; Tags</div>{% endblock %} {% block title %}Template tags{% endblock %} {% block content %} <h1>Template tag documentation</h1> <div id="content-main"> {% regroup tags|dictsort:"library" by library as tag_libraries %} {% for library in tag_libraries %} <div class="module"> <h2>{% firstof library.grouper "Built-in tags" %}</h2> {% if library.grouper %}<p class="small quiet">To use these tags, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the tag.</p><hr />{% endif %} {% for tag in library.list|dictsort:"name" %} <h3 id="{{ tag.name }}">{{ tag.name }}</h3> <h4>{{ tag.title }}</h4> <p>{{ tag.body }}</p> {% if not forloop.last %}<hr />{% endif %} {% endfor %} </div> {% endfor %} </div> {% endblock %} {% block sidebar %} <div id="content-related"> {% regroup tags|dictsort:"library" by library as tag_libraries %} {% for library in tag_libraries %} <div class="module"> <h2>{% firstof library.grouper "Built-in tags" %}</h2> <ul> {% for tag in library.list|dictsort:"name" %} <li><a href="#{{ tag.name }}">{{ tag.name }}</a></li> {% endfor %} </ul> </div> {% endfor %} </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin_doc/template_tag_index.html
HTML
asf20
1,464
{% extends "admin/base_site.html" %} {% load i18n %} {% block extrahead %} {{ block.super }} <style type="text/css"> .module table { width:100%; } .module table p { padding: 0; margin: 0; } </style> {% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; <a href="../">Models</a> &rsaquo; {{ name }}</div>{% endblock %} {% block title %}Model: {{ name }}{% endblock %} {% block content %} <div id="content-main"> <h1>{{ summary }}</h1> {% if description %} <p>{% filter linebreaksbr %}{% trans description %}{% endfilter %}</p> {% endif %} <div class="module"> <table class="model"> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> {% for field in fields|dictsort:"name" %} <tr> <td>{{ field.name }}</td> <td>{{ field.data_type }}</td> <td>{{ field.verbose }}{% if field.help_text %} - {{ field.help_text|safe }}{% endif %}</td> </tr> {% endfor %} </tbody> </table> </div> <p class="small"><a href="../">&lsaquo; Back to Models Documentation</a></p> </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin_doc/model_detail.html
HTML
asf20
1,130
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; Templates &rsaquo; {{ name }}</div>{% endblock %} {% block title %}Template: {{ name }}{% endblock %} {% block content %} <h1>Template: "{{ name }}"</h1> {% regroup templates|dictsort:"site_id" by site as templates_by_site %} {% for group in templates_by_site %} <h2>Search path for template "{{ name }}" on {{ group.grouper }}:</h2> <ol> {% for template in group.list|dictsort:"order" %} <li><code>{{ template.file }}</code>{% if not template.exists %} <em>(does not exist)</em>{% endif %}</li> {% endfor %} </ol> {% endfor %} <p class="small"><a href="../../">&lsaquo; Back to Documentation</a></p> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin_doc/template_detail.html
HTML
asf20
831
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Documentation</div>{% endblock %} {% block title %}Please install docutils{% endblock %} {% block content %} <h1>Documentation</h1> <div id="content-main"> <h3>The admin documentation system requires Python's <a href="http://docutils.sf.net/">docutils</a> library.</h3> <p>Please ask your administrators to install <a href="http://docutils.sf.net/">docutils</a>.</p> </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin_doc/missing_docutils.html
HTML
asf20
531
{% extends "admin/base_site.html" %} {% load i18n %} {% block coltype %}colSM{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; Views</div>{% endblock %} {% block title %}Views{% endblock %} {% block content %} <h1>View documentation</h1> {% regroup views|dictsort:"site_id" by site as views_by_site %} <div id="content-related" class="sidebar"> <div class="module"> <h2>Jump to site</h2> <ul> {% for site_views in views_by_site %} <li><a href="#site{{ site_views.grouper.id }}">{{ site_views.grouper.name }}</a></li> {% endfor %} </ul> </div> </div> <div id="content-main"> {% for site_views in views_by_site %} <div class="module"> <h2 id="site{{ site_views.grouper.id }}">Views by URL on {{ site_views.grouper.name }}</h2> {% for view in site_views.list|dictsort:"url" %} {% ifchanged %} <h3><a href="{{ view.module }}.{{ view.name }}/">{{ view.url }}</a></h3> <p class="small quiet">View function: {{ view.module }}.{{ view.name }}</p> <p>{{ view.title }}</p> <hr /> {% endifchanged %} {% endfor %} </div> {% endfor %} </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin_doc/view_index.html
HTML
asf20
1,154
{% extends "admin/base_site.html" %} {% block breadcrumbs %}{% load i18n %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> &rsaquo; <a href="../">{% trans "Documentation" %}</a> &rsaquo; {% trans "Bookmarklets" %}</div>{% endblock %} {% block title %}{% trans "Documentation bookmarklets" %}{% endblock %} {% block content %} {% blocktrans %} <p class="help">To install bookmarklets, drag the link to your bookmarks toolbar, or right-click the link and add it to your bookmarks. Now you can select the bookmarklet from any page in the site. Note that some of these bookmarklets require you to be viewing the site from a computer designated as "internal" (talk to your system administrator if you aren't sure if your computer is "internal").</p> {% endblocktrans %} <div id="content-main"> <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('HEAD',location.href,false);x.send(null);try{view=x.getResponseHeader('x-view');}catch(e){alert('No view found for this page');return;}if(view=='undefined'){alert('No view found for this page');}document.location='{{ admin_url }}doc/views/'+view+'/';})()">{% trans "Documentation for this page" %}</a></h3> <p>{% trans "Jumps you from any page to the documentation for the view that generates that page." %}</p> <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{type=x.getResponseHeader('x-object-type');id=x.getResponseHeader('x-object-id');}catch(e){type='(none)';id='(none)';}d=document;b=d.body;e=d.createElement('div');e.id='xxxhhh';s=e.style;s.position='absolute';s.left='10px';s.top='10px';s.font='10px monospace';s.border='1px black solid';s.padding='4px';s.backgroundColor='#eee';e.appendChild(d.createTextNode('Type: '+type));e.appendChild(d.createElement('br'));e.appendChild(d.createTextNode('ID: '+id));e.appendChild(d.createElement('br'));l=d.createElement('a');l.href='#';l.onclick=function(){b.removeChild(e);};l.appendChild(d.createTextNode('[close]'));l.style.textDecoration='none';e.appendChild(l);b.appendChild(e);})();">{% trans "Show object ID" %}</a></h3> <p>{% trans "Shows the content-type and unique ID for pages that represent a single object." %}</p> <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}document.location='{{ admin_url }}'+type.split('.').join('/')+'/'+id+'/';})()">{% trans "Edit this object (current window)" %}</a></h3> <p>{% trans "Jumps to the admin page for pages that represent a single object." %}</p> <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}window.open('{{ admin_url }}'+type.split('.').join('/')+'/'+id+'/');})()">{% trans "Edit this object (new window)" %}</a></h3> <p>{% trans "As above, but opens the admin page in a new window." %}</p> </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin_doc/bookmarklets.html
HTML
asf20
3,689
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; <a href="../">Views</a> &rsaquo; {{ name }}</div>{% endblock %} {% block title %}View: {{ name }}{% endblock %} {% block content %} <h1>{{ name }}</h1> <h2 class="subhead">{{ summary }}</h2> <p>{{ body }}</p> {% if meta.Context %} <h3>Context:</h3> <p>{{ meta.Context }}</p> {% endif %} {% if meta.Templates %} <h3>Templates:</h3> <p>{{ meta.Templates }}</p> {% endif %} <p class="small"><a href="../">&lsaquo; Back to Views Documentation</a></p> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin_doc/view_detail.html
HTML
asf20
652
{% extends "admin/base_site.html" %} {% load i18n %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Documentation</div>{% endblock %} {% block title %}Documentation{% endblock %} {% block content %} <h1>Documentation</h1> <div id="content-main"> <h3><a href="tags/">Tags</a></h3> <p>List of all the template tags and their functions.</p> <h3><a href="filters/">Filters</a></h3> <p>Filters are actions which can be applied to variables in a template to alter the output.</p> <h3><a href="models/">Models</a></h3> <p>Models are descriptions of all the objects in the system and their associated fields. Each model has a list of fields which can be accessed as template variables.</p> <h3><a href="views/">Views</a></h3> <p>Each page on the public site is generated by a view. The view defines which template is used to generate the page and which objects are available to that template.</p> <h3><a href="bookmarklets/">Bookmarklets</a></h3> <p>Tools for your browser to quickly access admin functionality.</p> </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin_doc/index.html
HTML
asf20
1,096
{% extends "admin/base_site.html" %} {% load i18n %} {% block coltype %}colSM{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; Models</div>{% endblock %} {% block title %}Models{% endblock %} {% block content %} <h1>Model documentation</h1> {% regroup models by app_label as grouped_models %} <div id="content-main"> {% for group in grouped_models %} <div class="module"> <h2 id="{{ group.grouper }}">{{ group.grouper|capfirst }}</h2> <table class="xfull"> {% for model in group.list %} <tr> <th><a href="{{ model.app_label }}.{{ model.object_name.lower }}/">{{ model.object_name }}</a></th> </tr> {% endfor %} </table> </div> {% endfor %} </div> {% endblock %} {% block sidebar %} <div id="content-related" class="sidebar"> <div class="module"> <h2>Model groups</h2> <ul> {% regroup models by app_label as grouped_models %} {% for group in grouped_models %} <li><a href="#{{ group.grouper }}">{{ group.grouper|capfirst }}</a></li> {% endfor %} </ul> </div> </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin_doc/model_index.html
HTML
asf20
1,081
{% extends "admin/base_site.html" %} {% load i18n %} {% block coltype %}colSM{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; filters</div>{% endblock %} {% block title %}Template filters{% endblock %} {% block content %} <h1>Template filter documentation</h1> <div id="content-main"> {% regroup filters|dictsort:"library" by library as filter_libraries %} {% for library in filter_libraries %} <div class="module"> <h2>{% firstof library.grouper "Built-in filters" %}</h2> {% if library.grouper %}<p class="small quiet">To use these filters, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the filter.</p><hr />{% endif %} {% for filter in library.list|dictsort:"name" %} <h3 id="{{ filter.name }}">{{ filter.name }}</h3> <p>{{ filter.title }}</p> <p>{{ filter.body }}</p> {% if not forloop.last %}<hr />{% endif %} {% endfor %} </div> {% endfor %} </div> {% endblock %} {% block sidebar %} <div id="content-related"> {% regroup filters|dictsort:"library" by library as filter_libraries %} {% for library in filter_libraries %} <div class="module"> <h2>{% firstof library.grouper "Built-in filters" %}</h2> <ul> {% for filter in library.list|dictsort:"name" %} <li><a href="#{{ filter.name }}">{{ filter.name }}</a></li> {% endfor %} </ul> </div> {% endfor %} </div> {% endblock %}
100uhaco
trunk/GAE/common/django_aep_export/django_templates/templates/admin_doc/template_filter_index.html
HTML
asf20
1,525
#!/usr/bin/env python if __name__ == '__main__': from common.appenginepatch.aecmd import setup_env setup_env(manage_py_env=True) # Recompile translation files from mediautils.compilemessages import updatemessages updatemessages() # Generate compressed media files for manage.py update import sys from mediautils.generatemedia import updatemedia if len(sys.argv) >= 2 and sys.argv[1] == 'update': updatemedia(True) import settings from django.core.management import execute_manager execute_manager(settings)
100uhaco
trunk/GAE/manage.py
Python
asf20
566
#!/bin/sh rtc-template -bpython \ --module-name=Proxy \ --module-desc='RTC-Lite for Arduino' \ --module-version=1.0.0 \ --module-vendor=AIST \ --module-category=Proxy \ --module-comp-type=STATIC \ --module-act-type=PERIODIC \ --module-max-inst=1 \ --outport=Watt:TimedShort \ --outport=Light:TimedShort \ --outport=Temp:TimedShort sed -e "s/OpenRTM/OpenRTM_aist/g" Proxy.py > Proxy.pyy mv Proxy.pyy Proxy.py
100uhaco
trunk/RTC/python/Proxy/gen.sh
Shell
asf20
454
#!/usr/bin/env python # -*- Python -*- import sys import time sys.path.append(".") # Import RTM module import OpenRTM_aist import RTC import socket import httplib from time import sleep # Import Service implementation class # <rtc-template block="service_impl"> # </rtc-template> # Import Service stub modules # <rtc-template block="global_idl"> # </rtc-template> # This module's spesification # <rtc-template block="module_spec"> proxy_spec = ["implementation_id", "Proxy", "type_name", "Proxy", "description", "RTC-Lite for Arduino", "version", "1.0.0", "vendor", "AIST", "category", "Proxy", "activity_type", "STATIC", "max_instance", "1", "language", "Python", "lang_type", "SCRIPT", ""] # </rtc-template> class Proxy(OpenRTM_aist.DataFlowComponentBase): def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) # DataPorts initialization # <rtc-template block="data_ports"> self._d_Watt =RTC.TimedShort(RTC.Time(0,0),0) self._d_Light =RTC.TimedShort(RTC.Time(0,0),0) self._d_Temp =RTC.TimedShort(RTC.Time(0,0),0) self._WattOut =OpenRTM_aist.OutPort("Watt", self._d_Watt, OpenRTM_aist.RingBuffer(8)) self._LightOut =OpenRTM_aist.OutPort("Light", self._d_Light, OpenRTM_aist.RingBuffer(8)) self._TempOut =OpenRTM_aist.OutPort("Temp", self._d_Temp, OpenRTM_aist.RingBuffer(8)) # Set OutPort buffer self.registerOutPort("Watt",self._WattOut) self.registerOutPort("Light",self._LightOut) self.registerOutPort("Temp",self._TempOut) self._remoteIP="" # </rtc-template> # DataPorts initialization # <rtc-template block="service_ports"> # </rtc-template> # initialize of configuration-data. # <rtc-template block="configurations"> # </rtc-template> def onInitialize(self): # Bind variables and configuration variable # <rtc-template block="bind_config"> # </rtc-template> return RTC.RTC_OK #def onFinalize(self): # return RTC.RTC_OK #def onStartup(self, ec_id): # return RTC.RTC_OK #def onShutdown(self, ec_id): # return RTC.RTC_OK def onActivated(self, ec_id): print "onActivated" host ='' port =80 address ="255.255.255.255" recv_port =1300 recv_timeout =5 s =socket.socket( socket.AF_INET, socket.SOCK_DGRAM) s.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.setsockopt( socket.SOL_SOCKET, socket.SO_BROADCAST, 1) s.bind( ( host, port)) r =socket.socket(socket.AF_INET, socket.SOCK_DGRAM) r.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) r.bind((host, recv_port)) r.settimeout( recv_timeout) max =5 count =0 while count <5: print "try: ", count s.sendto( str(count), ( address, port)) try: message, ip_and_port = r.recvfrom(8192) if len( message) >0: print "message:", message, "from", ip_and_port self._remoteIP =ip_and_port[0] s.close() r.close() return RTC.RTC_OK except: count +=1 s.close() r.close() return RTC.RTC_ERROR def onDeactivated(self, ec_id): print "onDeactivated!" return RTC.RTC_OK def onExecute(self, ec_id): print "onExecute!" conn =httplib.HTTPConnection( self._remoteIP) conn.request( "GET", "/EXE") r =conn.getresponse() conn.close() print r.status, r.reason data =r.read() token =data.split( '\r\n') self._d_Watt.data =int(token[0]) self._d_Light.data =int(token[1]) self._d_Temp.data =int(token[2]) print self._d_Watt.data print self._d_Light.data print self._d_Temp.data self._WattOut.write() self._LightOut.write() self._TempOut.write() time.sleep( 1) return RTC.RTC_OK #def onAborting(self, ec_id): # return RTC.RTC_OK def onError(self, ec_id): print "onError!" return RTC.RTC_OK #def onReset(self, ec_id): # return RTC.RTC_OK #def onStateUpdate(self, ec_id): # return RTC.RTC_OK #def onRateChanged(self, ec_id): # return RTC.RTC_OK def MyModuleInit(manager): profile = OpenRTM_aist.Properties(defaults_str=proxy_spec) manager.registerFactory(profile, Proxy, OpenRTM_aist.Delete) # Create a component comp = manager.createComponent("Proxy") def main(): mgr = OpenRTM_aist.Manager.init(len(sys.argv), sys.argv) mgr.setModuleInitProc(MyModuleInit) mgr.activateManager() mgr.runManager() if __name__ == "__main__": main()
100uhaco
trunk/RTC/python/Proxy/.svn/text-base/Proxy.py.svn-base
Python
asf20
4,475
#!/bin/sh rtc-template -bpython \ --module-name=Proxy \ --module-desc='RTC-Lite for Arduino' \ --module-version=1.0.0 \ --module-vendor=AIST \ --module-category=Proxy \ --module-comp-type=STATIC \ --module-act-type=PERIODIC \ --module-max-inst=1 \ --outport=Watt:TimedShort \ --outport=Light:TimedShort \ --outport=Temp:TimedShort sed -e "s/OpenRTM/OpenRTM_aist/g" Proxy.py > Proxy.pyy mv Proxy.pyy Proxy.py
100uhaco
trunk/RTC/python/Proxy/.svn/text-base/gen.sh.svn-base
Shell
asf20
454
#!/usr/bin/env python # -*- Python -*- import sys import time sys.path.append(".") # Import RTM module import OpenRTM_aist import RTC import socket import httplib from time import sleep # Import Service implementation class # <rtc-template block="service_impl"> # </rtc-template> # Import Service stub modules # <rtc-template block="global_idl"> # </rtc-template> # This module's spesification # <rtc-template block="module_spec"> proxy_spec = ["implementation_id", "Proxy", "type_name", "Proxy", "description", "RTC-Lite for Arduino", "version", "1.0.0", "vendor", "AIST", "category", "Proxy", "activity_type", "STATIC", "max_instance", "1", "language", "Python", "lang_type", "SCRIPT", ""] # </rtc-template> class Proxy(OpenRTM_aist.DataFlowComponentBase): def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) # DataPorts initialization # <rtc-template block="data_ports"> self._d_Watt =RTC.TimedShort(RTC.Time(0,0),0) self._d_Light =RTC.TimedShort(RTC.Time(0,0),0) self._d_Temp =RTC.TimedShort(RTC.Time(0,0),0) self._WattOut =OpenRTM_aist.OutPort("Watt", self._d_Watt, OpenRTM_aist.RingBuffer(8)) self._LightOut =OpenRTM_aist.OutPort("Light", self._d_Light, OpenRTM_aist.RingBuffer(8)) self._TempOut =OpenRTM_aist.OutPort("Temp", self._d_Temp, OpenRTM_aist.RingBuffer(8)) # Set OutPort buffer self.registerOutPort("Watt",self._WattOut) self.registerOutPort("Light",self._LightOut) self.registerOutPort("Temp",self._TempOut) self._remoteIP="" # </rtc-template> # DataPorts initialization # <rtc-template block="service_ports"> # </rtc-template> # initialize of configuration-data. # <rtc-template block="configurations"> # </rtc-template> def onInitialize(self): # Bind variables and configuration variable # <rtc-template block="bind_config"> # </rtc-template> return RTC.RTC_OK #def onFinalize(self): # return RTC.RTC_OK #def onStartup(self, ec_id): # return RTC.RTC_OK #def onShutdown(self, ec_id): # return RTC.RTC_OK def onActivated(self, ec_id): print "onActivated" host ='' port =80 address ="255.255.255.255" recv_port =1300 recv_timeout =5 s =socket.socket( socket.AF_INET, socket.SOCK_DGRAM) s.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.setsockopt( socket.SOL_SOCKET, socket.SO_BROADCAST, 1) s.bind( ( host, port)) r =socket.socket(socket.AF_INET, socket.SOCK_DGRAM) r.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) r.bind((host, recv_port)) r.settimeout( recv_timeout) max =5 count =0 while count <5: print "try: ", count s.sendto( str(count), ( address, port)) try: message, ip_and_port = r.recvfrom(8192) if len( message) >0: print "message:", message, "from", ip_and_port self._remoteIP =ip_and_port[0] s.close() r.close() return RTC.RTC_OK except: count +=1 s.close() r.close() return RTC.RTC_ERROR def onDeactivated(self, ec_id): print "onDeactivated!" return RTC.RTC_OK def onExecute(self, ec_id): print "onExecute!" conn =httplib.HTTPConnection( self._remoteIP) conn.request( "GET", "/EXE") r =conn.getresponse() conn.close() print r.status, r.reason data =r.read() token =data.split( '\r\n') self._d_Watt.data =int(token[0]) self._d_Light.data =int(token[1]) self._d_Temp.data =int(token[2]) print self._d_Watt.data print self._d_Light.data print self._d_Temp.data self._WattOut.write() self._LightOut.write() self._TempOut.write() time.sleep( 1) return RTC.RTC_OK #def onAborting(self, ec_id): # return RTC.RTC_OK def onError(self, ec_id): print "onError!" return RTC.RTC_OK #def onReset(self, ec_id): # return RTC.RTC_OK #def onStateUpdate(self, ec_id): # return RTC.RTC_OK #def onRateChanged(self, ec_id): # return RTC.RTC_OK def MyModuleInit(manager): profile = OpenRTM_aist.Properties(defaults_str=proxy_spec) manager.registerFactory(profile, Proxy, OpenRTM_aist.Delete) # Create a component comp = manager.createComponent("Proxy") def main(): mgr = OpenRTM_aist.Manager.init(len(sys.argv), sys.argv) mgr.setModuleInitProc(MyModuleInit) mgr.activateManager() mgr.runManager() if __name__ == "__main__": main()
100uhaco
trunk/RTC/python/Proxy/Proxy.py
Python
asf20
4,475
// -*- Java -*- /*! * @file ProxyComp.java * @brief Standalone component * @date $Date$ * * $Id$ */ import RTC.ComponentProfile; import RTC.PortInterfacePolarity; import RTC.PortInterfaceProfileListHolder; import RTC.PortService; import RTC.PortServiceListHolder; import _SDOPackage.NVListHolder; import jp.go.aist.rtm.RTC.Manager; import jp.go.aist.rtm.RTC.ModuleInitProc; import jp.go.aist.rtm.RTC.RTObject_impl; import jp.go.aist.rtm.RTC.util.NVUtil; import jp.go.aist.rtm.RTC.util.Properties; /* * ! @class ProxyComp @brief Standalone component Class * */ public class ProxyComp implements ModuleInitProc { public void myModuleInit(Manager mgr) { Properties prop = new Properties(Proxy.component_conf); mgr.registerFactory(prop, new Proxy(), new Proxy()); // Create a component RTObject_impl comp = mgr.createComponent("Proxy"); if (comp == null) { System.err.println("Component create failed."); System.exit(0); } // Create a component System.out.println("Creating a component: \"Proxy\"...."); System.out.println("succeed."); ComponentProfile prof = comp.get_component_profile(); System.out.println( "=================================================" ); System.out.println( " Component Profile" ); System.out.println( "-------------------------------------------------" ); System.out.println( "InstanceID: " + prof.instance_name ); System.out.println( "Implementation: " + prof.type_name ); System.out.println( "Description: " + prof.description ); System.out.println( "Version: " + prof.version ); System.out.println( "Maker: " + prof.vendor ); System.out.println( "Category: " + prof.category ); System.out.println( " Other properties " ); NVUtil.dump(new NVListHolder(prof.properties)); System.out.println( "=================================================" ); PortServiceListHolder portlist = new PortServiceListHolder(comp.get_ports()); for( int intIdx=0;intIdx<portlist.value.length;++intIdx ) { PortService port = portlist.value[intIdx]; System.out.println( "=================================================" ); System.out.println( "Port" + intIdx + " (name): "); System.out.println( port.get_port_profile().name ); System.out.println( "-------------------------------------------------" ); PortInterfaceProfileListHolder iflist = new PortInterfaceProfileListHolder(port.get_port_profile().interfaces); for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) { System.out.println( "I/F name: " ); System.out.println( iflist.value[intIdx2].instance_name ); System.out.println( "I/F type: "); System.out.println( iflist.value[intIdx2].type_name ); if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) { System.out.println( "Polarity: PROVIDED" ); } else { System.out.println( "Polarity: REQUIRED" ); } } System.out.println( "- properties -" ); NVUtil.dump(new NVListHolder(port.get_port_profile().properties)); System.out.println( "-------------------------------------------------" ); } // Example // The following procedure is examples how handle RT-Components. // These should not be in this function. // // Get the component's object reference // Manager manager = Manager.instance(); // RTObject rtobj = null; // try { // rtobj = // RTObjectHelper.narrow(manager.getPOA().servant_to_reference(comp)); // } catch (ServantNotActive e) { // e.printStackTrace(); // } catch (WrongPolicy e) { // e.printStackTrace(); // } // // // Get the port list of the component // PortListHolder portlist = new PortListHolder(); // portlist.value = rtobj.get_ports(); // // // getting port profiles // System.out.println( "Number of Ports: " ); // System.out.println( portlist.value.length ); // for( int intIdx=0;intIdx<portlist.value.length;++intIdx ) { // Port port = portlist.value[intIdx]; // System.out.println( "Port" + intIdx + " (name): "); // System.out.println( port.get_port_profile().name ); // // PortInterfaceProfileListHolder iflist = new // PortInterfaceProfileListHolder(); // iflist.value = port.get_port_profile().interfaces; // System.out.println( "---interfaces---" ); // for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) { // System.out.println( "I/F name: " ); // System.out.println( iflist.value[intIdx2].instance_name ); // System.out.println( "I/F type: " ); // System.out.println( iflist.value[intIdx2].type_name ); // if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) // { // System.out.println( "Polarity: PROVIDED" ); // } else { // System.out.println( "Polarity: REQUIRED" ); // } // } // System.out.println( "---properties---" ); // NVUtil.dump( new NVListHolder(port.get_port_profile().properties) ); // System.out.println( "----------------" ); // } } public static void main(String[] args) { // Initialize manager final Manager manager = Manager.init(args); // Set module initialization proceduer // This procedure will be invoked in activateManager() function. ProxyComp init = new ProxyComp(); manager.setModuleInitProc(init); // Activate manager and register to naming service manager.activateManager(); // run the manager in blocking mode // runManager(false) is the default. manager.runManager(); // If you want to run the manager in non-blocking mode, do like this // manager.runManager(true); } }
100uhaco
trunk/RTC/java/Proxy/ProxyComp.java
Java
asf20
6,004
// -*- Java -*- /*! * @file Proxy.java * @date $Date$ * * $Id$ */ import jp.go.aist.rtm.RTC.Manager; import jp.go.aist.rtm.RTC.RTObject_impl; import jp.go.aist.rtm.RTC.RtcDeleteFunc; import jp.go.aist.rtm.RTC.RtcNewFunc; import jp.go.aist.rtm.RTC.util.Properties; /* * ! @class Proxy @brief RTC-Lite for Arduino */ public class Proxy implements RtcNewFunc, RtcDeleteFunc { // Module specification // <rtc-template block="module_spec"> public static String component_conf[] = { "implementation_id", "Proxy", "type_name", "Proxy", "description", "RTC-Lite for Arduino", "version", "1.0.0", "vendor", "AIST", "category", "Proxy", "activity_type", "STATIC", "max_instance", "1", "language", "Java", "lang_type", "compile", "exec_cxt.periodic.rate", "0.2", // Configuration variables "conf.default.MAC_addr", "00-00-00-00-00-00", "" }; // </rtc-template> public RTObject_impl createRtc(Manager mgr) { return new ProxyImpl(mgr); } public void deleteRtc(RTObject_impl rtcBase) { rtcBase = null; } public void registerModule() { Properties prop = new Properties(component_conf); final Manager manager = Manager.instance(); manager.registerFactory(prop, new Proxy(), new Proxy()); } }
100uhaco
trunk/RTC/java/Proxy/.svn/text-base/Proxy.java.svn-base
Java
asf20
1,308
// -*- Java -*- /*! * @file ProxyComp.java * @brief Standalone component * @date $Date$ * * $Id$ */ import RTC.ComponentProfile; import RTC.PortInterfacePolarity; import RTC.PortInterfaceProfileListHolder; import RTC.PortService; import RTC.PortServiceListHolder; import _SDOPackage.NVListHolder; import jp.go.aist.rtm.RTC.Manager; import jp.go.aist.rtm.RTC.ModuleInitProc; import jp.go.aist.rtm.RTC.RTObject_impl; import jp.go.aist.rtm.RTC.util.NVUtil; import jp.go.aist.rtm.RTC.util.Properties; /* * ! @class ProxyComp @brief Standalone component Class * */ public class ProxyComp implements ModuleInitProc { public void myModuleInit(Manager mgr) { Properties prop = new Properties(Proxy.component_conf); mgr.registerFactory(prop, new Proxy(), new Proxy()); // Create a component RTObject_impl comp = mgr.createComponent("Proxy"); if (comp == null) { System.err.println("Component create failed."); System.exit(0); } // Create a component System.out.println("Creating a component: \"Proxy\"...."); System.out.println("succeed."); ComponentProfile prof = comp.get_component_profile(); System.out.println( "=================================================" ); System.out.println( " Component Profile" ); System.out.println( "-------------------------------------------------" ); System.out.println( "InstanceID: " + prof.instance_name ); System.out.println( "Implementation: " + prof.type_name ); System.out.println( "Description: " + prof.description ); System.out.println( "Version: " + prof.version ); System.out.println( "Maker: " + prof.vendor ); System.out.println( "Category: " + prof.category ); System.out.println( " Other properties " ); NVUtil.dump(new NVListHolder(prof.properties)); System.out.println( "=================================================" ); PortServiceListHolder portlist = new PortServiceListHolder(comp.get_ports()); for( int intIdx=0;intIdx<portlist.value.length;++intIdx ) { PortService port = portlist.value[intIdx]; System.out.println( "=================================================" ); System.out.println( "Port" + intIdx + " (name): "); System.out.println( port.get_port_profile().name ); System.out.println( "-------------------------------------------------" ); PortInterfaceProfileListHolder iflist = new PortInterfaceProfileListHolder(port.get_port_profile().interfaces); for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) { System.out.println( "I/F name: " ); System.out.println( iflist.value[intIdx2].instance_name ); System.out.println( "I/F type: "); System.out.println( iflist.value[intIdx2].type_name ); if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) { System.out.println( "Polarity: PROVIDED" ); } else { System.out.println( "Polarity: REQUIRED" ); } } System.out.println( "- properties -" ); NVUtil.dump(new NVListHolder(port.get_port_profile().properties)); System.out.println( "-------------------------------------------------" ); } // Example // The following procedure is examples how handle RT-Components. // These should not be in this function. // // Get the component's object reference // Manager manager = Manager.instance(); // RTObject rtobj = null; // try { // rtobj = // RTObjectHelper.narrow(manager.getPOA().servant_to_reference(comp)); // } catch (ServantNotActive e) { // e.printStackTrace(); // } catch (WrongPolicy e) { // e.printStackTrace(); // } // // // Get the port list of the component // PortListHolder portlist = new PortListHolder(); // portlist.value = rtobj.get_ports(); // // // getting port profiles // System.out.println( "Number of Ports: " ); // System.out.println( portlist.value.length ); // for( int intIdx=0;intIdx<portlist.value.length;++intIdx ) { // Port port = portlist.value[intIdx]; // System.out.println( "Port" + intIdx + " (name): "); // System.out.println( port.get_port_profile().name ); // // PortInterfaceProfileListHolder iflist = new // PortInterfaceProfileListHolder(); // iflist.value = port.get_port_profile().interfaces; // System.out.println( "---interfaces---" ); // for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) { // System.out.println( "I/F name: " ); // System.out.println( iflist.value[intIdx2].instance_name ); // System.out.println( "I/F type: " ); // System.out.println( iflist.value[intIdx2].type_name ); // if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) // { // System.out.println( "Polarity: PROVIDED" ); // } else { // System.out.println( "Polarity: REQUIRED" ); // } // } // System.out.println( "---properties---" ); // NVUtil.dump( new NVListHolder(port.get_port_profile().properties) ); // System.out.println( "----------------" ); // } } public static void main(String[] args) { // Initialize manager final Manager manager = Manager.init(args); // Set module initialization proceduer // This procedure will be invoked in activateManager() function. ProxyComp init = new ProxyComp(); manager.setModuleInitProc(init); // Activate manager and register to naming service manager.activateManager(); // run the manager in blocking mode // runManager(false) is the default. manager.runManager(); // If you want to run the manager in non-blocking mode, do like this // manager.runManager(true); } }
100uhaco
trunk/RTC/java/Proxy/.svn/text-base/ProxyComp.java.svn-base
Java
asf20
6,004
// -*- Java -*- /*! * @file Proxy.java * @date $Date$ * * $Id$ */ import jp.go.aist.rtm.RTC.Manager; import jp.go.aist.rtm.RTC.RTObject_impl; import jp.go.aist.rtm.RTC.RtcDeleteFunc; import jp.go.aist.rtm.RTC.RtcNewFunc; import jp.go.aist.rtm.RTC.util.Properties; /* * ! @class Proxy @brief RTC-Lite for Arduino */ public class Proxy implements RtcNewFunc, RtcDeleteFunc { // Module specification // <rtc-template block="module_spec"> public static String component_conf[] = { "implementation_id", "Proxy", "type_name", "Proxy", "description", "RTC-Lite for Arduino", "version", "1.0.0", "vendor", "AIST", "category", "Proxy", "activity_type", "STATIC", "max_instance", "1", "language", "Java", "lang_type", "compile", "exec_cxt.periodic.rate", "0.2", // Configuration variables "conf.default.MAC_addr", "00-00-00-00-00-00", "" }; // </rtc-template> public RTObject_impl createRtc(Manager mgr) { return new ProxyImpl(mgr); } public void deleteRtc(RTObject_impl rtcBase) { rtcBase = null; } public void registerModule() { Properties prop = new Properties(component_conf); final Manager manager = Manager.instance(); manager.registerFactory(prop, new Proxy(), new Proxy()); } }
100uhaco
trunk/RTC/java/Proxy/Proxy.java
Java
asf20
1,308
title Proxy set "CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar" java ProxyComp
100uhaco
trunk/RTC/java/Proxy/classes/Proxy.bat
Batchfile
asf20
131
// -*- Java -*- /*! * @file GAEConnectorComp.java * @brief Standalone component * @date $Date$ * * $Id$ */ import RTC.ComponentProfile; import RTC.PortInterfacePolarity; import RTC.PortInterfaceProfileListHolder; import RTC.PortService; import RTC.PortServiceListHolder; import _SDOPackage.NVListHolder; import jp.go.aist.rtm.RTC.Manager; import jp.go.aist.rtm.RTC.ModuleInitProc; import jp.go.aist.rtm.RTC.RTObject_impl; import jp.go.aist.rtm.RTC.util.NVUtil; import jp.go.aist.rtm.RTC.util.Properties; /*! * @class GAEConnectorComp * @brief Standalone component Class * */ public class GAEConnectorComp implements ModuleInitProc { public void myModuleInit(Manager mgr) { Properties prop = new Properties(GAEConnector.component_conf); mgr.registerFactory(prop, new GAEConnector(), new GAEConnector()); // Create a component RTObject_impl comp = mgr.createComponent("GAEConnector"); if( comp==null ) { System.err.println("Component create failed."); System.exit(0); } // Create a component System.out.println("Creating a component: \"GAEConnector\"...."); System.out.println("succeed."); ComponentProfile prof = comp.get_component_profile(); System.out.println( "=================================================" ); System.out.println( " Component Profile" ); System.out.println( "-------------------------------------------------" ); System.out.println( "InstanceID: " + prof.instance_name ); System.out.println( "Implementation: " + prof.type_name ); System.out.println( "Description: " + prof.description ); System.out.println( "Version: " + prof.version ); System.out.println( "Maker: " + prof.vendor ); System.out.println( "Category: " + prof.category ); System.out.println( " Other properties " ); NVUtil.dump(new NVListHolder(prof.properties)); System.out.println( "=================================================" ); PortServiceListHolder portlist = new PortServiceListHolder(comp.get_ports()); for( int intIdx=0;intIdx<portlist.value.length;++intIdx ) { PortService port = portlist.value[intIdx]; System.out.println( "=================================================" ); System.out.println( "Port" + intIdx + " (name): "); System.out.println( port.get_port_profile().name ); System.out.println( "-------------------------------------------------" ); PortInterfaceProfileListHolder iflist = new PortInterfaceProfileListHolder(port.get_port_profile().interfaces); for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) { System.out.println( "I/F name: " ); System.out.println( iflist.value[intIdx2].instance_name ); System.out.println( "I/F type: "); System.out.println( iflist.value[intIdx2].type_name ); if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) { System.out.println( "Polarity: PROVIDED" ); } else { System.out.println( "Polarity: REQUIRED" ); } } System.out.println( "- properties -" ); NVUtil.dump(new NVListHolder(port.get_port_profile().properties)); System.out.println( "-------------------------------------------------" ); } // Example // The following procedure is examples how handle RT-Components. // These should not be in this function. // // Get the component's object reference // Manager manager = Manager.instance(); // RTObject rtobj = null; // try { // rtobj = RTObjectHelper.narrow(manager.getPOA().servant_to_reference(comp)); // } catch (ServantNotActive e) { // e.printStackTrace(); // } catch (WrongPolicy e) { // e.printStackTrace(); // } // // // Get the port list of the component // PortListHolder portlist = new PortListHolder(); // portlist.value = rtobj.get_ports(); // // // getting port profiles // System.out.println( "Number of Ports: " ); // System.out.println( portlist.value.length ); // for( int intIdx=0;intIdx<portlist.value.length;++intIdx ) { // Port port = portlist.value[intIdx]; // System.out.println( "Port" + intIdx + " (name): "); // System.out.println( port.get_port_profile().name ); // // PortInterfaceProfileListHolder iflist = new PortInterfaceProfileListHolder(); // iflist.value = port.get_port_profile().interfaces; // System.out.println( "---interfaces---" ); // for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) { // System.out.println( "I/F name: " ); // System.out.println( iflist.value[intIdx2].instance_name ); // System.out.println( "I/F type: " ); // System.out.println( iflist.value[intIdx2].type_name ); // if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) { // System.out.println( "Polarity: PROVIDED" ); // } else { // System.out.println( "Polarity: REQUIRED" ); // } // } // System.out.println( "---properties---" ); // NVUtil.dump( new NVListHolder(port.get_port_profile().properties) ); // System.out.println( "----------------" ); // } } public static void main(String[] args) { // Initialize manager final Manager manager = Manager.init(args); // Set module initialization proceduer // This procedure will be invoked in activateManager() function. GAEConnectorComp init = new GAEConnectorComp(); manager.setModuleInitProc(init); // Activate manager and register to naming service manager.activateManager(); // run the manager in blocking mode // runManager(false) is the default. manager.runManager(); // If you want to run the manager in non-blocking mode, do like this // manager.runManager(true); } }
100uhaco
trunk/RTC/java/GAEConnector/GAEConnectorComp.java
Java
asf20
6,370
// -*- Java -*- /*! * @file GAEConnector.java * @date $Date$ * * $Id$ */ import jp.go.aist.rtm.RTC.Manager; import jp.go.aist.rtm.RTC.RTObject_impl; import jp.go.aist.rtm.RTC.RtcDeleteFunc; import jp.go.aist.rtm.RTC.RtcNewFunc; import jp.go.aist.rtm.RTC.RegisterModuleFunc; import jp.go.aist.rtm.RTC.util.Properties; /*! * @class GAEConnector * @brief http connector for GAE */ public class GAEConnector implements RtcNewFunc, RtcDeleteFunc, RegisterModuleFunc { // Module specification // <rtc-template block="module_spec"> public static String component_conf[] = { "implementation_id", "GAEConnector", "type_name", "GAEConnector", "description", "http connector for GAE", "version", "1.0.0", "vendor", "AIST", "category", "Connector", "activity_type", "STATIC", "max_instance", "1", "language", "Java", "lang_type", "compile", "exec_cxt.periodic.rate", "1.0", // Configuration variables "conf.default.Account", "xxxxxxxx", "conf.default.Password", "xxxxxxxx", "" }; // </rtc-template> public RTObject_impl createRtc(Manager mgr) { return new GAEConnectorImpl(mgr); } public void deleteRtc(RTObject_impl rtcBase) { rtcBase = null; } public void registerModule() { Properties prop = new Properties(component_conf); final Manager manager = Manager.instance(); manager.registerFactory(prop, new GAEConnector(), new GAEConnector()); } }
100uhaco
trunk/RTC/java/GAEConnector/.svn/text-base/GAEConnector.java.svn-base
Java
asf20
1,667
// -*- Java -*- /*! * @file GAEConnectorComp.java * @brief Standalone component * @date $Date$ * * $Id$ */ import RTC.ComponentProfile; import RTC.PortInterfacePolarity; import RTC.PortInterfaceProfileListHolder; import RTC.PortService; import RTC.PortServiceListHolder; import _SDOPackage.NVListHolder; import jp.go.aist.rtm.RTC.Manager; import jp.go.aist.rtm.RTC.ModuleInitProc; import jp.go.aist.rtm.RTC.RTObject_impl; import jp.go.aist.rtm.RTC.util.NVUtil; import jp.go.aist.rtm.RTC.util.Properties; /*! * @class GAEConnectorComp * @brief Standalone component Class * */ public class GAEConnectorComp implements ModuleInitProc { public void myModuleInit(Manager mgr) { Properties prop = new Properties(GAEConnector.component_conf); mgr.registerFactory(prop, new GAEConnector(), new GAEConnector()); // Create a component RTObject_impl comp = mgr.createComponent("GAEConnector"); if( comp==null ) { System.err.println("Component create failed."); System.exit(0); } // Create a component System.out.println("Creating a component: \"GAEConnector\"...."); System.out.println("succeed."); ComponentProfile prof = comp.get_component_profile(); System.out.println( "=================================================" ); System.out.println( " Component Profile" ); System.out.println( "-------------------------------------------------" ); System.out.println( "InstanceID: " + prof.instance_name ); System.out.println( "Implementation: " + prof.type_name ); System.out.println( "Description: " + prof.description ); System.out.println( "Version: " + prof.version ); System.out.println( "Maker: " + prof.vendor ); System.out.println( "Category: " + prof.category ); System.out.println( " Other properties " ); NVUtil.dump(new NVListHolder(prof.properties)); System.out.println( "=================================================" ); PortServiceListHolder portlist = new PortServiceListHolder(comp.get_ports()); for( int intIdx=0;intIdx<portlist.value.length;++intIdx ) { PortService port = portlist.value[intIdx]; System.out.println( "=================================================" ); System.out.println( "Port" + intIdx + " (name): "); System.out.println( port.get_port_profile().name ); System.out.println( "-------------------------------------------------" ); PortInterfaceProfileListHolder iflist = new PortInterfaceProfileListHolder(port.get_port_profile().interfaces); for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) { System.out.println( "I/F name: " ); System.out.println( iflist.value[intIdx2].instance_name ); System.out.println( "I/F type: "); System.out.println( iflist.value[intIdx2].type_name ); if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) { System.out.println( "Polarity: PROVIDED" ); } else { System.out.println( "Polarity: REQUIRED" ); } } System.out.println( "- properties -" ); NVUtil.dump(new NVListHolder(port.get_port_profile().properties)); System.out.println( "-------------------------------------------------" ); } // Example // The following procedure is examples how handle RT-Components. // These should not be in this function. // // Get the component's object reference // Manager manager = Manager.instance(); // RTObject rtobj = null; // try { // rtobj = RTObjectHelper.narrow(manager.getPOA().servant_to_reference(comp)); // } catch (ServantNotActive e) { // e.printStackTrace(); // } catch (WrongPolicy e) { // e.printStackTrace(); // } // // // Get the port list of the component // PortListHolder portlist = new PortListHolder(); // portlist.value = rtobj.get_ports(); // // // getting port profiles // System.out.println( "Number of Ports: " ); // System.out.println( portlist.value.length ); // for( int intIdx=0;intIdx<portlist.value.length;++intIdx ) { // Port port = portlist.value[intIdx]; // System.out.println( "Port" + intIdx + " (name): "); // System.out.println( port.get_port_profile().name ); // // PortInterfaceProfileListHolder iflist = new PortInterfaceProfileListHolder(); // iflist.value = port.get_port_profile().interfaces; // System.out.println( "---interfaces---" ); // for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) { // System.out.println( "I/F name: " ); // System.out.println( iflist.value[intIdx2].instance_name ); // System.out.println( "I/F type: " ); // System.out.println( iflist.value[intIdx2].type_name ); // if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) { // System.out.println( "Polarity: PROVIDED" ); // } else { // System.out.println( "Polarity: REQUIRED" ); // } // } // System.out.println( "---properties---" ); // NVUtil.dump( new NVListHolder(port.get_port_profile().properties) ); // System.out.println( "----------------" ); // } } public static void main(String[] args) { // Initialize manager final Manager manager = Manager.init(args); // Set module initialization proceduer // This procedure will be invoked in activateManager() function. GAEConnectorComp init = new GAEConnectorComp(); manager.setModuleInitProc(init); // Activate manager and register to naming service manager.activateManager(); // run the manager in blocking mode // runManager(false) is the default. manager.runManager(); // If you want to run the manager in non-blocking mode, do like this // manager.runManager(true); } }
100uhaco
trunk/RTC/java/GAEConnector/.svn/text-base/GAEConnectorComp.java.svn-base
Java
asf20
6,370