Merge branch 'master' into mindcoding
authorMarius Gavrilescu <marius@ieval.ro>
Tue, 25 Mar 2014 12:38:32 +0000 (14:38 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Tue, 25 Mar 2014 12:38:32 +0000 (14:38 +0200)
Conflicts:
lib/Gruntmaster/Page/Generic.pm
lib/Gruntmaster/Page/Pb/Entry.pm
tmpl/ct_entry.en

29 files changed:
a/about.en [new file with mode: 0644]
a/about.en.title [new file with mode: 0644]
a/guide.en [new file with mode: 0644]
a/guide.en.title [new file with mode: 0644]
a/index.en
a/index.en.title
a/rules.en [new file with mode: 0644]
a/rules.en.title [new file with mode: 0644]
app.psgi
css/codemirror.css [new file with mode: 0644]
css/custom.css
css/logos.css [new file with mode: 0644]
js/90-custom.js
js/90-ga.js [new file with mode: 0644]
lib/Gruntmaster/Page/Pb/Entry.pm [new file with mode: 0644]
log.conf
run
static/favicon.png [new file with mode: 0644]
static/guide/1.png [new file with mode: 0755]
static/guide/2.png [new file with mode: 0755]
static/guide/3.2.png [new file with mode: 0755]
static/guide/3.png [new file with mode: 0755]
static/guide/4.2.png [new file with mode: 0755]
static/guide/4.png [new file with mode: 0755]
static/guide/5.png [new file with mode: 0755]
static/logos.png [new file with mode: 0644]
tmpl/footer.en
tmpl/header.en
tmpl/pb_entry.en

diff --git a/a/about.en b/a/about.en
new file mode 100644 (file)
index 0000000..2c1d517
--- /dev/null
@@ -0,0 +1,25 @@
+We are a group of coders of all ages, passionate about problem solving and algorithms. Together, we created MindCoding, an online platform where anyone can learn algorithms and test their skills. Join us, teach yourself new things and have fun!
+<p>
+Our website provides a problem list with an online evaluation system, which means you&#39ll find out on the spot if your solution is correct. We support a wide rande of programming languages, allowing all programers to participate, regardless of their technical background. <b>Read from stdin and print to stdout.</b>
+<p>
+If you take part in our coding competition (which we strongly recommend!) don&#39t forget to check out our standings and see how well you did compared to your friends.
+<p>
+Put your mind to work and code!
+
+<h2>How to use the website</h2>
+First you need to create an account. For this click the Account button in the navbar.<br>
+When you want to do an action that needs an account you will be required to log in. <br>
+To submit a problem you can either paste your code into the text area for the corresponding problem or browse for the source.<br>
+To take part in a contest, you don't need to register to a particular one, you just need to access its page after the contest starts.
+Here are some examples for how to submit:<br>
+<a href="http://ideone.com/58mgdC">C</a><br>
+<a href="http://ideone.com/gH3zg1">C++</a><br>
+<a href="http://ideone.com/N7TkzK">Java</a><br>
+<a href="http://ideone.com/dQgwIT">Pascal</a><br>
+<a href="http://ideone.com/gSKAGU">Perl</a><br>
+<a href="http://ideone.com/3H6NmV">Python</a><br>
+
+
+<!--
+Mind Coding wants to gather the students passionate of Computer Science, regardless of age and background and offer them the chance to collaborate. Contestants will have the opportunity to get in touch with Cluj-Napoca’s employers, and also to scrutinize the facilities of studying at “Babes-Bolyai” University. During the online round, the students may establish contact with employers through banners and sponsored problems. At the final round, officials of universities and companies from Cluj will hold presentations and will directly communicate with students. Mind Coding endeavors to reward the elite of Computer Science’s students and attract them to Cluj-Napoca in the near future. Furthermore, Mind Coding wants to create a large community of enthusiastic students, attempting to establish strong connection between Romanian peers.
+-->
\ No newline at end of file
diff --git a/a/about.en.title b/a/about.en.title
new file mode 100644 (file)
index 0000000..660f88f
--- /dev/null
@@ -0,0 +1 @@
+About us
\ No newline at end of file
diff --git a/a/guide.en b/a/guide.en
new file mode 100644 (file)
index 0000000..c270379
--- /dev/null
@@ -0,0 +1,72 @@
+<div class="well">\r
+       <h2>Quick Start Guide:</h2>\r
+       <ul>\r
+               <li>First of all you need to <b>create an account</b>. For this, click the <b>Account</b> button in the navbar.\r
+               When you want to do an action that needs an account you will be requiered to log in. <i>For example see last step in the Submitting part.</i></li>\r
+               <li>In order to <b>take part in a contest</b> <u>you don't need to register to a particular one</u>. You just need to <b>access its page</b> after the contest starts.</li>\r
+               <li>To <b>submit a solution</b> you can either paste your code into the text area for the corresponding problem or browse for the source. In what follows you can see all the steps for submitting:  </li>\r
+       </ul>\r
+\r
+       <div style="clear: both; display:block; position:relative; float: left; width: 600px">\r
+               <h3>STEP 1: Choosing a problem from the list</h3>\r
+               <img alt="" height="272" src="/static/guide/1.png" width="400" style="float: left; margin:2px 10px">\r
+               <br><p>In order to choose a problem click the <b>Problems</b> button from the \r
+               navbar. </p>\r
+               <p>Then <b>click on</b> the problem you want to solve.\r
+       <br><i>For example let's choose <b>A+B</b> problem.</i> </p>\r
+       </div>\r
+\r
+       <div style="clear: both; display:block; position:relative; float: left">\r
+               <h3>STEP 2: Starting to fill the form</h3>\r
+               <img alt="" height="272" src="/static/guide/2.png" width="400" style="float: left; margin:2px 10px">\r
+               <br>\r
+               <p> From now on we focus on <b>Submit solution</b> area. </p>\r
+               <p> Here we can find the form to be filled in order to upload a solution to any given problem.</p>\r
+       </div>\r
+\r
+       <div style="clear: both; display:block; position:relative; float: left">\r
+               <h3>STEP 3: Solution source code</h3>\r
+               <table style="margin-left:10px; text-align:center">\r
+               <tr>\r
+                       <td style="width:200px"><b>1st Option</b> - Upload the source file<br>\r
+                               <img alt="" height="192" src="/static/guide/3.png" width="350" style="margin:2px 10px"><br>\r
+                               Go to <b>Choose file</b> button from <b>File</b> area and then choose the source file.\r
+                       </td>\r
+                       <td> or </td>\r
+                       <td style="width:200px"><b>2nd Option</b> - Paste the code<br>\r
+                               <img alt="" height="340" src="/static/guide/3.2.png" width="250" style="margin:2px 10px">\r
+                       </td>\r
+               </tr>\r
+               </table>\r
+               <i>Here are some examples for how to submit:</i>\r
+               <ul>\r
+                       <li><a href="http://ideone.com/58mgdC" target="_blank">C</a></li>\r
+                       <li><a href="http://ideone.com/gH3zg1" target="_blank">C++</a></li>\r
+                       <li><a href="http://ideone.com/N7TkzK" target="_blank">Java</a></li>\r
+                       <li><a href="http://ideone.com/dQgwIT" target="_blank">Pascal</a></li>\r
+                       <li><a href="http://ideone.com/gSKAGU" target="_blank">Perl</a></li>\r
+                       <li><a href="http://ideone.com/3H6NmV" target="_blank">Python</a></li>\r
+               </ul>\r
+       </div>\r
+\r
+\r
+       <div style="clear: both; display:block; position:relative; float: left">\r
+               <h3>STEP 4: Selecting the file format</h3>\r
+               <img alt="" height="270" src="/static/guide/4.png" width="250" style="float: left; margin:2px 10px">\r
+               <p> After uploading the source code we have to choose the format \r
+               corresponding to the code we provided as solution.</p>\r
+       </div>\r
+\r
+       <div style="clear: both; display:block; position:relative; float: left">\r
+               <h3>...and SUBMIT</h3>\r
+               <img alt="" height="260" src="/static/guide/5.png" width="250" style="float: left; margin:2px 10px">\r
+               <p>Click the <b>Submit job</b> button and wait for the results.</p> <p>You will be redirected \r
+               to <b>Job log</b> page where you can see the results. </p>\r
+\r
+       </div>\r
+       <div style="clear:both"> </div>\r
+\r
+       <h3>Good luck!</h3>\r
+\r
+\r
+</div>\r
diff --git a/a/guide.en.title b/a/guide.en.title
new file mode 100644 (file)
index 0000000..1fb0ba9
--- /dev/null
@@ -0,0 +1 @@
+Quick start guide
\ No newline at end of file
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..de60fff4141064fed4e17cb837102ffd2e584281 100644 (file)
@@ -0,0 +1,25 @@
+<div class="well">
+<h2>Online qualification round schedule</h2>
+<ul>
+<li>Round 1: 30th of January
+<li>Round 2: 27th of February
+<li>Round 3: 13th of March
+<li>Round 4: 27th of March
+</ul>
+<p>Each round will begin at 19:00 and will last one hour and a half (90 minutes)<br>
+For any questions contact us on <a href="http://webchat.oftc.net/?channels=%23mindcoding">#mindcoding</a> (oftc.net)<br>
+Read our <a href="guide">quick-start guide</a>
+</div>
+
+<div class="well">
+<h2>MindCoding National Competition - First Edition</h2>
+<p>We are happy to announce the launch of MindCoding, our fun and challenging national programming competition! It doesn&#39t matter if you have a job, you&#39re a student or you&#39re still in school, what really matters is your passion for problem solving.
+<p>
+Join our community and have the opportunity to learn new things and make a name of yourself! Are you passionate about a certain technology? Do you need a team for working on a project? MindCoding will help you make new friends who share your interests.
+<p>
+The first online round is this Thursday, on the 30th of January. We hope you&#39ll join us!
+<p>
+You will have to solve 4 algorithmic problems of various difficulty levels, and they will be scored based on their level and your problem solving speed. In order for a solution to be considered correct, it must pass all of our tests. We strongly recommend getting used to our platform by solving a few warm-up  <a href="/pb/">challenges</a>.
+<p>
+Good luck and have fun!
+</div>
index e7e81c93c088e5d20e78bb5a18f9aadf1e297226..d0fb4fba7b3dd1530bc0f443fbc162f07ef6e629 100644 (file)
@@ -1 +1 @@
-Gruntmaster 6000
\ No newline at end of file
+MindCoding First Edition
\ No newline at end of file
diff --git a/a/rules.en b/a/rules.en
new file mode 100644 (file)
index 0000000..332c964
--- /dev/null
@@ -0,0 +1,13 @@
+<h3>MindCoding - Rules</h3>
+
+<ul>
+<li>Each round will consist of 4 algorithmic problems.
+<li>Your final score will be calculated by adding your scores for all the problems in the round.
+<li>After submitting a solution it will be evaluated on a few pretests and you will be able to see your result for that given test set.
+<li>At the end of a round, the solution will be evaluated on a set of tests. If it doesn’t output the correct answer for all the tests or it exceeds our memory/time limit for at least one test, it will be scored with 0 points.
+<li>Each problem will have a maximum score between 1000 and 100, depending on it’s difficulty.
+<li>The maximum score you can obtain on a problem decreases as time passes after you’ve read it.
+<li>In order to decide whether your solution is correct, only your last uploaded source file will be taken into consideration.
+<li>If the contestant wishes to resend a solution for a problem, the problem’s maximum score will decrease by 10%.
+<li>Each problem will have a minimum score under which the score can not decrease, no matter how many solutions a contstant submits.
+</ul>
diff --git a/a/rules.en.title b/a/rules.en.title
new file mode 100644 (file)
index 0000000..c191cb5
--- /dev/null
@@ -0,0 +1 @@
+Rules
\ No newline at end of file
index 856d82c20baec055ec268114cab49614efaac15e..72558f139fff16a6e2514074d1cbf22d8ebf1ae1 100644 (file)
--- a/app.psgi
+++ b/app.psgi
@@ -12,7 +12,7 @@ use Digest::SHA qw/sha256/;
 use Log::Log4perl;
 
 use constant ACCESSLOG_FORMAT => '%{X-Forwarded-For}i|%h %u "%r" %>s %b "%{Referer}i" "%{User-agent}i"';
-use constant CONTENT_SECURITY_POLICY => q,default-src 'none'; script-src 'self' www.google-analytics.com; style-src 'self'; img-src 'self'; connect-src 'self',;
+use constant CONTENT_SECURITY_POLICY => q,default-src 'none'; script-src 'self' www.google-analytics.com; style-src 'self'; img-src 'self' www.google-analytics.com; connect-src 'self',;
 
 $Apache2::AuthzCaps::rootdir = $Apache2::Authen::Passphrase::rootdir;
 my $word = qr,(\w+),a;
diff --git a/css/codemirror.css b/css/codemirror.css
new file mode 100644 (file)
index 0000000..3df9948
--- /dev/null
@@ -0,0 +1,265 @@
+/* BASICS */
+
+.CodeMirror {
+  /* Set height, width, borders, and global font properties here */
+  font-family: monospace;
+  height: 300px;
+}
+.CodeMirror-scroll {
+  /* Set scrolling behaviour here */
+  overflow: auto;
+}
+
+/* PADDING */
+
+.CodeMirror-lines {
+  padding: 4px 0; /* Vertical padding around content */
+}
+.CodeMirror pre {
+  padding: 0 4px; /* Horizontal padding of content */
+}
+
+.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+  background-color: white; /* The little square between H and V scrollbars */
+}
+
+/* GUTTER */
+
+.CodeMirror-gutters {
+  border-right: 1px solid #ddd;
+  background-color: #f7f7f7;
+  white-space: nowrap;
+}
+.CodeMirror-linenumbers {}
+.CodeMirror-linenumber {
+  padding: 0 3px 0 5px;
+  min-width: 20px;
+  text-align: right;
+  color: #999;
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
+}
+
+/* CURSOR */
+
+.CodeMirror div.CodeMirror-cursor {
+  border-left: 1px solid black;
+  z-index: 3;
+}
+/* Shown when moving in bi-directional text */
+.CodeMirror div.CodeMirror-secondarycursor {
+  border-left: 1px solid silver;
+}
+.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
+  width: auto;
+  border: 0;
+  background: #7e7;
+  z-index: 1;
+}
+/* Can style cursor different in overwrite (non-insert) mode */
+.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
+
+.cm-tab { display: inline-block; }
+
+/* DEFAULT THEME */
+
+.cm-s-default .cm-keyword {color: #708;}
+.cm-s-default .cm-atom {color: #219;}
+.cm-s-default .cm-number {color: #164;}
+.cm-s-default .cm-def {color: #00f;}
+.cm-s-default .cm-variable {color: black;}
+.cm-s-default .cm-variable-2 {color: #05a;}
+.cm-s-default .cm-variable-3 {color: #085;}
+.cm-s-default .cm-property {color: black;}
+.cm-s-default .cm-operator {color: black;}
+.cm-s-default .cm-comment {color: #a50;}
+.cm-s-default .cm-string {color: #a11;}
+.cm-s-default .cm-string-2 {color: #f50;}
+.cm-s-default .cm-meta {color: #555;}
+.cm-s-default .cm-qualifier {color: #555;}
+.cm-s-default .cm-builtin {color: #30a;}
+.cm-s-default .cm-bracket {color: #997;}
+.cm-s-default .cm-tag {color: #170;}
+.cm-s-default .cm-attribute {color: #00c;}
+.cm-s-default .cm-header {color: blue;}
+.cm-s-default .cm-quote {color: #090;}
+.cm-s-default .cm-hr {color: #999;}
+.cm-s-default .cm-link {color: #00c;}
+
+.cm-negative {color: #d44;}
+.cm-positive {color: #292;}
+.cm-header, .cm-strong {font-weight: bold;}
+.cm-em {font-style: italic;}
+.cm-link {text-decoration: underline;}
+
+.cm-s-default .cm-error {color: #f00;}
+.cm-invalidchar {color: #f00;}
+
+div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
+div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
+.CodeMirror-activeline-background {background: #e8f2ff;}
+
+/* STOP */
+
+/* The rest of this file contains styles related to the mechanics of
+   the editor. You probably shouldn't touch them. */
+
+.CodeMirror {
+  line-height: 1;
+  position: relative;
+  overflow: hidden;
+  background: white;
+  color: black;
+}
+
+.CodeMirror-scroll {
+  /* 30px is the magic margin used to hide the element's real scrollbars */
+  /* See overflow: hidden in .CodeMirror */
+  margin-bottom: -30px; margin-right: -30px;
+  padding-bottom: 30px; padding-right: 30px;
+  height: 100%;
+  outline: none; /* Prevent dragging from highlighting the element */
+  position: relative;
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
+}
+.CodeMirror-sizer {
+  position: relative;
+}
+
+/* The fake, visible scrollbars. Used to force redraw during scrolling
+   before actuall scrolling happens, thus preventing shaking and
+   flickering artifacts. */
+.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+  position: absolute;
+  z-index: 6;
+  display: none;
+}
+.CodeMirror-vscrollbar {
+  right: 0; top: 0;
+  overflow-x: hidden;
+  overflow-y: scroll;
+}
+.CodeMirror-hscrollbar {
+  bottom: 0; left: 0;
+  overflow-y: hidden;
+  overflow-x: scroll;
+}
+.CodeMirror-scrollbar-filler {
+  right: 0; bottom: 0;
+}
+.CodeMirror-gutter-filler {
+  left: 0; bottom: 0;
+}
+
+.CodeMirror-gutters {
+  position: absolute; left: 0; top: 0;
+  padding-bottom: 30px;
+  z-index: 3;
+}
+.CodeMirror-gutter {
+  white-space: normal;
+  height: 100%;
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
+  padding-bottom: 30px;
+  margin-bottom: -32px;
+  display: inline-block;
+  /* Hack to make IE7 behave */
+  *zoom:1;
+  *display:inline;
+}
+.CodeMirror-gutter-elt {
+  position: absolute;
+  cursor: default;
+  z-index: 4;
+}
+
+.CodeMirror-lines {
+  cursor: text;
+}
+.CodeMirror pre {
+  /* Reset some styles that the rest of the page might have set */
+  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
+  border-width: 0;
+  background: transparent;
+  font-family: inherit;
+  font-size: inherit;
+  margin: 0;
+  white-space: pre;
+  word-wrap: normal;
+  line-height: inherit;
+  color: inherit;
+  z-index: 2;
+  position: relative;
+  overflow: visible;
+}
+.CodeMirror-wrap pre {
+  word-wrap: break-word;
+  white-space: pre-wrap;
+  word-break: normal;
+}
+.CodeMirror-code pre {
+  border-right: 30px solid transparent;
+  width: -webkit-fit-content;
+  width: -moz-fit-content;
+  width: fit-content;
+}
+.CodeMirror-wrap .CodeMirror-code pre {
+  border-right: none;
+  width: auto;
+}
+.CodeMirror-linebackground {
+  position: absolute;
+  left: 0; right: 0; top: 0; bottom: 0;
+  z-index: 0;
+}
+
+.CodeMirror-linewidget {
+  position: relative;
+  z-index: 2;
+  overflow: auto;
+}
+
+.CodeMirror-widget {}
+
+.CodeMirror-wrap .CodeMirror-scroll {
+  overflow-x: hidden;
+}
+
+.CodeMirror-measure {
+  position: absolute;
+  width: 100%;
+  height: 0;
+  overflow: hidden;
+  visibility: hidden;
+}
+.CodeMirror-measure pre { position: static; }
+
+.CodeMirror div.CodeMirror-cursor {
+  position: absolute;
+  visibility: hidden;
+  border-right: none;
+  width: 0;
+}
+.CodeMirror-focused div.CodeMirror-cursor {
+  visibility: visible;
+}
+
+.CodeMirror-selected { background: #d9d9d9; }
+.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
+
+.cm-searching {
+  background: #ffa;
+  background: rgba(255, 255, 0, .4);
+}
+
+/* IE7 hack to prevent it from returning funny offsetTops on the spans */
+.CodeMirror span { *vertical-align: text-bottom; }
+
+@media print {
+  /* Hide the cursor when printing */
+  .CodeMirror div.CodeMirror-cursor {
+    visibility: hidden;
+  }
+}
index 9872ee8daf56c22f8819dbf17a8ef45d52c14c23..ffdd79e1843e6a86b48a92714f3815df96d15ab0 100644 (file)
@@ -4,14 +4,6 @@ h1#title{
        font-size: 3em !important;
 }
 
-footer{
-       width: 60em;
-       margin: auto;
-       margin-top: 6em;
-       white-space: pre-wrap;
-       color: #777;
-}
-
 #logo {
        margin: 5em auto 2em;
        display: block;
@@ -48,10 +40,22 @@ div#result{
        text-align: center;
 }
 
+footer{
+       padding: 1.5em 0;
+}
+
 a.dropdown-toggle{
        cursor: pointer;
 }
 
+#sponsors a.logo{
+       margin-bottom: 1em;
+}
+
 .table-fixed{
        table-layout: fixed;
-}
\ No newline at end of file
+}
+
+code {
+       background-color: inherit;
+}
diff --git a/css/logos.css b/css/logos.css
new file mode 100644 (file)
index 0000000..297fe5d
--- /dev/null
@@ -0,0 +1,24 @@
+.logo {
+       background: url("/static/logos.png") no-repeat;
+       display: inline-block;
+       vertical-align: middle;
+}
+
+.logo-bigstep{ background-position: 0 0; width: 250px; height: 72px; }
+.logo-clujlife{ background-position: -260px 0; width: 60px; height: 53px; }
+.logo-cos{ background-position: -330px 0; width: 212px; height: 53px; }
+.logo-csf{ background-position: -552px 0; width: 220px; height: 120px; }
+.logo-emag.logo-dark{ background-position: -782px 0; width: 250px; height: 64px; }
+.logo-emag{ background-position: -1042px 0; width: 250px; height: 83px; }
+.logo-eyc{ background-position: -1302px 0; width: 166px; height: 53px; }
+.logo-facebook{ background-position: -1478px 0; width: 111px; height: 111px; }
+.logo-hermes.logo-dark{ background-position: -1599px 0; width: 192px; height: 101px; }
+.logo-hermes{ background-position: -1801px 0; width: 200px; height: 111px; }
+.logo-hostway{ background-position: -2011px 0; width: 243px; height: 37px; }
+.logo-mindcoding{ background-position: -2264px 0; width: 600px; height: 93px; display: block; }
+.logo-sigla{ background-position: -2874px 0; width: 29px; height: 31px; }
+.logo-usr{ background-position: -2913px 0; width: 105px; height: 52px; }
+.logo-vinsieu{ background-position: -3028px 0; width: 71px; height: 53px; }
+.logo-welcome2cluj{ background-position: -3109px 0; width: 123px; height: 53px; }
+.logo-yardi{ background-position: -3242px 0; width: 250px; height: 61px; }
+.logo-yardi.logo-dark{ background-position: -3502px 0; width: 250px; height: 61px; }
index 750aaa101822763bfb7171b430d375e4089640f0..d847fc12092dc8dcd444e7929088dc02993e59e9 100644 (file)
@@ -3,6 +3,15 @@
        function set_style(name){
                $('#stylesheet').attr("href", "/css/" + name + ".css");
                localStorage.setItem("theme", name);
+               if(name == 'slate' || name == 'cyborg')
+                       $('.logo').addClass('logo-dark');
+               else
+                       $('.logo').removeClass('logo-dark');
+       }
+
+       var theme = localStorage.getItem("theme");
+       if(theme) {
+               set_style(theme);
        }
 
        $( document ).ready(function() {
                $('#theme_cerulean').on('click', function () { set_style("cerulean"); });
                $('#theme_cyborg'  ).on('click', function () { set_style("cyborg"); });
                $('#theme_cosmo'   ).on('click', function () { set_style("cosmo"); });
-       });
 
-       var theme = localStorage.getItem("theme");
-       if(theme) {
-               set_style(theme);
-       }
+               if(!$('#sidebar').size()) {
+                       var content = $('#content');
+                       content.wrapInner('<div class="col-md-9">').append('<div id="sidebar" class="col-md-3">').addClass('row');
+               }
+               $('#sponsors').detach().appendTo($('#sidebar'));
+
+               if(theme) set_style(theme);
+       });
 })();
diff --git a/js/90-ga.js b/js/90-ga.js
new file mode 100644 (file)
index 0000000..4c829f1
--- /dev/null
@@ -0,0 +1,11 @@
+var dnt = navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "1";
+
+if(!dnt) {
+       (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+       (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+       m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+       })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+       ga('create', 'UA-47497115-1', 'mindcoding.ro');
+       ga('send', 'pageview');
+}
diff --git a/lib/Gruntmaster/Page/Pb/Entry.pm b/lib/Gruntmaster/Page/Pb/Entry.pm
new file mode 100644 (file)
index 0000000..8877ce5
--- /dev/null
@@ -0,0 +1,36 @@
+package Gruntmaster::Page::Pb::Entry;
+
+use Gruntmaster::Page::Base pb_entry => '<tmpl_var name>';
+
+use constant FORMATS => [qw/C CPP JAVA PASCAL PERL PYTHON/];
+
+sub _generate{
+       my ($self, $htc, $lang, $env, $contest, $id) = @_;
+       debug $env => "language is '$lang', contest is '$contest', id is '$id'";
+       my $user = $env->{REMOTE_USER};
+       if ($contest && $user && time >= contest_start $contest) {
+               local $Gruntmaster::Data::contest = $contest;
+               mark_open $id, $user;
+               debug $env => "Marking problem $id of contest $contest open by $user";
+       }
+
+       $htc->param(cansubmit => 1);
+       if ($contest) {
+               $htc->param(cansubmit => (time <= contest_end $contest));
+               $htc->param(contest => $contest);
+       }
+       $htc->param(formats => FORMATS);
+       $htc->param(id => $id);
+       local $Gruntmaster::Data::contest = $contest if $contest;
+       $htc->param(name => problem_name $id);
+       $htc->param(author => problem_author $id);
+       $htc->param(owner => problem_owner $id);
+       $htc->param(owner_name => do{ local $Gruntmaster::Data::contest; user_name $htc->param('owner')} );
+       $htc->param(statement => problem_statement $id);
+       $htc->param(timelimit => problem_timeout $id);
+}
+
+sub vary { 'Authorization' }
+sub max_age { 600 }
+
+1
index dbde8c99849fd272e94c9eb7ee599934edcd195f..fb698f086ee899d97cff835857f48432f34ceb60 100644 (file)
--- a/log.conf
+++ b/log.conf
@@ -1,5 +1,7 @@
-log4perl.category. = TRACE, stderr
+log4perl.category. = TRACE, logfile
+
+log4perl.appender.logfile                          = Log::Log4perl::Appender::File
+log4perl.appender.logfile.filename                 = /var/log/mindcoding
+log4perl.appender.logfile.layout                   = Log::Log4perl::Layout::PatternLayout
+log4perl.appender.logfile.layout.ConversionPattern = [%d] [%F{1}:%M{1}:%L] [%p] %m%n
 
-log4perl.appender.stderr                          = Log::Log4perl::Appender::Screen
-log4perl.appender.stderr.layout                   = Log::Log4perl::Layout::PatternLayout
-log4perl.appender.stderr.layout.ConversionPattern = [%d] [%F{1}:%M{1}:%L] [%p] %m%n
diff --git a/run b/run
index fc3bcd04b786316d39f1bf46b7b463be966b2d71..d5ab8d777e923d2b2ebfbd352f874c38e9007c9d 100755 (executable)
--- a/run
+++ b/run
@@ -1,5 +1,5 @@
 #!/bin/bash
-export PURGE_HOST=gm.ieval.ro
+export PURGE_HOST=mindcoding.ro
 export AAP_ROOTDIR=/var/www/auth/us/
 export PLACK_ENV=deployment
-exec start_server --port=8081 -- plackup -s Starlet -Ilib -L Delayed
+exec start_server --port=8082 -- plackup -s Starlet -Ilib -L Delayed --keepalive-timeout=100000 --max-reqs-per-child=1000 --max-workers=50
diff --git a/static/favicon.png b/static/favicon.png
new file mode 100644 (file)
index 0000000..b7df921
Binary files /dev/null and b/static/favicon.png differ
diff --git a/static/guide/1.png b/static/guide/1.png
new file mode 100755 (executable)
index 0000000..b794601
Binary files /dev/null and b/static/guide/1.png differ
diff --git a/static/guide/2.png b/static/guide/2.png
new file mode 100755 (executable)
index 0000000..cf09867
Binary files /dev/null and b/static/guide/2.png differ
diff --git a/static/guide/3.2.png b/static/guide/3.2.png
new file mode 100755 (executable)
index 0000000..c55eab8
Binary files /dev/null and b/static/guide/3.2.png differ
diff --git a/static/guide/3.png b/static/guide/3.png
new file mode 100755 (executable)
index 0000000..34cdab1
Binary files /dev/null and b/static/guide/3.png differ
diff --git a/static/guide/4.2.png b/static/guide/4.2.png
new file mode 100755 (executable)
index 0000000..90d31a6
Binary files /dev/null and b/static/guide/4.2.png differ
diff --git a/static/guide/4.png b/static/guide/4.png
new file mode 100755 (executable)
index 0000000..dd89593
Binary files /dev/null and b/static/guide/4.png differ
diff --git a/static/guide/5.png b/static/guide/5.png
new file mode 100755 (executable)
index 0000000..c2f1d4d
Binary files /dev/null and b/static/guide/5.png differ
diff --git a/static/logos.png b/static/logos.png
new file mode 100644 (file)
index 0000000..164a640
Binary files /dev/null and b/static/logos.png differ
index c0f928d6d13f33b9db1be1f8433ee0c8d679f87e..66e13d624aec71f59d77e4f5baa22adafbf2f58e 100644 (file)
@@ -1,5 +1,33 @@
+
+</div>
+
+<div id="sponsors">
+<h3>Official sponsors</h3>
+<a class="logo logo-yardi" href="https://www.facebook.com/YardiRomania"></a>
+<a class="logo logo-emag" href="http://www.fundatiaemag.ro/"></a>
+<a class="logo logo-hostway" href="http://www.hostway.ro/"></a>
+<a class="logo logo-bigstep" href="http://www.bigstep.com/"></a>
+</div>
+
 <footer>
-Dilmom: Why don't you call your product the Gruntmaster 6000?
-Dilbert: What kind of product do you see when you imagine a Gruntmaster 6000?
-Dilmom: Well, it's a stripped-down version of the Gruntmaster 9000, of course. But it's software-upgradeable.
+<div class="row">
+<div class="col-md-6 column text-center">
+<a class="logo logo-hermes" href="http://www.societatea-hermes.ro"></a>
+</div>
+
+<div class="col-md-6 column text-center">
+<a class="logo logo-facebook" href="http://www.facebook.com/mindcodingcluj"></a>
+</div>
+</div>
+
+<h3> Partners </h3>
+<a href="http://cs.ubbcluj.ro" class="logo logo-csf"></a>
+<a href="http://www.uniunea.ro" class="logo logo-usr"></a>
+<a href="http://www.coscj.ro" class="logo logo-cos"></a>
+<a href="http://www.cluj2015.ro/romana" class="logo logo-eyc"></a>
+<h3> Media Partners </h3>
+<a href="http://www.clujlife.com" class="logo logo-clujlife"></a>
+<a href="http://www.vinsieu.ro/eveniment/cluj/cluj-napoca/alte-evenimente/mindcoding/88970/e.html" class="logo logo-vinsieu"></a>
+<a href="http://www.welcome2cluj.com" class="logo logo-welcome2cluj"></a>
 </footer>
+</div>
index c4f51f6c9c07e99040daf75ed209e23f28525438..5f08d375b5249dffb5efb977b1eaa31c71e9f0dc 100644 (file)
@@ -1,16 +1,17 @@
 <!DOCTYPE html>
-<title>TITLE_GOES_HERE</title>
+<title>TITLE_GOES_HERE | MindCoding</title>
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
-<link rel="stylesheet" href="/css/cyborg.css" id="stylesheet">
+<link rel="shortcut icon" href="/static/favicon.png">
+<link rel="stylesheet" href="/css/cosmo.css" id="stylesheet">
 <script src="/js.js" type="text/javascript"></script>
 
 <nav class="navbar navbar-default navbar-static-top" role="navigation">
 <div class="container-fluid">
 <div class="navbar-header">
 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
-<a class="navbar-brand" href="/">Gruntmaster 6000</a>
+<a class="navbar-brand" href="/"><div class="logo logo-sigla"></div></a>
 </div>
 
 <div class="collapse navbar-collapse">
 <li><a href="/pb/">Problems</a>
 <li><a href="/ct/">Contests</a>
 <li><a href="/account">Account</a>
+<li><a href="/about">About</a>
 </ul>
 
 <ul class="nav navbar-nav navbar-right">
+<li><a href="/rules">Rules</a>
 <li><a class="dropdown-toggle" data-toggle="dropdown"> Theme <span class="caret"></span></a>
 
 <ul class="dropdown-menu" role="menu">
@@ -38,5 +41,9 @@
 
 <div class="container-fluid">
 
+<div class="logo logo-mindcoding center-block"></div>
+
 <h1 id="title">TITLE_GOES_HERE</h1>
 <div id="result"></div>
+
+<div id="content">
index f3d0f7579603123cf8e29590f69644e382f33d94..e7996a0b7d5770bca1a096c9b8183a61d9fe6ef3 100644 (file)
@@ -4,7 +4,11 @@
 </div>
 
 <div class="col-md-3">
+<div id="sidebar"></div>
+
+<h3>Problem information</h3>
 <dl>
+<dt>Time limit:</dt> <dd><tmpl_var timelimit>&nbsp;s</dd>
 <dt>Author</dt> <dd><tmpl_var author></dd>
 <dt>Owner</dt> <dd><a href="/us/<tmpl_var owner>"><tmpl_if owner_name><tmpl_var owner_name><tmpl_else><tmpl_var owner></tmpl_if></a></dd>
 </dl>
This page took 0.02929 seconds and 4 git commands to generate.