From 8fdf9250157cde2341ec9c86ead44b2ed1354aa2 Mon Sep 17 00:00:00 2001 From: Michael Elovskikh Date: Fri, 15 Feb 2013 14:41:12 +0600 Subject: Added tabs between object form and generic content form on PUT/PATCH form Some extra behaviour to `BrowsableAPIRenderer` to handle PATCH form. Added PATCH button on generic content PUT form. Tabs between object form and generic content form on PUT/PATCH form wich are both allways visible now. Fix #570 Refs #591 --- rest_framework/static/rest_framework/js/default.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'rest_framework/static') diff --git a/rest_framework/static/rest_framework/js/default.js b/rest_framework/static/rest_framework/js/default.js index ecaccc0f..bc5b0292 100644 --- a/rest_framework/static/rest_framework/js/default.js +++ b/rest_framework/static/rest_framework/js/default.js @@ -3,3 +3,5 @@ prettyPrint(); $('.js-tooltip').tooltip({ delay: 1000 }); + +$('#form-switcher a:first').tab('show'); \ No newline at end of file -- cgit v1.2.3 From 2fb6fa2dd3b336cc442e707dbb80a4d5616582a6 Mon Sep 17 00:00:00 2001 From: Michael Elovskikh Date: Wed, 20 Feb 2013 17:15:12 +0600 Subject: Minimal forms appearance improvements --- rest_framework/static/rest_framework/css/default.css | 11 +++++++++++ rest_framework/static/rest_framework/js/default.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'rest_framework/static') diff --git a/rest_framework/static/rest_framework/css/default.css b/rest_framework/static/rest_framework/css/default.css index b2e41b99..73107527 100644 --- a/rest_framework/static/rest_framework/css/default.css +++ b/rest_framework/static/rest_framework/css/default.css @@ -150,6 +150,17 @@ html, body { margin: 0 auto -60px; } +.form-switcher { + margin-bottom: 0; +} + +.tab-content { + padding-top: 25px; + background: #fff; + border: 1px solid #ddd; + border-top: none; + border-radius: 0 0 4px 4px; +} #footer, #push { height: 60px; /* .push must be the same height as .footer */ diff --git a/rest_framework/static/rest_framework/js/default.js b/rest_framework/static/rest_framework/js/default.js index bc5b0292..484a3bdf 100644 --- a/rest_framework/static/rest_framework/js/default.js +++ b/rest_framework/static/rest_framework/js/default.js @@ -4,4 +4,4 @@ $('.js-tooltip').tooltip({ delay: 1000 }); -$('#form-switcher a:first').tab('show'); \ No newline at end of file +$('.form-switcher a:first').tab('show'); \ No newline at end of file -- cgit v1.2.3 From 048ef6a03988d371f25352eb0aba24c40b997054 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 22 Feb 2013 08:39:26 +0000 Subject: Polishing touches to #663 --- .../static/rest_framework/css/default.css | 43 +++++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'rest_framework/static') diff --git a/rest_framework/static/rest_framework/css/default.css b/rest_framework/static/rest_framework/css/default.css index 73107527..4e7cbc06 100644 --- a/rest_framework/static/rest_framework/css/default.css +++ b/rest_framework/static/rest_framework/css/default.css @@ -154,12 +154,43 @@ html, body { margin-bottom: 0; } -.tab-content { - padding-top: 25px; - background: #fff; - border: 1px solid #ddd; - border-top: none; - border-radius: 0 0 4px 4px; +.well .form-actions { + padding-bottom: 0; + margin-bottom: 0; +} + +.well form { + margin-bottom: 0; +} + +.nav-tabs { + border: 0; +} + +.nav-tabs > li { + margin-bottom: -3px; + float: right; +} + +.nav-tabs li a { + margin-right: 0; +} + +.nav-tabs > .active > a { + background: #f5f5f5; +} + +.nav-tabs > .active > a:hover { + background: #f5f5f5; +} + +.tabs-below > .nav-tabs { + border-bottom: none !important; +} + +.tabs-below > .nav-tabs > li { + margin-bottom: -2px !important; + margin-right: 0 !important; } #footer, #push { -- cgit v1.2.3 From 7b9e134a8ff473891d791492e1fba27abe6f6721 Mon Sep 17 00:00:00 2001 From: Michael Elovskikh Date: Fri, 22 Feb 2013 17:49:10 +0600 Subject: Minimal appearance fixes in addition to #663 --- rest_framework/static/rest_framework/css/default.css | 17 +++++++++-------- rest_framework/static/rest_framework/js/default.js | 8 +++++++- 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'rest_framework/static') diff --git a/rest_framework/static/rest_framework/css/default.css b/rest_framework/static/rest_framework/css/default.css index 4e7cbc06..d806267b 100644 --- a/rest_framework/static/rest_framework/css/default.css +++ b/rest_framework/static/rest_framework/css/default.css @@ -154,6 +154,12 @@ html, body { margin-bottom: 0; } +.well { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + .well .form-actions { padding-bottom: 0; margin-bottom: 0; @@ -168,7 +174,6 @@ html, body { } .nav-tabs > li { - margin-bottom: -3px; float: right; } @@ -184,13 +189,9 @@ html, body { background: #f5f5f5; } -.tabs-below > .nav-tabs { - border-bottom: none !important; -} - -.tabs-below > .nav-tabs > li { - margin-bottom: -2px !important; - margin-right: 0 !important; +.tabbable.first-tab-active .tab-content +{ + border-top-right-radius: 0; } #footer, #push { diff --git a/rest_framework/static/rest_framework/js/default.js b/rest_framework/static/rest_framework/js/default.js index 484a3bdf..c74829d7 100644 --- a/rest_framework/static/rest_framework/js/default.js +++ b/rest_framework/static/rest_framework/js/default.js @@ -4,4 +4,10 @@ $('.js-tooltip').tooltip({ delay: 1000 }); -$('.form-switcher a:first').tab('show'); \ No newline at end of file +$('a[data-toggle="tab"]:first').on('shown', function (e) { + $(e.target).parents('.tabbable').addClass('first-tab-active'); +}); +$('a[data-toggle="tab"]:not(:first)').on('shown', function (e) { + $(e.target).parents('.tabbable').removeClass('first-tab-active'); +}); +$('.form-switcher a:first').tab('show'); -- cgit v1.2.3