summaryrefslogtreecommitdiff
path: root/templates/lobby_html.jinja
blob: 0564e555c0fb943ae0ed461d89024e6b1e68c0ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<html>
  <head>
    <title>Steam Lobbylinkfinder</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" type="text/css" href="static/style.css" />
    <link rel="icon" type="image/png" href="static/favicon.png" />
    <script src="static/misc.js"></script>
  </head>
  <body>

    <ul id="menu">
      <li class="menu"><a class="joinbutton" href="javascript:hideOffline();" id="offlinetoggle">Hide Offline</a></li>
      <li class="menu"><a href="javascript:location.reload();" class="joinbutton">Refresh</a></li>
      <li class="menu app"><a class="joinbutton" href="server">Serverinfo</a></li>
      <li class="menu app"><a class="joinbutton" href="premadefinder">Premadefinder</a></li>
    </ul>

    {% with messages = get_flashed_messages() %}
        {% if messages %}
            <ul id="flash">
                {% for message in messages %}
                    <li>{{ message  }}</li>
                {% endfor %}
            </ul>
        {% endif %}
    {% endwith %}

    {# avatar: 32x32, avatarmedium: 64x64, avatarfull: 184x184 #}

    {% for steamid,profile in steamids.items() %}
    {% if profile['gameid'] %}{% set state = "Ingame" %}{% else %}{% set state = states[profile['personastate']].lower().replace(' ', '') %}{% endif %}

    <div class="player {{ state }}">
      <div class="interna">
        <a href="{{ profile['profileurl'] }}">
          <span class="steamname {{ state }}">{{ profile['personaname']|e }}</span><br />
          <img src="{{ profile['avatarfull'] }}" class="avatar {{ state }}" /><br />
          <span class="maininfo">({{ profile['main']|e }})</span>
        </a>
      </div>
      <div class="interna stats">
        {# Ingame (Steam), Ingame (Nonsteam), Offline/Other #}
        {% if profile['gameid'] %}
        <span class="ingame"><a href="http://store.steampowered.com/app/{{ profile['gameid'] }}" class="ingame">{{ gamelist[profile['gameid']] or profile['gameextrainfo'] or 'N/A' }}
            {% if profile['gameserverip'] not in serverinfo %}
            {# No serverinfo -> Display game logo #}
            <img src="http://cdn.akamai.steamstatic.com/steam/apps/{{ profile['gameid'] }}/header.jpg" class="gameimage" />
            {% endif %}
          </a></span><br/>
          {% if profile['lobbysteamid'] %}
          <div class="buttons">
            <a href="steam://joinlobby/{{ profile['gameid'] }}/{{ profile['lobbysteamid'] }}/{{ profile['steamid'] }}" class="joinbutton">Join lobby</a>
            <a href="#" onclick="javascript:copyToClipboard('[url]steam://joinlobby/{{ profile['gameid'] }}/{{ profile['lobbysteamid'] }}/{{ profile['steamid'] }}[/url]'); return false;" class="joinbutton">Copy link</a>
          </div>
          {% elif profile['gameserverip'] %}
          {# playing on a server, got info? #}
          {% if serverinfo[profile['gameserverip']] %}
          <div class="serverinfo">
            {% set game       = serverinfo[profile['gameserverip']]['game'] %}
            {% set servername = serverinfo[profile['gameserverip']]['name'] %}
            {% set mapname    = serverinfo[profile['gameserverip']]['map'] %}
            {% set players    = serverinfo[profile['gameserverip']]['players'] %}
            {% set playersmax = serverinfo[profile['gameserverip']]['playersmax'] %}
            {% if game != gamelist[profile['gameid']] %}
            <span class="gamename">{{ game }}</span><br />
            {% endif %}
            {{ servername }}<br />
            {{ mapname }} ({{ players }}/{{ playersmax }})
          </div>
          {% endif %}
          <div class="buttons">
            <a href="steam://connect/{{ profile['gameserverip'] }}" class="joinbutton">Connect</a>
            <a href="#" onclick="javascript:copyToClipboard('[url]steam://connect/{{ profile['gameserverip'] }}[/url]'); return false;" class="joinbutton">Copy link</a>
          </div>
          {% endif %}
          {% elif gamelist[profile['gameid']] %}
          <span class="ingameother">{{ gamelist[profile['gameid']] }}</span><br />
          <span class="info">(non-steam)</span>
          {% else %}
          {% if profile['personastate'] == 0 %}
          <span class="{{ state }}">Offline since {{ (current_time - profile['lastlogoff']) | display_age }}</span>
          {% else %}
          <span class="{{ state }}">{{ states[profile['personastate']] }}</span>
          {% endif %}
          {% if profile['communityvisibilitystate'] == 1 %}
          <br /><span class="error">Profile private</span>
          {% endif %}
          {% endif %}
      </div>
    </div>
    {% endfor %}

    {% if steamids['76561197963063991'] %}
    <p id="disclaimer">
    Falls dir hier Accounts fehlen oder du Vorschläge hast oder hier nicht genannt werden willst,
    dann wende dich an <a class="{{ states[ steamids['76561197963063991']['personastate'] ] }}" href="{{ steamids['76561197963063991']['profileurl'] }}"><img src="{{ steamids['76561197963063991']['avatar'] }}" width="16" height="16 "/>Penguin</a>!
    </p>
    {% endif %}

  </body>
</html>

<!-- vim: commentstring={#\ %s\ #}