Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #231 from WycliffeAssociates/event-update
Browse files Browse the repository at this point in the history
Event update
  • Loading branch information
vleong2332 committed Oct 14, 2015
2 parents 03b8ccd + 5011a19 commit ecb265e
Show file tree
Hide file tree
Showing 13 changed files with 651 additions and 61 deletions.
41 changes: 41 additions & 0 deletions td/templates/resources/_project_detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<table class="table">
<tbody>
{% if data %}

<tr>
<th>Translation Project</th>
<td>
{% if user.is_authenticated %}
<a class="btn btn-primary btn-xs" href="{% url "tracking:charter_update" charter.id %}">Edit</a>
{% else %}
<i class="fa fa-check"></i>
{% endif %}
</td>
</tr>
<tr><th>Start Date</th><td>{{ data.start_date }}</td></tr>
<tr><th>Completion Date</th><td>{{ data.end_date }}</td></tr>

{% if user.is_authenticated %}
<tr><th>Lead Department</th><td>{{ data.lead_dept }}</td></tr>
<tr><th>Contact Person</th><td>{{ data.contact_person }}</td></tr>
<tr><th>Accounting Number</th><td>{{ data.number }}</td></tr>
<tr><th>Created At</th><td>{{ data.created_at }}</td></tr>
<tr><th>Created By</th><td>{{ data.created_by }}</td></tr>
{% endif %}

{% else %}

<tr>
<th>Translation Project</th>
<td>
{% if user.is_authenticated %}
<a class="btn btn-primary btn-xs" href="{% url "tracking:charter_add" %}">Add</a>
{% else %}
<span>Not Started</span>
{% endif %}
</td>
</tr>

{% endif %}
</tbody>
</table>
67 changes: 46 additions & 21 deletions td/templates/resources/language_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

{% load humanize %}


{% block body %}

{% include "resources/_breadcrumbs.html" with region=country.region %}
Expand All @@ -18,21 +19,46 @@ <h1>
<div class="col-md-6">
<table class="table">
<tbody>
<!-- NOTE: Isn't language name redundant here? -->
<tr><th>Language</th><td>{{ language.name }}</td></tr>
<tr><th>Direction</th><td><span class="label label-default">{{ language.get_direction_display }}</span></td></tr>
<tr><th>Code</th><td>{{ language.code }}</td></tr>
<tr><th>ISO 639-3</th><td>{{ language.iso_639_3 }}</td></tr>
<tr><th>Direction</th><td><span class="label label-default">{{ language.get_direction_display }}</span></td></tr>
<tr><th>Gateway Language</th><td>{{ language.gateway_language }}</td></tr>
<!-- NOTE: Isn't gateway flag redundant here, since it is implied by the gateway language info above? -->
<tr><th>Gateway Flag</th><td>{% if language.gateway_flag %}<i class="fa fa-check"></i>{% else %}<i class="fa fa-remove"></i>{% endif %} </td></tr>
<tr><th># of Native Speakers</th><td>{{ language.native_speakers|default:""|intcomma }}</td></tr>
</tbody>
</table>
</div>
<div class="col-md-6">
{% include "resources/_short_list.html" with title="Networks Translating" data=language.networks_translating.all %}
<!-- NOTE: Include _project_detail.html instead that can also display "Networks Translating" info -->
<!-- {% include "resources/_short_list.html" with title="Networks Translating" data=language.networks_translating.all %} -->
{% include "resources/_project_detail.html" with data=charter %}
</div>
</div>

{% if user.is_authenticated %}
{% if events.count %}
<div class="panel panel-default">
<div class="panel-heading"><h1 class="panel-title">Translation Events/Workshops</h1></div>
<table class="table table-bordered" data-source="{% url "tracking:ajax_charter_events" charter.pk %}">
<thead>
<tr>
<th>Number</th>
<th>Location</th>
<th>Start Date</th>
<th>End Date</th>
<th>Lead Department</th>
<th>Contact Person</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
{% endif %}
{% endif %}

