Permalink
Browse files

Generate backend

  • Loading branch information...
kalimatas committed Jul 10, 2011
1 parent b972ea8 commit 363d8d03c3bdd298a87a9b030d5ff57fa04cc079
Showing with 531 additions and 5 deletions.
  1. +5 −0 apps/backend/config/app.yml
  2. +8 −0 apps/backend/config/backendConfiguration.class.php
  3. +7 −0 apps/backend/config/cache.yml
  4. +42 −0 apps/backend/config/factories.yml
  5. +10 −0 apps/backend/config/filters.yml
  6. +34 −0 apps/backend/config/routing.yml
  7. +5 −0 apps/backend/config/security.yml
  8. +35 −0 apps/backend/config/settings.yml
  9. +20 −0 apps/backend/config/view.yml
  10. +5 −0 apps/backend/lib/myUser.class.php
  11. +16 −0 apps/backend/modules/category/actions/actions.class.php
  12. +28 −0 apps/backend/modules/category/config/generator.yml
  13. +13 −0 apps/backend/modules/category/lib/categoryGeneratorConfiguration.class.php
  14. +13 −0 apps/backend/modules/category/lib/categoryGeneratorHelper.class.php
  15. +53 −0 apps/backend/modules/job/actions/actions.class.php
  16. +47 −0 apps/backend/modules/job/config/generator.yml
  17. +13 −0 apps/backend/modules/job/lib/jobGeneratorConfiguration.class.php
  18. +13 −0 apps/backend/modules/job/lib/jobGeneratorHelper.class.php
  19. +4 −0 apps/backend/modules/job/templates/_generated_token.php
  20. +35 −0 apps/backend/templates/layout.php
  21. +8 −0 config/app.yml
  22. +29 −0 lib/form/doctrine/BackendJobeetJobForm.class.php
  23. +1 −0 lib/form/doctrine/JobeetCategoryForm.class.php
  24. +10 −5 lib/form/doctrine/JobeetJobForm.class.php
  25. +10 −0 lib/model/doctrine/JobeetJob.class.php
  26. +8 −0 lib/model/doctrine/JobeetJobTable.class.php
  27. +19 −0 test/functional/backend/categoryActionsTest.php
  28. +19 −0 test/functional/backend/jobActionsTest.php
  29. +7 −0 web/backend.php
  30. +13 −0 web/backend_dev.php
  31. +1 −0 web/sfDoctrinePlugin
