Free and open source ticket system written in python

๐Ÿ‘Œ IMPROVE: Update translations and placeholders in ticketing templates and forms

+24 -12
+1 -1
paw/__init__.py
··· 1 1 from django import get_version 2 2 3 - VERSION = (0, 1, 0, "beta", 6) 3 + VERSION = (0, 1, 0, "beta", 7) 4 4 5 5 __version__ = get_version(VERSION)
+7 -7
paw/templates/ticketing/ticket_detail.html
··· 41 41 <div class="form-control w-full max-w-xs"> 42 42 {{ template_form.template_select }} 43 43 </div> 44 - <button type="submit" name="apply_template" class="btn btn-sm btn-success ml-2">Apply Template</button> 44 + <button type="submit" name="apply_template" class="btn btn-sm btn-success ml-2">{% trans 'Apply Template' %}</button> 45 45 </div> 46 46 </form> 47 47 {% endif %} ··· 57 57 {% if request.user.is_staff %} 58 58 <div class="form-control w-52 mr-4"> 59 59 <label for="{{ form.hidden_from_client.id_for_label }}" class="cursor-pointer label"> 60 - <span class="label-text">Hidden from client</span> 60 + <span class="label-text">{% trans 'Hidden from client' %}</span> 61 61 {{ form.hidden_from_client }} 62 62 </label> 63 63 </div> ··· 123 123 {% if ticket.category %} 124 124 {{ ticket.category.name }} 125 125 {% else %} 126 - <span class="italic">{% trans 'Unassigned' %}</span> 126 + <span>{% trans 'General' %}</span> 127 127 {% endif %} 128 128 </div> 129 129 {% if request.user.is_staff %} ··· 132 132 <h2 class="font-semibold text-xs mb-2">{% trans 'Assign to new category' %}</h2> 133 133 <div class="flex justify-end items-center mb-2"> 134 134 {{ category_assignment_form.category_select }} 135 - <button type="submit" name="assign_to_category" class="btn btn-sm btn-neutral ml-2">Assign</button> 135 + <button type="submit" name="assign_to_category" class="btn btn-sm btn-neutral ml-2">{% trans 'Assign' %}</button> 136 136 </div> 137 137 </form> 138 138 {% endif %} 139 139 <div class="divider"></div> 140 - <h2 class="font-semibold mb-4">Assignees</h2> 140 + <h2 class="font-semibold mb-4">{% trans 'Assignees' %}</h2> 141 141 <div class="text-neutral flex items-center text-sm mb-4"> 142 142 <svg xmlns="http://www.w3.org/2000/svg" class="mr-2 w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0" /><path d="M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2" /></svg> 143 143 {% include 'partials/assigned_to.html' with assigned_to=ticket.assigned_to %} ··· 159 159 {% if request.user.is_staff %} 160 160 <form action="" method="post"> 161 161 {% csrf_token %} 162 - <h2 class="font-semibold text-xs mb-2">Assign to new team</h2> 162 + <h2 class="font-semibold text-xs mb-2">{% trans 'Assign to new team' %}</h2> 163 163 <div class="flex justify-end items-center mb-2"> 164 164 {{ team_assignment_form.team_select }} 165 - <button type="submit" name="assign_to_team" class="btn btn-sm btn-neutral ml-2">Assign</button> 165 + <button type="submit" name="assign_to_team" class="btn btn-sm btn-neutral ml-2">{% trans 'Assign' %}</button> 166 166 </div> 167 167 </form> 168 168 {% endif %}
+9 -1
paw/templates/ticketing/tickets.html
··· 34 34 <td> 35 35 {% include 'partials/assigned_to.html' with assigned_to=ticket.assigned_to %} 36 36 </td> 37 - <td><div class="badge badge-neutral">{{ ticket.category }}</div></td> 37 + <td> 38 + <div class="badge badge-neutral"> 39 + {% if ticket.category %} 40 + {{ ticket.category }} 41 + {% else %} 42 + {% trans 'General' %} 43 + {% endif %} 44 + </div> 45 + </td> 38 46 <td class="w-48"> 39 47 {% include 'partials/ticket_status_badge.html' with ticket=ticket %} 40 48 </td>
+7 -3
ticketing/forms.py
··· 15 15 model = Ticket 16 16 fields = ['title', 'description', 'category'] 17 17 widgets = { 18 - 'title': forms.TextInput(attrs={'class': 'input input-bordered w-full'}), 19 - 'description': forms.Textarea(attrs={'class': 'textarea textarea-bordered h-32 w-full'}), 18 + 'title': forms.TextInput(attrs={'class': 'input input-bordered w-full', 'placeholder': _('Please enter a title'), 'aria-label': _('Title')}), 19 + 'description': forms.Textarea(attrs={'class': 'textarea textarea-bordered h-32 w-full', 'placeholder': _('Please describe your issue'), 'aria-label': _('Description')}), 20 20 'category': forms.Select(attrs={'class': 'select select-bordered w-full'}), 21 21 } 22 + 23 + def __init__(self, *args, **kwargs): 24 + super(TicketForm, self).__init__(*args, **kwargs) 25 + self.fields['category'].empty_label = _('General') 22 26 23 27 24 28 class TemplateForm(forms.Form): ··· 33 37 34 38 35 39 class CategoryAssignmentForm(forms.Form): 36 - category_select = forms.ModelChoiceField(queryset=Category.objects.all(), empty_label=_('No Category'), required=False, widget=forms.Select( 40 + category_select = forms.ModelChoiceField(queryset=Category.objects.all(), empty_label=_('General'), required=False, widget=forms.Select( 37 41 attrs={'class': 'select select-bordered select-sm w-full'}))