_changeform.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  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: 0 !important;
  329. @include for-width(374px) {
  330. border-radius: 4px !important;
  331. border-right: 1px !important;
  332. }
  333. &-link {
  334. vertical-align: top;
  335. display: inline-block;
  336. @include for-width(374px) {
  337. display: none;
  338. }
  339. span {
  340. width: 32px;
  341. height: 32px;
  342. line-height: 32px !important;
  343. background-color: $button-background-color;
  344. color: $button-text-color;
  345. display: inline-block;
  346. vertical-align: middle;
  347. text-align: center;
  348. border-radius: 0 4px 4px 0;
  349. }
  350. &:hover span {
  351. background-color: $button-hover-background-color;
  352. color: $button-hover-text-color;
  353. }
  354. }
  355. }
  356. .vDateField {
  357. min-width: 6.85em;
  358. }
  359. .vTimeField {
  360. min-width: 4.7em;
  361. }
  362. .vDateField-link + .vTimeField {
  363. margin-left: 10px;
  364. }
  365. .vURLField {
  366. width: 30em;
  367. }
  368. .vLargeTextField, .vXMLLargeTextField {
  369. width: 48em;
  370. @include for-mobile {
  371. width: 100%;
  372. }
  373. }
  374. .flatpages-flatpage #id_content {
  375. height: 40.2em;
  376. }
  377. .module table .vPositiveSmallIntegerField {
  378. width: 2.2em;
  379. }
  380. .vTextField {
  381. width: 20em;
  382. @include for-phone {
  383. width: 100%;
  384. }
  385. }
  386. .vIntegerField {
  387. width: 6em;
  388. }
  389. .vBigIntegerField {
  390. width: 10em;
  391. }
  392. .vForeignKeyRawIdAdminField {
  393. width: 5em;
  394. }
  395. /* INLINES */
  396. .inline-group {
  397. padding: 0;
  398. background-color: $content-background-color;
  399. border-radius: 4px;
  400. border: 0;
  401. thead th {
  402. padding: 8px 10px;
  403. }
  404. .aligned label {
  405. width: 160px;
  406. }
  407. > fieldset.module {
  408. padding: 0;
  409. }
  410. }
  411. .inline-related {
  412. position: relative;
  413. h3 {
  414. margin: 0;
  415. background: linear-gradient(to top, $content-background-color 0%, $content-contrast-background-color 100%);
  416. font-weight: bold;
  417. color: $text-color;
  418. padding: 20px 30px 0 30px;
  419. @include for-mobile {
  420. padding: 20px 20px 0 20px;
  421. line-height: 2;
  422. }
  423. > b {
  424. margin-right: 10px;
  425. }
  426. .inline_label {
  427. display: inline-block;
  428. background: $content-contrast2-background-color;
  429. color: $content-contrast2-text-color;
  430. padding: 4px 8px;
  431. border-radius: 5px;
  432. font-size: 10px;
  433. font-weight: normal;
  434. white-space: nowrap;
  435. overflow: hidden;
  436. text-overflow: ellipsis;
  437. max-width: 100%;
  438. box-sizing: border-box;
  439. vertical-align: middle;
  440. @include for-mobile {
  441. margin-right: 10px;
  442. line-height: normal;
  443. }
  444. ~ .inlinechangelink, ~ .inlineviewlink {
  445. font-size: 18px;
  446. margin-left: 10px;
  447. vertical-align: middle;
  448. &:before {
  449. margin: 0;
  450. }
  451. }
  452. }
  453. span.delete, .inline-deletelink {
  454. float: right;
  455. margin-left: 10px;
  456. display: inline-block;
  457. background: $danger-button-background-color;
  458. color: $danger-button-text-color;
  459. padding: 4px 8px;
  460. border-radius: 5px;
  461. font-size: 10px;
  462. font-weight: normal;
  463. vertical-align: middle;
  464. white-space: nowrap;
  465. @include for-mobile {
  466. float: none;
  467. margin-left: 0;
  468. line-height: normal;
  469. }
  470. label {
  471. font-size: 10px;
  472. vertical-align: middle;
  473. &:before {
  474. font-size: 10px;
  475. color: $danger-button-text-color;
  476. vertical-align: middle;
  477. }
  478. }
  479. }
  480. }
  481. fieldset {
  482. margin: 0;
  483. background: #fff;
  484. width: 100%;
  485. &.module {
  486. background-color: inherit;
  487. box-sizing: border-box;
  488. h3 {
  489. margin: 0;
  490. padding: 2px 5px 3px 5px;
  491. font-size: 11px;
  492. text-align: left;
  493. font-weight: bold;
  494. background: #bcd;
  495. color: #fff;
  496. }
  497. }
  498. }
  499. }
  500. .inline-related.tabular fieldset.module {
  501. padding: 0;
  502. table {
  503. width: 100%;
  504. }
  505. }
  506. .inline-group {
  507. .tabular {
  508. overflow-x: auto;
  509. -webkit-overflow-scrolling: touch;
  510. table {
  511. box-shadow: none;
  512. margin: 0;
  513. }
  514. thead th, thead td {
  515. background: linear-gradient(to top, $content-background-color 0%, $content-contrast-background-color 100%);
  516. font-weight: bold;
  517. color: $text-color;
  518. a:link, a:visited {
  519. color: $text-color;
  520. }
  521. }
  522. td.original {
  523. white-space: nowrap;
  524. width: 1px;
  525. padding-right: 0;
  526. &.empty {
  527. padding: 0;
  528. }
  529. p {
  530. padding: 0;
  531. .inlinechangelink, .inlineviewlink {
  532. font-size: 18px;
  533. margin: 0;
  534. vertical-align: middle;
  535. }
  536. }
  537. }
  538. tr.add-row td {
  539. padding: 8px 10px;
  540. border-bottom: 1px solid #eee;
  541. }
  542. }
  543. ul.tools {
  544. padding: 0;
  545. margin: 0;
  546. list-style: none;
  547. li {
  548. display: inline;
  549. padding: 0 5px;
  550. }
  551. }
  552. div.add-row, .tabular tr.add-row td {
  553. padding: 16px;
  554. border: 0;
  555. }
  556. ul.tools a.add, div.add-row a, .tabular tr.add-row td a {
  557. font-size: 12px;
  558. font-weight: bold;
  559. vertical-align: middle;
  560. &:before {
  561. @include font-icon;
  562. content: $icon-add;
  563. vertical-align: middle;
  564. margin-right: 4px;
  565. }
  566. }
  567. }
  568. .empty-form {
  569. display: none;
  570. }
  571. /* RELATED FIELD ADD ONE / LOOKUP */
  572. form .related-widget-wrapper ul {
  573. display: inline-block;
  574. margin-left: 0;
  575. padding-left: 0;
  576. }
  577. .clearable-file-input input {
  578. margin-top: 0;
  579. }
  580. .changeform-navigation {
  581. display: none;
  582. float: left;
  583. margin-bottom: 20px;
  584. @include for-mobile {
  585. margin-bottom: 5px;
  586. margin-right: 10px;
  587. }
  588. &.initialized {
  589. display: block;
  590. }
  591. &-button {
  592. font-weight: bold;
  593. vertical-align: middle;
  594. }
  595. }
  596. .related-widget-wrapper-link {
  597. opacity: 0.5;
  598. transition: opacity $transitions-duration;
  599. &:link {
  600. opacity: 1;
  601. }
  602. }
  603. .add-related, .add-another, .change-related, .delete-related, .related-lookup {
  604. display: none;
  605. &.initialized {
  606. display: inline-block;
  607. }
  608. .form-row & {
  609. margin-top: 10px;
  610. }
  611. }
  612. .related-widget-wrapper-icon {
  613. &:before {
  614. @include font-icon;
  615. font-size: 20px;
  616. vertical-align: middle;
  617. }
  618. .add-related &, .add-another & {
  619. &:before {
  620. content: $icon-add3;
  621. }
  622. }
  623. .change-related & {
  624. &:before {
  625. content: $icon-edit;
  626. }
  627. }
  628. .delete-related & {
  629. &:before {
  630. content: $icon-cross;
  631. }
  632. }
  633. }
  634. .related-lookup {
  635. margin-left: 6px;
  636. &:before {
  637. @include font-icon;
  638. font-size: 20px;
  639. vertical-align: middle;
  640. content: $icon-search;
  641. }
  642. }
  643. /* TABS */
  644. .changeform-tabs {
  645. margin: 0;
  646. padding: 0 0 0 16px;
  647. border-bottom: 2px solid $background-color;
  648. background-color: $content-background-color;
  649. border-radius: 4px 4px 0 0;
  650. @include for-mobile {
  651. padding: 10px 10px 5px 10px;
  652. }
  653. &-item {
  654. display: inline-block;
  655. padding: 0;
  656. line-height: normal;
  657. a, a:hover, a:visited {
  658. display: inline-block;
  659. padding: 12px 4px;
  660. margin: 0 8px 0 0;
  661. border-bottom: 2px solid transparent;
  662. position: relative;
  663. top: 2px;
  664. color: $dim-text-color;
  665. font-weight: bold;
  666. font-size: 11px;
  667. text-transform: uppercase;
  668. transition: background-color $fast-transitions-duration,
  669. color $fast-transitions-duration,
  670. border-color $transitions-duration;
  671. @include for-mobile {
  672. margin: 0 5px 5px 0;
  673. padding: 8px 12px;
  674. top: auto;
  675. border: 0;
  676. border-radius: 5px;
  677. font-weight: normal;
  678. background: $button-background-color;
  679. color: $button-text-color;
  680. }
  681. }
  682. a:hover {
  683. color: $text-color;
  684. }
  685. &.errors {
  686. & a, & a:hover, & a:visited {
  687. border-color: $tab-error-border-color;
  688. @include for-mobile {
  689. background: $danger-button-background-color;
  690. color: $danger-button-text-color;
  691. }
  692. }
  693. }
  694. &.selected {
  695. & a, & a:hover, & a:visited {
  696. color: $text-color;
  697. border-color: $tab-selected-border-color;
  698. @include for-mobile {
  699. background: $button-hover-background-color;
  700. color: $button-hover-text-color;
  701. }
  702. }
  703. }
  704. }
  705. ~ .module, ~ .inline-group {
  706. display: none !important;
  707. border-radius: 0 0 4px 4px;
  708. &.selected {
  709. display: block !important;
  710. }
  711. }
  712. }
  713. body.change-form #content-main > form > div {
  714. > .module, > .inline-group {
  715. display: none;
  716. &.initialized {
  717. display: block;
  718. }
  719. }
  720. }