Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
panikdb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
panikdb
Commits
8c0c3ec6
Commit
8c0c3ec6
authored
Sep 30, 2016
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add phone and mobile fields to users
parent
25e7bd0b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
0 deletions
+62
-0
panikdb/aa/admin.py
panikdb/aa/admin.py
+1
-0
panikdb/aa/migrations/0003_auto_20160930_1258.py
panikdb/aa/migrations/0003_auto_20160930_1258.py
+30
-0
panikdb/aa/models.py
panikdb/aa/models.py
+15
-0
panikdb/static/css/style.css
panikdb/static/css/style.css
+16
-0
No files found.
panikdb/aa/admin.py
View file @
8c0c3ec6
...
...
@@ -10,6 +10,7 @@ class UserAdmin(django.contrib.auth.admin.UserAdmin):
fieldsets
=
(
(
None
,
{
'fields'
:
(
'username'
,
'password'
)}),
(
_
(
'Personal info'
),
{
'fields'
:
(
'first_name'
,
'last_name'
,
'email'
,
'phone'
,
'mobile'
,
'emissions'
,
'news_categories'
)}),
(
_
(
'Permissions'
),
{
'fields'
:
(
'is_active'
,
'is_staff'
,
'is_superuser'
,
'groups'
,
'user_permissions'
)}),
...
...
panikdb/aa/migrations/0003_auto_20160930_1258.py
0 → 100644
View file @
8c0c3ec6
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
models
,
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'aa'
,
'0002_auto_20150125_1431'
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
'user'
,
options
=
{
'ordering'
:
[
'first_name'
,
'last_name'
]},
),
migrations
.
AddField
(
model_name
=
'user'
,
name
=
'mobile'
,
field
=
models
.
CharField
(
max_length
=
20
,
null
=
True
,
verbose_name
=
'Mobile'
,
blank
=
True
),
preserve_default
=
True
,
),
migrations
.
AddField
(
model_name
=
'user'
,
name
=
'phone'
,
field
=
models
.
CharField
(
max_length
=
20
,
null
=
True
,
verbose_name
=
'Phone'
,
blank
=
True
),
preserve_default
=
True
,
),
]
panikdb/aa/models.py
View file @
8c0c3ec6
...
...
@@ -3,6 +3,7 @@ import re
from
django.contrib.auth.models
import
AbstractUser
from
django.core
import
validators
from
django.db
import
models
from
django.utils.translation
import
ugettext_lazy
as
_
from
emissions.models
import
Emission
,
Episode
,
NewsItem
,
NewsCategory
,
SoundFile
...
...
@@ -10,6 +11,12 @@ class User(AbstractUser):
emissions
=
models
.
ManyToManyField
(
Emission
,
null
=
True
,
blank
=
True
)
news_categories
=
models
.
ManyToManyField
(
NewsCategory
,
null
=
True
,
blank
=
True
)
phone
=
models
.
CharField
(
_
(
'Phone'
),
max_length
=
20
,
null
=
True
,
blank
=
True
)
mobile
=
models
.
CharField
(
_
(
'Mobile'
),
max_length
=
20
,
null
=
True
,
blank
=
True
)
class
Meta
:
ordering
=
[
'first_name'
,
'last_name'
]
def
can_manage
(
self
,
object
):
if
self
.
is_staff
:
return
True
...
...
@@ -22,3 +29,11 @@ class User(AbstractUser):
if
isinstance
(
object
,
NewsItem
):
return
self
.
has_perm
(
'emissions.change_newsitem'
)
or
object
.
emission
in
self
.
emissions
.
all
()
return
False
def
__unicode__
(
self
):
s
=
super
(
User
,
self
).
__unicode__
()
if
self
.
mobile
:
return
'%s (%s)'
%
(
s
,
self
.
mobile
)
if
self
.
phone
:
return
'%s (%s)'
%
(
s
,
self
.
phone
)
return
s
panikdb/static/css/style.css
View file @
8c0c3ec6
...
...
@@ -755,3 +755,19 @@ body.submitting {
opacity
:
0.5
;
pointer-events
:
none
;
}
div
#content
ul
.team
{
padding
:
0
;
padding-left
:
1ex
;
margin
:
0
;
}
ul
.team
li
{
display
:
inline
;
padding
:
0
;
margin
:
0
;
}
ul
.team
li
::after
{
content
:
" / "
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment