You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

548 lines
14 KiB

5 years ago
  1. /* Copyright 2018 Tecnativa - Jairo Llopis
  2. * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
  3. @mixin full-screen-dropdown {
  4. border: none;
  5. box-shadow: none;
  6. display: flex;
  7. flex-direction: column;
  8. height: calc(100vh - #{$o-navbar-height});
  9. max-height: calc(100vh - #{$o-navbar-height});
  10. position: fixed;
  11. width: 100vw;
  12. z-index: 100;
  13. // Inline style will override our `top`, so we need !important here
  14. top: $o-navbar-height !important;
  15. transform: none !important;
  16. }
  17. // Main navbar (with apps menu, user menu, debug menu...)
  18. @include media-breakpoint-down(sm) {
  19. .o_main_navbar {
  20. // This allows to have a sane layout for mobiles
  21. display: flex;
  22. // Remove clutter to only have small icons that fit in a small screen
  23. > .dropdown {
  24. display: flex;
  25. .navbar-toggler {
  26. color: white;
  27. }
  28. .o_menu_sections,
  29. .o_menu_systray,
  30. {
  31. padding: 0;
  32. }
  33. }
  34. // Whitespace before systray icons
  35. .o_menu_systray {
  36. margin-left: auto;
  37. }
  38. // Hide big things
  39. .o_menu_brand,
  40. .o_menu_sections,
  41. .oe_topbar_name,
  42. {
  43. display: none;
  44. }
  45. // Fix toggler button padding
  46. .o-menu-toggle {
  47. cursor: pointer;
  48. padding: 0 $o-horizontal-padding;
  49. }
  50. // Custom fullscreen layout when showing submenus
  51. .o_menu_sections.show {
  52. @include full-screen-dropdown();
  53. background-color: $dropdown-bg;
  54. .show {
  55. display: flex;
  56. flex-direction: column;
  57. .dropdown-menu {
  58. margin-left: 1rem;
  59. min-width: auto;
  60. width: calc(100vw - 2rem);
  61. }
  62. }
  63. > li,
  64. .o_menu_entry_lvl_1,
  65. .o_menu_header_lvl_1,
  66. {
  67. // Homogeneous background color
  68. background-color: $dropdown-bg;
  69. color: $dropdown-link-color;
  70. &:hover {
  71. background-color: $dropdown-link-hover-bg;
  72. color: $dropdown-link-hover-color;
  73. }
  74. // Disable the .o-no-caret class effect, to display the caret
  75. &.o-no-caret::after {
  76. content: "";
  77. }
  78. // Fix a strange glitch leaving headers invisible
  79. .dropdown-header {
  80. color: $dropdown-header-color;
  81. }
  82. }
  83. }
  84. // Custom fullscreen layout for systray items
  85. .o_mail_systray_dropdown.show {
  86. @include full-screen-dropdown();
  87. // Fix stretchy images
  88. .o_mail_preview_image {
  89. align-items: center;
  90. display: flex;
  91. flex-direction: row;
  92. img {
  93. display: block;
  94. height: auto;
  95. }
  96. }
  97. }
  98. // Higher height for dropdown items, for those with sausage fingers
  99. .dropdown-menu .dropdown-item {
  100. padding: {
  101. bottom: 0.5rem;
  102. top: 0.5rem;
  103. }
  104. }
  105. }
  106. }
  107. // Iconized full screen apps menu
  108. .o_menu_apps {
  109. .search-input:focus {
  110. border-color: $o-brand-primary;
  111. }
  112. .dropdown-menu.show {
  113. @include full-screen-dropdown();
  114. // Display apps in a grid
  115. align-content: flex-start;
  116. display: flex;
  117. flex-direction: row;
  118. flex-wrap: wrap;
  119. justify-content: flex-start;
  120. @include media-breakpoint-up(lg) {
  121. padding: {
  122. left: 20vw;
  123. right: 20vw;
  124. }
  125. }
  126. .o_app {
  127. align-items: center;
  128. display: flex;
  129. flex-direction: column;
  130. justify-content: flex-start;
  131. // Size depends on screen
  132. width: 33.33333333%;
  133. @include media-breakpoint-up(sm) {
  134. width: 25%;
  135. }
  136. @include media-breakpoint-up(md) {
  137. width: 16.6666666%;
  138. }
  139. }
  140. // Hide app icons when searching
  141. .has-results ~ .o_app {
  142. display: none;
  143. }
  144. .o-app-icon {
  145. height: auto;
  146. max-width: 7rem;
  147. }
  148. // Search input for menus
  149. .form-row {
  150. width: 100%;
  151. }
  152. .o-menu-search-result {
  153. align-items: center;
  154. background-position: left;
  155. background-repeat: no-repeat;
  156. background-size: contain;
  157. cursor: pointer;
  158. display: flex;
  159. padding-left: 3rem;
  160. white-space: normal;
  161. }
  162. // Allow to scroll only on results, keeping static search box above
  163. .search-container.has-results {
  164. height: 100%;
  165. .search-input {
  166. height: 3em;
  167. }
  168. .search-results {
  169. height: calc(100% - 3em);
  170. overflow: auto;
  171. }
  172. }
  173. }
  174. }
  175. // Scroll all but top bar
  176. html .o_web_client .o_main .o_main_content {
  177. @include media-breakpoint-down(sm) {
  178. overflow: auto;
  179. .o_content {
  180. overflow: initial;
  181. }
  182. }
  183. max-width: 100%;
  184. }
  185. // Control panel (breadcrumbs, search box, buttons...)
  186. @include media-breakpoint-down(sm) {
  187. .o_control_panel {
  188. // Arrange buttons to use space better
  189. .breadcrumb,
  190. .o_cp_buttons,
  191. .o_cp_left,
  192. .o_cp_right,
  193. .o_cp_searchview,
  194. {
  195. flex: 1 1 100%;
  196. @include media-breakpoint-up(md) {
  197. flex-basis: 50%;
  198. }
  199. }
  200. .breadcrumb {
  201. flex-basis: 80%;
  202. }
  203. .o_cp_searchview,
  204. .o_cp_right,
  205. {
  206. flex-basis: 10%;
  207. }
  208. .o_cp_left {
  209. flex-basis: 50%;
  210. white-space: nowrap;
  211. }
  212. .o_cp_pager {
  213. white-space: nowrap;
  214. }
  215. // Hide all but 2 last breadcrumbs, and render 2nd-to-last as arrow
  216. .breadcrumb-item {
  217. &:not(.active) {
  218. padding-left: 0;
  219. }
  220. &::before {
  221. content: none;
  222. padding-right: 0;
  223. }
  224. &:nth-last-of-type(1n+3) {
  225. display: none;
  226. }
  227. &:nth-last-of-type(2) {
  228. &::before {
  229. color: var(--primary);
  230. content: "\f048"; // .fa-step-backward
  231. cursor: pointer;
  232. font-family: FontAwesome;
  233. }
  234. a {
  235. display: none;
  236. }
  237. }
  238. }
  239. // Ellipsize long breadcrumbs
  240. .breadcrumb {
  241. max-width: 100%;
  242. text-overflow: ellipsis;
  243. }
  244. // Empty sidebar should not break layout
  245. .o_cp_sidebar:blank {
  246. display: none;
  247. }
  248. // In case you install `mail`, there is a mess on BS vs inline styles
  249. // we need to fix
  250. .o_cp_buttons .btn.d-block:not(.d-none) {
  251. display: inline-block !important;
  252. }
  253. // Dropdown with buttons to switch the view type
  254. .o_cp_switch_buttons.show {
  255. .dropdown-menu {
  256. align-content: center;
  257. display: flex;
  258. flex-direction: row;
  259. justify-content: space-around;
  260. padding: 0;
  261. .btn {
  262. border: {
  263. bottom: 0;
  264. radius: 0;
  265. top: 0;
  266. }
  267. }
  268. }
  269. }
  270. }
  271. }
  272. // Normal views
  273. .o_content, .modal-content {
  274. max-width: 100%;
  275. // Form views
  276. .o_form_view {
  277. .o_form_sheet {
  278. max-width: calc(100% - 32px);
  279. overflow-x: scroll;
  280. }
  281. // Sticky statusbar
  282. .o_form_statusbar {
  283. position: sticky;
  284. top: 0;
  285. z-index: 1;
  286. }
  287. // Support for long title (with ellipsis)
  288. .oe_title {
  289. width: initial;
  290. span {
  291. max-width: 100%;
  292. text-overflow: ellipsis;
  293. white-space: nowrap;
  294. overflow: hidden;
  295. width: initial;
  296. }
  297. span:active {
  298. white-space: normal;
  299. }
  300. }
  301. @include media-breakpoint-down(sm) {
  302. min-width: auto;
  303. // Avoid overflow on forms with title and/or button box
  304. .oe_button_box,
  305. .oe_title,
  306. {
  307. max-width: 100%;
  308. }
  309. // Avoid overflow on modals
  310. .o_form_sheet {
  311. min-width: auto;
  312. }
  313. // Render website inputs properly in phones
  314. .o_group .o_field_widget.o_text_overflow {
  315. // Overrides another !important
  316. width: auto !important;
  317. }
  318. // Make all input groups vertical
  319. .o_group_col_6 {
  320. width: 100%;
  321. }
  322. // Statusbar buttons dropdown for mobiles
  323. .o_statusbar_buttons_dropdown {
  324. border: {
  325. bottom: 0;
  326. radius: 0;
  327. top: 0;
  328. }
  329. height: 100%;
  330. }
  331. .o_statusbar_buttons > .btn {
  332. border-radius: 0;
  333. border: 0;
  334. width: 100%;
  335. margin-bottom: 0.2rem;
  336. &:last-child {
  337. margin-bottom: 0;
  338. }
  339. }
  340. .o_statusbar_status {
  341. // Arrow from rightmost button exceeds allowed width
  342. .o_arrow_button:first-child::before {
  343. content: none;
  344. display: none;
  345. }
  346. }
  347. // Full width in form sheets
  348. .o_form_sheet,
  349. .oe_chatter,
  350. {
  351. min-width: auto;
  352. max-width: 98%;
  353. }
  354. // Settings pages
  355. .app_settings_block {
  356. .row {
  357. margin: 0;
  358. }
  359. }
  360. .o_chatter {
  361. // Display send button on small screens
  362. .o_thread_composer {
  363. padding-left: $o-mail-thread-avatar-size*0.5;
  364. .o_composer_button_send {
  365. display: initial !important; // Forced in core
  366. }
  367. .o_chatter_avatar {
  368. display: none;
  369. }
  370. }
  371. .o_chatter_topbar {
  372. height: auto;
  373. flex-wrap: wrap-reverse;
  374. > .o_topbar_right_area {
  375. flex: 1 0 auto;
  376. flex-wrap: wrap;
  377. max-width: 100%;
  378. // Display followers on small screens
  379. .o_followers {
  380. display: initial !important; // Forced in core
  381. @include media-breakpoint-down(xs) {
  382. padding-bottom: 50px;
  383. }
  384. }
  385. }
  386. }
  387. }
  388. }
  389. }
  390. // Sided chatter, if user wants
  391. .o_chatter_position_sided & {
  392. @include media-breakpoint-up(lg) {
  393. .o_form_view:not(.o_form_nosheet) {
  394. display: flex;
  395. flex-flow: row nowrap;
  396. height: 100%;
  397. .o_form_sheet_bg {
  398. flex: 1 1 auto;
  399. overflow: auto;
  400. > .o_form_sheet {
  401. min-width: unset;
  402. }
  403. }
  404. .o_chatter {
  405. border-left: 1px solid gray('400');
  406. flex: 0 0 35%;
  407. max-width: initial;
  408. min-width: initial;
  409. overflow: auto;
  410. .o_chatter_header_container {
  411. padding-top: $grid-gutter-width * 0.5;
  412. top: 0;
  413. position: sticky;
  414. background-color: $o-view-background-color;
  415. z-index: 1;
  416. .o_chatter_topbar {
  417. margin-top: 0;
  418. flex-wrap: wrap;
  419. height: auto;
  420. button:last-of-type {
  421. flex: 1 0 auto;
  422. text-align: left;
  423. }
  424. .o_topbar_right_area {
  425. order: -10;
  426. flex: 0 1 100%;
  427. border-bottom-color: transparent;
  428. }
  429. }
  430. .o_attachments_previews {
  431. overflow: auto;
  432. max-height: $o-mail-attachment-image-size * 6;
  433. }
  434. }
  435. }
  436. }
  437. }
  438. }
  439. }
  440. // Sticky Header & Footer in List View
  441. .table-responsive {
  442. overflow-x: initial;
  443. .o_list_view {
  444. // th & td are here for compatibility with chrome
  445. thead, thead tr:nth-child(1) th {
  446. position: sticky;
  447. top: 0;
  448. z-index: 1;
  449. }
  450. thead tr:nth-child(1) th {
  451. background-color: $o-list-footer-bg-color;
  452. }
  453. tfoot, tfoot tr:nth-child(1) td {
  454. position: sticky;
  455. bottom: 0;
  456. }
  457. tfoot tr:nth-child(1) td {
  458. background-color: $o-list-footer-bg-color;
  459. }
  460. }
  461. }
  462. // Waiting Cursor
  463. .oe_wait {
  464. cursor: progress;
  465. }