Document upload and metadata input working
This commit is contained in:
0
apps/web_theme/__init__.py
Normal file
0
apps/web_theme/__init__.py
Normal file
0
apps/web_theme/conf/__init__.py
Normal file
0
apps/web_theme/conf/__init__.py
Normal file
7
apps/web_theme/conf/settings.py
Normal file
7
apps/web_theme/conf/settings.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from django.conf import settings
|
||||
|
||||
#Theme options are:
|
||||
#amro, bec, bec-green, blue, default, djime-cerulean, drastic-dark,
|
||||
#kathleene, olive, orange, red, reidb-greenish, warehouse
|
||||
|
||||
THEME = getattr(settings, 'WEB_THEME', 'default')
|
||||
BIN
apps/web_theme/locale/es/LC_MESSAGES/django.mo
Normal file
BIN
apps/web_theme/locale/es/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
24
apps/web_theme/locale/es/LC_MESSAGES/django.po
Normal file
24
apps/web_theme/locale/es/LC_MESSAGES/django.po
Normal file
@@ -0,0 +1,24 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-28 09:43-0400\n"
|
||||
"PO-Revision-Date: 2011-01-28 09:43\n"
|
||||
"Last-Translator: <admin@admin.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: \n"
|
||||
"X-Translated-Using: django-rosetta 0.5.6\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: templates/web_theme_login.html:3 templates/web_theme_login.html.py:8
|
||||
msgid "Login"
|
||||
msgstr "Iniciar sesión"
|
||||
BIN
apps/web_theme/locale/ru/LC_MESSAGES/django.mo
Normal file
BIN
apps/web_theme/locale/ru/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
24
apps/web_theme/locale/ru/LC_MESSAGES/django.po
Normal file
24
apps/web_theme/locale/ru/LC_MESSAGES/django.po
Normal file
@@ -0,0 +1,24 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-30 16:51+0300\n"
|
||||
"PO-Revision-Date: 2011-01-30 13:12\n"
|
||||
"Last-Translator: <garison2004@gmail.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: \n"
|
||||
"X-Translated-Using: django-rosetta 0.5.5\n"
|
||||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
|
||||
#: templates/web_theme_login.html:3 templates/web_theme_login.html.py:8
|
||||
msgid "Login"
|
||||
msgstr "Пользователь"
|
||||
1
apps/web_theme/media
Submodule
1
apps/web_theme/media
Submodule
Submodule apps/web_theme/media added at c4159791f9
3
apps/web_theme/models.py
Normal file
3
apps/web_theme/models.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
33
apps/web_theme/templates/pagination/pagination.html
Normal file
33
apps/web_theme/templates/pagination/pagination.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{% if is_paginated %}
|
||||
{% load i18n %}
|
||||
<div class="actions-bar wat-cf">
|
||||
<div class="pagination">
|
||||
{% if page_obj.has_previous %}
|
||||
<a class="prev_page" href="?page={{ page_obj.previous_page_number }}{{ getvars }}">‹‹ {% trans "Previous" %}</a>
|
||||
{% else %}
|
||||
<span class="disabled prev_page">‹‹ {% trans "Previous" %}</span>
|
||||
{% endif %}
|
||||
|
||||
{% for page in pages %}
|
||||
|
||||
{% if page %}
|
||||
|
||||
{% ifequal page page_obj.number %}
|
||||
<span class='current'>{{ page }}</span>
|
||||
{% else %}
|
||||
<a href="?page={{ page }}{{ getvars }}{{ hashtag }}">{{ page }}</a>
|
||||
{% endifequal %}
|
||||
{% else %}
|
||||
<span class="disabled">...</span>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% if page_obj.has_next %}
|
||||
<a class="next_page" href="?page={{ page_obj.next_page_number }}{{ getvars }}">{% trans "Next" %} ››</a>
|
||||
{% else %}
|
||||
<span class='disabled next-page'>{% trans "Next" %} ››</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
72
apps/web_theme/templates/web_theme_base.html
Normal file
72
apps/web_theme/templates/web_theme_base.html
Normal file
@@ -0,0 +1,72 @@
|
||||
{% load i18n %}
|
||||
{% load theme_tags %}
|
||||
{% get_theme as web_theme %}
|
||||
<!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">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Content-Language" content="{{ LANGUAGE_CODE }}" />
|
||||
|
||||
<title>{% block html_title %}{% endblock %}</title>
|
||||
|
||||
{% block keywords %}{% endblock %}
|
||||
|
||||
<link rel="stylesheet" href="{{ MEDIA_URL }}web_theme_media/stylesheets/base.css" type="text/css" media="screen" />
|
||||
<link rel="stylesheet" id="current-theme" href="{{ MEDIA_URL }}web_theme_media/stylesheets/themes/{{ web_theme }}/style.css" type="text/css" media="screen" />
|
||||
{% block web_theme_stylesheets %}{% endblock %}
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="{{ MEDIA_URL }}web_theme_media/javascripts/jquery-1.3.min.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="{{ MEDIA_URL }}web_theme_media/javascripts/jquery.scrollTo.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="{{ MEDIA_URL }}web_theme_media/javascripts/jquery.localscroll.js"></script>
|
||||
{% block web_theme_javascript %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
{% if user.is_anonymous %}
|
||||
<div id="box">
|
||||
{% block content_plain %}{% endblock %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not user.is_anonymous %}
|
||||
<div id="header">
|
||||
<h1><a href="{% url home %}">{% block web_theme_project_name %}{% endblock %}</a></h1>
|
||||
<div id="user-navigation">
|
||||
<ul class="wat-cf">
|
||||
{% block web_theme_user_navigation %}{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
<div id="main-navigation">
|
||||
<ul class="wat-cf">
|
||||
{% block web_theme_main_navigation %}{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="wrapper" class="wat-cf">
|
||||
<div id="main">
|
||||
<div class="block" id="block-text">
|
||||
{% block web_theme_secondary_navigation %}{% endblock %}
|
||||
{% if messages %}
|
||||
<div class="inner">
|
||||
<div class="flash">
|
||||
{% for message in messages %}
|
||||
<div class="message{% if message.tags %}{% if 'success' in message.tags %} notice{% endif %} {{ message.tags }}{% else %} notice{% endif %}">
|
||||
<p onclick="$(this).parent().parent().fadeOut(); return false;">{{ message }}</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block web_theme_messages %}{% endblock %}
|
||||
{% block web_theme_content %}{% endblock %}
|
||||
</div>
|
||||
{% block web_theme_footer %}{% endblock %}
|
||||
</div>
|
||||
<div id="sidebar">
|
||||
{% block web_theme_sidebar %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
23
apps/web_theme/templates/web_theme_login.html
Normal file
23
apps/web_theme/templates/web_theme_login.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends "web_theme_base.html" %}
|
||||
{% load i18n %}
|
||||
{% block html_title %}{% trans "Login" %}{% endblock %}
|
||||
{% block content_plain %}
|
||||
<div id="box">
|
||||
<h1>{% block project_name %}{% endblock %}</h1>
|
||||
<div class="block" id="block-login">
|
||||
<h2>{% trans "Login" %}</h2>
|
||||
<div class="content login">
|
||||
<form action="." method="post" class="form login">{% csrf_token %}
|
||||
<div class="group wat-cf">
|
||||
{% include "generic_form_instance.html" %}
|
||||
<input type="hidden" name="next" value="{{ next|escape }}" />
|
||||
<div class="group navform wat-cf">
|
||||
<button class="button" type="submit">
|
||||
<img src="{{ MEDIA_URL }}web_theme_media/images/icons/key.png" alt="Save" /> Login
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
0
apps/web_theme/templatetags/__init__.py
Normal file
0
apps/web_theme/templatetags/__init__.py
Normal file
32
apps/web_theme/templatetags/styling.py
Normal file
32
apps/web_theme/templatetags/styling.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from django import forms
|
||||
from django.template import TemplateSyntaxError, Library, \
|
||||
VariableDoesNotExist, Node, Variable
|
||||
from django.conf import settings
|
||||
|
||||
register = Library()
|
||||
|
||||
|
||||
class StylingNode(Node):
|
||||
def __init__(self, form_name, *args, **kwargs):
|
||||
self.form_name = form_name
|
||||
|
||||
def render(self, context):
|
||||
form = Variable(self.form_name).resolve(context)
|
||||
for field_name, field in form.fields.items():
|
||||
|
||||
if isinstance(field.widget, forms.widgets.TextInput):
|
||||
field.widget.attrs['class'] = 'text_field'
|
||||
elif isinstance(field.widget, forms.widgets.PasswordInput):
|
||||
field.widget.attrs['class'] = 'text_field'
|
||||
elif isinstance(field.widget, forms.widgets.Textarea):
|
||||
field.widget.attrs['class'] = 'text_area'
|
||||
|
||||
context[self.form_name] = form
|
||||
return ''
|
||||
|
||||
|
||||
|
||||
@register.tag
|
||||
def add_classes_to_form(parser, token):
|
||||
args = token.split_contents()
|
||||
return StylingNode(args[1])
|
||||
44
apps/web_theme/templatetags/theme_tags.py
Normal file
44
apps/web_theme/templatetags/theme_tags.py
Normal file
@@ -0,0 +1,44 @@
|
||||
import types
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse, NoReverseMatch
|
||||
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern, Resolver404, get_resolver
|
||||
from django.template import TemplateSyntaxError, Library, \
|
||||
VariableDoesNotExist, Node, Variable
|
||||
from django.utils.text import unescape_string_literal
|
||||
|
||||
#from common.api import object_navigation
|
||||
from web_theme.conf import settings as web_theme_settings
|
||||
|
||||
register = Library()
|
||||
|
||||
|
||||
class GetThemeNode(Node):
|
||||
def __init__(self, var_name, *args):
|
||||
self.var_name = var_name
|
||||
|
||||
def render(self, context):
|
||||
context['web_theme'] = web_theme_settings.THEME
|
||||
return ''
|
||||
|
||||
|
||||
import re
|
||||
|
||||
@register.tag
|
||||
def get_theme(parser, token):
|
||||
try:
|
||||
# Splitting by None == splitting by spaces.
|
||||
tag_name, arg = token.contents.split(None, 1)
|
||||
except ValueError:
|
||||
raise template.TemplateSyntaxError, "%r tag requires arguments" % token.contents.split()[0]
|
||||
|
||||
#m = re.search(r'(.*?) as (\w+)', arg)
|
||||
m = re.search(r'as (\w+)', arg)
|
||||
if not m:
|
||||
raise template.TemplateSyntaxError, "%r tag had invalid arguments" % tag_name
|
||||
#format_string, var_name = m.groups()
|
||||
var_name = m.groups()
|
||||
|
||||
#if not (format_string[0] == format_string[-1] and format_string[0] in ('"', "'")):
|
||||
# raise template.TemplateSyntaxError, "%r tag's argument should be in quotes" % tag_name
|
||||
return GetThemeNode(var_name)
|
||||
23
apps/web_theme/tests.py
Normal file
23
apps/web_theme/tests.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
This file demonstrates two different styles of tests (one doctest and one
|
||||
unittest). These will both pass when you run "manage.py test".
|
||||
|
||||
Replace these with more appropriate tests for your application.
|
||||
"""
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
class SimpleTest(TestCase):
|
||||
def test_basic_addition(self):
|
||||
"""
|
||||
Tests that 1 + 1 always equals 2.
|
||||
"""
|
||||
self.failUnlessEqual(1 + 1, 2)
|
||||
|
||||
__test__ = {"doctest": """
|
||||
Another way to test that 1 + 1 is equal to 2.
|
||||
|
||||
>>> 1 + 1 == 2
|
||||
True
|
||||
"""}
|
||||
|
||||
1
apps/web_theme/views.py
Normal file
1
apps/web_theme/views.py
Normal file
@@ -0,0 +1 @@
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user