Skip to content

Commit

Permalink
Refactor of the static pages on the site
Browse files Browse the repository at this point in the history
  • Loading branch information
eshton committed Mar 26, 2011
1 parent 2bd7e87 commit 64c0977
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 114 deletions.
40 changes: 26 additions & 14 deletions apps/frontend/config/routing.yml
Expand Up @@ -31,24 +31,41 @@ editmyprofile:
param: { module: sfGuardAuth, action: editMyProfile }
requirements: { sf_culture: (?:hu|en) }

rules:
url: /:sf_culture/rules
param: { module: rules, action: index }
requirements: { sf_culture: (?:hu|en) }

#######
#
# CMS PAGES
#
#######
homepage:
url: /:sf_culture
param:
module: replay
action: index
module: cms
action: home
sf_culture: <?php echo sfPropel::getDefaultCulture() . "\n" ?>
requirements: { sf_culture: (?:hu|en) }

replayhome:
url: /:sf_culture/replay
param: { module: replay, action: index }
url: /:sf_culture/home
param: { module: cms, action: home }
requirements: { sf_culture: (?:hu|en) }

contact:
url: /:sf_culture/contact
param: { module: cms, action: contact }
requirements: { sf_culture: (?:hu|en) }

rules:
url: /:sf_culture/rules
param: { module: cms, action: rules }
requirements: { sf_culture: (?:hu|en) }



#######
#
# REPLAY PAGES
#
#######
uploadreplay:
url: /:sf_culture/replay/upload
param: { module: replay, action: upload }
Expand Down Expand Up @@ -84,11 +101,6 @@ deletereplay:
param: { module: replay, action: delete }
requirements: { sf_culture: (?:hu|en) }

contact:
url: /:sf_culture/replay/contact
param: { module: replay, action: contact }
requirements: { sf_culture: (?:hu|en) }

# generic rules
# please, remove them by adding more specific rules
default_index:
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/i18n/en/messages.xml
Expand Up @@ -5,7 +5,7 @@
<header/>
<body>
<trans-unit id="1">
<source>Replays index</source>
<source>Home</source>
<target/>
</trans-unit>
<trans-unit id="2">
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/i18n/hu/messages.xml
Expand Up @@ -5,8 +5,8 @@
<header/>
<body>
<trans-unit id="1">
<source>Replays index</source>
<target>Replay lista</target>
<source>Home</source>
<target>Kezdőoldal</target>
</trans-unit>
<trans-unit id="2">
<source>Upload replay</source>
Expand Down
22 changes: 22 additions & 0 deletions apps/frontend/modules/cms/actions/actions.class.php
@@ -0,0 +1,22 @@
<?php

/**
*
* @package Cupapp
* @subpackage cms
* @author Your name here
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class cmsActions extends sfActions {

public function executeHome(sfWebRequest $request) {

}
public function executeRules(sfWebRequest $request) {

}
public function executeContact(sfWebRequest $request) {

}

}
26 changes: 26 additions & 0 deletions apps/frontend/modules/cms/templates/contactSuccess.php
@@ -0,0 +1,26 @@
<?php slot('title'); ?>
<?php echo __('Contact') ?>
<?php end_slot(); ?>

<?php slot('leftbar'); ?>
<?php include_partial('global/leftbar') ?>
<?php end_slot(); ?>

<?php slot('rightbar'); ?>
<?php include_partial('global/rightbar') ?>
<?php end_slot(); ?>

<div class="greybox">
<h1 id="contact_title"><?php echo __('Contact') ?></h1>
<div>
<div style="float:left">
zsol <br />
anathien <br />
aston
</div>
<div style="vertical-align: middle; line-height:3.7em">
@starcraft2.hu
</div>
</div>
<div style="clear:both;"></div>
</div>
24 changes: 24 additions & 0 deletions apps/frontend/modules/cms/templates/homeSuccess.php
@@ -0,0 +1,24 @@
<?php slot('title'); ?>
<?php echo __('Home') ?>
<?php end_slot(); ?>

<?php slot('leftbar'); ?>
<?php include_partial('global/leftbar') ?>
<?php end_slot(); ?>

<?php slot('rightbar'); ?>
<?php include_partial('global/rightbar') ?>
<?php end_slot(); ?>

<div class="greybox">
<h1 id="replay_index_title"><?php echo __('Home') ?></h1>
<div id="index_div">
<p>
Hello dear visitor! <br/><br/>
<?php echo __("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.", array('%%contact%%' => link_to(__("Contact"), 'replay/contact'))); ?> <br/><br/>
<?php echo __("Thanks in advance.")?> <br/>
Zsol <br/><br/>
</p>
</div>
<div style="clear:both;"></div>
</div>
Expand Up @@ -6,7 +6,7 @@
<?php include_partial('global/leftbar') ?>
<?php end_slot(); ?>

<?php slot('rightbar'); ?>
<?php slot('rightbar'); ?>
<?php include_partial('global/rightbar') ?>
<?php end_slot(); ?>

Expand Down
16 changes: 0 additions & 16 deletions apps/frontend/modules/replay/actions/contactAction.class.php

This file was deleted.

29 changes: 0 additions & 29 deletions apps/frontend/modules/replay/actions/indexAction.class.php

This file was deleted.

10 changes: 0 additions & 10 deletions apps/frontend/modules/replay/templates/_contactContent.php

This file was deleted.

17 changes: 0 additions & 17 deletions apps/frontend/modules/replay/templates/indexSuccess.php

This file was deleted.

21 changes: 0 additions & 21 deletions apps/frontend/modules/rules/actions/actions.class.php

This file was deleted.

2 changes: 0 additions & 2 deletions apps/frontend/modules/rules/config/view.yml

This file was deleted.

2 changes: 1 addition & 1 deletion apps/frontend/templates/_menu.php
@@ -1,5 +1,5 @@
<div class="menu">
<a href="<?php echo url_for('@replayhome') ?>"><?php echo __('Replays index') ?></a>
<a href="<?php echo url_for('@replayhome') ?>"><?php echo __('Home') ?></a>
<a href="<?php echo url_for('@uploadreplay') ?>"><?php echo __('Upload replay') ?></a>
<a href="<?php echo url_for('@browsereplay') ?>"><?php echo __('Browse replays') ?></a>
<a href="<?php echo url_for('@contact') ?>"><?php echo __('Contact') ?></a>
Expand Down
19 changes: 19 additions & 0 deletions test/functional/frontend/cmsActionsTest.php
@@ -0,0 +1,19 @@
<?php

include(dirname(__FILE__).'/../../bootstrap/functional.php');

$browser = new sfTestFunctional(new sfBrowser());

$browser->
get('/cms/index')->

with('request')->begin()->
isParameter('module', 'cms')->
isParameter('action', 'index')->
end()->

with('response')->begin()->
isStatusCode(200)->
checkElement('body', '!/This is a temporary page/')->
end()
;

0 comments on commit 64c0977

Please sign in to comment.