@@ -0,0 +1,5 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/11-App
+
+# default values
+#all:
@@ -0,0 +1,8 @@
+<?php
+
+class backendConfiguration extends sfApplicationConfiguration
+{
+ public function configure()
+ {
+ }
+}
@@ -0,0 +1,7 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/09-Cache
+
+default:
+ enabled: false
+ with_layout: false
+ lifetime: 86400
@@ -0,0 +1,42 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/05-Factories
+
+prod:
+ logger:
+ class: sfNoLogger
+ param:
+ level: err
+ loggers: ~
+
+test:
+ storage:
+ class: sfSessionTestStorage
+ param:
+ session_path: %SF_TEST_CACHE_DIR%/sessions
+
+ response:
+ class: sfWebResponse
+ param:
+ send_http_headers: false
+
+ mailer:
+ param:
+ delivery_strategy: none
+
+dev:
+ mailer:
+ param:
+ delivery_strategy: none
+
+all:
+ routing:
+ class: sfPatternRouting
+ param:
+ generate_shortest_url: true
+ extra_parameters_as_query_string: true
+
+ view_cache_manager:
+ class: sfViewCacheManager
+ param:
+ cache_key_use_vary_headers: true
+ cache_key_use_host_name: true
@@ -0,0 +1,10 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/12-Filters
+
+rendering: ~
+security: ~
+
+# insert your own filters here
+
+cache: ~
+execution: ~
@@ -0,0 +1,34 @@
+jobeet_category:
+ class: sfDoctrineRouteCollection
+ options:
+ model: JobeetCategory
+ module: category
+ prefix_path: /category
+ column: id
+ with_wildcard_routes: true
+
+jobeet_job:
+ class: sfDoctrineRouteCollection
+ options:
+ model: JobeetJob
+ module: job
+ prefix_path: /job
+ column: id
+ with_wildcard_routes: true
+
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/10-Routing
+
+# default rules
+homepage:
+ url: /
+ param: { module: job, action: index }
+
+# generic rules
+# please, remove them by adding more specific rules
+default_index:
+ url: /:module
+ param: { action: index }
+
+default:
+ url: /:module/:action/*
@@ -0,0 +1,5 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/08-Security
+
+default:
+ is_secure: false
@@ -0,0 +1,35 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/04-Settings
+
+prod:
+ .settings:
+ no_script_name: false
+ logging_enabled: false
+
+dev:
+ .settings:
+ error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?>
+ web_debug: true
+ cache: false
+ no_script_name: false
+ etag: false
+
+test:
+ .settings:
+ error_reporting: <?php echo ((E_ALL | E_STRICT) ^ E_NOTICE)."\n" ?>
+ cache: false
+ web_debug: false
+ no_script_name: false
+ etag: false
+
+all:
+ .settings:
+ # Form security secret (CSRF protection)
+ csrf_secret: ec95ded856fd68e66fb952bd023c67cc45cd2415
+
+ # Output escaping settings
+ escaping_strategy: true
+ escaping_method: ESC_SPECIALCHARS
+
+ # Enable the database manager
+ use_database: true
@@ -0,0 +1,20 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/13-View
+
+default:
+ http_metas:
+ content-type: text/html
+
+ metas:
+ #title: symfony project
+ #description: symfony project
+ #keywords: symfony, project
+ #language: en
+ #robots: index, follow
+
+ stylesheets: [main.css]
+
+ javascripts: []
+
+ has_layout: true
+ layout: layout
@@ -0,0 +1,5 @@
+<?php
+
+class myUser extends sfBasicSecurityUser
+{
+}
@@ -0,0 +1,16 @@
+<?php
+
+require_once dirname(__FILE__).'/../lib/categoryGeneratorConfiguration.class.php';
+require_once dirname(__FILE__).'/../lib/categoryGeneratorHelper.class.php';
+
+/**
+ * category actions.
+ *
+ * @package jobeet
+ * @subpackage category
+ * @author kalimatas
+ * @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class categoryActions extends autoCategoryActions
+{
+}
@@ -0,0 +1,28 @@
+generator:
+ class: sfDoctrineGenerator
+ param:
+ model_class: JobeetCategory
+ theme: admin
+ non_verbose_templates: true
+ with_show: false
+ singular: ~
+ plural: ~
+ route_prefix: jobeet_category
+ with_doctrine_route: true
+ actions_base_class: sfActions
+
+ config:
+ actions: ~
+ fields: ~
+ list:
+ title: Category Management
+ display: [=name, slug]
+ batch_actions: {}
+ object_actions: {}
+ filter:
+ class: false
+ form: ~
+ edit:
+ title: Editing Category "%%name%%"
+ new:
+ title: New Category
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * category module configuration.
+ *
+ * @package jobeet
+ * @subpackage category
+ * @author kalimatas
+ * @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class categoryGeneratorConfiguration extends BaseCategoryGeneratorConfiguration
+{
+}
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * category module helper.
+ *
+ * @package jobeet
+ * @subpackage category
+ * @author kalimatas
+ * @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class categoryGeneratorHelper extends BaseCategoryGeneratorHelper
+{
+}
@@ -0,0 +1,53 @@
+<?php
+
+require_once dirname(__FILE__).'/../lib/jobGeneratorConfiguration.class.php';
+require_once dirname(__FILE__).'/../lib/jobGeneratorHelper.class.php';
+
+/**
+ * job actions.
+ *
+ * @package jobeet
+ * @subpackage job
+ * @author kalimatas
+ * @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class jobActions extends autoJobActions
+{
+ public function executeBatchExtend(sfWebRequest $request)
+ {
+ $ids = $request->getParameter('ids');
+
+ $q = Doctrine_Query::create()
+ ->from('JobeetJob j')
+ ->whereIn('j.id', $ids);
+
+ foreach ($q->execute() as $job) {
+ $job->extend(true);
+ }
+
+ $this->getUser()->setFlash('notice', 'The selected jobs have been extended successfully.');
+ $this->redirect('jobeet_job');
+ }
+
+ public function executeListExtend(sfWebRequest $request)
+ {
+ $job = $this->getRoute()->getObject();
+ $job->extend(true);
+
+ $this->getUser()->setFlash('notice', 'The selected job have been extended successfully.');
+ $this->redirect('jobeet_job');
+ }
+
+ public function executeListDeleteNeverActivated(sfWebRequest $request)
+ {
+ $nb = Doctrine::getTable('JobeetJob')->cleanup(60);
+
+ if ( $nb ) {
+ $this->getUser()->setFlash('notice', sprintf('%d never activated job have been deleted successfully.', $nb));
+ } else {
+ $this->getUser()->setFlash('notice', 'No job to delete.');
+ }
+
+ $this->redirect('jobeet_job');
+ }
+}
@@ -0,0 +1,47 @@
+generator:
+ class: sfDoctrineGenerator
+ param:
+ model_class: JobeetJob
+ theme: admin
+ non_verbose_templates: true
+ with_show: false
+ singular: ~
+ plural: ~
+ route_prefix: jobeet_job
+ with_doctrine_route: true
+ actions_base_class: sfActions
+
+ config:
+ actions: ~
+ fields:
+ is_activated: { label: Activated?, help: Whether the user has activated the job, or not }
+ is_public: { label: Public?, help: Whether the job can also be published on affiliate websites, or not }
+ list:
+ title: Job Management
+ layout: stacked
+ display: [company, position, location, url, is_activated, email]
+ params: |
+ %%is_activated%% <small>%%jobeet_category%%</small> - %%company%% (<em>%%email%%</em>) is looking from a %%=position%% (%%location%%)
+ sort: [expires_at, desc]
+ max_per_page: 10
+ batch_actions:
+ _delete: ~
+ extend: ~
+ object_actions:
+ extend: ~
+ _edit: ~
+ _delete: ~
+ actions:
+ deleteNeverActivated: { label: Delete never activated jobs }
+ table_method: retrieveBackendJobList
+ filter:
+ display: [category_id, company, position, description, is_activated, is_public, email, expires_at]
+ form:
+ class: BackendJobeetJobForm
+ display:
+ Content: [category_id, type, company, logo, url, position, location, description, how_to_apply, is_public, email]
+ Admin: [_generated_token, is_activated, expires_at]
+ edit:
+ title: Editing Job "%%company%%" is looking for a "%%position%%"
+ new:
+ title: Job Creation
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * job module configuration.
+ *
+ * @package jobeet
+ * @subpackage job
+ * @author kalimatas
+ * @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class jobGeneratorConfiguration extends BaseJobGeneratorConfiguration
+{
+}
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * job module helper.
+ *
+ * @package jobeet
+ * @subpackage job
+ * @author kalimatas
+ * @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class jobGeneratorHelper extends BaseJobGeneratorHelper
+{
+}
@@ -0,0 +1,4 @@
+<div class="sf_admin_form_row">
+ <label>Token</label>
+ <?php echo $form->getObject()->getToken() ?>
+</div>
Oops, something went wrong.

0 comments on commit 363d8d0

Please sign in to comment.