Merge branch 'master' of ssh://bitbucket.org/yackob03/quay

Conflicts:
	static/js/controllers.js
This commit is contained in:
yackob03 2013-10-01 19:39:28 -04:00
commit 211fd6bcd7
8 changed files with 105 additions and 7 deletions

View file

@ -110,9 +110,22 @@ def get_visible_repositories(username=None):
def get_matching_repositories(repo_term, username=None):
namespace_term = repo_term
name_term = repo_term
visible = get_visible_repositories(username)
search_clauses = (Repository.name ** ('%' + repo_term + '%') |
Repository.namespace ** ('%' + repo_term + '%'))
search_clauses = (Repository.name ** ('%' + name_term + '%') |
Repository.namespace ** ('%' + namespace_term + '%'))
# Handle the case where the user has already entered a namespace path.
if repo_term.find('/') > 0:
parts = repo_term.split('/', 1)
namespace_term = '/'.join(parts[:-1])
name_term = parts[-1]
search_clauses = (Repository.name ** ('%' + name_term + '%') &
Repository.namespace ** ('%' + namespace_term + '%'))
final = visible.where(search_clauses).limit(10)
return list(final)

View file

@ -85,8 +85,9 @@ def create_repo_api():
pass
@app.route('/api/repository/find/<prefix>', methods=['GET'])
def match_repos_api(prefix):
@app.route('/api/find/repository', methods=['GET'])
def match_repos_api():
prefix = request.args.get('query', '')
def repo_view(repo):
return {
'namespace': repo.namespace,

View file

@ -38,6 +38,16 @@ def index():
return send_file('templates/index.html')
@app.route('/tos', methods=['GET'])
def tos():
return send_file('templates/tos.html')
@app.route('/privacy', methods=['GET'])
def privacy():
return send_file('templates/privacy.html')
def common_login(db_user):
if login_user(_LoginWrappedDBUser(db_user)):
logger.debug('Successfully signed in as: %s' % db_user.username)

View file

@ -175,6 +175,15 @@ background: linear-gradient(to bottom, #141414 0%,transparent 15%,transparent 8
width: 150px;
}
.landing-footer .copyright {
position: absolute;
left: 10px;
bottom: 4px;
font-size: 11px;
color: black;
}
#repoSearch {
width: 400px;
}

View file

@ -43,7 +43,7 @@ function HeaderCtrl($scope, UserService) {
$('#repoSearch').typeahead({
name: 'repositories',
remote: {
url: '/api/repository/find/%QUERY',
url: '/api/find/repository?query=%QUERY',
filter: function(data) {
var datums = [];
for (var i = 0; i < data.repositories.length; ++i) {

View file

@ -59,8 +59,8 @@
<div class="footer-column">
<h4>Legal</h4>
<ul>
<li><a href="">Terms of Service</a></li>
<li><a href="">Privacy Policy</a></li>
<li><a href="/tos">Terms of Service</a></li>
<li><a href="/privacy">Privacy Policy</a></li>
</ul>
</div>
@ -72,5 +72,6 @@
</div>
<a href="https://devtable.com"><img class="dt-logo" src="/static/dt-logo.png"></a>
<span class="copyright">&copy;2013 DevTable, LLC</span>
</div>

32
templates/privacy.html Normal file

File diff suppressed because one or more lines are too long

32
templates/tos.html Normal file

File diff suppressed because one or more lines are too long