Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default title entry #13

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions helm-quarry/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
web:
repository: 'quay.io/wikimedia-quarry/quarry'
tag: pr-66 # web tag managed by github actions
tag: pr-13 # web tag managed by github actions

worker:
repository: 'quay.io/wikimedia-quarry/quarry'
tag: pr-66 # worker tag managed by github actions
tag: pr-13 # worker tag managed by github actions
1 change: 1 addition & 0 deletions quarry/web/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def new_query():
return redirect("/login?next=/query/new")
query = Query()
query.user = get_user()
query.title = "Untitled query"
g.conn.session.add(query)
g.conn.session.commit()
return redirect(url_for("query.query_show", query_id=query.id))
Expand Down
4 changes: 2 additions & 2 deletions quarry/web/static/js/query/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ $( function () {
query_id: vars.query_id,
title: title
} ).done( function ( /* data */ ) {
document.title = ( title || 'Untitled query #' + vars.query_id ) + ' - Quarry';
document.title = title + ' - Quarry';
} );
} );
}
Expand Down Expand Up @@ -243,7 +243,7 @@ $( function () {
);

if ( !silent && vars.preferences.use_notifications ) {
let title = $( '#title' ).val() ? '"' + $( '#title' ).val() + '"' : 'Untitled query #' + vars.query_id;
let title = '"' + $( '#title' ).val() + '"';
sendNotification( title + ' execution has been completed' );
}

Expand Down
2 changes: 1 addition & 1 deletion quarry/web/templates/query/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<tbody>
{% for query in queries %}
<tr>
<td><a href="/query/{{query.id}}">{% if query.title %}{{query.title}}{% else %}Untitled query #{{query.id}}{% endif %}</a></td>
<td><a href="/query/{{query.id}}">{{query.title}}</a></td>
<td><a href="/{{query.user.username}}">{{query.user.username}}</a></td>
<td>{{query.latest_rev.latest_run.status_message}}</td>
<td title="{{query.latest_rev.latest_run.timestamp}} UTC">{{query.latest_rev.latest_run.timestamp|timesince}}</td>
Expand Down
8 changes: 2 additions & 6 deletions quarry/web/templates/query/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
<script src="/static/js/query/view.js?v=2"> </script>
{% endblock %}
{% block title %}
{% if query.title %}{{query.title}}{% else %}Untitled query #{{ query.id }}{% endif %} - Quarry
{{query.title}} - Quarry
{% endblock %}
{% block content %}
<div id="content" class="container {% if jsvars.can_edit %}edit{% else %}no-edit{% endif %} {% if jsvars.is_starred %}starred{% endif %} {% if query.published %}published {% endif %}">
<div class="row" id="title-container">


<div class="col-md-10">
<h2><input type="textbox" id="title" {% if jsvars.can_edit %}placeholder="Click to add title..."{% else %}readonly{% endif %} value="{% if query.title %}{{query.title}}{% endif %}"> </input></h2>
<h2><input type="textbox" id="title" value="{% if query.title %}{{query.title}}{% endif %}"> </input></h2>
</div>

<div class="col-md-2" id="title-actions-container">
Expand All @@ -50,11 +50,7 @@ <h2><input type="textbox" id="title" {% if jsvars.can_edit %}placeholder="Click
<small>
Fork of
<a href='/query/{{query.parent.id}}'>
{% if query.parent.title %}
{{ query.parent.title }}
{% else %}
Untitled query #{{ query.parent.id }}
{% endif %}
</a>
by <a href='/{{ query.parent.user.username }}'>{{ query.parent.user.username }}</a>
</small>
Expand Down
6 changes: 3 additions & 3 deletions quarry/web/templates/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h3>Published queries</h3>
<ul class="query-items-list">
{% for query in published_queries %}
<li class="query-item">
<a class="query-title" href="/query/{{query.id}}">{% if query.title %}{{query.title}}{% else %}Untitled query #{{query.id}}{% endif %}</a>
<a class="query-title" href="/query/{{query.id}}">{{query.title}}</a>
<small>{{query.last_touched|timesince}}</small>
</li>
{% else %}
Expand All @@ -37,7 +37,7 @@ <h3>Starred Queries</h3>
<ul class="query-items-list">
{% for star in stars %}
<li class="query-item">
<a class="query-title" href="/query/{{star.query.id}}">{% if star.query.title %}{{star.query.title}}{% else %}Untitled query #{{star.query.id}}{% endif %}</a>
<a class="query-title" href="/query/{{star.query.id}}">{{star.query.title}}</a>
</li>
{% else %}
This user has not starred any queries yet.
Expand All @@ -51,7 +51,7 @@ <h3>Draft Queries</h3>
<ul class="query-items-list">
{% for query in draft_queries %}
<li class="query-item">
<a class="query-title" href="/query/{{query.id}}">{% if query.title %}{{query.title}}{% else %}Untitled query #{{query.id}}{% endif %}</a>
<a class="query-title" href="/query/{{query.id}}">{{query.title}}</a>
<small>{{query.last_touched|timesince}}</small>
</li>
{% else %}
Expand Down
Loading