[Xfce4-commits] <moka:master> Add project maintainer and short description for cgit.

Nick Schermer noreply at xfce.org
Sun Nov 20 14:30:58 CET 2011


Updating branch refs/heads/master
         to e28a68694cb469a9474a06c70e1c9e84a49e988e (commit)
       from bc73cd4ee8ec6e61c036d185bb07cd747b01efdd (commit)

commit e28a68694cb469a9474a06c70e1c9e84a49e988e
Author: Nick Schermer <nick at xfce.org>
Date:   Wed Nov 16 18:51:20 2011 +0100

    Add project maintainer and short description for cgit.

 .gitignore                                       |    1 +
 examples/xfce/templates/project_feed_entry.erb   |    2 +-
 examples/xfce/templates/project_release_mail.erb |    2 +-
 lib/controllers/projects.rb                      |    4 ++-
 lib/models/project.rb                            |    7 ++--
 lib/views/project.haml                           |   34 ++++++++++++++++-----
 lib/views/project_new_release.haml               |    4 +-
 lib/views/stylesheet.sass                        |    3 ++
 8 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4d0c1c3..8e9eb7d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 pkg/
 examples/xfce/example.db
 examples/xfce/auth.log
+examples/xfce/migrate.rb
diff --git a/examples/xfce/templates/project_feed_entry.erb b/examples/xfce/templates/project_feed_entry.erb
index a06cc14..c6de88e 100644
--- a/examples/xfce/templates/project_feed_entry.erb
+++ b/examples/xfce/templates/project_feed_entry.erb
@@ -11,7 +11,7 @@
 What is <%= release.project.name %>?
 ========<%= Array.new(release.project.name.size, '=').join %>=
 
-<%= wrap_text(release.project.description).strip %>
+<%= wrap_text(release.project.longdesc).strip %>
 
 Website:
   <a href="<%= release.project.website %>"><%= release.project.website %></a>
diff --git a/examples/xfce/templates/project_release_mail.erb b/examples/xfce/templates/project_release_mail.erb
index 26e67b2..255a5b6 100644
--- a/examples/xfce/templates/project_release_mail.erb
+++ b/examples/xfce/templates/project_release_mail.erb
@@ -11,7 +11,7 @@
 What is <%= release.project.name %>?
 ========<%= Array.new(release.project.name.size, '=').join %>=
 
-<%= wrap_text(release.project.description).strip %>
+<%= wrap_text(release.project.longdesc).strip %>
 
 Website: 
   <%= release.project.website %>
diff --git a/lib/controllers/projects.rb b/lib/controllers/projects.rb
index 80e34bd..3d85225 100755
--- a/lib/controllers/projects.rb
+++ b/lib/controllers/projects.rb
@@ -43,7 +43,9 @@ module Moka
           authentication_required(@project)
 
           @project.website = params[:website]
-          @project.description = params[:description]
+          @project.longdesc = params[:longdesc]
+          @project.shortdesc = params[:shortdesc]
+          @project.owner = params[:owner]
           @project.save
 
           redirect "/project/#{params[:name]}"
diff --git a/lib/models/project.rb b/lib/models/project.rb
index 1f5caf6..936b34c 100755
--- a/lib/models/project.rb
+++ b/lib/models/project.rb
@@ -96,12 +96,13 @@ module Moka
 
       property :name,        String, :key => true
       property :website,     String, :length => 100
-      property :description, Text
+      property :shortdesc,   String, :length => 100
+      property :longdesc,    Text
+      property :norepo,      Boolean, :default => false
+      property :owner,       String
 
       has n,   :maintainers, :through => Resource
 
-      # mailinglists
-
       def classification
         Classification.find_by_project(self)
       end
diff --git a/lib/views/project.haml b/lib/views/project.haml
index b694eb8..4468e8f 100755
--- a/lib/views/project.haml
+++ b/lib/views/project.haml
@@ -3,19 +3,37 @@
   %form{:method => "post", :action => "/project/#{@project.name}/information"}
     %p
       %label{:for => "website"} Website:
-      %input{:type => "text", 
-             :name => "website", 
-             :id => "website", 
+      %input{:type => "text",
+             :name => "website",
+             :id => "website",
+             :maxlength => 100,
+             :class => 'fill',
              :value => "#{@project.website}"}
     %p
-      %label{:for => "description"} Description:
-      %textarea{:name => "description", :id => "description"} #{@project.description}
+      %label{:for => "shortdesc"} Short Description:
+      %input{:type => "text",
+             :name => "shortdesc",
+             :id => "shortdesc",
+             :maxlength => 100,
+             :class => 'fill',
+             :value => "#{@project.shortdesc}"}
+    %p
+      %label{:for => "longdesc"} Long Description:
+      %textarea{:name => "longdesc", :id => "longdesc"} #{@project.longdesc}
+    %p
+      %label{:for => "owner"} Owner:
+      %input{:type => "text",
+             :name => "owner",
+             :id => "owner",
+             :class => 'fill',
+             :value => "#{@project.owner}"}
     %p
       %label{:for => "maintainers"} Maintainers:
-      %input{:type => "text", 
+      %input{:type => "text",
              :name => "maintainers",
              :id =>  "maintainers",
-             :disabled => true, 
+             :disabled => true,
+             :class => 'fill',
              :value => "#{maintainer_names(@project)}"}
     %p.quote
       %input{:type => "submit", :value => "Save"}
@@ -25,7 +43,7 @@
   %p
     %select{:name => "classification"}
       - for classification in Classification.find_all
-        %option{:name => classification.name, 
+        %option{:name => classification.name,
                 :selected => (@project.classification.eql? classification)} #{classification.name}
     %input{:type => "submit", :value => "Change"}
 
diff --git a/lib/views/project_new_release.haml b/lib/views/project_new_release.haml
index 9aeaa01..8dbbac8 100755
--- a/lib/views/project_new_release.haml
+++ b/lib/views/project_new_release.haml
@@ -12,8 +12,8 @@
       %label{:for => "website"} Website:
       %input{:type => "text", :name => "website", :disabled => true, :value => "#{@project.website}"}
     %p
-      %label{:for => "description"} Description:
-      %textarea{:name => "description", :disabled => true} #{@project.description}
+      %label{:for => "longdesc"} Description:
+      %textarea{:name => "longdesc", :disabled => true} #{@project.longdesc}
 
   %form{:method => "get", :action => "/project/#{@project.name}/new-release/tarball"}
     %p.quote
diff --git a/lib/views/stylesheet.sass b/lib/views/stylesheet.sass
index abbf574..30c3f19 100755
--- a/lib/views/stylesheet.sass
+++ b/lib/views/stylesheet.sass
@@ -146,6 +146,9 @@ fieldset
   textarea
     width: 70%
 
+  input.fill
+    width: 50%
+
   p.error, p.info
     padding-left: 1em
 


More information about the Xfce4-commits mailing list