Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
I
IA-Short
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WWW
IA-Short
Commits
cdb6a883
Verified
Commit
cdb6a883
authored
Jun 30, 2019
by
Kevin Alberts
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ordering in python versions that don't have ordered dicts
parent
9429f2da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
liteshort.py
liteshort.py
+1
-1
templates/admin.html
templates/admin.html
+1
-1
No files found.
liteshort.py
View file @
cdb6a883
...
...
@@ -136,7 +136,6 @@ def list_shortlinks_page(page, limit=50):
assert
type
(
limit
)
==
int
start_index
=
(
page
-
1
)
*
limit
result
=
query_db
(
'SELECT * FROM urls ORDER BY short LIMIT ? OFFSET ?'
,
(
limit
,
start_index
),
False
,
None
)
result
=
nested_list_to_dict
(
result
)
return
result
...
...
@@ -370,6 +369,7 @@ def admin():
page
=
1
urls
=
list_shortlinks_page
(
page
,
app
.
config
[
'admin_links_per_page'
])
return
render_template
(
'admin.html'
,
urls
=
urls
,
page
=
page
,
page_count
=
page_count
,
num_items
=
num_items
)
else
:
return
render_template
(
'login.html'
)
...
...
templates/admin.html
View file @
cdb6a883
...
...
@@ -69,7 +69,7 @@ A copy of the MIT license can be obtained at https://mit-license.org/
<th>
Long link
</th>
<th>
Delete?
</th>
</tr>
{% for long, short in urls
.items()
%}
{% for long, short in urls %}
<tr>
<td>
{{ short }}
</td>
<td>
{{ long }}
</td>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment