e.attachEvent.toString().indexOf("[native code")||ca?(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)):(S=!0,e.attachEvent("onreadystatechange",b.onScriptLoad));e.src=d;if(m.onNodeCreated)m.onNodeCreated(e,m,c,d);P=e;H?C.insertBefore(e,H):C.appendChild(e);P=null;return e}if(ja)try{setTimeout(function(){},
35 | 0),importScripts(d),b.completeLoad(c)}catch(q){b.onError(F("importscripts","importScripts failed for "+c+" at "+d,q,[c]))}};E&&!w.skipDataMain&&X(document.getElementsByTagName("script"),function(b){C||(C=b.parentNode);if(O=b.getAttribute("data-main"))return u=O,w.baseUrl||-1!==u.indexOf("!")||(I=u.split("/"),u=I.pop(),T=I.length?I.join("/")+"/":"./",w.baseUrl=T),u=u.replace(U,""),g.jsExtRegExp.test(u)&&(u=O),w.deps=w.deps?w.deps.concat(u):[u],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&
36 | (d=c,c=b,b=null);L(c)||(d=c,c=null);!c&&K(d)&&(c=[],d.length&&(d.toString().replace(qa,ka).replace(ra,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));S&&(e=P||pa())&&(b||(b=e.getAttribute("data-requiremodule")),g=J[e.getAttribute("data-requirecontext")]);g?(g.defQueue.push([b,c,d]),g.defQueueMap[b]=!0):V.push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(w)}})(this);
37 |
--------------------------------------------------------------------------------
/app/static/style/errors.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | color: #222;
4 | font: 16px/1.7 'Helvetica Neue', Helvetica, Arial, Sans-serif;
5 | background: #eff2f5;
6 | }
7 |
8 | img {
9 | border: none;
10 | }
11 |
12 | a {
13 | text-decoration: none;
14 | color: #105cb6;
15 | }
16 |
17 | a:hover {
18 | text-decoration: underline;
19 | }
20 |
21 | .error {
22 | margin: 169px auto 0;
23 | width: 404px;
24 | }
25 |
26 | .error-wide {
27 | width: 500px;
28 | }
29 |
30 | @media (max-width: 500px) {
31 | .error {
32 | width: 98%;
33 | }
34 | }
35 |
36 | .error .header {
37 | overflow: hidden;
38 | font-size: 1.8em;
39 | line-height: 1.2;
40 | margin: 0 0 .33em .33em;
41 | }
42 |
43 | .error .header img {
44 | vertical-align: text-bottom;
45 | }
46 |
47 | .error .header .mute {
48 | color: #999;
49 | font-size: .5em;
50 | }
51 |
52 | .error hr {
53 | margin: 1.3em 0;
54 | }
55 |
56 | .error p {
57 | margin: 0 0 1.7em;
58 | color: #999;
59 | }
60 |
61 | .error p:last-child {
62 | margin-bottom: 0;
63 | }
64 |
65 | .error strong {
66 | font-size: 1.1em;
67 | color: #000;
68 | }
69 |
70 | .error .content {
71 | padding: 2em 1.25em;
72 | border: 1px solid #babbbc;
73 | border-radius: 5px;
74 | background: #f7f7f7;
75 | text-align: center;
76 | }
77 |
78 | .error .content .single {
79 | margin: 3em 0;
80 | font-size: 1.1em;
81 | color: #666;
82 | }
--------------------------------------------------------------------------------
/app/static/style/mycss.css:
--------------------------------------------------------------------------------
1 |
2 | .container {
3 | width: auto;
4 | }
5 |
6 | .top-nav-dropdowntop-nav-dropdown-other{
7 | display: inline;
8 | }
9 |
10 |
11 | /*user_pages*/
12 | .App-main {
13 | display: block;
14 | }
15 |
16 | .ProfileHeader {
17 | position: relative;
18 | width: 1000px;
19 | padding: 0 16px;
20 | margin: 10px auto;
21 | }
22 |
23 | .Card:last-child {
24 | margin-bottom: 0;
25 | }
26 |
27 | .Card {
28 | margin-bottom: 10px;
29 | background: #fff;
30 | border: 1px solid #e7eaf1;
31 | border-radius: 2px;
32 | box-shadow: 0 1px 3px rgba(0,37,55,.05);
33 | box-sizing: border-box;
34 | }
35 |
36 | .ProfileHeader-userCover {
37 | width: 100%;
38 | }
39 |
40 | .UserCoverEditor {
41 | position: relative;
42 | }
43 |
44 | .UserCover {
45 | position: relative;
46 | height: 240px;
47 | overflow: hidden;
48 | background: #f7f8fa;
49 | border-top-right-radius: 1px;
50 | border-top-left-radius: 1px;
51 | -webkit-transition: height .3s;
52 | transition: height .3s;
53 | }
54 |
55 | .UserCover-image, .UserCover-image img {
56 | width: 100%;
57 | height: 100%;
58 | -o-object-fit: cover;
59 | object-fit: cover;
60 | }
61 |
62 | .UserCover-image {
63 | -webkit-transition: -webkit-transform 6s ease-out;
64 | transition: -webkit-transform 6s ease-out;
65 | transition: transform 6s ease-out;
66 | transition: transform 6s ease-out,-webkit-transform 6s ease-out;
67 | }
68 |
69 | .ProfileHeader-wrapper {
70 | position: relative;
71 | width: 100%;
72 | background: #fff;
73 | box-sizing: border-box;
74 | }
75 |
76 | .ProfileHeader-main {
77 | position: relative;
78 | margin: 0 20px 24px;
79 | }
80 |
81 | .ProfileHeader-content {
82 | padding-top: 16px;
83 | padding-left: 32px;
84 | border-left: 164px solid transparent;
85 | }
86 |
87 | .ProfileHeader-contentHead {
88 | position: relative;
89 | padding-right: 106px;
90 | margin-bottom: 16px;
91 | }
92 |
93 | .ProfileHeader-title {
94 | -webkit-box-flex: 1;
95 | -ms-flex: 1;
96 | flex: 1;
97 | overflow: hidden;
98 | text-overflow: ellipsis;
99 | white-space: nowrap;
100 | }
101 |
102 | h1, h2, h3 {
103 | margin: 0;
104 | font: inherit;
105 | }
106 |
107 | h1 {
108 | display: block;
109 | font-size: 2em;
110 | -webkit-margin-before: 0.67em;
111 | -webkit-margin-after: 0.67em;
112 | -webkit-margin-start: 0px;
113 | -webkit-margin-end: 0px;
114 | font-weight: bold;
115 | }
116 |
117 | .ProfileHeader-contentBody {
118 | position: relative;
119 | width: 524px;
120 | overflow: hidden;
121 | -webkit-transition: height .3s;
122 | transition: height .3s;
123 | }
124 |
125 | .ProfileHeader-detail {
126 | width: 100%;
127 | font-size: 14px;
128 | line-height: 1.8;
129 | color: #262626;
130 | }
131 |
132 | .ProfileHeader-detailItem {
133 | display: -webkit-box;
134 | display: -ms-flexbox;
135 | display: flex;
136 | margin-bottom: 18px;
137 | }
138 |
139 | .ProfileHeader-detailLabel {
140 | width: 60px;
141 | margin-right: 37px;
142 | font-weight: 500;
143 | }
144 |
145 | .ProfileHeader-detailValue {
146 | -webkit-box-flex: 1;
147 | -ms-flex: 1;
148 | flex: 1;
149 | overflow: hidden;
150 | }
151 |
152 | .ProfileHeader-contentFooter {
153 | position: relative;
154 | padding-top: 8px;
155 | }
156 |
157 | .ProfileHeader-buttons {
158 | position: absolute;
159 | right: 0;
160 | bottom: 0;
161 | }
162 |
163 | .Button--blue {
164 | color: #0f88eb;
165 | border: 1px solid #0f88eb;
166 | }
167 |
168 | .Button {
169 | display: inline-block;
170 | /*padding: 0 16px;*/
171 | font-size: 14px;
172 | line-height: 32px;
173 | color: #8590a6;
174 | text-align: center;
175 | cursor: pointer;
176 | border: 1px solid #ccd8e1;
177 | border-radius: 3px;
178 | background: none;
179 | }
180 |
181 | .top-nav-profile-login {
182 | float: right;
183 | position: relative;
184 | min-width: 120px;
185 | margin-left: 15px;
186 | z-index: 10;
187 | }
188 |
189 | .top-nav-profile-login a{
190 | color: #f4f4f4;
191 | }
192 |
193 | .Profile-main {
194 | display: -webkit-box;
195 | display: -ms-flexbox;
196 | display: flex;
197 | width: 1000px;
198 | min-height: 100vh;
199 | padding: 0 16px;
200 | margin: 10px auto;
201 | -webkit-box-pack: justify;
202 | -ms-flex-pack: justify;
203 | justify-content: space-between;
204 | -webkit-box-align: start;
205 | -ms-flex-align: start;
206 | align-items: flex-start;
207 | }
208 |
209 | .Profile-mainColumn {
210 | width: 694px;
211 | }
212 |
213 | .Profile-sideColumn {
214 | width: 296px;
215 | color: #555;
216 | }
217 |
218 | .FollowshipCard {
219 | font-size: 14px;
220 | }
221 |
222 | .Card {
223 | margin-bottom: 10px;
224 | background: #fff;
225 | border: 1px solid #e7eaf1;
226 | border-radius: 2px;
227 | box-shadow: 0 1px 3px rgba(0,37,55,.05);
228 | box-sizing: border-box;
229 | }
230 |
231 | .NumberBoard {
232 | display: -webkit-box;
233 | display: -ms-flexbox;
234 | display: flex;
235 | -webkit-box-align: center;
236 | -ms-flex-align: center;
237 | align-items: center;
238 | text-align: center;
239 | }
240 |
241 | .NumberBoard {
242 | display: -webkit-box;
243 | display: -ms-flexbox;
244 | display: flex;
245 | -webkit-box-align: center;
246 | -ms-flex-align: center;
247 | align-items: center;
248 | text-align: center;
249 | }
250 |
251 | .FollowshipCard {
252 | font-size: 14px;
253 | }
254 |
255 | .Profile-sideColumn {
256 | width: 296px;
257 | color: #555;
258 | }
259 |
260 | .FollowshipCard-counts .NumberBoard-item {
261 | padding: 16px 0;
262 | }
263 |
264 | .NumberBoard-item {
265 | -webkit-box-flex: 1;
266 | -ms-flex: 1;
267 | flex: 1;
268 | }
269 |
270 | .Button--link, .Button--plain {
271 | height: auto;
272 | padding: 0;
273 | line-height: inherit;
274 | background-color: transparent;
275 | border: none;
276 | border-radius: 0;
277 | }
278 |
279 | .NumberBoard-name {
280 | font-size: 14px;
281 | line-height: 20px;
282 | color: #8590a6;
283 | }
284 |
285 | .NumberBoard-value {
286 | margin-top: 4px;
287 | font-size: 18px;
288 | font-weight: 500;
289 | line-height: 24px;
290 | color: #262626;
291 | }
292 |
293 | .ProfileHeader-contentFooter {
294 | position: relative;
295 | padding-top: 8px;
296 | }
297 |
298 | .ProfileHeader-expandButton {
299 | line-height: 1;
300 | }
301 |
302 | .ProfileHeader-buttons {
303 | position: absolute;
304 | right: 0;
305 | bottom: 0;
306 | }
307 |
308 | .Button--primary.Button--blue, .Button--primary.Button--blue:disabled {
309 | background: #0f88eb;
310 | }
311 | .Button--primary.Button--blue {
312 | color: #fff;
313 | }
314 | .FollowButton {
315 | width: 96px;
316 | }
317 |
318 | .Button--primary.Button--grey, .Button--primary.Button--grey:disabled {
319 | background: #c3ccd9;
320 | border: 1px solid #c3ccd9;
321 | }
322 | .Button--primary.Button--grey {
323 | color: #fff;
324 | }
325 |
326 | /*个人资料动态、关注等的配置*/
327 | .Card:last-child {
328 | margin-bottom: 0;
329 | }
330 | .Card {
331 | margin-bottom: 10px;
332 | background: #fff;
333 | border: 1px solid #e7eaf1;
334 | border-radius: 2px;
335 | box-shadow: 0 1px 3px rgba(0,37,55,.05);
336 | box-sizing: border-box;
337 | }
338 |
339 | .ProfileMain-tabs {
340 | -webkit-box-flex: 1;
341 | -ms-flex: 1;
342 | flex: 1;
343 | }
344 |
345 | .Tabs {
346 | border-bottom: 1px solid #f0f2f7;
347 | }
348 |
349 | ol, ul {
350 | padding: 0;
351 | margin: 0;
352 | }
353 |
354 | ul, menu, dir {
355 | display: block;
356 | list-style-type: disc;
357 | -webkit-margin-before: 1em;
358 | -webkit-margin-after: 1em;
359 | -webkit-margin-start: 0px;
360 | -webkit-margin-end: 0px;
361 | -webkit-padding-start: 40px;
362 | }
363 |
364 | .Tabs-item {
365 | display: inline-block;
366 | padding: 0 20px;
367 | }
368 | li {
369 | list-style-type: none;
370 | }
371 |
372 | li {
373 | display: list-item;
374 | text-align: -webkit-match-parent;
375 | }
376 |
377 | body:not(.Body--isAppleDevice) .ProfileMain-tabs .is-active {
378 | font-weight: 700;
379 | }
380 | .Tabs-link.is-active {
381 | font-weight: 500;
382 | color: #333;
383 | }
384 |
385 | .Tabs-link {
386 | position: relative;
387 | display: inline-block;
388 | padding: 14px 0;
389 | font-size: 16px;
390 | line-height: 22px;
391 | color: #2e2e2e;
392 | text-align: center;
393 | }
394 |
395 | a {
396 | color: inherit;
397 | text-decoration: none;
398 | }
399 |
400 |
401 | /*关注者与被关注者样式*/
402 | .Card:last-child {
403 | margin-bottom: 0;
404 | }
405 | .Card {
406 | margin-bottom: 10px;
407 | background: #fff;
408 | border: 1px solid #e7eaf1;
409 | border-radius: 2px;
410 | box-shadow: 0 1px 3px rgba(0,37,55,.05);
411 | box-sizing: border-box;
412 | }
413 | .List-item {
414 | position: relative;
415 | padding: 16px 20px;
416 | font-size: 14px;
417 | }
418 |
419 | .ContentItem-main {
420 | display: -webkit-box;
421 | display: -ms-flexbox;
422 | /*display: flex;*/
423 | }
424 | .ContentItem-image {
425 | float: left;
426 | margin-right: 20px;
427 | }
428 | avatar .Popover {
429 | display: block;
430 | }
431 |
432 | .Popover {
433 | position: relative;
434 | display: inline-block;
435 | }
436 |
437 | .UserItem-avatar .Avatar, .UserItem-avatar .Popover {
438 | display: block;
439 | }
440 | .Avatar--large {
441 | border-radius: 4px;
442 | }
443 | .Avatar {
444 | background: #fff;
445 | border-radius: 2px;
446 | }
447 |
448 | .UserAvatar .Avatar{
449 | width: 160px;
450 | height: 160px;
451 | }
452 | img {
453 | width: 60px;
454 | height: 60px;
455 | }
456 | .ContentItem-head {
457 | -webkit-box-flex: 1;
458 | -ms-flex: 1;
459 | flex: 1;
460 | overflow: hidden;
461 | }
462 | .ContentItem-title {
463 | font-size: 18px;
464 | font-weight: 700;
465 | line-height: 1.6;
466 | color: #1e1e1e;
467 | margin-top: -5px;
468 | margin-bottom: -5px;
469 | }
470 |
471 | .UserItem-name, .UserItem-name .UserLink-badge, .UserItem-title {
472 | display: -webkit-box;
473 | display: -ms-flexbox;
474 | display: flex;
475 | }
476 |
477 | .UserItem-title {
478 | -webkit-box-align: center;
479 | -ms-flex-align: center;
480 | align-items: center;
481 | }
482 |
483 | .List-item:not(:last-child):after {
484 | position: absolute;
485 | bottom: 0;
486 | display: block;
487 | width: calc(100% - 32px);
488 | border-bottom: 1px solid #f0f2f7;
489 | content: "";
490 | }
491 |
492 | .Popover {
493 | position: relative;
494 | display: inline-block;
495 | }
496 |
497 | .ContentItem-status {
498 | margin-top: 5px;
499 | color: #8590a6;
500 | font-size: 14px;
501 | }
502 |
503 | Inherited from div.ContentItem-meta
504 | .ContentItem-meta {
505 | font-size: 15px;
506 | color: #555;
507 | }
508 |
509 | .ContentItem-statusItem:not(:first-child):before {
510 | margin: 0 5px;
511 | content: "\B7";
512 | }
513 |
514 |
515 | .pagination>li {
516 | display: inline;
517 | }
518 | li {
519 | display: list-item;
520 | text-align: -webkit-match-parent;
521 | }
522 |
523 | li {
524 | list-style-type: none;
525 | }
526 |
527 | .pagination>li:first-child>a, .pagination>li:first-child>span {
528 | margin-left: 0;
529 | border-top-left-radius: 4px;
530 | border-bottom-left-radius: 4px;
531 | }
532 | .pagination>.disabled>a, .pagination>.disabled>a:focus, .pagination>.disabled>a:hover, .pagination>.disabled>span, .pagination>.disabled>span:focus, .pagination>.disabled>span:hover {
533 | color: #777;
534 | cursor: not-allowed;
535 | background-color: #fff;
536 | border-color: #ddd;
537 | }
538 | .pagination>li>a, .pagination>li>span {
539 | position: relative;
540 | float: left;
541 | padding: 6px 12px;
542 | margin-left: -1px;
543 | line-height: 1.42857143;
544 | color: #337ab7;
545 | text-decoration: none;
546 | background-color: #fff;
547 | border: 1px solid #ddd;
548 | }
549 | .pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover {
550 | z-index: 3;
551 | color: #fff;
552 | cursor: default;
553 | background-color: #337ab7;
554 | border-color: #337ab7;
555 | }
556 | .pagination>li>a, .pagination>li>span {
557 | position: relative;
558 | float: left;
559 | padding: 6px 12px;
560 | margin-left: -1px;
561 | line-height: 1.42857143;
562 | color: #337ab7;
563 | text-decoration: none;
564 | background-color: #fff;
565 | border: 1px solid #ddd;
566 | }
567 |
568 |
569 | /*修改头像*/
570 | .ProfileHeader-avatar {
571 | position: absolute;
572 | top: -25px;
573 | left: 0;
574 | z-index: 4;
575 | }
576 | .UserAvatarEditor {
577 | cursor: pointer;
578 | }
579 | .UserAvatar, .UserAvatar-inner {
580 | vertical-align: top;
581 | }
582 | .UserAvatar {
583 | display: inline-block;
584 | overflow: hidden;
585 | border: 4px solid #fff;
586 | border-radius: 8px;
587 | }
588 | .UserAvatar, .UserAvatar-inner {
589 | vertical-align: top;
590 | }
591 | .Avatar--large {
592 | border-radius: 4px;
593 | }
594 |
595 | .Avatar {
596 | background: #fff;
597 | border-radius: 2px;
598 | }
599 | img {
600 | width: 160px;
601 | height: 160px;
602 | }
603 | .Mask-hidden {
604 | pointer-events: none;
605 | opacity: 0;
606 | }
607 |
608 | .Mask {
609 | position: absolute;
610 | top: 0;
611 | right: 0;
612 | bottom: 0;
613 | left: 0;
614 | z-index: 1;
615 | -webkit-transition: opacity .2s ease-in;
616 | transition: opacity .2s ease-in;
617 | }
618 | .UserAvatarEditor-maskInner {
619 | z-index: 4;
620 | border: 4px solid #fff;
621 | border-radius: 8px;
622 | }
623 | .Mask-mask--black {
624 | background: #000;
625 | }
626 |
627 | .Mask-mask {
628 | position: absolute;
629 | z-index: -1;
630 | width: 100%;
631 | height: 100%;
632 | opacity: .4;
633 | box-sizing: border-box;
634 | }
635 |
636 | .Mask-content {
637 | position: absolute;
638 | top: 50%;
639 | left: 50%;
640 | z-index: 5;
641 | color: #fff;
642 | text-align: center;
643 | -webkit-transform: translate(-50%,-50%);
644 | transform: translate(-50%,-50%);
645 | }
646 | .UserAvatarEditor-cameraIcon {
647 | margin-bottom: 14px;
648 | fill: #fff;
649 | }
650 | .Icon {
651 | vertical-align: text-bottom;
652 | fill: #9fadc7;
653 | }
654 |
655 | html|* > svg {
656 | transform-origin: 50% 50% 0px;
657 | }
658 |
659 | svg:not(:root), symbol, image, marker, pattern, foreignObject {
660 | overflow: hidden;
661 | }
662 |
663 | * {
664 | transform-origin: 0px 0px 0px;
665 | }
666 | input[type="file" ] {
667 | align-items: baseline;
668 | color: inherit;
669 | text-align: start;
670 | }
671 |
672 | input[type="hidden" ], input[type="image" ], input[type="file" ] {
673 | -webkit-appearance: initial;
674 | background-color: initial;
675 | padding: initial;
676 | border: initial;
677 | }
678 |
679 | input {
680 | /*-webkit-appearance: textfield;*/
681 | background-color: white;
682 | border-image-source: initial;
683 | border-image-slice: initial;
684 | border-image-width: initial;
685 | border-image-outset: initial;
686 | border-image-repeat: initial;
687 | -webkit-rtl-ordering: logical;
688 | -webkit-user-select: text;
689 | cursor: auto;
690 | padding: 1px;
691 | border-width: 2px;
692 | border-style: inset;
693 | border-color: initial;
694 | }
695 |
696 | input, textarea, keygen, select, button {
697 | text-rendering: auto;
698 | color: initial;
699 | letter-spacing: normal;
700 | word-spacing: normal;
701 | text-transform: none;
702 | text-indent: 0px;
703 | text-shadow: none;
704 | display: inline-block;
705 | text-align: start;
706 | margin: 0em 0em 0em 0em;
707 | font: 13.3333px Arial;
708 | }
709 |
710 | input, textarea, keygen, select, button, meter, progress {
711 | -webkit-writing-mode: horizontal-tb;
712 | }
713 |
714 | .zu-top-nav-userinfo .Avatar {
715 | position: absolute;
716 | top: 9px;
717 | left: 10px;
718 | border: 1px solid rgba(0,0,0,.1);
719 | box-shadow: 0 1px 0 rgba(255,255,255,.1);
720 | background-color: transparent;
721 | }
722 |
723 | .UserLink-link .Avatar{
724 | width: 60px;
725 | height: 60px;
726 | }
727 | .topic-pages .topic-avatar .zm-entry-head-avatar-link, .topic-feed-page .topic-avatar .zm-entry-head-avatar-link {
728 | display: block;
729 | position: relative;
730 | width: 50px;
731 | height: 50px;
732 | }
733 | .topic-pages .topic-avatar .zm-entry-head-avatar-link img.zm-avatar-editor-preview, .topic-feed-page .topic-avatar .zm-entry-head-avatar-link img.zm-avatar-editor-preview {
734 | width: 50px;
735 | height: 50px;
736 | border-radius: 4px;
737 | }
738 |
739 | .topic-info .topic-name, .topic-info .topic-name {
740 | margin: 0 0 8px 65px;
741 | }
742 |
743 | .zm-topic-list-container .feed-main, .zm-topic-list-container .feed-main {
744 | margin-left: 0;
745 | }
746 | .feed-switcher, .feed-switcher {
747 | text-align: right;
748 | padding: 10px 0;
749 | color: #999;
750 | font-size: 12px;
751 | }
752 |
753 | .topic-info .zm-topic-topbar-nav {
754 | margin-left: 65px;
755 | }
756 | .zm-topic-topbar {
757 | margin-top: 4px;
758 | }
759 |
--------------------------------------------------------------------------------
/app/static/style/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | margin: 0;
3 | padding: 0;
4 | }
5 | .wrap {
6 | margin: 0 auto;
7 | }
8 | .wrap li {
9 | list-style: none;
10 | margin: 20px 0;
11 | padding: 20px 80px 30px 20px;
12 | color: #666;
13 | line-height: 2;
14 | border: 1px solid #81baeb;
15 | box-shadow: 5px 6px 5px #ccc;
16 | position: relative;
17 | }
18 | .content {
19 | text-indent: 2em;
20 | }
21 | .content p {
22 | margin-bottom: 15px;
23 | }
24 | .sign {
25 | font-size: 12px;
26 | padding: 1px 5px;
27 | position: absolute;
28 | bottom: 10px;
29 | right: 20px;
30 | text-align: center;
31 | -webkit-border-radius: 4px;
32 | -moz-border-radius: 4px;
33 | border-radius: 4px;
34 | color: #0c5897;
35 | background-color: #eff6fa;
36 | cursor: pointer;
37 | }
38 | .fold-fix {
39 | color: #fff;
40 | background-color: #81baeb;
41 | position: fixed;
42 | }
43 | h2 {
44 | font-size: 26px;
45 | line-height: 2.5;
46 | }
47 |
48 | .topic-title .Avatar {
49 | width: 40px;
50 | height: 40px;
51 | margin-right: 16px;
52 | }
53 |
54 | .topic-title .topic-title-name {
55 | color: #555;
56 | font-weight: 700;
57 | font-size: 14px;
58 | max-width: 40%;
59 | word-wrap: normal;
60 | white-space: nowrap;
61 | overflow: hidden;
62 | text-overflow: ellipsis;
63 | }
64 | .topic-title {
65 | padding-top: 15px;
66 | line-height: 40px;
67 | margin-bottom: 16px;
68 | }
69 |
--------------------------------------------------------------------------------
/app/templates/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 者也
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
22 |
23 | 你似乎来到了没有知识存在的荒原...
24 |
25 |
来源链接是否正确?用户、话题或问题是否存在?
26 |
27 |
28 | 返回首页
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/templates/500.html:
--------------------------------------------------------------------------------
1 | 服务器出错
--------------------------------------------------------------------------------
/app/templates/_macros.html:
--------------------------------------------------------------------------------
1 | {% macro pagination_widget(pagination, endpoint) %}
2 |
30 | {% endmacro %}
31 |
--------------------------------------------------------------------------------
/app/templates/alluser_follow_question.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block title %}关注[{{question.question_name}}]问题的人-者也{% endblock %}
3 | {% block head %}
4 | {{super()}}
5 |
45 | {% endblock %}
46 | {% block body %}
47 |
48 |
49 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | {% for topic_follow in question.follow_questions %}
60 |
98 | {% endfor %}
99 |
100 | {% endblock %}
101 |
--------------------------------------------------------------------------------
/app/templates/alluser_follow_topic.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block title %}关注[{{topic.topic_name}}]话题的人-者也{% endblock %}
3 | {% block head %}
4 | {{super()}}
5 |
45 | {% endblock %}
46 | {% block body %}
47 |
55 |
56 |
57 |
{{topic.topic_name}}
58 |
59 |
66 |
67 |
68 |
69 | {% for topic_follow in topic.follow_topics.all() %}
70 |
108 | {% endfor %}
109 |
110 | {% endblock %}
111 |
112 | {% block page_sidebar %}
113 |
114 |
143 |
144 |
145 |
146 |
描述
147 |
148 |
150 |
151 |
{{topic.topic_name}} {{topic.topic_desc
152 | or ""}}
153 |
154 |
155 |
156 |
157 |
158 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/answer_questions.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block title %}回答问题-者也{% endblock %}
3 | {% block body %}
4 |
5 |
推荐以下问题
6 |
7 |
8 |
9 |
10 | {% for topic in topics %}
11 | {% for question in topic.topic.question_topic %}
12 |
13 |
15 |
18 |
19 | {{question.question.answers.count()}} 个回答
20 | •
21 | {{question.question.follow_questions.count()}} 人关注
22 |
23 |
24 | {% endfor %}
25 | {% endfor %}
26 |
27 |
28 | {% endblock %}
29 |
30 | {% block page_sidebar %}
31 |
47 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/auth/add_category.html:
--------------------------------------------------------------------------------
1 | {% extends "auth/admin_base.html" %}
2 | {% import "bootstrap/wtf.html" as wtf %}
3 |
4 | {% block title %}添加话题类别{% endblock %}
5 |
6 | {% block page_content %}
7 |
10 |
11 | {{ wtf.quick_form(form) }}
12 |
13 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/auth/add_topic.html:
--------------------------------------------------------------------------------
1 | {% extends "auth/admin_base.html" %}
2 | {% import "bootstrap/wtf.html" as wtf %}
3 |
4 | {% block title %}添加话题{% endblock %}
5 |
6 | {% block page_content %}
7 |
10 |
31 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/auth/admin_base.html:
--------------------------------------------------------------------------------
1 | {% extends "bootstrap/base.html" %}
2 |
3 | {% block title %}者也后台管理{% endblock %}
4 |
5 | {% block head %}
6 | {{ super() }}
7 |
8 |
9 |
10 | {% endblock %}
11 |
12 | {% block navbar %}
13 |
14 |
15 |
24 |
25 |
32 |
33 | {% if current_user.is_authenticated %}
34 | 登出
35 | {% else %}
36 | >登入
37 | {% endif %}
38 |
39 |
40 |
41 |
42 | {% endblock %}
43 |
44 | {% block content %}
45 |
46 | {% for message in get_flashed_messages() %}
47 |
48 | ×
49 | {{ message }}
50 |
51 | {% endfor %}
52 |
53 | {% block page_content %}{% endblock %}
54 |
55 | {% endblock %}
56 |
--------------------------------------------------------------------------------
/app/templates/auth/admin_edit_profile.html:
--------------------------------------------------------------------------------
1 | {% extends "auth/admin_base.html" %}
2 | {% import "bootstrap/wtf.html" as wtf %}
3 |
4 |
5 | {% block page_content %}
6 |
9 |
10 | {{ wtf.quick_form(form) }}
11 |
12 | {% endblock %}
13 | s
--------------------------------------------------------------------------------
/app/templates/auth/admin_index.html:
--------------------------------------------------------------------------------
1 | {% extends "auth/admin_base.html" %}
2 |
--------------------------------------------------------------------------------
/app/templates/auth/email/change_email.html:
--------------------------------------------------------------------------------
1 | Dear {{ user.username }},
2 | To confirm your new email address click here .
3 | Alternatively, you can paste the following link in your browser's address bar:
4 | {{ url_for('auth.change_email', token=token, _external=True) }}
5 | Sincerely,
6 |
--------------------------------------------------------------------------------
/app/templates/auth/email/change_email.txt:
--------------------------------------------------------------------------------
1 | Dear {{ user.username }},
2 |
3 | To confirm your new email address click on the following link:
4 |
5 | {{ url_for('auth.change_email', token=token, _external=True) }}
6 |
7 | Sincerely,
8 |
9 |
--------------------------------------------------------------------------------
/app/templates/auth/email/confirm.html:
--------------------------------------------------------------------------------
1 | Dear {{ user.username }},
2 | To confirm your account please click here .
3 | Alternatively, you can paste the following link in your browser's address bar:
4 | {{ url_for('auth.confirm', token=token, _external=True) }}
5 | Sincerely,
6 |
--------------------------------------------------------------------------------
/app/templates/auth/email/confirm.txt:
--------------------------------------------------------------------------------
1 | Dear {{ user.username }},
2 |
3 |
4 | To confirm your account please click on the following link:
5 |
6 | {{ url_for('auth.confirm', token=token, _external=True) }}
7 |
8 | Sincerely,
9 |
10 |
11 | Note: replies to this email address are not monitored.
12 |
--------------------------------------------------------------------------------
/app/templates/auth/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 者也 - 与世界分享你的知识、经验和见解
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | {% import "bootstrap/wtf.html" as wtf %}
24 |
25 |
26 |
27 |
28 |
29 |
35 |
36 | {% for message in get_flashed_messages() %}
37 |
38 | ×
39 | {{ message }}
40 |
41 | {% endfor %}
42 |
43 |
44 |
45 |
46 |
54 |
55 |
56 |
57 |
58 | {{ wtf.quick_form(form1) }}
59 |
60 |
61 |
62 |
63 |
64 | {{ wtf.quick_form(form2) }}
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/app/templates/auth/manage_category.html:
--------------------------------------------------------------------------------
1 | {% extends "auth/admin_base.html" %}
2 | {% import "_macros.html" as macros %}
3 | {% block title %}管理话题类别{% endblock %}
4 | {% block head %}
5 | {{super()}}
6 |
17 | {% endblock %}
18 | {% block page_content %}
19 |
20 | 类别 描述 操作
21 | {% for cate in items %}
22 |
23 |
24 | {{cate.category_name}}
25 |
26 | {{cate.category_desc}}
27 | 删除
28 |
29 | {% endfor %}
30 |
31 |
34 | {% endblock %}
35 |
--------------------------------------------------------------------------------
/app/templates/auth/manage_topic.html:
--------------------------------------------------------------------------------
1 | {% extends "auth/admin_base.html" %}
2 | {% import "_macros.html" as macros %}
3 | {% block title %}管理话题类别{% endblock %}
4 | {% block head %}
5 | {{super()}}
6 |
17 | {% endblock %}
18 | {% block page_content %}
19 |
20 | 话题 描述 操作
21 | {% for topic in items %}
22 |
23 |
24 | {{topic.topic_name}}
25 |
26 | {{topic.topic_desc}}
27 | 删除
28 |
29 | {% endfor %}
30 |
31 |
34 | {% endblock %}
35 |
--------------------------------------------------------------------------------
/app/templates/auth/manage_users.html:
--------------------------------------------------------------------------------
1 | {% extends "auth/admin_base.html" %}
2 | {% block title %}管理用户{% endblock %}
3 | {% block page_content %}
4 |
5 | 用户名 邮箱 操作
6 | {% for user in users %}
7 |
8 |
9 | {{user.username}}
10 |
11 | {{user.email}}
12 | 设置
13 |
14 | {% endfor %}
15 |
16 | {% endblock %}
17 |
--------------------------------------------------------------------------------
/app/templates/auth/unconfirmed.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 |
3 | {% block title %}邮箱验证{% endblock %}
4 |
5 | {% block page_content %}
6 |
20 | {% endblock %}
21 |
--------------------------------------------------------------------------------
/app/templates/base_user.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 |
3 | {% block title %}{{user.name}}-者也{% endblock %}
4 | {% block head %}
5 |
6 | {{super()}}
7 |
92 |
93 | {% endblock %}
94 | {% block page_content %}
95 |
96 |
248 |
249 |
250 |
251 |
252 | {% block person_data %}
253 | {% endblock %}
254 |
255 |
272 |
273 |
274 |
275 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/edit_profile.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block head %}
3 | {{ super()}}
4 |
5 | {% endblock %}
6 | {% import "bootstrap/wtf.html" as wtf %}
7 | {% block title %}{{user.username}}{% endblock %}
8 | {% block page_content %}
9 |
10 |
23 |
24 |
25 |
26 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/email_settings.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block title %}邮箱设置{% endblock %}
3 | {% block head %}
4 | {{super()}}
5 |
6 | {% endblock %}
7 | {% block body %}
8 | {% import "bootstrap/wtf.html" as wtf %}
9 |
10 |
11 |
19 |
20 | {{wtf.quick_form(form)}}
21 |
22 |
23 |
24 |
25 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/explore.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block navi_color %}
3 |
4 | 首页
6 |
7 |
8 |
9 |
10 | 话题
11 |
12 |
13 |
14 | 发现
15 |
16 |
17 |
18 | 消息
20 |
21 | {% endblock %}
22 | {% block head %}
23 | {{super()}}
24 |
25 |
26 |
28 |
29 | {% endblock %}
30 |
31 | {% block body %}
32 |
33 |
34 |
35 |
36 | 编辑推荐
37 |
38 |
42 |
43 |
44 |
45 | {% for question_answer in questions_excellans %}
46 |
47 |
48 |
49 |
54 | {% if question_answer[1] %}
55 |
83 | {% endif %}
84 |
196 |
197 |
198 |
199 | {% endfor %}
200 |
201 |
202 |
203 |
204 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/password_settings.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block title %}密码设置{% endblock %}
3 | {% block head %}
4 | {{super()}}
5 |
6 |
7 | {% endblock %}
8 | {% block body %}
9 | {% import "bootstrap/wtf.html" as wtf %}
10 |
11 |
12 |
21 |
22 | {{ wtf.quick_form(form) }}
23 |
24 |
25 |
26 |
27 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/question_follow_all.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block title %}我关注的问题-者也{% endblock %}
3 | {% block head %}
4 | {{super()}}
5 | {% endblock %}
6 | {% block body %}
7 |
8 |
我关注的问题
9 |
10 |
11 |
12 | {% for question in questions %}
13 |
14 |
15 | {{question.question.views}}
16 | 浏览
17 |
18 |
39 |
40 | {% endfor %}
41 |
42 |
43 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/topic.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block title %}话题动态-者也{% endblock %}
3 | {% block navi_color %}
4 |
5 | 首页
7 |
8 |
9 |
10 |
11 | 话题
12 |
13 |
14 |
15 | 发现
16 |
17 |
18 |
19 | 消息
21 |
22 | {% endblock %}
23 | {% block head %}
24 | {{super()}}
25 |
26 |
27 |
29 | {% endblock %}
30 |
31 | {% block page_content %}
32 |
39 |
40 | {% for topic in topics %}
41 | {% if topic.topic.id == topic_selete.id %}
42 | {{topic.topic.topic_name}}
43 |
44 | {% else %}
45 | {{topic.topic.topic_name}}
47 | {% endif %}
48 | {% endfor %}
49 |
50 |
51 | {% if topic_selete %}
52 |
68 |
69 |
70 |
71 |
72 | {% for question_answer in topic_selete.questions_excellans() %}
73 |
74 |
75 |
76 |
81 | {% if question_answer[1] %}
82 |
110 | {% endif %}
111 |
220 |
221 |
222 |
223 | {% endfor %}
224 |
225 |
226 | {% endif %}
227 |
228 | {% endblock %}
229 |
230 | {% block page_sidebar %}
231 |
241 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/topic_detail.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block head %}
3 | {{super()}}
4 |
5 |
6 |
8 |
9 | {% endblock %}
10 |
11 | {% block body %}
12 |
13 |
25 |
26 |
27 |
28 |
{{topic.topic_name}}
29 |
30 |
34 |
35 |
36 |
37 |
38 | {% for question_answer in questions_excellans %}
39 |
40 |
41 |
42 |
47 | {% if question_answer[1] %}
48 |
76 | {% endif %}
77 |
173 |
174 |
175 |
176 | {% endfor %}
177 |
178 |
179 |
180 |
181 | {% endblock %}
182 |
183 | {% block page_sidebar %}
184 |
185 |
212 |
213 |
214 |
215 |
描述
216 |
217 |
219 |
220 |
{{topic.topic_name}} {{topic.topic_desc
221 | or ""}}
222 |
223 |
224 |
225 |
226 |
227 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/topics.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% block title %}话题广场-者也{% endblock %}
3 |
4 | {% block page_content %}
5 |
52 |
53 |
57 |
58 |
59 | {% for cate in topic_cate %}
60 | {% if cate.id == cate_selete.id %}
61 | {{cate.category_name}}
63 |
64 | {% else %}
65 | {{cate.category_name}}
67 |
68 | {% endif %}
69 | {% endfor %}
70 |
71 |
72 | {% if cate_selete %}
73 |
74 |
75 | {% for topic in cate_selete.topics %}
76 |
100 | {% endfor %}
101 |
102 |
103 | {% endif %}
104 |
105 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/user.html:
--------------------------------------------------------------------------------
1 | {% extends "base_user.html" %}
2 | {% block head %}
3 | {{super()}}
4 |
5 | {% endblock %}
6 | {% block person_data %}
7 |
8 |
30 |
31 |
35 |
36 | {% for dynamic in dynamics %}
37 | {% if dynamic[0] == "question" %}
38 |
49 | {% else %}
50 |
51 |
56 |
57 |
58 |
69 |
70 |
76 |
77 |
78 | {{dynamic[1].topic_desc}}
79 |
80 |
81 |
82 |
83 |
84 |
85 | {% endif %}
86 | {% endfor %}
87 |
88 |
89 |
90 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/user_answers.html:
--------------------------------------------------------------------------------
1 | {% extends "base_user.html" %}
2 | {% block head %}
3 | {{super()}}
4 |
5 | {% endblock %}
6 | {% import "_macros.html" as macros %}
7 | {% block person_data %}
8 |
9 |
31 |
32 |
33 |
34 | {% for item in items %}
35 |
36 |
37 |
42 |
74 |
75 |
76 | {{item.answer_body}}
77 |
78 |
80 |
81 |
82 |
83 |
100 |
101 | {% if current_user == user %}
102 |
103 |
106 |
108 |
109 |
110 |
111 |
112 | 删除
113 |
114 | {% endif %}
115 |
116 |
117 |
118 |
119 |
183 |
184 |
185 | {% endfor %}
186 |
187 |
188 |
191 |
192 | {% endblock %}}
--------------------------------------------------------------------------------
/app/templates/user_asks.html:
--------------------------------------------------------------------------------
1 | {% extends "base_user.html" %}
2 | {% import "_macros.html" as macros %}
3 | {% block head %}
4 | {{super()}}
5 |
6 | {% endblock %}
7 | {% block person_data %}
8 |
9 |
29 |
30 |
31 |
32 | {% for item in items %}
33 |
34 |
35 |
42 |
43 | {{item.question_time}}
44 | {{item.answers.count()}} 个回答
45 | {{item.follow_questions.count()}} 个关注
46 |
47 |
48 | {% endfor %}
49 |
50 |
51 |
52 |
55 |
56 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/user_follow_base.html:
--------------------------------------------------------------------------------
1 | {% extends "base_user.html" %}
2 | {% import "_macros.html" as macros %}
3 | {% block head %}
4 | {{super()}}
5 |
6 |
7 | {% endblock %}
8 | {% block person_data %}
9 |
10 |
32 |
33 |
34 | {% block follow %}{% endblock %}
35 |
36 | {% for follow in follows %}
37 |
38 |
40 |
41 |
59 |
60 |
61 |
71 |
72 |
73 |
74 |
{{follow.user.short_intr or ""}}
75 |
76 | 0 回答
77 | 0 文章 {{follow.user.followers.count()}} 关注者
79 |
80 |
81 |
82 |
83 | {% if current_user != follow.user %}
84 | {% if current_user.is_anonymous or not current_user.is_following(follow.user) %}
85 | {% if user == current_user %}
86 |
91 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 | 关注
101 |
102 | {% else %}
103 | {% if user == current_user %}
104 |
105 | 取消关注
106 |
107 | {% else %}
108 |
109 | 取消关注
110 |
111 | {% endif %}
112 | {% endif %}
113 | {% endif %}
114 |
115 |
116 |
117 |
118 |
119 | {% endfor %}
120 |
121 |
122 |
123 |
126 |
127 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/user_followers.html:
--------------------------------------------------------------------------------
1 | {% extends "user_follow_base.html" %}
2 | {% block follow %}
3 |
13 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/user_following.html:
--------------------------------------------------------------------------------
1 | {% extends "user_follow_base.html" %}
2 | {% block follow %}
3 |
12 | {% endblock %}
--------------------------------------------------------------------------------
/buildout.cfg:
--------------------------------------------------------------------------------
1 | [buildout]
2 | develop = .
3 | index = https://pypi.tuna.tsinghua.edu.cn/simple
4 | newest = false
5 | update-versions-file = versions.cfg
6 | extends = versions.cfg
7 | relative-paths = true
8 | show-picked-versions = true
9 | versions = versions
10 | parts = app
11 | init_db
12 | cleanpyc
13 |
14 | [app]
15 | recipe = zc.recipe.egg
16 | interpreter = python
17 | eggs = zheye
18 | setuptools
19 |
20 | [init_db]
21 | recipe = plone.recipe.command
22 | command = ./bin/init_db
23 |
24 | [cleanpyc]
25 | recipe = plone.recipe.command
26 | command = find ${buildout:directory} -iname '*.pyc' -delete
27 | update-command = ${:command}
--------------------------------------------------------------------------------
/config.py:
--------------------------------------------------------------------------------
1 | # coding=utf-8
2 | import os
3 |
4 | basedir = os.path.abspath(os.path.dirname(__file__))
5 |
6 |
7 | class Config:
8 | """
9 | 项目的配置文件类,配置可以都多种选择,```Config```为基类,
10 | 配置公共部分
11 | """
12 | SQLALCHEMY_COMMIT_ON_TEARDOWN = True # 开启自动commit
13 | SECRET_KEY = os.environ.get("SECRET_KEY") or "hard to guess string"
14 | SQLALCHEMY_TRACK_MODIFICATIONS = False
15 | MAIL_SERVER = 'smtp.163.com'
16 | MAIL_PORT = 25
17 | MAIL_USE_TLS = True
18 | MAIL_USERNAME = 'cl20141205@163.com'
19 | MAIL_PASSWORD = ''
20 | FLASKY_MAIL_SUBJECT_PREFIX = '[zheye]'
21 | FLASKY_MAIL_SENDER = 'Zheye Admin '
22 | FLASKY_ADMIN = 'cl20141205@163.com'
23 | FLASKY_FOLLOWERS_PER_PAGE = 2
24 | ADMIN_MANAGE = 10
25 | VIEW_MAX = 5 # 问题浏览次数常量
26 | UPLOAD_FOLDER = os.path.join(basedir)
27 |
28 | @staticmethod
29 | def init_app(app):
30 | pass
31 |
32 |
33 | class DevelopmentConfig(Config):
34 | DEBUG = True
35 | SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
36 | 'sqlite:///' + os.path.join(basedir, 'data.sqlite')
37 |
38 |
39 | class TestingConfig(Config):
40 | pass
41 |
42 |
43 | config = {
44 | "development": DevelopmentConfig,
45 | "testing": TestingConfig,
46 |
47 | "default": DevelopmentConfig
48 | }
49 |
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | # coding=utf-8
2 | from app import create_app
3 | from tornado.wsgi import WSGIContainer
4 | from tornado.httpserver import HTTPServer
5 | from tornado.options import define, options
6 | from tornado.ioloop import IOLoop
7 | from app import db
8 | from app.models.models import Role
9 |
10 | app = create_app("default")
11 | define("port", default=5000, type=int)
12 | define("cmd", default="runserver")
13 |
14 |
15 | def runserver():
16 | http_server = HTTPServer(WSGIContainer(app))
17 | http_server.listen(options.port)
18 | print "Server runing on http://0.0.0.0:%d" % options.port
19 | IOLoop.instance().start()
20 |
21 |
22 | def create_db():
23 | with app.app_context():
24 | db.create_all()
25 | Role.insert_roles() # 创建角色
26 |
27 |
28 | if __name__ == '__main__':
29 | options.parse_command_line()
30 | if options.cmd == "runserver":
31 | runserver()
32 | elif options.cmd == "create_db":
33 | create_db()
34 |
35 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | Flask==1.0
2 | Flask-Bootstrap==3.0.3.1
3 | Flask-Login==0.3.1
4 | Flask-Mail==0.9.0
5 | Flask-Migrate==1.1.0
6 | Flask-Moment==0.2.1
7 | Flask-SQLAlchemy==1.0
8 | Flask-Script==0.6.6
9 | Flask-WTF==0.9.4
10 | Jinja2==2.7.1
11 | Mako==0.9.1
12 | Markdown==2.3.1
13 | Flask-PageDown==0.1.4
14 | MarkupSafe==0.18
15 | SQLAlchemy==0.9.9
16 | WTForms==1.0.5
17 | Werkzeug==0.15.3
18 | alembic==0.6.2
19 | blinker==1.3
20 | itsdangerous==0.23
21 | six==1.10.0
22 | bleach==3.1.4
23 | click==6.7
24 | html5lib==1.0b3
25 | python-editor==1.0.3
26 | Flask-HTTPAuth==2.7.0
27 | tornado==4.4.1
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # flake8: noqa
3 | from setuptools import find_packages, setup
4 |
5 | entry_points = """
6 | [console_scripts]
7 | run_web=manage:runserver
8 | init_db=manage:create_db
9 | """
10 |
11 | setup(
12 | name='zheye',
13 | version='0.0.1',
14 | license='PRIVATE',
15 | author='',
16 | author_email='',
17 | url='https://github.com/mathbugua/zheye',
18 | description=u'zheye',
19 | packages=find_packages(exclude=['tests']),
20 | zip_safe=False,
21 | install_requires=[
22 | 'Flask',
23 | 'Flask-Bootstrap',
24 | 'Flask-Login',
25 | 'Flask-Mail',
26 | 'Flask-Migrate',
27 | 'Flask-Moment',
28 | 'Flask-SQLAlchemy',
29 | 'Flask-Script',
30 | 'Flask-WTF',
31 | 'Jinja2',
32 | 'Mako',
33 | 'Markdown',
34 | 'Flask-PageDown',
35 | 'MarkupSafe',
36 | 'SQLAlchemy',
37 | 'WTForms',
38 | 'Werkzeug',
39 | 'alembic',
40 | 'blinker',
41 | 'itsdangerous',
42 | 'six',
43 | 'bleach',
44 | 'click',
45 | 'html5lib',
46 | 'python-editor',
47 | 'Flask-HTTPAuth',
48 | 'tornado',
49 | ],
50 | entry_points=entry_points,
51 | )
52 |
--------------------------------------------------------------------------------
/versions.cfg:
--------------------------------------------------------------------------------
1 | [versions]
2 |
3 | zc.recipe.egg = 2.0.3
4 | Flask = 0.10.1
5 | Flask-Bootstrap = 3.0.3.1
6 | Flask-Login = 0.3.1
7 | Flask-Mail = 0.9.0
8 | Flask-Migrate = 1.1.0
9 | Flask-Moment = 0.2.1
10 | Flask-SQLAlchemy = 1.0
11 | Flask-Script = 0.6.6
12 | Flask-WTF = 0.9.4
13 | Jinja2 = 2.7.1
14 | Mako = 0.9.1
15 | Markdown = 2.3.1
16 | Flask-PageDown = 0.1.4
17 | MarkupSafe = 0.18
18 | SQLAlchemy = 0.9.9
19 | WTForms = 1.0.5
20 | Werkzeug = 0.10.4
21 | alembic = 0.6.2
22 | blinker = 1.3
23 | itsdangerous = 0.23
24 | six = 1.10.0
25 | bleach = 1.4.0
26 | click = 6.7
27 | html5lib = 1.0b3
28 | python-editor = 1.0.3
29 | Flask-HTTPAuth = 2.7.0
30 | tornado = 4.4.1
31 | # Added by buildout at 2018-11-23 15:53:25.866619
32 |
33 | # Required by:
34 | # tornado==4.4.1
35 | certifi = 2018.10.15
36 |
37 | # Added by buildout at 2018-11-23 15:59:10.651691
38 | plone.recipe.command = 1.1
39 |
--------------------------------------------------------------------------------
130 | {{question_answer[1].comments.count()}} 131 | 132 | 条评论
133 |