Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
hypothesis/h
40a/h
AFDudley/h
BigBlueHat/h
BinaryStars/h
CCH543/h
Cinemacloud/h
Ericgood/h
FTG-003/h
Forethinker/h
GratefulTony/h
HGldJ1966/h
JJediny/h
John-Williams/h
Laurian/h
LittleFancy/h
MattyQ/h
Mishkin2015/h
RichardLitt/h
Staffan1/h
SteelWagstaff/h
TowerBR/h
VanyTang/h
abigailricarte/h
ackermann/h
alecchap/h
alesarrett/h
alexsegura/h
almereyda/h
alon/h
andzi/h
angelicxsoul/h
ansmoh/h
apurvajalit/h
arjunvasan/h
asdevor/h
bZichett/h
badgettrg/Webmarks
balmas/h
balupton/h
bbarker/h
bennlich/h
benthor/h
blakewest/h
bogste/h
bradparks/h
brittanystoroz/h
buiquangchien/h
cdchapman/h
charblanc/h
chowsamihq/h
chr7stos/Webmarks
chrber/h
chrismPssina/h
christinaphamAD/h
cmbirk/h
codeaudit/h
coolcool21/h
cove/h
csillag/h
danjimilk/h
dannyhope/h
daredream/h
davidmcclure/h
dennisplucinik/h
dezynetechnologies/h
diegodlh/h
djcun95/h
donsequitur/h
edsu/h
eiro10/h
emckean/h
ercchy/h
eshellman/h
fangang123/h
fchasen/h
fcrimins/h
fhirsch/h
ficolo/h
fragkopoulos/h
gauravkeerthi/h
geass/h
gergely-ujvari/h
gitter-badger/h
gnott/h
gobengo/h
gorinovic/h
gus3000/h
hashin/h
helemaalbigt/h
hmstepanek/h
hwasiti/h
hylhero/h
hyperstudio/h
iHDeveloper/h
imeysam/h
jackspaceBerkeley/h
jarey/h
jasdeep/h
jason790/h
jasonzou/j
jazahn/h
jccr/h
jean/h
jeka57/h
jeremydean/h
jermnelson/h
jibe-b/h
jnishiyama/h
jojksd/h
jpadilla/h
jtremback/h
judell/h
juli-so/h
kabacs/h
karissa/h
kaushikvijay/h
kaydoh/h
kill4uk/h
klopiinas/h
klrkdekira/h
koulihong311/h
krassif/h
krstnkngs/h
leoqmp/h
linhua55/h
lucadealfaro/h
lyspooner/h
lyzadanger/h
m1yag1/h
magee/h
mambocab/h
manunymous/h
maraino/h
mari-ja/h
markbarratt/h
martinq/h
mbbaig/h
mcarv63/h
meawoppl/h
meflyup/h
metasj/h
mgasner/h
mgax/h
mollycr/h
mrchrisadams/h
mrienstra/h
mshavlovsky/h
muddasani/h
nagyist/hyphothesis-h
nagyistoce/hypothesis-h
nanxio/h
neozhangthe1/h
ningyifan/h
nkingsley/h
nlholdem/h
nlisgo/h
noscripter/h
nshkuro/h
odnodn/h
oliversauter/h
openbizgit/h
opengovfoundation/h
openstax/hypothesis-server
ouroboros8/h
pablomarti/h
pamo/h
philipn/h
philschatz/h
pinballwonder/h
plainspace/h
raowl/h
rickyhan/h
rmoorman/h
rmtsukuru/h
robertknight/h
rowhit/h
rsarxiv/h
saakaifoundry/h
samrose/h
scharf/h
shepazu/h
sherah/h
shofheinz/h
soapdog/h
ssin122/test-h
st-fresh/h
stuk88/h
sylvanmist/h
tetratorus/h
tilgovi/h
tomnar/h
trivenews/h
truthadjustr/h
utngz/h
voidfiles/h
wenchen/h
yargevad/h
yumatch/h
zshen777/h
Nothing to show
Choose a Head Repository
hypothesis/h
40a/h
AFDudley/h
BigBlueHat/h
BinaryStars/h
CCH543/h
Cinemacloud/h
Ericgood/h
FTG-003/h
Forethinker/h
GratefulTony/h
HGldJ1966/h
JJediny/h
John-Williams/h
Laurian/h
LittleFancy/h
MattyQ/h
Mishkin2015/h
RichardLitt/h
Staffan1/h
SteelWagstaff/h
TowerBR/h
VanyTang/h
abigailricarte/h
ackermann/h
alecchap/h
alesarrett/h
alexsegura/h
almereyda/h
alon/h
andzi/h
angelicxsoul/h
ansmoh/h
apurvajalit/h
arjunvasan/h
asdevor/h
bZichett/h
badgettrg/Webmarks
balmas/h
balupton/h
bbarker/h
bennlich/h
benthor/h
blakewest/h
bogste/h
bradparks/h
brittanystoroz/h
buiquangchien/h
cdchapman/h
charblanc/h
chowsamihq/h
chr7stos/Webmarks
chrber/h
chrismPssina/h
christinaphamAD/h
cmbirk/h
codeaudit/h
coolcool21/h
cove/h
csillag/h
danjimilk/h
dannyhope/h
daredream/h
davidmcclure/h
dennisplucinik/h
dezynetechnologies/h
diegodlh/h
djcun95/h
donsequitur/h
edsu/h
eiro10/h
emckean/h
ercchy/h
eshellman/h
fangang123/h
fchasen/h
fcrimins/h
fhirsch/h
ficolo/h
fragkopoulos/h
gauravkeerthi/h
geass/h
gergely-ujvari/h
gitter-badger/h
gnott/h
gobengo/h
gorinovic/h
gus3000/h
hashin/h
helemaalbigt/h
hmstepanek/h
hwasiti/h
hylhero/h
hyperstudio/h
iHDeveloper/h
imeysam/h
jackspaceBerkeley/h
jarey/h
jasdeep/h
jason790/h
jasonzou/j
jazahn/h
jccr/h
jean/h
jeka57/h
jeremydean/h
jermnelson/h
jibe-b/h
jnishiyama/h
jojksd/h
jpadilla/h
jtremback/h
judell/h
juli-so/h
kabacs/h
karissa/h
kaushikvijay/h
kaydoh/h
kill4uk/h
klopiinas/h
klrkdekira/h
koulihong311/h
krassif/h
krstnkngs/h
leoqmp/h
linhua55/h
lucadealfaro/h
lyspooner/h
lyzadanger/h
m1yag1/h
magee/h
mambocab/h
manunymous/h
maraino/h
mari-ja/h
markbarratt/h
martinq/h
mbbaig/h
mcarv63/h
meawoppl/h
meflyup/h
metasj/h
mgasner/h
mgax/h
mollycr/h
mrchrisadams/h
mrienstra/h
mshavlovsky/h
muddasani/h
nagyist/hyphothesis-h
nagyistoce/hypothesis-h
nanxio/h
neozhangthe1/h
ningyifan/h
nkingsley/h
nlholdem/h
nlisgo/h
noscripter/h
nshkuro/h
odnodn/h
oliversauter/h
openbizgit/h
opengovfoundation/h
openstax/hypothesis-server
ouroboros8/h
pablomarti/h
pamo/h
philipn/h
philschatz/h
pinballwonder/h
plainspace/h
raowl/h
rickyhan/h
rmoorman/h
rmtsukuru/h
robertknight/h
rowhit/h
rsarxiv/h
saakaifoundry/h
samrose/h
scharf/h
shepazu/h
sherah/h
shofheinz/h
soapdog/h
ssin122/test-h
st-fresh/h
stuk88/h
sylvanmist/h
tetratorus/h
tilgovi/h
tomnar/h
trivenews/h
truthadjustr/h
utngz/h
voidfiles/h
wenchen/h
yargevad/h
yumatch/h
zshen777/h
Nothing to show
  • 6 commits
  • 6 files changed
  • 2 commit comments
  • 4 contributors
