_changeform.scss 17 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  1. @import "globals";
  2. /* FORM ROWS */
  3. .form-row {
  4. overflow: hidden;
  5. padding: 10px;
  6. img, input {
  7. vertical-align: middle;
  8. }
  9. label input[type="checkbox"] {
  10. margin-top: 0;
  11. vertical-align: 0;
  12. }
  13. p {
  14. padding-left: 0;
  15. }
  16. .select2 {
  17. @include for-phone {
  18. width: auto !important;
  19. max-width: 100%;
  20. }
  21. }
  22. }
  23. .hidden {
  24. display: none;
  25. }
  26. /* FORM LABELS */
  27. label {
  28. .required &, &.required {
  29. font-weight: bold;
  30. &:after {
  31. content: "*";
  32. }
  33. }
  34. .form-row.errors & {
  35. color: $error-text-color;
  36. }
  37. }
  38. /* RADIO BUTTONS */
  39. form {
  40. ul.radiolist {
  41. li {
  42. list-style-type: none;
  43. }
  44. label {
  45. float: none;
  46. display: inline;
  47. }
  48. input[type="radio"] {
  49. margin: -2px 4px 0 0;
  50. padding: 0;
  51. }
  52. }
  53. ul.inline {
  54. margin-left: 0;
  55. padding: 0;
  56. li {
  57. float: left;
  58. padding-right: 7px;
  59. }
  60. }
  61. }
  62. /* ALIGNED FIELDSETS */
  63. .aligned {
  64. label {
  65. display: block;
  66. padding: 8px 10px 0 0;
  67. float: left;
  68. width: 160px;
  69. word-wrap: break-word;
  70. line-height: 1;
  71. @include for-mobile {
  72. display: block;
  73. padding: 0 0 0 2px;
  74. margin-bottom: 8px;
  75. float: none;
  76. width: auto;
  77. }
  78. }
  79. label + p {
  80. padding: 6px 0;
  81. margin-top: 0;
  82. margin-bottom: 0;
  83. margin-left: 170px;
  84. @include for-mobile {
  85. margin-left: 0;
  86. }
  87. }
  88. ul label {
  89. display: inline;
  90. float: none;
  91. width: auto;
  92. }
  93. .form-row input {
  94. margin-bottom: 0;
  95. }
  96. .vCheckboxLabel {
  97. float: none;
  98. width: auto;
  99. display: inline-block;
  100. vertical-align: -3px;
  101. padding: 0 0 5px 0;
  102. & + p.help {
  103. margin-top: -4px;
  104. }
  105. }
  106. }
  107. form .aligned {
  108. ul {
  109. margin-left: 160px;
  110. padding-left: 10px;
  111. @include for-mobile {
  112. margin-left: 0;
  113. padding-left: 0;
  114. }
  115. }
  116. ul.radiolist {
  117. display: inline-block;
  118. margin: 0;
  119. padding: 0;
  120. }
  121. p.help {
  122. clear: left;
  123. margin-top: 0;
  124. margin-left: 160px;
  125. padding-left: 10px;
  126. @include for-mobile {
  127. margin-left: 0;
  128. padding-left: 0;
  129. }
  130. }
  131. label + p.help {
  132. margin-left: 0;
  133. padding-left: 0;
  134. }
  135. p.help:last-child {
  136. margin-bottom: 0;
  137. padding-bottom: 0;
  138. }
  139. input + p.help,
  140. textarea + p.help,
  141. select + p.help {
  142. margin-left: 160px;
  143. padding-left: 10px;
  144. @include for-mobile {
  145. margin-left: 0;
  146. padding-left: 0;
  147. }
  148. }
  149. ul li {
  150. list-style: none;
  151. }
  152. table p {
  153. margin-left: 0;
  154. padding-left: 0;
  155. }
  156. }
  157. .colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField {
  158. width: 350px;
  159. @include for-mobile {
  160. width: 100%;
  161. }
  162. }
  163. .colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField {
  164. width: 510px;
  165. @include for-mobile {
  166. width: 100%;
  167. }
  168. }
  169. .checkbox-row p.help {
  170. margin-left: 0;
  171. padding-left: 0;
  172. }
  173. /* FIELDSETS */
  174. fieldset {
  175. .field-box {
  176. float: left;
  177. margin-right: 20px;
  178. }
  179. &.monospace textarea {
  180. font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
  181. }
  182. }
  183. /* WIDE FIELDSETS */
  184. .wide label {
  185. width: 200px;
  186. }
  187. form .wide p, form .wide input + p.help {
  188. margin-left: 200px;
  189. @include for-mobile {
  190. margin-left: 0;
  191. }
  192. }
  193. form .wide p.help {
  194. padding-left: 38px;
  195. @include for-mobile {
  196. padding-left: 0;
  197. }
  198. }
  199. .colM fieldset.wide .vLargeTextField, .colM fieldset.wide .vXMLLargeTextField {
  200. width: 450px;
  201. @include for-mobile {
  202. width: 100%;
  203. }
  204. }
  205. /* COLLAPSED FIELDSETS */
  206. //fieldset.collapsed * {
  207. // display: none;
  208. //}
  209. //
  210. //fieldset.collapsed h2, fieldset.collapsed {
  211. // display: block;
  212. //}
  213. //
  214. //fieldset.collapsed {
  215. // border: 1px solid #eee;
  216. // border-radius: 4px;
  217. // overflow: hidden;
  218. //}
  219. //
  220. //fieldset.collapsed h2 {
  221. // background: #f8f8f8;
  222. // color: #666;
  223. //}
  224. //
  225. //fieldset .collapse-toggle {
  226. // color: #fff;
  227. //}
  228. //
  229. //fieldset.collapsed .collapse-toggle {
  230. // background: transparent;
  231. // display: inline;
  232. // color: #447e9b;
  233. //}
  234. /* MONOSPACE TEXTAREAS */
  235. fieldset.monospace textarea {
  236. font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
  237. }
  238. /* SUBMIT ROW */
  239. .submit-row {
  240. margin: 20px 0;
  241. overflow: hidden;
  242. @include for-mobile {
  243. margin-bottom: 10px;
  244. }
  245. @include for-phone {
  246. padding: 0 10px;
  247. }
  248. input {
  249. &, &:visited, &:hover {
  250. margin: 0 5px 5px 0;
  251. padding: 0 20px;
  252. font-size: 12px;
  253. @include for-phone {
  254. display: block;
  255. width: 100%;
  256. margin: 0 0 8px 0;
  257. }
  258. }
  259. &.default {
  260. margin: 0 8px 5px 0;
  261. @include for-phone {
  262. display: block;
  263. width: 100%;
  264. margin: 0 0 20px 0;
  265. }
  266. }
  267. }
  268. p {
  269. margin: 0.3em;
  270. }
  271. p.deletelink-box {
  272. display: block;
  273. float: right;
  274. padding: 0;
  275. margin: 0 5px 5px 0;
  276. @include for-phone {
  277. float: none;
  278. display: block;
  279. margin: 0 0 8px 0;
  280. }
  281. }
  282. a.deletelink {
  283. &, &:visited, &:hover {
  284. display: inline-block;
  285. background-color: $danger-button-background-color;
  286. color: $danger-button-text-color;
  287. border: 0;
  288. border-radius: 4px;
  289. height: 32px;
  290. line-height: 32px;
  291. outline: 0;
  292. font-size: 12px;
  293. font-weight: lighter;
  294. text-align: center;
  295. padding: 0 20px;
  296. text-transform: uppercase;
  297. box-sizing: border-box;
  298. transition: background $transitions-duration, box-shadow $transitions-duration, border $transitions-duration;
  299. @include for-phone {
  300. display: block;
  301. width: 100%;
  302. }
  303. }
  304. &:hover, &:focus {
  305. background-color: $button-hover-background-color;
  306. color: $button-hover-text-color;
  307. }
  308. &:active {
  309. background-color: $button-active-background-color;
  310. color: $button-active-text-color;
  311. }
  312. }
  313. }
  314. body.popup .submit-row {
  315. overflow: auto;
  316. }
  317. /* CUSTOM FORM FIELDS */
  318. .vSelectMultipleField {
  319. vertical-align: top;
  320. }
  321. .vCheckboxField {
  322. border: none;
  323. }
  324. .vDateField, .vTimeField {
  325. margin-right: 2px;
  326. margin-bottom: 4px;
  327. border-radius: 4px 0 0 4px !important;
  328. border-right-width: 0 !important;
  329. #changelist & {
  330. border-radius: 4px !important;
  331. border-right-width: 1px !important;
  332. }
  333. @include for-width(374px) {
  334. border-radius: 4px !important;
  335. border-right-width: 1px !important;
  336. }
  337. &-link {
  338. vertical-align: top;
  339. display: inline-block;
  340. @include for-width(374px) {
  341. display: none;
  342. }
  343. span {
  344. width: 32px;
  345. height: 32px;
  346. line-height: 32px !important;
  347. background-color: $button-background-color;
  348. color: $button-text-color;
  349. display: inline-block;
  350. vertical-align: middle;
  351. text-align: center;
  352. border-radius: 0 4px 4px 0;
  353. }
  354. &:hover span {
  355. background-color: $button-hover-background-color;
  356. color: $button-hover-text-color;
  357. }
  358. }
  359. }
  360. .vDateField {
  361. min-width: 6.85em;
  362. }
  363. .vTimeField {
  364. min-width: 4.7em;
  365. }
  366. .vDateField-link + .vTimeField {
  367. margin-left: 10px;
  368. }
  369. .vURLField {
  370. width: 26em;
  371. @include for-phone {
  372. width: 100%;
  373. }
  374. }
  375. .vLargeTextField, .vXMLLargeTextField {
  376. width: 48em;
  377. @include for-mobile {
  378. width: 100%;
  379. }
  380. }
  381. .flatpages-flatpage #id_content {
  382. height: 40.2em;
  383. }
  384. .module table .vPositiveSmallIntegerField {
  385. width: 2.2em;
  386. }
  387. .vTextField {
  388. width: 20em;
  389. @include for-phone {
  390. width: 100%;
  391. }
  392. }
  393. .vIntegerField {
  394. width: 6em;
  395. }
  396. .vBigIntegerField {
  397. width: 10em;
  398. }
  399. .vForeignKeyRawIdAdminField {
  400. width: 5em;
  401. }
  402. /* INLINES */
  403. .inline-group {
  404. padding: 0;
  405. background-color: $content-background-color;
  406. border-radius: 4px;
  407. border: 0;
  408. &.compact {
  409. position: relative;
  410. min-height: 400px;
  411. @include for-mobile {
  412. position: static;
  413. min-height: 0;
  414. }
  415. }
  416. thead th {
  417. padding: 8px 10px;
  418. }
  419. .aligned label {
  420. width: 160px;
  421. }
  422. > fieldset.module {
  423. padding: 0;
  424. }
  425. }
  426. .inline-related {
  427. position: relative;
  428. h3 {
  429. margin: 0;
  430. background: linear-gradient(to top, $content-background-color 0%, $content-contrast-background-color 100%);
  431. font-weight: bold;
  432. color: $text-color;
  433. padding: 20px 30px 0 30px;
  434. @include for-mobile {
  435. padding: 20px 20px 0 20px;
  436. line-height: 2;
  437. }
  438. > b {
  439. margin-right: 10px;
  440. }
  441. .inline_label {
  442. display: inline-block;
  443. background: $content-contrast2-background-color;
  444. color: $content-contrast2-text-color;
  445. margin-right: 10px;
  446. padding: 4px 8px;
  447. border-radius: 5px;
  448. font-size: 10px;
  449. font-weight: normal;
  450. white-space: nowrap;
  451. overflow: hidden;
  452. text-overflow: ellipsis;
  453. max-width: 100%;
  454. box-sizing: border-box;
  455. vertical-align: middle;
  456. @include for-mobile {
  457. line-height: normal;
  458. }
  459. ~ .inlinechangelink, ~ .inlineviewlink {
  460. font-size: 18px;
  461. margin-right: 10px;
  462. vertical-align: middle;
  463. &:before {
  464. margin: 0;
  465. }
  466. }
  467. }
  468. span.delete, .inline-deletelink {
  469. float: right;
  470. margin-left: 10px;
  471. display: inline-block;
  472. background: $danger-button-background-color;
  473. color: $danger-button-text-color;
  474. padding: 4px 8px;
  475. border-radius: 5px;
  476. font-size: 10px;
  477. font-weight: normal;
  478. vertical-align: middle;
  479. white-space: nowrap;
  480. @include for-mobile {
  481. float: none;
  482. margin-left: 0;
  483. line-height: normal;
  484. }
  485. label {
  486. font-size: 10px;
  487. vertical-align: middle;
  488. &:before {
  489. font-size: 10px;
  490. color: $danger-button-text-color;
  491. vertical-align: middle;
  492. }
  493. }
  494. }
  495. }
  496. fieldset {
  497. margin: 0;
  498. background: #fff;
  499. width: 100%;
  500. &.module {
  501. background-color: inherit;
  502. box-sizing: border-box;
  503. h3 {
  504. margin: 0;
  505. padding: 2px 5px 3px 5px;
  506. font-size: 11px;
  507. text-align: left;
  508. font-weight: bold;
  509. background: #bcd;
  510. color: #fff;
  511. }
  512. }
  513. }
  514. }
  515. .inline-group.compact .inline-related h3 {
  516. background: transparent;
  517. }
  518. .inline-related.tabular fieldset.module {
  519. padding: 0;
  520. table {
  521. width: 100%;
  522. }
  523. }
  524. .inline-navigation {
  525. position: absolute;
  526. top: 0;
  527. bottom: 0;
  528. left: 0;
  529. width: 200px;
  530. background: $content-contrast-background-color;
  531. @include for-mobile {
  532. position: relative;
  533. width: auto;
  534. top: auto;
  535. bottom: auto;
  536. left: auto;
  537. }
  538. &-top {
  539. position: absolute;
  540. top: 0;
  541. right: 0;
  542. left: 0;
  543. height: 50px;
  544. background: linear-gradient(to bottom, $content-background-color 25%, transparentize($content-contrast-background-color, 1) 100%);
  545. z-index: 1;
  546. }
  547. &-bottom {
  548. position: absolute;
  549. right: 0;
  550. bottom: 0;
  551. left: 0;
  552. height: 50px;
  553. background: linear-gradient(to top, $content-background-color 25%, transparentize($content-contrast-background-color, 1) 100%);
  554. z-index: 1;
  555. @include for-mobile {
  556. display: none;
  557. }
  558. }
  559. .add-row {
  560. position: absolute;
  561. top: 10px;
  562. right: 0;
  563. left: 0;
  564. padding: 0 16px !important;
  565. z-index: 1;
  566. }
  567. &-content {
  568. position: absolute;
  569. top: 0;
  570. right: 0;
  571. bottom: 0;
  572. left: 0;
  573. padding: 40px 0 20px 0;
  574. overflow-y: auto;
  575. -webkit-overflow-scrolling: touch;
  576. @include for-mobile {
  577. position: static;
  578. top: auto;
  579. right: auto;
  580. bottom: auto;
  581. left: auto;
  582. padding-bottom: 10px;
  583. max-height: 200px;
  584. }
  585. }
  586. &-item {
  587. &, &:visited, &:hover {
  588. display: block;
  589. white-space: nowrap;
  590. text-overflow: ellipsis;
  591. overflow: hidden;
  592. padding: 8px 10px 8px 20px;
  593. color: $dim-text-color;
  594. transition: background-color $transitions-duration, color $transitions-duration;
  595. }
  596. body.no-touchevents &:hover, &:active {
  597. background: $button-hover-background-color;
  598. color: $button-hover-text-color;
  599. }
  600. &.empty {
  601. display: none;
  602. }
  603. &.selected {
  604. background: transparent;
  605. color: $text-color;
  606. font-weight: bold;
  607. cursor: default;
  608. }
  609. &.delete {
  610. text-decoration: line-through;
  611. }
  612. }
  613. }
  614. .inline-group {
  615. .tabular {
  616. overflow-x: auto;
  617. -webkit-overflow-scrolling: touch;
  618. table {
  619. box-shadow: none;
  620. margin: 0;
  621. }
  622. thead th, thead td {
  623. background: linear-gradient(to top, $content-background-color 0%, $content-contrast-background-color 100%);
  624. font-weight: bold;
  625. color: $text-color;
  626. a:link, a:visited {
  627. color: $text-color;
  628. }
  629. }
  630. td.original {
  631. white-space: nowrap;
  632. width: 1px;
  633. padding-right: 0;
  634. &.empty {
  635. padding: 0;
  636. }
  637. p {
  638. padding: 0;
  639. .inlinechangelink, .inlineviewlink {
  640. font-size: 18px;
  641. margin: 0;
  642. vertical-align: middle;
  643. }
  644. }
  645. }
  646. tr.add-row td {
  647. padding: 8px 10px;
  648. border-bottom: 1px solid #eee;
  649. }
  650. }
  651. .compact {
  652. display: none;
  653. margin-left: 200px;
  654. @include for-mobile {
  655. margin-left: 0;
  656. }
  657. &.selected {
  658. display: block;
  659. }
  660. }
  661. ul.tools {
  662. padding: 0;
  663. margin: 0;
  664. list-style: none;
  665. li {
  666. display: inline;
  667. padding: 0 5px;
  668. }
  669. }
  670. div.add-row, .tabular tr.add-row td {
  671. padding: 16px;
  672. border: 0;
  673. }
  674. ul.tools a.add, div.add-row a, .tabular tr.add-row td a {
  675. font-size: 12px;
  676. font-weight: bold;
  677. vertical-align: middle;
  678. &:before {
  679. @include font-icon;
  680. content: $icon-add;
  681. vertical-align: middle;
  682. margin-right: 4px;
  683. }
  684. }
  685. }
  686. .empty-form {
  687. display: none;
  688. }
  689. /* RELATED FIELD ADD ONE / LOOKUP */
  690. form .related-widget-wrapper ul {
  691. display: inline-block;
  692. margin-left: 0;
  693. padding-left: 0;
  694. }
  695. .clearable-file-input input {
  696. margin-top: 0;
  697. }
  698. .changeform-navigation {
  699. display: none;
  700. float: left;
  701. margin-bottom: 20px;
  702. @include for-mobile {
  703. margin-bottom: 5px;
  704. margin-right: 10px;
  705. }
  706. &.initialized {
  707. display: block;
  708. }
  709. &-button {
  710. font-weight: bold;
  711. vertical-align: middle;
  712. }
  713. }
  714. .related-widget-wrapper-link {
  715. opacity: 0.5;
  716. transition: opacity $transitions-duration;
  717. &:link {
  718. opacity: 1;
  719. }
  720. }
  721. .add-related, .add-another, .change-related, .delete-related, .related-lookup {
  722. display: none;
  723. &.initialized {
  724. display: inline-block;
  725. }
  726. .form-row & {
  727. margin-top: 10px;
  728. }
  729. }
  730. .related-widget-wrapper-icon {
  731. &:before {
  732. @include font-icon;
  733. font-size: 20px;
  734. vertical-align: middle;
  735. }
  736. .add-related &, .add-another & {
  737. &:before {
  738. content: $icon-add3;
  739. }
  740. }
  741. .change-related & {
  742. &:before {
  743. content: $icon-edit;
  744. }
  745. }
  746. .delete-related & {
  747. &:before {
  748. content: $icon-cross;
  749. }
  750. }
  751. }
  752. .related-lookup {
  753. margin-left: 6px;
  754. &:before {
  755. @include font-icon;
  756. font-size: 20px;
  757. vertical-align: middle;
  758. content: $icon-search;
  759. }
  760. }
  761. /* TABS */
  762. .changeform-tabs {
  763. margin: 0;
  764. padding: 0 0 0 16px;
  765. border-bottom: 2px solid $background-color;
  766. background-color: $content-background-color;
  767. border-radius: 4px 4px 0 0;
  768. @include for-mobile {
  769. padding: 10px 10px 5px 10px;
  770. }
  771. &-item {
  772. display: inline-block;
  773. padding: 0;
  774. line-height: normal;
  775. a, a:hover, a:visited {
  776. display: inline-block;
  777. padding: 12px 4px;
  778. margin: 0 8px 0 0;
  779. border-bottom: 2px solid transparent;
  780. position: relative;
  781. top: 2px;
  782. color: $dim-text-color;
  783. font-weight: bold;
  784. font-size: 11px;
  785. text-transform: uppercase;
  786. transition: background-color $fast-transitions-duration,
  787. color $fast-transitions-duration,
  788. border-color $transitions-duration;
  789. @include for-mobile {
  790. margin: 0 5px 5px 0;
  791. padding: 8px 12px;
  792. top: auto;
  793. border: 0;
  794. border-radius: 5px;
  795. font-weight: normal;
  796. background: $button-background-color;
  797. color: $button-text-color;
  798. }
  799. }
  800. a:hover {
  801. color: $text-color;
  802. }
  803. &.errors {
  804. & a, & a:hover, & a:visited {
  805. border-color: $tab-error-border-color;
  806. @include for-mobile {
  807. background: $danger-button-background-color;
  808. color: $danger-button-text-color;
  809. }
  810. }
  811. }
  812. &.selected {
  813. & a, & a:hover, & a:visited {
  814. color: $text-color;
  815. border-color: $tab-selected-border-color;
  816. @include for-mobile {
  817. background: $button-hover-background-color;
  818. color: $button-hover-text-color;
  819. }
  820. }
  821. }
  822. }
  823. ~ .module, ~ .inline-group {
  824. display: none !important;
  825. border-radius: 0 0 4px 4px;
  826. &.selected {
  827. display: block !important;
  828. }
  829. }
  830. }
  831. body.change-form #content-main > form > div {
  832. > .module, > .inline-group {
  833. display: none;
  834. &.initialized {
  835. display: block;
  836. }
  837. }
  838. }