forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customize the theme as per the direction (ltr and rtl), added transla…
…tion, made kkux app for dynamic news at home page. (Fixes openedx#1)
- Loading branch information
1 parent
588bd38
commit 5b650db
Showing
73 changed files
with
3,791 additions
and
2,077 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
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
Binary file not shown.
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
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,17 @@ | ||
from django.contrib import admin | ||
from .models import News, Language | ||
|
||
|
||
class LanguageAdmin(admin.ModelAdmin): | ||
list_display = ['name', 'code'] | ||
search_fields = ['name', 'code'] | ||
|
||
admin.site.register(Language, LanguageAdmin) | ||
|
||
|
||
class NewsAdmin(admin.ModelAdmin): | ||
list_display = ['title', 'language', 'position'] | ||
list_filter = ['language'] | ||
search_fields = ['title'] | ||
|
||
admin.site.register(News, NewsAdmin) |
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,47 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.utils.timezone | ||
import model_utils.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Language', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), | ||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), | ||
('name', models.CharField(default=b'English', max_length=50)), | ||
('code', models.CharField(default=b'en', unique=True, max_length=10)), | ||
], | ||
options={ | ||
'verbose_name': 'Language', | ||
'verbose_name_plural': 'Languages', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='News', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), | ||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), | ||
('title', models.CharField(help_text=b'News title upto 30 characters', max_length=255)), | ||
('link', models.URLField(help_text=b'Link for the news')), | ||
('short_description', models.TextField(help_text=b'Add description upto 100 characters', null=True, blank=True)), | ||
('position', models.IntegerField(default=1, help_text=b'Position/order of the news')), | ||
('language', models.ForeignKey(to='kkux.Language')), | ||
], | ||
options={ | ||
'ordering': ['position'], | ||
'verbose_name': 'News', | ||
'verbose_name_plural': 'News', | ||
}, | ||
), | ||
] |
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,42 @@ | ||
from django.db import models | ||
|
||
from model_utils.models import TimeStampedModel | ||
|
||
|
||
class Language(TimeStampedModel): | ||
name = models.CharField(max_length=50, default='English') | ||
code = models.CharField(max_length=10, unique=True, default='en') | ||
|
||
class Meta: | ||
app_label = "kkux" | ||
verbose_name = 'Language' | ||
verbose_name_plural = 'Languages' | ||
|
||
def __unicode__(self): | ||
return self.name | ||
|
||
def __repr__(self): | ||
return self.__unicode__() | ||
|
||
|
||
class News(TimeStampedModel): | ||
""" | ||
Store KKUx news details and news will be displayed on homepage. | ||
""" | ||
language = models.ForeignKey(Language, on_delete=models.CASCADE) | ||
title = models.CharField(max_length=255, help_text="News title upto 30 characters") | ||
link = models.URLField(help_text="Link for the news") | ||
short_description = models.TextField(null=True, blank=True, help_text="Add description upto 100 characters") | ||
position = models.IntegerField(default=1, help_text="Position/order of the news") | ||
|
||
class Meta(object): | ||
app_label = "kkux" | ||
ordering = ['position'] | ||
verbose_name = 'News' | ||
verbose_name_plural = 'News' | ||
|
||
def __unicode__(self): | ||
return self.title | ||
|
||
def __repr__(self): | ||
return self.__unicode__() |
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
19 changes: 19 additions & 0 deletions
19
...ps/content/course_overviews/migrations/0015_courseoverview_short_description_in_arabic.py
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,19 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('course_overviews', '0014_courseoverview_course_category'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='courseoverview', | ||
name='short_description_in_arabic', | ||
field=models.TextField(null=True), | ||
), | ||
] |
19 changes: 19 additions & 0 deletions
19
...ngoapps/content/course_overviews/migrations/0016_courseoverview_display_name_in_arabic.py
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,19 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('course_overviews', '0015_courseoverview_short_description_in_arabic'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='courseoverview', | ||
name='display_name_in_arabic', | ||
field=models.TextField(null=True), | ||
), | ||
] |
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
Oops, something went wrong.