-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'n-level' of https://github.com/fresearchgroup/Collabora…
…tion-System into n-level
- Loading branch information
Showing
25 changed files
with
1,027 additions
and
96 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 |
---|---|---|
|
@@ -30,3 +30,4 @@ src/ | |
.DS_Store/ | ||
node_modules/ | ||
static/js/dist/ | ||
media/badge_images |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from rest_framework import permissions | ||
from Community.models import CommunityMembership, Community | ||
|
||
class IsCommunityMember(permissions.BasePermission): | ||
|
||
def has_permission(self, request, view): | ||
return CommunityMembership.objects.filter(user=request.user, community=Community.objects.get(pk=view.kwargs['pk'])) |
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,8 +1,9 @@ | ||
from django.conf.urls import url | ||
from .views import CommunityListsApi, CommunityArticlesApi, CommunityMediaApi | ||
from .views import CommunityListsApi, CommunityArticlesApi, CommunityMediaApi, CreateCommunityResource | ||
|
||
urlpatterns = [ | ||
url(r'^list/$', CommunityListsApi.as_view(), name='community-list-api'), | ||
url(r'^(?P<pk>\d*)/articles/$', CommunityArticlesApi.as_view(), name='community-articles-api'), | ||
url(r'^(?P<pk>\d*)/media/(?P<type>[\w\-]+)/$', CommunityMediaApi.as_view(), name='community-media-api'), | ||
url(r'^(?P<pk>\d*)/create/(?P<resource_type>[\w\-]+)/$', CreateCommunityResource.as_view(), name='community-resource-create') | ||
] |
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from rest_framework import serializers | ||
from Media.models import Media | ||
|
||
|
||
class MediaCreateSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Media | ||
fields = ('mediatype', 'title', 'mediafile', 'medialink') |
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,9 +1,10 @@ | ||
from django.contrib import admin | ||
from .models import ResourceScore, CommunityReputaion, FlagReason, ArticleFlagLogs, MediaFlagLogs | ||
from .models import ResourceScore, CommunityReputaion, FlagReason, ArticleFlagLogs, MediaFlagLogs, BadgeScore | ||
# Register your models here. | ||
|
||
admin.site.register(ResourceScore) | ||
admin.site.register(CommunityReputaion) | ||
admin.site.register(FlagReason) | ||
admin.site.register(ArticleFlagLogs) | ||
admin.site.register(MediaFlagLogs) | ||
admin.site.register(BadgeScore) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from django.conf.urls import url | ||
from .views import ReputationStats, ReputationStatsDetails, FlagReasons, ResourceReports, ReputationScore | ||
from .views import BadgesProgress | ||
|
||
urlpatterns = [ | ||
|
||
url(r'^reputation_stats/$', ReputationStats.as_view()), | ||
url(r'^reputation_stats/(?P<pk>[0-9]+)/$', ReputationStatsDetails.as_view()), | ||
url(r'^flag_reasons/$', FlagReasons.as_view()), | ||
url(r'^resource_reports/$', ResourceReports.as_view()), | ||
url(r'^score/$', ReputationScore.as_view()) | ||
url(r'^score/$', ReputationScore.as_view()), | ||
url(r'^badges/$', BadgesProgress.as_view()), | ||
] |
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
Oops, something went wrong.