github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/themes/wind/templates/main.html (about)

     1  {% extends "base.html" %}
     2  
     3  {% block content %}
     4  
     5  <div id="content" class="col-lg-9">
     6      {% include "msgerr.html" %}
     7      <div class="box">
     8          {% if curnode %}
     9              <div class="cell first">
    10                  <a href="/">{{SiteName}}</a>
    11                  {% if curnode.Title %}
    12                      <i class="fa fa-caret-right"></i> <a class="tag" href="/node/{{curnode.Title|urlencode}}/">{{curnode.Title}}</a>
    13                  {% endif %}
    14              </div>
    15              {% if curnode.Content %}
    16                  <div class="cell">{{curnode.Content|safe}}</div>
    17              {% endif %}
    18          {%else%}
    19              {%if nodes%}
    20                  <div class="cell first nav-cats">
    21                      {% for node in nodes %}
    22                          {%if forloop.Counter<=10 %}
    23                              <span class="cat">
    24                                  <a {% if CurNdTitle ==node.Title %}class="active" {% endif %} href="/node/{{node.Title|urlencode}}/">{{node.Title}}</a>
    25                              </span>
    26                          {%endif%}
    27                      {%endfor%}
    28                  </div>
    29              {%endif%}
    30                  <div class="cell nav-cats">
    31                      <span class="cat">
    32                          <a {% if not curnode %}class="active" {% endif %} href="/"> <i class="fa fa-refresh"></i>
    33                          </a>
    34                      </span>
    35                      <span class="cat">
    36                          <a {% if tab=="optimal" && isdefault==true %}class="active" {% endif %} href="/topics/optimal/">{{ i18n.Tr("topics-optimal") }}</a>
    37                      </span>
    38                      <span class="cat">
    39                          <a {% if tab=="lastest" && isdefault==true %}class="active" {% endif %} href="/topics/lastest/">{{ i18n.Tr("topics-lastest") }}</a>
    40                      </span>
    41                      <span class="cat">
    42                          <a {% if tab=="hotness" && isdefault==true %}class="active" {% endif %} href="/topics/hotness/">{{ i18n.Tr("topics-hotness") }}</a>
    43                      </span>
    44                      <span class="cat">
    45                          <a {% if tab=="rising" && isdefault==true %}class="active" {% endif %} href="/topics/rising/">{{ i18n.Tr("topics-rising") }}</a>
    46                      </span>
    47                      <span class="cat">
    48                          <a {% if tab=="scores" && isdefault==true %}class="active" {% endif %} href="/topics/scores/">{{ i18n.Tr("topics-scores") }}</a>
    49                      </span>
    50                      <span class="cat">
    51                          <a {% if tab=="votes" && isdefault==true %}class="active" {% endif %} href="/topics/votes/">{{ i18n.Tr("topics-votes") }}</a>
    52                      </span>
    53                      <span class="cat">
    54                          <a {% if tab=="controversial" && isdefault==true %}class="active" {% endif %} href="/topics/controversial/">{{ i18n.Tr("topics-controversial") }}</a>
    55                      </span>
    56                      <span class="cat">
    57                          <a {% if tab=="popular" && isdefault==true %}class="active" {% endif %} href="/topics/popular/">{{ i18n.Tr("topics-popular") }}</a>
    58                      </span>
    59                      <span class="cat">
    60                          <a {% if tab=="cold" && isdefault==true %}class="active" {% endif %} href="/topics/cold/">{{ i18n.Tr("topics-cold") }}</a>
    61                      </span>
    62                      <span class="cat">
    63                          <a {% if tab=="favorites" && isdefault==true %}class="active" {% endif %} href="/topics/favorites/">{{ i18n.Tr("topics-favorites") }}</a>
    64                      </span>
    65                      {% comment %}
    66                      <span class="cat">
    67                          <a href="/topics/follow/">{{ i18n.Tr("topics-follow") }}</a>
    68                      </span>
    69                      {% endcomment %}
    70                  </div>
    71          {% endif %}
    72          {% if TopicsBySort %}
    73              <div class="panel panel-default">
    74                      <div class="panel-heading bg-light bg-light">
    75                          <span class="cat">{{ i18n.Tr("top-topics") }}</span>
    76                      </div>
    77                      <div class="panel-body bg-light lter no-padder">
    78                          <div class="post-list lt">
    79                          {% for topic in TopicsBySort %}
    80                              <div class="post cell">
    81                                  <div class="avatar">
    82                                      <a href="/user/{{ topic.Author|urlencode }}/" data-toggle="tooltip" data-placement="right" data-original-title="{{topic.Author}}"><img src="{% if topic.AvatarMedium %}{{File(topic.AvatarMedium)}}{% else %}/identicon/{{topic.Author}}/48/default.png{% endif %}" alt="{{topic.Author}}" class="img-circle" style="width:48px;height:48px;"/>
    83                                      </a>
    84                                  </div>
    85                                  <a href="/topic/{{ topic.Id }}/">
    86                                      <h3 class="title" onclick="javascript:window.location.href = '/topic/{{ topic.Id }}/';">{{ topic.Title | safe }}</h3>
    87                                  </a>
    88                                  <div class="meta">
    89                                      {% if topic.Hotscore %}
    90                                          <span class="post-span votes"><i class="fa fa-chevron-up"></i>&nbsp;&nbsp;<span id="score-{{topic.Id}}">{{topic.Hotscore}}</span> • </span>
    91                                      {% endif %}
    92                                      {% if topic.Node %}
    93                                      <a class="tag" href="/node/{{ topic.Node|urlencode }}/">{{ topic.Node }}</a>
    94                                      •
    95                                      {% endif %}
    96                                      <a href="/createdby/{{ topic.Author|urlencode }}/">{{ topic.Author }}</a>
    97                                      {% if topic.Created %}
    98                                      •
    99                                      <span class="time">{{TimeSince(topic.Created)}}</span>
   100                                      {% endif %}
   101                                      {% if topic.ReplyLastUsername %}
   102                                          <span class="time"> •
   103                                              <span class="last-reply">
   104                                              最后回复来自 <a href="/user/{{ topic.ReplyLastUsername|urlencode }}/">{{ topic.ReplyLastUsername }}</a>
   105                                              </span>
   106                                              {% if topic.ReplyTime %}
   107                                                  于 {{TimeSince(topic.ReplyTime)}}
   108                                              {% endif %}
   109                                          </span>
   110                                      {% endif %}
   111                                      {% if topic.ReplyCount %}
   112                                      <span class="data hidden-xs pull-right">
   113                                          <a href="/topic/{{ topic.Id }}/" class="badge">{{ topic.ReplyCount }}</a>
   114                                      </span>
   115                                      {% endif %}
   116                                  </div>
   117                              </div>
   118                          {% endfor %}
   119                          </div>
   120                      </div>
   121              </div>
   122          {% endif %}
   123              <div class="post-list">
   124                  {% if topics %}
   125                      {% for topic in topics %}
   126                          <div class="post cell">
   127                                  <div class="avatar">
   128                                      <a href="/user/{{ topic.Author|urlencode }}/" data-toggle="tooltip" data-placement="right" data-original-title="{% if topic.Author %}{{topic.Author}}{% endif %}">
   129                                          <img src="{% if topic.AvatarMedium %}{{File(topic.AvatarMedium)}}{% else %}/identicon/{{topic.Author}}/48/default.png{% endif %}" alt="{{topic.Author}}" class="img-circle" style="width:48px;height:48px;"/>
   130                                      </a>
   131                                  </div>
   132                                  <a href="/topic/{{ topic.Id }}/">
   133                                      <h3 class="title" onclick="javascript:window.location.href = '/topic/{{ topic.Id }}/';">{{ topic.Title | safe }}</h3>
   134                                  </a>
   135                                  <div class="meta">
   136                                      {% if topic.Hotscore %}
   137                                          <span class="post-span votes"><i class="fa fa-chevron-up"></i>&nbsp;&nbsp;<span id="score-{{topic.Id}}">{{topic.Hotscore}}</span> • </span>
   138                                      {% endif %}
   139                                      {% if topic.Node %}
   140                                      <a class="tag" href="/node/{{ topic.Node|urlencode }}/">{{ topic.Node }}</a>
   141                                      •
   142                                      {% endif %}
   143                                      <a href="/createdby/{{ topic.Author|urlencode }}/">{{ topic.Author }}</a>
   144                                      {% if topic.Created %}
   145                                      •
   146                                      <span class="time">{{TimeSince(topic.Created)}}</span>
   147                                      {% endif %}
   148                                      {% if topic.ReplyLastUsername %}
   149                                          <span class="time"> •
   150                                              <span class="last-reply">
   151                                              最后回复来自 <a href="/user/{{ topic.ReplyLastUsername|urlencode }}/">{{ topic.ReplyLastUsername }}</a>
   152                                              </span>
   153                                              {% if topic.ReplyTime %}
   154                                                  于 {{TimeSince(topic.ReplyTime)}}
   155                                              {% endif %}
   156                                          </span>
   157                                      {% endif %}
   158                                      {% if topic.ReplyCount %}
   159                                      <span class="data hidden-xs pull-right">
   160                                          <a href="/topic/{{ topic.Id }}/" class="badge">{{ topic.ReplyCount }}</a>
   161                                      </span>
   162                                      {% endif %}
   163                                  </div>
   164                          </div>
   165                      {% endfor %}
   166                  {% else %}
   167                      {% if not TopicsBySort %}
   168                          <div class="post cell text-center">
   169                              {% if CurUsrTitle %}
   170                                      <a href="/new/node/{{CurUsrTitle|urlencode}}/topic/" class="btn btn-s-md btn-default btn-rounded">创建 {{CurUsrTitle}} 的新话题</a>
   171                              {% else %}
   172                                      <a href="/new/topic/" class="btn btn-s-md btn-default btn-rounded">尚没有话题 • 创建新话题</a>
   173                              {% endif %}
   174                                  <div style="clear:both;"></div>
   175                          </div>
   176                      {% endif %}
   177                  {% endif %}
   178              </div>
   179              {% if pagesbar %}
   180              <div class="cell last">
   181                  {{pagesbar|safe}}
   182              </div>
   183              {% endif %}
   184      </div>
   185  
   186          <section class="panel panel-default">
   187              <header class="panel-heading bg-light">
   188                  <ul class="nav nav-tabs pull-right">
   189                      <li class="active">
   190                          <a href="#comments-1" data-toggle="tab"> <i class="fa fa-comment-o text-muted"></i>
   191                              {{ i18n.Tr("optimal-comments") }}
   192                          </a>
   193                      </li>
   194                      <li>
   195                          <a href="#comments-2" data-toggle="tab"> <i class="fa fa-comment text-muted"></i>
   196                              {{ i18n.Tr("recent-comments") }}
   197                          </a>
   198                      </li>
   199                  </ul>
   200                  <span class="hidden-sm">{{ i18n.Tr("comment") }}</span>
   201              </header>
   202              <div class="panel-body">
   203                  <div class="tab-content">
   204                      <div class="tab-pane active" id="comments-1">
   205                          <div class="cell first">
   206                            <strong><a href="/best/comments/">{{ i18n.Tr("optimal-comments") }}</a></strong>
   207                          </div>
   208                          {% if ConfidenceReplys %}
   209                          <div class="post-list last">
   210                              {% for reply in ConfidenceReplys %}
   211                              <div class="post cell">
   212                                  <div class="avatar">
   213                                      <a href="/user/{{reply.Author}}/" title="{{reply.Author}}">
   214                                          <img src="{% if reply.AvatarMedium %}{{File(reply.AvatarMedium)}}{%else%}/identicon/{{reply.Author}}/48/default.png{% endif %}" alt="{{reply.Author}}'s Photo"></a>
   215                                  </div>
   216                                  {% if reply.Content %}
   217                                  <h3 class="title">
   218                                      <a href="/topic/{{reply.Tid}}/#reply{{reply.Id}}">
   219                                          {% with s=Htm2Str(reply.Content) %}
   220                                            {%if not s %}
   221                                              {{ reply.Author }} 回应了话题#{{reply.Tid}}
   222                                            {%else%}
   223                                              {{Cropword(s,0,48,"...")}}
   224                                            {%endif%}
   225                                          {% endwith %}
   226                                      </a>
   227                                  </h3>
   228                                  {% endif %}
   229                                  <div class="meta">
   230                                      <a href="/createdby/{{reply.Author}}/">{{reply.Author}}</a>
   231                                      •
   232                                      <span class="time">{{TimeSince(reply.Created)}}</span>
   233                                  </div>
   234                              </div>
   235                              {%endfor%}
   236                          </div>
   237                          {%else%}
   238                          <div class="post-list last">
   239                              <div class="post cell">
   240                                  {{ i18n.Tr("not-yet") }} {{ i18n.Tr("optimal-comments") }}
   241                              </div>
   242                          </div>
   243                          {% endif %}
   244                      </div>
   245                      <div class="tab-pane" id="comments-2">
   246                          <div class="cell first">
   247                            <strong>{{ i18n.Tr("recent-comments") }}</strong>
   248                          </div>
   249                          {% if replys %}
   250                          <div class="post-list last">
   251                              {% for reply in replys %}
   252                              <div class="post cell">
   253                                  <div class="avatar">
   254                                      <a href="/user/{{reply.Author}}/" title="{{reply.Author}}">
   255                                          <img src="{% if reply.AvatarMedium %}{{File(reply.AvatarMedium)}}{%else%}/identicon/{{reply.Author}}/48/default.png{% endif %}" alt="{{reply.Author}}'s Photo"></a>
   256                                  </div>
   257                                  {% if reply.Content %}
   258                                  <h3 class="title">
   259                                      <a href="/topic/{{reply.Tid}}/#reply{{reply.Id}}">
   260                                          {% with s=Htm2Str(reply.Content) %}
   261                                            {%if not s %}
   262                                              {{ reply.Author }} 回应了话题#{{reply.Tid}}
   263                                            {%else%}
   264                                              {{Cropword(s,0,48,"...")}}
   265                                            {%endif%}
   266                                          {% endwith %}
   267                                      </a>
   268                                  </h3>
   269                                  {% endif %}
   270                                  <div class="meta">
   271                                      <a href="/createdby/{{reply.Author}}/">{{reply.Author}}</a>
   272                                      •
   273                                      <span class="time">{{TimeSince(reply.Created)}}</span>
   274                                  </div>
   275                              </div>
   276                              {%endfor%}
   277                          </div>
   278                          {%else%}
   279                          <div class="post-list last">
   280                              <div class="post cell">
   281                                  {{ i18n.Tr("not-yet") }} {{ i18n.Tr("recent-comments") }}
   282                              </div>
   283                          </div>
   284                          {% endif %}
   285                      </div>
   286                  </div>
   287              </div>
   288          </section>
   289      {% include "navbox.html" %}
   290      {% if IsSigned and curnode %}
   291          <div class="box">
   292              <div class="cell first last">
   293                  <form id="post-new" method="POST" action="/new/node/{{curnode.Id}}/topic/">
   294                      <label class="control-label">快键发布</label>
   295                      <div class="controls">
   296                          <div class="form-group">
   297                              <textarea class="editor" name="title" style="height:122px;width:100%;margin:0;"></textarea>
   298                              <input value="{{curnode.Id}}" name="nodeid" type="hidden"/>
   299                          </div>
   300                      </div>
   301                      <div class="form-group">
   302                          <div class="button-bar" style="position: relative;">
   303                              <button type="submit" class="btn btn-s-md btn-dark btn-rounded" onclick="javascript:SubmitHolder();">
   304                                  发布&nbsp;&nbsp; <i class="icon-chevron-sign-right"></i>
   305                              </button>
   306                              <div class="clearfix"></div>
   307                          </div>
   308                          <div class="clearfix"></div>
   309                      </div>
   310                  </form>
   311                  {% include "editor-front.html" %}
   312              </div>
   313          </div>
   314      {% endif %}
   315  </div>
   316  {% endblock content %}