Revision: cae2b67930
Author: surenspost
Date: Mon Nov 22 05:24:57 2010
Log: Create a new src directory and copy cc_backend to that directory
http://code.google.com/p/codechecker/source/detail?r=cae2b67930
Revision: 11732d6cec
Author: surenspost
Date: Mon Nov 22 05:26:29 2010
Log: We no longer need the old cc_backend directory.
http://code.google.com/p/codechecker/source/detail?r=11732d6cec
Revision: 805593ec70
Author: surenspost
Date: Mon Nov 22 05:28:30 2010
Log: Create cc_frontend module within src. Create views, forms, models.py
a...
http://code.google.com/p/codechecker/source/detail?r=805593ec70
Revision: ee3a58c77c
Author: surenspost
Date: Mon Nov 22 05:29:23 2010
Log: We no longer need templates in the project root. Its within
src/cc_fro...
http://code.google.com/p/codechecker/source/detail?r=ee3a58c77c
Revision: a7dd846122
Author: surenspost
Date: Mon Nov 22 05:30:21 2010
Log: move config files to conf directory. This should go to $prefix/etc
http://code.google.com/p/codechecker/source/detail?r=a7dd846122
Revision: 40a098fe0c
Author: surenspost
Date: Mon Nov 22 05:30:53 2010
Log: make_setuid.sh goes to utils
http://code.google.com/p/codechecker/source/detail?r=40a098fe0c
Revision: bd733dd645
Author: surenspost
Date: Mon Nov 22 05:31:29 2010
Log: Add authors, readmes'
http://code.google.com/p/codechecker/source/detail?r=bd733dd645
Revision: 698c605237
Author: surenspost
Date: Mon Nov 22 05:32:23 2010
Log: now src should be copied as the python module to
$prefix/lib/python2.6...
http://code.google.com/p/codechecker/source/detail?r=698c605237
Revision: 0cc88bf7b7
Author: surenspost
Date: Mon Nov 22 05:35:30 2010
Log: Fixed first argument in a class method
http://code.google.com/p/codechecker/source/detail?r=0cc88bf7b7
Revision: cb892fdf51
Author: surenspost
Date: Mon Nov 22 05:53:21 2010
Log: Move cc_backend and cc_frontend into checker. The reasoning for that
i...
http://code.google.com/p/codechecker/source/detail?r=cb892fdf51
Revision: b08203914c
Author: surenspost
Date: Mon Nov 22 05:54:49 2010
Log: Fixing Reorg commit #1...
http://code.google.com/p/codechecker/source/detail?r=b08203914c
==============================================================================
Revision: cae2b67930
Author: surenspost
Date: Mon Nov 22 05:24:57 2010
Log: Create a new src directory and copy cc_backend to that directory
http://code.google.com/p/codechecker/source/detail?r=cae2b67930
Added:
/src/cc_backend/Checker.py
/src/cc_backend/Config.py
/src/cc_backend/__init__.py
/src/cc_backend/compiler/__init__.py
/src/cc_backend/compiler/compile.py
/src/cc_backend/evaluator/__init__.py
/src/cc_backend/evaluator/eval.py
/src/cc_backend/score/__init__.py
/src/cc_backend/score/score.py
/src/cc_backend/se/__init__.py
/src/cc_backend/se/build_secexec.sh
/src/cc_backend/se/secexec.c
/src/cc_backend/se/secexec.h
/src/cc_backend/se/secexec.py
/src/cc_backend/store/__init__.py
/src/cc_backend/store/default_store.py
/src/cc_backend/store/storage_interface.py
=======================================
--- /dev/null
+++ /src/cc_backend/Checker.py Mon Nov 22 05:24:57 2010
@@ -0,0 +1,74 @@
+#!/usr/bin
+import sys
+import os
+import string
+import time
+import threading
+
+from store.default_store import Default
+from evaluator.eval import Evaluate
+from compiler.compile import Compiler
+from score.score import Score
+from Config import Config
+
+
+def main():
+
+ config = Config("conf/codechecker.conf")
+ store = Default()
+ evaluator = Evaluate()
+ compiler = Compiler(config)
+ score = Score()
+
+ is_waiting = True
+
+ while True:
+ # get a queued submission.
+ submission = store.get_submission()
+
+ # if no submission is found wait for one.
+ if submission is None:
+ if not is_waiting:
+ is_waiting = True
+ print "Waiting for a submission."
+ time.sleep(2)
+ continue
+
+ is_waiting = False
+
+ # compile the submission
+ compiler_res = compiler.compile_source(submission["src_file"])
+ if compiler_res["retcode"] == 0:
+ store.set_compile_status("COMPILED", err_msg=None,
+ sub_id=submission["id"])
+ else:
+ store.set_compile_status("COMPILATION ERROR",
+ err_msg=status_info.err_msg,
+ sub_id=submission["id"])
+ continue
+
+ # Evaluate the queued submission. Somewhere in the following
+ # loop it is also possible that the program fails - need to
+ # set the status to runtime error status.
+ test_group_scores = []
+ for test_grp in store.get_test_group(submission["prob_id"]):
+ result_set = evaluator.eval_submission(submission,
+ test_grp,
compiler_res["run_cmd"])
+ test_grp_score = score.score_group(prob_id,
+ result_set)
+ store.set_test_group_score(test_grp_score,
+ problem_id=prob_id, test_group_id=test_grp["id"],
+ submission_id=submission["id"])
+ test_group_scores.append(test_grp_score)
+
+ # compute and set the overall score.
+ final_score = score.overall(test_group_scores,
+ problem_id=prob_id)
+ store.set_submission_score(final_score,
+ submission_id=submission["id"])
+ store.set_submission_run_status("PASS",
+ submission_id=submission["id"])
+
+
+if __name__ == '__main__':
+ main()
=======================================
--- /dev/null
+++ /src/cc_backend/Config.py Mon Nov 22 05:24:57 2010
@@ -0,0 +1,27 @@
+import ConfigParser
+import os
+
+class Config:
+
+ def __init__(self, configFilePath):
+ self.config = ConfigParser.ConfigParser()
+ self.config.read(configFilePath)
+ self.jail_root = self.config.get("BackendMain","JailRoot")
+ runs_path = self.config.get("BackendMain", "RunsPath")
+ self.runpath = os.path.join('/' , runs_path)
+ self.abs_path = os.path.join(self.jail_root, runs_path)
+ self.outputLimit =
int(self.config.get("BackendMain","OutputFileSizeLimit"))
+ self.heapsize = self.config.get("RuntimeLimits", "HeapSize")
+
+ # Check if setuid_helper exists.
+ self.shPath = self.config.get("BackendMain", "CheckerRoot")
+ "codechecker/backend/setuid_helper"
+ assert os.path.isfile(self.shPath) and os.access(self.shPath,
os.X_OK)
+
+
+if __name__ == "__main__":
+
+ config = Config("conf/codechecker.conf")
+ print config.config.sections()
+ print config.config.get("CompileCommands", "C_compile")
+
+
=======================================
--- /dev/null
+++ /src/cc_backend/compiler/compile.py Mon Nov 22 05:24:57 2010
@@ -0,0 +1,56 @@
+import subprocess
+import os.path
+
+
+class Compiler:
+ def __init__(self, config):
+ self.config = config
+
+ def compile_source(self, source_filepath, lang=None):
+ compiler = self.get_compiler(source_filepath, lang)
+ compiler.get_compile_cmd(source_filepath)
+ print compile_cmd
+ child = subprocess.Popen(compile_cmd, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE, shell=True)
+ out, err = child.communicate()
+ retDict = {}
+ retDict["retcode"] = child.returncode
+ retDict["compiler_output"] = out + err
+ retDict["run_cmd"] = compiler.get_run_cmd(source_filepath)
+ return retDict
+
+ # determines the language from the extension or from the lang
+ # argument if one is supplied.
+ def get_compiler(self, source_filepath, lang=None):
+ if lang == None:
+ # TODO: determine language from source_file and set it in
+ # lang
+ pass
+ if lang == "C":
+ return C_Compiler(self.config)
+ elif lang == "CPP":
+ return CPP_Compiler(self.config)
+ elif lang == "PY":
+ return Py_Compiler(self.config)
+ elif lang == "JAVA":
+ return Java_Compiler(self.config)
+
+
+class C_Compiler:
+ """
+ This is a language specific compiler class. It needs all the
+ methods needed below below.
+ """
+ def __init__(self, config):
+ self.config = config
+ self.compile_cmd =
config.config.get("CompileCommands", "C_compile")
+ self.exec_string = config.config.get("CompileCommands", "C_run")
+
+ def get_compile_cmd(self, source_path):
+ basename = os.path.join(self.config.abs_path, str(submission.pk))
+ return self.compile_cmd.replace("%s", basename
+ ".c").replace("%e", \
+ basename + ".exe")
+
+ def get_run_cmd(self, source_path):
+ basename = os.path.join(self.config.abs_path, str(submission.ph))
+ return self.exec_string.replace("%e", basename + ".exe")
=======================================
--- /dev/null
+++ /src/cc_backend/evaluator/eval.py Mon Nov 22 05:24:57 2010
@@ -0,0 +1,50 @@
+from os.path import splitext
+import os
+import subprocess
+import se.secexec
+class Evaluate:
+ def eval_submission(submission, test_grp, submission_exec):
+ """Takes submission and test_grp and returns result_set"""
+ tlimit = test_grp["timelimit"]
+ mlimit = test_grp["memlimit"]
+ maxfilesz = 32 #TODO: for now we fix it at 32M
+ jailroot = "jail" #FIXME: Need to lay down the exec env
+
+ #Assumption: each infile would be of the form submission_id.in
+ for infile in test_grp["input_files"]:
+ #First run submission_exec and then validate output
+ outfile = splitext(infile)[0] + ".out"
+ errfile = splitext(infile)[0] + ".err"
+ args = ["--infile=%s" % infile,
+ "--outfile=%s" % outfile,
+ "--errfile=%s" % errfile,
+ "--memlimit=%d" % mlimit,
+ "--timelimit=%d" % tlimit,
+ "--maxfilesz=%d" % maxfilesz,
+ "--executable=%s" % submission_exec,
+ "--euid=%d" % 1002, #TODO: someone needs
+ #to send the euid to use here
+ "--jailroot=%s" % jailroot]
+ args.insert(0, curdir + "/secexec")
+ ret_code = se.secexec.secure_spawn(args)
+ #End of executing the submission_exec
+ if test_grp["is_cust_scored"] == True:
+ #TODO: run cust_execute via secure_spawn
+ #with appropriate infile and outfile
+ pass
+ else:
+ #TODO: perform a diff
+ check = subprocess.Popen('diff -Bb ' + outfile + ' ' +
test_grp["input_file"], shell=True,
+ stdout=subprocess.PIPE)
+ diff_op = check.communicate()[0]
+ if diff_op == '':
+ #testcase passed
+ pass
+ else:
+ #testcase failed
+ pass
+
+
+ pass
+ pass
+ pass
=======================================
--- /dev/null
+++ /src/cc_backend/score/score.py Mon Nov 22 05:24:57 2010
@@ -0,0 +1,3 @@
+
+class Score:
+ pass
=======================================
--- /dev/null
+++ /src/cc_backend/se/build_secexec.sh Mon Nov 22 05:24:57 2010
@@ -0,0 +1,3 @@
+gcc -DDBG -DGETOPT -DJAIL -I. -o secexec secexec.c
+sudo chown root:root secexec
+sudo chmod u+s secexec
=======================================
--- /dev/null
+++ /src/cc_backend/se/secexec.c Mon Nov 22 05:24:57 2010
@@ -0,0 +1,177 @@
+#include <secexec.h>
+
+struct sigaction alarm_act;
+pid_t p;
+
+static void alarm_handler(int signo)
+{
+ /* its time to kill the child now! */
+ kill(p, SIGKILL);
+}
+
+int secure_spawn(ExecArgs ea) {
+ int ret;
+ char cur_dir[MAX_PATH_LEN], *new_dir = NULL;
+ char *targv[2] = {NULL, NULL}; /* dummy second arg for execvp */
+
+
+ p = fork();
+ if (!p) {
+ freopen(ea.infile, "r", stdin);
+ freopen(ea.outfile, "w", stdout);
+ freopen(ea.errfile, "w", stderr);
+
+ /* jailroot is expressed in absolute pathname terms.*/
+
+ chdir(ea.jailroot);
+ char *curdir = getcwd(NULL, 0);
+ ret = chroot(curdir);
+ free(curdir);
+#ifdef JAIL
+ FILE *fp = fopen("./chstuff", "a");
+ if(fp) {
+ fprintf(fp, "euid = %d ret = %d errno = %d\n", geteuid(), ret,
errno);
+ fclose(fp);
+ }
+#endif /* JAIL */
+
+ //drop priveleges
+ setuid(ea.euid);
+
+ struct rlimit lim ;
+ // set limit on number of forks possible.
+ lim.rlim_cur = lim.rlim_max = 0;
+ ret = setrlimit(RLIMIT_NPROC, &lim);
+
+ lim.rlim_cur = lim.rlim_max = ea.memlimit << 20;
+ ret = setrlimit(RLIMIT_AS, &lim);
+
+ lim.rlim_cur = ea.timelimit; lim.rlim_max = ea.timelimit + 1;
+ ret = setrlimit(RLIMIT_CPU, &lim);
+
+ lim.rlim_cur = lim.rlim_max = ea.maxfilesz << 20;
+ ret = setrlimit(RLIMIT_FSIZE, &lim);
+
+ targv[0] = ea.execname;
+ ret = execvp(ea.execname, targv);
+
+ //arbitrarily chosen to let parent know that execvp failed; we
+ //reach here only if execvp fails
+ return 111;
+ }
+
+ /* setting up an alarm for 'timelimit+2' seconds, since it includes CPU
and I/O time */
+ alarm_act.sa_handler = alarm_handler;
+ sigaction(SIGALRM, &alarm_act, NULL);
+ alarm(ea.timelimit+2);
+
+ int status;
+ struct rusage submission_stats;
+
+ int wait_ret = wait3(&status, 0, &submission_stats);
+#ifdef DBG
+ FILE *fp = fopen("/tmp/setuid-helper.debug", "a");
+ FILE *fs = fopen("/tmp/stats", "w");
+
+ if (WIFSIGNALED(status)) {
+ fprintf(fp, "submission %s signalled status = %d errno = %d\n",
ea.execname, WTERMSIG(status), errno);
+ return WTERMSIG(status);
+ }
+ if (WIFEXITED(status)) {
+ fprintf(fp, "child %s exited normally with status = %d errno
= %d\n", ea.execname, WEXITSTATUS(status), errno);
+ return WEXITSTATUS(status);
+ }
+ fprintf(fp, "child %s did not exit normally and did not get"
+ " signalled, exited with status = %d errno = %d\n", ea.execname,
status, errno);
+ fclose(fp);
+ fclose(fs);
+#endif /* DBG */
+ return status;
+}
+
+int main (int argc, char **argv) {
+ int c;
+ ExecArgs ea;
+
+ while (1) {
+ int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static struct option long_options[] = {
+ {"infile", required_argument, 0, 0},
+ {"outfile", required_argument, 0, 0},
+ {"errfile", required_argument, 0, 0},
+ {"jailroot", required_argument, 0, 0},
+ {"executable", required_argument, 0, 0},
+ {"euid", required_argument, 0, 0},
+ {"timelimit", required_argument, 0, 0},
+ {"memlimit", required_argument, 0, 0},
+ {"maxfilesz", required_argument, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "",
+ long_options, &option_index);
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 0:
+
+#ifdef GETOPT
+ printf ("option %s", long_options[option_index].name);
+ if (optarg)
+ printf (" with arg %s", optarg);
+ printf ("\n");
+#endif /*GETOPT*/
+
+ switch(option_index) {
+ case 0:
+ strcpy(ea.infile, optarg);
+ break;
+
+ case 1:
+ strcpy(ea.outfile, optarg);
+ break;
+
+ case 2:
+ strcpy(ea.errfile, optarg);
+ break;
+
+ case 3:
+ strcpy(ea.jailroot, optarg);
+ break;
+
+ case 4:
+ strcpy(ea.execname, optarg);
+ break;
+
+ case 5:
+ ea.euid = atoi(optarg);
+ break;
+
+ case 6:
+ ea.timelimit = atoi(optarg);
+ break;
+
+ case 7:
+ ea.memlimit = atoi(optarg);
+ break;
+
+ case 8:
+ ea.maxfilesz = atoi(optarg);
+ break;
+
+ default:
+ break;
+
+ }
+ break;
+
+ }
+ } /* option parsing ends */
+
+ int return_status = secure_spawn(ea);
+
+ return return_status;
+}
+
=======================================
--- /dev/null
+++ /src/cc_backend/se/secexec.h Mon Nov 22 05:24:57 2010
@@ -0,0 +1,30 @@
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <getopt.h>
+
+#define MAX_PATH_LEN 300
+#define MAX_ARGS 20
+
+struct _ExecArgs {
+ int timelimit, memlimit, maxfilesz,
+ euid;
+ char infile[MAX_PATH_LEN];
+ char outfile[MAX_PATH_LEN];
+ char errfile[MAX_PATH_LEN];
+ char jailroot[MAX_PATH_LEN];
+ char execname[MAX_PATH_LEN];
+};
+
+typedef struct _ExecArgs ExecArgs;
+
+int secure_spawn(ExecArgs ea);
=======================================
--- /dev/null
+++ /src/cc_backend/se/secexec.py Mon Nov 22 05:24:57 2010
@@ -0,0 +1,38 @@
+import subprocess
+from os.path import dirname, abspath
+
+def secure_spawn(args):
+ """
+ Takes a list of arguments where arg0 is secexec (setuid helper).
+ * execname is always relative to jailroot.
+ * jailroot is always expressd in absolute path terms.
+ Returns return code of execname that was run in jailroot
+ """
+
+ retcode = subprocess.Popen(args)
+ print retcode
+ return retcode
+
+
+if __name__ == "__main__":
+ infile, outfile, errfile = "in", "out", "err"
+ curdir = dirname(abspath(__file__))
+ jailroot = curdir + "/jail"
+ mlimit, tlimit, maxfilesz = 32, 2, 32
+ #execname should be relative to jailroot
+ execname = "./helloworld"
+ euid = 1002
+ print execname
+
+ args = ["--infile=%s" % infile,
+ "--outfile=%s" % outfile,
+ "--errfile=%s" % errfile,
+ "--memlimit=%d" % mlimit,
+ "--timelimit=%d" % tlimit,
+ "--maxfilesz=%d" % maxfilesz,
+ "--executable=%s" % execname,
+ "--euid=%d" % euid,
+ "--jailroot=%s" % jailroot]
+ args.insert(0, curdir + "/secexec")
+ print args
+ secure_spawn(args)
=======================================
--- /dev/null
+++ /src/cc_backend/store/default_store.py Mon Nov 22 05:24:57 2010
@@ -0,0 +1,32 @@
+from storage_interface import Store
+
+
+class Default(Store):
+
+ """
+ TODO: Implement the storage inferface for Django. See the API
+ specification in storage_interface.py for details about how to
+ implement the stubs below.
+ """
+
+ def __init__(self):
+ pass
+
+ def get_submission(self):
+ pass
+
+ def set_compile_status(self, status, err_msg=None, submission_id=None):
+ pass
+
+ def get_test_group(self, problem_id=None):
+ pass
+
+ def set_test_group_score(self, score, problem_id=None,
+ test_group_id=None, submission_id=None):
+ pass
+
+ def set_submission_run_status(self, status, submission_id=None):
+ pass
+
+ def set_submission_score(self, score, submission_id=None):
+ pass
=======================================
--- /dev/null
+++ /src/cc_backend/store/storage_interface.py Mon Nov 22 05:24:57 2010
@@ -0,0 +1,127 @@
+class Store:
+ """
+ This is the base class for the storage interface. The default
+ interface will be interface with Django's models. This module can
+ be derived and made to work any other kind of storage system too
+ like NOSQL, etc.
+
+ The requirements for the objects passed and returned by each
+ function are found in the function's comments below.
+
+ """
+
+ def __init__(self):
+ """
+ Initialize any storage connections here.
+ """
+ pass
+
+ def get_submission(self):
+ """
+ Fetches a submission from the store. If there is no queued
+ submission, it returns None immediately. If a queued
+ submission is found, it atomically sets the status of the
+ submission to "processing" in the persistent storage.
+
+ Arguments: None
+
+ Returns: None if no submission is queued at the
+ moment. Otherwise a dictionary with the following key/value
+ pairs:
+
+ {
+ "src_file" : "/path/to/source_file",
+ "prob_id" : "a string representing the id",
+ "id" : "string, id of submission"
+ }
+
+ """
+ pass
+
+ def set_compile_status(self, status, err_msg=None, sub_id=None):
+ """
+ Sets the compile status of submission to success/failure.
+
+ Arguments: status -> a string representing the status:
+ is either "SUCCESS" or "FAILURE"
+ err_msg -> a string representing the compiler
+ error message, if any; None otherwise
+ sub_id -> the string id of the submission
+
+ Returns: None
+ """
+ pass
+
+ def get_test_group(self, prob_id=None):
+ """
+ A test_group is a dictionary containing a list of input files
+ and corresponding ref_output objects. The output ref_output
+ objects are either reference output files or a binary program
+ that can check the output produced by the submission.
+
+ The returned dictionary also contains an attribute that
+ identifies the test_group id. This is used in the scoring
+ module to identify the scoring algorithm to use.
+
+ This function should be implemented as a python generator. The
+ Evaluation module calls this function repeatedly to get each
+ test_group successively.
+
+ Arguments: prob_id -> string id of the problem.
+
+ Returns: A testgroup object in each successive call until no
+ more remains. A testgroup object is a dictionary with the
+ following key/value pairs:
+
+ {
+ "prob_id" : "string problem id",
+
+ "testgroup_id" : "string id for testgroup",
+
+ "timelimit" : "time limit for a submisson for this testgroup",
+
+ "memlimit" : "memory limit for a submisson for this
testgroup",
+
+ "input_files" : [list of input file names] each of the form
+ submission_id.in and corresponding outfile
+ and errfile would be submission_id.{out,
err},
+
+ "output_files" : [list of corresponding reference output
+ file names] or None if a separate
+ program evaluates the outputs produced,
+
+ "cust_execute" : binary to execute as checker program
+ (TODO write details of semantics),
+
+ "score" : The int score if all cases in this testgroup
+ pass,
+
+ "is_cust_scored" : A flag, if True indicates that
+ cust_execute produces the score for
+ each input file (total score for group
+ is the sum)
+ }
+
+ """
+ pass
+
+ def set_testgroup_score(self, score, testgroup_id=None,
+ sub_id=None):
+ """
+ Sets the score for a submission for a testgroup
+ """
+ pass
+
+ def set_submission_run_status(self, status, sub_id=None):
+ """
+ After evaluation of test cases, this function sets the status
+ of the program to "ACCEPTED", "WRONG ANSWER" or some execution
+ error status.
+ """
+ pass
+
+ def set_submission_score(self, score, sub_id=None):
+ """
+ Sets the overall score for a submission.
+ """
+ pass
==============================================================================
Revision: 11732d6cec
Author: surenspost
Date: Mon Nov 22 05:26:29 2010
Log: We no longer need the old cc_backend directory.
http://code.google.com/p/codechecker/source/detail?r=11732d6cec
Deleted:
/cc_backend/AUTHORS
/cc_backend/README
/cc_backend/conf/codechecker.conf
/cc_backend/docs/README
/cc_backend/src/Checker.py
/cc_backend/src/Config.py
/cc_backend/src/__init__.py
/cc_backend/src/compiler/__init__.py
/cc_backend/src/compiler/compile.py
/cc_backend/src/evaluator/__init__.py
/cc_backend/src/evaluator/eval.py
/cc_backend/src/score/__init__.py
/cc_backend/src/score/score.py
/cc_backend/src/se/__init__.py
/cc_backend/src/se/build_secexec.sh
/cc_backend/src/se/secexec.c
/cc_backend/src/se/secexec.h
/cc_backend/src/se/secexec.py
/cc_backend/src/store/__init__.py
/cc_backend/src/store/default_store.py
/cc_backend/src/store/storage_interface.py
=======================================
--- /cc_backend/AUTHORS Thu Oct 14 07:15:47 2010
+++ /dev/null
@@ -1,3 +0,0 @@
-Surendran M <suren...@gmail.com>
-Krishnan Parthasarathi <krishnan.pa...@gmail.com>
-Aditya Manthramurthy <adity...@gmail.com>
=======================================
--- /cc_backend/README Thu Oct 14 07:15:47 2010
+++ /dev/null
@@ -1,3 +0,0 @@
-This is the codechecker backend folder.
-
-Please see docs/README to learn more about the codechecker design.
=======================================
--- /cc_backend/conf/codechecker.conf Wed Oct 20 05:56:33 2010
+++ /dev/null
@@ -1,40 +0,0 @@
-[BackendMain]
-# Specify the root directory of the Codechecker installation below. It
-# should be an absolute address.
-CheckerRoot=/opt/checker/
-
-#Jail Root director
-JailRoot=/jail/
-
-# Specify the directory in which the codechecker runs all
-# submissions. The input/output/err files, the source file, the
-# executable, and the reference output file are all placed here. It
-# must be an address within the Jail.
-RunsPath=var/run/codechecker/submissions/
-
-# Specify the maximum allowable output file size in MBs. This limits the
-# output file size of any of your submission programs.
-OutputFileSizeLimit=64
-
-#Specify the file where all log messages need to be written to
-LogFile=/tmp/nohup.out
-
-[CompileCommands]
-# Specify the language to be supported and the corresponding compilation
command.
-# Format:
-# %s - src file
-# %e - exec file
-C_compile=gcc -lm -Wall -O2 %s -o %e
-C_run=%e
-CPP_compile=g++ -Wall -O2 %s -o %e
-CPP_run=%e
-Py_compile=py_compilefiles %s
-Py_run=python %s
-Pascal_compile=gpc %s -o %e
-Pascal_run=%e
-Java_compile=gcj -C %s
-Java_run=gij -Xmx%l -cp %p %c
-
-[RuntimeLimits]
-# Maximum size of Heap Memory in MB
-HeapSize=256
=======================================
--- /cc_backend/docs/README Thu Oct 14 07:15:47 2010
+++ /dev/null
@@ -1,38 +0,0 @@
-This document explains how the codechecker works.
-
-The codechecker start executing from Main.py. This Main program simply
-waits for a submission with status = "queued" to appear. When this
-happens, it picks up the submission, changes it to status =
-"processing" (atomically - many other codechecker threads can be
-running) and starts processing it.
-
-Some terminology about test cases:
-
-1) Testcase - a testcase is an input file for a single run of a
-submission.
-
-2) Test_group - a collection of one or more testcases that are scored
-together, associated with a score. Eg: If a program passes all
-testcases in a test_group it can get the points for that
-test_group. If it does not pass all testcases, the submission could
-get no points.
-
-3) Result checker - a program submitted by a problem setter that is
-used to check the result of a testcase run by a custom algorithm. This
-program is required only for problems that need a custom result
-verification algorithm. If the result for a testcase is unique, it is
-sufficient to use a reference output file and see that the testcase
-run produces the same output file.
-
-Processing consists of first compiling the submission, and generating
-an executable. Once this is done, the Evaluation module
-begins. Evaluation consists of testing the submission against a set of
-test_groups. Each test_group is fetched in order and the testing for
-the testcases in that test group begins. The submission is executed
-against each testcase by the Secure Execution module (SE). The
-Evaluation module also checks the result of each testcase run with
-either a reference output file for that testcase or a Result_checker
-program. The Result_checker also runs in the SE module.
-
-
-
=======================================
--- /cc_backend/src/Checker.py Wed Nov 10 12:07:38 2010
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin
-import sys
-import os
-import string
-import time
-import threading
-
-from store.default_store import Default
-from evaluator.eval import Evaluate
-from compiler.compile import Compiler
-from score.score import Score
-from Config import Config
-
-
-def main():
-
- config = Config("conf/codechecker.conf")
- store = Default()
- evaluator = Evaluate()
- compiler = Compiler(config)
- score = Score()
-
- is_waiting = True
-
- while True:
- # get a queued submission.
- submission = store.get_submission()
-
- # if no submission is found wait for one.
- if submission is None:
- if not is_waiting:
- is_waiting = True
- print "Waiting for a submission."
- time.sleep(2)
- continue
-
- is_waiting = False
-
- # compile the submission
- compiler_res = compiler.compile_source(submission["src_file"])
- if compiler_res["retcode"] == 0:
- store.set_compile_status("COMPILED", err_msg=None,
- sub_id=submission["id"])
- else:
- store.set_compile_status("COMPILATION ERROR",
- err_msg=status_info.err_msg,
- sub_id=submission["id"])
- continue
-
- # Evaluate the queued submission. Somewhere in the following
- # loop it is also possible that the program fails - need to
- # set the status to runtime error status.
- test_group_scores = []
- for test_grp in store.get_test_group(submission["prob_id"]):
- result_set = evaluator.eval_submission(submission,
- test_grp,
compiler_res["run_cmd"])
- test_grp_score = score.score_group(prob_id,
- result_set)
- store.set_test_group_score(test_grp_score,
- problem_id=prob_id, test_group_id=test_grp["id"],
- submission_id=submission["id"])
- test_group_scores.append(test_grp_score)
-
- # compute and set the overall score.
- final_score = score.overall(test_group_scores,
- problem_id=prob_id)
- store.set_submission_score(final_score,
- submission_id=submission["id"])
- store.set_submission_run_status("PASS",
- submission_id=submission["id"])
-
-
-if __name__ == '__main__':
- main()
=======================================
--- /cc_backend/src/Config.py Wed Oct 20 05:58:54 2010
+++ /dev/null
@@ -1,27 +0,0 @@
-import ConfigParser
-import os
-
-class Config:
-
- def __init__(self, configFilePath):
- self.config = ConfigParser.ConfigParser()
- self.config.read(configFilePath)
- self.jail_root = self.config.get("BackendMain","JailRoot")
- runs_path = self.config.get("BackendMain", "RunsPath")
- self.runpath = os.path.join('/' , runs_path)
- self.abs_path = os.path.join(self.jail_root, runs_path)
- self.outputLimit =
int(self.config.get("BackendMain","OutputFileSizeLimit"))
- self.heapsize = self.config.get("RuntimeLimits", "HeapSize")
-
- # Check if setuid_helper exists.
- self.shPath = self.config.get("BackendMain", "CheckerRoot")
+ "codechecker/backend/setuid_helper"
- assert os.path.isfile(self.shPath) and os.access(self.shPath,
os.X_OK)
-
-
-if __name__ == "__main__":
-
- config = Config("conf/codechecker.conf")
- print config.config.sections()
- print config.config.get("CompileCommands", "C_compile")
-
-
=======================================
--- /cc_backend/src/compiler/compile.py Mon Oct 25 08:30:59 2010
+++ /dev/null
@@ -1,56 +0,0 @@
-import subprocess
-import os.path
-
-
-class Compiler:
- def __init__(self, config):
- self.config = config
-
- def compile_source(self, source_filepath, lang=None):
- compiler = self.get_compiler(source_filepath, lang)
- compiler.get_compile_cmd(source_filepath)
- print compile_cmd
- child = subprocess.Popen(compile_cmd, stdout=subprocess.PIPE,
- stderr=subprocess.PIPE, shell=True)
- out, err = child.communicate()
- retDict = {}
- retDict["retcode"] = child.returncode
- retDict["compiler_output"] = out + err
- retDict["run_cmd"] = compiler.get_run_cmd(source_filepath)
- return retDict
-
- # determines the language from the extension or from the lang
- # argument if one is supplied.
- def get_compiler(self, source_filepath, lang=None):
- if lang == None:
- # TODO: determine language from source_file and set it in
- # lang
- pass
- if lang == "C":
- return C_Compiler(self.config)
- elif lang == "CPP":
- return CPP_Compiler(self.config)
- elif lang == "PY":
- return Py_Compiler(self.config)
- elif lang == "JAVA":
- return Java_Compiler(self.config)
-
-
-class C_Compiler:
- """
- This is a language specific compiler class. It needs all the
- methods needed below below.
- """
- def __init__(self, config):
- self.config = config
- self.compile_cmd =
config.config.get("CompileCommands", "C_compile")
- self.exec_string = config.config.get("CompileCommands", "C_run")
-
- def get_compile_cmd(self, source_path):
- basename = os.path.join(self.config.abs_path, str(submission.pk))
- return self.compile_cmd.replace("%s", basename
+ ".c").replace("%e", \
- basename + ".exe")
-
- def get_run_cmd(self, source_path):
- basename = os.path.join(self.config.abs_path, str(submission.ph))
- return self.exec_string.replace("%e", basename + ".exe")
=======================================
--- /cc_backend/src/evaluator/eval.py Thu Nov 11 10:55:28 2010
+++ /dev/null
@@ -1,50 +0,0 @@
-from os.path import splitext
-import os
-import subprocess
-import se.secexec
-class Evaluate:
- def eval_submission(submission, test_grp, submission_exec):
- """Takes submission and test_grp and returns result_set"""
- tlimit = test_grp["timelimit"]
- mlimit = test_grp["memlimit"]
- maxfilesz = 32 #TODO: for now we fix it at 32M
- jailroot = "jail" #FIXME: Need to lay down the exec env
-
- #Assumption: each infile would be of the form submission_id.in
- for infile in test_grp["input_files"]:
- #First run submission_exec and then validate output
- outfile = splitext(infile)[0] + ".out"
- errfile = splitext(infile)[0] + ".err"
- args = ["--infile=%s" % infile,
- "--outfile=%s" % outfile,
- "--errfile=%s" % errfile,
- "--memlimit=%d" % mlimit,
- "--timelimit=%d" % tlimit,
- "--maxfilesz=%d" % maxfilesz,
- "--executable=%s" % submission_exec,
- "--euid=%d" % 1002, #TODO: someone needs
- #to send the euid to use here
- "--jailroot=%s" % jailroot]
- args.insert(0, curdir + "/secexec")
- ret_code = se.secexec.secure_spawn(args)
- #End of executing the submission_exec
- if test_grp["is_cust_scored"] == True:
- #TODO: run cust_execute via secure_spawn
- #with appropriate infile and outfile
- pass
- else:
- #TODO: perform a diff
- check = subprocess.Popen('diff -Bb ' + outfile + ' ' +
test_grp["input_file"], shell=True,
- stdout=subprocess.PIPE)
- diff_op = check.communicate()[0]
- if diff_op == '':
- #testcase passed
- pass
- else:
- #testcase failed
- pass
-
-
- pass
- pass
- pass
=======================================
--- /cc_backend/src/score/score.py Thu Oct 14 07:15:47 2010
+++ /dev/null
@@ -1,3 +0,0 @@
-
-class Score:
- pass
=======================================
--- /cc_backend/src/se/build_secexec.sh Thu Oct 28 13:11:00 2010
+++ /dev/null
@@ -1,3 +0,0 @@
-gcc -DDBG -DGETOPT -DJAIL -I. -o secexec secexec.c
-sudo chown root:root secexec
-sudo chmod u+s secexec
=======================================
--- /cc_backend/src/se/secexec.c Tue Nov 2 11:49:00 2010
+++ /dev/null
@@ -1,177 +0,0 @@
-#include <secexec.h>
-
-struct sigaction alarm_act;
-pid_t p;
-
-static void alarm_handler(int signo)
-{
- /* its time to kill the child now! */
- kill(p, SIGKILL);
-}
-
-int secure_spawn(ExecArgs ea) {
- int ret;
- char cur_dir[MAX_PATH_LEN], *new_dir = NULL;
- char *targv[2] = {NULL, NULL}; /* dummy second arg for execvp */
-
-
- p = fork();
- if (!p) {
- freopen(ea.infile, "r", stdin);
- freopen(ea.outfile, "w", stdout);
- freopen(ea.errfile, "w", stderr);
-
- /* jailroot is expressed in absolute pathname terms.*/
-
- chdir(ea.jailroot);
- char *curdir = getcwd(NULL, 0);
- ret = chroot(curdir);
- free(curdir);
-#ifdef JAIL
- FILE *fp = fopen("./chstuff", "a");
- if(fp) {
- fprintf(fp, "euid = %d ret = %d errno = %d\n", geteuid(), ret,
errno);
- fclose(fp);
- }
-#endif /* JAIL */
-
- //drop priveleges
- setuid(ea.euid);
-
- struct rlimit lim ;
- // set limit on number of forks possible.
- lim.rlim_cur = lim.rlim_max = 0;
- ret = setrlimit(RLIMIT_NPROC, &lim);
-
- lim.rlim_cur = lim.rlim_max = ea.memlimit << 20;
- ret = setrlimit(RLIMIT_AS, &lim);
-
- lim.rlim_cur = ea.timelimit; lim.rlim_max = ea.timelimit + 1;
- ret = setrlimit(RLIMIT_CPU, &lim);
-
- lim.rlim_cur = lim.rlim_max = ea.maxfilesz << 20;
- ret = setrlimit(RLIMIT_FSIZE, &lim);
-
- targv[0] = ea.execname;
- ret = execvp(ea.execname, targv);
-
- //arbitrarily chosen to let parent know that execvp failed; we
- //reach here only if execvp fails
- return 111;
- }
-
- /* setting up an alarm for 'timelimit+2' seconds, since it includes CPU
and I/O time */
- alarm_act.sa_handler = alarm_handler;
- sigaction(SIGALRM, &alarm_act, NULL);
- alarm(ea.timelimit+2);
-
- int status;
- struct rusage submission_stats;
-
- int wait_ret = wait3(&status, 0, &submission_stats);
-#ifdef DBG
- FILE *fp = fopen("/tmp/setuid-helper.debug", "a");
- FILE *fs = fopen("/tmp/stats", "w");
-
- if (WIFSIGNALED(status)) {
- fprintf(fp, "submission %s signalled status = %d errno = %d\n",
ea.execname, WTERMSIG(status), errno);
- return WTERMSIG(status);
- }
- if (WIFEXITED(status)) {
- fprintf(fp, "child %s exited normally with status = %d errno
= %d\n", ea.execname, WEXITSTATUS(status), errno);
- return WEXITSTATUS(status);
- }
- fprintf(fp, "child %s did not exit normally and did not get"
- " signalled, exited with status = %d errno = %d\n", ea.execname,
status, errno);
- fclose(fp);
- fclose(fs);
-#endif /* DBG */
- return status;
-}
-
-int main (int argc, char **argv) {
- int c;
- ExecArgs ea;
-
- while (1) {
- int this_option_optind = optind ? optind : 1;
- int option_index = 0;
- static struct option long_options[] = {
- {"infile", required_argument, 0, 0},
- {"outfile", required_argument, 0, 0},
- {"errfile", required_argument, 0, 0},
- {"jailroot", required_argument, 0, 0},
- {"executable", required_argument, 0, 0},
- {"euid", required_argument, 0, 0},
- {"timelimit", required_argument, 0, 0},
- {"memlimit", required_argument, 0, 0},
- {"maxfilesz", required_argument, 0, 0},
- {0, 0, 0, 0}
- };
-
- c = getopt_long (argc, argv, "",
- long_options, &option_index);
- if (c == -1)
- break;
-
- switch (c) {
- case 0:
-
-#ifdef GETOPT
- printf ("option %s", long_options[option_index].name);
- if (optarg)
- printf (" with arg %s", optarg);
- printf ("\n");
-#endif /*GETOPT*/
-
- switch(option_index) {
- case 0:
- strcpy(ea.infile, optarg);
- break;
-
- case 1:
- strcpy(ea.outfile, optarg);
- break;
-
- case 2:
- strcpy(ea.errfile, optarg);
- break;
-
- case 3:
- strcpy(ea.jailroot, optarg);
- break;
-
- case 4:
- strcpy(ea.execname, optarg);
- break;
-
- case 5:
- ea.euid = atoi(optarg);
- break;
-
- case 6:
- ea.timelimit = atoi(optarg);
- break;
-
- case 7:
- ea.memlimit = atoi(optarg);
- break;
-
- case 8:
- ea.maxfilesz = atoi(optarg);
- break;
-
- default:
- break;
-
- }
- break;
-
- }
- } /* option parsing ends */
-
- int return_status = secure_spawn(ea);
-
- return return_status;
-}
-
=======================================
--- /cc_backend/src/se/secexec.h Tue Nov 2 11:49:00 2010
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/resource.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <string.h>
-#include <getopt.h>
-
-#define MAX_PATH_LEN 300
-#define MAX_ARGS 20
-
-struct _ExecArgs {
- int timelimit, memlimit, maxfilesz,
- euid;
- char infile[MAX_PATH_LEN];
- char outfile[MAX_PATH_LEN];
- char errfile[MAX_PATH_LEN];
- char jailroot[MAX_PATH_LEN];
- char execname[MAX_PATH_LEN];
-};
-
-typedef struct _ExecArgs ExecArgs;
-
-int secure_spawn(ExecArgs ea);
=======================================
--- /cc_backend/src/se/secexec.py Tue Nov 2 11:49:00 2010
+++ /dev/null
@@ -1,38 +0,0 @@
-import subprocess
-from os.path import dirname, abspath
-
-def secure_spawn(args):
- """
- Takes a list of arguments where arg0 is secexec (setuid helper).
- * execname is always relative to jailroot.
- * jailroot is always expressd in absolute path terms.
- Returns return code of execname that was run in jailroot
- """
-
- retcode = subprocess.Popen(args)
- print retcode
- return retcode
-
-
-if __name__ == "__main__":
- infile, outfile, errfile = "in", "out", "err"
- curdir = dirname(abspath(__file__))
- jailroot = curdir + "/jail"
- mlimit, tlimit, maxfilesz = 32, 2, 32
- #execname should be relative to jailroot
- execname = "./helloworld"
- euid = 1002
- print execname
-
- args = ["--infile=%s" % infile,
- "--outfile=%s" % outfile,
- "--errfile=%s" % errfile,
- "--memlimit=%d" % mlimit,
- "--timelimit=%d" % tlimit,
- "--maxfilesz=%d" % maxfilesz,
- "--executable=%s" % execname,
- "--euid=%d" % euid,
- "--jailroot=%s" % jailroot]
- args.insert(0, curdir + "/secexec")
- print args
- secure_spawn(args)
=======================================
--- /cc_backend/src/store/default_store.py Wed Oct 20 06:55:23 2010
+++ /dev/null
@@ -1,32 +0,0 @@
-from storage_interface import Store
-
-
-class Default(Store):
-
- """
- TODO: Implement the storage inferface for Django. See the API
- specification in storage_interface.py for details about how to
- implement the stubs below.
- """
-
- def __init__(self):
- pass
-
- def get_submission(self):
- pass
-
- def set_compile_status(self, status, err_msg=None, submission_id=None):
- pass
-
- def get_test_group(self, problem_id=None):
- pass
-
- def set_test_group_score(self, score, problem_id=None,
- test_group_id=None, submission_id=None):
- pass
-
- def set_submission_run_status(self, status, submission_id=None):
- pass
-
- def set_submission_score(self, score, submission_id=None):
- pass
=======================================
--- /cc_backend/src/store/storage_interface.py Mon Nov 15 11:59:00 2010
+++ /dev/null
@@ -1,127 +0,0 @@
-class Store:
- """
- This is the base class for the storage interface. The default
- interface will be interface with Django's models. This module can
- be derived and made to work any other kind of storage system too
- like NOSQL, etc.
-
- The requirements for the objects passed and returned by each
- function are found in the function's comments below.
-
- """
-
- def __init__(self):
- """
- Initialize any storage connections here.
- """
- pass
-
- def get_submission(self):
- """
- Fetches a submission from the store. If there is no queued
- submission, it returns None immediately. If a queued
- submission is found, it atomically sets the status of the
- submission to "processing" in the persistent storage.
-
- Arguments: None
-
- Returns: None if no submission is queued at the
- moment. Otherwise a dictionary with the following key/value
- pairs:
-
- {
- "src_file" : "/path/to/source_file",
- "prob_id" : "a string representing the id",
- "id" : "string, id of submission"
- }
-
- """
- pass
-
- def set_compile_status(self, status, err_msg=None, sub_id=None):
- """
- Sets the compile status of submission to success/failure.
-
- Arguments: status -> a string representing the status:
- is either "SUCCESS" or "FAILURE"
- err_msg -> a string representing the compiler
- error message, if any; None otherwise
- sub_id -> the string id of the submission
-
- Returns: None
- """
- pass
-
- def get_test_group(self, prob_id=None):
- """
- A test_group is a dictionary containing a list of input files
- and corresponding ref_output objects. The output ref_output
- objects are either reference output files or a binary program
- that can check the output produced by the submission.
-
- The returned dictionary also contains an attribute that
- identifies the test_group id. This is used in the scoring
- module to identify the scoring algorithm to use.
-
- This function should be implemented as a python generator. The
- Evaluation module calls this function repeatedly to get each
- test_group successively.
-
- Arguments: prob_id -> string id of the problem.
-
- Returns: A testgroup object in each successive call until no
- more remains. A testgroup object is a dictionary with the
- following key/value pairs:
-
- {
- "prob_id" : "string problem id",
-
- "testgroup_id" : "string id for testgroup",
-
- "timelimit" : "time limit for a submisson for this testgroup",
-
- "memlimit" : "memory limit for a submisson for this
testgroup",
-
- "input_files" : [list of input file names] each of the form
- submission_id.in and corresponding outfile
- and errfile would be submission_id.{out,
err},
-
- "output_files" : [list of corresponding reference output
- file names] or None if a separate
- program evaluates the outputs produced,
-
- "cust_execute" : binary to execute as checker program
- (TODO write details of semantics),
-
- "score" : The int score if all cases in this testgroup
- pass,
-
- "is_cust_scored" : A flag, if True indicates that
- cust_execute produces the score for
- each input file (total score for group
- is the sum)
- }
-
- """
- pass
-
- def set_testgroup_score(self, score, testgroup_id=None,
- sub_id=None):
- """
- Sets the score for a submission for a testgroup
- """
- pass
-
- def set_submission_run_status(self, status, sub_id=None):
- """
- After evaluation of test cases, this function sets the status
- of the program to "ACCEPTED", "WRONG ANSWER" or some execution
- error status.
- """
- pass
-
- def set_submission_score(self, score, sub_id=None):
- """
- Sets the overall score for a submission.
- """
- pass
==============================================================================
Revision: 805593ec70
Author: surenspost
Date: Mon Nov 22 05:28:30 2010
Log: Create cc_frontend module within src. Create views, forms, models.py
and such from legacy codechecker directory
http://code.google.com/p/codechecker/source/detail?r=805593ec70
Added:
/src/cc_frontend/__init__.py
/src/cc_frontend/forms/__init__.py
/src/cc_frontend/manage.py
/src/cc_frontend/models.py
/src/cc_frontend/root_url.py
/src/cc_frontend/settings.py.sample
/src/cc_frontend/templates/about.html
/src/cc_frontend/templates/accounts/login.html
/src/cc_frontend/templates/accounts/password_change_done.html
/src/cc_frontend/templates/accounts/password_change_form.html
/src/cc_frontend/templates/accounts/pchange.html
/src/cc_frontend/templates/accounts/register.html
/src/cc_frontend/templates/admin/404.html
/src/cc_frontend/templates/admin/500.html
/src/cc_frontend/templates/admin/actions.html
/src/cc_frontend/templates/admin/app_index.html
/src/cc_frontend/templates/admin/auth/user/add_form.html
/src/cc_frontend/templates/admin/auth/user/change_password.html
/src/cc_frontend/templates/admin/base.html
/src/cc_frontend/templates/admin/base_site.html
/src/cc_frontend/templates/admin/change_form.html
/src/cc_frontend/templates/admin/change_list.html
/src/cc_frontend/templates/admin/change_list_results.html
/src/cc_frontend/templates/admin/date_hierarchy.html
/src/cc_frontend/templates/admin/delete_confirmation.html
/src/cc_frontend/templates/admin/delete_selected_confirmation.html
/src/cc_frontend/templates/admin/edit_inline/stacked.html
/src/cc_frontend/templates/admin/edit_inline/tabular.html
/src/cc_frontend/templates/admin/filter.html
/src/cc_frontend/templates/admin/includes/fieldset.html
/src/cc_frontend/templates/admin/index.html
/src/cc_frontend/templates/admin/invalid_setup.html
/src/cc_frontend/templates/admin/login.html
/src/cc_frontend/templates/admin/object_history.html
/src/cc_frontend/templates/admin/pagination.html
/src/cc_frontend/templates/admin/prepopulated_fields_js.html
/src/cc_frontend/templates/admin/search_form.html
/src/cc_frontend/templates/admin/submit_line.html
/src/cc_frontend/templates/admin/template_validator.html
/src/cc_frontend/templates/base.html
/src/cc_frontend/templates/contest.html
/src/cc_frontend/templates/problem.html
/src/cc_frontend/templates/references.html
/src/cc_frontend/templates/registration/logged_out.html
/src/cc_frontend/templates/registration/password_change_done.html
/src/cc_frontend/templates/registration/password_change_form.html
/src/cc_frontend/templates/registration/password_reset_complete.html
/src/cc_frontend/templates/registration/password_reset_confirm.html
/src/cc_frontend/templates/registration/password_reset_done.html
/src/cc_frontend/templates/registration/password_reset_email.html
/src/cc_frontend/templates/registration/password_reset_form.html
/src/cc_frontend/templates/table.html
/src/cc_frontend/urls.py
/src/cc_frontend/views.py
/src/cc_frontend/views/__init__.py
=======================================
--- /dev/null
+++ /src/cc_frontend/manage.py Mon Nov 22 05:28:30 2010
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+from django.core.management import execute_manager
+try:
+ import settings # Assumed to be in the same directory.
+except ImportError:
+ import sys
+ sys.stderr.write("Error: Can't find the file 'settings.py' in the
directory containing %r. It appears you've customized things.\nYou'll have
to run django-admin.py, passing it your settings module.\n(If the file
settings.py does indeed exist, it's causing an ImportError somehow.)\n" %
__file__)
+ sys.exit(1)
+
+if __name__ == "__main__":
+ execute_manager(settings)
=======================================
--- /dev/null
+++ /src/cc_frontend/models.py Mon Nov 22 05:28:30 2010
@@ -0,0 +1,154 @@
+from django.contrib import admin
+from django.db import models
+from django.contrib.auth.models import User
+from django import forms
+
+# Current Language types that are supported
+LANG_TYPES = (
+ ('c','C'),
+ ('cpp','C++'),
+ ('py','PYTHON 2.6.4'),
+ #(3,'JAVA'),
+)
+
+# Submission Statuses
+RESULT_TYPES = (
+ ('QU', 'QUEUED'),
+ ('CMP', 'COMPILING'),
+ ('CMPE', 'COMPILATION FAILURE'),
+ ('RUN', 'RUNNING'),
+ ('ACC', 'ACCEPTED'),
+ ('WA', 'WRONG ANSWER'),
+ ('TLE', 'TIME LIMIT EXCEEDED'),
+ ('OUTE', 'OUTPUT LIMIT EXCEEDED'),
+ ('SEG', 'SEGMENTATION FAULT'),
+ ('FPE', 'FLOATING POINT ERROR'),
+ ('KILL', 'KILLED'),
+ ('ABRT', 'ABORT SIGNALLED'),
+ ('RTE', 'RUN TIME ERROR'),
+ ('WTF', 'NON ZERO RETURN STATUS'),
+)
+
+# The site is organized as contests, this is a basic contest model
+# Contest has a title, a general description startTime and endTime.
+# Also if it will be publicly viewable by non admins if public is True.
+
+class Contest(models.Model):
+ title = models.CharField(max_length = 25)
+ description = models.TextField()
+ startTime = models.DateTimeField()
+ endTime = models.DateTimeField()
+ public = models.BooleanField(default = False)
+
+ def __unicode__(self):
+ return self.title
+
+# Each Contest has one or more problems. Orphan or non contest problem are
added
+# to a global contest. Each problem has a problem code, statement,
constraint
+# notes, sample input and output, time limit, memory limit, maximum score
for
+# that problem, allowed Languages for submission to that problem and a
penalty
+# for a wrong submission.
+
+class Problem(models.Model):
+
+ #Problem related metadata fields follow
+ contest = models.ForeignKey(Contest, verbose_name = 'Contest')
+ pcode = models.CharField(max_length = 25, verbose_name = 'Problem
Code')
+ penalty = models.IntegerField(verbose_name = 'Penalty')
+ is_approximate = models.BooleanField(default = False,
+ verbose_name = 'Is Approximate')
+ cust_eval = models.FileField(upload_to = "setter-bin/", blank = True,
+ default = None, verbose_name = 'Custom Evaluation executable')
+ cust_minScore = models.IntegerField(default = 0, verbose_name = "Min
Score")
+ cust_maxScore = models.IntegerField(default = 100, verbose_name = "Max
Score")
+
+ #Fields related to the display of the problem statement follow:
+ statement = models.TextField()
+ constraints = models.TextField() # Info about input constraints.
+ sampleInput = models.TextField(verbose_name = "Sample Input")
+ sampleOutput = models.TextField(verbose_name = "Sample Output")
+ scoring_info = models.TextField(verbose_name = "Scoring Information")
# Info
+ # about how the problem will be
scored.
+ tlimit = models.IntegerField(verbose_name = "Time Limit") # (in
seconds)
+ mlimit = models.IntegerField(verbose_name = "Memory Limit") # (in MiB)
+ allowedLangs = models.CommaSeparatedIntegerField(max_length=10,
+ verbose_name = "Allowed Languages")
+ source_limit = models.IntegerField(default=50,
+ verbose_name = "Max Source File Size") # The max source file size
allowed
+ # for the problem (in KiB).
+
+ def __unicode__(self):
+ return self.pcode
+
+# Each problem has several TestSet. A Test set is a set of tests a
submission
+# for that problem has to pass to get some score assigned to that TestSet.
+# Testset belongs to a problem and has a maximum score.
+
+class TestSet(models.Model):
+ problem = models.ForeignKey(Problem)
+ maxScore = models.IntegerField()
+
+ def __unicode__(self):
+ return str(self.problem) + '-' + str(self.maxScore)
+
+# Each TestSet has Testcases, which is an atomic test for a submission. It
has
+# an input and an corresponding Judge output to that.
+
+class Testcase(models.Model):
+ testSet = models.ForeignKey(TestSet)
+ input = models.TextField()
+ output = models.TextField()
+
+ def __unicode__(self):
+ return str(self.testSet)
+
+# Users can submit their solution to a problem. A submission has a result,
time
+# of submission, penalty for that submission, score for the submission,
+# submitted code and any error message that were generated for the
submission
+# during the evaluation of the submission
+class Submission(models.Model):
+ user = models.ForeignKey(User)
+ problem = models.ForeignKey(Problem)
+ result = models.CharField(max_length=4, choices=RESULT_TYPES,
default="QU")
+ time = models.DateTimeField()
+ language = models.CharField(max_length=10, choices=LANG_TYPES)
+ penalty = models.IntegerField(default=0)
+ score = models.IntegerField(default=0)
+ code = models.TextField()
+ errors = models.TextField()
+
+ def __unicode__(self):
+ return repr(self.pk)
+
+# This table logs the result of the evaluation of a submission against
+# a testcase. It is to be used in the scoring module for a submission
+# to aggregate the results of each testcase.
+class TestcaseEval(models.Model):
+ submission = models.ForeignKey(Submission)
+ testcase = models.ForeignKey(Testcase)
+ # memusage is in kilobytes
+ mem_usage = models.IntegerField(default=0)
+ # cputime is the total time in seconds (float - microsecond
+ # precision).
+ cpu_time = models.FloatField(default=0)
+ # submission score for this (submission,testcase) pair
+ score = models.IntegerField(default=0)
+ # pass/fail status
+ pass_status = models.CharField(max_length=10)
+ # submission misc info
+ misc_info = models.TextField()
+
+
+# This table logs the result of each testset.
+class TestSetEval(models.Model):
+ submission = models.ForeignKey(Submission)
+ testset = models.ForeignKey(TestSet)
+ score = models.IntegerField(default=0)
+ # TODO: some measure of aggregate CPU time for this testset
+ cpu_time = models.FloatField(default=0)
+ # TODO: some measure of aggregate memory usage for this testset
+ mem_usage = models.IntegerField(default=0)
+ # pass/fail status
+ pass_status = models.CharField(max_length=10)
+ # submission misc info
+ misc_info = models.TextField()
=======================================
--- /dev/null
+++ /src/cc_frontend/root_url.py Mon Nov 22 05:28:30 2010
@@ -0,0 +1,11 @@
+from django.conf.urls.defaults import patterns,include
+
+import settings
+
+# Remove the forward slashes !
+location_root_url = settings.BASE_URL[1:]
+
+urlpatterns = patterns('',
+ # Put the root url conf string here.
+ (r"%s" % location_root_url, include('codechecker.urls')),
+)
=======================================
--- /dev/null
+++ /src/cc_frontend/settings.py.sample Mon Nov 22 05:28:30 2010
@@ -0,0 +1,49 @@
+#Django Specific config
+TIME_ZONE = 'Asia/Kolkata'
+SITE_ID = 1
+TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.load_template_source',
+ 'django.template.loaders.app_directories.load_template_source',
+ )
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+)
+
+#Database connectivity
+#### EDIT THIS SECTION WITH YOUR DATABASE DETAILS ####
+DATABASE_ENGINE = 'mysql'
+DATABASE_NAME = ''
+DATABASE_USER = ''
+DATABASE_PASSWORD = ''
+###########################
+
+
+
+# codechecker based django config
+ROOT_URLCONF = 'codechecker.root_url'
+TEMPLATE_DIRS = (
+ '/opt/checker/templates',
+ )
+MEDIA_ROOT = '/opt/checker/media/'
+MEDIA_URL = '/media/'
+ADMIN_MEDIA_PREFIX = '/media/'
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+ 'django.contrib.admin',
+ 'codechecker.contests',
+ )
+
+# codechecker based custom config
+BASE_URL = '/site/'
+SERVERNAME = 'checker.example.com'
+
+# Debug
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/about.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,24 @@
+{% extends 'base.html' %}
+
+{% block header %}
+ <h3> About </h3>
+{% endblock %}
+{% block main_content %}
+
+ <p>
+ <a href="http://code.google.com/p/codechecker/">Codechecker</a>
+ is a Free and Open Source Online Programming Contest Judge
+ developed by <a href="http://suren.in">M
+ Surendran</a>, <a
href="http://www.google.com/profiles/112148397913728069336">Aditya
+ Manthramurthy</a> and <a
href="http://www.google.com/profiles/112622614976789698636">Krishnan
Parthasarathi</a>.
+ </p>
+ <p>
+ Want to conduct a similar contest in your college? <br>
+ Want to contribute to this FOSS project? <br>
+ Visit the project
+ page <a
href="http://code.google.com/p/codechecker">http://code.google.com/p/codechecker</a>
+ and get in touch with the developers!
+ </p>
+
+{% endblock %}
+
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/accounts/login.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,27 @@
+{% extends 'base.html' %}
+
+{% block main_content %}
+
+<h4> Please Login before you proceed! </h4>
+{% if form.errors %}
+<p>Your username and password didn't match. Please try again.</p>
+{% endif %}
+
+<form method="post" action="/site/login/">
+ <table>
+ <tr>
+ <td>{{ form.username.label_tag }}</td>
+ <td>{{ form.username }}</td>
+ </tr>
+ <tr>
+ <td>{{ form.password.label_tag }}</td>
+ <td>{{ form.password }}</td>
+ </tr>
+ </table>
+
+ <input type="submit" value="login" />
+ <input type="hidden" name="next" value="{{ next }}" />
+</form>
+
+<a href="/site/register/"> Register </a>
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/accounts/password_change_done.html Mon Nov
22 05:28:30 2010
@@ -0,0 +1,10 @@
+{% extends "base.html" %}
+
+
+{% block main_content %}
+
+<h1> Password change successful</h1>
+
+<p> Your password was changed. Return to the <a href="/site/"> Site
</a></p>
+
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/accounts/password_change_form.html Mon Nov
22 05:28:30 2010
@@ -0,0 +1,23 @@
+{% extends "base.html" %}
+
+
+{% block main_content %}
+
+<h2>Password change</h2>
+
+<p>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="/site/password_changed/" method="post">
+<table>
+{{ form.old_password.errors }}
+<tr><td><label for="id_old_password">Old password:</label></td><td>{{
form.old_password }}</td></tr>
+{{ form.new_password1.errors }}
+<tr><td><label for="id_new_password1">New password:</label></td><td>{{
form.new_password1 }}</td></tr>
+{{ form.new_password2.errors }}
+<tr><td><label for="id_new_password2">Confirm password:</label></td><td>{{
form.new_password2 }}</td></tr>
+
+<tr><td><input type="submit" value="Change my password" /></td></tr>
+</table>
+</form>
+
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/accounts/pchange.html Mon Nov 22 05:28:30
2010
@@ -0,0 +1,16 @@
+{% extends 'base.html' %}
+
+{% block main_content %}
+{% if message %}
+ {{ message }}
+{% endif %}
+{% if form %}
+Hi {{ team }} Team, Please create your login password Here !
+<form method="post" action="/site/change_password_first_time/">
+<table>
+{{ form.as_table }}
+<tr> <td> <input type="submit" value="Register"/> </td> </tr>
+</table>
+</form>
+{% endif %}
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/accounts/register.html Mon Nov 22 05:28:30
2010
@@ -0,0 +1,15 @@
+{% extends 'base.html' %}
+
+{% block main_content %}
+{% if message %}
+{{ message }}
+{% endif %}
+{% if form %}
+<form method="post" action="/site/register/">
+<table>
+{{ form.as_table }}
+<tr> <td> <input type="submit" value="Register"/> </td> </tr>
+</table>
+</form>
+{% endif %}
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/404.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,12 @@
+{% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/500.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,12 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{%
trans "Home" %}</a> › {% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/actions.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,16 @@
+{% load i18n %}
+<div class="actions">
+ {% for field in action_form %}{% if field.label %}<label>{{
field.label }} {% endif %}{{ field }}{% if field.label %}</label>{%
endif %}{% endfor %}
+ <button type="submit" class="button" title="{% trans "Run the selected
action" %}" name="index" value="{{ action_index|default:0 }}">{%
trans "Go" %}</button>
+ {% if actions_selection_counter %}
+ <script type="text/javascript">var _actions_icnt="{{
cl.result_list|length|default:"0" }}";</script>
+ <span class="action-counter">{{ selection_note }}</span>
+ {% if cl.result_count != cl.result_list|length %}
+ <span class="all">{{ selection_note_all }}</span>
+ <span class="question">
+ <a href="javascript:;" title="{% trans "Click here to select
the objects across all pages" %}">{% blocktrans with cl.result_count as
total_count %}Select all {{ total_count }} {{ module_name }}{%
endblocktrans %}</a>
+ </span>
+ <span class="clear"><a href="javascript:;">{% trans "Clear
selection" %}</a></span>
+ {% endif %}
+ {% endif %}
+</div>
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/app_index.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,15 @@
+{% extends "admin/index.html" %}
+{% load i18n %}
+
+{% if not is_popup %}
+
+{% block breadcrumbs %}
+<div class="breadcrumbs"><a href="../">
+{% trans "Home" %}</a> ›
+{% for app in app_list %}
+{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
+{% endfor %}</div>{% endblock %}
+
+{% endif %}
+
+{% block sidebar %}{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/auth/user/add_form.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,14 @@
+{% extends "admin/change_form.html" %}
+{% load i18n %}
+
+{% block form_top %}
+ {% if not is_popup %}
+ <p>{% trans "First, enter a username and password. Then, you'll be
able to edit more user options." %}</p>
+ {% else %}
+ <p>{% trans "Enter a username and password." %}</p>
+ {% endif %}
+{% endblock %}
+
+{% block after_field_sets %}
+<script
type="text/javascript">document.getElementById("id_username").focus();</script>
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/auth/user/change_password.html Mon Nov
22 05:28:30 2010
@@ -0,0 +1,54 @@
+{% extends "admin/base_site.html" %}
+{% load i18n admin_modify adminmedia %}
+{% block extrahead %}{{ block.super }}
+{% url admin:jsi18n as jsi18nurl %}
+<script type="text/javascript" src="{{ jsi18nurl|
default:"../../../../jsi18n/" }}"></script>
+{% endblock %}
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet"
type="text/css" href="{% 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> ›
+ <a href="../../../">{{ opts.app_label|capfirst|escape }}</a> ›
+ <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> ›
+ <a href="../">{{ original|truncatewords:"18" }}</a> ›
+ {% trans 'Change password' %}
+</div>
+{% endif %}{% endblock %}
+{% block content %}<div id="content-main">
+<form action="{{ form_url }}" method="post" id="{{ opts.module_name
}}_form">{% csrf_token %}{% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/base.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,82 @@
+<!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 %}" />
+{% block extrastyle %}{% endblock %}
+<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block
stylesheet_ie %}{% load adminmedia %}{% admin_media_prefix %}css/ie.css{%
endblock %}" /><![endif]-->
+{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{%
block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}"
/>{% endif %}
+<script type="text/javascript">window.__admin_media_prefix__ = "{% filter
escapejs %}{% admin_media_prefix %}{% endfilter %}";</script>
+{% block extrahead %}{% endblock %}
+{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{%
endblock %}
+</head>
+{% load i18n %}
+
+<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{%
endblock %}">
+
+<!-- Container -->
+<div id="container">
+
+ {% if not is_popup %}
+ <!-- Header -->
+ <div id="header">
+ <div id="branding">
+ {% block branding %}{% endblock %}
+ </div>
+ {% if user.is_active and user.is_staff %}
+ <div id="user-tools">
+ {% trans 'Welcome,' %}
+ <strong>{% filter force_escape %}{% firstof user.first_name
user.username %}{% endfilter %}</strong>.
+ {% block userlinks %}
+ {% url django-admindocs-docroot as docsroot %}
+ {% if docsroot %}
+ <a href="{{ docsroot }}">{%
trans 'Documentation' %}</a> /
+ {% endif %}
+ {% url admin:password_change as password_change_url %}
+ {% if password_change_url %}
+ <a href="{{ password_change_url }}">
+ {% else %}
+ <a href="{{ root_path }}password_change/">
+ {% endif %}
+ {% trans 'Change password' %}</a> /
+ {% url admin:logout as logout_url %}
+ {% if logout_url %}
+ <a href="{{ logout_url }}">
+ {% else %}
+ <a href="{{ root_path }}logout/">
+ {% endif %}
+ {% 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 %} › {{ title }}{% endif %}</div>{%
endblock %}
+ {% endif %}
+
+ {% if messages %}
+ <ul class="messagelist">{% for message in messages %}
+ <li{% if message.tags %} class="{{ message.tags }}"{%
endif %}>{{ 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>
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/base_site.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,10 @@
+{% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/change_form.html Mon Nov 22 05:28:30
2010
@@ -0,0 +1,67 @@
+{% extends "admin/base_site.html" %}
+{% load i18n admin_modify adminmedia %}
+
+{% block extrahead %}{{ block.super }}
+{% url admin:jsi18n as jsi18nurl %}
+<script type="text/javascript" src="{{ jsi18nurl|
default:"../../../jsi18n/" }}"></script>
+{{ media }}
+{% endblock %}
+
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet"
type="text/css" href="{% 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> ›
+ <a href="../../">{{ app_label|capfirst|escape }}</a> ›
+ {% if has_change_permission %}<a href="../">{{
opts.verbose_name_plural|capfirst }}</a>{% else %}{{
opts.verbose_name_plural|capfirst }}{% endif %} ›
+ {% 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">{% csrf_token %}{% 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>
+ {{ adminform.form.non_field_errors }}
+{% 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 adminform and 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/change_list.html Mon Nov 22 05:28:30
2010
@@ -0,0 +1,102 @@
+{% extends "admin/base_site.html" %}
+{% load adminmedia admin_list i18n %}
+
+{% block extrastyle %}
+ {{ block.super }}
+ <link rel="stylesheet" type="text/css" href="{%
admin_media_prefix %}css/changelists.css" />
+ {% if cl.formset %}
+ <link rel="stylesheet" type="text/css" href="{%
admin_media_prefix %}css/forms.css" />
+ {% endif %}
+ {% if cl.formset or action_form %}
+ {% url admin:jsi18n as jsi18nurl %}
+ <script type="text/javascript" src="{{ jsi18nurl|
default:'../../jsi18n/' }}"></script>
+ {% endif %}
+ {{ media.css }}
+ {% if not actions_on_top and not actions_on_bottom %}
+ <style>
+ #changelist table thead th:first-child {width: inherit}
+ </style>
+ {% endif %}
+{% endblock %}
+
+{% block extrahead %}
+{{ block.super }}
+{{ media.js }}
+{% if action_form %}{% if actions_on_top or actions_on_bottom %}
+<script type="text/javascript">
+(function($) {
+ $(document).ready(function($) {
+ $("tr input.action-select").actions();
+ });
+})(django.jQuery);
+</script>
+{% endif %}{% endif %}
+{% endblock %}
+
+{% block bodyclass %}change-list{% endblock %}
+
+{% if not is_popup %}
+ {% block breadcrumbs %}
+ <div class="breadcrumbs">
+ <a href="../../">
+ {% trans "Home" %}
+ </a>
+ ›
+ <a href="../">
+ {{ app_label|capfirst }}
+ </a>
+ ›
+ {{ 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 %}
+ {% if cl.formset.errors %}
+ <p class="errornote">
+ {% blocktrans count cl.formset.errors|length as counter %}Please
correct the error below.{% plural %}Please correct the errors below.{%
endblocktrans %}
+ </p>
+ {{ cl.formset.non_form_errors }}
+ {% endif %}
+ <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 %}
+
+ <form id="changelist-form" action="" method="post"{% if
cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{%
csrf_token %}
+ {% if cl.formset %}
+ {{ cl.formset.management_form }}
+ {% endif %}
+
+ {% block result_list %}
+ {% if action_form and actions_on_top and
cl.full_result_count %}{% admin_actions %}{% endif %}
+ {% result_list cl %}
+ {% if action_form and actions_on_bottom and
cl.full_result_count %}{% admin_actions %}{% endif %}
+ {% endblock %}
+ {% block pagination %}{% pagination cl %}{% endblock %}
+ </form>
+ </div>
+ </div>
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/change_list_results.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,22 @@
+{% if result_hidden_fields %}
+<div class="hiddenfields"> {# DIV for HTML validation #}
+{% for item in result_hidden_fields %}{{ item }}{% endfor %}
+</div>
+{% endif %}
+{% if results %}
+<table cellspacing="0" id="result_list">
+<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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/date_hierarchy.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,10 @@
+{% if show %}
+<div class="xfull">
+<ul class="toplinks">
+{% if back %}<li class="date-back"><a href="{{ back.link }}">‹ {{
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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/delete_confirmation.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,32 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}
+<div class="breadcrumbs">
+ <a href="../../../../">{% trans "Home" %}</a> ›
+ <a href="../../../">{{ app_label|capfirst }}</a> ›
+ <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> ›
+ <a href="../">{{ object|truncatewords:"18" }}</a> ›
+ {% 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">{% csrf_token %}
+ <div>
+ <input type="hidden" name="post" value="yes" />
+ <input type="submit" value="{% trans "Yes, I'm sure" %}" />
+ </div>
+ </form>
+{% endif %}
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/delete_selected_confirmation.html Mon
Nov 22 05:28:30 2010
@@ -0,0 +1,37 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}
+<div class="breadcrumbs">
+ <a href="../../">{% trans "Home" %}</a> ›
+ <a href="../">{{ app_label|capfirst }}</a> ›
+ <a href="./">{{ opts.verbose_name_plural|capfirst }}</a> ›
+ {% trans 'Delete multiple objects' %}
+</div>
+{% endblock %}
+
+{% block content %}
+{% if perms_lacking %}
+ <p>{% blocktrans %}Deleting the {{ object_name }} 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 %}Are you sure you want to delete the selected {{
object_name }} objects? All of the following objects and their related
items will be deleted:{% endblocktrans %}</p>
+ {% for deletable_object in deletable_objects %}
+ <ul>{{ deletable_object|unordered_list }}</ul>
+ {% endfor %}
+ <form action="" method="post">{% csrf_token %}
+ <div>
+ {% for obj in queryset %}
+ <input type="hidden" name="{{ action_checkbox_name }}" value="{{
obj.pk }}" />
+ {% endfor %}
+ <input type="hidden" name="action" value="delete_selected" />
+ <input type="hidden" name="post" value="yes" />
+ <input type="submit" value="{% trans "Yes, I'm sure" %}" />
+ </div>
+ </form>
+{% endif %}
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/edit_inline/stacked.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,79 @@
+{% load i18n adminmedia %}
+<div class="inline-group" id="{{ inline_admin_formset.formset.prefix
}}-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 %} empty-form last-related{%
endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not
forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
+ <h3><b>{{ inline_admin_formset.opts.verbose_name|title
}}:</b> <span class="inline_label">{% if
inline_admin_form.original %}{{ inline_admin_form.original }}{% else %}#{{
forloop.counter }}{% endif %}</span>
+ {% 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 %}
+ {% 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.form.non_field_errors %}{{
inline_admin_form.form.non_field_errors }}{% endif %}
+ {% for fieldset in inline_admin_form %}
+ {% include "admin/includes/fieldset.html" %}
+ {% endfor %}
+ {% if inline_admin_form.has_auto_field %}{{
inline_admin_form.pk_field.field }}{% endif %}
+ {{ inline_admin_form.fk_field.field }}
+</div>{% endfor %}
+</div>
+
+<script type="text/javascript">
+(function($) {
+ $(document).ready(function() {
+ var rows = "#{{ inline_admin_formset.formset.prefix
}}-group .inline-related";
+ var updateInlineLabel = function(row) {
+ $(rows).find(".inline_label").each(function(i) {
+ var count = i + 1;
+ $(this).html($(this).html().replace(/(#\d+)/g, "#" +
count));
+ });
+ }
+ var reinitDateTimeShortCuts = function() {
+ // Reinitialize the calendar and clock widgets by force, yuck.
+ if (typeof DateTimeShortcuts != "undefined") {
+ $(".datetimeshortcuts").remove();
+ DateTimeShortcuts.init();
+ }
+ }
+ var updateSelectFilter = function() {
+ // If any SelectFilter widgets were added, instantiate a new
instance.
+ if (typeof SelectFilter != "undefined"){
+ $(".selectfilter").each(function(index, value){
+ var namearr = value.name.split('-');
+ SelectFilter.init(value.id, namearr[namearr.length-1],
false, "{% admin_media_prefix %}");
+ })
+ $(".selectfilterstacked").each(function(index, value){
+ var namearr = value.name.split('-');
+ SelectFilter.init(value.id, namearr[namearr.length-1],
true, "{% admin_media_prefix %}");
+ })
+ }
+ }
+ var initPrepopulatedFields = function(row) {
+ row.find('.prepopulated_field').each(function() {
+ var field = $(this);
+ var input = field.find('input, select, textarea');
+ var dependency_list = input.data('dependency_list') || [];
+ var dependencies =
row.find(dependency_list.join(',')).find('input, select, textarea');
+ if (dependencies.length) {
+ input.prepopulate(dependencies,
input.attr('maxlength'));
+ }
+ });
+ }
+ $(rows).formset({
+ prefix: "{{ inline_admin_formset.formset.prefix }}",
+ addText: "{% blocktrans with
inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another
{{ verbose_name }}{% endblocktrans %}",
+ formCssClass: "dynamic-{{ inline_admin_formset.formset.prefix
}}",
+ deleteCssClass: "inline-deletelink",
+ deleteText: "{% trans "Remove" %}",
+ emptyCssClass: "empty-form",
+ removed: updateInlineLabel,
+ added: (function(row) {
+ initPrepopulatedFields(row);
+ reinitDateTimeShortCuts();
+ updateSelectFilter();
+ updateInlineLabel(row);
+ })
+ });
+ });
+})(django.jQuery);
+</script>
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/edit_inline/tabular.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,125 @@
+{% load i18n adminmedia %}
+<div class="inline-group" id="{{ inline_admin_formset.formset.prefix
}}-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.widget.is_hidden %}
+ <th{% if forloop.first %} colspan="2"{% endif %}{% if
field.required %} class="required"{% endif %}>{{ field.label|capfirst
}}</th>
+ {% endif %}
+ {% endfor %}
+ {% if inline_admin_formset.formset.can_delete %}<th>{%
trans "Delete?" %}</th>{% endif %}
+ </tr></thead>
+
+ <tbody>
+ {% 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 %}{% if forloop.last %} empty-form{% endif %}"
+ id="{{ inline_admin_formset.formset.prefix }}-{% if not
forloop.last %}{{ forloop.counter0 }}{% else %}empty{% 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 %}
+ {% if inline_admin_form.has_auto_field %}{{
inline_admin_form.pk_field.field }}{% endif %}
+ {{ 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 }}">
+ {% if field.is_readonly %}
+ <p>{{ field.contents }}</p>
+ {% else %}
+ {{ field.field.errors.as_ul }}
+ {{ field.field }}
+ {% endif %}
+ </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 %}
+ </tbody>
+ </table>
+</fieldset>
+ </div>
+</div>
+
+<script type="text/javascript">
+(function($) {
+ $(document).ready(function($) {
+ var rows = "#{{ inline_admin_formset.formset.prefix
}}-group .tabular.inline-related tbody tr";
+ var alternatingRows = function(row) {
+ $(rows).not(".add-row").removeClass("row1 row2")
+ .filter(":even").addClass("row1").end()
+ .filter(rows + ":odd").addClass("row2");
+ }
+ var reinitDateTimeShortCuts = function() {
+ // Reinitialize the calendar and clock widgets by force
+ if (typeof DateTimeShortcuts != "undefined") {
+ $(".datetimeshortcuts").remove();
+ DateTimeShortcuts.init();
+ }
+ }
+ var updateSelectFilter = function() {
+ // If any SelectFilter widgets are a part of the new form,
+ // instantiate a new SelectFilter instance for it.
+ if (typeof SelectFilter != "undefined"){
+ $(".selectfilter").each(function(index, value){
+ var namearr = value.name.split('-');
+ SelectFilter.init(value.id, namearr[namearr.length-1],
false, "{% admin_media_prefix %}");
+ })
+ $(".selectfilterstacked").each(function(index, value){
+ var namearr = value.name.split('-');
+ SelectFilter.init(value.id, namearr[namearr.length-1],
true, "{% admin_media_prefix %}");
+ })
+ }
+ }
+ var initPrepopulatedFields = function(row) {
+ row.find('.prepopulated_field').each(function() {
+ var field = $(this);
+ var input = field.find('input, select, textarea');
+ var dependency_list = input.data('dependency_list') || [];
+ var dependencies =
row.find(dependency_list.join(',')).find('input, select, textarea');
+ if (dependencies.length) {
+ input.prepopulate(dependencies,
input.attr('maxlength'));
+ }
+ });
+ }
+ $(rows).formset({
+ prefix: "{{ inline_admin_formset.formset.prefix }}",
+ addText: "{% blocktrans with
inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another
{{ verbose_name }}{% endblocktrans %}",
+ formCssClass: "dynamic-{{ inline_admin_formset.formset.prefix
}}",
+ deleteCssClass: "inline-deletelink",
+ deleteText: "{% trans "Remove" %}",
+ emptyCssClass: "empty-form",
+ removed: alternatingRows,
+ added: (function(row) {
+ initPrepopulatedFields(row);
+ reinitDateTimeShortCuts();
+ updateSelectFilter();
+ alternatingRows(row);
+ })
+ });
+ });
+})(django.jQuery);
+</script>
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/filter.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,8 @@
+{% 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>
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/includes/fieldset.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,28 @@
+<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 }}
+ {% if field.is_readonly %}
+ <p>{{ field.contents }}</p>
+ {% else %}
+ {{ field.field }}
+ {% endif %}
+ {% endif %}
+ {% if field.field.field.help_text %}
+ <p class="help">{{ field.field.field.help_text|
safe }}</p>
+ {% endif %}
+ </div>
+ {% endfor %}
+ </div>
+ {% endfor %}
+</fieldset>
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/index.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,80 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet"
type="text/css" href="{% 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> </td>
+ {% endif %}
+
+ {% if model.perms.change %}
+ <td><a href="{{ model.admin_url }}" class="changelink">{%
trans 'Change' %}</a></td>
+ {% else %}
+ <td> </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 entry.is_deletion %}
+ {{ entry.object_repr }}
+ {% else %}
+ <a href="{{ entry.get_admin_url }}">{{
entry.object_repr }}</a>
+ {% endif %}
+ <br/>
+ {% if entry.content_type %}
+ <span class="mini quiet">{% filter capfirst %}{% trans
entry.content_type.name %}{% endfilter %}</span>
+ {% else %}
+ <span class="mini quiet">{% trans 'Unknown
content' %}</span>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </div>
+</div>
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/invalid_setup.html Mon Nov 22 05:28:30
2010
@@ -0,0 +1,8 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{%
trans 'Home' %}</a> › {{ 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/login.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,34 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block extrastyle %}{% load adminmedia %}{{ block.super }}<link
rel="stylesheet" type="text/css" href="{%
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">{%
csrf_token %}
+ <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> </label><input type="submit" value="{% trans 'Log in' %}"
/>
+ </div>
+</form>
+
+<script type="text/javascript">
+document.getElementById('id_username').focus()
+</script>
+</div>
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/object_history.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,42 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}
+<div class="breadcrumbs">
+ <a href="../../../../">{% trans 'Home' %}</a> ›
+ <a href="../../../">{{ app_label|capfirst }}</a> ›
+ <a href="../../">{{ module_name }}</a> ›
+ <a href="../">{{ object|truncatewords:"18" }}</a> ›
+ {% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/pagination.html Mon Nov 22 05:28:30
2010
@@ -0,0 +1,12 @@
+{% 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 %} <a href="{{ show_all_url }}"
class="showall">{% trans 'Show all' %}</a>{% endif %}
+{% if cl.formset and cl.result_count %}<input type="submit" name="_save"
class="default" value="{% trans 'Save' %}"/>{% endif %}
+</p>
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/prepopulated_fields_js.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,23 @@
+<script type="text/javascript">
+(function($) {
+ var field = null;
+
+{% for field in prepopulated_fields %}
+ field = {
+ id: '#{{ field.field.auto_id }}',
+ dependency_ids: [],
+ dependency_list: [],
+ maxLength: {{ field.field.field.max_length|default_if_none:"50" }}
+ };
+
+ {% for dependency in field.dependencies %}
+ field['dependency_ids'].push('#{{ dependency.auto_id }}');
+ field['dependency_list'].push('.{{ dependency.name }}');
+ {% endfor %}
+
+ $('.empty-form .{{ field.field.name
}}').addClass('prepopulated_field');
+ $(field.id).data('dependency_list', field['dependency_list'])
+ .prepopulate($(field['dependency_ids'].join(',')),
field.maxLength);
+{% endfor %}
+})(django.jQuery);
+</script>
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/search_form.html Mon Nov 22 05:28:30
2010
@@ -0,0 +1,18 @@
+{% 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 'Search' %}" />
+{% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/submit_line.html Mon Nov 22 05:28:30
2010
@@ -0,0 +1,8 @@
+{% 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>
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/admin/template_validator.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,31 @@
+{% extends "admin/base_site.html" %}
+
+{% block content %}
+
+<div id="content-main">
+
+<form action="" method="post">{% csrf_token %}
+
+{% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/base.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,110 @@
+<!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="en" xml:lang="en">
+<head>
+
+<!-- change this to the title you want to appear in browser title bar -->
+
+<title> Codelabs </title >
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="author" content="suren aditya krishnan" />
+<meta name="description" content="Codelabs checker default " />
+<link rel="stylesheet" href="/media/css/style.css" type="text/css" />
+
+
+</head>
+
+<body>
+
+<div id="navcontainer">
+ <!-- the title that appear in the page header -->
+ <div id="title"> <a href="/site/"> CodeLabs </a></div>
+ <ul id="navlist">
+
+ {% block side_bar %}
+ <!-- put your navigation links and text here -->
+ <li><a href="/site/">Home</a></li>
+ <li><a href="/site/contests/">Contests</a></li>
+ <li><a href="/site/problems/">Problems</a></li>
+ <li><a href="/site/references/">References</a></li>
+ <li><a href="/site/submissions/">Judge Status</a></li>
+ <li><a href="/site/about/">About</a></li>
+ <!-- end navigation -->
+ {% if user.is_authenticated %}
+ <li> <a href="/site/logout/"> Logout </a> </li>
+ {% else %}
+ <li> <a href="/site/login/"> Login </a> </li>
+ <li> <a href="/site/register/"> Register </a> </li>
+ {% endif %}
+
+ {% endblock %}
+
+ </ul>
+ </div>
+
+</div>
+
+<div id="wrap">
+ <div id="container">
+ <div class="content">
+ <!-- here is your page content -->
+ <div id='breadcrumbs'>
+ <div id="greeting">
+ {% if user.is_authenticated %}
+ Welcome, <a href="#"> {{ user.username }} </a>!
+ {% else %}
+ Hello There! Please <a href="/site/login/"> Log in
</a>.
+ {% endif %}
+ </div>
+ {% block breadcrumbs %}
+
+ {% endblock %}
+ </div>
+ <div class="header">
+ {% block errors %}
+ <h4> {{ errors }} </h4>
+ {% endblock %}
+
+ {% block header %}
+ <h3>
+ Welcome to CodeLabs!
+ </h3>
+ <i> The Way Geeks Have fun </i>
+ {% endblock %}
+ </div>
+ <div class="links">
+ {% block links %}
+
+ {% endblock %}
+ </div>
+
+ <div class="main_content">
+ {% block main_content %}
+ <div>
+ <br>
+ Codelabs is an automated judge system to conduct
+ programming contests. It has a mechanism to submit
+ problem solutions, have them judged fully
+ automatically and provides (web) interfaces for
+ teams, the jury and the general public.
+ </div>
+ <br>
+ <div>
+ Please use the links on the left to navigate the
+ site. Register an account to start participating.
+ </div>
+ {% endblock %}
+ </div>
+ <br>
+ </div>
+
+
+
+ <div id="footer"><br />
+ <a href="http://code.google.com/p/codechecker"
style="text-decoration: none"> CodeChecker Project - 2010 </a>
+ </div>
+ </div>
+</div>
+
+<div id='header'> </div>
+</body>
+</html>
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/contest.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,31 @@
+{% extends 'table.html' %}
+
+{% block header %}
+<h3> Contest : {{ title }} </h3>
+{% endblock %}
+{% block links %}
+
+<div id="links">
+ <a href = "/site/contests/{{ contest }}/description/"
id="description">Description</a>
+ <a href = "/site/contests/{{ contest }}/problems"
id="problems">Problems</a>
+ <a href = "/site/contests/{{ contest }}/ranklist"
id="ranklist">Ranklist</a>
+ <a href = "/site/contests/{{ contest }}/submissions"
id="submissions">Submissions</a>
+ <a href = "/site/contests/{{ contest }}/my_submissions"
id="my-submissions">My Submissions</a>
+ <script type="text/javascript">
+ var linkNode = document.getElementById("{{ section }}");
+ linkNode.className = "selected";
+ </script>
+</div>
+{% endblock %}
+
+{% block main_content %}
+{% autoescape off %}
+{% ifequal section "description" %}
+{{ description }}
+{% endifequal %}
+{% ifnotequal section "description" %}
+{{ block.super }}
+{% endifnotequal %}
+{% endautoescape %}
+{% endblock %}
+
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/problem.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,60 @@
+{% extends 'table.html' %}
+
+{% block header %}
+<h3> Problem : {{ problem_code }} </h3>
+{% endblock %}
+{% block links %}
+<div id="links">
+ <a href = "/site/problems/{{ problem }}/" id="view">View Problem</a>
+ <a href = "/site/problems/{{ problem }}/submit/" id="submit">Submit</a>
+ <a href = "/site/problems/{{ problem }}/submissions/"
id="submissions">All Submissions</a>
+ <a href = "/site/problems/{{ problem }}/my_submissions/"
id="my_submissions">My Submissions</a>
+</div>
+ <script type="text/javascript">
+ var linkNode = document.getElementById("{{ section }}");
+ linkNode.className = "selected";
+ </script>
+{% endblock %}
+
+{% block main_content %}
+
+{% ifequal section "view" %}
+{% autoescape off %}
+{% if problem_statement %}
+{{ problem_statement }}
+<div class ="constraints"> <h4> Constraints: </h4> {{ problem_notes
}}</div>
+<div class ="data">
+ <h4> Sample Input: </h4>
+ <pre>{{ input_data }}</pre>
+ <h4> Sample Output: </h4>
+ <pre>{{ output_data }}</pre>
+ <h4> Time Limit: {{ tlimit }} sec <br>
+ Memory Limit: {{ mlimit }} MB</h4>
+</div>
+
+{% endif %}
+{% endautoescape %}
+{% endifequal %}
+
+{% ifequal section "submit" %}
+{% if form %}
+<form action="/site/problems/{{ problem }}/submit/" method="post">
+ <center>
+ <table>
+ <tr> <td> <label for="id_submissionLang"> Language :
</label></td> <td> {{ form.SubmissionLang }} </td> </tr>
+ <tr> <td> <label for="id_submissionCode"> Code : </label> {{
form.SubmissionCode.errors }}</td> <td align=center> {{ form.SubmissionCode
}}</td> </tr>
+ <tr> <td> </td><td align=center> <input type="submit"
value="Submit" /> </td></tr>
+ </table>
+ </center>
+</form>
+{% endif %}
+{% endifequal %}
+{% ifequal section "submissions" %}
+{{ block.super }}
+{% endifequal %}
+{% ifequal section "my_submissions" %}
+{{ block.super }}
+{% endifequal %}
+{% endblock %}
+
+
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/references.html Mon Nov 22 05:28:30 2010
@@ -0,0 +1,10 @@
+{% extends 'base.html' %}
+
+{% block main_content %}
+
+ <h3> References </h3>
+ The following sites may be of interest to you:
+ <p><a href='http://topcoder.com/tc'>TopCoder</a></p>
+ <p><a href='http://spoj.pl'>SPOJ</a></p>
+{% endblock %}
+
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/registration/logged_out.html Mon Nov 22
05:28:30 2010
@@ -0,0 +1,12 @@
+{% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/registration/password_change_done.html Mon
Nov 22 05:28:30 2010
@@ -0,0 +1,14 @@
+{% 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> › {% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/registration/password_change_form.html Mon
Nov 22 05:28:30 2010
@@ -0,0 +1,26 @@
+{% 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> › {% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/registration/password_reset_complete.html
Mon Nov 22 05:28:30 2010
@@ -0,0 +1,16 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{%
trans 'Home' %}</a> › {% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/registration/password_reset_confirm.html Mon
Nov 22 05:28:30 2010
@@ -0,0 +1,32 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{%
trans 'Home' %}</a> › {% 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." %}</p>
+
+{% endif %}
+
+{% endblock %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/registration/password_reset_done.html Mon
Nov 22 05:28:30 2010
@@ -0,0 +1,14 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{%
trans 'Home' %}</a> › {% 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 %}
=======================================
--- /dev/null
+++ /src/cc_frontend/templates/registration/password_reset_email.html Mon
Nov 22 05:28:30 2010
@@ -0,0 +1,15 @@
+{% 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 %}
=======================================
***Additional files exist in this changeset.***
==============================================================================
Revision: ee3a58c77c
Author: surenspost
Date: Mon Nov 22 05:29:23 2010
Log: We no longer need templates in the project root. Its within
src/cc_frontend/
http://code.google.com/p/codechecker/source/detail?r=ee3a58c77c
Deleted:
/templates/about.html
/templates/accounts/login.html
/templates/accounts/password_change_done.html
/templates/accounts/password_change_form.html
/templates/accounts/pchange.html
/templates/accounts/register.html
/templates/admin/404.html
/templates/admin/500.html
/templates/admin/actions.html
/templates/admin/app_index.html
/templates/admin/auth/user/add_form.html
/templates/admin/auth/user/change_password.html
/templates/admin/base.html
/templates/admin/base_site.html
/templates/admin/change_form.html
/templates/admin/change_list.html
/templates/admin/change_list_results.html
/templates/admin/date_hierarchy.html
/templates/admin/delete_confirmation.html
/templates/admin/delete_selected_confirmation.html
/templates/admin/edit_inline/stacked.html
/templates/admin/edit_inline/tabular.html
/templates/admin/filter.html
/templates/admin/includes/fieldset.html
/templates/admin/index.html
/templates/admin/invalid_setup.html
/templates/admin/login.html
/templates/admin/object_history.html
/templates/admin/pagination.html
/templates/admin/prepopulated_fields_js.html
/templates/admin/search_form.html
/templates/admin/submit_line.html
/templates/admin/template_validator.html
/templates/base.html
/templates/contest.html
/templates/index.php
/templates/problem.html
/templates/references.html
/templates/registration/logged_out.html
/templates/registration/password_change_done.html
/templates/registration/password_change_form.html
/templates/registration/password_reset_complete.html
/templates/registration/password_reset_confirm.html
/templates/registration/password_reset_done.html
/templates/registration/password_reset_email.html
/templates/registration/password_reset_form.html
/templates/table.html
=======================================
--- /templates/about.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,24 +0,0 @@
-{% extends 'base.html' %}
-
-{% block header %}
- <h3> About </h3>
-{% endblock %}
-{% block main_content %}
-
- <p>
- <a href="http://code.google.com/p/codechecker/">Codechecker</a>
- is a Free and Open Source Online Programming Contest Judge
- developed by <a href="http://suren.in">M
- Surendran</a>, <a
href="http://www.google.com/profiles/112148397913728069336">Aditya
- Manthramurthy</a> and <a
href="http://www.google.com/profiles/112622614976789698636">Krishnan
Parthasarathi</a>.
- </p>
- <p>
- Want to conduct a similar contest in your college? <br>
- Want to contribute to this FOSS project? <br>
- Visit the project
- page <a
href="http://code.google.com/p/codechecker">http://code.google.com/p/codechecker</a>
- and get in touch with the developers!
- </p>
-
-{% endblock %}
-
=======================================
--- /templates/accounts/login.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,27 +0,0 @@
-{% extends 'base.html' %}
-
-{% block main_content %}
-
-<h4> Please Login before you proceed! </h4>
-{% if form.errors %}
-<p>Your username and password didn't match. Please try again.</p>
-{% endif %}
-
-<form method="post" action="/site/login/">
- <table>
- <tr>
- <td>{{ form.username.label_tag }}</td>
- <td>{{ form.username }}</td>
- </tr>
- <tr>
- <td>{{ form.password.label_tag }}</td>
- <td>{{ form.password }}</td>
- </tr>
- </table>
-
- <input type="submit" value="login" />
- <input type="hidden" name="next" value="{{ next }}" />
-</form>
-
-<a href="/site/register/"> Register </a>
-{% endblock %}
=======================================
--- /templates/accounts/password_change_done.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,10 +0,0 @@
-{% extends "base.html" %}
-
-
-{% block main_content %}
-
-<h1> Password change successful</h1>
-
-<p> Your password was changed. Return to the <a href="/site/"> Site
</a></p>
-
-{% endblock %}
=======================================
--- /templates/accounts/password_change_form.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,23 +0,0 @@
-{% extends "base.html" %}
-
-
-{% block main_content %}
-
-<h2>Password change</h2>
-
-<p>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="/site/password_changed/" method="post">
-<table>
-{{ form.old_password.errors }}
-<tr><td><label for="id_old_password">Old password:</label></td><td>{{
form.old_password }}</td></tr>
-{{ form.new_password1.errors }}
-<tr><td><label for="id_new_password1">New password:</label></td><td>{{
form.new_password1 }}</td></tr>
-{{ form.new_password2.errors }}
-<tr><td><label for="id_new_password2">Confirm password:</label></td><td>{{
form.new_password2 }}</td></tr>
-
-<tr><td><input type="submit" value="Change my password" /></td></tr>
-</table>
-</form>
-
-{% endblock %}
=======================================
--- /templates/accounts/pchange.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,16 +0,0 @@
-{% extends 'base.html' %}
-
-{% block main_content %}
-{% if message %}
- {{ message }}
-{% endif %}
-{% if form %}
-Hi {{ team }} Team, Please create your login password Here !
-<form method="post" action="/site/change_password_first_time/">
-<table>
-{{ form.as_table }}
-<tr> <td> <input type="submit" value="Register"/> </td> </tr>
-</table>
-</form>
-{% endif %}
-{% endblock %}
=======================================
--- /templates/accounts/register.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,15 +0,0 @@
-{% extends 'base.html' %}
-
-{% block main_content %}
-{% if message %}
-{{ message }}
-{% endif %}
-{% if form %}
-<form method="post" action="/site/register/">
-<table>
-{{ form.as_table }}
-<tr> <td> <input type="submit" value="Register"/> </td> </tr>
-</table>
-</form>
-{% endif %}
-{% endblock %}
=======================================
--- /templates/admin/404.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,12 +0,0 @@
-{% 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 %}
=======================================
--- /templates/admin/500.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,12 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{%
trans "Home" %}</a> › {% 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 %}
=======================================
--- /templates/admin/actions.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,16 +0,0 @@
-{% load i18n %}
-<div class="actions">
- {% for field in action_form %}{% if field.label %}<label>{{
field.label }} {% endif %}{{ field }}{% if field.label %}</label>{%
endif %}{% endfor %}
- <button type="submit" class="button" title="{% trans "Run the selected
action" %}" name="index" value="{{ action_index|default:0 }}">{%
trans "Go" %}</button>
- {% if actions_selection_counter %}
- <script type="text/javascript">var _actions_icnt="{{
cl.result_list|length|default:"0" }}";</script>
- <span class="action-counter">{{ selection_note }}</span>
- {% if cl.result_count != cl.result_list|length %}
- <span class="all">{{ selection_note_all }}</span>
- <span class="question">
- <a href="javascript:;" title="{% trans "Click here to select
the objects across all pages" %}">{% blocktrans with cl.result_count as
total_count %}Select all {{ total_count }} {{ module_name }}{%
endblocktrans %}</a>
- </span>
- <span class="clear"><a href="javascript:;">{% trans "Clear
selection" %}</a></span>
- {% endif %}
- {% endif %}
-</div>
=======================================
--- /templates/admin/app_index.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,15 +0,0 @@
-{% extends "admin/index.html" %}
-{% load i18n %}
-
-{% if not is_popup %}
-
-{% block breadcrumbs %}
-<div class="breadcrumbs"><a href="../">
-{% trans "Home" %}</a> ›
-{% for app in app_list %}
-{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
-{% endfor %}</div>{% endblock %}
-
-{% endif %}
-
-{% block sidebar %}{% endblock %}
=======================================
--- /templates/admin/auth/user/add_form.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,14 +0,0 @@
-{% extends "admin/change_form.html" %}
-{% load i18n %}
-
-{% block form_top %}
- {% if not is_popup %}
- <p>{% trans "First, enter a username and password. Then, you'll be
able to edit more user options." %}</p>
- {% else %}
- <p>{% trans "Enter a username and password." %}</p>
- {% endif %}
-{% endblock %}
-
-{% block after_field_sets %}
-<script
type="text/javascript">document.getElementById("id_username").focus();</script>
-{% endblock %}
=======================================
--- /templates/admin/auth/user/change_password.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,54 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n admin_modify adminmedia %}
-{% block extrahead %}{{ block.super }}
-{% url admin:jsi18n as jsi18nurl %}
-<script type="text/javascript" src="{{ jsi18nurl|
default:"../../../../jsi18n/" }}"></script>
-{% endblock %}
-{% block extrastyle %}{{ block.super }}<link rel="stylesheet"
type="text/css" href="{% 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> ›
- <a href="../../../">{{ opts.app_label|capfirst|escape }}</a> ›
- <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> ›
- <a href="../">{{ original|truncatewords:"18" }}</a> ›
- {% trans 'Change password' %}
-</div>
-{% endif %}{% endblock %}
-{% block content %}<div id="content-main">
-<form action="{{ form_url }}" method="post" id="{{ opts.module_name
}}_form">{% csrf_token %}{% 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 %}
=======================================
--- /templates/admin/base.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,82 +0,0 @@
-<!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 %}" />
-{% block extrastyle %}{% endblock %}
-<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block
stylesheet_ie %}{% load adminmedia %}{% admin_media_prefix %}css/ie.css{%
endblock %}" /><![endif]-->
-{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{%
block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}"
/>{% endif %}
-<script type="text/javascript">window.__admin_media_prefix__ = "{% filter
escapejs %}{% admin_media_prefix %}{% endfilter %}";</script>
-{% block extrahead %}{% endblock %}
-{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{%
endblock %}
-</head>
-{% load i18n %}
-
-<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{%
endblock %}">
-
-<!-- Container -->
-<div id="container">
-
- {% if not is_popup %}
- <!-- Header -->
- <div id="header">
- <div id="branding">
- {% block branding %}{% endblock %}
- </div>
- {% if user.is_active and user.is_staff %}
- <div id="user-tools">
- {% trans 'Welcome,' %}
- <strong>{% filter force_escape %}{% firstof user.first_name
user.username %}{% endfilter %}</strong>.
- {% block userlinks %}
- {% url django-admindocs-docroot as docsroot %}
- {% if docsroot %}
- <a href="{{ docsroot }}">{%
trans 'Documentation' %}</a> /
- {% endif %}
- {% url admin:password_change as password_change_url %}
- {% if password_change_url %}
- <a href="{{ password_change_url }}">
- {% else %}
- <a href="{{ root_path }}password_change/">
- {% endif %}
- {% trans 'Change password' %}</a> /
- {% url admin:logout as logout_url %}
- {% if logout_url %}
- <a href="{{ logout_url }}">
- {% else %}
- <a href="{{ root_path }}logout/">
- {% endif %}
- {% 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 %} › {{ title }}{% endif %}</div>{%
endblock %}
- {% endif %}
-
- {% if messages %}
- <ul class="messagelist">{% for message in messages %}
- <li{% if message.tags %} class="{{ message.tags }}"{%
endif %}>{{ 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>
=======================================
--- /templates/admin/base_site.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,10 +0,0 @@
-{% 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 %}
=======================================
--- /templates/admin/change_form.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,67 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n admin_modify adminmedia %}
-
-{% block extrahead %}{{ block.super }}
-{% url admin:jsi18n as jsi18nurl %}
-<script type="text/javascript" src="{{ jsi18nurl|
default:"../../../jsi18n/" }}"></script>
-{{ media }}
-{% endblock %}
-
-{% block extrastyle %}{{ block.super }}<link rel="stylesheet"
type="text/css" href="{% 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> ›
- <a href="../../">{{ app_label|capfirst|escape }}</a> ›
- {% if has_change_permission %}<a href="../">{{
opts.verbose_name_plural|capfirst }}</a>{% else %}{{
opts.verbose_name_plural|capfirst }}{% endif %} ›
- {% 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">{% csrf_token %}{% 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>
- {{ adminform.form.non_field_errors }}
-{% 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 adminform and 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 %}
=======================================
--- /templates/admin/change_list.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,102 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load adminmedia admin_list i18n %}
-
-{% block extrastyle %}
- {{ block.super }}
- <link rel="stylesheet" type="text/css" href="{%
admin_media_prefix %}css/changelists.css" />
- {% if cl.formset %}
- <link rel="stylesheet" type="text/css" href="{%
admin_media_prefix %}css/forms.css" />
- {% endif %}
- {% if cl.formset or action_form %}
- {% url admin:jsi18n as jsi18nurl %}
- <script type="text/javascript" src="{{ jsi18nurl|
default:'../../jsi18n/' }}"></script>
- {% endif %}
- {{ media.css }}
- {% if not actions_on_top and not actions_on_bottom %}
- <style>
- #changelist table thead th:first-child {width: inherit}
- </style>
- {% endif %}
-{% endblock %}
-
-{% block extrahead %}
-{{ block.super }}
-{{ media.js }}
-{% if action_form %}{% if actions_on_top or actions_on_bottom %}
-<script type="text/javascript">
-(function($) {
- $(document).ready(function($) {
- $("tr input.action-select").actions();
- });
-})(django.jQuery);
-</script>
-{% endif %}{% endif %}
-{% endblock %}
-
-{% block bodyclass %}change-list{% endblock %}
-
-{% if not is_popup %}
- {% block breadcrumbs %}
- <div class="breadcrumbs">
- <a href="../../">
- {% trans "Home" %}
- </a>
- ›
- <a href="../">
- {{ app_label|capfirst }}
- </a>
- ›
- {{ 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 %}
- {% if cl.formset.errors %}
- <p class="errornote">
- {% blocktrans count cl.formset.errors|length as counter %}Please
correct the error below.{% plural %}Please correct the errors below.{%
endblocktrans %}
- </p>
- {{ cl.formset.non_form_errors }}
- {% endif %}
- <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 %}
-
- <form id="changelist-form" action="" method="post"{% if
cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{%
csrf_token %}
- {% if cl.formset %}
- {{ cl.formset.management_form }}
- {% endif %}
-
- {% block result_list %}
- {% if action_form and actions_on_top and
cl.full_result_count %}{% admin_actions %}{% endif %}
- {% result_list cl %}
- {% if action_form and actions_on_bottom and
cl.full_result_count %}{% admin_actions %}{% endif %}
- {% endblock %}
- {% block pagination %}{% pagination cl %}{% endblock %}
- </form>
- </div>
- </div>
-{% endblock %}
=======================================
--- /templates/admin/change_list_results.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,22 +0,0 @@
-{% if result_hidden_fields %}
-<div class="hiddenfields"> {# DIV for HTML validation #}
-{% for item in result_hidden_fields %}{{ item }}{% endfor %}
-</div>
-{% endif %}
-{% if results %}
-<table cellspacing="0" id="result_list">
-<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 %}
=======================================
--- /templates/admin/date_hierarchy.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,10 +0,0 @@
-{% if show %}
-<div class="xfull">
-<ul class="toplinks">
-{% if back %}<li class="date-back"><a href="{{ back.link }}">‹ {{
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 %}
=======================================
--- /templates/admin/delete_confirmation.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,32 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block breadcrumbs %}
-<div class="breadcrumbs">
- <a href="../../../../">{% trans "Home" %}</a> ›
- <a href="../../../">{{ app_label|capfirst }}</a> ›
- <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> ›
- <a href="../">{{ object|truncatewords:"18" }}</a> ›
- {% 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">{% csrf_token %}
- <div>
- <input type="hidden" name="post" value="yes" />
- <input type="submit" value="{% trans "Yes, I'm sure" %}" />
- </div>
- </form>
-{% endif %}
-{% endblock %}
=======================================
--- /templates/admin/delete_selected_confirmation.html Thu Oct 14 05:57:36
2010
+++ /dev/null
@@ -1,37 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block breadcrumbs %}
-<div class="breadcrumbs">
- <a href="../../">{% trans "Home" %}</a> ›
- <a href="../">{{ app_label|capfirst }}</a> ›
- <a href="./">{{ opts.verbose_name_plural|capfirst }}</a> ›
- {% trans 'Delete multiple objects' %}
-</div>
-{% endblock %}
-
-{% block content %}
-{% if perms_lacking %}
- <p>{% blocktrans %}Deleting the {{ object_name }} 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 %}Are you sure you want to delete the selected {{
object_name }} objects? All of the following objects and their related
items will be deleted:{% endblocktrans %}</p>
- {% for deletable_object in deletable_objects %}
- <ul>{{ deletable_object|unordered_list }}</ul>
- {% endfor %}
- <form action="" method="post">{% csrf_token %}
- <div>
- {% for obj in queryset %}
- <input type="hidden" name="{{ action_checkbox_name }}" value="{{
obj.pk }}" />
- {% endfor %}
- <input type="hidden" name="action" value="delete_selected" />
- <input type="hidden" name="post" value="yes" />
- <input type="submit" value="{% trans "Yes, I'm sure" %}" />
- </div>
- </form>
-{% endif %}
-{% endblock %}
=======================================
--- /templates/admin/edit_inline/stacked.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,79 +0,0 @@
-{% load i18n adminmedia %}
-<div class="inline-group" id="{{ inline_admin_formset.formset.prefix
}}-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 %} empty-form last-related{%
endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not
forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
- <h3><b>{{ inline_admin_formset.opts.verbose_name|title
}}:</b> <span class="inline_label">{% if
inline_admin_form.original %}{{ inline_admin_form.original }}{% else %}#{{
forloop.counter }}{% endif %}</span>
- {% 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 %}
- {% 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.form.non_field_errors %}{{
inline_admin_form.form.non_field_errors }}{% endif %}
- {% for fieldset in inline_admin_form %}
- {% include "admin/includes/fieldset.html" %}
- {% endfor %}
- {% if inline_admin_form.has_auto_field %}{{
inline_admin_form.pk_field.field }}{% endif %}
- {{ inline_admin_form.fk_field.field }}
-</div>{% endfor %}
-</div>
-
-<script type="text/javascript">
-(function($) {
- $(document).ready(function() {
- var rows = "#{{ inline_admin_formset.formset.prefix
}}-group .inline-related";
- var updateInlineLabel = function(row) {
- $(rows).find(".inline_label").each(function(i) {
- var count = i + 1;
- $(this).html($(this).html().replace(/(#\d+)/g, "#" +
count));
- });
- }
- var reinitDateTimeShortCuts = function() {
- // Reinitialize the calendar and clock widgets by force, yuck.
- if (typeof DateTimeShortcuts != "undefined") {
- $(".datetimeshortcuts").remove();
- DateTimeShortcuts.init();
- }
- }
- var updateSelectFilter = function() {
- // If any SelectFilter widgets were added, instantiate a new
instance.
- if (typeof SelectFilter != "undefined"){
- $(".selectfilter").each(function(index, value){
- var namearr = value.name.split('-');
- SelectFilter.init(value.id, namearr[namearr.length-1],
false, "{% admin_media_prefix %}");
- })
- $(".selectfilterstacked").each(function(index, value){
- var namearr = value.name.split('-');
- SelectFilter.init(value.id, namearr[namearr.length-1],
true, "{% admin_media_prefix %}");
- })
- }
- }
- var initPrepopulatedFields = function(row) {
- row.find('.prepopulated_field').each(function() {
- var field = $(this);
- var input = field.find('input, select, textarea');
- var dependency_list = input.data('dependency_list') || [];
- var dependencies =
row.find(dependency_list.join(',')).find('input, select, textarea');
- if (dependencies.length) {
- input.prepopulate(dependencies,
input.attr('maxlength'));
- }
- });
- }
- $(rows).formset({
- prefix: "{{ inline_admin_formset.formset.prefix }}",
- addText: "{% blocktrans with
inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another
{{ verbose_name }}{% endblocktrans %}",
- formCssClass: "dynamic-{{ inline_admin_formset.formset.prefix
}}",
- deleteCssClass: "inline-deletelink",
- deleteText: "{% trans "Remove" %}",
- emptyCssClass: "empty-form",
- removed: updateInlineLabel,
- added: (function(row) {
- initPrepopulatedFields(row);
- reinitDateTimeShortCuts();
- updateSelectFilter();
- updateInlineLabel(row);
- })
- });
- });
-})(django.jQuery);
-</script>
=======================================
--- /templates/admin/edit_inline/tabular.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,125 +0,0 @@
-{% load i18n adminmedia %}
-<div class="inline-group" id="{{ inline_admin_formset.formset.prefix
}}-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.widget.is_hidden %}
- <th{% if forloop.first %} colspan="2"{% endif %}{% if
field.required %} class="required"{% endif %}>{{ field.label|capfirst
}}</th>
- {% endif %}
- {% endfor %}
- {% if inline_admin_formset.formset.can_delete %}<th>{%
trans "Delete?" %}</th>{% endif %}
- </tr></thead>
-
- <tbody>
- {% 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 %}{% if forloop.last %} empty-form{% endif %}"
- id="{{ inline_admin_formset.formset.prefix }}-{% if not
forloop.last %}{{ forloop.counter0 }}{% else %}empty{% 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 %}
- {% if inline_admin_form.has_auto_field %}{{
inline_admin_form.pk_field.field }}{% endif %}
- {{ 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 }}">
- {% if field.is_readonly %}
- <p>{{ field.contents }}</p>
- {% else %}
- {{ field.field.errors.as_ul }}
- {{ field.field }}
- {% endif %}
- </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 %}
- </tbody>
- </table>
-</fieldset>
- </div>
-</div>
-
-<script type="text/javascript">
-(function($) {
- $(document).ready(function($) {
- var rows = "#{{ inline_admin_formset.formset.prefix
}}-group .tabular.inline-related tbody tr";
- var alternatingRows = function(row) {
- $(rows).not(".add-row").removeClass("row1 row2")
- .filter(":even").addClass("row1").end()
- .filter(rows + ":odd").addClass("row2");
- }
- var reinitDateTimeShortCuts = function() {
- // Reinitialize the calendar and clock widgets by force
- if (typeof DateTimeShortcuts != "undefined") {
- $(".datetimeshortcuts").remove();
- DateTimeShortcuts.init();
- }
- }
- var updateSelectFilter = function() {
- // If any SelectFilter widgets are a part of the new form,
- // instantiate a new SelectFilter instance for it.
- if (typeof SelectFilter != "undefined"){
- $(".selectfilter").each(function(index, value){
- var namearr = value.name.split('-');
- SelectFilter.init(value.id, namearr[namearr.length-1],
false, "{% admin_media_prefix %}");
- })
- $(".selectfilterstacked").each(function(index, value){
- var namearr = value.name.split('-');
- SelectFilter.init(value.id, namearr[namearr.length-1],
true, "{% admin_media_prefix %}");
- })
- }
- }
- var initPrepopulatedFields = function(row) {
- row.find('.prepopulated_field').each(function() {
- var field = $(this);
- var input = field.find('input, select, textarea');
- var dependency_list = input.data('dependency_list') || [];
- var dependencies =
row.find(dependency_list.join(',')).find('input, select, textarea');
- if (dependencies.length) {
- input.prepopulate(dependencies,
input.attr('maxlength'));
- }
- });
- }
- $(rows).formset({
- prefix: "{{ inline_admin_formset.formset.prefix }}",
- addText: "{% blocktrans with
inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another
{{ verbose_name }}{% endblocktrans %}",
- formCssClass: "dynamic-{{ inline_admin_formset.formset.prefix
}}",
- deleteCssClass: "inline-deletelink",
- deleteText: "{% trans "Remove" %}",
- emptyCssClass: "empty-form",
- removed: alternatingRows,
- added: (function(row) {
- initPrepopulatedFields(row);
- reinitDateTimeShortCuts();
- updateSelectFilter();
- alternatingRows(row);
- })
- });
- });
-})(django.jQuery);
-</script>
=======================================
--- /templates/admin/filter.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,8 +0,0 @@
-{% 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>
=======================================
--- /templates/admin/includes/fieldset.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,28 +0,0 @@
-<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 }}
- {% if field.is_readonly %}
- <p>{{ field.contents }}</p>
- {% else %}
- {{ field.field }}
- {% endif %}
- {% endif %}
- {% if field.field.field.help_text %}
- <p class="help">{{ field.field.field.help_text|
safe }}</p>
- {% endif %}
- </div>
- {% endfor %}
- </div>
- {% endfor %}
-</fieldset>
=======================================
--- /templates/admin/index.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,80 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block extrastyle %}{{ block.super }}<link rel="stylesheet"
type="text/css" href="{% 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> </td>
- {% endif %}
-
- {% if model.perms.change %}
- <td><a href="{{ model.admin_url }}" class="changelink">{%
trans 'Change' %}</a></td>
- {% else %}
- <td> </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 entry.is_deletion %}
- {{ entry.object_repr }}
- {% else %}
- <a href="{{ entry.get_admin_url }}">{{
entry.object_repr }}</a>
- {% endif %}
- <br/>
- {% if entry.content_type %}
- <span class="mini quiet">{% filter capfirst %}{% trans
entry.content_type.name %}{% endfilter %}</span>
- {% else %}
- <span class="mini quiet">{% trans 'Unknown
content' %}</span>
- {% endif %}
- </li>
- {% endfor %}
- </ul>
- {% endif %}
- </div>
-</div>
-{% endblock %}
=======================================
--- /templates/admin/invalid_setup.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,8 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{%
trans 'Home' %}</a> › {{ 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 %}
=======================================
--- /templates/admin/login.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,34 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block extrastyle %}{% load adminmedia %}{{ block.super }}<link
rel="stylesheet" type="text/css" href="{%
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">{%
csrf_token %}
- <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> </label><input type="submit" value="{% trans 'Log in' %}"
/>
- </div>
-</form>
-
-<script type="text/javascript">
-document.getElementById('id_username').focus()
-</script>
-</div>
-{% endblock %}
=======================================
--- /templates/admin/object_history.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,42 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block breadcrumbs %}
-<div class="breadcrumbs">
- <a href="../../../../">{% trans 'Home' %}</a> ›
- <a href="../../../">{{ app_label|capfirst }}</a> ›
- <a href="../../">{{ module_name }}</a> ›
- <a href="../">{{ object|truncatewords:"18" }}</a> ›
- {% 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 %}
=======================================
--- /templates/admin/pagination.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,12 +0,0 @@
-{% 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 %} <a href="{{ show_all_url }}"
class="showall">{% trans 'Show all' %}</a>{% endif %}
-{% if cl.formset and cl.result_count %}<input type="submit" name="_save"
class="default" value="{% trans 'Save' %}"/>{% endif %}
-</p>
=======================================
--- /templates/admin/prepopulated_fields_js.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,23 +0,0 @@
-<script type="text/javascript">
-(function($) {
- var field = null;
-
-{% for field in prepopulated_fields %}
- field = {
- id: '#{{ field.field.auto_id }}',
- dependency_ids: [],
- dependency_list: [],
- maxLength: {{ field.field.field.max_length|default_if_none:"50" }}
- };
-
- {% for dependency in field.dependencies %}
- field['dependency_ids'].push('#{{ dependency.auto_id }}');
- field['dependency_list'].push('.{{ dependency.name }}');
- {% endfor %}
-
- $('.empty-form .{{ field.field.name
}}').addClass('prepopulated_field');
- $(field.id).data('dependency_list', field['dependency_list'])
- .prepopulate($(field['dependency_ids'].join(',')),
field.maxLength);
-{% endfor %}
-})(django.jQuery);
-</script>
=======================================
--- /templates/admin/search_form.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,18 +0,0 @@
-{% 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 'Search' %}" />
-{% 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 %}
=======================================
--- /templates/admin/submit_line.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,8 +0,0 @@
-{% 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>
=======================================
--- /templates/admin/template_validator.html Thu Oct 14 05:57:36 2010
+++ /dev/null
@@ -1,31 +0,0 @@
-{% extends "admin/base_site.html" %}
-
-{% block content %}
-
-<div id="content-main">
-
-<form action="" method="post">{% csrf_token %}
-
-{% 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 %}
=======================================
--- /templates/base.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,110 +0,0 @@
-<!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="en" xml:lang="en">
-<head>
-
-<!-- change this to the title you want to appear in browser title bar -->
-
-<title> Codelabs </title >
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="author" content="suren aditya krishnan" />
-<meta name="description" content="Codelabs checker default " />
-<link rel="stylesheet" href="/media/css/style.css" type="text/css" />
-
-
-</head>
-
-<body>
-
-<div id="navcontainer">
- <!-- the title that appear in the page header -->
- <div id="title"> <a href="/site/"> CodeLabs </a></div>
- <ul id="navlist">
-
- {% block side_bar %}
- <!-- put your navigation links and text here -->
- <li><a href="/site/">Home</a></li>
- <li><a href="/site/contests/">Contests</a></li>
- <li><a href="/site/problems/">Problems</a></li>
- <li><a href="/site/references/">References</a></li>
- <li><a href="/site/submissions/">Judge Status</a></li>
- <li><a href="/site/about/">About</a></li>
- <!-- end navigation -->
- {% if user.is_authenticated %}
- <li> <a href="/site/logout/"> Logout </a> </li>
- {% else %}
- <li> <a href="/site/login/"> Login </a> </li>
- <li> <a href="/site/register/"> Register </a> </li>
- {% endif %}
-
- {% endblock %}
-
- </ul>
- </div>
-
-</div>
-
-<div id="wrap">
- <div id="container">
- <div class="content">
- <!-- here is your page content -->
- <div id='breadcrumbs'>
- <div id="greeting">
- {% if user.is_authenticated %}
- Welcome, <a href="#"> {{ user.username }} </a>!
- {% else %}
- Hello There! Please <a href="/site/login/"> Log in
</a>.
- {% endif %}
- </div>
- {% block breadcrumbs %}
-
- {% endblock %}
- </div>
- <div class="header">
- {% block errors %}
- <h4> {{ errors }} </h4>
- {% endblock %}
-
- {% block header %}
- <h3>
- Welcome to CodeLabs!
- </h3>
- <i> The Way Geeks Have fun </i>
- {% endblock %}
- </div>
- <div class="links">
- {% block links %}
-
- {% endblock %}
- </div>
-
- <div class="main_content">
- {% block main_content %}
- <div>
- <br>
- Codelabs is an automated judge system to conduct
- programming contests. It has a mechanism to submit
- problem solutions, have them judged fully
- automatically and provides (web) interfaces for
- teams, the jury and the general public.
- </div>
- <br>
- <div>
- Please use the links on the left to navigate the
- site. Register an account to start participating.
- </div>
- {% endblock %}
- </div>
- <br>
- </div>
-
-
-
- <div id="footer"><br />
- <a href="http://code.google.com/p/codechecker"
style="text-decoration: none"> CodeChecker Project - 2010 </a>
- </div>
- </div>
-</div>
-
-<div id='header'> </div>
-</body>
-</html>
=======================================
--- /templates/contest.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,31 +0,0 @@
-{% extends 'table.html' %}
-
-{% block header %}
-<h3> Contest : {{ title }} </h3>
-{% endblock %}
-{% block links %}
-
-<div id="links">
- <a href = "/site/contests/{{ contest }}/description/"
id="description">Description</a>
- <a href = "/site/contests/{{ contest }}/problems"
id="problems">Problems</a>
- <a href = "/site/contests/{{ contest }}/ranklist"
id="ranklist">Ranklist</a>
- <a href = "/site/contests/{{ contest }}/submissions"
id="submissions">Submissions</a>
- <a href = "/site/contests/{{ contest }}/my_submissions"
id="my-submissions">My Submissions</a>
- <script type="text/javascript">
- var linkNode = document.getElementById("{{ section }}");
- linkNode.className = "selected";
- </script>
-</div>
-{% endblock %}
-
-{% block main_content %}
-{% autoescape off %}
-{% ifequal section "description" %}
-{{ description }}
-{% endifequal %}
-{% ifnotequal section "description" %}
-{{ block.super }}
-{% endifnotequal %}
-{% endautoescape %}
-{% endblock %}
-
=======================================
--- /templates/problem.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,60 +0,0 @@
-{% extends 'table.html' %}
-
-{% block header %}
-<h3> Problem : {{ problem_code }} </h3>
-{% endblock %}
-{% block links %}
-<div id="links">
- <a href = "/site/problems/{{ problem }}/" id="view">View Problem</a>
- <a href = "/site/problems/{{ problem }}/submit/" id="submit">Submit</a>
- <a href = "/site/problems/{{ problem }}/submissions/"
id="submissions">All Submissions</a>
- <a href = "/site/problems/{{ problem }}/my_submissions/"
id="my_submissions">My Submissions</a>
-</div>
- <script type="text/javascript">
- var linkNode = document.getElementById("{{ section }}");
- linkNode.className = "selected";
- </script>
-{% endblock %}
-
-{% block main_content %}
-
-{% ifequal section "view" %}
-{% autoescape off %}
-{% if problem_statement %}
-{{ problem_statement }}
-<div class ="constraints"> <h4> Constraints: </h4> {{ problem_notes
}}</div>
-<div class ="data">
- <h4> Sample Input: </h4>
- <pre>{{ input_data }}</pre>
- <h4> Sample Output: </h4>
- <pre>{{ output_data }}</pre>
- <h4> Time Limit: {{ tlimit }} sec <br>
- Memory Limit: {{ mlimit }} MB</h4>
-</div>
-
-{% endif %}
-{% endautoescape %}
-{% endifequal %}
-
-{% ifequal section "submit" %}
-{% if form %}
-<form action="/site/problems/{{ problem }}/submit/" method="post">
- <center>
- <table>
- <tr> <td> <label for="id_submissionLang"> Language :
</label></td> <td> {{ form.SubmissionLang }} </td> </tr>
- <tr> <td> <label for="id_submissionCode"> Code : </label> {{
form.SubmissionCode.errors }}</td> <td align=center> {{ form.SubmissionCode
}}</td> </tr>
- <tr> <td> </td><td align=center> <input type="submit"
value="Submit" /> </td></tr>
- </table>
- </center>
-</form>
-{% endif %}
-{% endifequal %}
-{% ifequal section "submissions" %}
-{{ block.super }}
-{% endifequal %}
-{% ifequal section "my_submissions" %}
-{{ block.super }}
-{% endifequal %}
-{% endblock %}
-
-
=======================================
--- /templates/references.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,10 +0,0 @@
-{% extends 'base.html' %}
-
-{% block main_content %}
-
- <h3> References </h3>
- The following sites may be of interest to you:
- <p><a href='http://topcoder.com/tc'>TopCoder</a></p>
- <p><a href='http://spoj.pl'>SPOJ</a></p>
-{% endblock %}
-
=======================================
--- /templates/registration/logged_out.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,12 +0,0 @@
-{% 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 %}
=======================================
--- /templates/registration/password_change_done.html Fri Apr 30 15:57:46
2010
+++ /dev/null
@@ -1,14 +0,0 @@
-{% 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> › {% 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 %}
=======================================
--- /templates/registration/password_change_form.html Fri Apr 30 15:57:46
2010
+++ /dev/null
@@ -1,26 +0,0 @@
-{% 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> › {% 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 %}
=======================================
--- /templates/registration/password_reset_complete.html Fri Apr 30
15:57:46 2010
+++ /dev/null
@@ -1,16 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{%
trans 'Home' %}</a> › {% 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 %}
=======================================
--- /templates/registration/password_reset_confirm.html Fri Apr 30 15:57:46
2010
+++ /dev/null
@@ -1,32 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{%
trans 'Home' %}</a> › {% 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." %}</p>
-
-{% endif %}
-
-{% endblock %}
=======================================
--- /templates/registration/password_reset_done.html Fri Apr 30 15:57:46
2010
+++ /dev/null
@@ -1,14 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{%
trans 'Home' %}</a> › {% 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 %}
=======================================
--- /templates/registration/password_reset_email.html Fri Apr 30 15:57:46
2010
+++ /dev/null
@@ -1,15 +0,0 @@
-{% 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 %}
=======================================
--- /templates/registration/password_reset_form.html Fri Apr 30 15:57:46
2010
+++ /dev/null
@@ -1,19 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{%
trans 'Home' %}</a> › {% 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 %}
=======================================
--- /templates/table.html Fri Apr 30 15:57:46 2010
+++ /dev/null
@@ -1,64 +0,0 @@
-{% extends 'base.html' %}
-
-{% block header %}
-<h3> {{ category }} </h3>
-{% endblock %}
-
-{% block main_content %}
-<center>
-{% if current_page %}
-<div class="pagination">
- <span>
- {% if current_page.has_previous %}
- <a href="{{ base_url }}/{{ current_page.previous_page_number
}}/"><img src="/media/img/site/arrowleft.png"> </a>
- {% endif %}
- </span>
- <span>
- Page {{ current_page.number }} of {{
current_page.paginator.num_pages }}
- </span>
- <span>
- {% if current_page.has_next %}
- <a href="{{ base_url }}/{{ current_page.next_page_number }}/">
<img src="/media/img/site/arrowright.png"></a>
- {% endif %}
- </span>
-</div>
-{% endif %}
-{% autoescape off %}
-<table id="{{category}}" class="zebra">
- <thead><tr>
- {% for col in columns %}
- <th scope="col">
- {% if col.link %}
- <a href="{{ col.link }}">{{ col.name }}</a>
- {% else %}
- {{ col.name }}
- {% endif %}
- </th>
- {% empty %}
- {% endfor %}
- </tr></thead>
- {% for rowItem in rows %}
- {% if colored %}
- <tr class="{{ rowItem.color }}">
- {% else %}
- <tr class="{% cycle "odd" "even" %}">
- {% endif %}
- {% for col in rowItem.items %}
- <td>
- {% if col.link %}
- <a href="{{ col.link }}">{{ col.value }}</a>
- {% else %}
- {{ col.value }}
- {% endif %}
- </td>
- {% endfor %}
- </tr>
- {% empty %}
- {% endfor %}
-</table>
-{% endautoescape %}
-</center>
-{% endblock %}
-
-
-
==============================================================================
Revision: a7dd846122
Author: surenspost
Date: Mon Nov 22 05:30:21 2010
Log: move config files to conf directory. This should go to $prefix/etc
http://code.google.com/p/codechecker/source/detail?r=a7dd846122
Added:
/conf/codechecker.conf
/conf/django.conf
Deleted:
/utils/codechecker.conf
/utils/django.conf
=======================================
--- /dev/null
+++ /conf/codechecker.conf Mon Nov 22 05:30:21 2010
@@ -0,0 +1,40 @@
+[BackendMain]
+# Specify the root directory of the Codechecker installation below. It
+# should be an absolute address.
+CheckerRoot=/opt/checker/
+
+#Jail Root director
+JailRoot=/jail/
+
+# Specify the directory in which the codechecker runs all
+# submissions. The input/output/err files, the source file, the
+# executable, and the reference output file are all placed here. It
+# must be an address within the Jail.
+RunsPath=var/run/codechecker/submissions/
+
+# Specify the maximum allowable output file size in MBs. This limits the
+# output file size of any of your submission programs.
+OutputFileSizeLimit=64
+
+#Specify the file where all log messages need to be written to
+LogFile=/tmp/nohup.out
+
+[CompileCommands]
+# Specify the language to be supported and the corresponding compilation
command.
+# Format:
+# %s - src file
+# %e - exec file
+C_compile=gcc -lm -Wall -O2 %s -o %e
+C_run=%e
+CPP_compile=g++ -Wall -O2 %s -o %e
+CPP_run=%e
+Py_compile=py_compilefiles %s
+Py_run=python %s
+Pascal_compile=gpc %s -o %e
+Pascal_run=%e
+Java_compile=gcj -C %s
+Java_run=gij -Xmx%l -cp %p %c
+
+[RuntimeLimits]
+# Maximum size of Heap Memory in MB
+HeapSize=256
=======================================
--- /dev/null
+++ /conf/django.conf Mon Nov 22 05:30:21 2010
@@ -0,0 +1,20 @@
+# Django Conf
+# The entire codechecker source root is to be linked as checker in /opt for
+# this to work
+
+# Tries to Match All Django URL and The Location Regex pattern has to match
+# the value in settings.py BASE_URL value.
+<Location /site/>
+ SetHandler python-program
+ PythonHandler django.core.handlers.modpython
+ SetEnv DJANGO_SETTINGS_MODULE codechecker.settings
+ PythonDebug On /site
+ PythonPath "['/opt/checker'] + sys.path"
+</Location>
+
+# If the request is for media, serve it. Dont allow .htaccess overridding
+# Disable directory listing using -Index
+<Directory /media>
+ AllowOverride None
+ Options -Indexes
+</Directory>
=======================================
--- /utils/codechecker.conf Thu Jul 1 13:59:16 2010
+++ /dev/null
@@ -1,40 +0,0 @@
-[BackendMain]
-# Specify the root directory of the Codechecker installation below. It
-# should be an absolute address.
-CheckerRoot=/opt/checker/
-
-#Jail Root director
-JailRoot=/jail/
-
-# Specify the directory in which the codechecker runs all
-# submissions. The input/output/err files, the source file, the
-# executable, and the reference output file are all placed here. It
-# must be an address within the Jail.
-RunsPath=var/run/codechecker/submissions/
-
-# Specify the maximum allowable output file size in MBs. This limits the
-# output file size of any of your submission programs.
-OutputFileSizeLimit=64
-
-#Specify the file where all log messages need to be written to
-LogFile=/tmp/nohup.out
-
-[CompileCommands]
-# Specify the language to be supported and the corresponding compilation
command.
-# Format:
-# %s - src file
-# %e - exec file
-C_compile=gcc -lm -Wall -O2 %s -o %e
-C_run=%e
-CPP_compile=g++ -Wall -O2 %s -o %e
-CPP_run=%e
-Py_compile=py_compilefiles %s
-Py_run=python %s
-Pascal_compile=gpc %s -o %e
-Pascal_run=%e
-Java_compile=gcj -C %s
-Java_run=gij -Xmx%l -cp %p %c
-
-[RuntimeLimits]
-# Maximum size of Heap Memory in MB
-HeapSize=256
=======================================
--- /utils/django.conf Thu Oct 14 03:36:31 2010
+++ /dev/null
@@ -1,20 +0,0 @@
-# Django Conf
-# The entire codechecker source root is to be linked as checker in /opt for
-# this to work
-
-# Tries to Match All Django URL and The Location Regex pattern has to match
-# the value in settings.py BASE_URL value.
-<Location /site/>
- SetHandler python-program
- PythonHandler django.core.handlers.modpython
- SetEnv DJANGO_SETTINGS_MODULE codechecker.settings
- PythonDebug On /site
- PythonPath "['/opt/checker'] + sys.path"
-</Location>
-
-# If the request is for media, serve it. Dont allow .htaccess overridding
-# Disable directory listing using -Index
-<Directory /media>
- AllowOverride None
- Options -Indexes
-</Directory>
==============================================================================
Revision: 40a098fe0c
Author: surenspost
Date: Mon Nov 22 05:30:53 2010
Log: make_setuid.sh goes to utils
http://code.google.com/p/codechecker/source/detail?r=40a098fe0c
Added:
/utils/make_setuid.sh
Deleted:
/make_setuid.sh
=======================================
--- /dev/null
+++ /utils/make_setuid.sh Mon Nov 22 05:30:53 2010
@@ -0,0 +1,6 @@
+#! /bin/bash
+rm -f codechecker/backend/setuid_helper
+gcc -o codechecker/backend/setuid_helper -DDBG
codechecker/backend/setuid_helper.c
+cd codechecker/backend
+sudo chown root:root setuid_helper && sudo chmod u+s setuid_helper
+cd ../../
=======================================
--- /make_setuid.sh Mon Oct 11 09:23:20 2010
+++ /dev/null
@@ -1,6 +0,0 @@
-#! /bin/bash
-rm -f codechecker/backend/setuid_helper
-gcc -o codechecker/backend/setuid_helper -DDBG
codechecker/backend/setuid_helper.c
-cd codechecker/backend
-sudo chown root:root setuid_helper && sudo chmod u+s setuid_helper
-cd ../../
==============================================================================
Revision: bd733dd645
Author: surenspost
Date: Mon Nov 22 05:31:29 2010
Log: Add authors, readmes'
http://code.google.com/p/codechecker/source/detail?r=bd733dd645
Added:
/AUTHORS
/README
/docs/README
=======================================
--- /dev/null
+++ /AUTHORS Mon Nov 22 05:31:29 2010
@@ -0,0 +1,3 @@
+Surendran M <suren...@gmail.com>
+Krishnan Parthasarathi <krishnan.pa...@gmail.com>
+Aditya Manthramurthy <adity...@gmail.com>
=======================================
--- /dev/null
+++ /README Mon Nov 22 05:31:29 2010
@@ -0,0 +1,3 @@
+This is the codechecker backend folder.
+
+Please see docs/README to learn more about the codechecker design.
=======================================
--- /dev/null
+++ /docs/README Mon Nov 22 05:31:29 2010
@@ -0,0 +1,38 @@
+This document explains how the codechecker works.
+
+The codechecker start executing from Main.py. This Main program simply
+waits for a submission with status = "queued" to appear. When this
+happens, it picks up the submission, changes it to status =
+"processing" (atomically - many other codechecker threads can be
+running) and starts processing it.
+
+Some terminology about test cases:
+
+1) Testcase - a testcase is an input file for a single run of a
+submission.
+
+2) Test_group - a collection of one or more testcases that are scored
+together, associated with a score. Eg: If a program passes all
+testcases in a test_group it can get the points for that
+test_group. If it does not pass all testcases, the submission could
+get no points.
+
+3) Result checker - a program submitted by a problem setter that is
+used to check the result of a testcase run by a custom algorithm. This
+program is required only for problems that need a custom result
+verification algorithm. If the result for a testcase is unique, it is
+sufficient to use a reference output file and see that the testcase
+run produces the same output file.
+
+Processing consists of first compiling the submission, and generating
+an executable. Once this is done, the Evaluation module
+begins. Evaluation consists of testing the submission against a set of
+test_groups. Each test_group is fetched in order and the testing for
+the testcases in that test group begins. The submission is executed
+against each testcase by the Secure Execution module (SE). The
+Evaluation module also checks the result of each testcase run with
+either a reference output file for that testcase or a Result_checker
+program. The Result_checker also runs in the SE module.
+
+
+
==============================================================================
Revision: 698c605237
Author: surenspost
Date: Mon Nov 22 05:32:23 2010
Log: now src should be copied as the python module to
$prefix/lib/python2.6/dist-packages
http://code.google.com/p/codechecker/source/detail?r=698c605237
Modified:
/setup.py
=======================================
--- /setup.py Mon Nov 15 11:54:21 2010
+++ /setup.py Mon Nov 22 05:32:23 2010
@@ -10,9 +10,18 @@
license='GPLv3',
url='http://code.google.com/p/codechecker',
platforms='All',
-
packages=['cc_backend', 'cc_backend.compiler', 'cc_backend.evaluator',
- 'cc_backend.score', 'cc_backend.se', 'cc_backend.store'],
- package_dir={'cc_backend' : 'cc_backend/src'}
+ packages=['checker',
+ 'checker.cc_backend',
+ 'checker.cc_backend.compiler',
+ 'checker.cc_backend.evaluator',
+ 'checker.cc_backend.score',
+ 'checker.cc_backend.se',
+ 'checker.cc_backend.store',
+ 'checker.cc_frontend',
+ 'checker.cc_frontend.views',
+ 'checker.cc_frontend.forms'
+ ],
+ package_dir={'checker' : 'src'}
)
==============================================================================
Revision: 0cc88bf7b7
Author: surenspost
Date: Mon Nov 22 05:35:30 2010
Log: Fixed first argument in a class method
http://code.google.com/p/codechecker/source/detail?r=0cc88bf7b7
Modified:
/src/cc_backend/evaluator/eval.py
=======================================
--- /src/cc_backend/evaluator/eval.py Mon Nov 22 05:24:57 2010
+++ /src/cc_backend/evaluator/eval.py Mon Nov 22 05:35:30 2010
@@ -3,7 +3,7 @@
import subprocess
import se.secexec
class Evaluate:
- def eval_submission(submission, test_grp, submission_exec):
+ def eval_submission(self, submission, test_grp, submission_exec):
"""Takes submission and test_grp and returns result_set"""
tlimit = test_grp["timelimit"]
mlimit = test_grp["memlimit"]
==============================================================================
Revision: cb892fdf51
Author: surenspost
Date: Mon Nov 22 05:53:21 2010
Log: Move cc_backend and cc_frontend into checker. The reasoning for that
is best explained in the next commit.
http://code.google.com/p/codechecker/source/detail?r=cb892fdf51
Added:
/src/checker/__init__.py
/src/checker/cc_backend/Checker.py
/src/checker/cc_backend/Config.py
/src/checker/cc_backend/__init__.py
/src/checker/cc_backend/compiler/__init__.py
/src/checker/cc_backend/compiler/compile.py
/src/checker/cc_backend/evaluator/__init__.py
/src/checker/cc_backend/evaluator/eval.py
/src/checker/cc_backend/score/__init__.py
/src/checker/cc_backend/score/score.py
/src/checker/cc_backend/se/__init__.py
/src/checker/cc_backend/se/build_secexec.sh
/src/checker/cc_backend/se/secexec.c
/src/checker/cc_backend/se/secexec.h
/src/checker/cc_backend/se/secexec.py
/src/checker/cc_backend/store/__init__.py
/src/checker/cc_backend/store/default_store.py
/src/checker/cc_backend/store/storage_interface.py
/src/checker/cc_frontend/__init__.py
/src/checker/cc_frontend/forms/__init__.py
/src/checker/cc_frontend/manage.py
/src/checker/cc_frontend/models.py
/src/checker/cc_frontend/root_url.py
/src/checker/cc_frontend/settings.py.sample
/src/checker/cc_frontend/templates/about.html
/src/checker/cc_frontend/templates/accounts/login.html
/src/checker/cc_frontend/templates/accounts/password_change_done.html
/src/checker/cc_frontend/templates/accounts/password_change_form.html
/src/checker/cc_frontend/templates/accounts/pchange.html
/src/checker/cc_frontend/templates/accounts/register.html
/src/checker/cc_frontend/templates/admin/404.html
/src/checker/cc_frontend/templates/admin/500.html
/src/checker/cc_frontend/templates/admin/actions.html
/src/checker/cc_frontend/templates/admin/app_index.html
/src/checker/cc_frontend/templates/admin/auth/user/add_form.html
/src/checker/cc_frontend/templates/admin/auth/user/change_password.html
/src/checker/cc_frontend/templates/admin/base.html
/src/checker/cc_frontend/templates/admin/base_site.html
/src/checker/cc_frontend/templates/admin/change_form.html
/src/checker/cc_frontend/templates/admin/change_list.html
/src/checker/cc_frontend/templates/admin/change_list_results.html
/src/checker/cc_frontend/templates/admin/date_hierarchy.html
/src/checker/cc_frontend/templates/admin/delete_confirmation.html
/src/checker/cc_frontend/templates/admin/delete_selected_confirmation.html
/src/checker/cc_frontend/templates/admin/edit_inline/stacked.html
/src/checker/cc_frontend/templates/admin/edit_inline/tabular.html
/src/checker/cc_frontend/templates/admin/filter.html
/src/checker/cc_frontend/templates/admin/includes/fieldset.html
/src/checker/cc_frontend/templates/admin/index.html
/src/checker/cc_frontend/templates/admin/invalid_setup.html
/src/checker/cc_frontend/templates/admin/login.html
/src/checker/cc_frontend/templates/admin/object_history.html
/src/checker/cc_frontend/templates/admin/pagination.html
/src/checker/cc_frontend/templates/admin/prepopulated_fields_js.html
/src/checker/cc_frontend/templates/admin/search_form.html
/src/checker/cc_frontend/templates/admin/submit_line.html
/src/checker/cc_frontend/templates/admin/template_validator.html
/src/checker/cc_frontend/templates/base.html
/src/checker/cc_frontend/templates/contest.html
/src/checker/cc_frontend/templates/problem.html
/src/checker/cc_frontend/templates/references.html
/src/checker/cc_frontend/templates/registration/logged_out.html
/src/checker/cc_frontend/templates/registration/password_change_done.html
/src/checker/cc_frontend/templates/registration/password_change_form.html
/src/checker/cc_frontend/templates/registration/password_reset_complete.html
/src/checker/cc_frontend/templates/registration/password_reset_confirm.html
/src/checker/cc_frontend/templates/registration/password_reset_done.html
/src/checker/cc_frontend/templates/registration/password_reset_email.html
/src/checker/cc_frontend/templates/registration/password_reset_form.html
/src/checker/cc_frontend/templates/table.html
/src/checker/cc_frontend/urls.py
/src/checker/cc_frontend/views.py
/src/checker/cc_frontend/views/__init__.py
Deleted:
/src/cc_backend/Checker.py
/src/cc_backend/Config.py
/src/cc_backend/__init__.py
/src/cc_backend/compiler/__init__.py
/src/cc_backend/compiler/compile.py
/src/cc_backend/evaluator/__init__.py
/src/cc_backend/evaluator/eval.py
/src/cc_backend/score/__init__.py
/src/cc_backend/score/score.py
/src/cc_backend/se/__init__.py
/src/cc_backend/se/build_secexec.sh
/src/cc_backend/se/secexec.c
/src/cc_backend/se/secexec.h
/src/cc_backend/se/secexec.py
/src/cc_backend/store/__init__.py
/src/cc_backend/store/default_store.py
/src/cc_backend/store/storage_interface.py
/src/cc_frontend/__init__.py
/src/cc_frontend/forms/__init__.py
/src/cc_frontend/manage.py
/src/cc_frontend/models.py
/src/cc_frontend/root_url.py
/src/cc_frontend/settings.py.sample
/src/cc_frontend/templates/about.html
/src/cc_frontend/templates/accounts/login.html
/src/cc_frontend/templates/accounts/password_change_done.html
/src/cc_frontend/templates/accounts/password_change_form.html
/src/cc_frontend/templates/accounts/pchange.html
/src/cc_frontend/templates/accounts/register.html
/src/cc_frontend/templates/admin/404.html
/src/cc_frontend/templates/admin/500.html
/src/cc_frontend/templates/admin/actions.html
/src/cc_frontend/templates/admin/app_index.html
/src/cc_frontend/templates/admin/auth/user/add_form.html
/src/cc_frontend/templates/admin/auth/user/change_password.html
/src/cc_frontend/templates/admin/base.html
/src/cc_frontend/templates/admin/base_site.html
/src/cc_frontend/templates/admin/change_form.html
/src/cc_frontend/templates/admin/change_list.html
/src/cc_frontend/templates/admin/change_list_results.html
/src/cc_frontend/templates/admin/date_hierarchy.html
/src/cc_frontend/templates/admin/delete_confirmation.html
/src/cc_frontend/templates/admin/delete_selected_confirmation.html
/src/cc_frontend/templates/admin/edit_inline/stacked.html
/src/cc_frontend/templates/admin/edit_inline/tabular.html
/src/cc_frontend/templates/admin/filter.html
/src/cc_frontend/templates/admin/includes/fieldset.html
/src/cc_frontend/templates/admin/index.html
/src/cc_frontend/templates/admin/invalid_setup.html
/src/cc_frontend/templates/admin/login.html
/src/cc_frontend/templates/admin/object_history.html
/src/cc_frontend/templates/admin/pagination.html
/src/cc_frontend/templates/admin/prepopulated_fields_js.html
/src/cc_frontend/templates/admin/search_form.html
/src/cc_frontend/templates/admin/submit_line.html
/src/cc_frontend/templates/admin/template_validator.html
/src/cc_frontend/templates/base.html
/src/cc_frontend/templates/contest.html
/src/cc_frontend/templates/problem.html
/src/cc_frontend/templates/references.html
/src/cc_frontend/templates/registration/logged_out.html
/src/cc_frontend/templates/registration/password_change_done.html
/src/cc_frontend/templates/registration/password_change_form.html
/src/cc_frontend/templates/registration/password_reset_complete.html
/src/cc_frontend/templates/registration/password_reset_confirm.html
/src/cc_frontend/templates/registration/password_reset_done.html
/src/cc_frontend/templates/registration/password_reset_email.html
/src/cc_frontend/templates/registration/password_reset_form.html
/src/cc_frontend/templates/table.html
/src/cc_frontend/urls.py
/src/cc_frontend/views.py
/src/cc_frontend/views/__init__.py
=======================================
--- /dev/null
+++ /src/checker/cc_backend/Checker.py Mon Nov 22 05:53:21 2010
@@ -0,0 +1,74 @@
+#!/usr/bin
+import sys
+import os
+import string
+import time
+import threading
+
+from store.default_store import Default
+from evaluator.eval import Evaluate
+from compiler.compile import Compiler
+from score.score import Score
+from Config import Config
+
+
+def main():
+
+ config = Config("conf/codechecker.conf")
+ store = Default()
+ evaluator = Evaluate()
+ compiler = Compiler(config)
+ score = Score()
+
+ is_waiting = True
+
+ while True:
+ # get a queued submission.
+ submission = store.get_submission()
+
+ # if no submission is found wait for one.
+ if submission is None:
+ if not is_waiting:
+ is_waiting = True
+ print "Waiting for a submission."
+ time.sleep(2)
+ continue
+
+ is_waiting = False
+
+ # compile the submission
+ compiler_res = compiler.compile_source(submission["src_file"])
+ if compiler_res["retcode"] == 0:
+ store.set_compile_status("COMPILED", err_msg=None,
+ sub_id=submission["id"])
+ else:
+ store.set_compile_status("COMPILATION ERROR",
+ err_msg=status_info.err_msg,
+ sub_id=submission["id"])
+ continue
+
+ # Evaluate the queued submission. Somewhere in the following
+ # loop it is also possible that the program fails - need to
+ # set the status to runtime error status.
+ test_group_scores = []
+ for test_grp in store.get_test_group(submission["prob_id"]):
+ result_set = evaluator.eval_submission(submission,
+ test_grp,
compiler_res["run_cmd"])
+ test_grp_score = score.score_group(prob_id,
+ result_set)
+ store.set_test_group_score(test_grp_score,
+ problem_id=prob_id, test_group_id=test_grp["id"],
+ submission_id=submission["id"])
+ test_group_scores.append(test_grp_score)
+
+ # compute and set the overall score.
+ final_score = score.overall(test_group_scores,
+ problem_id=prob_id)
+ store.set_submission_score(final_score,
+ submission_id=submission["id"])
+ store.set_submission_run_status("PASS",
+ submission_id=submission["id"])
+
+
+if __name__ == '__main__':
+ main()
=======================================
--- /dev/null
+++ /src/checker/cc_backend/Config.py Mon Nov 22 05:53:21 2010
@@ -0,0 +1,27 @@
+import ConfigParser
+import os
+
+class Config:
+
+ def __init__(self, configFilePath):
+ self.config = ConfigParser.ConfigParser()
+ self.config.read(configFilePath)
+ self.jail_root = self.config.get("BackendMain","JailRoot")
+ runs_path = self.config.get("BackendMain", "RunsPath")
+ self.runpath = os.path.join('/' , runs_path)
+ self.abs_path = os.path.join(self.jail_root, runs_path)
+ self.outputLimit =
int(self.config.get("BackendMain","OutputFileSizeLimit"))
+ self.heapsize = self.config.get("RuntimeLimits", "HeapSize")
+
+ # Check if setuid_helper exists.
+ self.shPath = self.config.get("BackendMain", "CheckerRoot")
+ "codechecker/backend/setuid_helper"
+ assert os.path.isfile(self.shPath) and os.access(self.shPath,
os.X_OK)
+
+
+if __name__ == "__main__":
+
+ config = Config("conf/codechecker.conf")
+ print config.config.sections()
+ print config.config.get("CompileCommands", "C_compile")
+
+
=======================================
--- /dev/null
+++ /src/checker/cc_backend/compiler/compile.py Mon Nov 22 05:53:21 2010
@@ -0,0 +1,56 @@
+import subprocess
+import os.path
+
+
+class Compiler:
+ def __init__(self, config):
+ self.config = config
+
+ def compile_source(self, source_filepath, lang=None):
+ compiler = self.get_compiler(source_filepath, lang)
+ compiler.get_compile_cmd(source_filepath)
+ print compile_cmd
+ child = subprocess.Popen(compile_cmd, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE, shell=True)
+ out, err = child.communicate()
+ retDict = {}
+ retDict["retcode"] = child.returncode
+ retDict["compiler_output"] = out + err
+ retDict["run_cmd"] = compiler.get_run_cmd(source_filepath)
+ return retDict
+
+ # determines the language from the extension or from the lang
+ # argument if one is supplied.
+ def get_compiler(self, source_filepath, lang=None):
+ if lang == None:
+ # TODO: determine language from source_file and set it in
+ # lang
+ pass
+ if lang == "C":
+ return C_Compiler(self.config)
+ elif lang == "CPP":
+ return CPP_Compiler(self.config)
+ elif lang == "PY":
+ return Py_Compiler(self.config)
+ elif lang == "JAVA":
+ return Java_Compiler(self.config)
+
+
+class C_Compiler:
+ """
+ This is a language specific compiler class. It needs all the
+ methods needed below below.
+ """
+ def __init__(self, config):
+ self.config = config
+ self.compile_cmd =
config.config.get("CompileCommands", "C_compile")
+ self.exec_string = config.config.get("CompileCommands", "C_run")
+
+ def get_compile_cmd(self, source_path):
+ basename = os.path.join(self.config.abs_path, str(submission.pk))
+ return self.compile_cmd.replace("%s", basename
+ ".c").replace("%e", \
+ basename + ".exe")
+
+ def get_run_cmd(self, source_path):
+ basename = os.path.join(self.config.abs_path, str(submission.ph))
+ return self.exec_string.replace("%e", basename + ".exe")
=======================================
--- /dev/null
+++ /src/checker/cc_backend/evaluator/eval.py Mon Nov 22 05:53:21 2010
@@ -0,0 +1,50 @@
+from os.path import splitext
+import os
+import subprocess
+import se.secexec
+class Evaluate:
+ def eval_submission(self, submission, test_grp, submission_exec):
+ """Takes submission and test_grp and returns result_set"""
+ tlimit = test_grp["timelimit"]
+ mlimit = test_grp["memlimit"]
+ maxfilesz = 32 #TODO: for now we fix it at 32M
+ jailroot = "jail" #FIXME: Need to lay down the exec env
+
+ #Assumption: each infile would be of the form submission_id.in
+ for infile in test_grp["input_files"]:
+ #First run submission_exec and then validate output
+ outfile = splitext(infile)[0] + ".out"
+ errfile = splitext(infile)[0] + ".err"
+ args = ["--infile=%s" % infile,
+ "--outfile=%s" % outfile,
+ "--errfile=%s" % errfile,
+ "--memlimit=%d" % mlimit,
+ "--timelimit=%d" % tlimit,
+ "--maxfilesz=%d" % maxfilesz,
+ "--executable=%s" % submission_exec,
+ "--euid=%d" % 1002, #TODO: someone needs
+ #to send the euid to use here
+ "--jailroot=%s" % jailroot]
+ args.insert(0, curdir + "/secexec")
+ ret_code = se.secexec.secure_spawn(args)
+ #End of executing the submission_exec
+ if test_grp["is_cust_scored"] == True:
+ #TODO: run cust_execute via secure_spawn
+ #with appropriate infile and outfile
+ pass
+ else:
+ #TODO: perform a diff
+ check = subprocess.Popen('diff -Bb ' + outfile + ' ' +
test_grp["input_file"], shell=True,
+ stdout=subprocess.PIPE)
+ diff_op = check.communicate()[0]
+ if diff_op == '':
+ #testcase passed
+ pass
+ else:
+ #testcase failed
+ pass
+
+
+ pass
+ pass
+ pass
=======================================
--- /dev/null
+++ /src/checker/cc_backend/score/score.py Mon Nov 22 05:53:21 2010
@@ -0,0 +1,3 @@
+
+class Score:
+ pass
=======================================
--- /dev/null
+++ /src/checker/cc_backend/se/build_secexec.sh Mon Nov 22 05:53:21 2010
@@ -0,0 +1,3 @@
+gcc -DDBG -DGETOPT -DJAIL -I. -o secexec secexec.c
+sudo chown root:root secexec
+sudo chmod u+s secexec
=======================================
--- /dev/null
+++ /src/checker/cc_backend/se/secexec.c Mon Nov 22 05:53:21 2010
@@ -0,0 +1,177 @@
+#include <secexec.h>
+
+struct sigaction alarm_act;
+pid_t p;
+
+static void alarm_handler(int signo)
+{
+ /* its time to kill the child now! */
+ kill(p, SIGKILL);
+}
+
+int secure_spawn(ExecArgs ea) {
+ int ret;
+ char cur_dir[MAX_PATH_LEN], *new_dir = NULL;
+ char *targv[2] = {NULL, NULL}; /* dummy second arg for execvp */
+
+
+ p = fork();
+ if (!p) {
+ freopen(ea.infile, "r", stdin);
+ freopen(ea.outfile, "w", stdout);
+ freopen(ea.errfile, "w", stderr);
+
+ /* jailroot is expressed in absolute pathname terms.*/
+
+ chdir(ea.jailroot);
+ char *curdir = getcwd(NULL, 0);
+ ret = chroot(curdir);
+ free(curdir);
+#ifdef JAIL
+ FILE *fp = fopen("./chstuff", "a");
+ if(fp) {
+ fprintf(fp, "euid = %d ret = %d errno = %d\n", geteuid(), ret,
errno);
+ fclose(fp);
+ }
+#endif /* JAIL */
+
+ //drop priveleges
+ setuid(ea.euid);
+
+ struct rlimit lim ;
+ // set limit on number of forks possible.
+ lim.rlim_cur = lim.rlim_max = 0;
+ ret = setrlimit(RLIMIT_NPROC, &lim);
+
+ lim.rlim_cur = lim.rlim_max = ea.memlimit << 20;
+ ret = setrlimit(RLIMIT_AS, &lim);
+
+ lim.rlim_cur = ea.timelimit; lim.rlim_max = ea.timelimit + 1;
+ ret = setrlimit(RLIMIT_CPU, &lim);
+
+ lim.rlim_cur = lim.rlim_max = ea.maxfilesz << 20;
+ ret = setrlimit(RLIMIT_FSIZE, &lim);
+
+ targv[0] = ea.execname;
+ ret = execvp(ea.execname, targv);
+
+ //arbitrarily chosen to let parent know that execvp failed; we
+ //reach here only if execvp fails
+ return 111;
+ }
+
+ /* setting up an alarm for 'timelimit+2' seconds, since it includes CPU
and I/O time */
+ alarm_act.sa_handler = alarm_handler;
+ sigaction(SIGALRM, &alarm_act, NULL);
+ alarm(ea.timelimit+2);
+
+ int status;
+ struct rusage submission_stats;
+
+ int wait_ret = wait3(&status, 0, &submission_stats);
+#ifdef DBG
+ FILE *fp = fopen("/tmp/setuid-helper.debug", "a");
+ FILE *fs = fopen("/tmp/stats", "w");
+
+ if (WIFSIGNALED(status)) {
+ fprintf(fp, "submission %s signalled status = %d errno = %d\n",
ea.execname, WTERMSIG(status), errno);
+ return WTERMSIG(status);
+ }
+ if (WIFEXITED(status)) {
+ fprintf(fp, "child %s exited normally with status = %d errno
= %d\n", ea.execname, WEXITSTATUS(status), errno);
+ return WEXITSTATUS(status);
+ }
+ fprintf(fp, "child %s did not exit normally and did not get"
+ " signalled, exited with status = %d errno = %d\n", ea.execname,
status, errno);
+ fclose(fp);
+ fclose(fs);
+#endif /* DBG */
+ return status;
+}
+
+int main (int argc, char **argv) {
+ int c;
+ ExecArgs ea;
+
+ while (1) {
+ int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static struct option long_options[] = {
+ {"infile", required_argument, 0, 0},
+ {"outfile", required_argument, 0, 0},
+ {"errfile", required_argument, 0, 0},
+ {"jailroot", required_argument, 0, 0},
+ {"executable", required_argument, 0, 0},
+ {"euid", required_argument, 0, 0},
+ {"timelimit", required_argument, 0, 0},
+ {"memlimit", required_argument, 0, 0},
+ {"maxfilesz", required_argument, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "",
+ long_options, &option_index);
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 0:
+
+#ifdef GETOPT
+ printf ("option %s", long_options[option_index].name);
+ if (optarg)
+ printf (" with arg %s", optarg);
+ printf ("\n");
+#endif /*GETOPT*/
+
+ switch(option_index) {
+ case 0:
+ strcpy(ea.infile, optarg);
+ break;
+
+ case 1:
+ strcpy(ea.outfile, optarg);
+ break;
+
+ case 2:
+ strcpy(ea.errfile, optarg);
+ break;
+
+ case 3:
+ strcpy(ea.jailroot, optarg);
+ break;
+
+ case 4:
+ strcpy(ea.execname, optarg);
+ break;
+
+ case 5:
+ ea.euid = atoi(optarg);
+ break;
+
+ case 6:
+ ea.timelimit = atoi(optarg);
+ break;
+
+ case 7:
+ ea.memlimit = atoi(optarg);
+ break;
+
+ case 8:
+ ea.maxfilesz = atoi(optarg);
+ break;
+
+ default:
+ break;
+
+ }
+ break;
+
+ }
+ } /* option parsing ends */
+
+ int return_status = secure_spawn(ea);
+
+ return return_status;
+}
+
=======================================
--- /dev/null
+++ /src/checker/cc_backend/se/secexec.h Mon Nov 22 05:53:21 2010
@@ -0,0 +1,30 @@
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <getopt.h>
+
+#define MAX_PATH_LEN 300
+#define MAX_ARGS 20
+
+struct _ExecArgs {
+ int timelimit, memlimit, maxfilesz,
+ euid;
+ char infile[MAX_PATH_LEN];
+ char outfile[MAX_PATH_LEN];
+ char errfile[MAX_PATH_LEN];
+ char jailroot[MAX_PATH_LEN];
+ char execname[MAX_PATH_LEN];
+};
+
+typedef struct _ExecArgs ExecArgs;
+
+int secure_spawn(ExecArgs ea);
=======================================
--- /dev/null
+++ /src/checker/cc_backend/se/secexec.py Mon Nov 22 05:53:21 2010
@@ -0,0 +1,38 @@
+import subprocess
+from os.path import dirname, abspath
+
+def secure_spawn(args):
+ """
+ Takes a list of arguments where arg0 is secexec (setuid helper).
+ * execname is always relative to jailroot.
+ * jailroot is always expressd in absolute path terms.
+ Returns return code of execname that was run in jailroot
+ """
+
+ retcode = subprocess.Popen(args)
+ print retcode
+ return retcode
+
+
+if __name__ == "__main__":
+ infile, outfile, errfile = "in", "out", "err"
+ curdir = dirname(abspath(__file__))
+ jailroot = curdir + "/jail"
+ mlimit, tlimit, maxfilesz = 32, 2, 32
+ #execname should be relative to jailroot
+ execname = "./helloworld"
+ euid = 1002
+ print execname
+
+ args = ["--infile=%s" % infile,
+ "--outfile=%s" % outfile,
+ "--errfile=%s" % errfile,
+ "--memlimit=%d" % mlimit,
+ "--timelimit=%d" % tlimit,
+ "--maxfilesz=%d" % maxfilesz,
+ "--executable=%s" % execname,
+ "--euid=%d" % euid,
+ "--jailroot=%s" % jailroot]
+ args.insert(0, curdir + "/secexec")
+ print args
+ secure_spawn(args)
=======================================
--- /dev/null
+++ /src/checker/cc_backend/store/default_store.py Mon Nov 22 05:53:21 2010
@@ -0,0 +1,32 @@
+from storage_interface import Store
+
+
+class Default(Store):
+
+ """
+ TODO: Implement the storage inferface for Django. See the API
+ specification in storage_interface.py for details about how to
+ implement the stubs below.
+ """
+
+ def __init__(self):
+ pass
+
+ def get_submission(self):
+ pass
+
+ def set_compile_status(self, status, err_msg=None, submission_id=None):
+ pass
+
+ def get_test_group(self, problem_id=None):
+ pass
+
+ def set_test_group_score(self, score, problem_id=None,
+ test_group_id=None, submission_id=None):
+ pass
+
+ def set_submission_run_status(self, status, submission_id=None):
+ pass
+
+ def set_submission_score(self, score, submission_id=None):
+ pass
=======================================
--- /dev/null
+++ /src/checker/cc_backend/store/storage_interface.py Mon Nov 22 05:53:21
2010
@@ -0,0 +1,127 @@
+class Store:
+ """
+ This is the base class for the storage interface. The default
+ interface will be interface with Django's models. This module can
+ be derived and made to work any other kind of storage system too
+ like NOSQL, etc.
+
+ The requirements for the objects passed and returned by each
+ function are found in the function's comments below.
+
+ """
+
+ def __init__(self):
+ """
+ Initialize any storage connections here.
+ """
+ pass
+
+ def get_submission(self):
+ """
+ Fetches a submission from the store. If there is no queued
+ submission, it returns None immediately. If a queued
+ submission is found, it atomically sets the status of the
+ submission to "processing" in the persistent storage.
+
+ Arguments: None
+
+ Returns: None if no submission is queued at the
+ moment. Otherwise a dictionary with the following key/value
+ pairs:
+
+ {
+ "src_file" : "/path/to/source_file",
+ "prob_id" : "a string representing the id",
+ "id" : "string, id of submission"
+ }
+
+ """
+ pass
+
+ def set_compile_status(self, status, err_msg=None, sub_id=None):
+ """
+ Sets the compile status of submission to success/failure.
+
+ Arguments: status -> a string representing the status:
+ is either "SUCCESS" or "FAILURE"
+ err_msg -> a string representing the compiler
+ error message, if any; None otherwise
+ sub_id -> the string id of the submission
+
+ Returns: None
+ """
+ pass
+
+ def get_test_group(self, prob_id=None):
+ """
+ A test_group is a dictionary containing a list of input files
+ and corresponding ref_output objects. The output ref_output
+ objects are either reference output files or a binary program
+ that can check the output produced by the submission.
+
+ The returned dictionary also contains an attribute that
+ identifies the test_group id. This is used in the scoring
+ module to identify the scoring algorithm to use.
+
+ This function should be implemented as a python generator. The
+ Evaluation module calls this function repeatedly to get each
+ test_group successively.
+
+ Arguments: prob_id -> string id of the problem.
+
+ Returns: A testgroup object in each successive call until no
+ more remains. A testgroup object is a dictionary with the
+ following key/value pairs:
+
+ {
+ "prob_id" : "string problem id",
+
+ "testgroup_id" : "string id for testgroup",
+
+ "timelimit" : "time limit for a submisson for this testgroup",
+
+ "memlimit" : "memory limit for a submisson for this
testgroup",
+
+ "input_files" : [list of input file names] each of the form
+ submission_id.in and corresponding outfile
+ and errfile would be submission_id.{out,
err},
+
+ "output_files" : [list of corresponding reference output
+ file names] or None if a separate
+ program evaluates the outputs produced,
+
+ "cust_execute" : binary to execute as checker program
+ (TODO write details of semantics),
+
+ "score" : The int score if all cases in this testgroup
+ pass,
+
+ "is_cust_scored" : A flag, if True indicates that
+ cust_execute produces the score for
+ each input file (total score for group
+ is the sum)
+ }
+
+ """
+ pass
+
+ def set_testgroup_score(self, score, testgroup_id=None,
+ sub_id=None):
+ """
+ Sets the score for a submission for a testgroup
+ """
+ pass
+
+ def set_submission_run_status(self, status, sub_id=None):
+ """
+ After evaluation of test cases, this function sets the status
+ of the program to "ACCEPTED", "WRONG ANSWER" or some execution
+ error status.
+ """
+ pass
+
+ def set_submission_score(self, score, sub_id=None):
+ """
+ Sets the overall score for a submission.
+ """
+ pass
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/manage.py Mon Nov 22 05:53:21 2010
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+from django.core.management import execute_manager
+try:
+ import settings # Assumed to be in the same directory.
+except ImportError:
+ import sys
+ sys.stderr.write("Error: Can't find the file 'settings.py' in the
directory containing %r. It appears you've customized things.\nYou'll have
to run django-admin.py, passing it your settings module.\n(If the file
settings.py does indeed exist, it's causing an ImportError somehow.)\n" %
__file__)
+ sys.exit(1)
+
+if __name__ == "__main__":
+ execute_manager(settings)
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/models.py Mon Nov 22 05:53:21 2010
@@ -0,0 +1,154 @@
+from django.contrib import admin
+from django.db import models
+from django.contrib.auth.models import User
+from django import forms
+
+# Current Language types that are supported
+LANG_TYPES = (
+ ('c','C'),
+ ('cpp','C++'),
+ ('py','PYTHON 2.6.4'),
+ #(3,'JAVA'),
+)
+
+# Submission Statuses
+RESULT_TYPES = (
+ ('QU', 'QUEUED'),
+ ('CMP', 'COMPILING'),
+ ('CMPE', 'COMPILATION FAILURE'),
+ ('RUN', 'RUNNING'),
+ ('ACC', 'ACCEPTED'),
+ ('WA', 'WRONG ANSWER'),
+ ('TLE', 'TIME LIMIT EXCEEDED'),
+ ('OUTE', 'OUTPUT LIMIT EXCEEDED'),
+ ('SEG', 'SEGMENTATION FAULT'),
+ ('FPE', 'FLOATING POINT ERROR'),
+ ('KILL', 'KILLED'),
+ ('ABRT', 'ABORT SIGNALLED'),
+ ('RTE', 'RUN TIME ERROR'),
+ ('WTF', 'NON ZERO RETURN STATUS'),
+)
+
+# The site is organized as contests, this is a basic contest model
+# Contest has a title, a general description startTime and endTime.
+# Also if it will be publicly viewable by non admins if public is True.
+
+class Contest(models.Model):
+ title = models.CharField(max_length = 25)
+ description = models.TextField()
+ startTime = models.DateTimeField()
+ endTime = models.DateTimeField()
+ public = models.BooleanField(default = False)
+
+ def __unicode__(self):
+ return self.title
+
+# Each Contest has one or more problems. Orphan or non contest problem are
added
+# to a global contest. Each problem has a problem code, statement,
constraint
+# notes, sample input and output, time limit, memory limit, maximum score
for
+# that problem, allowed Languages for submission to that problem and a
penalty
+# for a wrong submission.
+
+class Problem(models.Model):
+
+ #Problem related metadata fields follow
+ contest = models.ForeignKey(Contest, verbose_name = 'Contest')
+ pcode = models.CharField(max_length = 25, verbose_name = 'Problem
Code')
+ penalty = models.IntegerField(verbose_name = 'Penalty')
+ is_approximate = models.BooleanField(default = False,
+ verbose_name = 'Is Approximate')
+ cust_eval = models.FileField(upload_to = "setter-bin/", blank = True,
+ default = None, verbose_name = 'Custom Evaluation executable')
+ cust_minScore = models.IntegerField(default = 0, verbose_name = "Min
Score")
+ cust_maxScore = models.IntegerField(default = 100, verbose_name = "Max
Score")
+
+ #Fields related to the display of the problem statement follow:
+ statement = models.TextField()
+ constraints = models.TextField() # Info about input constraints.
+ sampleInput = models.TextField(verbose_name = "Sample Input")
+ sampleOutput = models.TextField(verbose_name = "Sample Output")
+ scoring_info = models.TextField(verbose_name = "Scoring Information")
# Info
+ # about how the problem will be
scored.
+ tlimit = models.IntegerField(verbose_name = "Time Limit") # (in
seconds)
+ mlimit = models.IntegerField(verbose_name = "Memory Limit") # (in MiB)
+ allowedLangs = models.CommaSeparatedIntegerField(max_length=10,
+ verbose_name = "Allowed Languages")
+ source_limit = models.IntegerField(default=50,
+ verbose_name = "Max Source File Size") # The max source file size
allowed
+ # for the problem (in KiB).
+
+ def __unicode__(self):
+ return self.pcode
+
+# Each problem has several TestSet. A Test set is a set of tests a
submission
+# for that problem has to pass to get some score assigned to that TestSet.
+# Testset belongs to a problem and has a maximum score.
+
+class TestSet(models.Model):
+ problem = models.ForeignKey(Problem)
+ maxScore = models.IntegerField()
+
+ def __unicode__(self):
+ return str(self.problem) + '-' + str(self.maxScore)
+
+# Each TestSet has Testcases, which is an atomic test for a submission. It
has
+# an input and an corresponding Judge output to that.
+
+class Testcase(models.Model):
+ testSet = models.ForeignKey(TestSet)
+ input = models.TextField()
+ output = models.TextField()
+
+ def __unicode__(self):
+ return str(self.testSet)
+
+# Users can submit their solution to a problem. A submission has a result,
time
+# of submission, penalty for that submission, score for the submission,
+# submitted code and any error message that were generated for the
submission
+# during the evaluation of the submission
+class Submission(models.Model):
+ user = models.ForeignKey(User)
+ problem = models.ForeignKey(Problem)
+ result = models.CharField(max_length=4, choices=RESULT_TYPES,
default="QU")
+ time = models.DateTimeField()
+ language = models.CharField(max_length=10, choices=LANG_TYPES)
+ penalty = models.IntegerField(default=0)
+ score = models.IntegerField(default=0)
+ code = models.TextField()
+ errors = models.TextField()
+
+ def __unicode__(self):
+ return repr(self.pk)
+
+# This table logs the result of the evaluation of a submission against
+# a testcase. It is to be used in the scoring module for a submission
+# to aggregate the results of each testcase.
+class TestcaseEval(models.Model):
+ submission = models.ForeignKey(Submission)
+ testcase = models.ForeignKey(Testcase)
+ # memusage is in kilobytes
+ mem_usage = models.IntegerField(default=0)
+ # cputime is the total time in seconds (float - microsecond
+ # precision).
+ cpu_time = models.FloatField(default=0)
+ # submission score for this (submission,testcase) pair
+ score = models.IntegerField(default=0)
+ # pass/fail status
+ pass_status = models.CharField(max_length=10)
+ # submission misc info
+ misc_info = models.TextField()
+
+
+# This table logs the result of each testset.
+class TestSetEval(models.Model):
+ submission = models.ForeignKey(Submission)
+ testset = models.ForeignKey(TestSet)
+ score = models.IntegerField(default=0)
+ # TODO: some measure of aggregate CPU time for this testset
+ cpu_time = models.FloatField(default=0)
+ # TODO: some measure of aggregate memory usage for this testset
+ mem_usage = models.IntegerField(default=0)
+ # pass/fail status
+ pass_status = models.CharField(max_length=10)
+ # submission misc info
+ misc_info = models.TextField()
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/root_url.py Mon Nov 22 05:53:21 2010
@@ -0,0 +1,11 @@
+from django.conf.urls.defaults import patterns,include
+
+import settings
+
+# Remove the forward slashes !
+location_root_url = settings.BASE_URL[1:]
+
+urlpatterns = patterns('',
+ # Put the root url conf string here.
+ (r"%s" % location_root_url, include('codechecker.urls')),
+)
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/settings.py.sample Mon Nov 22 05:53:21 2010
@@ -0,0 +1,49 @@
+#Django Specific config
+TIME_ZONE = 'Asia/Kolkata'
+SITE_ID = 1
+TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.load_template_source',
+ 'django.template.loaders.app_directories.load_template_source',
+ )
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+)
+
+#Database connectivity
+#### EDIT THIS SECTION WITH YOUR DATABASE DETAILS ####
+DATABASE_ENGINE = 'mysql'
+DATABASE_NAME = ''
+DATABASE_USER = ''
+DATABASE_PASSWORD = ''
+###########################
+
+
+
+# codechecker based django config
+ROOT_URLCONF = 'codechecker.root_url'
+TEMPLATE_DIRS = (
+ '/opt/checker/templates',
+ )
+MEDIA_ROOT = '/opt/checker/media/'
+MEDIA_URL = '/media/'
+ADMIN_MEDIA_PREFIX = '/media/'
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+ 'django.contrib.admin',
+ 'codechecker.contests',
+ )
+
+# codechecker based custom config
+BASE_URL = '/site/'
+SERVERNAME = 'checker.example.com'
+
+# Debug
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/about.html Mon Nov 22 05:53:21 2010
@@ -0,0 +1,24 @@
+{% extends 'base.html' %}
+
+{% block header %}
+ <h3> About </h3>
+{% endblock %}
+{% block main_content %}
+
+ <p>
+ <a href="http://code.google.com/p/codechecker/">Codechecker</a>
+ is a Free and Open Source Online Programming Contest Judge
+ developed by <a href="http://suren.in">M
+ Surendran</a>, <a
href="http://www.google.com/profiles/112148397913728069336">Aditya
+ Manthramurthy</a> and <a
href="http://www.google.com/profiles/112622614976789698636">Krishnan
Parthasarathi</a>.
+ </p>
+ <p>
+ Want to conduct a similar contest in your college? <br>
+ Want to contribute to this FOSS project? <br>
+ Visit the project
+ page <a
href="http://code.google.com/p/codechecker">http://code.google.com/p/codechecker</a>
+ and get in touch with the developers!
+ </p>
+
+{% endblock %}
+
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/accounts/login.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,27 @@
+{% extends 'base.html' %}
+
+{% block main_content %}
+
+<h4> Please Login before you proceed! </h4>
+{% if form.errors %}
+<p>Your username and password didn't match. Please try again.</p>
+{% endif %}
+
+<form method="post" action="/site/login/">
+ <table>
+ <tr>
+ <td>{{ form.username.label_tag }}</td>
+ <td>{{ form.username }}</td>
+ </tr>
+ <tr>
+ <td>{{ form.password.label_tag }}</td>
+ <td>{{ form.password }}</td>
+ </tr>
+ </table>
+
+ <input type="submit" value="login" />
+ <input type="hidden" name="next" value="{{ next }}" />
+</form>
+
+<a href="/site/register/"> Register </a>
+{% endblock %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/accounts/password_change_done.html
Mon Nov 22 05:53:21 2010
@@ -0,0 +1,10 @@
+{% extends "base.html" %}
+
+
+{% block main_content %}
+
+<h1> Password change successful</h1>
+
+<p> Your password was changed. Return to the <a href="/site/"> Site
</a></p>
+
+{% endblock %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/accounts/password_change_form.html
Mon Nov 22 05:53:21 2010
@@ -0,0 +1,23 @@
+{% extends "base.html" %}
+
+
+{% block main_content %}
+
+<h2>Password change</h2>
+
+<p>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="/site/password_changed/" method="post">
+<table>
+{{ form.old_password.errors }}
+<tr><td><label for="id_old_password">Old password:</label></td><td>{{
form.old_password }}</td></tr>
+{{ form.new_password1.errors }}
+<tr><td><label for="id_new_password1">New password:</label></td><td>{{
form.new_password1 }}</td></tr>
+{{ form.new_password2.errors }}
+<tr><td><label for="id_new_password2">Confirm password:</label></td><td>{{
form.new_password2 }}</td></tr>
+
+<tr><td><input type="submit" value="Change my password" /></td></tr>
+</table>
+</form>
+
+{% endblock %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/accounts/pchange.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,16 @@
+{% extends 'base.html' %}
+
+{% block main_content %}
+{% if message %}
+ {{ message }}
+{% endif %}
+{% if form %}
+Hi {{ team }} Team, Please create your login password Here !
+<form method="post" action="/site/change_password_first_time/">
+<table>
+{{ form.as_table }}
+<tr> <td> <input type="submit" value="Register"/> </td> </tr>
+</table>
+</form>
+{% endif %}
+{% endblock %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/accounts/register.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,15 @@
+{% extends 'base.html' %}
+
+{% block main_content %}
+{% if message %}
+{{ message }}
+{% endif %}
+{% if form %}
+<form method="post" action="/site/register/">
+<table>
+{{ form.as_table }}
+<tr> <td> <input type="submit" value="Register"/> </td> </tr>
+</table>
+</form>
+{% endif %}
+{% endblock %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/404.html Mon Nov 22 05:53:21
2010
@@ -0,0 +1,12 @@
+{% 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 %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/500.html Mon Nov 22 05:53:21
2010
@@ -0,0 +1,12 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{%
trans "Home" %}</a> › {% 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 %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/actions.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,16 @@
+{% load i18n %}
+<div class="actions">
+ {% for field in action_form %}{% if field.label %}<label>{{
field.label }} {% endif %}{{ field }}{% if field.label %}</label>{%
endif %}{% endfor %}
+ <button type="submit" class="button" title="{% trans "Run the selected
action" %}" name="index" value="{{ action_index|default:0 }}">{%
trans "Go" %}</button>
+ {% if actions_selection_counter %}
+ <script type="text/javascript">var _actions_icnt="{{
cl.result_list|length|default:"0" }}";</script>
+ <span class="action-counter">{{ selection_note }}</span>
+ {% if cl.result_count != cl.result_list|length %}
+ <span class="all">{{ selection_note_all }}</span>
+ <span class="question">
+ <a href="javascript:;" title="{% trans "Click here to select
the objects across all pages" %}">{% blocktrans with cl.result_count as
total_count %}Select all {{ total_count }} {{ module_name }}{%
endblocktrans %}</a>
+ </span>
+ <span class="clear"><a href="javascript:;">{% trans "Clear
selection" %}</a></span>
+ {% endif %}
+ {% endif %}
+</div>
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/app_index.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,15 @@
+{% extends "admin/index.html" %}
+{% load i18n %}
+
+{% if not is_popup %}
+
+{% block breadcrumbs %}
+<div class="breadcrumbs"><a href="../">
+{% trans "Home" %}</a> ›
+{% for app in app_list %}
+{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
+{% endfor %}</div>{% endblock %}
+
+{% endif %}
+
+{% block sidebar %}{% endblock %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/auth/user/add_form.html Mon
Nov 22 05:53:21 2010
@@ -0,0 +1,14 @@
+{% extends "admin/change_form.html" %}
+{% load i18n %}
+
+{% block form_top %}
+ {% if not is_popup %}
+ <p>{% trans "First, enter a username and password. Then, you'll be
able to edit more user options." %}</p>
+ {% else %}
+ <p>{% trans "Enter a username and password." %}</p>
+ {% endif %}
+{% endblock %}
+
+{% block after_field_sets %}
+<script
type="text/javascript">document.getElementById("id_username").focus();</script>
+{% endblock %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/auth/user/change_password.html
Mon Nov 22 05:53:21 2010
@@ -0,0 +1,54 @@
+{% extends "admin/base_site.html" %}
+{% load i18n admin_modify adminmedia %}
+{% block extrahead %}{{ block.super }}
+{% url admin:jsi18n as jsi18nurl %}
+<script type="text/javascript" src="{{ jsi18nurl|
default:"../../../../jsi18n/" }}"></script>
+{% endblock %}
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet"
type="text/css" href="{% 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> ›
+ <a href="../../../">{{ opts.app_label|capfirst|escape }}</a> ›
+ <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> ›
+ <a href="../">{{ original|truncatewords:"18" }}</a> ›
+ {% trans 'Change password' %}
+</div>
+{% endif %}{% endblock %}
+{% block content %}<div id="content-main">
+<form action="{{ form_url }}" method="post" id="{{ opts.module_name
}}_form">{% csrf_token %}{% 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 %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/base.html Mon Nov 22 05:53:21
2010
@@ -0,0 +1,82 @@
+<!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 %}" />
+{% block extrastyle %}{% endblock %}
+<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block
stylesheet_ie %}{% load adminmedia %}{% admin_media_prefix %}css/ie.css{%
endblock %}" /><![endif]-->
+{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{%
block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}"
/>{% endif %}
+<script type="text/javascript">window.__admin_media_prefix__ = "{% filter
escapejs %}{% admin_media_prefix %}{% endfilter %}";</script>
+{% block extrahead %}{% endblock %}
+{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{%
endblock %}
+</head>
+{% load i18n %}
+
+<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{%
endblock %}">
+
+<!-- Container -->
+<div id="container">
+
+ {% if not is_popup %}
+ <!-- Header -->
+ <div id="header">
+ <div id="branding">
+ {% block branding %}{% endblock %}
+ </div>
+ {% if user.is_active and user.is_staff %}
+ <div id="user-tools">
+ {% trans 'Welcome,' %}
+ <strong>{% filter force_escape %}{% firstof user.first_name
user.username %}{% endfilter %}</strong>.
+ {% block userlinks %}
+ {% url django-admindocs-docroot as docsroot %}
+ {% if docsroot %}
+ <a href="{{ docsroot }}">{%
trans 'Documentation' %}</a> /
+ {% endif %}
+ {% url admin:password_change as password_change_url %}
+ {% if password_change_url %}
+ <a href="{{ password_change_url }}">
+ {% else %}
+ <a href="{{ root_path }}password_change/">
+ {% endif %}
+ {% trans 'Change password' %}</a> /
+ {% url admin:logout as logout_url %}
+ {% if logout_url %}
+ <a href="{{ logout_url }}">
+ {% else %}
+ <a href="{{ root_path }}logout/">
+ {% endif %}
+ {% 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 %} › {{ title }}{% endif %}</div>{%
endblock %}
+ {% endif %}
+
+ {% if messages %}
+ <ul class="messagelist">{% for message in messages %}
+ <li{% if message.tags %} class="{{ message.tags }}"{%
endif %}>{{ 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>
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/base_site.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,10 @@
+{% 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 %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/change_form.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,67 @@
+{% extends "admin/base_site.html" %}
+{% load i18n admin_modify adminmedia %}
+
+{% block extrahead %}{{ block.super }}
+{% url admin:jsi18n as jsi18nurl %}
+<script type="text/javascript" src="{{ jsi18nurl|
default:"../../../jsi18n/" }}"></script>
+{{ media }}
+{% endblock %}
+
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet"
type="text/css" href="{% 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> ›
+ <a href="../../">{{ app_label|capfirst|escape }}</a> ›
+ {% if has_change_permission %}<a href="../">{{
opts.verbose_name_plural|capfirst }}</a>{% else %}{{
opts.verbose_name_plural|capfirst }}{% endif %} ›
+ {% 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">{% csrf_token %}{% 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>
+ {{ adminform.form.non_field_errors }}
+{% 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 adminform and 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 %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/change_list.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,102 @@
+{% extends "admin/base_site.html" %}
+{% load adminmedia admin_list i18n %}
+
+{% block extrastyle %}
+ {{ block.super }}
+ <link rel="stylesheet" type="text/css" href="{%
admin_media_prefix %}css/changelists.css" />
+ {% if cl.formset %}
+ <link rel="stylesheet" type="text/css" href="{%
admin_media_prefix %}css/forms.css" />
+ {% endif %}
+ {% if cl.formset or action_form %}
+ {% url admin:jsi18n as jsi18nurl %}
+ <script type="text/javascript" src="{{ jsi18nurl|
default:'../../jsi18n/' }}"></script>
+ {% endif %}
+ {{ media.css }}
+ {% if not actions_on_top and not actions_on_bottom %}
+ <style>
+ #changelist table thead th:first-child {width: inherit}
+ </style>
+ {% endif %}
+{% endblock %}
+
+{% block extrahead %}
+{{ block.super }}
+{{ media.js }}
+{% if action_form %}{% if actions_on_top or actions_on_bottom %}
+<script type="text/javascript">
+(function($) {
+ $(document).ready(function($) {
+ $("tr input.action-select").actions();
+ });
+})(django.jQuery);
+</script>
+{% endif %}{% endif %}
+{% endblock %}
+
+{% block bodyclass %}change-list{% endblock %}
+
+{% if not is_popup %}
+ {% block breadcrumbs %}
+ <div class="breadcrumbs">
+ <a href="../../">
+ {% trans "Home" %}
+ </a>
+ ›
+ <a href="../">
+ {{ app_label|capfirst }}
+ </a>
+ ›
+ {{ 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 %}
+ {% if cl.formset.errors %}
+ <p class="errornote">
+ {% blocktrans count cl.formset.errors|length as counter %}Please
correct the error below.{% plural %}Please correct the errors below.{%
endblocktrans %}
+ </p>
+ {{ cl.formset.non_form_errors }}
+ {% endif %}
+ <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 %}
+
+ <form id="changelist-form" action="" method="post"{% if
cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{%
csrf_token %}
+ {% if cl.formset %}
+ {{ cl.formset.management_form }}
+ {% endif %}
+
+ {% block result_list %}
+ {% if action_form and actions_on_top and
cl.full_result_count %}{% admin_actions %}{% endif %}
+ {% result_list cl %}
+ {% if action_form and actions_on_bottom and
cl.full_result_count %}{% admin_actions %}{% endif %}
+ {% endblock %}
+ {% block pagination %}{% pagination cl %}{% endblock %}
+ </form>
+ </div>
+ </div>
+{% endblock %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/change_list_results.html Mon
Nov 22 05:53:21 2010
@@ -0,0 +1,22 @@
+{% if result_hidden_fields %}
+<div class="hiddenfields"> {# DIV for HTML validation #}
+{% for item in result_hidden_fields %}{{ item }}{% endfor %}
+</div>
+{% endif %}
+{% if results %}
+<table cellspacing="0" id="result_list">
+<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 %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/date_hierarchy.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,10 @@
+{% if show %}
+<div class="xfull">
+<ul class="toplinks">
+{% if back %}<li class="date-back"><a href="{{ back.link }}">‹ {{
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 %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/delete_confirmation.html Mon
Nov 22 05:53:21 2010
@@ -0,0 +1,32 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}
+<div class="breadcrumbs">
+ <a href="../../../../">{% trans "Home" %}</a> ›
+ <a href="../../../">{{ app_label|capfirst }}</a> ›
+ <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> ›
+ <a href="../">{{ object|truncatewords:"18" }}</a> ›
+ {% 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">{% csrf_token %}
+ <div>
+ <input type="hidden" name="post" value="yes" />
+ <input type="submit" value="{% trans "Yes, I'm sure" %}" />
+ </div>
+ </form>
+{% endif %}
+{% endblock %}
=======================================
--- /dev/null
+++
/src/checker/cc_frontend/templates/admin/delete_selected_confirmation.html
Mon Nov 22 05:53:21 2010
@@ -0,0 +1,37 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}
+<div class="breadcrumbs">
+ <a href="../../">{% trans "Home" %}</a> ›
+ <a href="../">{{ app_label|capfirst }}</a> ›
+ <a href="./">{{ opts.verbose_name_plural|capfirst }}</a> ›
+ {% trans 'Delete multiple objects' %}
+</div>
+{% endblock %}
+
+{% block content %}
+{% if perms_lacking %}
+ <p>{% blocktrans %}Deleting the {{ object_name }} 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 %}Are you sure you want to delete the selected {{
object_name }} objects? All of the following objects and their related
items will be deleted:{% endblocktrans %}</p>
+ {% for deletable_object in deletable_objects %}
+ <ul>{{ deletable_object|unordered_list }}</ul>
+ {% endfor %}
+ <form action="" method="post">{% csrf_token %}
+ <div>
+ {% for obj in queryset %}
+ <input type="hidden" name="{{ action_checkbox_name }}" value="{{
obj.pk }}" />
+ {% endfor %}
+ <input type="hidden" name="action" value="delete_selected" />
+ <input type="hidden" name="post" value="yes" />
+ <input type="submit" value="{% trans "Yes, I'm sure" %}" />
+ </div>
+ </form>
+{% endif %}
+{% endblock %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/edit_inline/stacked.html Mon
Nov 22 05:53:21 2010
@@ -0,0 +1,79 @@
+{% load i18n adminmedia %}
+<div class="inline-group" id="{{ inline_admin_formset.formset.prefix
}}-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 %} empty-form last-related{%
endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not
forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
+ <h3><b>{{ inline_admin_formset.opts.verbose_name|title
}}:</b> <span class="inline_label">{% if
inline_admin_form.original %}{{ inline_admin_form.original }}{% else %}#{{
forloop.counter }}{% endif %}</span>
+ {% 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 %}
+ {% 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.form.non_field_errors %}{{
inline_admin_form.form.non_field_errors }}{% endif %}
+ {% for fieldset in inline_admin_form %}
+ {% include "admin/includes/fieldset.html" %}
+ {% endfor %}
+ {% if inline_admin_form.has_auto_field %}{{
inline_admin_form.pk_field.field }}{% endif %}
+ {{ inline_admin_form.fk_field.field }}
+</div>{% endfor %}
+</div>
+
+<script type="text/javascript">
+(function($) {
+ $(document).ready(function() {
+ var rows = "#{{ inline_admin_formset.formset.prefix
}}-group .inline-related";
+ var updateInlineLabel = function(row) {
+ $(rows).find(".inline_label").each(function(i) {
+ var count = i + 1;
+ $(this).html($(this).html().replace(/(#\d+)/g, "#" +
count));
+ });
+ }
+ var reinitDateTimeShortCuts = function() {
+ // Reinitialize the calendar and clock widgets by force, yuck.
+ if (typeof DateTimeShortcuts != "undefined") {
+ $(".datetimeshortcuts").remove();
+ DateTimeShortcuts.init();
+ }
+ }
+ var updateSelectFilter = function() {
+ // If any SelectFilter widgets were added, instantiate a new
instance.
+ if (typeof SelectFilter != "undefined"){
+ $(".selectfilter").each(function(index, value){
+ var namearr = value.name.split('-');
+ SelectFilter.init(value.id, namearr[namearr.length-1],
false, "{% admin_media_prefix %}");
+ })
+ $(".selectfilterstacked").each(function(index, value){
+ var namearr = value.name.split('-');
+ SelectFilter.init(value.id, namearr[namearr.length-1],
true, "{% admin_media_prefix %}");
+ })
+ }
+ }
+ var initPrepopulatedFields = function(row) {
+ row.find('.prepopulated_field').each(function() {
+ var field = $(this);
+ var input = field.find('input, select, textarea');
+ var dependency_list = input.data('dependency_list') || [];
+ var dependencies =
row.find(dependency_list.join(',')).find('input, select, textarea');
+ if (dependencies.length) {
+ input.prepopulate(dependencies,
input.attr('maxlength'));
+ }
+ });
+ }
+ $(rows).formset({
+ prefix: "{{ inline_admin_formset.formset.prefix }}",
+ addText: "{% blocktrans with
inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another
{{ verbose_name }}{% endblocktrans %}",
+ formCssClass: "dynamic-{{ inline_admin_formset.formset.prefix
}}",
+ deleteCssClass: "inline-deletelink",
+ deleteText: "{% trans "Remove" %}",
+ emptyCssClass: "empty-form",
+ removed: updateInlineLabel,
+ added: (function(row) {
+ initPrepopulatedFields(row);
+ reinitDateTimeShortCuts();
+ updateSelectFilter();
+ updateInlineLabel(row);
+ })
+ });
+ });
+})(django.jQuery);
+</script>
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/edit_inline/tabular.html Mon
Nov 22 05:53:21 2010
@@ -0,0 +1,125 @@
+{% load i18n adminmedia %}
+<div class="inline-group" id="{{ inline_admin_formset.formset.prefix
}}-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.widget.is_hidden %}
+ <th{% if forloop.first %} colspan="2"{% endif %}{% if
field.required %} class="required"{% endif %}>{{ field.label|capfirst
}}</th>
+ {% endif %}
+ {% endfor %}
+ {% if inline_admin_formset.formset.can_delete %}<th>{%
trans "Delete?" %}</th>{% endif %}
+ </tr></thead>
+
+ <tbody>
+ {% 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 %}{% if forloop.last %} empty-form{% endif %}"
+ id="{{ inline_admin_formset.formset.prefix }}-{% if not
forloop.last %}{{ forloop.counter0 }}{% else %}empty{% 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 %}
+ {% if inline_admin_form.has_auto_field %}{{
inline_admin_form.pk_field.field }}{% endif %}
+ {{ 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 }}">
+ {% if field.is_readonly %}
+ <p>{{ field.contents }}</p>
+ {% else %}
+ {{ field.field.errors.as_ul }}
+ {{ field.field }}
+ {% endif %}
+ </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 %}
+ </tbody>
+ </table>
+</fieldset>
+ </div>
+</div>
+
+<script type="text/javascript">
+(function($) {
+ $(document).ready(function($) {
+ var rows = "#{{ inline_admin_formset.formset.prefix
}}-group .tabular.inline-related tbody tr";
+ var alternatingRows = function(row) {
+ $(rows).not(".add-row").removeClass("row1 row2")
+ .filter(":even").addClass("row1").end()
+ .filter(rows + ":odd").addClass("row2");
+ }
+ var reinitDateTimeShortCuts = function() {
+ // Reinitialize the calendar and clock widgets by force
+ if (typeof DateTimeShortcuts != "undefined") {
+ $(".datetimeshortcuts").remove();
+ DateTimeShortcuts.init();
+ }
+ }
+ var updateSelectFilter = function() {
+ // If any SelectFilter widgets are a part of the new form,
+ // instantiate a new SelectFilter instance for it.
+ if (typeof SelectFilter != "undefined"){
+ $(".selectfilter").each(function(index, value){
+ var namearr = value.name.split('-');
+ SelectFilter.init(value.id, namearr[namearr.length-1],
false, "{% admin_media_prefix %}");
+ })
+ $(".selectfilterstacked").each(function(index, value){
+ var namearr = value.name.split('-');
+ SelectFilter.init(value.id, namearr[namearr.length-1],
true, "{% admin_media_prefix %}");
+ })
+ }
+ }
+ var initPrepopulatedFields = function(row) {
+ row.find('.prepopulated_field').each(function() {
+ var field = $(this);
+ var input = field.find('input, select, textarea');
+ var dependency_list = input.data('dependency_list') || [];
+ var dependencies =
row.find(dependency_list.join(',')).find('input, select, textarea');
+ if (dependencies.length) {
+ input.prepopulate(dependencies,
input.attr('maxlength'));
+ }
+ });
+ }
+ $(rows).formset({
+ prefix: "{{ inline_admin_formset.formset.prefix }}",
+ addText: "{% blocktrans with
inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another
{{ verbose_name }}{% endblocktrans %}",
+ formCssClass: "dynamic-{{ inline_admin_formset.formset.prefix
}}",
+ deleteCssClass: "inline-deletelink",
+ deleteText: "{% trans "Remove" %}",
+ emptyCssClass: "empty-form",
+ removed: alternatingRows,
+ added: (function(row) {
+ initPrepopulatedFields(row);
+ reinitDateTimeShortCuts();
+ updateSelectFilter();
+ alternatingRows(row);
+ })
+ });
+ });
+})(django.jQuery);
+</script>
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/filter.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,8 @@
+{% 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>
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/includes/fieldset.html Mon Nov
22 05:53:21 2010
@@ -0,0 +1,28 @@
+<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 }}
+ {% if field.is_readonly %}
+ <p>{{ field.contents }}</p>
+ {% else %}
+ {{ field.field }}
+ {% endif %}
+ {% endif %}
+ {% if field.field.field.help_text %}
+ <p class="help">{{ field.field.field.help_text|
safe }}</p>
+ {% endif %}
+ </div>
+ {% endfor %}
+ </div>
+ {% endfor %}
+</fieldset>
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/index.html Mon Nov 22 05:53:21
2010
@@ -0,0 +1,80 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet"
type="text/css" href="{% 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> </td>
+ {% endif %}
+
+ {% if model.perms.change %}
+ <td><a href="{{ model.admin_url }}" class="changelink">{%
trans 'Change' %}</a></td>
+ {% else %}
+ <td> </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 entry.is_deletion %}
+ {{ entry.object_repr }}
+ {% else %}
+ <a href="{{ entry.get_admin_url }}">{{
entry.object_repr }}</a>
+ {% endif %}
+ <br/>
+ {% if entry.content_type %}
+ <span class="mini quiet">{% filter capfirst %}{% trans
entry.content_type.name %}{% endfilter %}</span>
+ {% else %}
+ <span class="mini quiet">{% trans 'Unknown
content' %}</span>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </div>
+</div>
+{% endblock %}
=======================================
--- /dev/null
+++ /src/checker/cc_frontend/templates/admin/invalid_setup.html Mon Nov 22
05:53:21 2010
@@ -0,0 +1,8 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{%
trans 'Home' %}</a> › {{ 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 %}
=======================================
***Additional files exist in this changeset.***
==============================================================================
Revision: b08203914c
Author: surenspost
Date: Mon Nov 22 05:54:49 2010
Log: Fixing Reorg commit #1
This is how imports are going to work from now on. And this shall work in
dev environments as well ideally.
http://code.google.com/p/codechecker/source/detail?r=b08203914c
Modified:
/src/checker/cc_backend/evaluator/eval.py
=======================================
--- /src/checker/cc_backend/evaluator/eval.py Mon Nov 22 05:53:21 2010
+++ /src/checker/cc_backend/evaluator/eval.py Mon Nov 22 05:54:49 2010
@@ -1,7 +1,7 @@
from os.path import splitext
import os
import subprocess
-import se.secexec
+import checker.cc_backend.se.secexec as secexec
class Evaluate:
def eval_submission(self, submission, test_grp, submission_exec):
"""Takes submission and test_grp and returns result_set"""
@@ -26,7 +26,7 @@
#to send the euid to use here
"--jailroot=%s" % jailroot]
args.insert(0, curdir + "/secexec")
- ret_code = se.secexec.secure_spawn(args)
+ ret_code = secexec.secure_spawn(args)
#End of executing the submission_exec
if test_grp["is_cust_scored"] == True:
#TODO: run cust_execute via secure_spawn
One Big FAT push. I have taken efforts to make things not break here,
but this re-org was required to go ahead with our plans. I have tried
to be as atomic as possible as well, but mass moves generated a lot of
diff than expected.
Myself and PK would be adding todo's and stubs here on wards and
proceed to completion of the features.
On Mon, Nov 22, 2010 at 7:31 PM, <codec...@googlecode.com> wrote:
> 11 new revisions:
--
regards
Suren
Learning < Doing
Learn By doing.