-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.haml
95 lines (85 loc) · 4.02 KB
/
index.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
%header
%h1 ASQ
.db
%a.icon.database{ :href => '#', 'data-ref' => 'db' } DB
%ul
- @dbs.each do |dba|
%li
%a{ :href => '/' + dba, 'data-db-name' => dba }= dba
.queries
%input.search-in-queries{ :type => 'search', :placeholder => sprintf('Search %d queries', @queries.count) }
- if @queries.count != 0
%ul.query-list.hide
- @queries.each do |query|
%li
%a{ :href => '#', 'data-id' => query[:id] }
%span= query[:id]
%strong= query[:name]
%a.open.icon.add{ :href => '#', 'data-ref' => 'edit' } Add
%a.open.icon.edit.hide{ :href => '#', 'data-ref' => 'edit' } Edit
%a.open.icon.args.hide{ :href => '#', 'data-ref' => 'args' } Args
%a.open.icon.export.hide{ :href => '#', 'data-ref' => 'export' } Export
%input.search-in-results{ :type => 'search', :placeholder => 'Search in results' }
%section#edit.hide
%div
%h1 Edit query
%p.error.hide Errors here
%form{ :action => '/add', :method => 'post' }
%p
%label{ :for => 'edit-name' } Name
%input#edit-name{ :name => 'edit-name' }
%p
%label{ :for => 'edit-query' } Query
%textarea#edit-query{ :name => 'edit-query' }
%p
%input{ :type => 'hidden', :id => 'edit-id', :name => 'edit-id', :value => 'false' }
%a.delete-query.hide.icon.delete{ :href => '#' } Delete query
%input{ :type => 'submit', :id => 'edit-submit', :value => 'Save' }
.api-key
%section#args.hide
%div
%h1 Query arguments
%p.no-results-message.hide No results found for given input.
%form#argsform{ :action => '/', :method => 'post' }
%ul.args
%p
%input{ :type => 'submit', :id => 'args-submit', :value => 'Request' }
%section#export.hide
%div
%h1 Export results
%ul
%li
%a.csv{ :href => '#' } .csv (Comma-separated values)
%li
%em
Google Docs
%strong Coming soon!
%section#logger.hide
%div
%h1 Log
%ul.log
%li
%h2 Page rendered
%p
%small= DateTime.now
%section#about.hide
%div
%h1 About
%p ASQ: <b>A</b>wesome <b>S</b>uper <b>Q</b>ueries <small>(Or: <b>AS</b>k with a <b>Q</b>uery.)</small>
%p More info in the <a href="https://github.com/Springest/ASQ">Github repository</a>.
%h2 Arguments in queries
%ul
%li Open the add/edit a query dialog.
%li
On the place where you want to use an argument, insert one of the following things:
%code.blockcode
[INT:Number]<br>
[FLOAT:Another_number;default=5.7]<br>
[STRING:Name_of_the_string;default=hallo] for a string with default value 'hallo' (without quotes).<br>
[DATE:Some_date]<br>
[DATE:Month;type=month] for a month (will be padded like this if the input is `2012-05-13`): `2012-05-01`<br>
[DATE:Some_year;type=year,compact=true] for a year that will not be padded on the right.<br>
[STRING:SubjectName;autosuggest=subjects.name] for an autosuggest served from table 'subject' column 'name'.
%li Note that for comparison with the <code>=</code> you need to wrap the column name in the <code>DATE(columnname)</code> or one of the other date functions in MySQL. <a href="http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html">See also the documentation on the MySQL website.</a>
%li The names of the variables can't contain spaces.
%li If you use strings in a comparison, wrap the code around quotes, otherwise MySQL does not know that it is dealing with strings.