Skip to content

Commit

Permalink
Merge pull request #113 from newpanjing/dev
Browse files Browse the repository at this point in the history
2.5
  • Loading branch information
newpanjing authored Jul 9, 2019
2 parents 1f8818e + 7ab993d commit 67e0313
Show file tree
Hide file tree
Showing 65 changed files with 436 additions and 100 deletions.
33 changes: 2 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Simple and friendly.
Django admin theme the simpleui
</p>
<p align="center">
<a href="https://github.com/newpanjing/simpleui/blob/master/LICENSE"><a href="https://opencollective.com/simpleui" alt="Financial Contributors on Open Collective"><img src="https://opencollective.com/simpleui/all/badge.svg?label=financial+contributors" /></a> <img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
<a href="https://github.com/newpanjing/simpleui/blob/master/LICENSE"><a href="https://opencollective.com/simpleui" alt="Financial Contributors on Open Collective"><img src="https://opencollective.com/simpleui/all/badge.svg?label=financial+contributors" /></a>
<a href="https://github.com/newpanjing/simpleui/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
 <a href="https://pypi.org/project/django-simpleui/#history"><img src="https://img.shields.io/pypi/v/django-simpleui.svg"></a>
<a href="https://python.org"><img src="https://img.shields.io/badge/python->=3.7.x-green.svg"></a>
<a href="https://pypi.org/project/django-simpleui/">
Expand Down Expand Up @@ -197,33 +198,3 @@ simpleui的发展离不开以下优秀贡献者的支持。如果您想为simple
|[@shouyong](https://github.com/shouyong)|bug修复|
|[@Roddy1219](https://github.com/Roddy1219)|bug修复|
|[@WalkerWang731](https://github.com/WalkerWang731)|优质代码贡献|
## Contributors
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/newpanjing/simpleui/graphs/contributors"><img src="https://opencollective.com/simpleui/contributors.svg?width=890&button=false" /></a>
### Financial Contributors
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/simpleui/contribute)]
#### Individuals
<a href="https://opencollective.com/simpleui"><img src="https://opencollective.com/simpleui/individuals.svg?width=890"></a>
#### Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/simpleui/contribute)]
<a href="https://opencollective.com/simpleui/organization/0/website"><img src="https://opencollective.com/simpleui/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/simpleui/organization/1/website"><img src="https://opencollective.com/simpleui/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/simpleui/organization/2/website"><img src="https://opencollective.com/simpleui/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/simpleui/organization/3/website"><img src="https://opencollective.com/simpleui/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/simpleui/organization/4/website"><img src="https://opencollective.com/simpleui/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/simpleui/organization/5/website"><img src="https://opencollective.com/simpleui/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/simpleui/organization/6/website"><img src="https://opencollective.com/simpleui/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/simpleui/organization/7/website"><img src="https://opencollective.com/simpleui/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/simpleui/organization/8/website"><img src="https://opencollective.com/simpleui/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/simpleui/organization/9/website"><img src="https://opencollective.com/simpleui/organization/9/avatar.svg"></a>
2 changes: 1 addition & 1 deletion simpleui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def get_version():
return '2.1.4.619'
return '2.5'
18 changes: 15 additions & 3 deletions simpleui/static/admin/simpleui-x/css/base.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion simpleui/static/admin/simpleui-x/css/base.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 26 additions & 8 deletions simpleui/static/admin/simpleui-x/css/base.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.simpleui-form-item {
display: inline-block;
width: auto;
margin-right: 10px;
}

#changelist #toolbar form input {
Expand Down Expand Up @@ -57,6 +58,9 @@ a:link, a:visited {

.object-tools {
margin-top: 0px;
position: absolute;
top: 10px;
right: 30px;
}

.vTextField {
Expand Down Expand Up @@ -158,22 +162,26 @@ body,
}

.object-tools {
top: 6px!important;
top: 6px !important;
margin: 0px;
}
.el-pagination__total{
display: block!important;

.el-pagination__total {
display: block !important;
}
.el-pagination__jump{
display: block!important;

.el-pagination__jump {
display: block !important;
margin: 0px;
margin-top: 10px;
}
.el-pager{

.el-pager {
margin: 0px;
padding: 0px;
}
.el-dialog{

.el-dialog {
width: 90%;
}

Expand All @@ -191,4 +199,14 @@ body,
#content {
padding: 0px !important;
}
}
}

#changelist .actions {
margin-right: auto;
position: relative;

.btn-group {
position: absolute;
right: 0px;
}
}
54 changes: 50 additions & 4 deletions simpleui/static/admin/simpleui-x/js/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
(function () {
if (window.frameElement) {
window.frameElement.contentWindow.parent.callback()
}

window.addEventListener('hashchange', function (e) {
// console.log(e)
// console.log('hash')
if (e.newURL != e.oldURL) {
openByHash()
}
});

function openByHash() {
var hash = location.hash;
hash = hash.substring(1)

for (var i = 0; i < app.menuData.length; i++) {
var item = app.menuData[i]
if ((item.url || '/') == hash) {
app.openTab(item, item.index)
break;
}
}
}

function changeUrl(data) {
location.href = '#' + (data.url || '/')
}

window.callback = function () {
window.location.reload()
}

var fontConfig = new Vue({
el: '#dynamicCss',
Expand Down Expand Up @@ -42,7 +74,8 @@
new Vue({
el: '#main',
data: {
searchInput:'',
isResize: false,
searchInput: '',
height: 1000,
fold: false,
zoom: false,
Expand Down Expand Up @@ -127,7 +160,8 @@
fontDialogVisible: false,
fontSlider: 12,
loading: false,
menuTextShow: true
menuTextShow: true,
menuData: []
},
watch: {
fold: function (newValue, oldValue) {
Expand Down Expand Up @@ -167,10 +201,11 @@
if (!self.small) {

self.menuTextShow = !(width < 800);
self.$nextTick(()=>{
self.fold= width < 800;
self.$nextTick(() => {
self.fold = width < 800;
})
}
self.isResize = true

//判断全屏状态
try {
Expand All @@ -181,12 +216,17 @@
}
window.app = this;


window.menus.forEach(item => {
item.icon = getIcon(item.name, item.icon);

if (item.models) {
item.models.forEach(mItem => {
mItem.icon = getIcon(mItem.name, mItem.icon);
self.menuData.push(mItem)
});
} else {
self.menuData.push(item)
}
});

Expand All @@ -206,6 +246,9 @@
}
}

if(location.hash!=''){
openByHash();
}
},
methods: {
reset: function () {
Expand Down Expand Up @@ -284,6 +327,7 @@
var index = item.index;
this.menuActive = index;
this.breadcrumbs = item.breadcrumbs;
changeUrl(item);
},
handleTabsEdit: function (targetName, action) {

Expand All @@ -297,6 +341,7 @@
next = temp.id;
self.menuActive = temp.index;
self.breadcrumbs = temp.breadcrumbs;
changeUrl(temp)
}
}
});
Expand Down Expand Up @@ -334,6 +379,7 @@
this.tabs.push(data);
this.tabModel = data.id;
}
changeUrl(data)

}
,
Expand Down
12 changes: 10 additions & 2 deletions simpleui/static/admin/simpleui-x/js/login.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
if (parent.callback) {
//如果是在子框架内就把首页刷新
parent.callback();
}
new Vue({
el: '.login-main',
data: {
username: '',
password: ''
password: '',
loading: false
},
methods: {
login: function () {
document.getElementById('login-form').submit();
this.loading = true
this.$nextTick(function () {
document.getElementById('login-form').submit();
});
}
}
})
7 changes: 7 additions & 0 deletions simpleui/static/admin/simpleui-x/theme/admin.lte.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion simpleui/static/admin/simpleui-x/theme/admin.lte.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions simpleui/static/admin/simpleui-x/theme/aircraft.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 67e0313

Please sign in to comment.