diff options
author | André Glüpker <git@wgmd.de> | 2017-10-01 14:50:19 +0200 |
---|---|---|
committer | André Glüpker <git@wgmd.de> | 2017-10-01 14:50:19 +0200 |
commit | 1585395e7e530665c565b88fea15cbea68d3a88d (patch) | |
tree | 204033b68d01e27036a68d625f4474f3254880c2 /templates | |
download | steam-1585395e7e530665c565b88fea15cbea68d3a88d.tar.gz steam-1585395e7e530665c565b88fea15cbea68d3a88d.tar.bz2 steam-1585395e7e530665c565b88fea15cbea68d3a88d.zip |
Initial public release
Diffstat (limited to 'templates')
-rw-r--r-- | templates/error.jinja | 16 | ||||
-rw-r--r-- | templates/lobby_html.jinja | 100 | ||||
-rw-r--r-- | templates/premades_html.jinja | 102 |
3 files changed, 218 insertions, 0 deletions
diff --git a/templates/error.jinja b/templates/error.jinja new file mode 100644 index 0000000..60c185f --- /dev/null +++ b/templates/error.jinja @@ -0,0 +1,16 @@ +<html> + <head> + <title>CS:GO Lobbylinkfinder</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <link rel="stylesheet" type="text/css" href="static/style.css" /> + </head> + <body> + <div class="error"> + <h4>Es ist ein Fehler aufgetreten!</h4> + <pre>{{ error }}</pre> + <a href="javascript:window.history.back();" class="joinbutton">Zurück</a> + <a href="/" class="joinbutton">Zur Startseite</a> + </div> + </body> +</html> + diff --git a/templates/lobby_html.jinja b/templates/lobby_html.jinja new file mode 100644 index 0000000..fcf440b --- /dev/null +++ b/templates/lobby_html.jinja @@ -0,0 +1,100 @@ +<html><head> + <title>CS:GO Lobbylinkfinder</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <link rel="stylesheet" type="text/css" href="static/style.css" /> + <script src="static/hide.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="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['gameextrainfo'] %}{% 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">{{ profile['gameextrainfo'] }} + {% 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:window.prompt('Lobbylink', '[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 != profile['gameextrainfo'] %} + <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:window.prompt('Lobbylink', '[url]steam://connect/{{ profile['gameserverip'] }}[/url]'); return false;" class="joinbutton">Copy link</a> + </div> + {% endif %} + {% elif profile['gameextrainfo'] %} + <span class="ingameother">{{ profile['gameextrainfo'] }}</span><br /> + <span class="info">(non-steam)</span> + {% else %} + {% if profile['personastate'] == 0 %} + <span class="{{ state }}">Offline since {{ display_time(current_time - profile['lastlogoff']) }}</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\ #} diff --git a/templates/premades_html.jinja b/templates/premades_html.jinja new file mode 100644 index 0000000..39ebb0b --- /dev/null +++ b/templates/premades_html.jinja @@ -0,0 +1,102 @@ +<html><head> + <title>CS:GO Premadefinder</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <link rel="stylesheet" type="text/css" href="static/style.css" /> + <script src="static/vivagraph.min.js"></script> + </head> + <body onload="onLoad();"> + + <ul id="menu"> + <li class="menu app"><a class="joinbutton" href="lobby">Lobbylinkfinder</a></li> + </ul> + + <div class="form"> + Copy&Paste den Inhalt von 'status' aus der Konsole.<br /> + <form action="premadefinder" method="post"> + <textarea name="statustext" cols="75" rows="10"></textarea><br /> + <input class="joinbutton" type="submit" name="Freunde finden!" /> + </form> + </div> + + + {% if steamids %} + + <script type="text/javascript"> + function onLoad(){ + var graph = Viva.Graph.graph(); + + {% for steamid in steamids %} + graph.addNode('{{ steamid }}', {url : '{{ profiles[steamid]['avatarmedium'] }}', name : '{{ profiles[steamid]['personaname']|e }}', friends : {% if profiles[steamid]['communityvisibilitystate'] == 3 %} 'yes' {% else %} 'no' {% endif %}}); + {% endfor %} + {% for connection in connections %} + graph.addLink('{{ connection[0] }}', '{{ connection[1] }}'); + {% endfor %} + + var graphics = Viva.Graph.View.svgGraphics(); + graphics.node( + function(node) { + if (node.data) { + var ui = Viva.Graph.svg('g'), + svgText = Viva.Graph.svg('text') + .attr('text-anchor', 'middle') + .attr('fill', 'rgb(150, 150, 0)') + .attr('x', '+16px') + .attr('y', '+48px') + .text(node.data.name), + img = Viva.Graph.svg('image') + .attr('width', 32) + .attr('height', 32) + .link(node.data.url), + border = Viva.Graph.svg('rect') + .attr('width', 36) + .attr('height', 36) + .attr('x', '-2px') + .attr('y', '-2px') + .attr('fill', 'red'); + if (node.data.friends == 'no') { + ui.append(border); + } + ui.append(img); + ui.append(svgText); + return ui; + } + } + ).placeNode( + function(nodeUI, pos){ + // Shift image to let links go to the center: + nodeUI.attr('transform', + 'translate(' + + (pos.x - 16) + ',' + (pos.y - 16) + + ')'); + } + ); + + var layout = Viva.Graph.Layout.forceDirected(graph, { + stableThreshold : 0.09, + springLength : 150, + springCoeff : 0.0008, + dragCoeff : 0.05, + gravity : -1.0 + }); + + var renderer = Viva.Graph.View.renderer(graph, { + container: document.getElementById('premades'), + graphics : graphics, + layout : layout + }); + + renderer.run(); + }; + </script> + + <div id="premades"> + </div> + <div id="info"> + (Private Profile sind durch eine rote Umrandung gekennzeichnet.) + </div> + {% endif %} + + </body> +</html> + +{# vim: commentstring={#\ %s\ #} |