Skip to content

Commit 3059b01

Browse files
committed
Support deactivated data & render MP IDs
1 parent 076a7cd commit 3059b01

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

oauth/idp_auth.html

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,9 @@
4343
if (window.skip_idp_confirm)
4444
return post_auth(session_id);
4545

46-
if (confirm('Log in at the external service?')){
47-
window.localStorage.setItem(window.store_idp_skip_tpl + window.consumer_id, true);
48-
post_auth(session_id);
46+
window.localStorage.setItem(window.store_idp_skip_tpl + window.consumer_id, true);
47+
post_auth(session_id);
4948

50-
} else {
51-
console.log('Redirecting a user to login...');
52-
window.localStorage.removeItem(window.store_redir_key);
53-
window.location.href = window.login_url;
54-
}
5549
} else {
5650
console.log("Error: HTTP " + xmlhttp.status + " status received from server");
5751
console.log('Redirecting a user to login...');

src_js/main_logic.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ function switch_control_mode(mode, next_mode, active_abf, active_cde){ // NB (0,
527527
}
528528

529529
function build_cells(json, header, footer){
530-
var cls_map = {7: 'ml_data', 8: 'ab_data', 9: 'ab_data', 10: 'ab_data', 11: 'ab_data'},
530+
var cls_map = {7: 'ml_data', 8: 'ab_data', 9: 'ab_data', 10: 'ab_data', 11: 'ab_data', 13: 'deactivated'},
531531
result_html = '';
532532
if (header) result_html += header;
533533

@@ -563,7 +563,7 @@ function build_cells(json, header, footer){
563563
}
564564

565565
function build_thumbs(json){
566-
var cls_map = {6: 'pd_full', 7: 'ml_data', 8: 'ab_data', 9: 'ab_data', 10: 'ab_data', 11: 'ab_data'},
566+
var cls_map = {6: 'pd_full', 7: 'ml_data', 8: 'ab_data', 9: 'ab_data', 10: 'ab_data', 11: 'ab_data', 13: 'deactivated'},
567567
result_html = '';
568568

569569
if (wmgui.search_type == 2){
@@ -745,6 +745,7 @@ function request_refinement(query_obj, is_heavy){
745745
* 10 - ab initio entry (P-array) phonon spectra
746746
* 11 - ab initio data in progress (unproc)
747747
* 12 - 3d combination of C-diagrams
748+
* 13 - deactivated entries
748749
*/
749750
function open_context(el, launch_ext){
750751
close_vibox();
@@ -817,6 +818,9 @@ function open_context(el, launch_ext){
817818

818819
} else if (rank == 12){
819820
$('#pd3d_data, #visualize').show();
821+
822+
} else if (rank == 13){
823+
$('#deactivated_data, #download_bib').show();
820824
}
821825
$('#ctx_col > ul > li.d_icon > a').each(function(){
822826
var fmt = $(this).attr('rel'),
@@ -1553,7 +1557,10 @@ function show_dunit_info(phid, bid, entry){
15531557
}).done(function(data){
15541558
if (data.error) return wmgui.notify(data.error);
15551559

1556-
var html = '<h4>' + data.out.formula_html.split(' ')[0] + ' ' + (data.out.spg || '?') + ' ' + (data.out.pearson || '&mdash;') + '</h4><p>This phase was reported in ' + data.out.articles_count + ' article' + (data.out.articles_count > 1 ? 's' : '') + '.';
1560+
var mp_data = '';
1561+
if (data.out.mpid) mp_data = '<h4 style="background:#ddd;margin-top:-7px;">Materials Project <a target="_blank" href="https://materialsproject.org/materials/mp-' + data.out.mpid + '">mp-' + data.out.mpid + '</a></h4>';
1562+
1563+
var html = '<h4>' + data.out.formula_html.split(' ')[0] + ' ' + (data.out.spg || '?') + ' ' + (data.out.pearson || '&mdash;') + '</h4>' + mp_data + '<p>This phase was reported in ' + data.out.articles_count + ' article' + (data.out.articles_count > 1 ? 's' : '') + '.';
15571564
if (data.out.sim_count > 1) html += ' There are <a href="#interlinkage/' + phid + '">' + data.out.sim_count + ' structurally similar phases</a> from other articles.';
15581565
html += '</p>';
15591566
$('#phase_info').html(html);

src_js/markup.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,9 @@ function register_html(){
338338
<div id="pd3d_data" class="spinoff_pane">
339339
<p>Automatically combined phase diagrams</p><span class="extd href">Show more info...</span><span class="legend" style="display:none">The 3d <a href="#search/phase%20diagram%20prism">prisms</a> and <a href="#search/phase%20diagram%20tetrahedron">tetrahedra</a> were automatically combined and rendered by the platform from the suitable <a href="#search/binary%20phase%20diagram">binary</a> and (or) <a href="#search/ternary%20phase%20diagram">ternary</a> phase diagrams.<br /><br /></span>
340340
</div>
341+
<div id="deactivated_data" class="spinoff_pane">
342+
<p>This entry was deactivated due to the quality issues detected.</p>
343+
</div>
341344
342345
<ul>
343346
<li id="visualize" class="wmbutton">Visualize</li>

webassets/ermac.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ th.a5.header, th.a5.headerSortUp, th.a5.headerSortDown{background-position:80% c
182182
td.a5{font-size:0.9em;letter-spacing:-1px;font-style:italic;}
183183

184184
div.context_msg{display:none;width:70%;margin:0 auto;padding-top:10px;color:#555;font-size:1.25em;text-align:center;}
185-
#toomuch{margin-bottom:35px;}
185+
#toomuch{margin-bottom:40px;}
186186
#loadscroll{margin-bottom:100px;}
187187
#plthint{margin:0 auto 120px;}
188-
#plthint > span{display:block;width:100%;margin-bottom:45px;}
188+
#plthint > span{display:block;width:100%;margin-bottom:45px;font-size:1.15em;}
189189
#plthint > div{display:inline-block;width:61px;height:60px;margin:0 3%;}
190190
#plthint > div:hover{transform:scale(1.25);}
191191
#plthint > div > a{display:block;width:100%;height:100%;background-size:cover;margin:0 auto;opacity:0.8;}
@@ -221,6 +221,7 @@ td.p5 > a.launch_id, td.a6 > a.launch_id{display:inline-block;text-decoration:no
221221
td.p5 > a.launch_id:hover, td.a6 > a.launch_id:hover{background:#E36868;color:#fff;}
222222

223223
tr.opened td.c1{background-image:url(unlock.png);background-repeat:no-repeat;background-position:98% 50%;}
224+
tr.deactivated td.c1:after{content:" deactivated";color:#f00;font-style:italic;}
224225
div.opened div.gallery_img:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background-image:url(unlock.png);background-repeat:no-repeat;background-position:95% 95%;}
225226

226227
/* COLUMNS */
@@ -411,11 +412,12 @@ body.darkmode--activated #hintsbox_logo{filter:invert(100%);}
411412
#discovery_enabled, #discovery_disabled{text-align:left;width:90%;margin:0 auto;}
412413
#discovery_custom_box div.rearrange{user-select:none;display:inline-block;text-align:center;width:46%;color:#fff;background:#bfbfbf;line-height:28px;border:1px solid #bfbfbf;border-radius:4px;cursor:pointer;margin:4px;}
413414
#discovery_custom_box div.rearrange:hover{background:#FE9A2E;border-color:#FE9A2E;}
414-
#ml_data, #ab_data, #ab_promise, #pd3d_data{display:none;text-align:center;margin:0 0 15px 3px;color:#555;font-weight:normal;font-size:1.15em;line-height:2em;padding:6px 3px;}
415-
#ml_data span, #ab_data span, #ab_promise span, #pd3d_data span{display:block;font-size:0.8em;line-height:1.75em;margin-top:2em;}
415+
div.spinoff_pane{display:none;text-align:center;margin:0 0 15px 3px;color:#555;font-weight:normal;font-size:1.15em;line-height:2em;padding:6px 3px;}
416+
div.spinoff_pane span{display:block;font-size:0.8em;line-height:1.75em;margin-top:2em;}
416417
#ml_data{background:#f8f7ff;}
417418
#ab_data, #ab_promise{background:#f7fbff;}
418419
#pd3d_data{background:#ffd;}
420+
#deactivated_data{background:#ffe0e0;}
419421
#phases_ctx{user-select:none;}
420422
#phases_ctx span{display:inline-block;background:#ffd;text-align:center;color:#555;font-size:0.95em;line-height:2em;margin:1.5em 0 2em;padding:5px;}
421423

0 commit comments

Comments
 (0)