From 317f3bdb23607f73853f745448071e6da3bb9a92 Mon Sep 17 00:00:00 2001 From: Zambom Date: Thu, 29 Dec 2016 11:38:17 -0200 Subject: [PATCH] Cleaning users app --- users/templates/users/search.html | 146 -------------------------------------------------------------------------------------------------------------------------------------------------- users/templates/users/view.html | 36 ------------------------------------ users/views.py | 76 ---------------------------------------------------------------------------- 3 files changed, 0 insertions(+), 258 deletions(-) delete mode 100644 users/templates/users/search.html delete mode 100644 users/templates/users/view.html diff --git a/users/templates/users/search.html b/users/templates/users/search.html deleted file mode 100644 index 6243c6b..0000000 --- a/users/templates/users/search.html +++ /dev/null @@ -1,146 +0,0 @@ -{% extends 'home.html' %} - -{% load i18n pagination django_bootstrap_breadcrumbs permission_tags static %} -{% block javascript %} - - - - - - -{% endblock %} - -{% block breadcrumbs %} - {{ block.super }} - {% breadcrumb search 'users:search' %} -{% endblock %} - - -{% block content %} -
-

Search Result:

{{qtd}} items found - -{% if link_list %} -
-
-
-

- Links -

-
- -
-
-{% endif%} - -{% if file_list %} -
-
-
-

- File -

-
-
-
- - {% for file in file_list %} -
  • {{ file.file_type.icon }} {{ file.name }}
  • - {% endfor%} - - -
    - -
    -
    - - -
    -
    -
    -{% endif %} - -{% if forum_list %} -
    -
    -
    -

    - Forum -

    -
    -
    -
    - {% for forum in forum_list %} -
  • {{ forum }}
  • - {% endfor %} - -
    - -
    -
    -
    -{% endif %} - -{% if exam_list %} -
    -
    -
    -

    - Exam -

    -
    -
    -
    - {% for exam in exam_list %} - {{exam.name}} - {% endfor %} - -
    - -
    -
    -
    -{% endif %} - -{% if poll_list %} -
    -
    -
    -

    - Poll -

    -
    -
    -
    - - {% for poll in poll_list %} -
  • {% trans 'poll' %} {{ poll.name }}
  • - {% endfor %} - - -
    -
    -
    -
    -{% endif %} -
    - - - - -{% endblock %} diff --git a/users/templates/users/view.html b/users/templates/users/view.html deleted file mode 100644 index 6c9b6f7..0000000 --- a/users/templates/users/view.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends 'users/profile.html' %} - -{% load static i18n %} - -{% block breadcrumbs %} - -{% endblock %} - -{% block content %} -
    -
    - -
    -
    -

    {{ acc }}

    - {% if acc.type_profile %}{{ acc.get_type_profile_display }}{% else %} {% trans 'Administrator' %} {% endif %} - {{ acc.get_gender_display }} - {{ acc.city }} / {{ acc.state }} -

    - {% trans 'Mail:' %} {{ acc.email }} -

    -

    - {% trans 'Phone:' %} {{ acc.phone }} -

    -

    - {% trans 'Cpf:' %} {{ acc.cpf }} -

    -

    - {% trans 'Birth date:' %} {{ acc.birth_date }} -

    -
    -
    -{% endblock %} diff --git a/users/views.py b/users/views.py index 5373f35..b66a43c 100644 --- a/users/views.py +++ b/users/views.py @@ -1,13 +1,10 @@ from django.shortcuts import get_object_or_404,redirect, render from django.views import generic from django.contrib import messages -from rolepermissions.mixins import HasRoleMixin from django.contrib.auth import authenticate, login as login_user from django.contrib.auth.mixins import LoginRequiredMixin from django.core.urlresolvers import reverse, reverse_lazy from django.utils.translation import ugettext_lazy as _ -from rolepermissions.shortcuts import assign_role -from rolepermissions.verifications import has_role from .models import User from .forms import RegisterUserForm, ProfileForm, UserForm, ChangePassForm, PassResetRequest, SetPasswordForm @@ -26,79 +23,6 @@ from .serializers import UserSerializer from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly # ================ ADMIN ======================= - -# class View(LoginRequiredMixin, generic.DetailView): - -# #login_url = reverse_lazy("core:home") -# redirect_field_name = 'next' -# model = User -# context_object_name = 'acc' -# template_name = 'users/view.html' -# slug_field = 'username' -# slug_url_kwarg = 'username' - -# def get_context_data (self, **kwargs): -# context = super(View, self).get_context_data(**kwargs) -# context['title'] = "User" -# return context - -# def delete_user(request,username): -# user = get_object_or_404(User,username = username) -# user.delete() -# messages.success(request,_("User deleted Successfully!")) -# return redirect('users:manage') - -# def remove_account(request,username): -# user = get_object_or_404(User,username = username) -# user.delete() -# messages.success(request,_("User deleted Successfully!")) -# #return redirect('core:logout') - -# class Change_password(generic.TemplateView): -# template_name = 'users/change_password.html' - -# def get_context_data (self, **kwargs): -# context = super(Change_password, self).get_context_data(**kwargs) -# context['title'] = "Change Password" -# return context - -# class Remove_account(generic.TemplateView): -# template_name = 'users/remove_account.html' - -# def get_context_data (self, **kwargs): -# context = super(Remove_account, self).get_context_data(**kwargs) -# context['title'] = "Remove Account" -# return context - - - -# class DeleteUser(LoginRequiredMixin, generic.edit.DeleteView): -# allowed_roles = ['student'] -# #login_url = reverse_lazy("core:home") -# model = User - -# #success_url = reverse_lazy('core:index') -# success_message = "Deleted Successfully" - -# def get_queryset(self): -# user = get_object_or_404(User, username = self.request.user.username) -# return user - -# class SearchView(LoginRequiredMixin, generic.ListView): - -# #login_url = reverse_lazy("core:home") -# redirect_field_name = 'next' -# queryset = None -# template_name = 'users/search.html' -# paginate_by = 10 - -# def get_context_data(self, **kwargs): -# context = super(SearchView, self).get_context_data(**kwargs) -# search = self.request.GET.get('search', None) - - -# return context - class UsersListView(LoginRequiredMixin, generic.ListView): login_url = reverse_lazy("users:login") redirect_field_name = 'next' -- libgit2 0.21.2