@ -68,7 +68,7 @@
|
||||
</thead>
|
||||
<tr>
|
||||
{% for version in software_versions %}
|
||||
<td>{{ version.name }}</td>
|
||||
<td><a href="{% url 'ITAM:_software_version_view' software_id=software.id pk=version.id %}">{{ version.name }}</a></td>
|
||||
<td>{% include 'icons/issue_link.html.j2' with issue=2 %}</td>
|
||||
<td>{% include 'icons/issue_link.html.j2' with issue=3 %}</td>
|
||||
<td> </td>
|
||||
|
||||
@ -21,6 +21,7 @@ urlpatterns = [
|
||||
path("software/<int:pk>/", software.View.as_view(), name="_software_view"),
|
||||
path("software/<int:pk>/delete", software.Delete.as_view(), name="_software_delete"),
|
||||
path("software/<int:pk>/version/add", software_version.Add.as_view(), name="_software_version_add"),
|
||||
path("software/<int:software_id>/version/<int:pk>", software_version.View.as_view(), name="_software_version_view"),
|
||||
path("software/add/", software.Add.as_view(), name="_software_add"),
|
||||
|
||||
path("software_category/add/", software_category.Add.as_view(), name="_software_category_add"),
|
||||
|
||||
@ -6,6 +6,29 @@ from access.mixin import OrganizationPermission
|
||||
from ..models.software import Software, SoftwareVersion
|
||||
|
||||
|
||||
class View(OrganizationPermission, generic.UpdateView):
|
||||
model = SoftwareVersion
|
||||
permission_required = [
|
||||
'itam.view_softwareversion'
|
||||
]
|
||||
template_name = 'form.html.j2'
|
||||
|
||||
fields = [
|
||||
"name",
|
||||
]
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
context['content_title'] = self.object.name
|
||||
|
||||
return context
|
||||
|
||||
def get_success_url(self, **kwargs):
|
||||
|
||||
return f"/itam/software/{self.kwargs['software_id']}/"
|
||||
|
||||
|
||||
|
||||
class Add(PermissionRequiredMixin, OrganizationPermission, generic.CreateView):
|
||||
model = SoftwareVersion
|
||||
|
||||
Reference in New Issue
Block a user