srchub

srchub Commit Details


Date:2014-03-11 21:01:25 (10 years 9 months ago)
Author:Natalie Adams
Branch:master
Commit:822e1079589ae9aef1ac9e78bf85b87729b46e91
Parents: 22de793422fa15775008b5f7132c619599e87983
Message:Changing source preview to use new syntax highlighter fixing issue with QR OTP on user page

Changes:

File differences

indefero/src/IDF/FileUtil.php
6565
6666
6767
68
68
6969
7070
7171
7272
73
73
74
75
76
7477
7578
7679
}
$table = array();
$i = 1;
foreach (self::splitIntoLines($content) as $line) {
/*foreach (self::splitIntoLines($content) as $line) {
$table[] = '<tr class="c-line"><td class="code-lc" id="L'.$i.'"><a href="#L'.$i.'">'.$i.'</a></td>'
.'<td class="code mono'.$pretty.'">'.self::emphasizeControlCharacters(Pluf_esc($line)).'</td></tr>';
$i++;
}
return Pluf_Template::markSafe(implode("\n", $table));
return Pluf_Template::markSafe(implode("\n", $table));*/
//var_dump($fileinfo);
$content = '<script type="syntaxhighlighter" class="brush: ' . $fileinfo[2] . '">' . $content . '</script>';
return Pluf_Template::markSafe($content);
}
/**
indefero/src/IDF/Views/Source.php
380380
381381
382382
383
384
383
384
385
385386
386
387
387388
388389
389390
$props = $scm->getProperties($commit, $request_file);
$cache = Pluf_Cache::factory();
$key = sha1($request_file.$commit);
if (null === ($content=$cache->get($key))) {
$content = IDF_FileUtil::highLight($extra['mime'], $scm->getFile($request_file_info));
$content = IDF_FileUtil::highLight($extra['mime'], $scm->getFile($request_file_info));
/*if (null === ($content=$cache->get($key))) {
$cache->set($key, $content);
}
}*/
return Pluf_Shortcuts_RenderToResponse('idf/source/'.$scmConf.'/file.html',
array(
'page_title' => $page_title,
indefero/src/IDF/Views/User.php
5656
5757
5858
59
60
61
62
63
59
60
61
62
63
6464
6565
6666
......
114114
115115
116116
117
118
119
120
121
117
118
119
120
121
122122
123123
124124
125125
126126
127127
128
129
130
131
132
133
134
128
129
130
131
132
133
134
135135
136136
137137
......
147147
148148
149149
150
151
152
150
151
152
153153
154154
155155
......
166166
167167
168168
169
170
171
172
173
174
175
169
170
171
172
173
174
175
176176
177177
178178
......
233233
234234
235235
236
237
238
236
237
238
239239
240240
241241
......
286286
287287
288288
289
289
290290
291291
292292
293293
294
294
295295
296
296
297297
298
299
300
301
298
299
300
301
302
303
304
302305
303306
304
305307
306308
307309
......
311313
312314
313315
314
316
315317
316
317
318
319
318320
319321
320322
......
326328
327329
328330
329
331
330332
331333
332334
333335
334
336
337
335338
336339
337
338
340
341
339342
340343
341344
......
349352
350353
351354
352
353
354
355
356
357
358
359
360
361
362
363
355
356
357
358
359
360
361
362
363
364
365
366
364367
365368
366369
......
384387
385388
386389
387
390
388391
389392
390393
391
394
392395
393396
394397
......
397400
398401
399402
403
$form = new IDF_Form_ProjectRequest(null, $params);
}
return Pluf_Shortcuts_RenderToResponse('idf/user/projectrequest.html',
array('page_title' => $title,
'form' => $form,
'success' => $success,
'error' => $error),
$request);
array('page_title' => $title,
'form' => $form,
'success' => $success,
'error' => $error),
$request);
}
/**
$pag->sort_order = array('modif_dtime', 'ASC'); // will be reverted
$pag->sort_reverse_order = array('modif_dtime');
$list_display = array(
'id' => __('Id'),
array('project', 'Pluf_Paginator_FkToString', __('Project')),
array('summary', 'IDF_Views_IssueSummaryAndLabels', __('Summary')),
array('status', 'IDF_Views_Issue_ShowStatus', __('Status')),
array('modif_dtime', 'Pluf_Paginator_DateAgo', __('Last Updated')),
'id' => __('Id'),
array('project', 'Pluf_Paginator_FkToString', __('Project')),
array('summary', 'IDF_Views_IssueSummaryAndLabels', __('Summary')),
array('status', 'IDF_Views_Issue_ShowStatus', __('Status')),
array('modif_dtime', 'Pluf_Paginator_DateAgo', __('Last Updated')),
);
$pag->configure($list_display, array(), array('status', 'modif_dtime'));
$pag->items_per_page = 10;
$pag->no_results_text = ($working) ? __('No issues are assigned to you, yeah!') : __('All the issues you submitted are fixed, yeah!');
$pag->setFromRequest($request);
return Pluf_Shortcuts_RenderToResponse('idf/user/dashboard.html',
array(
'page_title' => $title,
'nb_submit' => $nb_submit,
'nb_owner' => $nb_owner,
'issues' => $pag,
),
$request);
array(
'page_title' => $title,
'nb_submit' => $nb_submit,
'nb_owner' => $nb_owner,
'issues' => $pag,
),
$request);
}
/**
$params = array('user' => $request->user);
if ($request->method == 'POST') {
$form = new IDF_Form_UserAccount(array_merge(
(array)$request->POST,
(array)$request->FILES
), $params);
(array)$request->POST,
(array)$request->FILES
), $params);
if ($form->isValid()) {
$user = $form->save();
$url = Pluf_HTTP_URL_urlForView('IDF_Views_User::myAccount');
$mailaddrs = Pluf::factory('IDF_EmailAddress')->get_email_addresses_for_user($request->user);
return Pluf_Shortcuts_RenderToResponse('idf/user/myaccount.html',
array('page_title' => __('Your Account'),
'api_key' => $api_key,
'ext_pass' => $ext_pass,
'keys' => $keys,
'mailaddrs' => $mailaddrs,
'form' => $form),
$request);
array('page_title' => __('Your Account'),
'api_key' => $api_key,
'ext_pass' => $ext_pass,
'keys' => $keys,
'mailaddrs' => $mailaddrs,
'form' => $form),
$request);
}
/**
$form = new IDF_Form_UserChangeEmail();
}
return Pluf_Shortcuts_RenderToResponse('idf/user/changeemail.html',
array('page_title' => __('Confirm The Email Change'),
'form' => $form),
$request);
array('page_title' => __('Confirm The Email Change'),
'form' => $form),
$request);
}
$user = $users[0];
$user_data = IDF_UserData::factory($user);
$ownedprojects = IDF_Views::getOwnedProjects($request->user);
$ownedprojects = IDF_Views::getOwnedProjects($user);
$pubprojects = array();
$privprojects = 0;
foreach($ownedprojects as $proj)
if ($ownedprojects != null && count($ownedprojects) > 0 )
{
if ($proj->private == 1)
foreach($ownedprojects as $proj)
{
$privprojects += 1;
continue;
} else {
$pubprojects[] = $proj;
if ($proj->private == 1)
{
$privprojects += 1;
continue;
} else {
$pubprojects[] = $proj;
}
}
}
$projectstats = IDF_Views::getProjectsStatistics($pubprojects);
//print_r($projectstats);
//echo $privprojects;
$pag = new Pluf_Paginator(new IDF_Issue());
$pag->model_view = "project_find_private";
$pag->class = 'recent-issues';
$pag->item_extra_props = array('current_user' => $request->user);
$pag->item_extra_props = array('current_user' => $user);
$pag->summary = __('This table shows the open issues.');
$pag->forced_where = new Pluf_SQL("owner = " . $request->user->id);
$pag->action = 'idf_dashboard';
$pag->forced_where = new Pluf_SQL("owner = " . $user->id);
$pag->action = array('idf_user_view', array($user->login));
$pag->sort_order = array('modif_dtime', 'ASC'); // will be reverted
$pag->sort_reverse_order = array('modif_dtime');
$list_display = array(
array('modif_dtime', 'Pluf_Paginator_DateAgo', __('Last Updated')),
);
$pag->configure($list_display, array(), array('status', 'modif_dtime'));
$pag->items_per_page = 10;
$pag->items_per_page = 20;
$pag->no_results_text = __('This user has no issues assigned to them!');
$pag->setFromRequest($request);
$pag2 = new Pluf_Paginator(new IDF_Commit());
$pag->model_view = "project_find_private";
$pag2->nb_items = 20;
$pag2->model_view = "project_find_private";
$pag2->class = 'recent-issues';
$pag2->summary = __('This table shows the latest commits of this user.');
$pag2->forced_where = new Pluf_SQL("author = " . $request->user->id);
$pag2->action = 'idf_dashboard';
$pag2->forced_where = new Pluf_SQL("author = " . $user->id);
$pag2->action = array('idf_user_view', array($user->login));
$pag2->sort_order = array('creation_dtime', 'ASC'); // will be reverted
$pag2->sort_reverse_order = array('creation_dtime');
$list_display = array(
$pag2->no_results_text = __('This user has not made any commits yet!');
$pag2->setFromRequest($request);
$projects = IDF_Views::getOwnedProjects($user);
return Pluf_Shortcuts_RenderToResponse('idf/user/public.html',
array('page_title' => (string) $user,
'member' => $user,
'user_data' => $user_data,
'projects' => $projects,
'issues' => $pag,
'commits' => $pag2,
'stats' => new Pluf_Template_ContextVars($projectstats),
'privatecount' => $privprojects
),
$request);
$projects = IDF_Views::getOwnedProjects($user);
return Pluf_Shortcuts_RenderToResponse('idf/user/public.html',
array('page_title' => (string) $user,
'member' => $user,
'user_data' => $user_data,
'projects' => $projects,
'issues' => $pag,
'commits' => $pag2,
'stats' => new Pluf_Template_ContextVars($projectstats),
'privatecount' => $privprojects
),
$request);
}
}
{
$project = $issue->get_project();
$edit = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view',
array($project->shortname, $issue->id));
array($project->shortname, $issue->id));
$tags = array();
foreach ($issue->get_tags_list() as $tag) {
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::listLabel',
array($project->shortname, $tag->id, 'open'));
array($project->shortname, $tag->id, 'open'));
$tags[] = sprintf('<a class="label" href="%s">%s</a>', $url, Pluf_esc((string) $tag));
}
$out = '';
}
return sprintf('<a href="%s">%s</a>', $edit, Pluf_esc($issue->summary)).$out;
}
indefero/src/IDF/templates/idf/base.html
133133
134134
135135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
136158
137159
138160
......
164186
165187
166188
189
190
191
192
193
194
195
196
197
167198
199
168200
169201
170202
return result
};
function gotoline()
{
if ($('.number' + window.location.hash.substring(1)).first().offset() == null)
{
window.setTimeout(gotoline, 100);
return;
}
$('html, body').animate({
scrollTop: ($('.number' + window.location.hash.substring(1)).first().offset().top)
},500);
changegutter();
}
function changegutter()
{
if ($('.gutter > [class*=number]').first().offset() == null)
{
window.setTimeout(changegutter, 100);
return;
}
$(".gutter > [class*=number]").each(function(){ $(this).html('<a href="https://' + window.location.hostname + window.location.pathname + '#' + $(this).html() +'">' + $(this).html() + '</a>'); });
}
$(function() {
));
SyntaxHighlighter.all();
if(window.location.hash)
{
window.setTimeout(gotoline, 100);
} else {
window.setTimeout(changegutter, 100);
}
});
{/literal}
</script>
</body>
indefero/src/IDF/templates/idf/user/myaccount.html
194194
195195
196196
197
197
198198
199199
200200
for(var i = 0; i < 32; i++)
key += chars[Math.floor(Math.random() * 32)];
$("#id_otpkey").val(key);
var url = "https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=otpauth%3A%2F%2Ftotp%srchub:" + user + "?secret=" + $("#id_otpkey").val().toUpperCase() + "%26issuer=srchub&choe=UTF-8";
var url = "https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=otpauth%3A%2F%2Ftotp%2Fsrchub:" + user + "?secret=" + $("#id_otpkey").val().toUpperCase() + "%26issuer=srchub&choe=UTF-8";
$("#QRcode").html('<img src="' + url + '" />')
return false;
});

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.09299s using 14 queries.