forms.less 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. // Basic mforms layout, used in resources, user profile etc.
  2. .mform {
  3. .fcontainer,
  4. fieldset {
  5. .fitem {
  6. &:extend(.form-group);
  7. &:extend(.form-horizontal .form-group);
  8. .fitemtitle {
  9. .make-md-column(4);
  10. .make-lg-column(3);
  11. label {
  12. .form-horizontal .control-label;
  13. }
  14. }
  15. .felement {
  16. .make-md-column(8);
  17. .make-lg-column(9);
  18. select,
  19. input[type="text"],
  20. input[type="password"] {
  21. .form-control;
  22. }
  23. }
  24. select[multiple], select[size] {
  25. height: auto;
  26. }
  27. .felement.fduration input[type="text"] {
  28. min-width: 0;
  29. width: 5em;
  30. display: inline-block;
  31. }
  32. .felement.fduration,
  33. .felement.fdate_selector,
  34. .felement.fdate_time_selector {
  35. select {
  36. width: auto;
  37. display: inline-block;
  38. min-width: 60px;
  39. }
  40. select[size],
  41. select[multiple] {
  42. height: auto;
  43. }
  44. label {
  45. display: inline-block;
  46. }
  47. }
  48. }
  49. }
  50. .fitem_actionbuttons {
  51. .form-group;
  52. .form-horizontal .form-group;
  53. > div.felement {
  54. .make-md-column(8);
  55. .make-md-column-offset(4);
  56. .make-lg-column(9);
  57. .make-lg-column-offset(3);
  58. }
  59. }
  60. }
  61. .mform fieldset .advancedbutton {
  62. text-align: right;
  63. }
  64. .jsenabled .mform .containsadvancedelements .advanced {
  65. display: none;
  66. }
  67. .mform .containsadvancedelements .advanced.show {
  68. display: block;
  69. }
  70. .mform fieldset.group {
  71. margin-bottom: 0
  72. }
  73. .mform span.error {
  74. color: @state-danger-text;
  75. }
  76. .mform fieldset.error {
  77. border: 1px solid @state-danger-border;
  78. }
  79. .mform fieldset.collapsible legend a.fheader {
  80. padding: 0 5px 0 20px;
  81. margin-left: -20px;
  82. background-image: url([[pix:t/expanded]]);
  83. background-repeat: no-repeat;
  84. background-position: left;
  85. }
  86. .mform fieldset.collapsed legend a.fheader {
  87. background-image: url([[pix:t/collapsed]]);
  88. }
  89. .jsenabled .mform .collapsed .fcontainer {
  90. display: none;
  91. }
  92. // These are for javascript hide/show, not actual links
  93. .mform legend a,
  94. .mform legend a:hover {
  95. color: @legend-color;
  96. text-decoration: none;
  97. }
  98. .mform label .req,
  99. .mform label .adv {
  100. cursor: help;
  101. }
  102. .mform .iconhelp {
  103. margin-left: 4px;
  104. margin-right: -16px;
  105. }
  106. // Basic admin forms layout.
  107. .form-item {
  108. &:extend(.form-group);
  109. &:extend(.form-horizontal .form-group);
  110. .form-label {
  111. .make-md-column(4);
  112. label {
  113. .form-horizontal .control-label;
  114. }
  115. }
  116. .form-setting {
  117. .make-md-column(8);
  118. select,
  119. input[type="text"],
  120. input[type="password"] {
  121. .form-control;
  122. }
  123. select[size],
  124. select[multiple] {
  125. height: auto;
  126. }
  127. .form-group {
  128. margin-bottom: 0;
  129. // name clash with Bootstrap form-group
  130. }
  131. }
  132. .form-description {
  133. .make-md-column(8);
  134. .make-md-column-offset(4);
  135. clear: left;
  136. margin-bottom: 0;
  137. }
  138. }
  139. .path-admin .buttons,
  140. .form-buttons {
  141. .make-md-column(8);
  142. .make-md-column-offset(4);
  143. margin-left: -15px; // There's no row container, needs negative margin at small sizes
  144. margin-bottom: 15px;
  145. .form-submit {
  146. margin-left: 0;
  147. }
  148. }
  149. .form-defaultinfo,
  150. .form-label .form-shortname {
  151. .text-muted;
  152. font-size: @font-size-small;
  153. }
  154. #adminsettings h3 {
  155. &:extend(legend);
  156. }
  157. .form-setting .form-checkbox input {
  158. margin-top: 12px;
  159. }
  160. .form-setting .form-multicheckbox ul {
  161. &:extend(.list-unstyled);
  162. }
  163. // Shared styles
  164. .fcheckbox > span > label,
  165. .form-checkbox + label,
  166. .form-multicheckbox label,
  167. .unmask label {
  168. &:extend(.checkbox label);
  169. padding-left: 0.3em;
  170. padding-right: 0.3em;
  171. }
  172. // At this width and above the form label stacks beside the control
  173. @media (min-width: @screen-md-min) {
  174. .mform .fitemtitle,
  175. .form-label {
  176. text-align: right;
  177. .form-shortname {
  178. display: block;
  179. }
  180. }
  181. .form-setting .form-multicheckbox,
  182. .fitem_fcheckbox .fcheckbox {
  183. padding-top: 8px;
  184. }
  185. .mform .fitem_actionbuttons > div.felement {
  186. padding-left: 10px;
  187. }
  188. .form-buttons .form-submit {
  189. margin-left: -5px;
  190. }
  191. .form-item .form-setting,
  192. .mform .fcontainer .fitem .felement {
  193. > input[type="text"],
  194. > input[type="password"],
  195. > select {
  196. width: auto;
  197. min-width: 480px;
  198. }
  199. }
  200. #page-mod-quiz-mod #id_reviewoptionshdr .fitem.fitem_fgroup {
  201. font-size: @font-size-small;
  202. .fitemtitle {
  203. min-height: 3.5em;
  204. }
  205. }
  206. }
  207. @media (max-width: @screen-sm-max) {
  208. // Fake a responsive grid for the quiz review options section.
  209. #page-mod-quiz-mod #id_reviewoptionshdr .fitem.fitem_fgroup {
  210. float: none;
  211. width: 100%;
  212. }
  213. }
  214. .mform .felement.fstatic,
  215. .form-item .form-description {
  216. .help-block;
  217. margin-bottom: 0;
  218. p:last-child {
  219. margin-bottom: 0;
  220. }
  221. }
  222. // despite crazy name, roughly equivalent to bootstrap's .form-inline
  223. .invisiblefieldset {
  224. display: inline;
  225. margin: 0;
  226. padding: 0;
  227. border-width: 0;
  228. }
  229. input[type="radio"],
  230. input[type="checkbox"] {
  231. margin: 0 4px;
  232. }
  233. /*
  234. .mform .fitem fieldset.fgroup label {
  235. // see .felement.fdate_selector above
  236. display: inline;
  237. float: none;
  238. width: auto;
  239. }
  240. .mform ul.file-list {
  241. padding: 0;
  242. margin: 0;
  243. list-style: none;
  244. }
  245. .mform .ftags label.accesshide {
  246. display: block;
  247. position: static;
  248. }
  249. .mform .ftags select {
  250. margin-bottom: 0.7em;
  251. min-width: 22em;
  252. }
  253. .mform .helplink img {
  254. margin: 0 .45em;
  255. padding: 0;
  256. }
  257. form input[type="text"] {
  258. .form-control;
  259. display: inline-block;
  260. width: auto;
  261. height: auto;
  262. }
  263. .loginpanel .error,
  264. .singleselect label {
  265. margin-right: .3em;
  266. }
  267. #portfolio-add-button {
  268. display: inline;
  269. }
  270. #page-grade-edit-outcome-course .courseoutcomes {
  271. margin-left: auto;
  272. margin-right: auto;
  273. width: 100%;
  274. }
  275. #page-grade-edit-outcome-course .courseoutcomes td {
  276. text-align:center;
  277. }
  278. // Checkbox labels. Bootstrap puts the associated checkbox inside the label.
  279. // Moodle puts it beside the label, so we need to make it inline-block
  280. // to keep it on the same horizontal level.
  281. input[type="radio"] + label,
  282. input[type="checkbox"] + label {
  283. display: inline;
  284. padding-left: 0.2em;
  285. }
  286. input[type="radio"],
  287. input[type="checkbox"] {
  288. margin-top: -4px; // Dodgy hack, must be better way.
  289. margin-right: 7px;
  290. }
  291. .singleselect {
  292. display: inline-block;
  293. form,
  294. select{
  295. margin: 0;
  296. }
  297. }
  298. .felement.ffilepicker {
  299. margin-top: 5px;
  300. }
  301. div#dateselector-calendar-panel {
  302. z-index: 3100; // Set higher than the z-index of the filemanager - see MDL-39047.
  303. }
  304. fieldset.coursesearchbox label {
  305. display: inline;
  306. }
  307. */