Document upload and metadata input working

This commit is contained in:
Roberto Rosario
2011-02-03 17:17:04 -04:00
parent fc6545f45a
commit 986dc5d805
77 changed files with 2851 additions and 57 deletions

13
apps/main/__init__.py Normal file
View File

@@ -0,0 +1,13 @@
from django.utils.translation import ugettext_lazy as _
from common.api import register_menu
register_menu([
{'text':_(u'home'), 'view':'home', 'famfam':'house', 'position':0},
{'text':_(u'setup'), 'view':'', 'links': [
],'famfam':'cog', 'name':'setup','position':7},
{'text':_(u'about'), 'view':'about', 'position':8},
])

3
apps/main/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

21
apps/main/templates/about.html Executable file
View File

@@ -0,0 +1,21 @@
{% extends "base.html" %}
{% load i18n %}
{% load project_tags %}
{% block title %} :: {% trans 'About this program' %}{% endblock %}
{% block content %}
<div class="content">
<h3 class="tc">
{% project_name %}<br /><br />
{% trans 'Django based document manager with custom metadata indexing and samba file serving integration' %}<br /><br />
<a href="http://www.github.com/rosarior/mayan/">http://www.github.com/rosarior/mayan/</a><br /><br />
</h3>
</div>
{% endblock %}
{% block footer %}
<div id="footer">
<div class="block">
<p>Copyright &copy; 2011 Roberto Rosario.</p>
</div>
</div>
{% endblock %}

102
apps/main/templates/base.html Executable file
View File

@@ -0,0 +1,102 @@
{% extends "web_theme_base.html" %}
{% load i18n %}
{% load project_tags %}
{% load navigation %}
{% block html_title %}{% project_name %}{% block title %}{% endblock %}{% endblock %}
{% block web_theme_project_name %}{% project_name %}{% endblock %}
{% block web_theme_stylesheets %}
<link rel="stylesheet" href="{{ MEDIA_URL }}css/override.css" type="text/css" media="screen" />
<link rel="stylesheet" href="{{ MEDIA_URL }}css/famfamfam-silk-sprite.css" type="text/css" media="screen" />
{% block stylesheets %}{% endblock %}
{% endblock %}
{% block web_theme_user_navigation %}
<li><strong>{% trans 'User' %}:</strong>
{% if user.is_anonymous %}
{% trans 'Anonymous' %}
{% else %}
{{ user }}
<a href="{% url password_change_view %}">({% trans 'New password' %})</a>
{% endif %}
</li>
{% if user.is_staff %}
<li><a href="/admin">{% trans "Admin site" %}</a></li>
{% endif %}
<li>
<form action="{% url set_language %}" method="post">{% csrf_token %}
<select name="language">
{% for lang in LANGUAGES %}
<option value="{{ lang.0 }}">{{ lang.1 }}</option>
{% endfor %}
</select>
<input type="submit" value="{% trans 'Go' %}" />
</form>
</li>
<li><a class="logout" href="{% if user.is_anonymous %}{% url login_view %}?next=/{% else %}{% url logout_view %}{% endif %}">{% if user.is_anonymous %}{% trans 'Login' %}{% else %}{% trans 'Logout' %}{% endif %}</a></li>
{% endblock %}
{% block web_theme_main_navigation %}
{% main_navigation %}
{% for link in navigation_main_links %}
<li class="{% if link.first %}first {% endif %}{% if link.active %}active{% endif %}"><a href="{{ link.url }}">{{ link.text|capfirst }}{% if link.famfam %}<span class="famfam active famfam-{{ link.famfam|default:'link' }}"></span>{% endif %}</a></li>
{% endfor %}
{% endblock %}
{% block web_theme_secondary_navigation %}
{% main_navigation %}
{% if navigation_secondary_links %}
<div class="secondary-navigation">
<ul class="wat-cf">
{% for link in navigation_secondary_links %}
<li class="{% if link.first %}first {% endif %}{% if link.active %}active{% endif %}"><a href="{{ link.url }}">{{ link.text|capfirst }}{% if link.famfam %}<span class="famfam active famfam-{{ link.famfam|default:'link' }}"></span>{% endif %}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %}
{% block web_theme_sidebar %}
{% get_object_navigation_links %}
{% if object_navigation_links %}
<div class="block">
{% if object %}
{% if object_name %}
<h3>{% blocktrans %}Actions for {{ object_name }}: {{ object }}{% endblocktrans %}</h3>
{% else %}
<h3>{% blocktrans %}Actions for: {{ object }}{% endblocktrans %}</h3>
{% endif %}
{% else %}
<h3>}{% trans 'Actions' %}</h3>
{% endif %}
<ul class="navigation">
{% with 'true' as as_li %}
{% include 'generic_navigation.html' %}
{% endwith %}
</ul>
</div>
{% endif %}
{% get_object_navigation_links "sidebar" %}
{% if object_navigation_links %}
<div class="block">
<h3>{% trans 'Other available actions' %}</h3>
<ul class="navigation">
{% with 'true' as as_li %}
{% include 'generic_navigation.html' %}
{% endwith %}
</ul>
</div>
{% endif %}
{% block sidebar %}{% endblock %}
{% endblock %}
{% block web_theme_content %}{% block content %}{% endblock %}{% endblock %}
{% block web_theme_footer %}{% block footer %}{% endblock %}{% endblock %}

16
apps/main/templates/home.html Executable file
View File

@@ -0,0 +1,16 @@
{% extends "base.html" %}
{% load project_tags %}
{% load i18n %}
{% block content %}
<div class="content">
<div class="tc"><h1>{% project_name %}</h1></div>
<div class="tc"><img src="{{ MEDIA_URL }}images/1068504_92921456.jpg" /></div>
</div>
{% endblock %}
{% block footer %}
<div id="footer">
<div class="block">
<p>Copyright &copy; 2011 Roberto Rosario.</p>
</div>
</div>
{% endblock %}

23
apps/main/tests.py Normal file
View 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
"""}

6
apps/main/urls.py Normal file
View File

@@ -0,0 +1,6 @@
from django.conf.urls.defaults import *
urlpatterns = patterns('main.views',
url(r'^$', 'home', (), 'home'),
)

6
apps/main/views.py Normal file
View File

@@ -0,0 +1,6 @@
from django.shortcuts import render_to_response
from django.template import RequestContext
def home(request):
return render_to_response('home.html', {},
context_instance=RequestContext(request))