-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,46 @@ | ||
from django.contrib import admin | ||
from import_export.admin import ImportExportModelAdmin | ||
from notices.models import Notice, BookmarkedNotice, TrendingInCollege | ||
|
||
|
||
class BookmarkedNoticeAdmin(admin.TabularInline): | ||
model = BookmarkedNotice | ||
extra=1 | ||
extra = 1 | ||
fieldsets = ( | ||
(None, { | ||
'classes': ('extrapretty','wide'), | ||
'classes': ('extrapretty', 'wide'), | ||
'fields': (('user', 'notice'), 'pinned'), | ||
}), | ||
) | ||
|
||
class NoticeAdmin(admin.ModelAdmin): | ||
list_display = ('faculty', 'title', 'course_branch_year', 'created', 'modified', 'visible_for_student', | ||
'visible_for_faculty', 'visible_for_hod', 'visible_for_others', 'visible_for_management' | ||
) | ||
|
||
class NoticeAdmin(ImportExportModelAdmin): | ||
list_display = ( | ||
'faculty', 'title', 'course_branch_year', | ||
'created', 'modified', 'visible_for_student', | ||
'visible_for_faculty', 'visible_for_hod', | ||
'visible_for_others', 'visible_for_management' | ||
) | ||
list_display_links = ('title', 'faculty') | ||
list_filter = ('faculty', 'category') | ||
list_per_page = 100 | ||
inlines = [BookmarkedNoticeAdmin] | ||
fieldsets = ( | ||
(None, { | ||
'classes': ('wide', 'extrapretty'), | ||
'fields': ('faculty', 'category', 'title', 'description', 'file_attached', 'course_branch_year', | ||
'visible_for_student', 'visible_for_faculty', 'visible_for_hod', | ||
'visible_for_others', 'visible_for_management', ), | ||
'fields': ( | ||
'faculty', 'category', 'title', 'description', | ||
'file_attached', 'course_branch_year', | ||
'visible_for_student', 'visible_for_faculty', | ||
'visible_for_hod', | ||
'visible_for_others', 'visible_for_management', ), | ||
}), | ||
) | ||
|
||
# class TrendingInCollegeAdmin(admin.ModelAdmin): | ||
# list_display = ('title', 'attachment', 'visibility') | ||
|
||
class TrendingInCollegeAdmin(admin.ModelAdmin): | ||
list_display = ('title', 'attachment', 'visibility') | ||
|
||
|
||
admin.site.register(Notice, NoticeAdmin) | ||
# admin.site.register(TrendingInCollege, TrendingInCollegeAdmin) #Unused model | ||
admin.site.register(TrendingInCollege, TrendingInCollegeAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters