nodebb-plugin-sso-biogrenci 2.0.7 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/library.js
CHANGED
|
@@ -21,12 +21,12 @@ plugin.init = async function (params) {
|
|
|
21
21
|
const { router, middleware } = params;
|
|
22
22
|
winston.info(`${LOG_PREFIX} Initializing...`);
|
|
23
23
|
|
|
24
|
-
//
|
|
25
|
-
router.get('/
|
|
26
|
-
router.get('/api/
|
|
24
|
+
// Firsat page
|
|
25
|
+
router.get('/firsat', middleware.buildHeader, renderFirsatlar);
|
|
26
|
+
router.get('/api/firsat', renderFirsatlar);
|
|
27
27
|
|
|
28
28
|
// API proxy: fetch opportunities
|
|
29
|
-
router.get('/api/biogrenci/
|
|
29
|
+
router.get('/api/biogrenci/firsat', async (req, res) => {
|
|
30
30
|
try {
|
|
31
31
|
const data = await fetchOpportunities(req.query);
|
|
32
32
|
res.json(data);
|
|
@@ -40,7 +40,7 @@ plugin.init = async function (params) {
|
|
|
40
40
|
router.get('/admin/plugins/biogrenci', middleware.admin.buildHeader, renderAdmin);
|
|
41
41
|
router.get('/api/admin/plugins/biogrenci', renderAdmin);
|
|
42
42
|
|
|
43
|
-
winston.info(`${LOG_PREFIX} Ready — /
|
|
43
|
+
winston.info(`${LOG_PREFIX} Ready — /firsat`);
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
async function renderFirsatlar(req, res) {
|
package/package.json
CHANGED
package/static/lib/admin.js
CHANGED
|
@@ -1,60 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
define('admin/plugins/biogrenci', ['settings'], function (Settings) {
|
|
3
|
+
define('admin/plugins/biogrenci', ['settings', 'alerts'], function (Settings, alerts) {
|
|
4
4
|
var ACP = {};
|
|
5
5
|
|
|
6
|
-
console.log('[biogrenci] admin.js loaded, Settings module:', typeof Settings);
|
|
7
|
-
console.log('[biogrenci] Settings methods:', Settings ? Object.keys(Settings) : 'N/A');
|
|
8
|
-
console.log('[biogrenci] Settings.load:', typeof Settings.load);
|
|
9
|
-
console.log('[biogrenci] Settings.save:', typeof Settings.save);
|
|
10
|
-
console.log('[biogrenci] Settings constructor:', typeof Settings.prototype);
|
|
11
|
-
|
|
12
6
|
ACP.init = function () {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Settings.load('biogrenci', formEl, function () {
|
|
24
|
-
console.log('[biogrenci] Settings loaded successfully');
|
|
25
|
-
formEl.find('[data-key]').each(function () {
|
|
26
|
-
console.log('[biogrenci] loaded value -', $(this).attr('data-key') + ':', $(this).val());
|
|
7
|
+
Settings.load('biogrenci', $('#biogrenci-settings'));
|
|
8
|
+
|
|
9
|
+
$('#save').on('click', function () {
|
|
10
|
+
Settings.save('biogrenci', $('#biogrenci-settings'), function () {
|
|
11
|
+
alerts.alert({
|
|
12
|
+
type: 'success',
|
|
13
|
+
alert_id: 'biogrenci-settings-saved',
|
|
14
|
+
title: 'Ayarlar Kaydedildi',
|
|
15
|
+
message: 'bi\'öğrenci ayarları başarıyla kaydedildi.',
|
|
16
|
+
timeout: 2500,
|
|
27
17
|
});
|
|
28
18
|
});
|
|
29
|
-
console.log('[biogrenci] Settings.load() called without error');
|
|
30
|
-
} catch (e) {
|
|
31
|
-
console.error('[biogrenci] Settings.load() threw error:', e);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
var saveBtn = $('#save');
|
|
35
|
-
console.log('[biogrenci] Save button found:', saveBtn.length > 0);
|
|
36
|
-
|
|
37
|
-
saveBtn.on('click', function () {
|
|
38
|
-
console.log('[biogrenci] Save button clicked');
|
|
39
|
-
formEl.find('[data-key]').each(function () {
|
|
40
|
-
console.log('[biogrenci] saving -', $(this).attr('data-key') + ':', $(this).val());
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
try {
|
|
44
|
-
Settings.save('biogrenci', formEl, function () {
|
|
45
|
-
console.log('[biogrenci] Settings saved successfully!');
|
|
46
|
-
app.alert({
|
|
47
|
-
type: 'success',
|
|
48
|
-
alert_id: 'biogrenci-settings-saved',
|
|
49
|
-
title: 'Ayarlar Kaydedildi',
|
|
50
|
-
message: 'bi\'öğrenci ayarları başarıyla kaydedildi.',
|
|
51
|
-
timeout: 2500,
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
console.log('[biogrenci] Settings.save() called without error');
|
|
55
|
-
} catch (e) {
|
|
56
|
-
console.error('[biogrenci] Settings.save() threw error:', e);
|
|
57
|
-
}
|
|
58
19
|
});
|
|
59
20
|
};
|
|
60
21
|
|
|
@@ -65,7 +65,7 @@ define('forum/biogrenci-firsatlar', [], function () {
|
|
|
65
65
|
if (state.type) p.set('type', state.type);
|
|
66
66
|
if (state.search) p.set('search', state.search);
|
|
67
67
|
|
|
68
|
-
fetch(config.relative_path + '/api/biogrenci/
|
|
68
|
+
fetch(config.relative_path + '/api/biogrenci/firsat?' + p.toString())
|
|
69
69
|
.then(function (r) { return r.json(); })
|
|
70
70
|
.then(function (res) {
|
|
71
71
|
if (res.error) { empty(res.error); return; }
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<div class="panel-body">
|
|
6
6
|
<div class="alert alert-info">
|
|
7
7
|
<i class="fa fa-info-circle"></i> Bu plugin bi'öğrenci partner API'sinden öğrenci fırsatlarını çeker ve forumda gösterir.
|
|
8
|
-
Fırsatlar sayfası: <a href="/
|
|
8
|
+
Fırsatlar sayfası: <a href="/firsat" target="_blank"><strong>/firsat</strong></a>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<form id="biogrenci-settings">
|