Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Bootstrap, ui and small improvements

ui still needs cleaning up
  • Loading branch information...
commit dd2e12f65ec8d8ddbb792268b64fa623a161f64b 1 parent 172a842
@giovdk21 authored
Showing with 13,460 additions and 249 deletions.
  1. +6 −3 .gitignore
  2. +19 −9 css/form.css
  3. +4 −3 css/ie.css
  4. +92 −38 css/main.css
  5. +1 −1  css/print.css
  6. +53 −50 css/screen.css
  7. +23 −5 css/style.css
  8. +16 −4 js/base.js
  9. +36 −44 protected/components/views/MoreInfoBox.php
  10. +3 −0  protected/config/development.php
  11. +9 −6 protected/config/main.php
  12. +24 −0 protected/extensions/bootstrap/LICENSE.txt
  13. +341 −0 protected/extensions/bootstrap/components/Bootstrap.php
  14. +32 −0 protected/extensions/bootstrap/gii/bootstrap/BootstrapCode.php
  15. +14 −0 protected/extensions/bootstrap/gii/bootstrap/BootstrapGenerator.php
  16. +35 −0 protected/extensions/bootstrap/gii/bootstrap/templates/default/_form.php
  17. +29 −0 protected/extensions/bootstrap/gii/bootstrap/templates/default/_search.php
  18. +26 −0 protected/extensions/bootstrap/gii/bootstrap/templates/default/_view.php
  19. +70 −0 protected/extensions/bootstrap/gii/bootstrap/templates/default/admin.php
  20. +183 −0 protected/extensions/bootstrap/gii/bootstrap/templates/default/controller.php
  21. +24 −0 protected/extensions/bootstrap/gii/bootstrap/templates/default/create.php
  22. +26 −0 protected/extensions/bootstrap/gii/bootstrap/templates/default/index.php
  23. +28 −0 protected/extensions/bootstrap/gii/bootstrap/templates/default/update.php
  24. +36 −0 protected/extensions/bootstrap/gii/bootstrap/templates/default/view.php
  25. +64 −0 protected/extensions/bootstrap/gii/bootstrap/views/index.php
  26. +176 −0 protected/extensions/bootstrap/lib/bootstrap/LICENSE
  27. +139 −0 protected/extensions/bootstrap/lib/bootstrap/README.md
  28. BIN  protected/extensions/bootstrap/lib/bootstrap/img/glyphicons-halflings-white.png
  29. BIN  protected/extensions/bootstrap/lib/bootstrap/img/glyphicons-halflings.png
  30. +104 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-affix.js
  31. +90 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-alert.js
  32. +96 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-button.js
  33. +176 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-carousel.js
  34. +158 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-collapse.js
  35. +150 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-dropdown.js
  36. +239 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-modal.js
  37. +103 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-popover.js
  38. +151 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-scrollspy.js
  39. +135 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-tab.js
  40. +275 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-tooltip.js
  41. +60 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-transition.js
  42. +300 −0 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-typeahead.js
  43. +34 −0 protected/extensions/bootstrap/lib/bootstrap/less/accordion.less
  44. +65 −0 protected/extensions/bootstrap/lib/bootstrap/less/alerts.less
  45. +62 −0 protected/extensions/bootstrap/lib/bootstrap/less/bootstrap.less
  46. +24 −0 protected/extensions/bootstrap/lib/bootstrap/less/breadcrumbs.less
  47. +245 −0 protected/extensions/bootstrap/lib/bootstrap/less/button-groups.less
  48. +231 −0 protected/extensions/bootstrap/lib/bootstrap/less/buttons.less
  49. +131 −0 protected/extensions/bootstrap/lib/bootstrap/less/carousel.less
  50. +31 −0 protected/extensions/bootstrap/lib/bootstrap/less/close.less
  51. +58 −0 protected/extensions/bootstrap/lib/bootstrap/less/code.less
  52. +22 −0 protected/extensions/bootstrap/lib/bootstrap/less/component-animations.less
  53. +210 −0 protected/extensions/bootstrap/lib/bootstrap/less/dropdowns.less
  54. +650 −0 protected/extensions/bootstrap/lib/bootstrap/less/forms.less
  55. +21 −0 protected/extensions/bootstrap/lib/bootstrap/less/grid.less
  56. +24 −0 protected/extensions/bootstrap/lib/bootstrap/less/hero-unit.less
  57. +72 −0 protected/extensions/bootstrap/lib/bootstrap/less/labels-badges.less
  58. +16 −0 protected/extensions/bootstrap/lib/bootstrap/less/layouts.less
  59. +681 −0 protected/extensions/bootstrap/lib/bootstrap/less/mixins.less
  60. +98 −0 protected/extensions/bootstrap/lib/bootstrap/less/modals.less
  61. +475 −0 protected/extensions/bootstrap/lib/bootstrap/less/navbar.less
  62. +384 −0 protected/extensions/bootstrap/lib/bootstrap/less/navs.less
  63. +40 −0 protected/extensions/bootstrap/lib/bootstrap/less/pager.less
  64. +64 −0 protected/extensions/bootstrap/lib/bootstrap/less/pagination.less
  65. +117 −0 protected/extensions/bootstrap/lib/bootstrap/less/popovers.less
  66. +122 −0 protected/extensions/bootstrap/lib/bootstrap/less/progress-bars.less
  67. +137 −0 protected/extensions/bootstrap/lib/bootstrap/less/reset.less
  68. +28 −0 protected/extensions/bootstrap/lib/bootstrap/less/responsive-1200px-min.less
  69. +174 −0 protected/extensions/bootstrap/lib/bootstrap/less/responsive-767px-max.less
  70. +19 −0 protected/extensions/bootstrap/lib/bootstrap/less/responsive-768px-979px.less
  71. +177 −0 protected/extensions/bootstrap/lib/bootstrap/less/responsive-navbar.less
  72. +43 −0 protected/extensions/bootstrap/lib/bootstrap/less/responsive-utilities.less
  73. +48 −0 protected/extensions/bootstrap/lib/bootstrap/less/responsive.less
  74. +52 −0 protected/extensions/bootstrap/lib/bootstrap/less/scaffolding.less
  75. +193 −0 protected/extensions/bootstrap/lib/bootstrap/less/sprites.less
  76. +245 −0 protected/extensions/bootstrap/lib/bootstrap/less/tables.less
  77. +52 −0 protected/extensions/bootstrap/lib/bootstrap/less/thumbnails.less
  78. +70 −0 protected/extensions/bootstrap/lib/bootstrap/less/tooltip.less
  79. +221 −0 protected/extensions/bootstrap/lib/bootstrap/less/type.less
  80. +30 −0 protected/extensions/bootstrap/lib/bootstrap/less/utilities.less
  81. +279 −0 protected/extensions/bootstrap/lib/bootstrap/less/variables.less
  82. +29 −0 protected/extensions/bootstrap/lib/bootstrap/less/wells.less
  83. +532 −0 protected/extensions/bootstrap/widgets/TbActiveForm.php
  84. +142 −0 protected/extensions/bootstrap/widgets/TbAlert.php
  85. +73 −0 protected/extensions/bootstrap/widgets/TbBadge.php
  86. +195 −0 protected/extensions/bootstrap/widgets/TbBaseMenu.php
  87. +84 −0 protected/extensions/bootstrap/widgets/TbBreadcrumbs.php
  88. +249 −0 protected/extensions/bootstrap/widgets/TbButton.php
  89. +81 −0 protected/extensions/bootstrap/widgets/TbButtonColumn.php
  90. +120 −0 protected/extensions/bootstrap/widgets/TbButtonGroup.php
  91. +172 −0 protected/extensions/bootstrap/widgets/TbCarousel.php
  92. +92 −0 protected/extensions/bootstrap/widgets/TbCollapse.php
  93. +56 −0 protected/extensions/bootstrap/widgets/TbDataColumn.php
  94. +68 −0 protected/extensions/bootstrap/widgets/TbDetailView.php
  95. +90 −0 protected/extensions/bootstrap/widgets/TbDropdown.php
  96. +128 −0 protected/extensions/bootstrap/widgets/TbGridView.php
  97. +62 −0 protected/extensions/bootstrap/widgets/TbHeroUnit.php
  98. +73 −0 protected/extensions/bootstrap/widgets/TbLabel.php
  99. +54 −0 protected/extensions/bootstrap/widgets/TbListView.php
  100. +103 −0 protected/extensions/bootstrap/widgets/TbMenu.php
  101. +87 −0 protected/extensions/bootstrap/widgets/TbModal.php
  102. +166 −0 protected/extensions/bootstrap/widgets/TbNavbar.php
  103. +128 −0 protected/extensions/bootstrap/widgets/TbPager.php
  104. +86 −0 protected/extensions/bootstrap/widgets/TbProgress.php
  105. +58 −0 protected/extensions/bootstrap/widgets/TbScrollSpy.php
  106. +183 −0 protected/extensions/bootstrap/widgets/TbTabs.php
  107. +50 −0 protected/extensions/bootstrap/widgets/TbThumbnails.php
  108. +54 −0 protected/extensions/bootstrap/widgets/TbTypeahead.php
  109. +470 −0 protected/extensions/bootstrap/widgets/input/TbInput.php
  110. +213 −0 protected/extensions/bootstrap/widgets/input/TbInputHorizontal.php
  111. +61 −0 protected/extensions/bootstrap/widgets/input/TbInputInline.php
  112. +35 −0 protected/extensions/bootstrap/widgets/input/TbInputSearch.php
  113. +170 −0 protected/extensions/bootstrap/widgets/input/TbInputVertical.php
  114. +105 −86 protected/views/layouts/main.php