Commits on Aug 26, 2014
Commits on Aug 27, 2014
Commits on Aug 28, 2014
Introduce user multifield
In the annotation.user field we store the users in the acct:username@domain format
However when we're searching for users via stream we only use the username part
and the client has to juggle to make up the domain and the backend
cannot theoretically know the domain.

So, the user field was turned into a multi-field, to reflect both usage.
annotation.user is the same as it was and
annotation.username contains only the username part.

Now the client doesn't have to construct back the whole user format.
And without this our 'any' fields searches failed for the user field

Fix #1456
Fix #1457
Showing with 40 additions and 23 deletions.
  1. +27 −1 h/models.py
  2. +0 −8 h/static/scripts/controllers.coffee
  3. +3 −7 h/static/scripts/searchfilters.coffee
  4. +5 −2 h/streamer.py
  5. +1 −1 h/templates/auth.html
  6. +4 −4 h/templates/help.pt
View
@@ -50,7 +50,22 @@ def __acl__(self):
'text': {'type': 'string'},
'deleted': {'type': 'boolean'},
'uri': {'type': 'string', 'index_analyzer': 'uri_index', 'search_analyzer': 'uri_search'},
'user': {'type': 'string', 'index': 'analyzed', 'analyzer': 'lower_keyword'},
'user': {
'type': 'multi_field',
'path': 'just_name',
'fields': {
'user': {
'type': 'string',
'index': 'analyzed',
'analyzer': 'lower_keyword'},
'username': {
'type': 'string',
'index': 'analyzed',
'index_analyzer': 'username',
'search_analyzer': 'lower_keyword'
}
}
},
'consumer': {'type': 'string', 'index': 'not_analyzed'},
'target': {
'properties': {
@@ -130,6 +145,13 @@ def __acl__(self):
]
}
},
'tokenizer': {
'username': {
'type': 'pattern',
'group': 1,
'pattern': '^acct:(.+)@.*$'
}
},
'analyzer': {
'thread': {
'tokenizer': 'path_hierarchy'
@@ -145,6 +167,10 @@ def __acl__(self):
},
'uri_search': {
'tokenizer': 'keyword',
},
'username': {
'tokenizer': 'username',
'filter': 'lowercase'
}
}
}
@@ -810,17 +810,9 @@ class Search
refresh()
class Notification
this.inject = ['$scope']
constructor: (
$scope
) ->
angular.module('h.controllers', imports)
.controller('AppController', App)
.controller('EditorController', Editor)
.controller('ViewerController', Viewer)
.controller('AnnotationViewerController', AnnotationViewer)
.controller('SearchController', Search)
.controller('NotificationController', Notification)
@@ -164,9 +164,7 @@ class SearchFilter
class QueryParser
rules:
user:
formatter: (user) ->
'acct:' + user + '@' + window.location.hostname
path: '/user'
path: '/username'
exact_match: true
case_sensitive: false
and_or: 'or'
@@ -219,13 +217,13 @@ class QueryParser
exact_match: false
case_sensitive: false
and_or: 'and'
path: ['/quote', '/tags', '/text', '/uri', '/user']
path: ['/quote', '/tags', '/text', '/uri', '/username']
options:
es:
query_type: 'multi_match'
match_type: 'cross_fields'
and_or: 'and'
fields: ['quote', 'tag', 'text', 'uri', 'user']
fields: ['quote', 'tag', 'text', 'uri', 'username']
parseModels: (models) ->
@@ -256,8 +254,6 @@ class QueryParser
mapped_field = if rule.path? then rule.path else '/'+category
if and_or is 'or'
val_list = ''
first = true
oper_part =
if rule.operator? then rule.operator
else if exact_match then 'one_of' else 'match_of'
View
@@ -528,7 +528,7 @@ def on_message(self, msg):
def after_action(event):
try:
request = event.request
clientID = request.headers.get('X-Client-Id')
clientid = request.headers.get('X-Client-Id')
action = event.action
if action == 'read':
@@ -540,7 +540,7 @@ def after_action(event):
manager = request.get_sockjs_manager()
for session in manager.active_sessions():
if session.clientID == clientID:
if session.clientID == clientid:
continue
try:
@@ -550,6 +550,9 @@ def after_action(event):
if 'references' in annotation:
annotation['quote'] = annotation['parent']['text']
if 'user' in annotation:
annotation['username'] = re.match('^acct:(.+)@.*$', annotation['user']).group(1)
flt = session.filter
if not (flt and flt.match(annotation, action)):
continue
View
@@ -134,7 +134,7 @@
<!-- / Register -->
<!-- Forgot password -->
<form data-title="Claim an account"
<form data-title="Confirm account"
data-value="forgot"
class="form tab-pane"
name="forgot"
View
@@ -35,14 +35,14 @@
<img height="150px" width="150px"
src="${request.static_url('h:static/images/helpdocumentation/createanaccount.jpg')}" />
<h2>Claiming a username:</h2>
<p>Have you already reserved a username? Use the “Claim your username” tab instead.</p>
<h2>Confirm an account or Claim a username:</h2>
<p>Have you already reserved a username? Use the “Confirm account” tab instead.</p>
<h2>Forgotten Password?</h2>
<p>Click “Password help” and enter the email address you signed up for your account with.</p>
<p>Click “Forgotten your password” and enter the email address you signed up for your account with.</p>
<img height="203px;" width="420px;"
src="${request.static_url('h:static/images/helpdocumentation/password1.jpg')}" />
<p>An email will be sent containing an activation code for your account. Click “I have an activation code.</p>
<p>An email will be sent containing an activation code for your account. Click “have an activation code.</p>
<img height="203px;" width="420px;"
src="${request.static_url('h:static/images/helpdocumentation/password2.jpg')}" />
<p>Enter the activation code and the new password for your account. Click sign in, and your password will be reset.</p>

Showing you all comments on commits in this comparison.

@aron

This comment has been minimized.

Show comment
Hide comment
@aron

aron Aug 28, 2014

Contributor

Hmm, I've found a few of these over the last few days. Does coffee lint pick these up? We should start running the code through something.

Contributor

aron commented on ce36333 Aug 28, 2014

Hmm, I've found a few of these over the last few days. Does coffee lint pick these up? We should start running the code through something.

@gergely-ujvari

This comment has been minimized.

Show comment
Hide comment
@gergely-ujvari

gergely-ujvari Aug 28, 2014

Contributor

I'm using PyCharm, it shows unused variables. (Even for coffee files)
But not classes which are never referenced.

Contributor

gergely-ujvari commented on ce36333 Aug 28, 2014

I'm using PyCharm, it shows unused variables. (Even for coffee files)
But not classes which are never referenced.