Permalink
Browse files

Merge branch 'master' of github.com:zsol/cupapp

  • Loading branch information...
2 parents 9a1856d + 4a02ff9 commit e1c98a61aa23945b5357af6a27b9e325f90c7f98 @zsol committed Mar 26, 2011
Showing with 305 additions and 100 deletions.
  1. +83 −19 apps/frontend/i18n/en/messages.xml
  2. +3 −3 apps/frontend/i18n/hu/messages.xml
  3. +9 −0 apps/frontend/modules/boxes/templates/_ie6.php
  4. +12 −3 apps/frontend/modules/boxes/templates/_lastComments.php
  5. +1 −1 apps/frontend/modules/boxes/templates/_lastReplays.php
  6. +1 −1 apps/frontend/modules/boxes/templates/_leftLinks.php
  7. +2 −2 apps/frontend/modules/boxes/templates/_loginBox.php
  8. +1 −1 apps/frontend/modules/boxes/templates/_myLastReplays.php
  9. +2 −2 apps/frontend/modules/boxes/templates/_thanks.php
  10. +1 −1 apps/frontend/modules/comment/templates/_replayComments.php
  11. +3 −16 apps/frontend/modules/sfGuardAuth/actions/editMyProfileAction.class.php
  12. +1 −4 apps/frontend/modules/sfGuardAuth/actions/registerAction.class.php
  13. +2 −8 apps/frontend/templates/_leftbar.php
  14. +14 −5 config/app.yml
  15. +3 −0 config/getEnvironment.php
  16. +57 −0 lib/helper/AvatarHelper.class.php
  17. +9 −0 lib/helper/ImageHelper.class.php
  18. +1 −5 lib/helper/RegisterHelper.class.php
  19. +1 −2 lib/model/other/RacePeer.class.php
  20. +4 −17 lib/model/sfGuardUser.php
  21. +77 −7 lib/model/sfGuardUserProfile.php
  22. +18 −3 web/css/main.css
  23. BIN web/images/baby_seal.jpg
  24. BIN web/images/icons/comments.png
  25. BIN web/images/icons/control_play.png
  26. BIN web/images/icons/control_play_blue.png
  27. BIN web/images/icons/delete.png
  28. BIN web/images/icons/heart.png
  29. BIN web/images/icons/link.png
  30. BIN web/images/icons/magnifier.png
  31. BIN web/images/icons/user.png
  32. BIN web/images/{unknown.png → unknown_medium.png}
  33. BIN web/images/unknown_normal.png
  34. BIN web/images/unknown_small.png
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xliff PUBLIC "-//XLIFF//DTD XLIFF//EN" "http://www.oasis-open.org/committees/xliff/documents/xliff.dtd">
<xliff version="1.0">
- <file source-language="EN" target-language="en" datatype="plaintext" original="messages" date="2011-02-19T10:35:22Z" product-name="messages">
+ <file source-language="EN" target-language="en" datatype="plaintext" original="messages" date="2011-03-26T12:43:52Z" product-name="messages">
<header/>
<body>
<trans-unit id="1">
@@ -60,10 +60,6 @@
<source>Message</source>
<target/>
</trans-unit>
- <trans-unit id="15">
- <source>Standard informations</source>
- <target/>
- </trans-unit>
<trans-unit id="16">
<source>Map name</source>
<target/>
@@ -253,7 +249,7 @@
<target/>
</trans-unit>
<trans-unit id="64">
- <source>This site has never been tested on Internet Explorer ... at all! Please if you are still using Internet Explorer 6 please at least upgrade to IE8, that should work fine.</source>
+ <source>This site has never been tested on Internet Explorer ... at all! If you are still using IE6, then SHAME ON YOU! Imagine a baby seal has just died because of you! Now go and get a decent browser!</source>
<target/>
</trans-unit>
<trans-unit id="65">
@@ -285,7 +281,7 @@
<target/>
</trans-unit>
<trans-unit id="74">
- <source>Special thanks</source>
+ <source>Thanks</source>
<target/>
</trans-unit>
<trans-unit id="75">
@@ -336,10 +332,6 @@
<source>I am only interested in replays in the category of %%category%% and game type of %%gametype%%</source>
<target/>
</trans-unit>
- <trans-unit id="87">
- <source>Please order the list for me by %%orderby%%</source>
- <target/>
- </trans-unit>
<trans-unit id="88">
<source>Search/Filter</source>
<target/>
@@ -364,14 +356,6 @@
<source>Please visit &lt;a href="%%url%%"&gt;%%url%%&lt;/a&gt; to confirm your email address.</source>
<target/>
</trans-unit>
- <trans-unit id="95">
- <source>Hello dear visitor! What you see now are the beginnings of a replay sharing site. Please use it to your pleasure! If you find any bugs, sending the details to my email address (%%contact%%) would help a lot. Thanks in advance.</source>
- <target/>
- </trans-unit>
- <trans-unit id="96">
- <source>Ps: Don't store your replays here, as I might have to wipe the database every now and then.</source>
- <target/>
- </trans-unit>
<trans-unit id="97">
<source>Your email is already confirmed.</source>
<target/>
@@ -440,6 +424,86 @@
<source>Other languages</source>
<target/>
</trans-unit>
+ <trans-unit id="114">
+ <source>Remember me</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="115">
+ <source>Sign in</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="116">
+ <source>No comments yet. This is a rare moment, so appreciate it!</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="117">
+ <source>Replay not given</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="118">
+ <source>Replay not found</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="119">
+ <source>Sorry, this replay is not amendable.</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="120">
+ <source>Sorry, you are not allowed to delete this replay.</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="121">
+ <source>Too short! At least %%ss%% characters!</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="122">
+ <source>This field is required!</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="123">
+ <source>Amend Replay</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="124">
+ <source>Amend replay</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="125">
+ <source>Delete replay</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="126">
+ <source>Are you sure?</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="127">
+ <source>Standard information</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="128">
+ <source>Region</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="129">
+ <source>Date of play</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="130">
+ <source>What you see now are the beginnings of a replay sharing site. Please use it to your pleasure! If you find any bugs, sending the details to my email address (%%contact%%) would help a lot.</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="131">
+ <source>Thanks in advance.</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="132">
+ <source>Please order the list for me by %%orderby%% in %%order%% order.</source>
+ <target/>
+ </trans-unit>
+ <trans-unit id="133">
+ <source>Image cannot be created.</source>
+ <target/>
+ </trans-unit>
</body>
</file>
</xliff>
@@ -113,8 +113,8 @@
<target>Figyelem!</target>
</trans-unit>
<trans-unit id="29">
- <source>This site has never been tested on Internet Explorer ... at all! Please if you are still using Internet Explorer 6 please at least upgrade to IE8, that should work fine.</source>
- <target>Ezt az oldalt sose teszteltük Internet Explorerrel ... egyáltalán! Ha még mindig Internet Explorer 6-ot használsz, legalább 8-asra frissíts, az elvileg megy.</target>
+ <source>This site has never been tested on Internet Explorer ... at all! If you are still using IE6, then SHAME ON YOU! Imagine a baby seal has just died because of you! Now go and get a decent browser!</source>
+ <target>Ezt az oldalt sose teszteltük Internet Explorerrel ... egyáltalán! Ha még mindig IE6-ot használsz, akkor SZÉGYELD MAGAD! Képzeld el, hogy egy tündibündi bébifóka éppen meghalt miattad! Na most menj és szerezz egy normális böngészőt!</target>
</trans-unit>
<trans-unit id="30">
<source>Thank you for your understanding and sorry for the inconveniences it may cause.</source>
@@ -129,7 +129,7 @@
<target>Menü</target>
</trans-unit>
<trans-unit id="35">
- <source>Special thanks</source>
+ <source>Thanks</source>
<target>Köszönet</target>
</trans-unit>
<trans-unit id="36">
@@ -0,0 +1,9 @@
+<div class="greybox">
+ <h3><img alt="warning" src="/images/icons/delete.png"/> <?php echo __('Warning!') ?></h3>
+ <p style="text-align:center;"><img src="/images/baby_seal.jpg" alt="baby_seal"/></p>
+
+ <p style="font-size:0.8em;text-align:justify;"><?php echo __('This site has never been tested on Internet Explorer ... at all! If you are still using IE6, then SHAME ON YOU! Imagine a baby seal has just died because of you! Now go and get a decent browser!'); ?></p>
+ <img style="float:left;padding:3px 5px 5px 0px;" alt="nottestedinIE" src="/images/misc/not_tested_in_ie.png"/>
+ <p style="font-size:0.8em;text-align:justify;"><?php echo __('Thank you for your understanding and sorry for the inconveniences it may cause.'); ?></p>
+ <a style="font-size: 10px;" href="http://www.ie6countdown.com">www.ie6countdown.com</a>
+</div>
@@ -1,14 +1,23 @@
<div class="greybox">
- <h3><?php echo __('Latest comments') ?></h3>
+ <h3><img alt="comments" src="/images/icons/comments.png"/> <?php echo __('Latest comments') ?></h3>
<?php if (count($comments) == 0) :?>
<?php echo __('No comments yet. This is a rare moment, so appreciate it!') ?>
<?php else: ?>
<?php foreach($comments as $comment) : ?>
<?php $replay = $comment->getReplay() ?>
<div class="comment_list_box">
- <?php echo link_to($comment->getsfGuardUser()->getUserName(). ': ' .$comment->getCommentPrefix(22), '@viewreplay?id='.$replay->getId().'&name='.$replay.'#comment_'.$comment->getId()) ?>
- <span class="comment_list_box_time"><?php echo $replay->getCreatedAt() ?></span>
+ <div class="comment_list_box_header">
+ <div style="float:left;"><img style="float:left;margin:4px 3px 3px 0px;" alt="avatar" src="<?php echo $comment->getsfGuardUser()->getProfile()->getAvatarOrDefaultUrl(AvatarHelper::SIZE_SMALL) ?>"/></div>
+ <div style="float:right;overflow:visible;margin:-1px 0px 0px 0px;padding:0px;">
+ <a href="<?php echo url_for('@viewreplay?id='.$replay->getId().'&name='.$replay.'#comment_'.$comment->getId()) ?>"><img alt="show comment" src="/images/icons/magnifier.png"/></a>
+ </div>
+ <div><?php echo $comment->getsfGuardUser()->getUserName() ?></b> @ <?php echo $replay->getCreatedAt() ?></div>
+ <div><?php echo link_to(substr($replay,0,28).'..','@viewreplay?id='.$replay->getId().'&name='.$replay) ?></div>
+ </div>
+
+ <?php echo $comment->getCommentPrefix(150) ?>
</div>
+ <div style="clear:both;"></div>
<?php endforeach;?>
<?php endif; ?>
</div>
@@ -1,5 +1,5 @@
<div class="greybox">
- <h3><?php echo __('Last uploaded replays') ?></h3>
+ <h3><img alt="playbutton" src="/images/icons/control_play.png"/> <?php echo __('Last uploaded replays') ?></h3>
<?php if (count($replays) == 0) : ?>
<?php echo __('There is no replay in the system right now.') ?>
<?php else : ?>
@@ -1,5 +1,5 @@
<div class="greybox">
- <h3><?php echo __('Links') ?></h3>
+ <h3><img alt="link" src="/images/icons/link.png"/> <?php echo __('Links') ?></h3>
<ul>
<li><a href="http://eu.battle.net/sc2/en/"><?php echo __('Starcraft2 website') ?></a></li>
<li><a href="http://teamliquid.net/"><?php echo __('Teamliquid') ?></a></li>
@@ -1,7 +1,7 @@
<div class="greybox" style="margin-top:0px;">
- <h3><?php echo __('Profile') ?></h3>
+ <h3><img alt="user" src="/images/icons/user.png"/> <?php echo __('Profile') ?></h3>
<?php if ($sf_user->isAuthenticated()) : ?>
- <img style="float:right;" alt="avatar" src="<?php echo $sf_user->getProfile()->getAvatarOrDefaultUrl() ?>"/>
+ <img style="float:right;" alt="avatar" src="<?php echo $sf_user->getProfile()->getAvatarOrDefaultUrl(AvatarHelper::SIZE_NORMAL) ?>"/>
<?php echo __('Logged in as') ?> <b><?php echo $sf_user->getUsername() ?></b><br/>
<a href="<?php echo url_for('@editmyprofile') ?>"><?php echo __('Edit profile') ?></a><br/>
<a href="<?php echo url_for('@sf_guard_signout') ?>"><?php echo __('Log out') ?></a>
@@ -1,5 +1,5 @@
<div class="greybox">
- <h3><?php echo __('My replays') ?></h3>
+ <h3><img alt="playbutton" src="/images/icons/control_play_blue.png"/> <?php echo __('My replays') ?></h3>
<?php if (count($replays) == 0) : ?>
<?php echo __('You have no replays in the system.') ?>
<?php else : ?>
@@ -1,7 +1,7 @@
<div class="greybox">
- <h3><?php echo __('Special thanks') ?></h3>
+ <h3><img alt="heart" src="/images/icons/heart.png"/> <?php echo __('Thanks') ?></h3>
<ul>
+ <li style="text-align:center;"><a href="http://github.com/zsol/cupapp"><img src="/images/misc/github.png"/></a></li>
<li><a href="http://www.symfony-project.org/"><img src="/images/misc/symfony.gif"/></a></li>
- <li><a href="http://github.com/"><img src="/images/misc/github.png"/></a></li>
</ul>
</div>
@@ -15,7 +15,7 @@
<span style="float:right;"><?php echo $comment->getCreatedAt() ?></span>
</div>
<div class="comment_body">
- <div class="comment_avatar"><img style="float:left;" alt="avatar" src="<?php echo $user->getProfile()->getAvatarOrDefaultUrl() ?>"/></div>
+ <div class="comment_avatar"><img style="float:left;" alt="avatar" src="<?php echo $user->getProfile()->getAvatarOrDefaultUrl(AvatarHelper::SIZE_MEDIUM) ?>"/></div>
<div class="comment_content"><?php echo str_replace(array("\r\n", "\n", "\r"), "<br />", $comment->getComment()); ?></div>
</div>
</div>
@@ -44,23 +44,10 @@ public function execute($request) {
//Create avatar
$file = $this->form->getValue('avatar');
if ($file) {
- $oldFile = null;
- if ($userProfile->getAvatar()) {
- $oldFile = $userProfile->getAvatarPath();
- }
$filePath = $file->getTempName();
- $saveName = $user->getAvatarSaveName();
- $savePath = $user->getAvatarSavePath();
- try {
- RegisterHelper::createThumbnail($filePath, $savePath);
- $userProfile->setAvatar($saveName);
- } catch (Exception $e) {
-
- }
-
- //Delete the old one
- if ($oldFile) {
- unlink($oldFile);
+ if (!$userProfile->createAndSaveAvatar($filePath)) {
+ $this->getUser()->setFlash('error_message', $i18n->__('Image cannot be created.'));
+ $this->redirect('@homepage');
}
}
@@ -47,11 +47,8 @@ public function execute($request) {
$file = $this->form->getValue('avatar');
if ($file) {
$filePath = $file->getTempName();
- $saveName = $user->getAvatarSaveName();
- $savePath = $user->getAvatarSavePath();
try {
- RegisterHelper::createThumbnail($filePath, $savePath);
- $userProfile->setAvatar($saveName);
+ $userProfile->createAndSaveAvatar($filePath);
} catch (Exception $e) {
$this->getUser()->setFlash('error_message', $e->getMessage());
$this->redirect('@homepage');
@@ -1,10 +1,4 @@
<?php /*include_partial('boxes/leftMenu') */ ?>
<?php include_partial('boxes/leftLinks') ?>
-<?php include_partial('boxes/thanks') ?>
-
-<div class="greybox">
- <h3><?php echo __('Warning!') ?></h3>
- <p style="text-align:center;"><img src="/images/misc/not_tested_in_ie.png"/></p>
- <p style="font-size:0.8em;"><?php echo __('This site has never been tested on Internet Explorer ... at all! Please if you are still using Internet Explorer 6 please at least upgrade to IE8, that should work fine.'); ?></p>
- <p style="font-size:0.8em;"><?php echo __('Thank you for your understanding and sorry for the inconveniences it may cause.'); ?></p>
-</div>
+<?php include_partial('boxes/ie6') ?>
+<?php include_partial('boxes/thanks') ?>
View
@@ -21,12 +21,20 @@ all:
password_min_length: 5
password_max_length: 50
email_min_length: 5
- avatar_max_upload_size: 50000 # 50 Kbytes
- avatar_width: 50
- avatar_height: 50
- profile:
- default_avatar: /images/unknown.png
+ avatar:
+ max_upload_size: 50000 # 50 Kbytes
+ width_normal: 70
+ height_normal: 70
+ width_medium: 50
+ height_medium: 50
+ width_small: 23
+ height_small: 23
+ image_format: png
+ image_format_mime_type: image/png
+ default_avatar_normal: /images/unknown_normal.png
+ default_avatar_medium: /images/unknown_medium.png
+ default_avatar_small: /images/unknown_small.png
boxes:
last_uploaded_replays_num: 5
@@ -47,6 +55,7 @@ all:
hu:
name: Magyar
+ #this needs to be refactored a bit
google_analytics:
code: >
<script type="text/javascript">
@@ -1,5 +1,8 @@
<?php
+$env = 'dev';
+$debug = true;
+
if ($_SERVER['SERVER_NAME'] == 'test.cupapp.com') {
$env = 'dev';
$debug = true;
Oops, something went wrong.

0 comments on commit e1c98a6

Please sign in to comment.