View
9 .gitignore
@@ -1,3 +1,6 @@
-assets/
-protected/runtime/
-themes/classic/views/
+assets/
+protected/runtime/*
+themes/classic/views/
+/index.php
+.idea/
+protected/data/user.db
View
28 css/form.css
@@ -36,7 +36,6 @@
div.form
{
- margin: 0;
}
div.form input,
@@ -83,12 +82,16 @@ div.form span.required
color: red;
}
+div.form div.error label:first-child,
div.form label.error,
div.form span.error
{
color: #C00;
}
+div.form div.error input,
+div.form div.error textarea,
+div.form div.error select,
div.form input.error,
div.form textarea.error,
div.form select.error
@@ -97,6 +100,18 @@ div.form select.error
border-color: #C00;
}
+div.form div.success input,
+div.form div.success textarea,
+div.form div.success select,
+div.form input.success,
+div.form textarea.success,
+div.form select.success
+{
+ background: #E6EFC2;
+ border-color: #C6D880;
+}
+
+
div.form .errorSummary
{
border: 2px solid #C00;
@@ -124,7 +139,7 @@ div.form .errorSummary ul
padding: 0 0 0 20px;
}
-div.wide form label
+div.wide.form label
{
float: left;
margin-right: 10px;
@@ -133,18 +148,13 @@ div.wide form label
width: 100px;
}
-div.wide form .row
+div.wide.form .row
{
clear: left;
}
-div.wide form .buttons
+div.wide.form .buttons, div.wide.form .hint, div.wide.form .errorMessage
{
clear: left;
padding-left: 110px;
}
-
-div.wide form .errorMessage
-{
- margin: 0 0 0 110px;
-}
View
7 css/ie.css
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
- Blueprint CSS Framework 0.9
+ Blueprint CSS Framework 1.0.1
http://blueprintcss.org
* Copyright (c) 2007-Present. See LICENSE for more info.
@@ -14,7 +14,7 @@
/* ie.css */
body {text-align:center;}
.container {text-align:left;}
-* html .column, * html div.span-1, * html div.span-2, * html div.span-3, * html div.span-4, * html div.span-5, * html div.span-6, * html div.span-7, * html div.span-8, * html div.span-9, * html div.span-10, * html div.span-11, * html div.span-12, * html div.span-13, * html div.span-14, * html div.span-15, * html div.span-16, * html div.span-17, * html div.span-18, * html div.span-19, * html div.span-20, * html div.span-21, * html div.span-22, * html div.span-23, * html div.span-24 {display:inline;overflow-x:hidden;}
+* html .column, * html .span-1, * html .span-2, * html .span-3, * html .span-4, * html .span-5, * html .span-6, * html .span-7, * html .span-8, * html .span-9, * html .span-10, * html .span-11, * html .span-12, * html .span-13, * html .span-14, * html .span-15, * html .span-16, * html .span-17, * html .span-18, * html .span-19, * html .span-20, * html .span-21, * html .span-22, * html .span-23, * html .span-24 {display:inline;overflow-x:hidden;}
* html legend {margin:0px -8px 16px 0;padding:0;}
sup {vertical-align:text-top;}
sub {vertical-align:text-bottom;}
@@ -24,12 +24,13 @@ img {-ms-interpolation-mode:bicubic;}
.clearfix, .container {display:inline-block;}
* html .clearfix, * html .container {height:1%;}
fieldset {padding-top:0;}
+legend {margin-top:-0.2em;margin-bottom:1em;margin-left:-0.5em;}
textarea {overflow:auto;}
+label {vertical-align:middle;position:relative;top:-0.25em;}
input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;}
input.text:focus, input.title:focus {border-color:#666;}
input.text, input.title, textarea, select {margin:0.5em 0;}
input.checkbox, input.radio {position:relative;top:.25em;}
form.inline div, form.inline p {vertical-align:middle;}
-form.inline label {position:relative;top:-0.25em;}
form.inline input.checkbox, form.inline input.radio, form.inline input.button, form.inline button {margin:0.5em 0;}
button, input.button {position:relative;top:0.25em;}
View
130 css/main.css
@@ -27,6 +27,11 @@ body
padding: 20px;
}
+#sidebar
+{
+ padding: 20px 20px 20px 0;
+}
+
#footer
{
padding: 10px;
@@ -49,8 +54,7 @@ body
#mainmenu ul
{
- /* padding:6px 20px 5px 20px; */
- xpadding: 0px;
+ padding:6px 20px 5px 20px;
margin:0px;
}
@@ -66,56 +70,55 @@ body
font-size:12px;
font-weight:bold;
text-decoration:none;
- padding:0px 8px;
+ padding:5px 8px;
}
-#mainmenu ul li a:hover, #mainmenu ul li a.active
+#mainmenu ul li a:hover, #mainmenu ul li.active a
{
- /* color: #6399cd;
- background-color:#EFF4FA; */
- color: #FA0;
+ color: #6399cd;
+ background-color:#EFF4FA;
text-decoration:none;
}
-div.error, div.notice, .success
+div.flash-error, div.flash-notice, div.flash-success
{
padding:.8em;
margin-bottom:1em;
border:2px solid #ddd;
}
-div.error
+div.flash-error
{
background:#FBE3E4;
color:#8a1f11;
border-color:#FBC2C4;
}
-div.notice
+div.flash-notice
{
background:#FFF6BF;
color:#514721;
border-color:#FFD324;
}
-div.success
+div.flash-success
{
background:#E6EFC2;
color:#264409;
border-color:#C6D880;
}
-div.error a
+div.flash-error a
{
color:#8a1f11;
}
-div.notice a
+div.flash-notice a
{
color:#514721;
}
-div.success a
+div.flash-success a
{
color:#264409;
}
@@ -125,51 +128,102 @@ div.form .rememberMe label
display: inline;
}
-.actions
+div.view
+{
+ padding: 10px;
+ margin: 10px 0;
+ border: 1px solid #C9E0ED;
+}
+
+div.breadcrumbs
+{
+ font-size: 0.9em;
+ padding: 5px 20px;
+}
+
+div.breadcrumbs span
+{
+ font-weight: bold;
+}
+
+div.search-form
+{
+ padding: 10px;
+ margin: 10px 0;
+ background: #eee;
+}
+
+.portlet
+{
+
+}
+
+.portlet-decoration
+{
+ padding: 3px 8px;
+ background: #B7D6E7;
+ border-left: 5px solid #6FACCF;
+}
+
+.portlet-title
{
- margin: 0 0 10px 0;
+ font-size: 12px;
+ font-weight: bold;
padding: 0;
+ margin: 0;
+ color: #298dcd;
}
-.actions li
+.portlet-content
{
- display: inline;
+ font-size:0.9em;
+ margin: 0 0 15px 0;
+ padding: 5px 8px;
+ background:#EFFDFF;
+}
+
+.portlet-content ul
+{
+ list-style-image:none;
+ list-style-position:outside;
+ list-style-type:none;
margin: 0;
padding: 0;
}
-.actions li a
+.portlet-content li
{
- padding: 5px;
+ padding: 2px 0 4px 0px;
+}
+
+.operations
+{
+ list-style-type: none;
margin: 0;
- color: #298dcd;
- text-decoration: none;
- font-size: 0.8em;
- font-weight: bold;
- background: #DFF4FF;
- border-left: 5px solid #589FC8;
+ padding: 0;
}
-.actions li a:hover, .actions li a.active
+.operations li
{
- background: #589FC8;
- color: white;
+ padding-bottom: 2px;
}
-div.view
+.operations li a
{
- padding: 10px;
- margin: 10px 0;
- border: 1px solid #C9E0ED;
+ font: bold 12px Arial;
+ color: #0066A4;
+ display: block;
+ padding: 2px 0 2px 8px;
+ line-height: 15px;
+ text-decoration: none;
}
-div.breadcrumbs
+.operations li a:visited
{
- font-size: 0.9em;
- padding: 5px 20px;
+ color: #0066A4;
}
-div.breadcrumbs span
+.operations li a:hover
{
- font-weight: bold;
+ background: #80CFFF;
}
View
2  css/print.css
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
- Blueprint CSS Framework 0.9
+ Blueprint CSS Framework 1.0.1
http://blueprintcss.org
* Copyright (c) 2007-Present. See LICENSE for more info.
View
103 css/screen.css
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
- Blueprint CSS Framework 0.9
+ Blueprint CSS Framework 1.0.1
http://blueprintcss.org
* Copyright (c) 2007-Present. See LICENSE for more info.
@@ -12,14 +12,17 @@
----------------------------------------------------------------------- */
/* reset.css */
-html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
-body {line-height:1.5;}
+html {margin:0;padding:0;border:0;}
+body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;}
+article, aside, details, figcaption, figure, dialog, footer, header, hgroup, menu, nav, section {display:block;}
+body {line-height:1.5;background:white;}
table {border-collapse:separate;border-spacing:0;}
-caption, th, td {text-align:left;font-weight:normal;}
-table, td, th {vertical-align:middle;}
-blockquote:before, blockquote:after, q:before, q:after {content:"";}
+caption, th, td {text-align:left;font-weight:normal;float:none !important;}
+table, th, td {vertical-align:middle;}
+blockquote:before, blockquote:after, q:before, q:after {content:'';}
blockquote, q {quotes:"" "";}
a img {border:none;}
+:focus {outline:0;}
/* typography.css */
html {font-size:100.01%;}
@@ -33,14 +36,15 @@ h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;}
h6 {font-size:1em;font-weight:bold;}
h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
p {margin:0 0 1.5em;}
-p img.left {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;}
-p img.right {float:right;margin:1.5em 0 1.5em 1.5em;}
-a:focus, a:hover {color:#000;}
-a {color:#009;text-decoration:underline;}
+.left {float:left !important;}
+p .left {margin:1.5em 1.5em 1.5em 0;padding:0;}
+.right {float:right !important;}
+p .right {margin:1.5em 0 1.5em 1.5em;padding:0;}
+a:focus, a:hover {color:#09f;}
+a {color:#06c;text-decoration:underline;}
blockquote {margin:1.5em;color:#666;font-style:italic;}
-strong {font-weight:bold;}
+strong, dfn {font-weight:bold;}
em, dfn {font-style:italic;}
-dfn {font-weight:bold;}
sup, sub {line-height:0;}
abbr, acronym {border-bottom:1px dotted #666;}
address {margin:0 0 1.5em;font-style:italic;}
@@ -48,7 +52,7 @@ del {color:#666;}
pre {margin:1.5em 0;white-space:pre;}
pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;}
li ul, li ol {margin:0;}
-ul, ol {margin:0 1.5em 1.5em 0;padding-left:3.333em;}
+ul, ol {margin:0 1.5em 1.5em 0;padding-left:1.5em;}
ul {list-style-type:disc;}
ol {list-style-type:decimal;}
dl {margin:0 0 1.5em 0;}
@@ -75,9 +79,8 @@ caption {background:#eee;}
/* grid.css */
.container {width:950px;margin:0 auto;}
-.showgrid {background:url(src/grid.png);}
-.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {float:left;margin-right:10px;}
-.last, div.last {margin-right:0;}
+.column, .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12, .span-13, .span-14, .span-15, .span-16, .span-17, .span-18, .span-19, .span-20, .span-21, .span-22, .span-23, .span-24 {float:left;margin-right:10px;}
+.last {margin-right:0;}
.span-1 {width:30px;}
.span-2 {width:70px;}
.span-3 {width:110px;}
@@ -101,32 +104,32 @@ caption {background:#eee;}
.span-21 {width:830px;}
.span-22 {width:870px;}
.span-23 {width:910px;}
-.span-24, div.span-24 {width:950px;margin-right:0;}
-input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {border-left-width:1px!important;border-right-width:1px!important;padding-left:5px!important;padding-right:5px!important;}
-input.span-1, textarea.span-1 {width:18px!important;}
-input.span-2, textarea.span-2 {width:58px!important;}
-input.span-3, textarea.span-3 {width:98px!important;}
-input.span-4, textarea.span-4 {width:138px!important;}
-input.span-5, textarea.span-5 {width:178px!important;}
-input.span-6, textarea.span-6 {width:218px!important;}
-input.span-7, textarea.span-7 {width:258px!important;}
-input.span-8, textarea.span-8 {width:298px!important;}
-input.span-9, textarea.span-9 {width:338px!important;}
-input.span-10, textarea.span-10 {width:378px!important;}
-input.span-11, textarea.span-11 {width:418px!important;}
-input.span-12, textarea.span-12 {width:458px!important;}
-input.span-13, textarea.span-13 {width:498px!important;}
-input.span-14, textarea.span-14 {width:538px!important;}
-input.span-15, textarea.span-15 {width:578px!important;}
-input.span-16, textarea.span-16 {width:618px!important;}
-input.span-17, textarea.span-17 {width:658px!important;}
-input.span-18, textarea.span-18 {width:698px!important;}
-input.span-19, textarea.span-19 {width:738px!important;}
-input.span-20, textarea.span-20 {width:778px!important;}
-input.span-21, textarea.span-21 {width:818px!important;}
-input.span-22, textarea.span-22 {width:858px!important;}
-input.span-23, textarea.span-23 {width:898px!important;}
-input.span-24, textarea.span-24 {width:938px!important;}
+.span-24 {width:950px;margin-right:0;}
+input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {border-left-width:1px;border-right-width:1px;padding-left:5px;padding-right:5px;}
+input.span-1, textarea.span-1 {width:18px;}
+input.span-2, textarea.span-2 {width:58px;}
+input.span-3, textarea.span-3 {width:98px;}
+input.span-4, textarea.span-4 {width:138px;}
+input.span-5, textarea.span-5 {width:178px;}
+input.span-6, textarea.span-6 {width:218px;}
+input.span-7, textarea.span-7 {width:258px;}
+input.span-8, textarea.span-8 {width:298px;}
+input.span-9, textarea.span-9 {width:338px;}
+input.span-10, textarea.span-10 {width:378px;}
+input.span-11, textarea.span-11 {width:418px;}
+input.span-12, textarea.span-12 {width:458px;}
+input.span-13, textarea.span-13 {width:498px;}
+input.span-14, textarea.span-14 {width:538px;}
+input.span-15, textarea.span-15 {width:578px;}
+input.span-16, textarea.span-16 {width:618px;}
+input.span-17, textarea.span-17 {width:658px;}
+input.span-18, textarea.span-18 {width:698px;}
+input.span-19, textarea.span-19 {width:738px;}
+input.span-20, textarea.span-20 {width:778px;}
+input.span-21, textarea.span-21 {width:818px;}
+input.span-22, textarea.span-22 {width:858px;}
+input.span-23, textarea.span-23 {width:898px;}
+input.span-24, textarea.span-24 {width:938px;}
.append-1 {padding-right:40px;}
.append-2 {padding-right:80px;}
.append-3 {padding-right:120px;}
@@ -173,8 +176,8 @@ input.span-24, textarea.span-24 {width:938px!important;}
.prepend-21 {padding-left:840px;}
.prepend-22 {padding-left:880px;}
.prepend-23 {padding-left:920px;}
-div.border {padding-right:4px;margin-right:5px;border-right:1px solid #eee;}
-div.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;}
+.border {padding-right:4px;margin-right:5px;border-right:1px solid #ddd;}
+.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #ddd;}
.pull-1 {margin-left:-40px;}
.pull-2 {margin-left:-80px;}
.pull-3 {margin-left:-120px;}
@@ -224,12 +227,12 @@ div.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;
.push-22 {margin:0 -880px 1.5em 880px;}
.push-23 {margin:0 -920px 1.5em 920px;}
.push-24 {margin:0 -960px 1.5em 960px;}
-.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:right;position:relative;}
-.prepend-top {margin-top:1.5em;}
-.append-bottom {margin-bottom:1.5em;}
-.box {padding:1.5em;margin-bottom:1.5em;background:#E5ECF9;}
-hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;}
+.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:left;position:relative;}
+div.prepend-top, .prepend-top {margin-top:1.5em;}
+div.append-bottom, .append-bottom {margin-bottom:1.5em;}
+.box {padding:1.5em;margin-bottom:1.5em;background:#e5eCf9;}
+hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:1px;margin:0 0 17px;border:none;}
hr.space {background:#fff;color:#fff;visibility:hidden;}
.clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;}
.clearfix, .container {display:block;}
-.clear {clear:both;}
+.clear {clear:both;}
View
28 css/style.css
@@ -1,4 +1,12 @@
+body {
+ padding-top: 60px;
+}
+
+#header, #page { border: 0px none; }
+#page { position: relative; }
+
+
div.example_title {
color: #000;
border-bottom: 2px solid #FB0;
@@ -24,7 +32,7 @@ div.demo_box {
}
div.source_box {
- margin-bottom: 3em;
+ margin-bottom: 3em;
}
div.source_box div.syntaxhighlighter {
@@ -38,7 +46,7 @@ div.container {
#top_right_box {
position: fixed;
- top: 0px;
+ top: 40px;
right: 0px;
background: #FFF;
border-left: 1px solid #DDD;
@@ -49,6 +57,8 @@ div.container {
z-index: 100;
}
+#top_right_box form { display: inline; }
+
#hide_source_toggle {
display: inline-block;
}
@@ -56,7 +66,7 @@ div.container {
#more_topic_info {
position: absolute;
right: 20px;
- top: 100px;
+ top: 0px;
display: none;
}
@@ -74,8 +84,14 @@ div.container {
#more_topic_info a:hover { color: #FA0; }
+#more_info_content { display: none; }
+#more_info_inner ul.link_list { margin-left: 4px; font-size: 0.9em; margin-bottom: 1em; }
+
+div.popover { width: 326px; }
+
ul.link_list { list-style: none; padding-left: 3px; }
+
ul.link_list li {
background: url('../images/html.png') no-repeat center left;
padding-left: 20px;
@@ -102,7 +118,6 @@ div.right_menu {
right: 0px;
top: 160px;
background: #FFFFFF;
- border: 1px solid #888; /* #ff9100 */
border-right: 0px none;
z-index: 10;
}
@@ -164,4 +179,7 @@ div.right_menu ul li a:hover {
background-color: #FFF;
}
-/* ------------------------------------------------- */
+/* ------------------------------------------------- */
+
+
+footer { text-align: center; font-size: 0.8em; }
View
20 js/base.js
@@ -2,23 +2,23 @@ function Source() {
this.shown = null;
this.hide = function(animate) {
$("#hide_source_toggle a").html('Show source code');
-
+
if (animate)
$("div.source_box").fadeOut();
else
$("div.source_box").hide();
-
+
this.shown = false;
}
this.show = function(animate) {
$("#hide_source_toggle a").html('Hide source code');
-
+
if (animate)
$("div.source_box").slideDown('slow');
else
$("div.source_box").show();
-
+
this.shown = true;
}
@@ -36,9 +36,21 @@ function askDbResetConfirm() {
}
+function loadMoreInfo() {
+ return $('#more_info_content').html();
+}
+
+
jQuery(document).ready(function() {
jQuery("#hide_source_toggle a").click(function(event) {
event.preventDefault();
source.toggle();
});
+
+
+ $('#more_topic_info_link').popover({
+ placement: 'bottom',
+ title: 'More information',
+ content: loadMoreInfo
+ });
});
View
80 protected/components/views/MoreInfoBox.php
@@ -1,44 +1,36 @@
-<?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
- 'id'=>'moreinfobox_dialog',
- 'options'=>array(
- 'title'=>'More information about this topic',
- 'autoOpen'=>false,
- 'modal'=>false,
- 'width'=>500,
- 'maxHeight'=>500,
- 'position'=>array('right', 'top'),
- 'buttons'=>array('Close'=>'js:function() { $(this).dialog("close"); }'),
- ),
-));
-?>
-
-<?php if (!empty($references) && is_array($references)): ?>
-<div class="small_title">References</div>
-<ul class="link_list">
-<?php foreach($references as $url=>$label): ?>
- <li><a href="<?php echo $url; ?>" target="_blank"><?php echo $label; ?></a></li>
-<?php endforeach; ?>
-</ul>
-<?php endif; ?>
-
-
-<?php if (!empty($see_also) && is_array($see_also)): ?>
-<div class="small_title">See also</div>
-<ul class="link_list">
-<?php foreach($see_also as $url=>$label): ?>
- <li><a href="<?php echo $url; ?>"><?php echo $label; ?></a></li>
-<?php endforeach; ?>
-</ul>
-<?php endif; ?>
-
-
-<?php if (!empty($external_links) && is_array($external_links)): ?>
-<div class="small_title">External links</div>
-<ul class="link_list">
-<?php foreach($external_links as $url=>$label): ?>
- <li><a href="<?php echo $url; ?>" target="_blank"><?php echo $label; ?></a></li>
-<?php endforeach; ?>
-</ul>
-<?php endif; ?>
-
-<?php $this->endWidget('zii.widgets.jui.CJuiDialog'); ?>
+
+<div id="more_info_content">
+ <div id="more_info_inner">
+
+ <?php if (!empty($references) && is_array($references)): ?>
+ <div class="small_title">References</div>
+ <ul class="link_list">
+ <?php foreach($references as $url=>$label): ?>
+ <li><a href="<?php echo $url; ?>" target="_blank"><?php echo $label; ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+ <?php endif; ?>
+
+
+ <?php if (!empty($see_also) && is_array($see_also)): ?>
+ <div class="small_title">See also</div>
+ <ul class="link_list">
+ <?php foreach($see_also as $url=>$label): ?>
+ <li><a href="<?php echo $url; ?>"><?php echo $label; ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+ <?php endif; ?>
+
+
+ <?php if (!empty($external_links) && is_array($external_links)): ?>
+ <div class="small_title">External links</div>
+ <ul class="link_list">
+ <?php foreach($external_links as $url=>$label): ?>
+ <li><a href="<?php echo $url; ?>" target="_blank"><?php echo $label; ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+ <?php endif; ?>
+
+
+ </div>
+</div>
View
3  protected/config/development.php
@@ -13,6 +13,9 @@
'ipFilters'=>array('127.0.0.1'),
// 'newFileMode'=>0666,
// 'newDirMode'=>0777,
+ 'generatorPaths'=>array(
+ 'bootstrap.gii',
+ ),
),
),
'components'=>array(
View
15 protected/config/main.php
@@ -9,10 +9,10 @@
// Common Jui Widget preferences:
-$jui_prefs =array(
- 'themeUrl'=>'css/jui/',
- 'theme'=>'base',
-);
+//$jui_prefs =array(
+// 'themeUrl'=>'css/jui/',
+// 'theme'=>'base',
+//);
// This is the main Web application configuration. Any writable
@@ -22,7 +22,7 @@
'name'=>'Yii Playground',
// preloading 'log' component
- 'preload'=>array('log', 'dbManager', 'uiSettings', 'lc'),
+ 'preload'=>array('log', 'dbManager', 'uiSettings', 'lc', 'bootstrap'),
// autoloading model and component classes
'import'=>array(
@@ -87,8 +87,11 @@
),
),
),
+ 'bootstrap'=>array(
+ 'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
+ ),
),
-
+
'modules' => array(
'AjaxModule',
'UiModule',
View
24 protected/extensions/bootstrap/LICENSE.txt
@@ -0,0 +1,24 @@
+Copyright (c) 2010, Christoffer Niska
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Christoffer Niska nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
341 protected/extensions/bootstrap/components/Bootstrap.php
@@ -0,0 +1,341 @@
+<?php
+/**
+ * Bootstrap class file.
+ * @author Christoffer Niska <ChristofferNiska@gmail.com>
+ * @copyright Copyright &copy; Christoffer Niska 2011-
+ * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
+ * @version 1.0.0
+ */
+
+/**
+ * Bootstrap application component.
+ */
+class Bootstrap extends CApplicationComponent
+{
+ // Bootstrap plugins.
+ const PLUGIN_ALERT = 'alert';
+ const PLUGIN_BUTTON = 'button';
+ const PLUGIN_CAROUSEL = 'carousel';
+ const PLUGIN_COLLAPSE = 'collapse';
+ const PLUGIN_DROPDOWN = 'dropdown';
+ const PLUGIN_MODAL = 'modal';
+ const PLUGIN_POPOVER = 'popover';
+ const PLUGIN_SCROLLSPY = 'scrollspy';
+ const PLUGIN_TAB = 'tab';
+ const PLUGIN_TOOLTIP = 'tooltip';
+ const PLUGIN_TRANSITION = 'transition';
+ const PLUGIN_TYPEAHEAD = 'typeahead';
+ // todo: add the affix plugin in version 2.1.0
+
+ /**
+ * @var boolean whether to register the Bootstrap core CSS (bootstrap.min.css).
+ * Defaults to true.
+ */
+ public $coreCss = true;
+ /**
+ * @var boolean whether to register the Bootstrap responsive CSS (bootstrap-responsive.min.css).
+ * Defaults to false.
+ */
+ public $responsiveCss = false;
+ /**
+ * @var boolean whether to register the Yii-specific CSS missing from Bootstrap.
+ * @since 0.9.12
+ */
+ public $yiiCss = true;
+ /**
+ * @var boolean whether to register jQuery and the Bootstrap JavaScript.
+ * @since 0.9.10
+ */
+ public $enableJS = true;
+ /**
+ * @var array plugin initial options (name=>options).
+ * Each array key-value pair represents the initial options for a single plugin class,
+ * with the array key being the plugin name, and array value being the initial options array.
+ * @since 0.9.8
+ */
+ public $plugins = array();
+ /**
+ * @var string default popover CSS selector.
+ * @since 0.10.0
+ */
+ public $popoverSelector = 'a[rel="popover"]';
+ /**
+ * @var string default tooltip CSS selector.
+ * @since 0.10.0
+ */
+ public $tooltipSelector = 'a[rel="tooltip"]';
+
+ protected $_assetsUrl;
+
+ /**
+ * Initializes the component.
+ */
+ public function init()
+ {
+ // Register the bootstrap path alias.
+ if (Yii::getPathOfAlias('bootstrap') === false)
+ Yii::setPathOfAlias('bootstrap', realpath(dirname(__FILE__).'/..'));
+
+ // Prevents the extension from registering scripts and publishing assets when ran from the command line.
+ if (Yii::app() instanceof CConsoleApplication)
+ return;
+
+ if ($this->coreCss !== false)
+ $this->registerCoreCss();
+
+ if ($this->responsiveCss !== false)
+ $this->registerResponsiveCss();
+
+ if ($this->yiiCss !== false)
+ $this->registerYiiCss();
+
+ if ($this->enableJS !== false)
+ $this->registerCoreScripts();
+
+ parent::init();
+ }
+
+ /**
+ * Registers the Bootstrap CSS.
+ */
+ public function registerCoreCss()
+ {
+ Yii::app()->clientScript->registerCssFile($this->getAssetsUrl().'/css/bootstrap.css');
+ }
+
+ /**
+ * Registers the Bootstrap responsive CSS.
+ * @since 0.9.8
+ */
+ public function registerResponsiveCss()
+ {
+ /** @var CClientScript $cs */
+ $cs = Yii::app()->getClientScript();
+ $cs->registerMetaTag('width=device-width, initial-scale=1.0', 'viewport');
+ $cs->registerCssFile($this->getAssetsUrl().'/css/bootstrap-responsive.css');
+ }
+
+ /**
+ * Registers the Yii-specific CSS missing from Bootstrap.
+ * @since 0.9.11
+ */
+ public function registerYiiCss()
+ {
+ Yii::app()->clientScript->registerCssFile($this->getAssetsUrl().'/css/bootstrap-yii.css');
+ }
+
+ /**
+ * Registers the core JavaScript.
+ * @since 0.9.8
+ */
+ public function registerCoreScripts()
+ {
+ $this->registerJS(Yii::app()->clientScript->coreScriptPosition);
+ $this->registerTooltip();
+ $this->registerPopover();
+ }
+
+ /**
+ * Registers the Bootstrap JavaScript.
+ * @param int $position the position of the JavaScript code.
+ * @see CClientScript::registerScriptFile
+ */
+ public function registerJS($position = CClientScript::POS_HEAD)
+ {
+ /** @var CClientScript $cs */
+ $cs = Yii::app()->getClientScript();
+ $cs->registerCoreScript('jquery');
+ $cs->registerScriptFile($this->getAssetsUrl().'/js/bootstrap.js', $position);
+ }
+
+ /**
+ * Registers the Bootstrap alert plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#alerts
+ * @since 0.9.8
+ */
+ public function registerAlert($selector = null, $options = array())
+ {
+ $this->registerPlugin(self::PLUGIN_ALERT, $selector, $options);
+ }
+
+ /**
+ * Registers the Bootstrap buttons plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#buttons
+ * @since 0.9.8
+ */
+ public function registerButton($selector = null, $options = array())
+ {
+ $this->registerPlugin(self::PLUGIN_BUTTON, $selector, $options);
+ }
+
+ /**
+ * Registers the Bootstrap carousel plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#carousel
+ * @since 0.9.8
+ */
+ public function registerCarousel($selector = null, $options = array())
+ {
+ $this->registerPlugin(self::PLUGIN_CAROUSEL, $selector, $options);
+ }
+
+ /**
+ * Registers the Bootstrap collapse plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#collapse
+ * @since 0.9.8
+ */
+ public function registerCollapse($selector = null, $options = array())
+ {
+ $this->registerPlugin(self::PLUGIN_COLLAPSE, $selector, $options, '.collapse');
+ }
+
+ /**
+ * Registers the Bootstrap dropdowns plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#dropdowns
+ * @since 0.9.8
+ */
+ public function registerDropdown($selector = null, $options = array())
+ {
+ $this->registerPlugin(self::PLUGIN_DROPDOWN, $selector, $options, '.dropdown-toggle[data-dropdown="dropdown"]');
+ }
+
+ /**
+ * Registers the Bootstrap modal plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#modal
+ * @since 0.9.8
+ */
+ public function registerModal($selector = null, $options = array())
+ {
+ $this->registerPlugin(self::PLUGIN_MODAL, $selector, $options);
+ }
+
+ /**
+ * Registers the Bootstrap scrollspy plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#scrollspy
+ * @since 0.9.8
+ */
+ public function registerScrollSpy($selector = null, $options = array())
+ {
+ $this->registerPlugin(self::PLUGIN_SCROLLSPY, $selector, $options);
+ }
+
+ /**
+ * Registers the Bootstrap popover plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#popover
+ * @since 0.9.8
+ */
+ public function registerPopover($selector = null, $options = array())
+ {
+ $this->registerTooltip(); // Popover requires the tooltip plugin
+ $this->registerPlugin(self::PLUGIN_POPOVER, $selector, $options, $this->popoverSelector);
+ }
+
+ /**
+ * Registers the Bootstrap tabs plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#tabs
+ * @since 0.9.8
+ */
+ public function registerTabs($selector = null, $options = array())
+ {
+ $this->registerPlugin(self::PLUGIN_TAB, $selector, $options);
+ }
+
+ /**
+ * Registers the Bootstrap tooltip plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#tooltip
+ * @since 0.9.8
+ */
+ public function registerTooltip($selector = null, $options = array())
+ {
+ $this->registerPlugin(self::PLUGIN_TOOLTIP, $selector, $options, $this->tooltipSelector);
+ }
+
+ /**
+ * Registers the Bootstrap typeahead plugin.
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @see http://twitter.github.com/bootstrap/javascript.html#typeahead
+ * @since 0.9.8
+ */
+ public function registerTypeahead($selector = null, $options = array())
+ {
+ $this->registerPlugin(self::PLUGIN_TYPEAHEAD, $selector, $options);
+ }
+
+ /**
+ * Registers a Bootstrap JavaScript plugin.
+ * @param string $name the name of the plugin
+ * @param string $selector the CSS selector
+ * @param array $options the plugin options
+ * @param string $defaultSelector the default CSS selector
+ * @since 0.9.8
+ */
+ protected function registerPlugin($name, $selector = null, $options = array(), $defaultSelector = null)
+ {
+ if (!isset($selector) && empty($options))
+ {
+ // Initialization from extension configuration.
+ $config = isset($this->plugins[$name]) ? $this->plugins[$name] : array();
+
+ if (isset($config['selector']))
+ $selector = $config['selector'];
+
+ if (isset($config['options']))
+ $options = $config['options'];
+
+ if (!isset($selector))
+ $selector = $defaultSelector;
+ }
+
+ if (isset($selector))
+ {
+ $key = __CLASS__.'.'.md5($name.$selector.serialize($options).$defaultSelector);
+ $options = !empty($options) ? CJavaScript::encode($options) : '';
+ Yii::app()->clientScript->registerScript($key, "jQuery('{$selector}').{$name}({$options});");
+ }
+ }
+
+ /**
+ * Returns the URL to the published assets folder.
+ * @return string the URL
+ */
+ protected function getAssetsUrl()
+ {
+ if (isset($this->_assetsUrl))
+ return $this->_assetsUrl;
+ else
+ {
+ $assetsPath = Yii::getPathOfAlias('bootstrap.assets');
+ $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG);
+ return $this->_assetsUrl = $assetsUrl;
+ }
+ }
+
+ /**
+ * Returns the extension version number.
+ * @return string the version
+ */
+ public function getVersion()
+ {
+ return '1.0.0';
+ }
+}
View
32 protected/extensions/bootstrap/gii/bootstrap/BootstrapCode.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * BootstrapCode class file.
+ * @author Christoffer Niska <ChristofferNiska@gmail.com>
+ * @copyright Copyright &copy; Christoffer Niska 2011-
+ * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
+ */
+
+Yii::import('gii.generators.crud.CrudCode');
+
+class BootstrapCode extendS CrudCode
+{
+ public function generateActiveRow($modelClass, $column)
+ {
+ if ($column->type === 'boolean')
+ return "\$form->checkBoxRow(\$model,'{$column->name}')";
+ else if (stripos($column->dbType,'text') !== false)
+ return "\$form->textAreaRow(\$model,'{$column->name}',array('rows'=>6, 'cols'=>50, 'class'=>'span8'))";
+ else
+ {
+ if (preg_match('/^(password|pass|passwd|passcode)$/i',$column->name))
+ $inputField='passwordFieldRow';
+ else
+ $inputField='textFieldRow';
+
+ if ($column->type!=='string' || $column->size===null)
+ return "\$form->{$inputField}(\$model,'{$column->name}',array('class'=>'span5'))";
+ else
+ return "\$form->{$inputField}(\$model,'{$column->name}',array('class'=>'span5','maxlength'=>$column->size))";
+ }
+ }
+}
View
14 protected/extensions/bootstrap/gii/bootstrap/BootstrapGenerator.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * BootstrapGenerator class file.
+ * @author Christoffer Niska <ChristofferNiska@gmail.com>
+ * @copyright Copyright &copy; Christoffer Niska 2011-
+ * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
+ */
+
+Yii::import('gii.generators.crud.CrudGenerator');
+
+class BootstrapGenerator extends CrudGenerator
+{
+ public $codeModel = 'bootstrap.gii.bootstrap.BootstrapCode';
+}
View
35 protected/extensions/bootstrap/gii/bootstrap/templates/default/_form.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * The following variables are available in this template:
+ * - $this: the BootCrudCode object
+ */
+?>
+<?php echo "<?php \$form=\$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
+ 'id'=>'".$this->class2id($this->modelClass)."-form',
+ 'enableAjaxValidation'=>false,
+)); ?>\n"; ?>
+
+ <p class="help-block">Fields with <span class="required">*</span> are required.</p>
+
+ <?php echo "<?php echo \$form->errorSummary(\$model); ?>\n"; ?>
+
+<?php
+foreach($this->tableSchema->columns as $column)
+{
+ if($column->autoIncrement)
+ continue;
+?>
+ <?php echo "<?php echo ".$this->generateActiveRow($this->modelClass,$column)."; ?>\n"; ?>
+
+<?php
+}
+?>
+ <div class="form-actions">
+ <?php echo "<?php \$this->widget('bootstrap.widgets.TbButton', array(
+ 'buttonType'=>'submit',
+ 'type'=>'primary',
+ 'label'=>\$model->isNewRecord ? 'Create' : 'Save',
+ )); ?>\n"; ?>
+ </div>
+
+<?php echo "<?php \$this->endWidget(); ?>\n"; ?>
View
29 protected/extensions/bootstrap/gii/bootstrap/templates/default/_search.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * The following variables are available in this template:
+ * - $this: the BootCrudCode object
+ */
+?>
+<?php echo "<?php \$form=\$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
+ 'action'=>Yii::app()->createUrl(\$this->route),
+ 'method'=>'get',
+)); ?>\n"; ?>
+
+<?php foreach($this->tableSchema->columns as $column): ?>
+<?php
+ $field=$this->generateInputField($this->modelClass,$column);
+ if(strpos($field,'password')!==false)
+ continue;
+?>
+ <?php echo "<?php echo ".$this->generateActiveRow($this->modelClass,$column)."; ?>\n"; ?>
+
+<?php endforeach; ?>
+ <div class="form-actions">
+ <?php echo "<?php \$this->widget('bootstrap.widgets.TbButton', array(
+ 'buttonType'=>'submit'
+ 'type'=>'primary',
+ 'label'=>'Search',
+ )); ?>\n"; ?>
+ </div>
+
+<?php echo "<?php \$this->endWidget(); ?>\n"; ?>
View
26 protected/extensions/bootstrap/gii/bootstrap/templates/default/_view.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * The following variables are available in this template:
+ * - $this: the BootCrudCode object
+ */
+?>
+<div class="view">
+
+<?php
+echo "\t<b><?php echo CHtml::encode(\$data->getAttributeLabel('{$this->tableSchema->primaryKey}')); ?>:</b>\n";
+echo "\t<?php echo CHtml::link(CHtml::encode(\$data->{$this->tableSchema->primaryKey}),array('view','id'=>\$data->{$this->tableSchema->primaryKey})); ?>\n\t<br />\n\n";
+$count=0;
+foreach($this->tableSchema->columns as $column)
+{
+ if($column->isPrimaryKey)
+ continue;
+ if(++$count==7)
+ echo "\t<?php /*\n";
+ echo "\t<b><?php echo CHtml::encode(\$data->getAttributeLabel('{$column->name}')); ?>:</b>\n";
+ echo "\t<?php echo CHtml::encode(\$data->{$column->name}); ?>\n\t<br />\n\n";
+}
+if($count>=7)
+ echo "\t*/ ?>\n";
+?>
+
+</div>
View
70 protected/extensions/bootstrap/gii/bootstrap/templates/default/admin.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * The following variables are available in this template:
+ * - $this: the BootCrudCode object
+ */
+?>
+<?php
+echo "<?php\n";
+$label=$this->pluralize($this->class2name($this->modelClass));
+echo "\$this->breadcrumbs=array(
+ '$label'=>array('index'),
+ 'Manage',
+);\n";
+?>
+
+$this->menu=array(
+ array('label'=>'List <?php echo $this->modelClass; ?>','url'=>array('index')),
+ array('label'=>'Create <?php echo $this->modelClass; ?>','url'=>array('create')),
+);
+
+Yii::app()->clientScript->registerScript('search', "
+$('.search-button').click(function(){
+ $('.search-form').toggle();
+ return false;
+});
+$('.search-form form').submit(function(){
+ $.fn.yiiGridView.update('<?php echo $this->class2id($this->modelClass); ?>-grid', {
+ data: $(this).serialize()
+ });
+ return false;
+});
+");
+?>
+
+<h1>Manage <?php echo $this->pluralize($this->class2name($this->modelClass)); ?></h1>
+
+<p>
+You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
+or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
+</p>
+
+<?php echo "<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button btn')); ?>"; ?>
+
+<div class="search-form" style="display:none">
+<?php echo "<?php \$this->renderPartial('_search',array(
+ 'model'=>\$model,
+)); ?>\n"; ?>
+</div><!-- search-form -->
+
+<?php echo "<?php"; ?> $this->widget('bootstrap.widgets.TbGridView',array(
+ 'id'=>'<?php echo $this->class2id($this->modelClass); ?>-grid',
+ 'dataProvider'=>$model->search(),
+ 'filter'=>$model,
+ 'columns'=>array(
+<?php
+$count=0;
+foreach($this->tableSchema->columns as $column)
+{
+ if(++$count==7)
+ echo "\t\t/*\n";
+ echo "\t\t'".$column->name."',\n";
+}
+if($count>=7)
+ echo "\t\t*/\n";
+?>
+ array(
+ 'class'=>'bootstrap.widgets.TbButtonColumn',
+ ),
+ ),
+)); ?>
View
183 protected/extensions/bootstrap/gii/bootstrap/templates/default/controller.php
@@ -0,0 +1,183 @@
+<?php
+/**
+ * This is the template for generating a controller class file for CRUD feature.
+ * The following variables are available in this template:
+ * - $this: the BootCrudCode object
+ */
+?>
+<?php echo "<?php\n"; ?>
+
+class <?php echo $this->controllerClass; ?> extends <?php echo $this->baseControllerClass."\n"; ?>
+{
+ /**
+ * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
+ * using two-column layout. See 'protected/views/layouts/column2.php'.
+ */
+ public $layout='//layouts/column2';
+
+ /**
+ * @return array action filters
+ */
+ public function filters()
+ {
+ return array(
+ 'accessControl', // perform access control for CRUD operations
+ );
+ }
+
+ /**
+ * Specifies the access control rules.
+ * This method is used by the 'accessControl' filter.
+ * @return array access control rules
+ */
+ public function accessRules()
+ {
+ return array(
+ array('allow', // allow all users to perform 'index' and 'view' actions
+ 'actions'=>array('index','view'),
+ 'users'=>array('*'),
+ ),
+ array('allow', // allow authenticated user to perform 'create' and 'update' actions
+ 'actions'=>array('create','update'),
+ 'users'=>array('@'),
+ ),
+ array('allow', // allow admin user to perform 'admin' and 'delete' actions
+ 'actions'=>array('admin','delete'),
+ 'users'=>array('admin'),
+ ),
+ array('deny', // deny all users
+ 'users'=>array('*'),
+ ),
+ );
+ }
+
+ /**
+ * Displays a particular model.
+ * @param integer $id the ID of the model to be displayed
+ */
+ public function actionView($id)
+ {
+ $this->render('view',array(
+ 'model'=>$this->loadModel($id),
+ ));
+ }
+
+ /**
+ * Creates a new model.
+ * If creation is successful, the browser will be redirected to the 'view' page.
+ */
+ public function actionCreate()
+ {
+ $model=new <?php echo $this->modelClass; ?>;
+
+ // Uncomment the following line if AJAX validation is needed
+ // $this->performAjaxValidation($model);
+
+ if(isset($_POST['<?php echo $this->modelClass; ?>']))
+ {
+ $model->attributes=$_POST['<?php echo $this->modelClass; ?>'];
+ if($model->save())
+ $this->redirect(array('view','id'=>$model-><?php echo $this->tableSchema->primaryKey; ?>));
+ }
+
+ $this->render('create',array(
+ 'model'=>$model,
+ ));
+ }
+
+ /**
+ * Updates a particular model.
+ * If update is successful, the browser will be redirected to the 'view' page.
+ * @param integer $id the ID of the model to be updated
+ */
+ public function actionUpdate($id)
+ {
+ $model=$this->loadModel($id);
+
+ // Uncomment the following line if AJAX validation is needed
+ // $this->performAjaxValidation($model);
+
+ if(isset($_POST['<?php echo $this->modelClass; ?>']))
+ {
+ $model->attributes=$_POST['<?php echo $this->modelClass; ?>'];
+ if($model->save())
+ $this->redirect(array('view','id'=>$model-><?php echo $this->tableSchema->primaryKey; ?>));
+ }
+
+ $this->render('update',array(
+ 'model'=>$model,
+ ));
+ }
+
+ /**
+ * Deletes a particular model.
+ * If deletion is successful, the browser will be redirected to the 'admin' page.
+ * @param integer $id the ID of the model to be deleted
+ */
+ public function actionDelete($id)
+ {
+ if(Yii::app()->request->isPostRequest)
+ {
+ // we only allow deletion via POST request
+ $this->loadModel($id)->delete();
+
+ // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
+ if(!isset($_GET['ajax']))
+ $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
+ }
+ else
+ throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
+ }
+
+ /**
+ * Lists all models.
+ */
+ public function actionIndex()
+ {
+ $dataProvider=new CActiveDataProvider('<?php echo $this->modelClass; ?>');
+ $this->render('index',array(
+ 'dataProvider'=>$dataProvider,
+ ));
+ }
+
+ /**
+ * Manages all models.
+ */
+ public function actionAdmin()
+ {
+ $model=new <?php echo $this->modelClass; ?>('search');
+ $model->unsetAttributes(); // clear any default values
+ if(isset($_GET['<?php echo $this->modelClass; ?>']))
+ $model->attributes=$_GET['<?php echo $this->modelClass; ?>'];
+
+ $this->render('admin',array(
+ 'model'=>$model,
+ ));
+ }
+
+ /**
+ * Returns the data model based on the primary key given in the GET variable.
+ * If the data model is not found, an HTTP exception will be raised.
+ * @param integer the ID of the model to be loaded
+ */
+ public function loadModel($id)
+ {
+ $model=<?php echo $this->modelClass; ?>::model()->findByPk($id);
+ if($model===null)
+ throw new CHttpException(404,'The requested page does not exist.');
+ return $model;
+ }
+
+ /**
+ * Performs the AJAX validation.
+ * @param CModel the model to be validated
+ */
+ protected function performAjaxValidation($model)
+ {
+ if(isset($_POST['ajax']) && $_POST['ajax']==='<?php echo $this->class2id($this->modelClass); ?>-form')
+ {
+ echo CActiveForm::validate($model);
+ Yii::app()->end();
+ }
+ }
+}
View
24 protected/extensions/bootstrap/gii/bootstrap/templates/default/create.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * The following variables are available in this template:
+ * - $this: the BootCrudCode object
+ */
+?>
+<?php
+echo "<?php\n";
+$label=$this->pluralize($this->class2name($this->modelClass));
+echo "\$this->breadcrumbs=array(
+ '$label'=>array('index'),
+ 'Create',
+);\n";
+?>
+
+$this->menu=array(
+ array('label'=>'List <?php echo $this->modelClass; ?>','url'=>array('index')),
+ array('label'=>'Manage <?php echo $this->modelClass; ?>','url'=>array('admin')),
+);
+?>
+
+<h1>Create <?php echo $this->modelClass; ?></h1>
+
+<?php echo "<?php echo \$this->renderPartial('_form', array('model'=>\$model)); ?>"; ?>
View
26 protected/extensions/bootstrap/gii/bootstrap/templates/default/index.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * The following variables are available in this template:
+ * - $this: the BootCrudCode object
+ */
+?>
+<?php
+echo "<?php\n";
+$label=$this->pluralize($this->class2name($this->modelClass));
+echo "\$this->breadcrumbs=array(
+ '$label',
+);\n";
+?>
+
+$this->menu=array(
+ array('label'=>'Create <?php echo $this->modelClass; ?>','url'=>array('create')),
+ array('label'=>'Manage <?php echo $this->modelClass; ?>','url'=>array('admin')),
+);
+?>
+
+<h1><?php echo $label; ?></h1>
+
+<?php echo "<?php"; ?> $this->widget('bootstrap.widgets.TbListView',array(
+ 'dataProvider'=>$dataProvider,
+ 'itemView'=>'_view',
+)); ?>
View
28 protected/extensions/bootstrap/gii/bootstrap/templates/default/update.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * The following variables are available in this template:
+ * - $this: the BootCrudCode object
+ */
+?>
+<?php
+echo "<?php\n";
+$nameColumn=$this->guessNameColumn($this->tableSchema->columns);
+$label=$this->pluralize($this->class2name($this->modelClass));
+echo "\$this->breadcrumbs=array(
+ '$label'=>array('index'),
+ \$model->{$nameColumn}=>array('view','id'=>\$model->{$this->tableSchema->primaryKey}),
+ 'Update',
+);\n";
+?>
+
+$this->menu=array(
+ array('label'=>'List <?php echo $this->modelClass; ?>','url'=>array('index')),
+ array('label'=>'Create <?php echo $this->modelClass; ?>','url'=>array('create')),
+ array('label'=>'View <?php echo $this->modelClass; ?>','url'=>array('view','id'=>$model-><?php echo $this->tableSchema->primaryKey; ?>)),
+ array('label'=>'Manage <?php echo $this->modelClass; ?>','url'=>array('admin')),
+);
+?>
+
+<h1>Update <?php echo $this->modelClass." <?php echo \$model->{$this->tableSchema->primaryKey}; ?>"; ?></h1>
+
+<?php echo "<?php echo \$this->renderPartial('_form',array('model'=>\$model)); ?>"; ?>
View
36 protected/extensions/bootstrap/gii/bootstrap/templates/default/view.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * The following variables are available in this template:
+ * - $this: the BootCrudCode object
+ */
+?>
+<?php
+echo "<?php\n";
+$nameColumn=$this->guessNameColumn($this->tableSchema->columns);
+$label=$this->pluralize($this->class2name($this->modelClass));
+echo "\$this->breadcrumbs=array(
+ '$label'=>array('index'),
+ \$model->{$nameColumn},
+);\n";
+?>
+
+$this->menu=array(
+ array('label'=>'List <?php echo $this->modelClass; ?>','url'=>array('index')),
+ array('label'=>'Create <?php echo $this->modelClass; ?>','url'=>array('create')),
+ array('label'=>'Update <?php echo $this->modelClass; ?>','url'=>array('update','id'=>$model-><?php echo $this->tableSchema->primaryKey; ?>)),
+ array('label'=>'Delete <?php echo $this->modelClass; ?>','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model-><?php echo $this->tableSchema->primaryKey; ?>),'confirm'=>'Are you sure you want to delete this item?')),
+ array('label'=>'Manage <?php echo $this->modelClass; ?>','url'=>array('admin')),
+);
+?>
+
+<h1>View <?php echo $this->modelClass." #<?php echo \$model->{$this->tableSchema->primaryKey}; ?>"; ?></h1>
+
+<?php echo "<?php"; ?> $this->widget('bootstrap.widgets.TbDetailView',array(
+ 'data'=>$model,
+ 'attributes'=>array(
+<?php
+foreach($this->tableSchema->columns as $column)
+ echo "\t\t'".$column->name."',\n";
+?>
+ ),
+)); ?>
View
64 protected/extensions/bootstrap/gii/bootstrap/views/index.php
@@ -0,0 +1,64 @@
+<?php
+$class=get_class($model);
+Yii::app()->clientScript->registerScript('gii.crud',"
+$('#{$class}_controller').change(function(){
+ $(this).data('changed',$(this).val()!='');
+});
+$('#{$class}_model').bind('keyup change', function(){
+ var controller=$('#{$class}_controller');
+ if(!controller.data('changed')) {
+ var id=new String($(this).val().match(/\\w*$/));
+ if(id.length>0)
+ id=id.substring(0,1).toLowerCase()+id.substring(1);
+ controller.val(id);
+ }
+});
+");
+?>
+<h1>Bootstrap Generator</h1>
+
+<p>This generator generates a controller and views that implement CRUD operations for the specified data model.</p>
+
+<?php $form=$this->beginWidget('CCodeForm', array('model'=>$model)); ?>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'model'); ?>
+ <?php echo $form->textField($model,'model',array('size'=>65)); ?>
+ <div class="tooltip">
+ Model class is case-sensitive. It can be either a class name (e.g. <code>Post</code>)
+ or the path alias of the class file (e.g. <code>application.models.Post</code>).
+ Note that if the former, the class must be auto-loadable.
+ </div>
+ <?php echo $form->error($model,'model'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'controller'); ?>
+ <?php echo $form->textField($model,'controller',array('size'=>65)); ?>
+ <div class="tooltip">
+ Controller ID is case-sensitive. CRUD controllers are often named after
+ the model class name that they are dealing with. Below are some examples:
+ <ul>
+ <li><code>post</code> generates <code>PostController.php</code></li>
+ <li><code>postTag</code> generates <code>PostTagController.php</code></li>
+ <li><code>admin/user</code> generates <code>admin/UserController.php</code>.
+ If the application has an <code>admin</code> module enabled,
+ it will generate <code>UserController</code> (and other CRUD code)
+ within the module instead.
+ </li>
+ </ul>
+ </div>
+ <?php echo $form->error($model,'controller'); ?>
+ </div>
+
+ <div class="row sticky">
+ <?php echo $form->labelEx($model,'baseControllerClass'); ?>
+ <?php echo $form->textField($model,'baseControllerClass',array('size'=>65)); ?>
+ <div class="tooltip">
+ This is the class that the new CRUD controller class will extend from.
+ Please make sure the class exists and can be autoloaded.