From 2ddc41bea9418d867440599503754099453b121c Mon Sep 17 00:00:00 2001 From: Igor Popov Date: Tue, 4 Feb 2014 15:57:48 +0400 Subject: [PATCH] some bits --- INSTALL.md | 1 + openraData/handlers.py | 13 ++++ openraData/static/style.css | 138 +++--------------------------------- openraData/triggers.py | 5 ++ systemTool/settings.py | 3 + 5 files changed, 30 insertions(+), 130 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 90e7abb..194d484 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -29,6 +29,7 @@ curl * Modify "OPENRA_PATH" to specify a directory with compiled OpenRA files (with slash at the end) (make sure it's always the latest release) * Modify "RSYNC_MAP_PATH" to specify a directory where 'good' maps will be dumped by website trigger for dedicated servers usage * Modify GITHUB related settings (user, repository and API token): used to post an issue with info about OpenRA crash report + * Modify "ADMIN_EMAIL" to specify an email address of a person who is responsible for fixing map uploading issues * Edit DB related configuration ``` diff --git a/openraData/handlers.py b/openraData/handlers.py index 4ec016f..a058304 100644 --- a/openraData/handlers.py +++ b/openraData/handlers.py @@ -266,3 +266,16 @@ def GetRevisions(self, mapid, seek_next=False): self.GetRevisions(self.revisions[-1], True) return self.GetRevisions(mapObject.pre_rev) + + def GetLatest(self, mapid): + mapObject = Maps.objects.get(id=mapid) + if mapObject.next_rev == 0: + return mapObject.id + return self.GetLatest(mapObject.next_rev) + + def DeleteMap(self, mapid): + pass + + def NotifyOnFail(self, message, tempname): + # send an email to admin attaching map file which is already saved in temp location + pass diff --git a/openraData/static/style.css b/openraData/static/style.css index 0b5f7bc..ba3af43 100644 --- a/openraData/static/style.css +++ b/openraData/static/style.css @@ -13,12 +13,12 @@ body { } .no-svg body { - background-image: url("/static/images/bg-fallback.png"); + background-image: url("/static/images/bg-fallback.png"); } h1 { - font-size: 220%; - font-family: Cambria, Georgia, Times New Roman, Serif; + font-size: 220%; + font-family: Cambria, Georgia, Times New Roman, Serif; } h2, h3 { @@ -28,7 +28,7 @@ h2, h3 { } h3 { - font-size: 125%; + font-size: 125%; } hr { @@ -129,7 +129,6 @@ table tr td { height: 66px; border-bottom: solid 3px #74c2e7; background: none repeat scroll 0% 0% rgba(32, 44, 69, 0.4); - /*background-color: #234c76;*/ } #header h1 { @@ -208,7 +207,7 @@ table tr td { } #nav li li:hover { - border: none; + border: none; } .submenu-top { @@ -317,7 +316,7 @@ table tr td { } #screenshot IMG.last-active { - z-index:9; + z-index:9; } #ghbanner img { @@ -341,7 +340,6 @@ table tr td { background: #74c2e7; background: rgba(32, 44, 69, 0.4); margin-right: 50px; - /* box-shadow: 0px 0px 20px #000; */ } #qsearch { @@ -358,7 +356,7 @@ table tr td { } #quick-search input:focus { - outline : none; + outline : none; } .btn { @@ -373,17 +371,11 @@ table tr td { z-index: 99; } -/* Comment position hacks */ -#disqus_thread { - padding-top: 20px; -} - div.noscript { text-align: center; padding-bottom: 10px; } -/* Games page */ table { margin:0 auto; width:90%; @@ -396,118 +388,4 @@ td, th, tr { #paging td:hover { background: rgba(32, 44, 69, 0.4); -} - -#serverlist { - text-align:center; -} - -#serverlist .gameSubline { - font-size:10px; -} - -#serverlist .gameWaiting { - color: #0A0; -} - -#serverlist .gamePlaying { - color: #F80; -} - -#serverlist .greyout { - color: #999; -} - -#serverlist .greyout .gameWaiting { - color: #050; -} - -#serverlist .greyout .gamePlaying { - color: #740; -} - -/* Downloads page */ -.downloadplatform { - list-style-type:none; - padding:0; - margin:0 auto; - width:90%; - text-align:center; -} - -.downloadplatform li { - display:inline; - margin:2px; -} - -.downloadplatform a { - padding:4px; - display:inline-block; - border: solid 3px #272d2c; - background-color: #272d2c; - text-decoration:none; - border-radius: 10px; - -moz-border-radius: 10px; - -webkit-border-radius: 10px; - -khtml-border-radius: 10px; -} - -.downloadplatform a img { - vertical-align: middle; - border: 0; -} - -.downloadplatform a:hover { - background-color: #888; - border-color: #888; -} - -.downloadplatform a.active { - border: solid 3px #74c2e7; - background-color: #272d2c; -} - -.downloadplatform a.active:hover { - background-color: #888; -} - -.downloadlinks { - list-style-type:none; - padding:0; - margin:0 auto; - width:90%; - text-align:center; -} - -.downloadlinks li { - display:inline; - padding:15px; -} - -.downloadlinks a { - font-family: 12px/1.4 Helvetica,arial,freesans,clean,sans-serif; - background: url("/static/images/download.svg") no-repeat; - background-position: 15px 15px; - padding:10px 15px 10px 60px; - display:inline-block; - border: solid 3px #182547; - background-color: #272d2c; - text-decoration:none; - text-align:center; - border-radius: 10px; - -moz-border-radius: 10px; - -webkit-border-radius: 10px; - -khtml-border-radius: 10px; -} - -.no-svg .downloadlinks a { - background-image: url("/static/images/download-fallback.png"); -} - -.downloadlinks a:hover { - background-color: #888; -} - -.downloadblurb { - min-height: 50px; -} +} \ No newline at end of file diff --git a/openraData/triggers.py b/openraData/triggers.py index a9b5e7b..843daff 100644 --- a/openraData/triggers.py +++ b/openraData/triggers.py @@ -1,3 +1,7 @@ +from django.conf import settings +from django.contrib.auth.models import User +from openraData.models import Maps + # Map Triggers def recalculate_hashes(): @@ -9,6 +13,7 @@ def map_upgrade(): pass def filterMapsRsync(): + # sync + syncall # this function syncs rsync directory with fresh list of maps, triggered by uploading a new map pass diff --git a/systemTool/settings.py b/systemTool/settings.py index 87cae2e..4084e51 100644 --- a/systemTool/settings.py +++ b/systemTool/settings.py @@ -102,3 +102,6 @@ GITHUB_API_TOKEN = '' GITHUB_USER = '' GITHUB_REPO = '' + +# Email address of a person who is responsible for fixing map uploading issues +ADMIN_EMAIL = ''