12 |
13 |
14 |
15 |
Password Reset Form
16 |
20 |
21 |
22 |
23 | {% endblock body %}
24 |
--------------------------------------------------------------------------------
/static/admin/img/inline-delete.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/templates/password_reset_done.html:
--------------------------------------------------------------------------------
1 |
2 | {% extends 'base.html'%}
3 |
4 | {% block head %}
5 |
6 | {% endblock head %}
7 |
8 | {% block body %}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
Well done!
16 |
17 |
An Email has been sent with instructions to reset your password.
18 |
19 |
20 |
Check Your Email!
21 |
22 |
23 |
24 |
25 |
26 | {% endblock body %}
27 |
--------------------------------------------------------------------------------
/static/admin/img/icon-viewlink.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/templates/password_reset_complete.html:
--------------------------------------------------------------------------------
1 |
2 | {% extends 'base.html'%}
3 |
4 | {% block head %}
5 |
6 | {% endblock head %}
7 |
8 | {% block body %}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
Well done!
16 |
17 |
Password Reset Complete
18 |
19 |
Login !
20 |
21 |
22 |
23 |
24 |
25 |
26 | {% endblock body %}
27 |
--------------------------------------------------------------------------------
/templates/password_reset_confirm.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html'%}
2 |
3 | {% block head %}
4 |
5 | {% endblock head %}
6 |
7 | {% block body %}
8 |
9 |
10 |
11 |
12 |
Reset Your Password
13 | Enter Your New Password
14 | {% load crispy_forms_tags %}
15 |
20 |
21 |
22 |
23 |
24 | {% endblock body %}
25 |
--------------------------------------------------------------------------------
/templates/login.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load crispy_forms_tags %}
3 | {% block body %}
4 |
20 | {% endblock body %}
--------------------------------------------------------------------------------
/static/admin/js/popup_response.js:
--------------------------------------------------------------------------------
1 | /*global opener */
2 | (function() {
3 | 'use strict';
4 | var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse);
5 | switch(initData.action) {
6 | case 'change':
7 | opener.dismissChangeRelatedObjectPopup(window, initData.value, initData.obj, initData.new_value);
8 | break;
9 | case 'delete':
10 | opener.dismissDeleteRelatedObjectPopup(window, initData.value);
11 | break;
12 | default:
13 | opener.dismissAddRelatedObjectPopup(window, initData.value, initData.obj);
14 | break;
15 | }
16 | })();
17 |
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/zh-TW.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/certificate/migrations/0007_certificate_url.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 3.2.4 on 2021-07-04 13:17
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('certificate', '0006_rename_ogr_participant_org'),
10 | ]
11 |
12 | operations = [
13 | migrations.CreateModel(
14 | name='Certificate_url',
15 | fields=[
16 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17 | ('certificate_id', models.CharField(max_length=1000)),
18 | ],
19 | ),
20 | ]
21 |
--------------------------------------------------------------------------------
/certificate/migrations/0008_auto_20210713_0830.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 3.2.4 on 2021-07-13 08:30
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('certificate', '0007_certificate_url'),
10 | ]
11 |
12 | operations = [
13 | migrations.RenameField(
14 | model_name='event',
15 | old_name='event_date',
16 | new_name='starting_date',
17 | ),
18 | migrations.AddField(
19 | model_name='event',
20 | name='ending_date',
21 | field=models.DateField(null=True),
22 | ),
23 | ]
24 |
--------------------------------------------------------------------------------
/static/admin/img/icon-unknown.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/static/admin/img/icon-unknown-alt.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/certificate/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 3.2.4 on 2021-06-11 04:28
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | initial = True
9 |
10 | dependencies = [
11 | ]
12 |
13 | operations = [
14 | migrations.CreateModel(
15 | name='Template',
16 | fields=[
17 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18 | ('title', models.CharField(max_length=300)),
19 | ('file', models.FileField(upload_to='certificate/templates')),
20 | ],
21 | ),
22 | ]
23 |
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/zh-CN.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/certificate/convter.py:
--------------------------------------------------------------------------------
1 | import json
2 | import requests
3 |
4 |
5 |
6 | def ppt2pdf(f_path,filename, token):
7 |
8 | headers = {"Authorization": token}
9 | para = {
10 | "name": filename,
11 | "parents": ["13GzxN9pBRmFsdfs60zK0xfDbZbCll0w_Q"]
12 | }
13 | files = {
14 | 'data': ('metadata', json.dumps(para), 'application/json; charset=UTF-8'),
15 | 'file': open(f_path, "rb")
16 | }
17 | r = requests.post(
18 | "https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart",
19 | headers=headers,
20 | files=files
21 | )
22 | fi = r.text.split()
23 | st = fi[4]
24 | st = st[1:-2]
25 | return st
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/az.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/fi.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ja.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/img/icon-clock.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/hu.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/tr.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ko.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/th.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """Django's command-line utility for administrative tasks."""
3 | import os
4 | import sys
5 |
6 |
7 | def main():
8 | """Run administrative tasks."""
9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ism.settings')
10 | try:
11 | from django.core.management import execute_from_command_line
12 | except ImportError as exc:
13 | raise ImportError(
14 | "Couldn't import Django. Are you sure it's installed and "
15 | "available on your PYTHONPATH environment variable? Did you "
16 | "forget to activate a virtual environment?"
17 | ) from exc
18 | execute_from_command_line(sys.argv)
19 |
20 |
21 | if __name__ == '__main__':
22 | main()
23 |
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/id.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/vi.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+' ký tự"';return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/is.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ar.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="الرجاء حذف "+t+" عناصر";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="الرجاء إضافة "+t+" عناصر";return n},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){var t="تستطيع إختيار "+e.maximum+" بنود فقط";return t},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/de.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/et.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/sv.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/bg.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/km.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចេញ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនេះ";return n},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានតែ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/nb.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn ";return t>1?n+=" flere tegn":n+=" tegn til",n},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ms.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/change_form.js:
--------------------------------------------------------------------------------
1 | /*global showAddAnotherPopup, showRelatedObjectLookupPopup showRelatedObjectPopup updateRelatedObjectLinks*/
2 |
3 | (function($) {
4 | 'use strict';
5 | $(document).ready(function() {
6 | var modelName = $('#django-admin-form-add-constants').data('modelName');
7 | $('body').on('click', '.add-another', function(e) {
8 | e.preventDefault();
9 | var event = $.Event('django:add-another-related');
10 | $(this).trigger(event);
11 | if (!event.isDefaultPrevented()) {
12 | showAddAnotherPopup(this);
13 | }
14 | });
15 |
16 | if (modelName) {
17 | $('form#' + modelName + '_form :input:visible:enabled:first').focus();
18 | }
19 | });
20 | })(django.jQuery);
21 |
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/gl.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Elimine ";return t===1?n+="un carácter":n+=t+" caracteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Engada ";return t===1?n+="un carácter":n+=t+" caracteres",n},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){var t="Só pode ";return e.maximum===1?t+="un elemento":t+=e.maximum+" elementos",t},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/da.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Angiv venligst "+t+" tegn mindre";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Angiv venligst "+t+" tegn mere";return n},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/en.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/he.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/hi.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/fa.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها میتوانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجهای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/hr.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/mk.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/eu.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/pt-BR.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/templates/certificate/view_certificate_status.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 |
3 | {% block body %}
4 |
5 |
6 | {% for event in events %}
7 |
8 |
9 |
10 |
{{event.event_name}}
11 |
{{event.event_type}}
12 |
{{event.starting_date}}
13 |
View Status
14 |
Delete
15 |
16 |
17 |
18 |
19 | {% endfor %}
20 |
21 |
22 | {% endblock body %}
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/pt.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"carácter",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/lv.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/es.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ca.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/it.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/fr.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Supprimez "+t+" caractère";return t!==1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Saisissez "+t+" caractère";return t!==1&&(n+="s"),n},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){var t="Vous pouvez seulement sélectionner "+e.maximum+" élément";return e.maximum!==1&&(t+="s"),t},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ro.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+"sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/nl.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/lt.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"į","ius","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ą","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/pl.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/el.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/sr.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/uk.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/sr-Cyrl.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ru.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/templates/certificate/track.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 |
3 | {% block body %}
4 |
Certificate Generation Report for {{event_type}} of {{event_name}}
5 |
on : {{event_date}}
6 |
7 |
8 |
9 |
10 | #
11 | Name
12 | Email
13 | Organization
14 | Status
15 |
16 |
17 |
18 | {% for item in participat_details %}
19 |
20 | {{forloop.counter}}
21 | {{item.name}}
22 | {{item.email}}
23 | {{item.org}}
24 | {% if item.status %}
25 | Sent
26 | {% else %}
27 | Unsend
28 | {% endif %}
29 |
30 | {% endfor %}
31 |
32 |
33 | {% endblock %}
--------------------------------------------------------------------------------
/static/admin/js/collapse.min.js:
--------------------------------------------------------------------------------
1 | (function(){var e=function(b,a){return b.nodeName===a.toUpperCase()?b:"BODY"===b.parentNode.nodeName?null:b.parentNode&&e(b.parentNode,a)};window.addEventListener("load",function(){for(var b=document.querySelectorAll("fieldset.collapse"),a=0;a
--------------------------------------------------------------------------------
/static/admin/img/icon-calendar.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/static/admin/img/gis/move_vertex_off.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/sk.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/img/calendar-icons.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/static/admin/img/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Code Charm Ltd
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/static/admin/img/sorting-icons.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/cs.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak méně":n<=4?"Prosím zadejte o "+e(n,!0)+" znaky méně":"Prosím zadejte o "+n+" znaků méně"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím zadejte ještě jeden znak":n<=4?"Prosím zadejte ještě další "+e(n,!0)+" znaky":"Prosím zadejte ještě dalších "+n+" znaků"},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky":"Můžete zvolit maximálně "+n+" položek"},noResults:function(){return"Nenalezeny žádné položky"},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/xregexp/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2007-2012 Steven Levithan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2012-2015 Kevin Brown, Igor Vaynberg, and Select2 contributors
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/static/admin/css/vendor/select2/LICENSE-SELECT2.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2012-2015 Kevin Brown, Igor Vaynberg, and Select2 contributors
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/templates/admin/view_users.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load crispy_forms_tags %}
3 | {% block body %}
4 | All Users of this site
5 |
6 |
7 |
8 | Username
9 | Full Name
10 | User Type
11 | Edit
12 | Delete
13 |
14 |
15 |
16 | {% for user in users %}
17 |
18 | {{user.username}}
19 | {{user.get_full_name}}
20 |
21 | {% if user.is_superuser %}
22 | Admin
23 | {% else %}
24 | Normal
25 | {% endif %}
26 |
27 |
28 |
29 |
33 |
34 |
35 | {% endfor %}
36 |
37 |
38 | {% endblock body %}
--------------------------------------------------------------------------------
/static/admin/js/autocomplete.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | 'use strict';
3 | var init = function($element, options) {
4 | var settings = $.extend({
5 | ajax: {
6 | data: function(params) {
7 | return {
8 | term: params.term,
9 | page: params.page
10 | };
11 | }
12 | }
13 | }, options);
14 | $element.select2(settings);
15 | };
16 |
17 | $.fn.djangoAdminSelect2 = function(options) {
18 | var settings = $.extend({}, options);
19 | $.each(this, function(i, element) {
20 | var $element = $(element);
21 | init($element, settings);
22 | });
23 | return this;
24 | };
25 |
26 | $(function() {
27 | // Initialize all autocomplete widgets except the one in the template
28 | // form used when a new formset is added.
29 | $('.admin-autocomplete').not('[name*=__prefix__]').djangoAdminSelect2();
30 | });
31 |
32 | $(document).on('formset:added', (function() {
33 | return function(event, $newFormset) {
34 | return $newFormset.find('.admin-autocomplete').djangoAdminSelect2();
35 | };
36 | })(this));
37 | }(django.jQuery));
38 |
--------------------------------------------------------------------------------
/certificate/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from django.contrib.auth.models import User
3 | from django.utils.text import slugify
4 |
5 | class Certificate_url(models.Model):
6 | certificate_id = models.CharField(max_length=1000)
7 |
8 | class Event(models.Model):
9 | user = models.ForeignKey(User, on_delete=models.CASCADE)
10 | event_name = models.CharField(max_length=250)
11 | event_type = models.CharField(max_length=250)
12 | starting_date = models.DateField()
13 | ending_date = models.DateField(null=True)
14 | csv_file = models.FileField(upload_to="certificates/csv_files/")
15 | template = models.FileField(upload_to="certificates/templates/")
16 | name_column = models.CharField(max_length=250, null=True, blank=True)
17 | email_column = models.CharField(max_length=250, null=True, blank=True)
18 | org_column = models.CharField(max_length=250, null=True, blank=True)
19 | message = models.TextField(null=True, blank=True)
20 | slug = models.SlugField(null=True, blank=True)
21 |
22 | def save(self, *args, **kwargs):
23 | self.slug = slugify(self.event_name)
24 | super(Event, self).save(*args, **kwargs)
25 |
26 | class Participant(models.Model):
27 | event = models.ForeignKey(Event, on_delete=models.CASCADE)
28 | name = models.CharField(max_length=250)
29 | email = models.CharField(max_length=250)
30 | org = models.CharField(max_length=250)
31 | status = models.BooleanField(default=False)
--------------------------------------------------------------------------------
/static/admin/js/vendor/jquery/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright jQuery Foundation and other contributors, https://jquery.org/
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals. For exact contribution history, see the revision history
5 | available at https://github.com/jquery/jquery
6 |
7 | ====
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining
10 | a copy of this software and associated documentation files (the
11 | "Software"), to deal in the Software without restriction, including
12 | without limitation the rights to use, copy, modify, merge, publish,
13 | distribute, sublicense, and/or sell copies of the Software, and to
14 | permit persons to whom the Software is furnished to do so, subject to
15 | the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be
18 | included in all copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 |
--------------------------------------------------------------------------------
/ism/urls.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from django.urls import path, include
3 | from django.conf import settings
4 | from django.conf.urls.static import static
5 | from django.contrib.auth.views import LoginView, LogoutView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
6 |
7 | urlpatterns = [
8 | path('admin', admin.site.urls),
9 | path('', include('main.urls')),
10 | path('certificate/', include('certificate.urls')),
11 | path("login/", LoginView.as_view(template_name='login.html', redirect_authenticated_user=True), name="login"),
12 | path("logout/", LogoutView.as_view(next_page='login'), name="logout"),
13 | path("password-reset/",
14 | PasswordResetView.as_view(template_name='password_reset.html'),
15 | name="password_reset"),
16 |
17 | path("password-reset/done/",
18 | PasswordResetDoneView.as_view(template_name='password_reset_done.html'),
19 | name="password_reset_done"),
20 |
21 | path("password-reset-confirm///",
22 | PasswordResetConfirmView.as_view(template_name='password_reset_confirm.html'),
23 | name="password_reset_confirm"),
24 |
25 | path("password-reset-complete/",
26 | PasswordResetCompleteView.as_view(template_name='password_reset_complete.html'),
27 | name="password_reset_complete"),
28 | ]
29 |
30 | if settings.DEBUG:
31 | urlpatterns += static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
32 | urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
--------------------------------------------------------------------------------
/static/admin/css/login.css:
--------------------------------------------------------------------------------
1 | /* LOGIN FORM */
2 |
3 | body.login {
4 | background: #f8f8f8;
5 | }
6 |
7 | .login #header {
8 | height: auto;
9 | padding: 15px 16px;
10 | justify-content: center;
11 | }
12 |
13 | .login #header h1 {
14 | font-size: 18px;
15 | }
16 |
17 | .login #header h1 a {
18 | color: #fff;
19 | }
20 |
21 | .login #content {
22 | padding: 20px 20px 0;
23 | }
24 |
25 | .login #container {
26 | background: #fff;
27 | border: 1px solid #eaeaea;
28 | border-radius: 4px;
29 | overflow: hidden;
30 | width: 28em;
31 | min-width: 300px;
32 | margin: 100px auto;
33 | }
34 |
35 | .login #content-main {
36 | width: 100%;
37 | }
38 |
39 | .login .form-row {
40 | padding: 4px 0;
41 | float: left;
42 | width: 100%;
43 | border-bottom: none;
44 | }
45 |
46 | .login .form-row label {
47 | padding-right: 0.5em;
48 | line-height: 2em;
49 | font-size: 1em;
50 | clear: both;
51 | color: #333;
52 | }
53 |
54 | .login .form-row #id_username, .login .form-row #id_password {
55 | clear: both;
56 | padding: 8px;
57 | width: 100%;
58 | -webkit-box-sizing: border-box;
59 | -moz-box-sizing: border-box;
60 | box-sizing: border-box;
61 | }
62 |
63 | .login span.help {
64 | font-size: 10px;
65 | display: block;
66 | }
67 |
68 | .login .submit-row {
69 | clear: both;
70 | padding: 1em 0 0 9.4em;
71 | margin: 0;
72 | border: none;
73 | background: none;
74 | text-align: left;
75 | }
76 |
77 | .login .password-reset-link {
78 | text-align: center;
79 | }
80 |
--------------------------------------------------------------------------------
/templates/admin/create_user.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load crispy_forms_tags %}
3 | {% block body %}
4 |
44 | {% endblock body %}
--------------------------------------------------------------------------------
/static/admin/js/prepopulate.js:
--------------------------------------------------------------------------------
1 | /*global URLify*/
2 | (function($) {
3 | 'use strict';
4 | $.fn.prepopulate = function(dependencies, maxLength, allowUnicode) {
5 | /*
6 | Depends on urlify.js
7 | Populates a selected field with the values of the dependent fields,
8 | URLifies and shortens the string.
9 | dependencies - array of dependent fields ids
10 | maxLength - maximum length of the URLify'd string
11 | allowUnicode - Unicode support of the URLify'd string
12 | */
13 | return this.each(function() {
14 | var prepopulatedField = $(this);
15 |
16 | var populate = function() {
17 | // Bail if the field's value has been changed by the user
18 | if (prepopulatedField.data('_changed')) {
19 | return;
20 | }
21 |
22 | var values = [];
23 | $.each(dependencies, function(i, field) {
24 | field = $(field);
25 | if (field.val().length > 0) {
26 | values.push(field.val());
27 | }
28 | });
29 | prepopulatedField.val(URLify(values.join(' '), maxLength, allowUnicode));
30 | };
31 |
32 | prepopulatedField.data('_changed', false);
33 | prepopulatedField.on('change', function() {
34 | prepopulatedField.data('_changed', true);
35 | });
36 |
37 | if (!prepopulatedField.val()) {
38 | $(dependencies.join(',')).on('keyup change focus', populate);
39 | }
40 | });
41 | };
42 | })(django.jQuery);
43 |
--------------------------------------------------------------------------------
/templates/admin/edit_user.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load crispy_forms_tags %}
3 | {% block body %}
4 |
44 | {% endblock body %}
--------------------------------------------------------------------------------
/static/main/js/main.js:
--------------------------------------------------------------------------------
1 |
2 | document.querySelector('#sidebarCollapse').addEventListener('click',function() {
3 | document.querySelector('#sidebar').classList.toggle('active');
4 | document.querySelector('#content').classList.toggle('active');
5 | });
6 |
7 |
8 |
9 | function editMenu(elm) {
10 |
11 | let title = document.getElementById(`${elm}-title`);
12 | let icon = document.getElementById(`${elm}-icon`);
13 | let url = document.getElementById(`${elm}-url`);
14 | let btn = document.getElementById(`${elm}-btn`);
15 |
16 | title.innerHTML = ` `;
17 | icon.innerHTML = ` `;
18 | url.innerHTML = ` `;
19 | btn.innerHTML = ` `;
20 | }
21 |
22 | function editMenuSend(elm){
23 | let title = document.getElementById(`${elm}-title`).querySelector('input').value;
24 | let icon = document.getElementById(`${elm}-icon`).querySelector('input').value;
25 | let url = document.getElementById(`${elm}-url`).querySelector('input').value;
26 | $.ajax(
27 | {
28 | type:"POST",
29 | url: '/updateMenu',
30 | data:{
31 | id: elm,
32 | title: title,
33 | icon: icon,
34 | url:url,
35 | },
36 | success: function(data)
37 | {
38 | document.getElementById(`${elm}-title`).innerText = data.title;
39 | document.getElementById(`${elm}-icon`).innerText = data.icon;
40 | document.getElementById(`${elm}-url`).innerText = data.url;
41 | document.getElementById(`${elm}-btn`).innerHTML = ` `;
42 | }
43 | });
44 | }
45 |
--------------------------------------------------------------------------------
/certificate/migrations/0003_event_participants.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 3.2.4 on 2021-06-13 11:51
2 |
3 | from django.conf import settings
4 | from django.db import migrations, models
5 | import django.db.models.deletion
6 |
7 |
8 | class Migration(migrations.Migration):
9 |
10 | initial = True
11 |
12 | dependencies = [
13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL),
14 | ('certificate', '0002_delete_template'),
15 | ]
16 |
17 | operations = [
18 | migrations.CreateModel(
19 | name='Event',
20 | fields=[
21 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22 | ('event_name', models.CharField(max_length=250)),
23 | ('event_type', models.CharField(max_length=250)),
24 | ('event_date', models.DateField()),
25 | ('csv_file', models.FileField(upload_to='certificates/csv_files/')),
26 | ('template', models.FileField(upload_to='certificates/templates/')),
27 | ('name_column', models.CharField(blank=True, max_length=250, null=True)),
28 | ('email_column', models.CharField(blank=True, max_length=250, null=True)),
29 | ('org_column', models.CharField(blank=True, max_length=250, null=True)),
30 | ('slug', models.SlugField(blank=True, null=True)),
31 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
32 | ],
33 | ),
34 | migrations.CreateModel(
35 | name='participants',
36 | fields=[
37 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
38 | ('name', models.CharField(max_length=250)),
39 | ('email', models.CharField(max_length=250)),
40 | ('ogr', models.CharField(max_length=250)),
41 | ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='certificate.event')),
42 | ],
43 | ),
44 | ]
45 |
--------------------------------------------------------------------------------
/static/admin/css/responsive_rtl.css:
--------------------------------------------------------------------------------
1 | /* TABLETS */
2 |
3 | @media (max-width: 1024px) {
4 | [dir="rtl"] .colMS {
5 | margin-right: 0;
6 | }
7 |
8 | [dir="rtl"] #user-tools {
9 | text-align: right;
10 | }
11 |
12 | [dir="rtl"] #changelist .actions label {
13 | padding-left: 10px;
14 | padding-right: 0;
15 | }
16 |
17 | [dir="rtl"] #changelist .actions select {
18 | margin-left: 0;
19 | margin-right: 15px;
20 | }
21 |
22 | [dir="rtl"] .change-list .filtered .results,
23 | [dir="rtl"] .change-list .filtered .paginator,
24 | [dir="rtl"] .filtered #toolbar,
25 | [dir="rtl"] .filtered div.xfull,
26 | [dir="rtl"] .filtered .actions {
27 | margin-right: 0;
28 | margin-left: 230px;
29 | }
30 |
31 | [dir="rtl"] .inline-group ul.tools a.add,
32 | [dir="rtl"] .inline-group div.add-row a,
33 | [dir="rtl"] .inline-group .tabular tr.add-row td a {
34 | padding: 8px 26px 8px 10px;
35 | background-position: calc(100% - 8px) 9px;
36 | }
37 |
38 | [dir="rtl"] .related-widget-wrapper-link + .selector {
39 | margin-right: 0;
40 | margin-left: 15px;
41 | }
42 |
43 | [dir="rtl"] .selector .selector-filter label {
44 | margin-right: 0;
45 | margin-left: 8px;
46 | }
47 |
48 | [dir="rtl"] .object-tools li {
49 | float: right;
50 | }
51 |
52 | [dir="rtl"] .object-tools li + li {
53 | margin-left: 0;
54 | margin-right: 15px;
55 | }
56 |
57 | [dir="rtl"] .dashboard .module table td a {
58 | padding-left: 0;
59 | padding-right: 16px;
60 | }
61 | }
62 |
63 | /* MOBILE */
64 |
65 | @media (max-width: 767px) {
66 | [dir="rtl"] .change-list .filtered .results,
67 | [dir="rtl"] .change-list .filtered .paginator,
68 | [dir="rtl"] .filtered #toolbar,
69 | [dir="rtl"] .filtered div.xfull,
70 | [dir="rtl"] .filtered .actions {
71 | margin-left: 0;
72 | }
73 |
74 | [dir="rtl"] .aligned .add-another,
75 | [dir="rtl"] .aligned .related-lookup,
76 | [dir="rtl"] .aligned .datetimeshortcuts {
77 | margin-left: 0;
78 | margin-right: 15px;
79 | }
80 |
81 | [dir="rtl"] .aligned ul {
82 | margin-right: 0;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/static/admin/js/collapse.js:
--------------------------------------------------------------------------------
1 | /*global gettext*/
2 | (function() {
3 | 'use strict';
4 | var closestElem = function(elem, tagName) {
5 | if (elem.nodeName === tagName.toUpperCase()) {
6 | return elem;
7 | }
8 | if (elem.parentNode.nodeName === 'BODY') {
9 | return null;
10 | }
11 | return elem.parentNode && closestElem(elem.parentNode, tagName);
12 | };
13 |
14 | window.addEventListener('load', function() {
15 | // Add anchor tag for Show/Hide link
16 | var fieldsets = document.querySelectorAll('fieldset.collapse');
17 | for (var i = 0; i < fieldsets.length; i++) {
18 | var elem = fieldsets[i];
19 | // Don't hide if fields in this fieldset have errors
20 | if (elem.querySelectorAll('div.errors').length === 0) {
21 | elem.classList.add('collapsed');
22 | var h2 = elem.querySelector('h2');
23 | var link = document.createElement('a');
24 | link.setAttribute('id', 'fieldsetcollapser' + i);
25 | link.setAttribute('class', 'collapse-toggle');
26 | link.setAttribute('href', '#');
27 | link.textContent = gettext('Show');
28 | h2.appendChild(document.createTextNode(' ('));
29 | h2.appendChild(link);
30 | h2.appendChild(document.createTextNode(')'));
31 | }
32 | }
33 | // Add toggle to hide/show anchor tag
34 | var toggleFunc = function(ev) {
35 | if (ev.target.matches('.collapse-toggle')) {
36 | ev.preventDefault();
37 | ev.stopPropagation();
38 | var fieldset = closestElem(ev.target, 'fieldset');
39 | if (fieldset.classList.contains('collapsed')) {
40 | // Show
41 | ev.target.textContent = gettext('Hide');
42 | fieldset.classList.remove('collapsed');
43 | } else {
44 | // Hide
45 | ev.target.textContent = gettext('Show');
46 | fieldset.classList.add('collapsed');
47 | }
48 | }
49 | };
50 | var inlineDivs = document.querySelectorAll('fieldset.module');
51 | for (i = 0; i < inlineDivs.length; i++) {
52 | inlineDivs[i].addEventListener('click', toggleFunc);
53 | }
54 | });
55 | })();
56 |
--------------------------------------------------------------------------------
/static/admin/js/actions.min.js:
--------------------------------------------------------------------------------
1 | (function(a){var f;a.fn.actions=function(e){var b=a.extend({},a.fn.actions.defaults,e),g=a(this),k=!1,l=function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()},m=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},n=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},p=function(){n();
2 | a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)},q=function(c){c?l():n();a(g).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},h=function(){var c=a(g).filter(":checked").length,d=a(".action-counter").data("actionsIcnt");a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:d},!0));a(b.allToggle).prop("checked",function(){if(c===g.length){var a=!0;l()}else a=!1,p();return a})};a(b.counterContainer).show();
3 | a(this).filter(":checked").each(function(c){a(this).parent().parent().toggleClass(b.selectedClass);h();1===a(b.acrossInput).val()&&m()});a(b.allToggle).show().on("click",function(){q(a(this).prop("checked"));h()});a("a",b.acrossQuestions).on("click",function(c){c.preventDefault();a(b.acrossInput).val(1);m()});a("a",b.acrossClears).on("click",function(c){c.preventDefault();a(b.allToggle).prop("checked",!1);p();q(0);h()});f=null;a(g).on("click",function(c){c||(c=window.event);var d=c.target?c.target:
4 | c.srcElement;if(f&&a.data(f)!==a.data(d)&&!0===c.shiftKey){var e=!1;a(f).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(g).each(function(){if(a.data(this)===a.data(f)||a.data(this)===a.data(d))e=e?!1:!0;e&&a(this).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);f=d;h()});a("form#changelist-form table#result_list tr").on("change","td:gt(0) :input",function(){k=!0});
5 | a('form#changelist-form button[name="index"]').on("click",function(a){if(k)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});a('form#changelist-form input[name="_save"]').on("click",function(c){var d=!1;a("select option:selected",b.actionContainer).each(function(){a(this).val()&&(d=!0)});if(d)return k?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")):
6 | confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})};a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"};a(document).ready(function(){var e=
7 | a("tr input.action-select");0
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/templates/certificate/index.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 |
3 | {% block body %}
4 |
5 | Issue Certificate
6 |
7 |
8 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | Note :-
95 |
96 | Template file should be in .ppt or .pptx format.
97 | In template at the place of Name , please write {{ "{{Full Name}" }}}
98 | In template at the place of Organization , please write {{"{{organization}"}}}
99 | In template at the place of Event Type , please write {{"{{Event Type}"}}}
100 | In template at the place of Topic , please write {{"{{topic}"}}}
101 | In template at the place of Date , please write {{"{{Date}"}}}
102 |
103 |
104 |
105 |
106 |
107 | {% endblock body %}
--------------------------------------------------------------------------------
/static/admin/js/timeparse.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | 'use strict';
3 | var timeParsePatterns = [
4 | // 9
5 | {
6 | re: /^\d{1,2}$/i,
7 | handler: function(bits) {
8 | if (bits[0].length === 1) {
9 | return '0' + bits[0] + ':00';
10 | } else {
11 | return bits[0] + ':00';
12 | }
13 | }
14 | },
15 | // 13:00
16 | {
17 | re: /^\d{2}[:.]\d{2}$/i,
18 | handler: function(bits) {
19 | return bits[0].replace('.', ':');
20 | }
21 | },
22 | // 9:00
23 | {
24 | re: /^\d[:.]\d{2}$/i,
25 | handler: function(bits) {
26 | return '0' + bits[0].replace('.', ':');
27 | }
28 | },
29 | // 3 am / 3 a.m. / 3am
30 | {
31 | re: /^(\d+)\s*([ap])(?:.?m.?)?$/i,
32 | handler: function(bits) {
33 | var hour = parseInt(bits[1]);
34 | if (hour === 12) {
35 | hour = 0;
36 | }
37 | if (bits[2].toLowerCase() === 'p') {
38 | if (hour === 12) {
39 | hour = 0;
40 | }
41 | return (hour + 12) + ':00';
42 | } else {
43 | if (hour < 10) {
44 | return '0' + hour + ':00';
45 | } else {
46 | return hour + ':00';
47 | }
48 | }
49 | }
50 | },
51 | // 3.30 am / 3:15 a.m. / 3.00am
52 | {
53 | re: /^(\d+)[.:](\d{2})\s*([ap]).?m.?$/i,
54 | handler: function(bits) {
55 | var hour = parseInt(bits[1]);
56 | var mins = parseInt(bits[2]);
57 | if (mins < 10) {
58 | mins = '0' + mins;
59 | }
60 | if (hour === 12) {
61 | hour = 0;
62 | }
63 | if (bits[3].toLowerCase() === 'p') {
64 | if (hour === 12) {
65 | hour = 0;
66 | }
67 | return (hour + 12) + ':' + mins;
68 | } else {
69 | if (hour < 10) {
70 | return '0' + hour + ':' + mins;
71 | } else {
72 | return hour + ':' + mins;
73 | }
74 | }
75 | }
76 | },
77 | // noon
78 | {
79 | re: /^no/i,
80 | handler: function(bits) {
81 | return '12:00';
82 | }
83 | },
84 | // midnight
85 | {
86 | re: /^mid/i,
87 | handler: function(bits) {
88 | return '00:00';
89 | }
90 | }
91 | ];
92 |
93 | function parseTimeString(s) {
94 | for (var i = 0; i < timeParsePatterns.length; i++) {
95 | var re = timeParsePatterns[i].re;
96 | var handler = timeParsePatterns[i].handler;
97 | var bits = re.exec(s);
98 | if (bits) {
99 | return handler(bits);
100 | }
101 | }
102 | return s;
103 | }
104 |
105 | window.parseTimeString = parseTimeString;
106 | })();
107 |
--------------------------------------------------------------------------------
/templates/certificate/from2.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 |
3 | {% block body %}
4 |
5 | Issue Certificate
6 |
7 |
8 |
113 | {% endblock body %}
--------------------------------------------------------------------------------
/templates/main/index.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 |
3 | {% block body %}
4 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
Welcome {{request.user.get_full_name}}
149 |
150 |
151 |
152 |
153 |
158 |
159 |
164 |
165 |
166 |
167 |
168 | {% endblock body %}
--------------------------------------------------------------------------------
/ism/settings.py:
--------------------------------------------------------------------------------
1 |
2 | from pathlib import Path
3 |
4 | # Build paths inside the project like this: BASE_DIR / 'subdir'.
5 | BASE_DIR = Path(__file__).resolve().parent.parent
6 |
7 |
8 | # Quick-start development settings - unsuitable for production
9 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
10 |
11 | # SECURITY WARNING: keep the secret key used in production secret!
12 | SECRET_KEY = 'django-insecure-7&--0=g5vvs=i*c#^ofyhua!i6j68if2ftb0mi-abbp3#6&yo_'
13 |
14 | # SECURITY WARNING: don't run with debug turned on in production!
15 | DEBUG = True
16 |
17 | ALLOWED_HOSTS = []
18 |
19 |
20 | # Application definition
21 |
22 | INSTALLED_APPS = [
23 | 'django.contrib.admin',
24 | 'django.contrib.auth',
25 | 'django.contrib.contenttypes',
26 | 'django.contrib.sessions',
27 | 'django.contrib.messages',
28 | 'django.contrib.staticfiles',
29 | 'crispy_forms',
30 | 'django_cleanup.apps.CleanupConfig',
31 | 'main.apps.MainConfig',
32 | 'certificate.apps.CertificateConfig',
33 | ]
34 |
35 | MIDDLEWARE = [
36 | 'django.middleware.security.SecurityMiddleware',
37 | 'django.contrib.sessions.middleware.SessionMiddleware',
38 | 'django.middleware.common.CommonMiddleware',
39 | 'django.middleware.csrf.CsrfViewMiddleware',
40 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
41 | 'django.contrib.messages.middleware.MessageMiddleware',
42 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
43 | ]
44 |
45 | ROOT_URLCONF = 'ism.urls'
46 |
47 | TEMPLATES = [
48 | {
49 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
50 | 'DIRS': [BASE_DIR / 'templates'],
51 | 'APP_DIRS': True,
52 | 'OPTIONS': {
53 | 'context_processors': [
54 | 'django.template.context_processors.debug',
55 | 'django.template.context_processors.request',
56 | 'django.contrib.auth.context_processors.auth',
57 | 'django.contrib.messages.context_processors.messages',
58 | ],
59 | },
60 | },
61 | ]
62 |
63 | WSGI_APPLICATION = 'ism.wsgi.application'
64 |
65 |
66 | # Database
67 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
68 |
69 | DATABASES = {
70 | 'default': {
71 | 'ENGINE': 'django.db.backends.sqlite3',
72 | 'NAME': BASE_DIR / 'db.sqlite3',
73 | }
74 | }
75 |
76 |
77 | # Password validation
78 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
79 |
80 | AUTH_PASSWORD_VALIDATORS = [
81 | {
82 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
83 | },
84 | {
85 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
86 | },
87 | {
88 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
89 | },
90 | {
91 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
92 | },
93 | ]
94 |
95 |
96 | # Internationalization
97 | # https://docs.djangoproject.com/en/3.2/topics/i18n/
98 |
99 | LANGUAGE_CODE = 'en-us'
100 |
101 | TIME_ZONE = 'UTC'
102 |
103 | USE_I18N = True
104 |
105 | USE_L10N = True
106 |
107 | USE_TZ = True
108 |
109 | ##### For Localhost #####
110 |
111 | STATICFILES_DIRS = [BASE_DIR / 'static',]
112 | STATIC_URL = '/static/'
113 |
114 | MEDIA_URL = '/media/'
115 | MEDIA_ROOT = BASE_DIR / 'media'
116 | # STATIC_ROOT = BASE_DIR / 'static'
117 |
118 | ##### For Server #######
119 |
120 | # MEDIA_ROOT = '/home/ism/ism/media'
121 | # MEDIA_URL = '/media/'
122 | # STATIC_ROOT = '/home/ism/ism/static'
123 | # STATIC_URL = '/static/'
124 |
125 | LOGIN_URL = 'login'
126 | LOGIN_REDIRECT_URL = 'home'
127 |
128 | CRISPY_TEMPLATE_PACK = 'bootstrap4'
129 |
130 | # Default primary key field type
131 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
132 |
133 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
134 |
135 | EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
136 | EMAIL_HOST = 'smtp.gmail.com'
137 | EMAIL_PORT = 587
138 | EMAIL_HOST_USER = 'YOUR EMAIL'
139 | EMAIL_HOST_PASSWORD = 'EMAIL PASSWORD'
140 | EMAIL_USE_TLS = True
--------------------------------------------------------------------------------
/static/bootstrap/css/bootstrap-reboot.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v5.0.0-beta3 (https://getbootstrap.com/)
3 | * Copyright 2011-2021 The Bootstrap Authors
4 | * Copyright 2011-2021 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}
8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */
--------------------------------------------------------------------------------
/static/bootstrap/css/bootstrap-reboot.rtl.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v5.0.0-beta3 (https://getbootstrap.com/)
3 | * Copyright 2011-2021 The Bootstrap Authors
4 | * Copyright 2011-2021 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-right:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-right:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:right}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:right;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:right}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}[type=email],[type=number],[type=tel],[type=url]{direction:ltr}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}
8 | /*# sourceMappingURL=bootstrap-reboot.rtl.min.css.map */
--------------------------------------------------------------------------------
/main/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import render, redirect, get_object_or_404
2 | from django.urls import reverse
3 | from django.contrib.auth.decorators import login_required
4 | from django.contrib.auth.models import User
5 | from django.contrib import messages
6 | import random, string
7 | from django.core.mail import send_mail
8 | from django.conf import settings
9 | from django.contrib.auth.forms import PasswordChangeForm
10 |
11 | @login_required
12 | def index(request):
13 |
14 | # print(request.scheme+"://"+request.get_host()+reverse('password_reset'))
15 | return render(request, 'main/index.html', {'title': "Home"})
16 |
17 | @login_required
18 | def create_user(request):
19 | if not request.user.is_superuser:
20 | return redirect("home")
21 |
22 | if request.method == "POST":
23 | fname = request.POST.get('fname')
24 | lname = request.POST.get('lname')
25 | email = request.POST.get('email')
26 | admin = request.POST.get('admin')
27 | letters = string.ascii_letters
28 | passwd = ''.join(random.choice(letters) for letter in range(12))
29 | user = User.objects.create_user(email, email, passwd)
30 | user.first_name = fname
31 | user.last_name = lname
32 | if admin != None:
33 | user.is_superuser = True
34 | user.is_staff = True
35 | user.save()
36 | messages.success(request, 'Account for user {} has been created'.format(email))
37 | send_mail("Your Account has been Created at ISM",
38 | f"Hello {fname} {lname} \nYour Account has been Created at ISM patna certificate generator site. you have to set your password. \n \
39 | \nSteps for reset you password:-\n1) Open {request.scheme}://{request.get_host()+reverse('password_reset')}\
40 | \n2) Enter your email and press reset button. \n3) Open the email send by us and click the link. \
41 | \n4) Set your strong password. \nNow You Done you can login into your account by email as username and your password\
42 | \nRemember your email is your username at this site\nThanks and Regards!",
43 | settings.EMAIL_HOST_USER,
44 | [email],
45 | fail_silently = False)
46 |
47 |
48 | return render(request, 'admin/create_user.html', {
49 | 'title': "User Registration"
50 | })
51 |
52 |
53 | @login_required
54 | def view_users(request):
55 | if not request.user.is_superuser:
56 | return redirect("home")
57 | if request.method == "POST":
58 | username = request.POST.get('username')
59 | user = get_object_or_404(User, username = username)
60 | fname = user.first_name
61 | lname = user.last_name
62 | email = user.email
63 | send_mail("Your Account had been deleted",
64 | f"Hello {fname} {lname} \nYour Account has been deleted form ISM patna certificate generator website by {request.user.first_name} {request.user.last_name}\nThanks and Regards!",
65 | settings.EMAIL_HOST_USER,
66 | [email],
67 | fail_silently = False)
68 |
69 | user.delete()
70 | messages.success(request, 'User {} has been deleted successfully'.format(username))
71 |
72 | return render(request, 'admin/view_users.html', {
73 | 'users': User.objects.all(),
74 | 'title': "Users"
75 | })
76 |
77 | @login_required
78 | def edit_user(request, username):
79 | if not request.user.is_superuser:
80 | return redirect("home")
81 |
82 | if request.method == "POST":
83 | fname = request.POST.get('fname')
84 | lname = request.POST.get('lname')
85 | email = request.POST.get('email')
86 | admin = request.POST.get('admin')
87 |
88 | user = User.objects.get(username=email)
89 | user.first_name = fname
90 | user.last_name = lname
91 | if admin != None:
92 | user.is_superuser = True
93 | user.is_staff = True
94 | else:
95 | user.is_superuser = False
96 | user.is_staff = False
97 | user.save()
98 | send_mail(f"Your Account had been edited ",
99 | f"Hello {fname} {lname} \nYour Account had been edited by {request.user.first_name} {request.user.last_name}\nThanks and Regards!",
100 | settings.EMAIL_HOST_USER,
101 | [email],
102 | fail_silently = False)
103 |
104 | return redirect('view_users')
105 |
106 | return render(request, 'admin/edit_user.html', {
107 | 'user': User.objects.get(username=username),
108 | 'title': "Edit User",
109 | })
110 |
111 | @login_required
112 | def change_password(request):
113 | if request.method == 'POST':
114 | passChangeForm = PasswordChangeForm(request.user, request.POST)
115 | if passChangeForm.is_valid():
116 | passChangeForm.save()
117 | messages.success(request, f'Password had been changed successfully')
118 | else:
119 | passChangeForm = PasswordChangeForm(request.user)
120 |
121 | return render(request, "change_password.html",{'form': passChangeForm, 'title': "Change Password"})
--------------------------------------------------------------------------------
/templates/base.html:
--------------------------------------------------------------------------------
1 |
2 | {% load static %}
3 |
4 |
5 | '+a.addText+" "),l=d.find("tr:last a")):(c.filter(":last").after('"),l=c.filter(":last").next().find("a")));l.on("click",function(d){d.preventDefault();d=b("#"+a.prefix+"-empty");
6 | var c=d.clone(!0);c.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+h);c.is("tr")?c.children(":last").append('"):c.is("ul")||c.is("ol")?c.append(''+a.deleteText+" "):c.children(":first").append(''+a.deleteText+" ");c.find("*").each(function(){f(this,a.prefix,g.val())});c.insertBefore(b(d));
7 | b(g).val(parseInt(g.val(),10)+1);h+=1;""!==e.val()&&0>=e.val()-g.val()&&l.parent().hide();c.find("a."+a.deleteCssClass).on("click",function(d){d.preventDefault();c.remove();--h;a.removed&&a.removed(c);b(document).trigger("formset:removed",[c,a.prefix]);d=b("."+a.formCssClass);b("#id_"+a.prefix+"-TOTAL_FORMS").val(d.length);(""===e.val()||0 tr",b(d).tabularFormset(d,a.options)}})})})(django.jQuery);
14 |
--------------------------------------------------------------------------------
/static/admin/js/SelectBox.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | 'use strict';
3 | var SelectBox = {
4 | cache: {},
5 | init: function(id) {
6 | var box = document.getElementById(id);
7 | var node;
8 | SelectBox.cache[id] = [];
9 | var cache = SelectBox.cache[id];
10 | var boxOptions = box.options;
11 | var boxOptionsLength = boxOptions.length;
12 | for (var i = 0, j = boxOptionsLength; i < j; i++) {
13 | node = boxOptions[i];
14 | cache.push({value: node.value, text: node.text, displayed: 1});
15 | }
16 | },
17 | redisplay: function(id) {
18 | // Repopulate HTML select box from cache
19 | var box = document.getElementById(id);
20 | var node;
21 | $(box).empty(); // clear all options
22 | var new_options = box.outerHTML.slice(0, -9); // grab just the opening tag
23 | var cache = SelectBox.cache[id];
24 | for (var i = 0, j = cache.length; i < j; i++) {
25 | node = cache[i];
26 | if (node.displayed) {
27 | var new_option = new Option(node.text, node.value, false, false);
28 | // Shows a tooltip when hovering over the option
29 | new_option.setAttribute("title", node.text);
30 | new_options += new_option.outerHTML;
31 | }
32 | }
33 | new_options += '';
34 | box.outerHTML = new_options;
35 | },
36 | filter: function(id, text) {
37 | // Redisplay the HTML select box, displaying only the choices containing ALL
38 | // the words in text. (It's an AND search.)
39 | var tokens = text.toLowerCase().split(/\s+/);
40 | var node, token;
41 | var cache = SelectBox.cache[id];
42 | for (var i = 0, j = cache.length; i < j; i++) {
43 | node = cache[i];
44 | node.displayed = 1;
45 | var node_text = node.text.toLowerCase();
46 | var numTokens = tokens.length;
47 | for (var k = 0; k < numTokens; k++) {
48 | token = tokens[k];
49 | if (node_text.indexOf(token) === -1) {
50 | node.displayed = 0;
51 | break; // Once the first token isn't found we're done
52 | }
53 | }
54 | }
55 | SelectBox.redisplay(id);
56 | },
57 | delete_from_cache: function(id, value) {
58 | var node, delete_index = null;
59 | var cache = SelectBox.cache[id];
60 | for (var i = 0, j = cache.length; i < j; i++) {
61 | node = cache[i];
62 | if (node.value === value) {
63 | delete_index = i;
64 | break;
65 | }
66 | }
67 | cache.splice(delete_index, 1);
68 | },
69 | add_to_cache: function(id, option) {
70 | SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1});
71 | },
72 | cache_contains: function(id, value) {
73 | // Check if an item is contained in the cache
74 | var node;
75 | var cache = SelectBox.cache[id];
76 | for (var i = 0, j = cache.length; i < j; i++) {
77 | node = cache[i];
78 | if (node.value === value) {
79 | return true;
80 | }
81 | }
82 | return false;
83 | },
84 | move: function(from, to) {
85 | var from_box = document.getElementById(from);
86 | var option;
87 | var boxOptions = from_box.options;
88 | var boxOptionsLength = boxOptions.length;
89 | for (var i = 0, j = boxOptionsLength; i < j; i++) {
90 | option = boxOptions[i];
91 | var option_value = option.value;
92 | if (option.selected && SelectBox.cache_contains(from, option_value)) {
93 | SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1});
94 | SelectBox.delete_from_cache(from, option_value);
95 | }
96 | }
97 | SelectBox.redisplay(from);
98 | SelectBox.redisplay(to);
99 | },
100 | move_all: function(from, to) {
101 | var from_box = document.getElementById(from);
102 | var option;
103 | var boxOptions = from_box.options;
104 | var boxOptionsLength = boxOptions.length;
105 | for (var i = 0, j = boxOptionsLength; i < j; i++) {
106 | option = boxOptions[i];
107 | var option_value = option.value;
108 | if (SelectBox.cache_contains(from, option_value)) {
109 | SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1});
110 | SelectBox.delete_from_cache(from, option_value);
111 | }
112 | }
113 | SelectBox.redisplay(from);
114 | SelectBox.redisplay(to);
115 | },
116 | sort: function(id) {
117 | SelectBox.cache[id].sort(function(a, b) {
118 | a = a.text.toLowerCase();
119 | b = b.text.toLowerCase();
120 | try {
121 | if (a > b) {
122 | return 1;
123 | }
124 | if (a < b) {
125 | return -1;
126 | }
127 | }
128 | catch (e) {
129 | // silently fail on IE 'unknown' exception
130 | }
131 | return 0;
132 | } );
133 | },
134 | select_all: function(id) {
135 | var box = document.getElementById(id);
136 | var boxOptions = box.options;
137 | var boxOptionsLength = boxOptions.length;
138 | for (var i = 0; i < boxOptionsLength; i++) {
139 | boxOptions[i].selected = 'selected';
140 | }
141 | }
142 | };
143 | window.SelectBox = SelectBox;
144 | })(django.jQuery);
145 |
--------------------------------------------------------------------------------
/static/admin/js/actions.js:
--------------------------------------------------------------------------------
1 | /*global gettext, interpolate, ngettext*/
2 | (function($) {
3 | 'use strict';
4 | var lastChecked;
5 |
6 | $.fn.actions = function(opts) {
7 | var options = $.extend({}, $.fn.actions.defaults, opts);
8 | var actionCheckboxes = $(this);
9 | var list_editable_changed = false;
10 | var showQuestion = function() {
11 | $(options.acrossClears).hide();
12 | $(options.acrossQuestions).show();
13 | $(options.allContainer).hide();
14 | },
15 | showClear = function() {
16 | $(options.acrossClears).show();
17 | $(options.acrossQuestions).hide();
18 | $(options.actionContainer).toggleClass(options.selectedClass);
19 | $(options.allContainer).show();
20 | $(options.counterContainer).hide();
21 | },
22 | reset = function() {
23 | $(options.acrossClears).hide();
24 | $(options.acrossQuestions).hide();
25 | $(options.allContainer).hide();
26 | $(options.counterContainer).show();
27 | },
28 | clearAcross = function() {
29 | reset();
30 | $(options.acrossInput).val(0);
31 | $(options.actionContainer).removeClass(options.selectedClass);
32 | },
33 | checker = function(checked) {
34 | if (checked) {
35 | showQuestion();
36 | } else {
37 | reset();
38 | }
39 | $(actionCheckboxes).prop("checked", checked)
40 | .parent().parent().toggleClass(options.selectedClass, checked);
41 | },
42 | updateCounter = function() {
43 | var sel = $(actionCheckboxes).filter(":checked").length;
44 | // data-actions-icnt is defined in the generated HTML
45 | // and contains the total amount of objects in the queryset
46 | var actions_icnt = $('.action-counter').data('actionsIcnt');
47 | $(options.counterContainer).html(interpolate(
48 | ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), {
49 | sel: sel,
50 | cnt: actions_icnt
51 | }, true));
52 | $(options.allToggle).prop("checked", function() {
53 | var value;
54 | if (sel === actionCheckboxes.length) {
55 | value = true;
56 | showQuestion();
57 | } else {
58 | value = false;
59 | clearAcross();
60 | }
61 | return value;
62 | });
63 | };
64 | // Show counter by default
65 | $(options.counterContainer).show();
66 | // Check state of checkboxes and reinit state if needed
67 | $(this).filter(":checked").each(function(i) {
68 | $(this).parent().parent().toggleClass(options.selectedClass);
69 | updateCounter();
70 | if ($(options.acrossInput).val() === 1) {
71 | showClear();
72 | }
73 | });
74 | $(options.allToggle).show().on('click', function() {
75 | checker($(this).prop("checked"));
76 | updateCounter();
77 | });
78 | $("a", options.acrossQuestions).on('click', function(event) {
79 | event.preventDefault();
80 | $(options.acrossInput).val(1);
81 | showClear();
82 | });
83 | $("a", options.acrossClears).on('click', function(event) {
84 | event.preventDefault();
85 | $(options.allToggle).prop("checked", false);
86 | clearAcross();
87 | checker(0);
88 | updateCounter();
89 | });
90 | lastChecked = null;
91 | $(actionCheckboxes).on('click', function(event) {
92 | if (!event) { event = window.event; }
93 | var target = event.target ? event.target : event.srcElement;
94 | if (lastChecked && $.data(lastChecked) !== $.data(target) && event.shiftKey === true) {
95 | var inrange = false;
96 | $(lastChecked).prop("checked", target.checked)
97 | .parent().parent().toggleClass(options.selectedClass, target.checked);
98 | $(actionCheckboxes).each(function() {
99 | if ($.data(this) === $.data(lastChecked) || $.data(this) === $.data(target)) {
100 | inrange = (inrange) ? false : true;
101 | }
102 | if (inrange) {
103 | $(this).prop("checked", target.checked)
104 | .parent().parent().toggleClass(options.selectedClass, target.checked);
105 | }
106 | });
107 | }
108 | $(target).parent().parent().toggleClass(options.selectedClass, target.checked);
109 | lastChecked = target;
110 | updateCounter();
111 | });
112 | $('form#changelist-form table#result_list tr').on('change', 'td:gt(0) :input', function() {
113 | list_editable_changed = true;
114 | });
115 | $('form#changelist-form button[name="index"]').on('click', function(event) {
116 | if (list_editable_changed) {
117 | return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."));
118 | }
119 | });
120 | $('form#changelist-form input[name="_save"]').on('click', function(event) {
121 | var action_changed = false;
122 | $('select option:selected', options.actionContainer).each(function() {
123 | if ($(this).val()) {
124 | action_changed = true;
125 | }
126 | });
127 | if (action_changed) {
128 | if (list_editable_changed) {
129 | return confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action."));
130 | } else {
131 | return confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."));
132 | }
133 | }
134 | });
135 | };
136 | /* Setup plugin defaults */
137 | $.fn.actions.defaults = {
138 | actionContainer: "div.actions",
139 | counterContainer: "span.action-counter",
140 | allContainer: "div.actions span.all",
141 | acrossInput: "div.actions input.select-across",
142 | acrossQuestions: "div.actions span.question",
143 | acrossClears: "div.actions span.clear",
144 | allToggle: "#action-toggle",
145 | selectedClass: "selected"
146 | };
147 | $(document).ready(function() {
148 | var $actionsEls = $('tr input.action-select');
149 | if ($actionsEls.length > 0) {
150 | $actionsEls.actions();
151 | }
152 | });
153 | })(django.jQuery);
154 |
--------------------------------------------------------------------------------
/static/admin/js/admin/RelatedObjectLookups.js:
--------------------------------------------------------------------------------
1 | /*global SelectBox, interpolate*/
2 | // Handles related-objects functionality: lookup link for raw_id_fields
3 | // and Add Another links.
4 |
5 | (function($) {
6 | 'use strict';
7 |
8 | // IE doesn't accept periods or dashes in the window name, but the element IDs
9 | // we use to generate popup window names may contain them, therefore we map them
10 | // to allowed characters in a reversible way so that we can locate the correct
11 | // element when the popup window is dismissed.
12 | function id_to_windowname(text) {
13 | text = text.replace(/\./g, '__dot__');
14 | text = text.replace(/\-/g, '__dash__');
15 | return text;
16 | }
17 |
18 | function windowname_to_id(text) {
19 | text = text.replace(/__dot__/g, '.');
20 | text = text.replace(/__dash__/g, '-');
21 | return text;
22 | }
23 |
24 | function showAdminPopup(triggeringLink, name_regexp, add_popup) {
25 | var name = triggeringLink.id.replace(name_regexp, '');
26 | name = id_to_windowname(name);
27 | var href = triggeringLink.href;
28 | if (add_popup) {
29 | if (href.indexOf('?') === -1) {
30 | href += '?_popup=1';
31 | } else {
32 | href += '&_popup=1';
33 | }
34 | }
35 | var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
36 | win.focus();
37 | return false;
38 | }
39 |
40 | function showRelatedObjectLookupPopup(triggeringLink) {
41 | return showAdminPopup(triggeringLink, /^lookup_/, true);
42 | }
43 |
44 | function dismissRelatedLookupPopup(win, chosenId) {
45 | var name = windowname_to_id(win.name);
46 | var elem = document.getElementById(name);
47 | if (elem.className.indexOf('vManyToManyRawIdAdminField') !== -1 && elem.value) {
48 | elem.value += ',' + chosenId;
49 | } else {
50 | document.getElementById(name).value = chosenId;
51 | }
52 | win.close();
53 | }
54 |
55 | function showRelatedObjectPopup(triggeringLink) {
56 | return showAdminPopup(triggeringLink, /^(change|add|delete)_/, false);
57 | }
58 |
59 | function updateRelatedObjectLinks(triggeringLink) {
60 | var $this = $(triggeringLink);
61 | var siblings = $this.nextAll('.view-related, .change-related, .delete-related');
62 | if (!siblings.length) {
63 | return;
64 | }
65 | var value = $this.val();
66 | if (value) {
67 | siblings.each(function() {
68 | var elm = $(this);
69 | elm.attr('href', elm.attr('data-href-template').replace('__fk__', value));
70 | });
71 | } else {
72 | siblings.removeAttr('href');
73 | }
74 | }
75 |
76 | function dismissAddRelatedObjectPopup(win, newId, newRepr) {
77 | var name = windowname_to_id(win.name);
78 | var elem = document.getElementById(name);
79 | if (elem) {
80 | var elemName = elem.nodeName.toUpperCase();
81 | if (elemName === 'SELECT') {
82 | elem.options[elem.options.length] = new Option(newRepr, newId, true, true);
83 | } else if (elemName === 'INPUT') {
84 | if (elem.className.indexOf('vManyToManyRawIdAdminField') !== -1 && elem.value) {
85 | elem.value += ',' + newId;
86 | } else {
87 | elem.value = newId;
88 | }
89 | }
90 | // Trigger a change event to update related links if required.
91 | $(elem).trigger('change');
92 | } else {
93 | var toId = name + "_to";
94 | var o = new Option(newRepr, newId);
95 | SelectBox.add_to_cache(toId, o);
96 | SelectBox.redisplay(toId);
97 | }
98 | win.close();
99 | }
100 |
101 | function dismissChangeRelatedObjectPopup(win, objId, newRepr, newId) {
102 | var id = windowname_to_id(win.name).replace(/^edit_/, '');
103 | var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]);
104 | var selects = $(selectsSelector);
105 | selects.find('option').each(function() {
106 | if (this.value === objId) {
107 | this.textContent = newRepr;
108 | this.value = newId;
109 | }
110 | });
111 | selects.next().find('.select2-selection__rendered').each(function() {
112 | // The element can have a clear button as a child.
113 | // Use the lastChild to modify only the displayed value.
114 | this.lastChild.textContent = newRepr;
115 | this.title = newRepr;
116 | });
117 | win.close();
118 | }
119 |
120 | function dismissDeleteRelatedObjectPopup(win, objId) {
121 | var id = windowname_to_id(win.name).replace(/^delete_/, '');
122 | var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]);
123 | var selects = $(selectsSelector);
124 | selects.find('option').each(function() {
125 | if (this.value === objId) {
126 | $(this).remove();
127 | }
128 | }).trigger('change');
129 | win.close();
130 | }
131 |
132 | // Global for testing purposes
133 | window.id_to_windowname = id_to_windowname;
134 | window.windowname_to_id = windowname_to_id;
135 |
136 | window.showRelatedObjectLookupPopup = showRelatedObjectLookupPopup;
137 | window.dismissRelatedLookupPopup = dismissRelatedLookupPopup;
138 | window.showRelatedObjectPopup = showRelatedObjectPopup;
139 | window.updateRelatedObjectLinks = updateRelatedObjectLinks;
140 | window.dismissAddRelatedObjectPopup = dismissAddRelatedObjectPopup;
141 | window.dismissChangeRelatedObjectPopup = dismissChangeRelatedObjectPopup;
142 | window.dismissDeleteRelatedObjectPopup = dismissDeleteRelatedObjectPopup;
143 |
144 | // Kept for backward compatibility
145 | window.showAddAnotherPopup = showRelatedObjectPopup;
146 | window.dismissAddAnotherPopup = dismissAddRelatedObjectPopup;
147 |
148 | $(document).ready(function() {
149 | $("a[data-popup-opener]").on('click', function(event) {
150 | event.preventDefault();
151 | opener.dismissRelatedLookupPopup(window, $(this).data("popup-opener"));
152 | });
153 | $('body').on('click', '.related-widget-wrapper-link', function(e) {
154 | e.preventDefault();
155 | if (this.href) {
156 | var event = $.Event('django:show-related', {href: this.href});
157 | $(this).trigger(event);
158 | if (!event.isDefaultPrevented()) {
159 | showRelatedObjectPopup(this);
160 | }
161 | }
162 | });
163 | $('body').on('change', '.related-widget-wrapper select', function(e) {
164 | var event = $.Event('django:update-related');
165 | $(this).trigger(event);
166 | if (!event.isDefaultPrevented()) {
167 | updateRelatedObjectLinks(this);
168 | }
169 | });
170 | $('.related-widget-wrapper select').trigger('change');
171 | $('body').on('click', '.related-lookup', function(e) {
172 | e.preventDefault();
173 | var event = $.Event('django:lookup-related');
174 | $(this).trigger(event);
175 | if (!event.isDefaultPrevented()) {
176 | showRelatedObjectLookupPopup(this);
177 | }
178 | });
179 | });
180 |
181 | })(django.jQuery);
182 |
--------------------------------------------------------------------------------
/static/admin/css/changelists.css:
--------------------------------------------------------------------------------
1 | /* CHANGELISTS */
2 |
3 | #changelist {
4 | position: relative;
5 | width: 100%;
6 | }
7 |
8 | #changelist table {
9 | width: 100%;
10 | }
11 |
12 | .change-list .hiddenfields { display:none; }
13 |
14 | .change-list .filtered table {
15 | border-right: none;
16 | }
17 |
18 | .change-list .filtered {
19 | min-height: 400px;
20 | }
21 |
22 | .change-list .filtered .results, .change-list .filtered .paginator,
23 | .filtered #toolbar, .filtered div.xfull {
24 | margin-right: 280px;
25 | width: auto;
26 | }
27 |
28 | .change-list .filtered table tbody th {
29 | padding-right: 1em;
30 | }
31 |
32 | #changelist-form .results {
33 | overflow-x: auto;
34 | }
35 |
36 | #changelist .toplinks {
37 | border-bottom: 1px solid #ddd;
38 | }
39 |
40 | #changelist .paginator {
41 | color: #666;
42 | border-bottom: 1px solid #eee;
43 | background: #fff;
44 | overflow: hidden;
45 | }
46 |
47 | /* CHANGELIST TABLES */
48 |
49 | #changelist table thead th {
50 | padding: 0;
51 | white-space: nowrap;
52 | vertical-align: middle;
53 | }
54 |
55 | #changelist table thead th.action-checkbox-column {
56 | width: 1.5em;
57 | text-align: center;
58 | }
59 |
60 | #changelist table tbody td.action-checkbox {
61 | text-align: center;
62 | }
63 |
64 | #changelist table tfoot {
65 | color: #666;
66 | }
67 |
68 | /* TOOLBAR */
69 |
70 | #changelist #toolbar {
71 | padding: 8px 10px;
72 | margin-bottom: 15px;
73 | border-top: 1px solid #eee;
74 | border-bottom: 1px solid #eee;
75 | background: #f8f8f8;
76 | color: #666;
77 | }
78 |
79 | #changelist #toolbar form input {
80 | border-radius: 4px;
81 | font-size: 14px;
82 | padding: 5px;
83 | color: #333;
84 | }
85 |
86 | #changelist #toolbar form #searchbar {
87 | height: 19px;
88 | border: 1px solid #ccc;
89 | padding: 2px 5px;
90 | margin: 0;
91 | vertical-align: top;
92 | font-size: 13px;
93 | }
94 |
95 | #changelist #toolbar form #searchbar:focus {
96 | border-color: #999;
97 | }
98 |
99 | #changelist #toolbar form input[type="submit"] {
100 | border: 1px solid #ccc;
101 | padding: 2px 10px;
102 | margin: 0;
103 | vertical-align: middle;
104 | background: #fff;
105 | box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset;
106 | cursor: pointer;
107 | color: #333;
108 | }
109 |
110 | #changelist #toolbar form input[type="submit"]:focus,
111 | #changelist #toolbar form input[type="submit"]:hover {
112 | border-color: #999;
113 | }
114 |
115 | #changelist #changelist-search img {
116 | vertical-align: middle;
117 | margin-right: 4px;
118 | }
119 |
120 | /* FILTER COLUMN */
121 |
122 | #changelist-filter {
123 | position: absolute;
124 | top: 0;
125 | right: 0;
126 | z-index: 1000;
127 | width: 240px;
128 | background: #f8f8f8;
129 | border-left: none;
130 | margin: 0;
131 | }
132 |
133 | #changelist-filter h2 {
134 | font-size: 14px;
135 | text-transform: uppercase;
136 | letter-spacing: 0.5px;
137 | padding: 5px 15px;
138 | margin-bottom: 12px;
139 | border-bottom: none;
140 | }
141 |
142 | #changelist-filter h3 {
143 | font-weight: 400;
144 | font-size: 14px;
145 | padding: 0 15px;
146 | margin-bottom: 10px;
147 | }
148 |
149 | #changelist-filter ul {
150 | margin: 5px 0;
151 | padding: 0 15px 15px;
152 | border-bottom: 1px solid #eaeaea;
153 | }
154 |
155 | #changelist-filter ul:last-child {
156 | border-bottom: none;
157 | padding-bottom: none;
158 | }
159 |
160 | #changelist-filter li {
161 | list-style-type: none;
162 | margin-left: 0;
163 | padding-left: 0;
164 | }
165 |
166 | #changelist-filter a {
167 | display: block;
168 | color: #999;
169 | text-overflow: ellipsis;
170 | overflow-x: hidden;
171 | }
172 |
173 | #changelist-filter li.selected {
174 | border-left: 5px solid #eaeaea;
175 | padding-left: 10px;
176 | margin-left: -15px;
177 | }
178 |
179 | #changelist-filter li.selected a {
180 | color: #5b80b2;
181 | }
182 |
183 | #changelist-filter a:focus, #changelist-filter a:hover,
184 | #changelist-filter li.selected a:focus,
185 | #changelist-filter li.selected a:hover {
186 | color: #036;
187 | }
188 |
189 | /* DATE DRILLDOWN */
190 |
191 | .change-list ul.toplinks {
192 | display: block;
193 | float: left;
194 | padding: 0;
195 | margin: 0;
196 | width: 100%;
197 | }
198 |
199 | .change-list ul.toplinks li {
200 | padding: 3px 6px;
201 | font-weight: bold;
202 | list-style-type: none;
203 | display: inline-block;
204 | }
205 |
206 | .change-list ul.toplinks .date-back a {
207 | color: #999;
208 | }
209 |
210 | .change-list ul.toplinks .date-back a:focus,
211 | .change-list ul.toplinks .date-back a:hover {
212 | color: #036;
213 | }
214 |
215 | /* PAGINATOR */
216 |
217 | .paginator {
218 | font-size: 13px;
219 | padding-top: 10px;
220 | padding-bottom: 10px;
221 | line-height: 22px;
222 | margin: 0;
223 | border-top: 1px solid #ddd;
224 | }
225 |
226 | .paginator a:link, .paginator a:visited {
227 | padding: 2px 6px;
228 | background: #79aec8;
229 | text-decoration: none;
230 | color: #fff;
231 | }
232 |
233 | .paginator a.showall {
234 | padding: 0;
235 | border: none;
236 | background: none;
237 | color: #5b80b2;
238 | }
239 |
240 | .paginator a.showall:focus, .paginator a.showall:hover {
241 | background: none;
242 | color: #036;
243 | }
244 |
245 | .paginator .end {
246 | margin-right: 6px;
247 | }
248 |
249 | .paginator .this-page {
250 | padding: 2px 6px;
251 | font-weight: bold;
252 | font-size: 13px;
253 | vertical-align: top;
254 | }
255 |
256 | .paginator a:focus, .paginator a:hover {
257 | color: white;
258 | background: #036;
259 | }
260 |
261 | /* ACTIONS */
262 |
263 | .filtered .actions {
264 | margin-right: 280px;
265 | border-right: none;
266 | }
267 |
268 | #changelist table input {
269 | margin: 0;
270 | vertical-align: baseline;
271 | }
272 |
273 | #changelist table tbody tr.selected {
274 | background-color: #FFFFCC;
275 | }
276 |
277 | #changelist .actions {
278 | padding: 10px;
279 | background: #fff;
280 | border-top: none;
281 | border-bottom: none;
282 | line-height: 24px;
283 | color: #999;
284 | }
285 |
286 | #changelist .actions.selected {
287 | background: #fffccf;
288 | border-top: 1px solid #fffee8;
289 | border-bottom: 1px solid #edecd6;
290 | }
291 |
292 | #changelist .actions span.all,
293 | #changelist .actions span.action-counter,
294 | #changelist .actions span.clear,
295 | #changelist .actions span.question {
296 | font-size: 13px;
297 | margin: 0 0.5em;
298 | display: none;
299 | }
300 |
301 | #changelist .actions:last-child {
302 | border-bottom: none;
303 | }
304 |
305 | #changelist .actions select {
306 | vertical-align: top;
307 | height: 24px;
308 | background: none;
309 | color: #000;
310 | border: 1px solid #ccc;
311 | border-radius: 4px;
312 | font-size: 14px;
313 | padding: 0 0 0 4px;
314 | margin: 0;
315 | margin-left: 10px;
316 | }
317 |
318 | #changelist .actions select:focus {
319 | border-color: #999;
320 | }
321 |
322 | #changelist .actions label {
323 | display: inline-block;
324 | vertical-align: middle;
325 | font-size: 13px;
326 | }
327 |
328 | #changelist .actions .button {
329 | font-size: 13px;
330 | border: 1px solid #ccc;
331 | border-radius: 4px;
332 | background: #fff;
333 | box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset;
334 | cursor: pointer;
335 | height: 24px;
336 | line-height: 1;
337 | padding: 4px 8px;
338 | margin: 0;
339 | color: #333;
340 | }
341 |
342 | #changelist .actions .button:focus, #changelist .actions .button:hover {
343 | border-color: #999;
344 | }
345 |
--------------------------------------------------------------------------------
/static/admin/js/core.js:
--------------------------------------------------------------------------------
1 | // Core javascript helper functions
2 |
3 | // basic browser identification & version
4 | var isOpera = (navigator.userAgent.indexOf("Opera") >= 0) && parseFloat(navigator.appVersion);
5 | var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]);
6 |
7 | // quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]);
8 | function quickElement() {
9 | 'use strict';
10 | var obj = document.createElement(arguments[0]);
11 | if (arguments[2]) {
12 | var textNode = document.createTextNode(arguments[2]);
13 | obj.appendChild(textNode);
14 | }
15 | var len = arguments.length;
16 | for (var i = 3; i < len; i += 2) {
17 | obj.setAttribute(arguments[i], arguments[i + 1]);
18 | }
19 | arguments[1].appendChild(obj);
20 | return obj;
21 | }
22 |
23 | // "a" is reference to an object
24 | function removeChildren(a) {
25 | 'use strict';
26 | while (a.hasChildNodes()) {
27 | a.removeChild(a.lastChild);
28 | }
29 | }
30 |
31 | // ----------------------------------------------------------------------------
32 | // Find-position functions by PPK
33 | // See https://www.quirksmode.org/js/findpos.html
34 | // ----------------------------------------------------------------------------
35 | function findPosX(obj) {
36 | 'use strict';
37 | var curleft = 0;
38 | if (obj.offsetParent) {
39 | while (obj.offsetParent) {
40 | curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft);
41 | obj = obj.offsetParent;
42 | }
43 | // IE offsetParent does not include the top-level
44 | if (isIE && obj.parentElement) {
45 | curleft += obj.offsetLeft - obj.scrollLeft;
46 | }
47 | } else if (obj.x) {
48 | curleft += obj.x;
49 | }
50 | return curleft;
51 | }
52 |
53 | function findPosY(obj) {
54 | 'use strict';
55 | var curtop = 0;
56 | if (obj.offsetParent) {
57 | while (obj.offsetParent) {
58 | curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop);
59 | obj = obj.offsetParent;
60 | }
61 | // IE offsetParent does not include the top-level
62 | if (isIE && obj.parentElement) {
63 | curtop += obj.offsetTop - obj.scrollTop;
64 | }
65 | } else if (obj.y) {
66 | curtop += obj.y;
67 | }
68 | return curtop;
69 | }
70 |
71 | //-----------------------------------------------------------------------------
72 | // Date object extensions
73 | // ----------------------------------------------------------------------------
74 | (function() {
75 | 'use strict';
76 | Date.prototype.getTwelveHours = function() {
77 | var hours = this.getHours();
78 | if (hours === 0) {
79 | return 12;
80 | }
81 | else {
82 | return hours <= 12 ? hours : hours - 12;
83 | }
84 | };
85 |
86 | Date.prototype.getTwoDigitMonth = function() {
87 | return (this.getMonth() < 9) ? '0' + (this.getMonth() + 1) : (this.getMonth() + 1);
88 | };
89 |
90 | Date.prototype.getTwoDigitDate = function() {
91 | return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate();
92 | };
93 |
94 | Date.prototype.getTwoDigitTwelveHour = function() {
95 | return (this.getTwelveHours() < 10) ? '0' + this.getTwelveHours() : this.getTwelveHours();
96 | };
97 |
98 | Date.prototype.getTwoDigitHour = function() {
99 | return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours();
100 | };
101 |
102 | Date.prototype.getTwoDigitMinute = function() {
103 | return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes();
104 | };
105 |
106 | Date.prototype.getTwoDigitSecond = function() {
107 | return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds();
108 | };
109 |
110 | Date.prototype.getHourMinute = function() {
111 | return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute();
112 | };
113 |
114 | Date.prototype.getHourMinuteSecond = function() {
115 | return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond();
116 | };
117 |
118 | Date.prototype.getFullMonthName = function() {
119 | return typeof window.CalendarNamespace === "undefined"
120 | ? this.getTwoDigitMonth()
121 | : window.CalendarNamespace.monthsOfYear[this.getMonth()];
122 | };
123 |
124 | Date.prototype.strftime = function(format) {
125 | var fields = {
126 | B: this.getFullMonthName(),
127 | c: this.toString(),
128 | d: this.getTwoDigitDate(),
129 | H: this.getTwoDigitHour(),
130 | I: this.getTwoDigitTwelveHour(),
131 | m: this.getTwoDigitMonth(),
132 | M: this.getTwoDigitMinute(),
133 | p: (this.getHours() >= 12) ? 'PM' : 'AM',
134 | S: this.getTwoDigitSecond(),
135 | w: '0' + this.getDay(),
136 | x: this.toLocaleDateString(),
137 | X: this.toLocaleTimeString(),
138 | y: ('' + this.getFullYear()).substr(2, 4),
139 | Y: '' + this.getFullYear(),
140 | '%': '%'
141 | };
142 | var result = '', i = 0;
143 | while (i < format.length) {
144 | if (format.charAt(i) === '%') {
145 | result = result + fields[format.charAt(i + 1)];
146 | ++i;
147 | }
148 | else {
149 | result = result + format.charAt(i);
150 | }
151 | ++i;
152 | }
153 | return result;
154 | };
155 |
156 | // ----------------------------------------------------------------------------
157 | // String object extensions
158 | // ----------------------------------------------------------------------------
159 | String.prototype.pad_left = function(pad_length, pad_string) {
160 | var new_string = this;
161 | for (var i = 0; new_string.length < pad_length; i++) {
162 | new_string = pad_string + new_string;
163 | }
164 | return new_string;
165 | };
166 |
167 | String.prototype.strptime = function(format) {
168 | var split_format = format.split(/[.\-/]/);
169 | var date = this.split(/[.\-/]/);
170 | var i = 0;
171 | var day, month, year;
172 | while (i < split_format.length) {
173 | switch (split_format[i]) {
174 | case "%d":
175 | day = date[i];
176 | break;
177 | case "%m":
178 | month = date[i] - 1;
179 | break;
180 | case "%Y":
181 | year = date[i];
182 | break;
183 | case "%y":
184 | year = date[i];
185 | break;
186 | }
187 | ++i;
188 | }
189 | // Create Date object from UTC since the parsed value is supposed to be
190 | // in UTC, not local time. Also, the calendar uses UTC functions for
191 | // date extraction.
192 | return new Date(Date.UTC(year, month, day));
193 | };
194 |
195 | })();
196 | // ----------------------------------------------------------------------------
197 | // Get the computed style for and element
198 | // ----------------------------------------------------------------------------
199 | function getStyle(oElm, strCssRule) {
200 | 'use strict';
201 | var strValue = "";
202 | if(document.defaultView && document.defaultView.getComputedStyle) {
203 | strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
204 | }
205 | else if(oElm.currentStyle) {
206 | strCssRule = strCssRule.replace(/\-(\w)/g, function(strMatch, p1) {
207 | return p1.toUpperCase();
208 | });
209 | strValue = oElm.currentStyle[strCssRule];
210 | }
211 | return strValue;
212 | }
213 |
--------------------------------------------------------------------------------