Skip to content

Commit

Permalink
Merge pull request #204 from newpanjing/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
newpanjing authored Dec 19, 2019
2 parents eab6e41 + 107dba8 commit e0da6c5
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ simpleui 特点

☕️ Element-UI + Vue 加持,让古老的django admin 焕然一新。

🦀 新增支持Django3.0,Python3.8、Python3.9,敢于做第一个吃螃蟹的人。

# 开发初衷
Django Admin默认界面设计语言存在着的一些不足,比如色彩单一,大量线条的使用,分割化明显。将这些不足归类一下就是界面单调、雷同性明显、缺少惊喜。我们认为新的平台类视觉风格可以打破这些束缚,尝试一些新的探索,启发传统的设计认知,因此结合当下设计趋势,构思了Element+Django Admin的Simpleui。让Django Admin和Element产生完美的交互。配以最流行的后台设计风格,让Django Admin更加强大。

Expand Down
2 changes: 2 additions & 0 deletions doc/en/README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ simpleui Characteristics

☕️ `Element-UI` and `Vue` ,Let the `django admin` be better.

🦀 Add support for Django3.0 Python3.8, Python3.9, dares to do the first person to eat crab.

# Original intention of development
`Django Admin` default interface design language has some shortcomings, such as single color, the use of a large number of lines, and obvious segmentation. To classify these shortcomings is that the interface is monotonous, obvious similarity, and lack of surprises. We believe that the new platform-like visual style can break these constraints, try some new explorations, and inspire traditional design cognition, so combined with the current design trend, I have conceived `Element+Django Admin's` Simpleui. Let `Django Admin` and `Element` make the perfect interaction. With the most popular back-end design style, let `Django Admin` is even more powerful.

Expand Down
2 changes: 1 addition & 1 deletion simpleui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def get_version():
return '3.7'
return '3.8'
2 changes: 1 addition & 1 deletion simpleui/static/admin/simpleui-x/automatic/dicts.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var dicts = {
//银行
'fas fa-credit-card': ['银行卡', '银行', '信用卡', '储蓄卡'],
//ad
'fas fa-ad': ['宣传', '广告', 'banner', 'Banner', 'ad', 'Ad'],
'fas fa-ad': ['宣传', '广告', 'banner', 'Banner', 'ad', 'Ad', '横幅', '轮播'],
//hot
'fab fa-hotjar': ['热搜', '热度', '火焰'],
//info
Expand Down
2 changes: 1 addition & 1 deletion simpleui/static/admin/simpleui-x/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@
if (loading) {
data.loading = true;
this.loading = true;
}else{
} else {
data.loading = false;
this.loading = false;
}
Expand Down
3 changes: 1 addition & 2 deletions simpleui/templates/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@

{% home_page %}


{% if home %}
<span v-if="index==0" slot="label"><i
class="{{ icon }}"></i><span>{{ title }}</span>
Expand Down Expand Up @@ -376,7 +375,7 @@
<script type="text/javascript" src="{% static '/admin/simpleui-x/theme/theme.js' %}"></script>
<script type="text/javascript" src="{% static '/admin/simpleui-x/waves/waves.min.js' %}?_=2.0.5"></script>
{% block index_js %}
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/index.js' %}?_=3.4"></script>
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/index.js' %}?_=3.9"></script>
{% endblock %}
{% block autoupdate %}
{% if not "SIMPLEUI_STATIC_OFFLINE"|get_config %}
Expand Down
6 changes: 4 additions & 2 deletions simpleui/templates/admin/search_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@
<el-option label="{{ option.1 }}" value="{{ option.0 }}"></el-option>
{% endfor %}
{% else %}
<el-option label="True" value="True"></el-option>
<el-option label="False" value="False"></el-option>
{% get_boolean_choices as choices %}
{% for c in choices %}
<el-option label="{{ c.1 }}" value="{{ c.0 }}"></el-option>
{% endfor %}
{% endif %}
</el-select>

Expand Down
9 changes: 9 additions & 0 deletions simpleui/templatetags/simpletags.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
register = template.Library()

PY_VER = sys.version[0] # 2 or 3
from django.utils.translation import gettext_lazy as _

if PY_VER != '2':
from importlib import reload
Expand Down Expand Up @@ -477,3 +478,11 @@ def has_admindoc_page(context):
return context.template_name.find('admin_doc') == 0
else:
return False


@register.simple_tag
def get_boolean_choices():
return (
('True', _('Yes')),
('False', _('No'))
)

0 comments on commit e0da6c5

Please sign in to comment.