<div class="panel panel-default">
<div class="panel-heading">
Expand Down Expand Up @@ -63,25 +89,24 @@ <h2 class="panel-title">Resources</h2>
</table>
</div>
{% if language.gateway_to.count %}
<div class="panel panel-default">
<div class="panel-heading"><h1 class="panel-title">Gateway To:</h1></div>
<table class="table table-bordered" data-source="{% url "ajax_ds_uw_languages_gateway" language.pk %}">
<thead>
<tr>
<th>Code</th>
<th>ISO-639-3</th>
<th>Name</th>
<th>Direction</th>
<th>Country</th>
<th># Native Speakers</th>
<th>Gateway Flag</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h1 class="panel-title">Gateway To:</h1></div>
<table class="table table-bordered" data-source="{% url "ajax_ds_uw_languages_gateway" language.pk %}">
<thead>
<tr>
<th>Code</th>
<th>ISO-639-3</th>
<th>Name</th>
<th>Direction</th>
<th>Country</th>
<th># Native Speakers</th>
<th>Gateway Flag</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
{% endif %}


{% endblock %}
6 changes: 5 additions & 1 deletion td/tracking/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
Facilitator,
Hardware,
Material,
Output,
Publication,
Software,
Translator,
TranslationMethod,
Expand All @@ -28,7 +30,7 @@ class EventAdmin(admin.ModelAdmin):
("General Info", {"fields": (("charter", "number"), "location", ("start_date", "end_date"), "lead_dept", "contact_person")}),
("Parties Involved", {"fields": ["translators", "facilitators", "departments", "networks"]}),
("Resources", {"fields": ["software", "hardware", "translation_methods", "materials"]}),
(None, {"fields": ["output_target", "publishing_process"]}),
(None, {"fields": ["output_target", "publication", "current_check_level", "target_check_level"]}),
("Submission Info", {"fields": ["created_at", "created_by"]}),
]
list_display = ("charter", "number", "location", "start_date", "end_date", "contact_person")
Expand All @@ -43,3 +45,5 @@ class EventAdmin(admin.ModelAdmin):
admin.site.register(TranslationMethod)
admin.site.register(Software)
admin.site.register(Hardware)
admin.site.register(Output)
admin.site.register(Publication)
4 changes: 4 additions & 0 deletions td/tracking/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
Department,
Event,
Hardware,
Output,
Publication,
TranslationMethod,
Software,
)
Expand Down Expand Up @@ -97,6 +99,8 @@ def __init__(self, pk="-1", *args, **kwargs):
self.fields["hardware"].queryset = Hardware.objects.order_by("name")
self.fields["software"].queryset = Software.objects.order_by("name")
self.fields["translation_methods"].queryset = TranslationMethod.objects.order_by("name")
self.fields["output_target"].queryset = Output.objects.order_by("name")
self.fields["publication"].queryset = Publication.objects.order_by("name")
self.fields["charter"] = forms.CharField(
widget=forms.TextInput(
attrs={
Expand Down
24 changes: 24 additions & 0 deletions td/tracking/migrations/0018_auto_20151001_1715.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('tracking', '0017_auto_20151001_1432'),
]

operations = [
migrations.AddField(
model_name='event',
name='current_check_level',
field=models.SlugField(choices=[(b'1', b'1'), (b'2', b'2'), (b'3', b'3')], blank=True, null=True, verbose_name=b'Current Checking Level'),
),
migrations.AddField(
model_name='event',
name='target_check_level',
field=models.SlugField(choices=[(b'1', b'1'), (b'2', b'2'), (b'3', b'3')], blank=True, null=True, verbose_name=b'Anticipated Checking Level'),
),
]
46 changes: 46 additions & 0 deletions td/tracking/migrations/0019_auto_20151002_1928.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('tracking', '0018_auto_20151001_1715'),
]

operations = [
migrations.CreateModel(
name='Output',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=200)),
],
),
migrations.CreateModel(
name='Publication',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=200)),
],
),
migrations.RemoveField(
model_name='event',
name='publishing_process',
),
migrations.RemoveField(
model_name='event',
name='output_target',
),
migrations.AddField(
model_name='event',
name='publication',
field=models.ManyToManyField(to='tracking.Publication', verbose_name=b'Publishing Medium', blank=True),
),
migrations.AddField(
model_name='event',
name='output_target',
field=models.ManyToManyField(to='tracking.Output', verbose_name=b'Output Target', blank=True),
),
]

0 comments on commit ecb265e

Please sign in to comment.