Skip to content

Commit

Permalink
Changing Arabgigs to Arabtechies
Browse files Browse the repository at this point in the history
  • Loading branch information
notnoop committed Aug 19, 2010
1 parent 438c55b commit 69c7b02
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Project properties
#Fri Apr 23 11:24:20 PDT 2010
project.organization=com.notnoop
project.name=arabgigs
project.name=arabtechies
sbt.version=0.7.4
project.version=0.1
def.scala.version=2.7.7
Expand Down
18 changes: 17 additions & 1 deletion src/main/scala/bootstrap/liftweb/Boot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,29 @@ class Boot {
// where to search snippet
LiftRules.addToPackages("code")

def isNumeric(s: String) =
try {
Integer.parseInt(s)
true
} catch {
case _ => false
}


LiftRules.statelessRewrite.append {
case RewriteRequest(
ParsePath(List("gigs", id),_,_,_),_,_) if isNumeric(id) =>
RewriteResponse("gigs" :: "view" :: Nil, Map("id" -> id))
}

// Build SiteMap
val entries = List(
Menu.i("Home") / "index" >> Hidden, // the simple way to declare a menu
Menu.i("Geeks") / "geeks",
Menu.i("Suites") / "suites",
Menu.i("Startups") / "startups",
Menu.i("Gigs") / "gigs"
Menu.i("Gigs") / "gigs",

) ::: Gig.menus ::: Business.menus

// the User management menu items
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/code/model/Business.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package model {
import _root_.net.liftweb.mapper._
import _root_.net.liftweb.util._
import _root_.net.liftweb.common._
import _root_.net.liftweb.sitemap.Loc._

object Business extends Business with LongKeyedMetaMapper[Business]
with CRUDify[Long, Business] {
Expand All @@ -12,6 +13,7 @@ with CRUDify[Long, Business] {
override def fieldOrder = List(title, description, location,
country, website, contact, notes)
override def showAllMenuLoc = Empty
override def createMenuLocParams: List[AnyLocParam] = Hidden :: Nil
}

class Business extends LongKeyedMapper[Business] with IdPK with CreatedUpdated {
Expand Down
8 changes: 8 additions & 0 deletions src/main/scala/code/model/Gig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package model {
import _root_.net.liftweb.mapper._
import _root_.net.liftweb.util._
import _root_.net.liftweb.common._
import _root_.net.liftweb.sitemap.Loc._

object Gig extends Gig with LongKeyedMetaMapper[Gig]
with CRUDify[Long, Gig] {
Expand All @@ -12,6 +13,8 @@ with CRUDify[Long, Gig] {
override def fieldOrder = List(title, description, location,
country, website, contact, notes)
override def showAllMenuLoc = Empty
override def createMenuLocParams: List[AnyLocParam] = Hidden :: Nil
override def viewMenuLoc = Empty
}

class Gig extends LongKeyedMapper[Gig] with IdPK with CreatedUpdated {
Expand All @@ -25,6 +28,11 @@ class Gig extends LongKeyedMapper[Gig] with IdPK with CreatedUpdated {
object description extends MappedTextarea(this, 2048) {
override def displayName = "Description"
override def required_? = true
override def asHtml : scala.xml.Node = {
import com.tristanhunt.knockoff.DefaultDiscounter._
val text : String = is
toXHTML(knockoff(text.replace("\r\n", "\n")))
}
}

object country extends MappedCountry(this) {
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/main/webapp/templates-hidden/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
<script id="jquery" src="/classpath/jquery.js" type="text/javascript"/>
<script id="json" src="/classpath/json.js" type="text/javascript"/>

<link rel="stylesheet" href="/css/arabgigs.css" type="text/css" media="screen" charset="utf-8"/>
<link rel="stylesheet" href="/css/arabtechies.css" type="text/css" media="screen" charset="utf-8"/>
</head>

<body>

<div class="container">
<div class="header">
<h1>Arabgigs</h1>
<h1>Arabtechies</h1>

<!-- add elements here in reverse order -->
<a class="add_content" href="/gigs/create">Gig</a>
<a class="add_content" href="/businesses/create">Business</a>
<a class="add_content" href="#">Profile</a>
<span class="add_content">Add: </span>

<h3>Find Enterprenuers, Find Startups</h3>
<h3>Where the developers and techies are!</h3>
</div>

<lift:Menu.builder ul:class="nav" linkToSelf="true"
Expand Down

0 comments on commit 69c7b02

Please sign in to comment.