[Xfce4-commits] <moka:master> Makeup maintainer profile page.

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


Updating branch refs/heads/master
         to ce94a35d1d5b2f5a263ec21b9995526cc10b19fd (commit)
       from d3fc2862ad192eba9808f7cff26a120a7b330d41 (commit)

commit ce94a35d1d5b2f5a263ec21b9995526cc10b19fd
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Oct 15 20:46:21 2011 +0200

    Makeup maintainer profile page.

 lib/views/layout.haml             |    2 +-
 lib/views/maintainer.haml         |    2 +
 lib/views/maintainer_profile.haml |   43 +++++++++++++++++++++++-------------
 lib/views/stylesheet.sass         |   12 ++++++++-
 4 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/lib/views/layout.haml b/lib/views/layout.haml
index 9d22c44..70367d4 100644
--- a/lib/views/layout.haml
+++ b/lib/views/layout.haml
@@ -26,5 +26,5 @@
           %a{:href => "http://archive.xfce.org"} Archive
         %li
           %a{:href => "https://bugzilla.xfce.org"} Bugzilla
-      %div{:id => 'main-toolbar-clear'}
+      %div{:class => "clearboth"}
     =yield
diff --git a/lib/views/maintainer.haml b/lib/views/maintainer.haml
index 7f599d2..0bc7583 100644
--- a/lib/views/maintainer.haml
+++ b/lib/views/maintainer.haml
@@ -24,9 +24,11 @@
     %th Username
     %th Real Name
     %th Email
+    %th # Projects
   - for maintainer in Maintainer.all(:active => true).sort
     %tr{:class => maintainer.is_admin ? "admin" : ""}
       %td
         %a{:href => "/maintainer/#{maintainer.username}"} #{maintainer.username}
       %td #{maintainer.realname}
       %td #{maintainer.email}
+      %td #{maintainer.projects.length}
diff --git a/lib/views/maintainer_profile.haml b/lib/views/maintainer_profile.haml
index 1dae2e8..88d2a4c 100644
--- a/lib/views/maintainer_profile.haml
+++ b/lib/views/maintainer_profile.haml
@@ -25,8 +25,8 @@
   %p
     %label{:for => "username"} Login Name:
     %input{:type => "text", :name => "fooname", :disabled => true, :value => @maintainer.username}
-    %input{:type => "hidden", 
-           :name => "username", 
+    %input{:type => "hidden",
+           :name => "username",
            :id => "username",
            :value => @maintainer.username}
   %p
@@ -81,7 +81,7 @@
                :disabled => !authentication_user.is_admin}
         %label{:for => "r_#{role.name}"} #{role.description}
   - if !visible_roles
-    %p This user has no roles.
+    %p You don't have special roles.
 
   %h3 Collections
   - visible_collections = false
@@ -96,22 +96,33 @@
                :disabled => !authentication_user.is_admin}
         %label{:for => "c_#{collection.name}"} #{collection.display_name}
   - if !visible_collections
-    %p This user is not maintaining a collection.
+    %p You are not maintaining a collection.
 
   %h3 Projects
   - visible_projects = false
-  - for project in Project.all.sort
-    - if authentication_user.is_admin or @maintainer.projects.include?(project)
-      - visible_projects = true
-      %p
-        %input{:type => "checkbox",
-               :name => "projects[#{project.name}]",
-               :id => "p_#{project.name}",
-               :checked => @maintainer.projects.include?(project),
-               :disabled => !authentication_user.is_admin}
-        %label{:for => "p_#{project.name}"} #{project.name}
-  - if !visible_projects
-    %p This users is not maintaining a project.
+  - if authentication_user.is_admin
+    - projects = Project.all.sort
+    - classifications = Classification.find_all.sort
+  - else
+    - projects = authentication_user.projects.sort
+    - classifications = authentication_user.project_classifications
+
+  - for classification in classifications
+    %h4 #{classification.name.capitalize}
+    %div{:class => "columns"}
+      - for project in projects
+        - if project.classification.eql? classification
+          - visible_projects = true
+          %p
+            %input{:type => "checkbox",
+                   :name => "projects[#{project.name}]",
+                   :id => "p_#{project.name}",
+                   :checked => @maintainer.projects.include?(project),
+                   :disabled => !authentication_user.is_admin}
+            %label{:for => "p_#{project.name}"} #{project.name}
+      - if !visible_projects
+        %p This users is not maintaining a project.
+      %div{:class => "clearboth"}
 
   - if authentication_user.is_admin
     %p
diff --git a/lib/views/stylesheet.sass b/lib/views/stylesheet.sass
index afa1933..48ad6b4 100755
--- a/lib/views/stylesheet.sass
+++ b/lib/views/stylesheet.sass
@@ -9,7 +9,7 @@ body
     top: 2em
     bottom: 2em
 
-  max-width: 600px
+  max-width: 700px
   padding: 2em
 
   background:
@@ -61,7 +61,7 @@ a
       background:
         color: rgb(100,150,250)
 
-#main-toolbar-clear
+.clearboth
   clear: both
 
 h2
@@ -109,6 +109,13 @@ form
   p
     padding: 0.25em
 
+.columns p
+  float: left
+  width: 32%
+  margin: 0
+  white-space: nowrap
+
+
 form.admintasks
   display: inline
 
@@ -117,6 +124,7 @@ fieldset
   padding: 0em
   margin: 0em
 
+
   p
     padding: 0em
 


More information about the Xfce4-commits mailing list