Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
54cc93a8
Commit
54cc93a8
authored
Sep 07, 2012
by
Alec Perkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework nav to use Bootstrap's Navbar.
parent
5043b9f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
129 deletions
+143
-129
djangorestframework/static/djangorestframework/css/style.css
+4
-0
djangorestframework/templates/djangorestframework/base.html
+139
-129
No files found.
djangorestframework/static/djangorestframework/css/style.css
View file @
54cc93a8
body
{
padding-top
:
1em
;
}
\ No newline at end of file
djangorestframework/templates/djangorestframework/base.html
View file @
54cc93a8
...
@@ -20,139 +20,149 @@
...
@@ -20,139 +20,149 @@
</head>
</head>
<body
class=
"{% block bodyclass %}{% endblock %}"
>
<body
class=
"{% block bodyclass %}{% endblock %} container"
>
<div
id=
"container"
>
<div
class=
"navbar"
>
<div
id=
"header"
>
<div
class=
"navbar-inner"
>
<div
id=
"branding"
>
<span
class=
"brand"
href=
"/"
>
<h1
id=
"site-name"
>
{% block branding %}
<a
href=
'http://django-rest-framework.org'
>
Django REST framework
</a>
<span
class=
"version"
>
v {{ version }}
</span>
{% endblock %}
</h1>
{% block branding %}
<a
href=
'http://django-rest-framework.org'
>
Django REST framework
</a>
<span
class=
"version"
>
v {{ version }}
</span>
{% endblock %}
</div>
</span>
<div
id=
"user-tools"
>
{% block userlinks %}
{% block userlinks %}
<ul
class=
"nav pull-right"
>
{% if user.is_active %}
{% if user.is_active %}
Welcome, {{ user }}.
<li
class=
"dropdown"
>
{% optional_login %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
{% else %}
Welcome, {{ user }}
{% optional_logout %}
<b
class=
"caret"
></b>
{% endif %}
</a>
{% endblock %}
<ul
class=
"dropdown-menu"
>
</div>
<li>
{% optional_logout %}
</li>
{% block nav-global %}{% endblock %}
</ul>
</div>
</li>
{% else %}
<div
class=
"breadcrumbs"
>
<li>
{% optional_login %}
</li>
{% block breadcrumbs %}
{% endif %}
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
</ul>
<a
href=
"{{ breadcrumb_url }}"
>
{{ breadcrumb_name }}
</a>
{% if not forloop.last %}
›
{% endif %}
{% endblock %}
{% endfor %}
</div>
{% endblock %}
</div>
</div>
{% block nav-global %}{% endblock %}
<!-- Content -->
<div
id=
"content"
class=
"{% block coltype %}colM{% endblock %}"
>
<div
class=
"breadcrumbs"
>
{% if 'OPTIONS' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %}
{% block breadcrumbs %}
<form
action=
"{{ request.get_full_path }}"
method=
"post"
>
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
{% csrf_token %}
<a
href=
"{{ breadcrumb_url }}"
>
{{ breadcrumb_name }}
</a>
{% if not forloop.last %}
›
{% endif %}
<input
type=
"hidden"
name=
"{{ api_settings.FORM_METHOD_OVERRIDE }}"
value=
"OPTIONS"
/>
{% endfor %}
<input
type=
"submit"
value=
"OPTIONS"
class=
"default"
/>
{% endblock %}
</form>
</div>
{% endif %}
<!-- Content -->
<div
class=
'content-main'
>
<div
id=
"content"
class=
"{% block coltype %}colM{% endblock %}"
>
<h1>
{{ name }}
</h1>
<p>
{{ description }}
</p>
{% if 'OPTIONS' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %}
<div
class=
'module'
>
<form
action=
"{{ request.get_full_path }}"
method=
"post"
>
<pre><b>
HTTP {{ response.status_code }} {{ response.status_text }}
</b>
{% autoescape off %}
{% csrf_token %}
<input
type=
"hidden"
name=
"{{ api_settings.FORM_METHOD_OVERRIDE }}"
value=
"OPTIONS"
/>
<input
type=
"submit"
value=
"OPTIONS"
class=
"default"
/>
</form>
{% endif %}
<div
class=
'content-main'
>
<h1>
{{ name }}
</h1>
<p>
{{ description }}
</p>
<div
class=
'module'
>
<pre><b>
HTTP {{ response.status_code }} {{ response.status_text }}
</b>
{% autoescape off %}
{% for key, val in response.items %}
<b>
{{ key }}:
</b>
{{ val|urlize_quoted_links }}
{% for key, val in response.items %}
<b>
{{ key }}:
</b>
{{ val|urlize_quoted_links }}
{% endfor %}
{% endfor %}
{{ content|urlize_quoted_links }}
</pre>
{% endautoescape %}
</div>
{{ content|urlize_quoted_links }}
</pre>
{% endautoescape %}
</div>
{% if 'GET' in allowed_methods %}
{% if 'GET' in allowed_methods %}
<form>
<form>
<fieldset
class=
'module aligned'
>
<fieldset
class=
'module aligned'
>
<h2>
GET {{ name }}
</h2>
<h2>
GET {{ name }}
</h2>
<div
class=
'submit-row'
style=
'margin: 0; border: 0'
>
<div
class=
'submit-row'
style=
'margin: 0; border: 0'
>
<a
href=
'{{ request.get_full_path }}'
rel=
"nofollow"
style=
'float: left'
>
GET
</a>
<a
href=
'{{ request.get_full_path }}'
rel=
"nofollow"
style=
'float: left'
>
GET
</a>
{% for format in available_formats %}
{% for format in available_formats %}
{% with FORMAT_PARAM|add:"="|add:format as param %}
{% with FORMAT_PARAM|add:"="|add:format as param %}
[
<a
href=
'{{ request.get_full_path|add_query_param:param }}'
rel=
"nofollow"
>
{{ format }}
</a>
]
[
<a
href=
'{{ request.get_full_path|add_query_param:param }}'
rel=
"nofollow"
>
{{ format }}
</a>
]
{% endwith %}
{% endwith %}
{% endfor %}
{% endfor %}
</div>
</div>
</fieldset>
</fieldset>
</form>
</form>
{% endif %}
{% endif %}
{% comment %}
{% comment %}
DROP POST/PUT/DELETE until the forms are working with REST framework 2
DROP POST/PUT/DELETE until the forms are working with REST framework 2
{# Only display the POST/PUT/DELETE forms if method tunneling via POST forms is enabled and the user has permissions on this view. #}
{# Only display the POST/PUT/DELETE forms if method tunneling via POST forms is enabled and the user has permissions on this view. #}
{% if response.status_code != 403 %}
{% if response.status_code != 403 %}
{% if 'POST' in allowed_methods %}
{% if 'POST' in allowed_methods %}
<form
action=
"{{ request.get_full_path }}"
method=
"POST"
{%
if
post_form
.
is_multipart
%}
enctype=
"multipart/form-data"
{%
endif
%}
>
<form
action=
"{{ request.get_full_path }}"
method=
"POST"
{%
if
post_form
.
is_multipart
%}
enctype=
"multipart/form-data"
{%
endif
%}
>
<fieldset
class=
'module aligned'
>
<fieldset
class=
'module aligned'
>
<h2>
POST {{ name }}
</h2>
<h2>
POST {{ name }}
</h2>
{% csrf_token %}
{% csrf_token %}
{{ post_form.non_field_errors }}
{{ post_form.non_field_errors }}
{% for field in post_form %}
{% for field in post_form %}
<div
class=
'form-row'
>
<div
class=
'form-row'
>
{{ field.label_tag }}
{{ field.label_tag }}
{{ field }}
{{ field }}
<span
class=
'help'
>
{{ field.help_text }}
</span>
<span
class=
'help'
>
{{ field.help_text }}
</span>
{{ field.errors }}
{{ field.errors }}
</div>
</div>
{% endfor %}
{% endfor %}
<div
class=
'submit-row'
style=
'margin: 0; border: 0'
>
<div
class=
'submit-row'
style=
'margin: 0; border: 0'
>
<input
type=
"submit"
value=
"POST"
class=
"default"
/>
<input
type=
"submit"
value=
"POST"
class=
"default"
/>
</div>
</div>
</fieldset>
</fieldset>
</form>
</form>
{% endif %}
{% endif %}
{% if 'PUT' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %}
{% if 'PUT' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %}
<form
action=
"{{ request.get_full_path }}"
method=
"POST"
{%
if
put_form
.
is_multipart
%}
enctype=
"multipart/form-data"
{%
endif
%}
>
<form
action=
"{{ request.get_full_path }}"
method=
"POST"
{%
if
put_form
.
is_multipart
%}
enctype=
"multipart/form-data"
{%
endif
%}
>
<fieldset
class=
'module aligned'
>
<fieldset
class=
'module aligned'
>
<h2>
PUT {{ name }}
</h2>
<h2>
PUT {{ name }}
</h2>
<input
type=
"hidden"
name=
"{{ api_settings.FORM_METHOD_OVERRIDE }}"
value=
"PUT"
/>
<input
type=
"hidden"
name=
"{{ api_settings.FORM_METHOD_OVERRIDE }}"
value=
"PUT"
/>
{% csrf_token %}
{% csrf_token %}
{{ put_form.non_field_errors }}
{{ put_form.non_field_errors }}
{% for field in put_form %}
{% for field in put_form %}
<div
class=
'form-row'
>
<div
class=
'form-row'
>
{{ field.label_tag }}
{{ field.label_tag }}
{{ field }}
{{ field }}
<span
class=
'help'
>
{{ field.help_text }}
</span>
<span
class=
'help'
>
{{ field.help_text }}
</span>
{{ field.errors }}
{{ field.errors }}
</div>
</div>
{% endfor %}
{% endfor %}
<div
class=
'submit-row'
style=
'margin: 0; border: 0'
>
<div
class=
'submit-row'
style=
'margin: 0; border: 0'
>
<input
type=
"submit"
value=
"PUT"
class=
"default"
/>
<input
type=
"submit"
value=
"PUT"
class=
"default"
/>
</div>
</div>
</fieldset>
</fieldset>
</form>
</form>
{% endif %}
{% endif %}
{% if 'DELETE' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %}
{% if 'DELETE' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %}
<form
action=
"{{ request.get_full_path }}"
method=
"POST"
>
<form
action=
"{{ request.get_full_path }}"
method=
"POST"
>
<fieldset
class=
'module aligned'
>
<fieldset
class=
'module aligned'
>
<h2>
DELETE {{ name }}
</h2>
<h2>
DELETE {{ name }}
</h2>
{% csrf_token %}
{% csrf_token %}
<input
type=
"hidden"
name=
"{{ api_settings.FORM_METHOD_OVERRIDE }}"
value=
"DELETE"
/>
<input
type=
"hidden"
name=
"{{ api_settings.FORM_METHOD_OVERRIDE }}"
value=
"DELETE"
/>
<div
class=
'submit-row'
style=
'margin: 0; border: 0'
>
<div
class=
'submit-row'
style=
'margin: 0; border: 0'
>
<input
type=
"submit"
value=
"DELETE"
class=
"default"
/>
<input
type=
"submit"
value=
"DELETE"
class=
"default"
/>
</div>
</div>
</fieldset>
</fieldset>
</form>
</form>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endcomment %}
{% endcomment %}
</div>
</div>
<!-- END content-main -->
<!-- END content-main -->
</div>
</div>
<!-- END Content -->
<!-- END Content -->
{% block footer %}
<div
id=
"footer"
></div>
{% endblock %}
{% block footer %}
<div
id=
"footer"
></div>
{% endblock %}
</div>
</div>
...
...
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