21 Commits

Author SHA1 Message Date
1b2f9a2278 fix output messages for reindexing 2018-08-24 09:23:09 -07:00
937708f5d8 do *full* indexing 2018-08-24 09:01:18 -07:00
4c3ee712bb Fix display bug. Merge branch 'dcppc' of github.com:dcppc/centillion into dcppc
* 'dcppc' of github.com:dcppc/centillion:
  fix styles
2018-08-24 08:42:03 -07:00
f5af965a33 fix display bug 2018-08-24 08:41:35 -07:00
bce16d336d fix flask example configuration 2018-08-24 08:40:46 -07:00
729514ac89 Merge pull request #93 from dcppc/fix-styles
fix styles
2018-08-24 08:37:51 -07:00
46ce070b09 fix styles 2018-08-24 08:31:57 -07:00
891fa50868 fix results boxes in results table to be gray 2018-08-24 02:30:49 -07:00
fdb3963ede tack on the disqus comments anchor to disqus URLs 2018-08-24 02:01:34 -07:00
90379a69c5 Merge pull request #92 from dcppc/add-date-subgrp-emailthreads
add string formatting for dates and add date/mailing list column to email threads master list
2018-08-24 01:58:29 -07:00
0faca67c35 add string formatting for dates and add date/mailing list column to email threads master list
closes #58
2018-08-24 01:56:19 -07:00
77b533b642 Merge pull request #86 from dcppc/disqus
Add Disqus
2018-08-24 01:18:37 -07:00
ccf013e3c9 Merge pull request #85 from dcppc/add-coc-dotgithub
Add Code of Conduct, Contributing, and PR template
2018-08-24 01:18:14 -07:00
e67db4f1ef Merge pull request #89 from dcppc/fix-flashed-messages-font
fix font used in flashed messages
2018-08-24 01:17:59 -07:00
b11a26a812 Merge pull request #91 from dcppc/merge-datetime-into-disqus
Merge datetime into disqus
2018-08-24 01:14:24 -07:00
4f41d8597f fix font used in flashed messages 2018-08-23 19:05:16 -07:00
17b2d359bb add contributing and code of conduct files 2018-08-23 11:03:48 -07:00
62ca62274e add github pull request template 2018-08-23 11:02:37 -07:00
501cae8329 Merge pull request #81 from dcppc/detect-beta-banner
Add custom banners for beta/localhost centillion instances
2018-08-21 13:18:11 -07:00
0543c3e89f fix filename 2018-08-21 12:01:12 -07:00
2191140232 Add custom banners for beta/localhost centillion instances 2018-08-21 11:58:19 -07:00
15 changed files with 176 additions and 36 deletions

12
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,12 @@
Thanks for contributing to centillion!
Please place an x between the brackets to indicate a yes answer
to the questions below.
- [ ] Is this pull request mergeable?
- [ ] Has this been tested locally?
- [ ] Does this pull request pass the tests?
- [ ] Have new tests been added to cover any new code?
- [ ] Was a spellchecker run on the source code and documentation after
changes were made?

43
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,43 @@
# Code of Conduct
## DCPPC Code of Conduct
All members of the Commons are expected to agree with the following code
of conduct. We will enforce this code as needed. We expect cooperation
from all members to help ensuring a safe environment for everybody.
## The Quick Version
The Consortium is dedicated to providing a harassment-free experience
for everyone, regardless of gender, gender identity and expression, age,
sexual orientation, disability, physical appearance, body size, race, or
religion (or lack thereof). We do not tolerate harassment of Consortium
members in any form. Sexual language and imagery is generally not
appropriate for any venue, including meetings, presentations, or
discussions.
## The Less Quick Version
Harassment includes offensive verbal comments related to gender, gender
identity and expression, age, sexual orientation, disability, physical
appearance, body size, race, religion, sexual images in public spaces,
deliberate intimidation, stalking, following, harassing photography or
recording, sustained disruption of talks or other events, inappropriate
physical contact, and unwelcome sexual attention.
Members asked to stop any harassing behavior are expected to comply
immediately.
If you are being harassed, notice that someone else is being harassed,
or have any other concerns, please contact [Titus
Brown](mailto:ctbrown@ucdavis.edu) immediately. If Titus is the cause of
your concern, please contact [Vivien
Bonazzi](mailto:bonazziv@mail.nih.gov).
We expect members to follow these guidelines at any Consortium event.
Original source and credit: <http://2012.jsconf.us/#/about> & The Ada
Initiative. Please help by translating or improving:
<http://github.com/leftlogic/confcodeofconduct.com>. This work is
licensed under a Creative Commons Attribution 3.0 Unported License

21
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,21 @@
# Contributing to the DCPPC Internal Repository
Hello, and thank you for wanting to contribute to the DCPPC Internal
Repository\!
By contributing to this repository, you agree:
1. To obey the [Code of Conduct](./CODE_OF_CONDUCT.md)
2. To release all your contributions under the same terms as the
license itself: the [Creative Commons Zero](./LICENSE.md) (aka
Public Domain) license
If you are OK with these two conditions, then we welcome both you and
your contribution\!
If you have any questions about contributing, please [open an
issue](https://github.com/dcppc/internal/issues/new) and Team Copper
will lend a hand ASAP.
Thank you for being here and for being a part of the DCPPC project.

View File

@@ -267,7 +267,11 @@ def list_docs(doctype):
if org['login']=='dcppc':
# Business as usual
search = Search(app.config["INDEX_DIR"])
return jsonify(search.get_list(doctype))
results_list = search.get_list(doctype)
for result in results_list:
ct = result['created_time']
result['created_time'] = datetime.strftime(ct,"%Y-%m-%d %I:%M %p")
return jsonify(results_list)
# nope
return render_template('403.html')

View File

@@ -744,10 +744,10 @@ class Search:
full_items[f['id']] = f
## Shorter:
break
#break
## Longer:
#if nextPageToken is None:
# break
if nextPageToken is None:
break
writer = self.ix.writer()
@@ -795,7 +795,7 @@ class Search:
subprocess.call(['rm','-fr',temp_dir])
writer.commit()
print("Done, updated %d documents in the index" % count)
print("Done, updated %d Google Drive files in the index" % count)
# ------------------------------
@@ -873,7 +873,7 @@ class Search:
writer.commit()
print("Done, updated %d documents in the index" % count)
print("Done, updated %d Github issues in the index" % count)
@@ -1247,7 +1247,7 @@ class Search:
elif doctype=='issue':
item_keys = ['title','repo_name','repo_url','url','created_time','modified_time']
elif doctype=='emailthread':
item_keys = ['title','owner_name','url','created_time','modified_time']
item_keys = ['title','owner_name','url','group','created_time','modified_time']
elif doctype=='disqus':
item_keys = ['title','created_time','url']
elif doctype=='ghfile':

View File

@@ -1,20 +1,38 @@
######################################
# github oauth
GITHUB_OAUTH_CLIENT_ID = "XXX"
GITHUB_OAUTH_CLIENT_SECRET = "YYY"
######################################
# github acces token
GITHUB_TOKEN = "XXX"
######################################
# groups.io
GROUPSIO_TOKEN = "XXXXX"
GROUPSIO_USERNAME = "XXXXX"
GROUPSIO_PASSWORD = "XXXXX"
######################################
# Disqus API public key
DISQUS_TOKEN = "XXXXX"
######################################
# everything else
# Location of index file
INDEX_DIR = "search_index"
# oauth client deets
GITHUB_OAUTH_CLIENT_ID = "XXX"
GITHUB_OAUTH_CLIENT_SECRET = "YYY"
GITHUB_TOKEN = "ZZZ"
# More information footer: Repository label
FOOTER_REPO_ORG = "charlesreid1"
FOOTER_REPO_ORG = "dcppc"
FOOTER_REPO_NAME = "centillion"
# Toggle to show Whoosh parsed query
SHOW_PARSED_QUERY=True
TAGLINE = "Search All The Things"
TAGLINE = "Search the Data Commons"
# Flask settings
DEBUG = True
SECRET_KEY = 'WWWWW'
SECRET_KEY = 'XXXXX'

View File

@@ -118,6 +118,7 @@ class DisqusCrawler(object):
link = response['link']
clean_link = re.sub('data-commons.us','nihdatacommons.us',link)
clean_link += "#disqus_comments"
# Finished working on thread.

View File

@@ -66,7 +66,7 @@ class GroupsIOArchivesCrawler(object):
## Short circuit
## for debugging purposes
break
#break
return subgroups

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -57,6 +57,25 @@ $(document).ready(function() {
});
//////////////////////////////////
// utility functions
// https://stackoverflow.com/a/25275808
function iso8601(date) {
var hours = date.getHours();
var minutes = date.getMinutes();
var ampm = hours >= 12 ? 'PM' : 'AM';
hours = hours % 12;
hours = hours ? hours : 12; // the hour '0' should be '12'
minutes = minutes < 10 ? '0'+minutes : minutes;
var strTime = hours + ':' + minutes + ' ' + ampm;
return date.getYear() + "-" + (date.getMonth()+1) + "-" + date.getDate() + " " + strTime;
}
// https://stackoverflow.com/a/7390612
var toType = function(obj) {
return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase()
}
//////////////////////////////////
// API-to-Table Functions
@@ -315,8 +334,10 @@ function load_emailthreads_table(){
var r = new Array(), j = -1, size=result.length;
r[++j] = '<thead>'
r[++j] = '<tr class="header-row">';
r[++j] = '<th width="70%">Topic</th>';
r[++j] = '<th width="30%">Started By</th>';
r[++j] = '<th width="60%">Topic</th>';
r[++j] = '<th width="15%">Started By</th>';
r[++j] = '<th width="15%">Date</th>';
r[++j] = '<th width="10%">Mailing List</th>';
r[++j] = '</tr>';
r[++j] = '</thead>'
r[++j] = '<tbody>'
@@ -327,6 +348,10 @@ function load_emailthreads_table(){
r[++j] = '</a>'
r[++j] = '</td><td>';
r[++j] = result[i]['owner_name'];
r[++j] = '</td><td>';
r[++j] = result[i]['created_time'];
r[++j] = '</td><td>';
r[++j] = result[i]['group'];
r[++j] = '</td></tr>';
}
r[++j] = '</tbody>'

View File

@@ -58,7 +58,7 @@ button#feedback {
/* search results table */
td#search-results-score-col,
td#search-results-type-col {
width: 100px;
width: 90px;
}
div.container {
@@ -86,6 +86,14 @@ div.container {
}
/* badges for number of docs indexed */
span.results-count {
background-color: #555;
}
span.indexing-count {
background-color: #337ab7;
}
span.badge {
vertical-align: text-bottom;
}
@@ -126,7 +134,7 @@ li.search-group-item {
}
div.url {
background-color: rgba(86,61,124,.15);
background-color: rgba(40,40,60,.15);
padding: 8px;
}
@@ -192,7 +200,7 @@ table {
.info, .last-searches {
color: gray;
font-size: 12px;
/*font-size: 12px;*/
font-family: Arial, serif;
}
@@ -202,27 +210,27 @@ table {
div.tags a, td.tag-cloud a {
color: #b56020;
font-size: 12px;
/*font-size: 12px;*/
}
td.tag-cloud, td.directories-cloud {
font-size: 12px;
/*font-size: 12px;*/
color: #555555;
}
td.directories-cloud a {
font-size: 12px;
/*font-size: 12px;*/
color: #377BA8;
}
div.path {
font-size: 12px;
/*font-size: 12px;*/
color: #666666;
margin-bottom: 3px;
}
div.path a {
font-size: 12px;
/*font-size: 12px;*/
margin-right: 5px;
}

View File

@@ -7,11 +7,18 @@
<div class="col12sm" id="banner-col">
<center>
<a id="banner-a" href="{{ url_for('search')}}?query=&fields=">
<img id="banner-img" src="{{ url_for('static', filename='centillion_white.png') }}">
{% if 'betasearch' in request.url %}
<img id="banner-img" src="{{ url_for('static', filename='centillion_white_beta.png') }}">
{% elif 'localhost' in request.url %}
<img id="banner-img" src="{{ url_for('static', filename='centillion_white_localhost.png') }}">
{% else %}
<img id="banner-img" src="{{ url_for('static', filename='centillion_white.png') }}">
{% endif %}
</a>
</center>
</div>
</div>
{% if config['TAGLINE'] %}
<div class="row" id="tagline-row">
<div class="col12sm" id="tagline-col">

View File

@@ -5,7 +5,7 @@
<div class="alert alert-success alert-dismissible fade in">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
{% for message in messages %}
<p class="lead">{{ message }}</p>
<p>{{ message }}</p>
{% endfor %}
</div>
</div>

View File

@@ -52,8 +52,8 @@
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 info">
<b>Found:</b> <span class="badge">{{entries|length}}</span> results
out of <span class="badge">{{totals["total"]}}</span> total items indexed
<b>Found:</b> <span class="badge results-count">{{entries|length}}</span> results
out of <span class="badge results-count">{{totals["total"]}}</span> total items indexed
</div>
</div>
</div>
@@ -67,32 +67,32 @@
<div class="col-xs-12 info">
<b>Indexing:</b>
<span class="badge">{{totals["gdoc"]}}</span>
<span class="badge indexing-count">{{totals["gdoc"]}}</span>
<a href="/master_list?doctype=gdoc#gdoc">
Google Drive files
</a>,
<span class="badge">{{totals["issue"]}}</span>
<span class="badge indexing-count">{{totals["issue"]}}</span>
<a href="/master_list?doctype=issue#issue">
Github issues
</a>,
<span class="badge">{{totals["ghfile"]}}</span>
<span class="badge indexing-count">{{totals["ghfile"]}}</span>
<a href="/master_list?doctype=ghfile#ghfile">
Github files
</a>,
<span class="badge">{{totals["markdown"]}}</span>
<span class="badge indexing-count">{{totals["markdown"]}}</span>
<a href="/master_list?doctype=markdown#markdown">
Github Markdown files
</a>,
<span class="badge">{{totals["emailthread"]}}</span>
<span class="badge indexing-count">{{totals["emailthread"]}}</span>
<a href="/master_list?doctype=emailthread#emailthread">
Groups.io email threads
</a>,
<span class="badge">{{totals["disqus"]}}</span>
<span class="badge indexing-count">{{totals["disqus"]}}</span>
<a href="/master_list?doctype=disqus#disqus">
Disqus comment threads
</a>
@@ -101,6 +101,7 @@
</div>
</li>
</ul>
</div>
</div>