vieyahn2017 / pypy

python trial collections
1 stars 1 forks source link

8.9 Flask例子 pkyx #4

Closed vieyahn2017 closed 1 year ago

vieyahn2017 commented 6 years ago

https://github.com/tonnie17/pkyx

vieyahn2017 commented 6 years ago

base.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
  <meta name="description" content="提供比较搜索服务。通过pkyx,你可以清晰地查看物品的属性,或者通过比较更好地作出选择,更重要的是,你可以创建知识词条,方便自己和他人的使用,快向世界分享你的知识吧!" />
  <meta name="keywords" content="pkyx,pk一下,比较,compare,comparison,wiki"/>
  <meta name ="viewport" content ="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<!-- <link href="http://cdn.bootcss.com/semantic-ui/2.1.6/semantic.min.css" rel="stylesheet"> -->
  <link rel="stylesheet" href="{{ url_for('static', filename='semantic.min.css') }}">
  <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
  <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
    {% block head %}
    {% endblock %}
</head>
<body>
{% block content %}
{% endblock %}
<div class="ui page dimmer">
  <div class="content">
    <div class="center">
      <img class="ui image centered" src="http://7sbqim.com1.z0.glb.clouddn.com/pkyxlogo.png" alt="pkyx logo">
      <br>
        <p>pkyx是基于Flask开发的一个比较维基网站,中文译名为「PK一下」,灵感来自于VSChart。</p>
        <p>通过pkyx,你可以清晰地查看物品的属性,或者通过比较更好地作出选择,更重要的是,你可以创建知识词条,方便自己和他人的使用,快向世界分享你的知识吧!</p>
        <span>源码: <a style="color:#00b5ad;" href="https://github.com/tonnie17/pkyx">https://github.com/tonnie17/pkyx</a></span>
    </div>
  </div>
</div>
</body>
<!-- <script src="http://cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/semantic-ui/2.1.6/semantic.min.js"></script> -->
<script src="{{ url_for('static', filename='jquery.min.js') }}"></script>
<script src="{{ url_for('static', filename='semantic.min.js') }}"></script> 
<script>
    $(function(){
        $('.message .close').on('click', function() {
            $(this)
              .closest('.message')
              .transition('fade');
          });
        $('#what').on('click', function(){
          $('.dimmer').dimmer('show');
        });
    });
</script>
{% block js %}
{% endblock %}
</html>
vieyahn2017 commented 6 years ago

这个项目有那三个semantic jquery在线文件 https://github.com/devcronberg/personservice

vieyahn2017 commented 6 years ago

main-views.py 添加


import sys
defaultencoding = 'utf-8'
if sys.getdefaultencoding() != defaultencoding:
    reload(sys)
    sys.setdefaultencoding(defaultencoding)