-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
""" | ||
Django settings for Translator project. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/1.6/topics/settings/ | ||
For the full list of settings and their values, see | ||
https://docs.djangoproject.com/en/1.6/ref/settings/ | ||
""" | ||
|
||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | ||
import os,sys | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) | ||
SETTINGS_DIR = os.path.dirname(__file__) | ||
PROJECT_PATH = os.path.join(SETTINGS_DIR, os.pardir) | ||
PROJECT_PATH = os.path.abspath(PROJECT_PATH) | ||
|
||
# Quick-start development settings - unsuitable for production | ||
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ | ||
|
||
# SECURITY WARNING: keep the secret key used in production secret! | ||
SECRET_KEY = 'l89(v-#vgokfn4c4qe+^+h0jwe%rt0lzxz_oa_=ob=$*02*e2z' | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = True | ||
|
||
TEMPLATE_DEBUG = True | ||
|
||
ALLOWED_HOSTS = [] | ||
|
||
|
||
# Application definition | ||
|
||
INSTALLED_APPS = ( | ||
'django.contrib.admin', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.messages', | ||
'django.contrib.staticfiles', | ||
'TranslatorManager', | ||
'django.contrib.admin', | ||
'Translator' | ||
) | ||
|
||
MIDDLEWARE_CLASSES = ( | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
) | ||
|
||
ROOT_URLCONF = 'Translator.urls' | ||
|
||
WSGI_APPLICATION = 'Translator.wsgi.application' | ||
|
||
|
||
# Database | ||
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.mysql', | ||
'NAME': 'TranslatorDB', | ||
'USER':'root', | ||
'PASSWORD':'root' | ||
#os.path.join(BASE_DIR, 'db.sqlite3'), | ||
} | ||
} | ||
|
||
# Internationalization | ||
# https://docs.djangoproject.com/en/1.6/topics/i18n/ | ||
|
||
LANGUAGE_CODE = 'en-us' | ||
|
||
TIME_ZONE = 'UTC' | ||
|
||
USE_I18N = True | ||
|
||
USE_L10N = True | ||
|
||
USE_TZ = True | ||
|
||
|
||
# Static files (CSS, JavaScript, Images) | ||
# https://docs.djangoproject.com/en/1.6/howto/static-files/ | ||
|
||
STATIC_PATH = os.path.join(PROJECT_PATH, 'static') | ||
|
||
STATIC_URL = '/static/' # You may find this is already defined as such. | ||
|
||
STATICFILES_DIRS = ( | ||
STATIC_PATH, | ||
) | ||
|
||
TEMPLATE_PATH = os.path.join(PROJECT_PATH, 'templates') | ||
TEMPLATE_DIRS = ( | ||
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". | ||
# Always use forward slashes, even on Windows. | ||
# Don't forget to use absolute paths, not relative paths. | ||
TEMPLATE_PATH, | ||
) | ||
|
||
LOGGING = { | ||
'version': 1, | ||
'disable_existing_loggers': False, | ||
'formatters': { | ||
'verbose': { | ||
'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", | ||
'datefmt' : "%d/%b/%Y %H:%M:%S" | ||
}, | ||
'simple': { | ||
'format': '%(levelname)s %(message)s' | ||
}, | ||
}, | ||
'handlers': { | ||
'console':{ | ||
'level':'DEBUG', | ||
'class':'logging.StreamHandler', | ||
'formatter': 'simple' | ||
}, | ||
}, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.conf.urls import patterns, include, url | ||
from TranslatorManager import views | ||
|
||
from django.contrib import admin | ||
admin.autodiscover() | ||
|
||
urlpatterns = patterns('', | ||
# Examples: | ||
# url(r'^$', 'Translator.views.home', name='home'), | ||
# url(r'^blog/', include('blog.urls')), | ||
|
||
url(r'^admin/', include(admin.site.urls)), | ||
url(r'^$', views.index, name='index'), | ||
url(r'^clients/', views.clients, name='clients'), | ||
url(r'^jobs/', views.jobs, name='jobs'), | ||
url(r'^completed/', views.completed, name='completed'), | ||
#url(r'^jobs/(?P<client>[-\w]+)/all_clients/$', 'all_clients'), | ||
url(r'^add_client/$', views.add_client, name='add_client'), # NEW MAPPING! | ||
|
||
|
||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
WSGI config for Translator project. | ||
It exposes the WSGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ | ||
""" | ||
|
||
import os | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Translator.settings") | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
application = get_wsgi_application() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from django.contrib import admin | ||
from TranslatorManager.models import Client,JobType,ClientJob | ||
# Register your models here. | ||
|
||
|
||
admin.site.register(Client) | ||
admin.site.register(JobType) | ||
admin.site.register(ClientJob) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
__author__ = 'joannes' | ||
|
||
from django import forms | ||
from TranslatorManager.models import Client,ClientJob | ||
|
||
class ClientForm(forms.ModelForm): | ||
clientName = forms.CharField(max_length=200, help_text="Please enter the client name.") | ||
clientContact = forms.CharField(max_length=200, help_text="Please enter the client contact.") | ||
|
||
# An inline class to provide additional information on the form. | ||
class Meta: | ||
# Provide an association between the ModelForm and a model | ||
model = Client | ||
fields = ["clientName", "clientContact"] | ||
|
||
|
||
class AddJobForm(forms.ModelForm): | ||
clientName = forms.CharField(max_length=200, help_text="Please enter the client name.") | ||
clientContact = forms.CharField(max_length=200, help_text="Please enter the client contact.") | ||
|
||
ENGLISH = 'EN' | ||
FRENCH = 'FR' | ||
SPANISH = 'ES' | ||
LANGUAGES = ( | ||
(ENGLISH, 'English'), | ||
(FRENCH, 'French'), | ||
(SPANISH, 'Spanish'), | ||
) | ||
TRANSLATION = 'Translation' | ||
REVIEW = 'Review' | ||
DTP = 'DTP' | ||
|
||
SERVICES = ( | ||
(TRANSLATION, 'Translation'), | ||
(REVIEW, 'Review'), | ||
(DTP, 'DTP'), | ||
) | ||
#client = models.ForeignKey(Client) | ||
clientContact = forms.CharField(max_length=100) | ||
languageFrom = forms.CharField(max_length=2) | ||
languageTarget = forms.CharField(max_length=2) | ||
description = forms.CharField(max_length=300) | ||
service = forms.CharField(max_length=20) | ||
deadLine = forms.DateTimeField() | ||
#currency = models. | ||
hours_Spent = forms.FloatField() | ||
words_new = forms.FloatField() | ||
words_fuzzy50 = forms.FloatField() | ||
words_fuzzy75 = forms.FloatField() | ||
words_fuzzy85 = forms.FloatField() | ||
words_fuzzy95 = forms.FloatField() | ||
words_match = forms.FloatField() | ||
words_rep = forms.FloatField() | ||
words_ice = forms.FloatField() | ||
#multiply total with this percentage value e.g. 100 * 1.50 (50% rush charge) | ||
pay_rush = forms.FloatField() | ||
|
||
# An inline class to provide additional information on the form. | ||
class Meta: | ||
# Provide an association between the ModelForm and a model | ||
model = ClientJob | ||
fields = ["clientName", "clientContact"] |