Permalink
Browse files

Merge branch 'master' of heroku.com:simple-ice-37

  • Loading branch information...
2 parents 3bb7f09 + 4fdac4a commit ccf9a4019e956bdd789bed0781d8e4504eb4688f @fd fd committed May 3, 2010
@@ -50,7 +50,7 @@ def create
def destroy
membership.destroy
- redirect_to project
+ redirect_to membership.project
end
private
@@ -70,17 +70,17 @@ def require_project_ownership
if current_user.member?(project)
redirect_to project
else
- redirect_to home_path
+ redirect_to project_path()
end
return false
end
end
def require_ownership
- unless current_user.owner?(membership)
+ unless current_user.owner?(membership) or current_user.owner?(membership.project)
store_location
flash[:notice] = "You must be the owner of this project"
- redirect_to home_path
+ redirect_to membership.project
return false
end
end
@@ -114,22 +114,6 @@ def block2(title=nil, &block)
concat(%{</div></div>})
end
- def css_class_first(value=nil, check=nil)
- unless value.nil? or check.nil?
- if value == check
- %{first}
- end
- end
- end
-
- def css_class_last(value=nil, check=nil)
- unless value.nil? or check.nil?
- if value == check
- %{last}
- end
- end
- end
-
def css_class(class_name='', value=nil, check=nil)
unless value.nil? or check.nil?
if value == check
View
@@ -163,17 +163,22 @@ body
&.environment
:width 1000px
- &.projects, &.errors, &.occurrences
- :cursor pointer
-
th
:text-transform uppercase
:font-weight bold
:font-size 10px
- th span
+ th.sortable span
+ :padding-right 10px
:border-bottom 1px solid
:border-color= !grey_light
+ :cursor pointer
+
+ th.headerSortUp span
+ :background url(/images/backgrounds/bg-sortable-arrow-up.gif) no-repeat right center
+
+ th.headerSortDown span
+ :background url(/images/backgrounds/bg-sortable-arrow-down.gif) no-repeat right center
td, th
:padding 8px
@@ -232,7 +237,12 @@ body
+links
td.project
+ :padding 0
:font-size 1.4em
+
+ a
+ :padding 8px
+ :display block
td.count, th.count
:text-align center
@@ -262,7 +272,14 @@ body
:font
:size 12px
:weight bold
-
+
+ td.error
+ :padding 0
+
+ a
+ :display block
+ :padding 8px
+
div.pagination
:font-size 1em
a
@@ -285,6 +302,7 @@ body
:color= !orange
a:hover
:text-decoration none
+
form
label
:display block
@@ -407,12 +425,14 @@ body
:padding 0
:list-style none
li
+ :position relative
:clear both
:border-top 1px solid rgb(255,255,255)
:border-bottom 1px solid rgb(228,230,223)
img
:float left
.info
+ :position relative
:float left
:padding 7px 10px
:line-height 1em
@@ -421,6 +441,18 @@ body
.email
:font-size 10px
:color rgb(178,181,174)
+ .delete
+ :position absolute
+ :display block
+ :top 50%
+ :right 0
+ :margin -8px 0 0 0
+ :border none
+ :width 16px
+ :height 16px
+ :background url(/images/icons/delete.png) no-repeat center center
+ :text-indent -8888px
+
li.first
:border-top none
li.last
@@ -469,11 +501,12 @@ body
li.me
:background url(/images/backgrounds/bg-me-label.gif) no-repeat right center
li.form
- position: relative
-
+ :position relative
+ :border none
+ :padding 20px 0 0 0
textarea
- width: 100%
- height: 5em
+ :width 100%
+ :height 5em
#footer
@@ -590,4 +623,14 @@ body
.notice
:padding 10px 20px
:background #EEEF86
- :color rgb(94, 95, 23)
+ :color rgb(94, 95, 23)
+
+textarea
+ +border-radius-3
+ :border-width 1px
+ :border-style solid
+ :border-color #DCDCDC #EBEBEB #EBEBEB #DCDCDC
+ :padding 5px
+ :background #FFF
+ :font-family helvetica, arial, sans-serif
+
@@ -6,7 +6,7 @@
%td.label
%span{:class => error.last_occurence.reporter}
= abbreviation(error.last_occurence.reporter)
- %td
+ %td.error
= link_to h(truncate(error.name, :length => 100)), error
%td.count
%div
@@ -18,7 +18,7 @@
%br
= will_paginate occurences
- %table.table.occurrences
+ %table.table.occurrences.sortable
=render occurences
= will_paginate occurences
@@ -21,10 +21,11 @@
%a{ :href => "#", :title => "Newsletter" }
Newsletter
%li.invites-counter
- Only
- %strong
- = invites_left(50)
- invites left, so hurry!
+ - if invites_left(50).to_i > 0
+ Only
+ %strong
+ = invites_left(50)
+ invites left, so hurry!
%h1
%a{ :href => "/", :title => "Failtale (beta) - Telling you more about failing applications." }
@@ -124,7 +125,7 @@
%span.valid{:style => "display:none;"}
%span.invalid{:style => "display:none;"}
%p
- = f.submit "Request invitation", :class => 'button request'
+ = f.submit "Request invitation", :class => 'button'
#login{:style => "display:none;"}
- form_for UserSession.new, :url => user_session_path, :html => {:class => 'form'} do |f|
@@ -1,16 +1,16 @@
- sidebar_blocks[:members] = true
- sidebar_blocks[:api_key] = true
-%table.errors
+%table.errors.sortable
%thead
%tr
%th.select
= check_box_tag 'selectAll'
%th.label
%span label
- %th
+ %th.sortable
%span error
- %th{ :class => "count {sorter: 'digit'}" }
+ %th.count.sortable
%span count
%tbody
- unless open_errors.empty?
@@ -1,2 +1,2 @@
= stylesheet_link_tag 'http://jquery-ui.googlecode.com/svn/tags/latest/themes/base/jquery-ui.css', 'application'
-= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js', 'jquery.autoSuggest.minified.js', 'jquery.clearfield.packed.js', 'application.js'
+= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js', 'jquery.autoSuggest.minified.js', 'jquery.tablesorter.min.js', 'jquery.clearfield.packed.js', 'application.js'
@@ -1,2 +1,2 @@
= stylesheet_link_tag 'reset.css', 'general.css'
-= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js', 'jquery.scrollTo-min.js', 'jquery.clearfield.packed.js', 'application.js'
+= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js', 'jquery.scrollTo-min.js', 'jquery.clearfield.packed.js', 'jquery.tablesorter.min.js', 'application.js'
@@ -11,14 +11,18 @@
.block.members
%h3 Members
%ul
- - @project.members.each_with_index do |member, idx|
+ - @project.memberships.all(:include => :user).each_with_index do |membership, idx|
+ - member = membership.user
%li{:class => %{clearfix #{css_class('first', idx, 0)} #{css_class('last', idx, (@project.members.length - 1))} #{css_class('owner', member.owner?(@project), true)}} }
= image_tag member.gravatar_url(:size => 40)
%span.info
%strong.name
= member.name
%span.email
= member.email
+ - if current_user.owner?(@project) and current_user != member
+ = link_to 'Delete', membership_path(membership), :class => 'delete', :method => :delete, :confirm => "Are you sure you want to delete this member?"
+
- if current_user.owner?(@project)
%li.clearfix.last.add-member
@@ -29,7 +33,7 @@
%h3 Comments
%ul
- @error.comments.each_with_index do |comment, idx|
- %li{:class => %{clearfix #{css_class('first', idx, 0)} #{css_class('last', idx, (@project.members.length - 1))} #{css_class('me', comment.user.id == current_user.id, true)}} }
+ %li{:class => %{clearfix #{css_class('first', idx, 0)} #{css_class('last', idx, (@error.comments.length - 1))} #{css_class('me', comment.user.id == current_user.id, true)}} }
= image_tag comment.user.gravatar_url(:size => 40)
%span.info
%strong.user
@@ -41,4 +45,4 @@
%li.form
- form_for [@error, Comment.new] do |f|
= f.text_area :body
- = f.submit
+ = f.submit 'Comment', :class => 'button'
View
@@ -32,22 +32,22 @@
:shallow => true,
:member => member do |projects|
- projects.resources :memberships,
- :except => [:index, :show]
+ projects.resources :memberships,
+ :except => [:index, :show]
- projects.resources :errors,
- :shallow => true,
- :only => [:show, :update] do |errors|
+ projects.resources :errors,
+ :shallow => true,
+ :only => [:show, :update] do |errors|
- errors.resources :comments,
- :only => [:create]
-
- errors.resources :occurences,
- :only => [:show],
- :member => {
- :backtrace => :get,
- :environment => :get }
+ errors.resources :comments,
+ :only => [:create]
+ errors.resources :occurences,
+ :only => [:show],
+ :member => {
+ :backtrace => :get,
+ :environment => :get }
+
end
end
View
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -18,9 +18,12 @@ var switchContent = (function(sender){
var validateEmail = (function(address){
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
- !(reg.test(address) == false);
+ return reg.test(address);
});
+/*
+ * DOM Ready
+ */
$(document).ready(function() {
var header = $('#header'),
footer = $('#footer'),
@@ -114,16 +117,25 @@ $(document).ready(function() {
}
return false;
});
-
- /*
- * Clearfield
- */
+
+ /*
+ * Clearfield
+ */
$('.clear-field').clearField();
-
- $('table.projects a, table.errors a, table.occurrences a').each(function(){
- var a = $(this),
- row = a.parent('td');
- $(row).click(function(){ window.location.href = a.attr('href'); });
- })
-
+
+
+ try {
+ /*
+ * Table sorter
+ */
+ $("table.sortable").tablesorter({textExtraction: 'complex'});
+ $("table.sortable th").filter(function(idx){
+ if ($(this).hasClass('sortable')) {
+ return false;
+ } else {
+ return $(this);
+ }
+ }).unbind('click');
+ } catch (e) { /* ignore */ };
+
}); // End DOM ready
Oops, something went wrong.

0 comments on commit ccf9a40

Please sign in to comment.