瀏覽代碼

Updated margins for ul li, ol li elements, Changed Tools to Help in Toolbar, Moved Download Backup to Setup > System > Download Backup

version-14
Anand Doshi 11 年之前
父節點
當前提交
b5aa26b7bc
共有 5 個文件被更改,包括 219 次插入223 次删除
  1. +11
    -1
      frappe/config/setup.py
  2. +149
    -145
      frappe/public/css/bootstrap.css
  3. +5
    -0
      frappe/public/css/less/frappe.less
  4. +46
    -77
      frappe/public/js/frappe/ui/toolbar/toolbar.js
  5. +8
    -0
      frappe/public/js/frappe/views/moduleview.js

+ 11
- 1
frappe/config/setup.py 查看文件

@@ -133,6 +133,15 @@ data = [
"description": _("Install Applications."),
"icon": "icon-download"
},
{
"type": "doctype",
"name": "Backup Manager",
"label": _("Download Backup"),
"onclick": "frappe.ui.toolbar.download_backup",
"icon": "icon-download-alt",
"description": _("Send download link of a recent backup to System Managers"),
"hide_count": True
},
{
"type": "doctype",
"name": "Social Login Keys",
@@ -141,7 +150,8 @@ data = [
{
"type": "doctype",
"name": "Backup Manager",
"description": _("Manage cloud backups on Dropbox")
"description": _("Manage cloud backups on Dropbox"),
"hide_count": True
},
{
"type": "doctype",


+ 149
- 145
frappe/public/css/bootstrap.css 查看文件

@@ -275,7 +275,7 @@ html {
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
line-height: 1.42857143;
color: #333;
background-color: #fff;
}
@@ -320,7 +320,7 @@ img {
max-width: 100%;
height: auto;
padding: 4px;
line-height: 1.428571429;
line-height: 1.42857143;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
@@ -596,7 +596,7 @@ dl {
}
dt,
dd {
line-height: 1.428571429;
line-height: 1.42857143;
}
dt {
font-weight: bold;
@@ -643,7 +643,7 @@ blockquote small,
blockquote .small {
display: block;
font-size: 80%;
line-height: 1.428571429;
line-height: 1.42857143;
color: #999;
}
blockquote footer:before,
@@ -682,7 +682,7 @@ blockquote:after {
address {
margin-bottom: 20px;
font-style: normal;
line-height: 1.428571429;
line-height: 1.42857143;
}
code,
kbd,
@@ -711,7 +711,7 @@ pre {
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.428571429;
line-height: 1.42857143;
color: #333;
word-break: break-all;
word-wrap: break-word;
@@ -775,73 +775,73 @@ pre code {
width: 100%;
}
.col-xs-11 {
width: 91.66666666666666%;
width: 91.66666667%;
}
.col-xs-10 {
width: 83.33333333333334%;
width: 83.33333333%;
}
.col-xs-9 {
width: 75%;
}
.col-xs-8 {
width: 66.66666666666666%;
width: 66.66666667%;
}
.col-xs-7 {
width: 58.333333333333336%;
width: 58.33333333%;
}
.col-xs-6 {
width: 50%;
}
.col-xs-5 {
width: 41.66666666666667%;
width: 41.66666667%;
}
.col-xs-4 {
width: 33.33333333333333%;
width: 33.33333333%;
}
.col-xs-3 {
width: 25%;
}
.col-xs-2 {
width: 16.666666666666664%;
width: 16.66666667%;
}
.col-xs-1 {
width: 8.333333333333332%;
width: 8.33333333%;
}
.col-xs-pull-12 {
right: 100%;
}
.col-xs-pull-11 {
right: 91.66666666666666%;
right: 91.66666667%;
}
.col-xs-pull-10 {
right: 83.33333333333334%;
right: 83.33333333%;
}
.col-xs-pull-9 {
right: 75%;
}
.col-xs-pull-8 {
right: 66.66666666666666%;
right: 66.66666667%;
}
.col-xs-pull-7 {
right: 58.333333333333336%;
right: 58.33333333%;
}
.col-xs-pull-6 {
right: 50%;
}
.col-xs-pull-5 {
right: 41.66666666666667%;
right: 41.66666667%;
}
.col-xs-pull-4 {
right: 33.33333333333333%;
right: 33.33333333%;
}
.col-xs-pull-3 {
right: 25%;
}
.col-xs-pull-2 {
right: 16.666666666666664%;
right: 16.66666667%;
}
.col-xs-pull-1 {
right: 8.333333333333332%;
right: 8.33333333%;
}
.col-xs-pull-0 {
right: 0;
@@ -850,37 +850,37 @@ pre code {
left: 100%;
}
.col-xs-push-11 {
left: 91.66666666666666%;
left: 91.66666667%;
}
.col-xs-push-10 {
left: 83.33333333333334%;
left: 83.33333333%;
}
.col-xs-push-9 {
left: 75%;
}
.col-xs-push-8 {
left: 66.66666666666666%;
left: 66.66666667%;
}
.col-xs-push-7 {
left: 58.333333333333336%;
left: 58.33333333%;
}
.col-xs-push-6 {
left: 50%;
}
.col-xs-push-5 {
left: 41.66666666666667%;
left: 41.66666667%;
}
.col-xs-push-4 {
left: 33.33333333333333%;
left: 33.33333333%;
}
.col-xs-push-3 {
left: 25%;
}
.col-xs-push-2 {
left: 16.666666666666664%;
left: 16.66666667%;
}
.col-xs-push-1 {
left: 8.333333333333332%;
left: 8.33333333%;
}
.col-xs-push-0 {
left: 0;
@@ -889,37 +889,37 @@ pre code {
margin-left: 100%;
}
.col-xs-offset-11 {
margin-left: 91.66666666666666%;
margin-left: 91.66666667%;
}
.col-xs-offset-10 {
margin-left: 83.33333333333334%;
margin-left: 83.33333333%;
}
.col-xs-offset-9 {
margin-left: 75%;
}
.col-xs-offset-8 {
margin-left: 66.66666666666666%;
margin-left: 66.66666667%;
}
.col-xs-offset-7 {
margin-left: 58.333333333333336%;
margin-left: 58.33333333%;
}
.col-xs-offset-6 {
margin-left: 50%;
}
.col-xs-offset-5 {
margin-left: 41.66666666666667%;
margin-left: 41.66666667%;
}
.col-xs-offset-4 {
margin-left: 33.33333333333333%;
margin-left: 33.33333333%;
}
.col-xs-offset-3 {
margin-left: 25%;
}
.col-xs-offset-2 {
margin-left: 16.666666666666664%;
margin-left: 16.66666667%;
}
.col-xs-offset-1 {
margin-left: 8.333333333333332%;
margin-left: 8.33333333%;
}
.col-xs-offset-0 {
margin-left: 0;
@@ -932,73 +932,73 @@ pre code {
width: 100%;
}
.col-sm-11 {
width: 91.66666666666666%;
width: 91.66666667%;
}
.col-sm-10 {
width: 83.33333333333334%;
width: 83.33333333%;
}
.col-sm-9 {
width: 75%;
}
.col-sm-8 {
width: 66.66666666666666%;
width: 66.66666667%;
}
.col-sm-7 {
width: 58.333333333333336%;
width: 58.33333333%;
}
.col-sm-6 {
width: 50%;
}
.col-sm-5 {
width: 41.66666666666667%;
width: 41.66666667%;
}
.col-sm-4 {
width: 33.33333333333333%;
width: 33.33333333%;
}
.col-sm-3 {
width: 25%;
}
.col-sm-2 {
width: 16.666666666666664%;
width: 16.66666667%;
}
.col-sm-1 {
width: 8.333333333333332%;
width: 8.33333333%;
}
.col-sm-pull-12 {
right: 100%;
}
.col-sm-pull-11 {
right: 91.66666666666666%;
right: 91.66666667%;
}
.col-sm-pull-10 {
right: 83.33333333333334%;
right: 83.33333333%;
}
.col-sm-pull-9 {
right: 75%;
}
.col-sm-pull-8 {
right: 66.66666666666666%;
right: 66.66666667%;
}
.col-sm-pull-7 {
right: 58.333333333333336%;
right: 58.33333333%;
}
.col-sm-pull-6 {
right: 50%;
}
.col-sm-pull-5 {
right: 41.66666666666667%;
right: 41.66666667%;
}
.col-sm-pull-4 {
right: 33.33333333333333%;
right: 33.33333333%;
}
.col-sm-pull-3 {
right: 25%;
}
.col-sm-pull-2 {
right: 16.666666666666664%;
right: 16.66666667%;
}
.col-sm-pull-1 {
right: 8.333333333333332%;
right: 8.33333333%;
}
.col-sm-pull-0 {
right: 0;
@@ -1007,37 +1007,37 @@ pre code {
left: 100%;
}
.col-sm-push-11 {
left: 91.66666666666666%;
left: 91.66666667%;
}
.col-sm-push-10 {
left: 83.33333333333334%;
left: 83.33333333%;
}
.col-sm-push-9 {
left: 75%;
}
.col-sm-push-8 {
left: 66.66666666666666%;
left: 66.66666667%;
}
.col-sm-push-7 {
left: 58.333333333333336%;
left: 58.33333333%;
}
.col-sm-push-6 {
left: 50%;
}
.col-sm-push-5 {
left: 41.66666666666667%;
left: 41.66666667%;
}
.col-sm-push-4 {
left: 33.33333333333333%;
left: 33.33333333%;
}
.col-sm-push-3 {
left: 25%;
}
.col-sm-push-2 {
left: 16.666666666666664%;
left: 16.66666667%;
}
.col-sm-push-1 {
left: 8.333333333333332%;
left: 8.33333333%;
}
.col-sm-push-0 {
left: 0;
@@ -1046,37 +1046,37 @@ pre code {
margin-left: 100%;
}
.col-sm-offset-11 {
margin-left: 91.66666666666666%;
margin-left: 91.66666667%;
}
.col-sm-offset-10 {
margin-left: 83.33333333333334%;
margin-left: 83.33333333%;
}
.col-sm-offset-9 {
margin-left: 75%;
}
.col-sm-offset-8 {
margin-left: 66.66666666666666%;
margin-left: 66.66666667%;
}
.col-sm-offset-7 {
margin-left: 58.333333333333336%;
margin-left: 58.33333333%;
}
.col-sm-offset-6 {
margin-left: 50%;
}
.col-sm-offset-5 {
margin-left: 41.66666666666667%;
margin-left: 41.66666667%;
}
.col-sm-offset-4 {
margin-left: 33.33333333333333%;
margin-left: 33.33333333%;
}
.col-sm-offset-3 {
margin-left: 25%;
}
.col-sm-offset-2 {
margin-left: 16.666666666666664%;
margin-left: 16.66666667%;
}
.col-sm-offset-1 {
margin-left: 8.333333333333332%;
margin-left: 8.33333333%;
}
.col-sm-offset-0 {
margin-left: 0;
@@ -1090,73 +1090,73 @@ pre code {
width: 100%;
}
.col-md-11 {
width: 91.66666666666666%;
width: 91.66666667%;
}
.col-md-10 {
width: 83.33333333333334%;
width: 83.33333333%;
}
.col-md-9 {
width: 75%;
}
.col-md-8 {
width: 66.66666666666666%;
width: 66.66666667%;
}
.col-md-7 {
width: 58.333333333333336%;
width: 58.33333333%;
}
.col-md-6 {
width: 50%;
}
.col-md-5 {
width: 41.66666666666667%;
width: 41.66666667%;
}
.col-md-4 {
width: 33.33333333333333%;
width: 33.33333333%;
}
.col-md-3 {
width: 25%;
}
.col-md-2 {
width: 16.666666666666664%;
width: 16.66666667%;
}
.col-md-1 {
width: 8.333333333333332%;
width: 8.33333333%;
}
.col-md-pull-12 {
right: 100%;
}
.col-md-pull-11 {
right: 91.66666666666666%;
right: 91.66666667%;
}
.col-md-pull-10 {
right: 83.33333333333334%;
right: 83.33333333%;
}
.col-md-pull-9 {
right: 75%;
}
.col-md-pull-8 {
right: 66.66666666666666%;
right: 66.66666667%;
}
.col-md-pull-7 {
right: 58.333333333333336%;
right: 58.33333333%;
}
.col-md-pull-6 {
right: 50%;
}
.col-md-pull-5 {
right: 41.66666666666667%;
right: 41.66666667%;
}
.col-md-pull-4 {
right: 33.33333333333333%;
right: 33.33333333%;
}
.col-md-pull-3 {
right: 25%;
}
.col-md-pull-2 {
right: 16.666666666666664%;
right: 16.66666667%;
}
.col-md-pull-1 {
right: 8.333333333333332%;
right: 8.33333333%;
}
.col-md-pull-0 {
right: 0;
@@ -1165,37 +1165,37 @@ pre code {
left: 100%;
}
.col-md-push-11 {
left: 91.66666666666666%;
left: 91.66666667%;
}
.col-md-push-10 {
left: 83.33333333333334%;
left: 83.33333333%;
}
.col-md-push-9 {
left: 75%;
}
.col-md-push-8 {
left: 66.66666666666666%;
left: 66.66666667%;
}
.col-md-push-7 {
left: 58.333333333333336%;
left: 58.33333333%;
}
.col-md-push-6 {
left: 50%;
}
.col-md-push-5 {
left: 41.66666666666667%;
left: 41.66666667%;
}
.col-md-push-4 {
left: 33.33333333333333%;
left: 33.33333333%;
}
.col-md-push-3 {
left: 25%;
}
.col-md-push-2 {
left: 16.666666666666664%;
left: 16.66666667%;
}
.col-md-push-1 {
left: 8.333333333333332%;
left: 8.33333333%;
}
.col-md-push-0 {
left: 0;
@@ -1204,37 +1204,37 @@ pre code {
margin-left: 100%;
}
.col-md-offset-11 {
margin-left: 91.66666666666666%;
margin-left: 91.66666667%;
}
.col-md-offset-10 {
margin-left: 83.33333333333334%;
margin-left: 83.33333333%;
}
.col-md-offset-9 {
margin-left: 75%;
}
.col-md-offset-8 {
margin-left: 66.66666666666666%;
margin-left: 66.66666667%;
}
.col-md-offset-7 {
margin-left: 58.333333333333336%;
margin-left: 58.33333333%;
}
.col-md-offset-6 {
margin-left: 50%;
}
.col-md-offset-5 {
margin-left: 41.66666666666667%;
margin-left: 41.66666667%;
}
.col-md-offset-4 {
margin-left: 33.33333333333333%;
margin-left: 33.33333333%;
}
.col-md-offset-3 {
margin-left: 25%;
}
.col-md-offset-2 {
margin-left: 16.666666666666664%;
margin-left: 16.66666667%;
}
.col-md-offset-1 {
margin-left: 8.333333333333332%;
margin-left: 8.33333333%;
}
.col-md-offset-0 {
margin-left: 0;
@@ -1248,73 +1248,73 @@ pre code {
width: 100%;
}
.col-lg-11 {
width: 91.66666666666666%;
width: 91.66666667%;
}
.col-lg-10 {
width: 83.33333333333334%;
width: 83.33333333%;
}
.col-lg-9 {
width: 75%;
}
.col-lg-8 {
width: 66.66666666666666%;
width: 66.66666667%;
}
.col-lg-7 {
width: 58.333333333333336%;
width: 58.33333333%;
}
.col-lg-6 {
width: 50%;
}
.col-lg-5 {
width: 41.66666666666667%;
width: 41.66666667%;
}
.col-lg-4 {
width: 33.33333333333333%;
width: 33.33333333%;
}
.col-lg-3 {
width: 25%;
}
.col-lg-2 {
width: 16.666666666666664%;
width: 16.66666667%;
}
.col-lg-1 {
width: 8.333333333333332%;
width: 8.33333333%;
}
.col-lg-pull-12 {
right: 100%;
}
.col-lg-pull-11 {
right: 91.66666666666666%;
right: 91.66666667%;
}
.col-lg-pull-10 {
right: 83.33333333333334%;
right: 83.33333333%;
}
.col-lg-pull-9 {
right: 75%;
}
.col-lg-pull-8 {
right: 66.66666666666666%;
right: 66.66666667%;
}
.col-lg-pull-7 {
right: 58.333333333333336%;
right: 58.33333333%;
}
.col-lg-pull-6 {
right: 50%;
}
.col-lg-pull-5 {
right: 41.66666666666667%;
right: 41.66666667%;
}
.col-lg-pull-4 {
right: 33.33333333333333%;
right: 33.33333333%;
}
.col-lg-pull-3 {
right: 25%;
}
.col-lg-pull-2 {
right: 16.666666666666664%;
right: 16.66666667%;
}
.col-lg-pull-1 {
right: 8.333333333333332%;
right: 8.33333333%;
}
.col-lg-pull-0 {
right: 0;
@@ -1323,37 +1323,37 @@ pre code {
left: 100%;
}
.col-lg-push-11 {
left: 91.66666666666666%;
left: 91.66666667%;
}
.col-lg-push-10 {
left: 83.33333333333334%;
left: 83.33333333%;
}
.col-lg-push-9 {
left: 75%;
}
.col-lg-push-8 {
left: 66.66666666666666%;
left: 66.66666667%;
}
.col-lg-push-7 {
left: 58.333333333333336%;
left: 58.33333333%;
}
.col-lg-push-6 {
left: 50%;
}
.col-lg-push-5 {
left: 41.66666666666667%;
left: 41.66666667%;
}
.col-lg-push-4 {
left: 33.33333333333333%;
left: 33.33333333%;
}
.col-lg-push-3 {
left: 25%;
}
.col-lg-push-2 {
left: 16.666666666666664%;
left: 16.66666667%;
}
.col-lg-push-1 {
left: 8.333333333333332%;
left: 8.33333333%;
}
.col-lg-push-0 {
left: 0;
@@ -1362,37 +1362,37 @@ pre code {
margin-left: 100%;
}
.col-lg-offset-11 {
margin-left: 91.66666666666666%;
margin-left: 91.66666667%;
}
.col-lg-offset-10 {
margin-left: 83.33333333333334%;
margin-left: 83.33333333%;
}
.col-lg-offset-9 {
margin-left: 75%;
}
.col-lg-offset-8 {
margin-left: 66.66666666666666%;
margin-left: 66.66666667%;
}
.col-lg-offset-7 {
margin-left: 58.333333333333336%;
margin-left: 58.33333333%;
}
.col-lg-offset-6 {
margin-left: 50%;
}
.col-lg-offset-5 {
margin-left: 41.66666666666667%;
margin-left: 41.66666667%;
}
.col-lg-offset-4 {
margin-left: 33.33333333333333%;
margin-left: 33.33333333%;
}
.col-lg-offset-3 {
margin-left: 25%;
}
.col-lg-offset-2 {
margin-left: 16.666666666666664%;
margin-left: 16.66666667%;
}
.col-lg-offset-1 {
margin-left: 8.333333333333332%;
margin-left: 8.33333333%;
}
.col-lg-offset-0 {
margin-left: 0;
@@ -1416,7 +1416,7 @@ th {
.table > tbody > tr > td,
.table > tfoot > tr > td {
padding: 8px;
line-height: 1.428571429;
line-height: 1.42857143;
vertical-align: top;
border-top: 1px solid #ddd;
}
@@ -1683,7 +1683,7 @@ output {
display: block;
padding-top: 7px;
font-size: 14px;
line-height: 1.428571429;
line-height: 1.42857143;
color: #555;
}
.form-control {
@@ -1692,7 +1692,7 @@ output {
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
@@ -1973,7 +1973,7 @@ select[multiple].input-lg {
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.428571429;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
@@ -3015,7 +3015,7 @@ input[type="button"].btn-block {
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
line-height: 1.42857143;
color: #333;
white-space: nowrap;
}
@@ -3064,7 +3064,7 @@ input[type="button"].btn-block {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.428571429;
line-height: 1.42857143;
color: #999;
}
.dropdown-backdrop {
@@ -3489,7 +3489,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
}
.nav-tabs > li > a {
margin-right: 2px;
line-height: 1.428571429;
line-height: 1.42857143;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
}
@@ -4128,7 +4128,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
float: left;
padding: 6px 12px;
margin-left: -1px;
line-height: 1.428571429;
line-height: 1.42857143;
color: #2980b9;
text-decoration: none;
background-color: #fff;
@@ -4389,7 +4389,7 @@ a.list-group-item.active > .badge,
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.428571429;
line-height: 1.42857143;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
@@ -5152,7 +5152,7 @@ button.close {
opacity: .5;
}
.modal-header {
min-height: 16.428571429px;
min-height: 16.42857143px;
padding: 15px;
border-bottom: 1px solid #e5e5e5;
}
@@ -5161,7 +5161,7 @@ button.close {
}
.modal-title {
margin: 0;
line-height: 1.428571429;
line-height: 1.42857143;
}
.modal-body {
position: relative;
@@ -5841,4 +5841,8 @@ h3,
h4 {
font-weight: bold;
}
ul.with-margin li,
ol.with-margin li {
margin: 7px auto;
}
/*# sourceMappingURL=bootstrap.css.map */

+ 5
- 0
frappe/public/css/less/frappe.less 查看文件

@@ -28,4 +28,9 @@

h3, h4 {
font-weight: bold;
}

ul.with-margin li,
ol.with-margin li {
margin: 7px auto;
}

+ 46
- 77
frappe/public/js/frappe/ui/toolbar/toolbar.js 查看文件

@@ -7,11 +7,10 @@ frappe.ui.toolbar.Toolbar = Class.extend({
this.make();
//this.make_modules();
this.make_file();
frappe.ui.toolbar.recent = new frappe.ui.toolbar.RecentDocs();
frappe.ui.toolbar.bookmarks = new frappe.ui.toolbar.Bookmarks();
this.make_tools();
this.set_user_name();
this.make_logout();
this.make_history();
this.make_bookmarks();
this.make_help();
this.make_user_menu();
this.make_notification();
$('.dropdown-toggle').dropdown();
@@ -42,7 +41,8 @@ frappe.ui.toolbar.Toolbar = Class.extend({
<ul class="nav navbar-nav navbar-right">\
<li class="dropdown">\
<a class="dropdown-toggle" data-toggle="dropdown" href="#" \
onclick="return false;" id="toolbar-user-link"></a>\
onclick="return false;">\
<span id="toolbar-user-name"></span><b class="caret"></b></a>\
<ul class="dropdown-menu" id="toolbar-user">\
</ul>\
</li>\
@@ -69,51 +69,6 @@ frappe.ui.toolbar.Toolbar = Class.extend({
})
},

// make_modules: function() {
// $('<li class="dropdown">\
// <a class="dropdown-toggle" data-toggle="dropdown" href="#"\
// title="'+frappe._("Modules")+'"\
// onclick="return false;">'+frappe._("Modules")+'</a>\
// <ul class="dropdown-menu modules">\
// </ul>\
// </li>').prependTo('.navbar .nav:first');
//
// var modules_list = frappe.user.get_desktop_items().sort();
// var menu_list = $(".navbar .modules");
//
// var _get_list_item = function(m) {
// args = {
// module: m,
// module_page: frappe.modules[m].link,
// module_label: frappe._(frappe.modules[m].label || m),
// icon: frappe.modules[m].icon
// }
//
// return repl('<li><a href="#%(module_page)s" \
// data-module="%(module)s"><i class="%(icon)s" style="display: inline-block; \
// width: 21px; margin-top: -2px; margin-left: -7px;"></i>\
// %(module_label)s</a></li>', args);
// }
//
// // desktop
// $('<li><a href="#desktop"><i class="icon-th"></i> '
// + frappe._("Desktop") + '</a></li>\
// <li class="divider"></li>').appendTo(menu_list)
//
// // add to dropdown
// $.each(modules_list,function(i, m) {
// if(m!='Setup') {
// menu_list.append(_get_list_item(m));
// }
// })
//
// // setup for system manager
// if(user_roles.indexOf("System Manager")!=-1) {
// menu_list.append('<li class="divider">' + _get_list_item("Setup"));
// }
//
// },
make_file: function() {
frappe.ui.toolbar.new_dialog = new frappe.ui.toolbar.NewDialog();
frappe.ui.toolbar.search = new frappe.ui.toolbar.Search();
@@ -126,50 +81,64 @@ frappe.ui.toolbar.Toolbar = Class.extend({
onclick="return false;">'+frappe._("File")+'</a>\
<ul class="dropdown-menu" id="navbar-file">\
<li><a href="#" onclick="return frappe.ui.toolbar.new_dialog.show();">\
<i class="icon-plus"></i> '+frappe._('New')+'...</a></li>\
<i class="icon-fixed-width icon-plus"></i> '+frappe._('New')+'...</a></li>\
<li><a href="#" onclick="return frappe.ui.toolbar.report.show();">\
<i class="icon-list"></i> '+frappe._('Report')+'...</a></li>\
<i class="icon-fixed-width icon-list"></i> '+frappe._('Report')+'...</a></li>\
</ul>\
</li>');
},
make_history: function() {
frappe.ui.toolbar.recent = new frappe.ui.toolbar.RecentDocs();
},
make_bookmarks: function() {
frappe.ui.toolbar.bookmarks = new frappe.ui.toolbar.Bookmarks();
},

make_tools: function() {
make_help: function() {
$('.navbar .nav:first').append('<li class="dropdown">\
<a class="dropdown-toggle" data-toggle="dropdown" href="#" \
title="'+frappe._("Tools")+'"\
onclick="return false;">'+frappe._("Tools")+'</a>\
<ul class="dropdown-menu" id="toolbar-tools">\
<li><a href="#" onclick="return frappe.ui.toolbar.clear_cache();">\
<i class="icon-fixed-width icon-refresh"></i> '
+frappe._('Clear Cache & Refresh')+'</a></li>\
title="'+frappe._("Help")+'"\
onclick="return false;">'+frappe._("Help")+'</a>\
<ul class="dropdown-menu" id="toolbar-help"> \
<li><a href="#" onclick="return frappe.ui.toolbar.show_about();">\
<i class="icon-fixed-width icon-info-sign"></i> '
+frappe._('About')+'</a></li>\
<li><a href="http://erpnext.org/attributions.html" target="_blank"><i class="icon-fixed-width icon-heart"></i> '
+frappe._('Attributions')+'</a></li>\
<li><a href="http://frappe.io/apps" target="_blank">\
<i class="icon-fixed-width icon-file"></i> '+frappe._('Documentation')+'</a></li> \
<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank"> \
<i class="icon-fixed-width icon-quote-left"></i> '+frappe._('Forum')+'</a></li> \
<li class="divider"></li> \
<li><a href="#" onclick="return frappe.ui.toolbar.clear_cache();">\
<i class="icon-fixed-width icon-refresh"></i> '
+frappe._('Clear Cache')+'</a></li>\
</ul>\
</li>');
if(has_common(user_roles,['Administrator','System Manager'])) {
$('#toolbar-tools').append('<li><a href="#" \
onclick="return frappe.ui.toolbar.download_backup();"><i class="icon-fixed-width icon-download"></i> '
+frappe._('Download Backup')+'</a></li>');
}
},
set_user_name: function() {
var fn = user_fullname;
if(fn.length > 15) fn = fn.substr(0,12) + '...';
$('#toolbar-user-link').html(fn + '<b class="caret"></b>');
$('#toolbar-user-name').html(fn);
},

make_logout: function() {
// logout
$('#toolbar-user').append('<li><a href="#" onclick="return frappe.app.logout();">\
<i class="icon-fixed-width icon-signout"></i> '+frappe._('Logout')+'</a></li>');
$('#toolbar-user').append('<li class="divider"></li><li><a href="/index">\
<i class="icon-fixed-width icon-globe"></i> '+frappe._('Switch to Portal')+'</a></li>');
make_user_menu: function() {
this.set_user_name();
$(repl('<li><a href="#%(user_form)s">\
<i class="icon-fixed-width icon-user"></i>%(my_settings)s</a></li>\
<li><a href="/index"> \
<i class="icon-fixed-width icon-globe"></i>%(website)s</a></li>\
<li class="divider"></li>\
<li><a href="#" onclick="return frappe.app.logout();"> \
<i class="icon-fixed-width icon-signout"></i>%(logout)s</a></li>', {
"logout": frappe._('Logout'),
"website": frappe._('Switch to Website'),
"user_form": encodeURIComponent("Form/User/"+user),
"my_settings": frappe._("My Settings")
})
).appendTo("#toolbar-user");
}

});

$.extend(frappe.ui.toolbar, {
@@ -179,7 +148,7 @@ $.extend(frappe.ui.toolbar, {
frappe.ui.toolbar.add_menu_divider(menu);
}

return $('<li class="custom-menu"><a><i class="'
return $('<li class="custom-menu"><a><i class="icon-fixed-width '
+icon+'"></i> '+label+'</a></li>')
.insertBefore(menu.find(".divider"))
.find("a")


+ 8
- 0
frappe/public/js/frappe/views/moduleview.js 查看文件

@@ -185,6 +185,11 @@ frappe.views.moduleview.ModuleView = Class.extend({
.on("click", function() {
if(item.route) {
frappe.set_route(item.route);
} else if(item.onclick) {
var fn = eval(item.onclick);
if(typeof(fn)==="function") {
fn();
}
} else if(item.type==="doctype") {
frappe.set_route("List", item.name)
}
@@ -197,7 +202,10 @@ frappe.views.moduleview.ModuleView = Class.extend({
} else {
frappe.set_route("Report", item.doctype, item.name);
}
} else {
return;
}
return false;
});
var show_count = (item.type==="doctype" || (item.type==="page" && item.doctype)) && !item.hide_count


Loading…
取消
儲存