[ClockingIT @ Fix login page compilation]

<% unless @company.nil? %>

<title><%= @company.name %> - ClockingIT</title>
<%= stylesheet_link_merged :tt %>

  <% if flash[:notice] %>
<%= flash[:notice] %><% flash.clear %>
<% end %>

  <% if @internal && @internal.logo? %>
  <%= tag("img", {:src => "/customers/show_logo/#{@internal.id}", :border => 0 } ) %>
  <% else %>
  <%= @company.name %>
  <% end %>

  <%= start_form_tag( {:action => 'validate'}, {:id => "loginform"}) %>

Username	<input name="user[username]" id="username" type="text" class="inputbox" alt="username" size="10" />

Password	<input type="password" id="password" name="user[password]" class="inputbox" size="10" alt="password" />

 	<input type="submit" name="Submit" class="button" value="Log in" />

 	Forgot Login?

  <%= end_form_tag %>

© 2005-2006 Clocking IT - by Erlend & Ellen Simonsen (support@clockingit.com)

<% else %>

<a href="http://www.<%= $CONFIG[:domain] %>/login/signup">Sign Up

Forum

Wiki

About

Home

      <%= render :partial => "left_column" %>

  <% if flash[:notice] %>
<%= flash[:notice] %><% flash.clear %>

  <% else %>
  <% lines = [
    "After introducing ClockingIT at work, we've stopped having status-meetings, as everyone knows who does what, at all times.

-- Erlend Simonsen",
    "Firstly, let me add my voice to the many telling you your application is wonderful!",
    "I, like everyone else, love ClockingIT",
    "You're doing a fantastic job!",
    "your tool it's awasome, i hope you have time to improve it, i really think that can become the best tool in his category",
    "really, really, really great! It's more...the best i've ever seen.",
    "I've worked with a lot of PM systems. MS Project, OpenWorkbench, Basecamp, etc...but clockingit have sthg that I was looking for...simplicity.",
    "All of the clients I've shown it to to get an idea if they liked, actually loved it!",
    "First of all, i'd like to thank you soooo much for your magnificent work and dedication; you are indeed developing a grand and most usable application in groupware trends.",
    "Only a quick note to let you know how impressed I am with this project, both technically and philosophically.",
    "Must say Clocking IT is very cool and unique.",
    "I am really quite impressed with your time tracker",
    "In my 8 years of consulting, 3 hours has got to be fastest turn-around time for a feature request that I've ever seen. Thanks.",
    "Thanks so much this is great!!!",
    "Your site looks great - and for free, no less.",
    "Actually, great was probably an understatement - after exploring it a bit more it looks smarter and more intuitive than any other project management software I've seen.",
    "Well done to you and your team.",
    "The main thing in software projects is the task management and the measurement of the time we have to spend. You combine this in a really awesome design, like Apple does: not to overloaded and still very powerfull.",
    "I have been looking for a good project management package for years and this is the best I've seen.",
    "WELL DONE!",
    "Whoa, that was quick! Thank you!",
    "I was reminded how refreshing and heartening you and your wife's attitude is compared to the ignorance, arrogance and contempt for others of some other software developers",
    "I'm totally blown away - this is by FAR the best project tracking system that we have ever seen!!!",
    "So very nice!  Thanks so much for building this.  It's really great!",
    "LOVING your product.  SO GOOD.  Wow.",
    "I love the program. Thanks for making it free. ",
    "I've used various things in the past to record my working day including a Yahoo widget but this is by far the best.",
    "Looks like so far you've created a great project. Very simple and to the point and very fast!! ",
    "I'm greatly surprised every day with your new improvements...",
    "We just started using clockingit this week and are SO PLEASED with finding a program that does just what we want.",
    "I love the easy to use interface and especially the ease of keeping track of time on each task. Great job!",
    "Thanks a lot for creating such a wonderfull tool and for deciding to open-source it !",
    "Thanks again for such an amazing application!!!",
    "Having a blast working with your software - you have no idea how much this has helped our little startup!",
    "We're now accurately able to track hours in each task and we'll be using that to bill our clients, so it's AWESOME!"
    ]
    #04/19/2007 - Done.
    %>

"<%= lines[rand(lines.size)]%>"

  <% end %>

Smart, easy and free...

Previous

Next

<a href="http://www.<%= $CONFIG[:domain] %>/login/signup">

<% end %>

<% unless @company.nil? %>

<title><%= @company.name %> - ClockingIT</title>
<%= stylesheet_link_merged :tt %>

  <% if flash[:notice] %>
<%= flash[:notice] %><% flash.clear %>
<% end %>

  <% if @internal && @internal.logo? %>
  <%= tag("img", {:src => "/customers/show_logo/#{@internal.id}", :border => 0 } ) %>
  <% else %>
  <%= @company.name %>
  <% end %>

  <%= start_form_tag( {:action => 'validate'}, {:id => "loginform"}) %>

Username	<input name="user[username]" id="username" type="text" class="inputbox" alt="username" size="10" />

Password	<input type="password" id="password" name="user[password]" class="inputbox" size="10" alt="password" />

 	<input type="submit" name="Submit" class="button" value="Log in" />

 	Forgot Login?

  <%= end_form_tag %>

© 2005-2006 Clocking IT - by Erlend & Ellen Simonsen (support@clockingit.com)

<% else %>

<a href="http://www.<%= $CONFIG[:domain] %>/login/signup">Sign Up

Forum

Wiki

About

Home

      <%= render :partial => "left_column" %>

  <% if flash[:notice] %>
<%= flash[:notice] %><% flash.clear %>

  <% else %>]
  <% lines = [
    "After introducing ClockingIT at work, we've stopped having status-meetings, as everyone knows who does what, at all times.

-- Erlend Simonsen",
    "Firstly, let me add my voice to the many telling you your application is wonderful!",
    "I, like everyone else, love ClockingIT",
    "You're doing a fantastic job!",
    "your tool it's awasome, i hope you have time to improve it, i really think that can become the best tool in his category",
    "really, really, really great! It's more...the best i've ever seen.",
    "I've worked with a lot of PM systems. MS Project, OpenWorkbench, Basecamp, etc...but clockingit have sthg that I was looking for...simplicity.",
    "All of the clients I've shown it to to get an idea if they liked, actually loved it!",
    "First of all, i'd like to thank you soooo much for your magnificent work and dedication; you are indeed developing a grand and most usable application in groupware trends.",
    "Only a quick note to let you know how impressed I am with this project, both technically and philosophically.",
    "Must say Clocking IT is very cool and unique.",
    "I am really quite impressed with your time tracker",
    "In my 8 years of consulting, 3 hours has got to be fastest turn-around time for a feature request that I've ever seen. Thanks.",
    "Thanks so much this is great!!!",
    "Your site looks great - and for free, no less.",
    "Actually, great was probably an understatement - after exploring it a bit more it looks smarter and more intuitive than any other project management software I've seen.",
    "Well done to you and your team.",
    "The main thing in software projects is the task management and the measurement of the time we have to spend. You combine this in a really awesome design, like Apple does: not to overloaded and still very powerfull.",
    "I have been looking for a good project management package for years and this is the best I've seen.",
    "WELL DONE!",
    "Whoa, that was quick! Thank you!",
    "I was reminded how refreshing and heartening you and your wife's attitude is compared to the ignorance, arrogance and contempt for others of some other software developers",
    "I'm totally blown away - this is by FAR the best project tracking system that we have ever seen!!!",
    "So very nice!  Thanks so much for building this.  It's really great!",
    "LOVING your product.  SO GOOD.  Wow.",
    "I love the program. Thanks for making it free. ",
    "I've used various things in the past to record my working day including a Yahoo widget but this is by far the best.",
    "Looks like so far you've created a great project. Very simple and to the point and very fast!! ",
    "I'm greatly surprised every day with your new improvements...",
    "We just started using clockingit this week and are SO PLEASED with finding a program that does just what we want.",
    "I love the easy to use interface and especially the ease of keeping track of time on each task. Great job!",
    "Thanks a lot for creating such a wonderfull tool and for deciding to open-source it !",
    "Thanks again for such an amazing application!!!",
    "Having a blast working with your software - you have no idea how much this has helped our little startup!",
    "We're now accurately able to track hours in each task and we'll be using that to bill our clients, so it's AWESOME!",

    #04/19/2007 - Done.

    ] %>

<%= lines[rand(lines.size)]

  <% end %>

Smart, easy and free...

Previous

Next

<a href="http://www.<%= $CONFIG[:domain] %>/login/signup">

<% end %>


Applied patch in #805

Applied patch in #805

git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@1005 820eb932-12ee-0310-9ca8-eeb645f39767

<div id="active_<%= active.html_id %>" class="dragitem">

<%= active.sidebar_controller.display_name %>

<%= active.sidebar_controller.description %>

<%= render_component :layout=>false,
             :controller=>active.sidebar_controller,
             :action=>'configure_wrapper', :params => {:sidebar => active } %>

  <%= link_to_remote('remove',
        :url => {:action => 'remove', :id => active.id,
                 :element => "active_#{active.html_id}"},
        :before => "new Effect.Fade('active_#{active.html_id}')",
        :loading => "new Element.show('update_spinner')") %>

<div id="active_<%= active.html_id %>" class="dragitem">

<%= active.sidebar_controller.display_name %>

<%= active.sidebar_controller.description %>

<%= render_component :layout=>false,
             :controller=>active.sidebar_controller,
             :action=>'configure_wrapper', :params => {:sidebar => active } %>

  <%= link_to_remote('remove',
        :url => {:action => 'remove', :id => 'active',
                 :element => "active_#{active.html_id}"},
        :before => "new Effect.Fade('active_#{active.html_id}')",
        :loading => "new Element.show('update_spinner')") %>


Fix case in logo filenames

Fix case in logo filenames

        Sindo Varela

        Antoni Gutiérrez Rubí - @antonigr

        EzaroMedia

        Francisco Polo - @franciscopolo

        Ideas For Change

        Nagore de los Ríos

        IsabelG

        Juan

        Jordi Torrejón

        Antoni Serra

        François Derbaix

        Irene Milleiro

        Marcos Menéndez

        blat

        Marc Garriga

        José Antonio Gallego

        Belen & Carles

        Francesco

        Amalio Espinosa

        Juan Elosua

        Aquilino Cabo

        Pascual Cano

        Pedro Moreno

        José F. Leal

        Pablo Aretxabala

        EMCubo

        Antonio Delgado

        José M. Alonso

        Lluís Guiu

        alvarod

        Marc López Plana

        Sergio

        Joan Subirats

        Alberto Ortiz de Zárate

        Antonio Galindo

        José Luis Marín

        Carlos

        Lostium Project

        Rosa Adela Caffarena

        Marga V.

        Álvaro Ortiz

        Stéphane M. Grueso

        Andreu Veà

        MacarenaRG

        Carlos Iglesias

        Javier Yohn Planells

        Txe

        Antonio Maestre

        Juanlu Sánchez

        Judas

        aesedepece

        Freedonia

        dvdgmz

        María Fernández Maïssa

        jpzafra

        Kfe Innovación

        Pierre Mendiharat

        Francisco Quiroga

        Monica Garriga

        Javier Creus

        Jordi Vilas

        Jorge Bay

        Elyague

        Aitor Bediaga

        Marti Sanchez

        Mariacho

        pablobm

        Ricard Espelt

        Helen Darbishire

        Sergio Mayo

        Daniel Laguna

        mrubio

        Kike

        Antonio

        Javier Garcia Leon

        Eduardo García

        J. Félix Ontañón

        Susana Noguero

        Berta Sureda

        Carlos Alonso

        Manuel Fernández Valdivia

        Borja Robert

        César Córcoles

        Manuel Pueyo

        Gerald Kogler

        Colbrain

        Pilar Gonzalo

        Vzy

        María Zarauz

        Esther Caparros

        fur alle falle

        emy

        Juan Carlos Lesmes

        Guzmán

        Gabriel Rodríguez Alberich

        Inés Skotnicka

        Juan Arteaga

        efis

        Gabriel Navarro

        Kiosko.net

        garcirrey

        Enric Senabre

        Dani Díaz

        babi

        Go globalgood

        Santi Mas de Xaxàs Faus

        Mar Cabra

        Olivier

        Jordi

        Xavi Capdevila

        David Sánchez Carpio

(Si falta tu nombre, o si quieres cambiarlo por algún motivo, por favor ponte en contacto con nosotros.)


I'm not sure what this means in this context so I'm removing it

<% @title = "FOI officer questions" %>

<%= render :partial => 'sidebar' %>

<%= @title %> #

I just got here from bottom of an FOI request, what is going on? #

<%= site_name %> is a service run by a charity. It helps ordinary members
of the public make FOI requests, and easily track and share the responses.

The FOI request you received was made by someone using <%= site_name %>. You can
simply reply to the request as you would any other request from an individual.
The only difference is that your response will be automatically published on
the Internet.

If you have privacy or other concerns, please read the answers below.
You might also like to read the introduction to <%= site_name %> to find out more about what
the site does from the point of view of a user. You can also search the
site to find the authority that you work for, and view the status of
any requests made using the site.

Finally, we welcome comments and
thoughts from FOI officers, please get in touch.

Why are you publishing responses to FOI requests? #

We think there are lots of benefits. Most importantly it will encourage the
public to be more interested and involved in the work of government. We
also hope that it will reduce the number of duplicate requests on any
subject that a public body will receive. Given that Freedom of Information
responses contain public information, which anybody could easily request
again from the public authority, we think there should be no reason not to
publish it widely.

Are the people making requests real people? #

Yes. For the purposes of keeping track of responses we use
computer-generated email addresses for each request. However, before
they can send a request, each user must register on the site with a
unique email address that we then verify. You can search this site and
find a page listing all requests that each person has made.

An email isn't a sufficient address for an FOI request! #

Yes it is.

Aren't you making lots of vexatious requests? #

<%= site_name %> is not making any requests. We are sending requests on
behalf of our users, who are real people making the requests.

Look at it like this - if lots of different people made requests from
different Hotmail email addresses, then you would not think that Microsoft were
making vexatious requests. It is exactly the same if lots of requests are made
via <%= site_name %>. Moreover, since all requests are public it is much easier
for you to see if one of our users is making vexatious requests.

I can see a request on <%= site_name %>, but we never got it by email!#

If a request appears on the site, then we have attempted to send it to
the authority by email. Any delivery failure messages will automatically
appear on the site. You can check the address we're using with the "View FOI
email address" link which appears on the page for the authority. Contact us if there is a better address we can
use.

Requests are sometimes not delivered because they are quietly removed by
"spam filters" in the IT department of the authority. Authorities can make
sure this doesn't happen by asking their IT departments to "whitelist"
any email from @<%= MySociety::Config.get('INCOMING_EMAIL_DOMAIN', 'localhost') %>.
If you ask us we will resend any request,
and/or give technical details of delivery so an IT department can chase
up what happened to the message.

Finally, you can respond to any request from your web browser, without
needing any email, using the "respond to request" link at the bottom of
each request page.

How do you calculate the deadline shown on request pages?#

The Freedom of Information Act says:

      …the agency or Minister must…as soon as practicable but in
      any case not later than the end of the period of 30 days after the day on
      which the request is received by or on behalf of the agency or Minister,
      take all reasonable steps to enable the applicant to be notified of a
      decision on the request

    —
    (s 15(5)(b))

  And we try to be as generous as possible in our calculation of the 30 day
  timeframe.

But really, how do you calculate the deadline?#

Please read the answer to the previous question first. Legally, authorities
must respond promptly to FOI requests. If they fail to do that,
it is best if they show the hard work they are doing by explaining what is
taking the extra time to do.

That said, <%= site_name %> does show the maximum legal deadline
for response on each request. Here's how we calculate it.

If the day we deliver the request by email is a working day, we count that
as "day zero", even if it was delivered late in the evening. Days end at
midnight.  We then count the next working day as "day one", and so on up to
20 working days.

If the day the request email was delivered was a non-working day, we count
the next working day as "day one". Delivery is delivery, even if it happened on
the weekend. Some authorities <a href="http://www.<%= site_name %>.com/request/policy_regarding_body_scans#incoming-1100">disagree with this, our lawyer disagrees with them.

Requesters are encouraged to mark when they have clarified
their request so the clock resets, but sometimes they get this wrong. If you
see a problem with a particular request, let us know and we'll fix it.

The date thus calculated is shown on requests with the text "By law,
Agency should normally have responded by...". There is only
one case which is not normal, see the next question about
public interest test time extensions.

If you're getting really nerdy about all this, read the detailed Office of the Australian Information Commissioner guidance.
Meanwhile, remember that the law says authorities must respond
promptly. That's really what matters.

How can I send a large file, which won't go by email?#

Instead of email, you can respond to a request directly from your web
browser, including uploading a file. To do this, choose "respond to request" at
the bottom of the request's page. Contact us if it
is too big for even that (more than, say, 50Mb).

Why do you publish the names of public servants and the text of emails? #

We consider what officers or servants do in the course of their employment
to be public information. We will only remove content in exceptional
circumstances, see our take down policy.

Do you publish email addresses or mobile phone numbers? #

To prevent spam, we automatically remove most emails and some mobile numbers from
responses to requests.  Please contact us if we've
missed one.
For technical reasons we don't always remove them from attachments, such as certain PDFs.

If you need to know what an address was that we've removed, please get in touch with us. Occasionally, an email address
forms an important part of a response and we will post it up in an obscured
form in an annotation.

What is your policy on copyright of documents?#

Our Freedom of Information law is "applicant blind", so anyone in the
world can request the same document and get a copy of it.

If you think our making a document available on the internet infringes your
copyright, you may contact us and ask us
to take it down.  However, to save tax payers' money by preventing duplicate
requests, and for good public relations, we'd advise you not to do that.

If you haven't already, read the introduction -->

Otherwise, the credits or the programmers API -->

<% @title = "FOI officer questions" %>

<%= render :partial => 'sidebar' %>

<%= @title %> #

I just got here from bottom of an FOI request, what is going on? #

<%= site_name %> is a service run by a charity. It helps ordinary members
of the public make FOI requests, and easily track and share the responses.

The FOI request you received was made by someone using <%= site_name %>. You can
simply reply to the request as you would any other request from an individual.
The only difference is that your response will be automatically published on
the Internet.

If you have privacy or other concerns, please read the answers below.
You might also like to read the introduction to <%= site_name %> to find out more about what
the site does from the point of view of a user. You can also search the
site to find the authority that you work for, and view the status of
any requests made using the site.

Finally, we welcome comments and
thoughts from FOI officers, please get in touch.

Why are you publishing responses to FOI requests? #

We think there are lots of benefits. Most importantly it will encourage the
public to be more interested and involved in the work of government. We
also hope that it will reduce the number of duplicate requests on any
subject that a public body will receive. Given that Freedom of Information
responses contain public information, which anybody could easily request
again from the public authority, we think there should be no reason not to
publish it widely.

Are the people making requests real people? #

Yes. For the purposes of keeping track of responses we use
computer-generated email addresses for each request. However, before
they can send a request, each user must register on the site with a
unique email address that we then verify. You can search this site and
find a page listing all requests that each person has made.

An email isn't a sufficient address for an FOI request! #

Yes it is.

Aren't you making lots of vexatious requests? #

<%= site_name %> is not making any requests. We are sending requests on
behalf of our users, who are real people making the requests.

Look at it like this - if lots of different people made requests from
different Hotmail email addresses, then you would not think that Microsoft were
making vexatious requests. It is exactly the same if lots of requests are made
via <%= site_name %>. Moreover, since all requests are public it is much easier
for you to see if one of our users is making vexatious requests.

I can see a request on <%= site_name %>, but we never got it by email!#

If a request appears on the site, then we have attempted to send it to
the authority by email. Any delivery failure messages will automatically
appear on the site. You can check the address we're using with the "View FOI
email address" link which appears on the page for the authority. Contact us if there is a better address we can
use.

Requests are sometimes not delivered because they are quietly removed by
"spam filters" in the IT department of the authority. Authorities can make
sure this doesn't happen by asking their IT departments to "whitelist"
any email from @<%= MySociety::Config.get('INCOMING_EMAIL_DOMAIN', 'localhost') %>.
If you ask us we will resend any request,
and/or give technical details of delivery so an IT department can chase
up what happened to the message.

Finally, you can respond to any request from your web browser, without
needing any email, using the "respond to request" link at the bottom of
each request page.

How do you calculate the deadline shown on request pages?#

The Freedom of Information Act says:

      …the agency or Minister must…as soon as practicable but in
      any case not later than the end of the period of 30 days after the day on
      which the request is received by or on behalf of the agency or Minister,
      take all reasonable steps to enable the applicant to be notified of a
      decision on the request

    —
    (s 15(5)(b))

  And we try to be as generous as possible in our calculation of the 30 day
  timeframe.

FOI officers often have to do a lot of hard work to answer
requests, and this is hidden from the public. We think it would help everyone
to have more of that complexity visible.

But really, how do you calculate the deadline?#

Please read the answer to the previous question first. Legally, authorities
must respond promptly to FOI requests. If they fail to do that,
it is best if they show the hard work they are doing by explaining what is
taking the extra time to do.

That said, <%= site_name %> does show the maximum legal deadline
for response on each request. Here's how we calculate it.

If the day we deliver the request by email is a working day, we count that
as "day zero", even if it was delivered late in the evening. Days end at
midnight.  We then count the next working day as "day one", and so on up to
20 working days.

If the day the request email was delivered was a non-working day, we count
the next working day as "day one". Delivery is delivery, even if it happened on
the weekend. Some authorities <a href="http://www.<%= site_name %>.com/request/policy_regarding_body_scans#incoming-1100">disagree with this, our lawyer disagrees with them.

Requesters are encouraged to mark when they have clarified
their request so the clock resets, but sometimes they get this wrong. If you
see a problem with a particular request, let us know and we'll fix it.

The date thus calculated is shown on requests with the text "By law,
Agency should normally have responded by...". There is only
one case which is not normal, see the next question about
public interest test time extensions.

If you're getting really nerdy about all this, read the detailed Office of the Australian Information Commissioner guidance.
Meanwhile, remember that the law says authorities must respond
promptly. That's really what matters.

How can I send a large file, which won't go by email?#

Instead of email, you can respond to a request directly from your web
browser, including uploading a file. To do this, choose "respond to request" at
the bottom of the request's page. Contact us if it
is too big for even that (more than, say, 50Mb).

Why do you publish the names of public servants and the text of emails? #

We consider what officers or servants do in the course of their employment
to be public information. We will only remove content in exceptional
circumstances, see our take down policy.

Do you publish email addresses or mobile phone numbers? #

To prevent spam, we automatically remove most emails and some mobile numbers from
responses to requests.  Please contact us if we've
missed one.
For technical reasons we don't always remove them from attachments, such as certain PDFs.

If you need to know what an address was that we've removed, please get in touch with us. Occasionally, an email address
forms an important part of a response and we will post it up in an obscured
form in an annotation.

What is your policy on copyright of documents?#

Our Freedom of Information law is "applicant blind", so anyone in the
world can request the same document and get a copy of it.

If you think our making a document available on the internet infringes your
copyright, you may contact us and ask us
to take it down.  However, to save tax payers' money by preventing duplicate
requests, and for good public relations, we'd advise you not to do that.

If you haven't already, read the introduction -->

Otherwise, the credits or the programmers API -->


added untaint to title

added untaint to title

editing <%= h @item.title %>

<% error_messages_for :item %>

<% form_for :item, :url => { :action => 'update' }, :html => { :method => 'put' } do |f| -%>

Title

  <%= f.text_field :title %>

Description

  <%= f.text_area :description %>

Tags

  <input id="tags" name="tags" value="<%= h @item.taggings.map { |t| t.to_s }.join(', ') %>" />

    <% default_content_for :submit_button do %>
      <%= submit_tag 'Update' %>
    <% end %>

<% end -%>

editing <%= @item.title %>

<% error_messages_for :item %>

<% form_for :item, :url => { :action => 'update' }, :html => { :method => 'put' } do |f| -%>

Title

  <%= f.text_field :title %>

Description

  <%= f.text_area :description %>

Tags

  <input id="tags" name="tags" value="<%= h @item.taggings.map { |t| t.to_s }.join(', ') %>" />

    <% default_content_for :submit_button do %>
      <%= submit_tag 'Update' %>
    <% end %>

<% end -%>


zombies align left

zombies align left

<iframe src="<%= @link.website_url %>" style="position: fixed; top:0; left:0; width: 100%; height: 100%" frameborder='0' marginheight='0' marginwidth='0' scrolling='auto' class="viewing">

<a href='/images/zombies/<%= ZOMBIE_IMAGES[rand(ZOMBIE_IMAGES.length)] %>' id='zombie' class='hide'>


hide people from being listed when viewer is not logged in

<% if logged_in? %>

my contacts

<% if @contacts %>
<%= render :partial => 'user', :collection => @contacts %>
<% else %>
<%=  'You have no contacts'.t %>
<% end %>

my peers (users I share a common group with)

<% if @peers %>
<%= render :partial => 'user', :collection => @peers %>
<% else %>
<%=  'You have no peers'.t %>
<% end %>

all people

<%= render :partial => 'user', :collection => User.find(:all) %>

<% else %>
No public profiles yet...
<% end %>


Scribbish update 3.  Closes #1100

Scribbish update 3.  Closes #1100

git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@1272 820eb932-12ee-0310-9ca8-eeb645f39767

<%= form_remote_tag :url      => {:action => 'comment', :id => @article},
                    :update   => 'comments_div',
                    :loading  => 'commentLoading()',
                    :complete => 'commentComplete()',
                    :html     => {:id => 'commentform', :class => 'comments' } %>

<fieldset>
  <legend>Comments</legend>

    Name:

      <%= text_field "comment", "author" %>
      (<%= link_to_function("leave url/email »", "Effect.toggle('extra_fields', 'blind', {duration: .3})") %>)

	    Email: <%= content_tag('small', "(#{link_to('gravatar', 'http://gravatar.com')} enabled)") if this_blog.use_gravatar %>

	      <%= text_field "comment", "email" %>

	    Url:

	      <%= text_field "comment", "url" %>

      Comments:
      <%= content_tag('small', link_to("Textile enabled", "http://hobix.com/textile/")) if this_blog.comment_text_filter.include? 'textile' %>
      <%= content_tag('small', link_to("Markdown enabled", "http://daringfireball.net/projects/markdown/")) if this_blog.comment_text_filter.include? 'markdown' %>

      <%= text_area 'comment', 'body' %>

    <%= submit_to_remote('preview', 'Preview!',
                         :update => 'preview',
                         :complete => "Element.show('preview')",
                         :url    => { :action => 'comment_preview' }) %>
    <%= submit_tag 'Submit', :onclick => "this.disabled=true; Element.hide('preview');" %>
    <%= image_tag '/images/theme/spinner.gif', :id => 'spinner', :style => 'display:none' %>

</fieldset>
<%= end_form_tag %>

<%= form_remote_tag :url      => {:action => 'comment', :id => @article},
                    :update   => 'comments_div',
                    :loading  => 'commentLoading()',
                    :complete => 'commentComplete()',
                    :html     => {:id => 'commentform', :class => 'comments' } %>

<fieldset>
  <legend>Comments</legend>

    Name:

      <%= text_field "comment", "author" %>
      (<%= link_to_function("leave url/email »", "new Effect.toggle('extra_fields', 'blind', {duration: .3})") %>)

	    Email: <%= content_tag('small', "(#{link_to('gravatar', 'http://gravatar.com')} enabled)") if this_blog.use_gravatar %>

	      <%= text_field "comment", "email" %>

	    Url:

	      <%= text_field "comment", "url" %>

      Comments:
      <%= content_tag('small', link_to("Textile enabled", "http://hobix.com/textile/")) if this_blog.comment_text_filter.include? 'textile' %>
      <%= content_tag('small', link_to("Markdown enabled", "http://daringfireball.net/projects/markdown/")) if this_blog.comment_text_filter.include? 'markdown' %>

      <%= text_area 'comment', 'body' %>

    <input type="button" value="Preview" onclick="new Ajax.Updater('preview','<%= url_for :action => 'comment_preview' %>',{asynchronous:true,evalScripts:true,parameters:Form.serialize('commentform'),onComplete:function(request){Element.show('preview')}});return false;" />
    <%= submit_tag 'Submit' %>
    <%= image_tag '/images/theme/spinner.gif', :id => 'spinner', :style => 'display:none' %>

</fieldset>
<%= end_form_tag %>


Loading theme CSS after all others

Loading theme CSS after all others

(ActionItem2216)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= html_language %>" lang="<%= html_language %>">

    <title><%= h page_title %></title>
    <%= yield(:feeds) %>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content="<%= @environment.name %>" />
    <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" />
    <%= noosfero_javascript %>
    <%= stylesheet_link_tag noosfero_stylesheets, :cache => 'cache' %>
    <%= stylesheet_link_tag template_stylesheet_path %>
    <%= stylesheet_link_tag icon_theme_stylesheet_path %>
    <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %>
    <% @plugins.enabled_plugins.each do |plugin| %>
      <% if plugin.stylesheet? %>
        <%= stylesheet_tag plugin.class.public_path('style.css'), {} %>
      <% end %>
    <% end %>
    <%= stylesheet_link_tag theme_stylesheet_path %>

    <%# Add custom tags/styles/etc via content_for %>
    <%= yield :head %>
    <%= javascript_tag('render_all_jquery_ui_widgets()') %>
    <% @plugins.enabled_plugins.each do |plugin| %>
      <% plugin.js_files.each do |js_file| %>
        <%= javascript_src_tag plugin.class.public_path(js_file), {} %>
      <% end %>
    <% end %>
    <%=
      @plugins.map(:head_ending).collect do |content|
        content.respond_to?(:call) ? content.call : content
      end.join('\n')
    %>

  <body class="<%=
    # Identify the current controller and action for the CSS:
    " controller-"+ @controller.controller_name() +
    " action-"+ @controller.controller_name() +"-"+ @controller.action_name() +
    " template-"+ ( profile.nil? ? "default" : profile.layout_template ) +
    (!profile.nil? && profile.is_on_homepage?(request.path,@page) ? " profile-homepage" : "")
    %>" >

    <%= _("Go to the content") %>
    <%=
      @plugins.map(:body_beginning).collect do |content|
        content.respond_to?(:call) ? content.call : content
      end.join('\n')
    %>

        <%= theme_header %>

            <%= usermenu_logged_in %>

              <%= _("%s or %s") % [thickbox_inline_popup_link('' + _('Login') + '', login_url, 'inlineLoginBox', :id => 'link_login'), link_to('' + _('Register') + '', :controller => 'account', :action => 'signup') ] %>

                <%= render :file => 'account/login', :locals => { :is_thickbox => true } %>

          <form action="/search" class="search_form" method="get" class="clean">
            <input name="query" size="15" value="<%=_('Search...')%>"
                onfocus="this.form.className='focused';
                         if(this.value=='<%=_('Search...')%>'){this.value=''}"
                onblur="this.form.className='';
                        if(/^\s*$/.test(this.value)){
                          this.value='<%=_('Search...')%>';
                          this.form.className='clean'
                        }" />

<%=_('Press Enter to send the search query.')%>

          </form>

          <%= theme_site_title %>

            <%= theme_extra_navigation %>

            <%= insert_boxes(yield) %>

    <%= render_environment_features(:logged_in) %>

      <%= theme_footer %>

    <%= noosfero_layout_features %>
    <%= theme_javascript_ng %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= html_language %>" lang="<%= html_language %>">

    <title><%= h page_title %></title>
    <%= yield(:feeds) %>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content="<%= @environment.name %>" />
    <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" />
    <%= noosfero_javascript %>
    <%= stylesheet_link_tag noosfero_stylesheets, :cache => 'cache' %>
    <%= stylesheet_link_tag template_stylesheet_path %>
    <%= stylesheet_link_tag icon_theme_stylesheet_path %>
    <%= stylesheet_link_tag theme_stylesheet_path %>
    <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %>
    <% @plugins.enabled_plugins.each do |plugin| %>
      <% if plugin.stylesheet? %>
        <%= stylesheet_tag plugin.class.public_path('style.css'), {} %>
      <% end %>
    <% end %>

    <%# Add custom tags/styles/etc via content_for %>
    <%= yield :head %>
    <%= javascript_tag('render_all_jquery_ui_widgets()') %>
    <% @plugins.enabled_plugins.each do |plugin| %>
      <% plugin.js_files.each do |js_file| %>
        <%= javascript_src_tag plugin.class.public_path(js_file), {} %>
      <% end %>
    <% end %>
    <%=
      @plugins.map(:head_ending).collect do |content|
        content.respond_to?(:call) ? content.call : content
      end.join('\n')
    %>

  <body class="<%=
    # Identify the current controller and action for the CSS:
    " controller-"+ @controller.controller_name() +
    " action-"+ @controller.controller_name() +"-"+ @controller.action_name() +
    " template-"+ ( profile.nil? ? "default" : profile.layout_template ) +
    (!profile.nil? && profile.is_on_homepage?(request.path,@page) ? " profile-homepage" : "")
    %>" >

    <%= _("Go to the content") %>
    <%=
      @plugins.map(:body_beginning).collect do |content|
        content.respond_to?(:call) ? content.call : content
      end.join('\n')
    %>

        <%= theme_header %>

            <%= usermenu_logged_in %>

              <%= _("%s or %s") % [thickbox_inline_popup_link('' + _('Login') + '', login_url, 'inlineLoginBox', :id => 'link_login'), link_to('' + _('Register') + '', :controller => 'account', :action => 'signup') ] %>

                <%= render :file => 'account/login', :locals => { :is_thickbox => true } %>

          <form action="/search" class="search_form" method="get" class="clean">
            <input name="query" size="15" value="<%=_('Search...')%>"
                onfocus="this.form.className='focused';
                         if(this.value=='<%=_('Search...')%>'){this.value=''}"
                onblur="this.form.className='';
                        if(/^\s*$/.test(this.value)){
                          this.value='<%=_('Search...')%>';
                          this.form.className='clean'
                        }" />

<%=_('Press Enter to send the search query.')%>

          </form>

          <%= theme_site_title %>

            <%= theme_extra_navigation %>

            <%= insert_boxes(yield) %>

    <%= render_environment_features(:logged_in) %>

      <%= theme_footer %>

    <%= noosfero_layout_features %>
    <%= theme_javascript_ng %>


Link to feed in admin interface.

Link to feed in admin interface.

<% @title = 'Listing tracks' %>

<%=@title%>

<% form_tag("", :method => "get") do %>

       <%= text_field_tag 'query', params[:query], { :size => 30 } %>
       <%= submit_tag "Search" %> (substring search the query - so use url_names_for_a_particular_request_or_authority_or_person)

<% end %>

  Id
  Tracked by
  <% for column in TrackThing.content_columns %>
    <%= column.human_name %>
  <% end %>
  Items sent by email

<% for track_thing in @admin_tracks %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h track_thing.id %>
  <%= user_admin_link(track_thing.tracking_user) %>
  <% for column in TrackThing.content_columns.map { |c| c.name } %>
    <% if column == 'track_medium' and track_thing.track_medium == 'feed'%>
         <%= link_to track_thing.track_medium, atom_feed_url(:track_id => track_thing.id) %>
    <% else %>
        <%=h track_thing.send(column) %>
    <% end %>
  <% end %>
  <%= track_thing.track_things_sent_emails.size %>

<% end %>

<%= will_paginate(@admin_tracks) %>

<% @title = 'Listing tracks' %>

<%=@title%>

<% form_tag("", :method => "get") do %>

       <%= text_field_tag 'query', params[:query], { :size => 30 } %>
       <%= submit_tag "Search" %> (substring search the query - so use url_names_for_a_particular_request_or_authority_or_person)

<% end %>

  Id
  Tracked by
  <% for column in TrackThing.content_columns %>
    <%= column.human_name %>
  <% end %>
  Items sent by email

<% for track_thing in @admin_tracks %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h track_thing.id %>
  <%= user_admin_link(track_thing.tracking_user) %>
  <% for column in TrackThing.content_columns.map { |c| c.name } %>
    <%=h track_thing.send(column) %>
  <% end %>
  <%= track_thing.track_things_sent_emails.size %>

<% end %>

<%= will_paginate(@admin_tracks) %>


Fixed layout of comments without mugs.

Fixed layout of comments without mugs.

git-svn-id: bc266cc4dcdee41d9588461a87969679bbc3047f@840 7a65b82a-1d14-0410-b525-e2835e71a0b4

    <%= :CREATED.t %>:
      <%= comment.created.web_time %>

    <%= :BY.t %>:
      <%= user_link(comment.user) %>
      <% if check_permission(comment.user_id) %>
        [<%= link_to(:EDIT.t, :controller => 'comment',
                     :action => 'edit_comment', :id => comment.id,
                     :params => query_params) %> |
        <%= link_to(:DESTROY.t, { :controller => 'comment',
                    :action => 'destroy_comment', :id => comment.id,
                    :params => query_params },
                    { :confirm => :are_you_sure.l }) %>]
      <% end %>

    <%= :SUMMARY.t %>:
      <%= comment.summary.tl %>

  <%= sanitize(comment.comment).tpl %>

  <% user = comment.user
  if user.image_id %>
    <%= thumbnail(user.image_id, :border => 0, :size => :thumbnail,
                 :link => :show_user, :user => user.id, :votes => false) %>
  <% end %>


Show current status on the original sent things, so lists of requests are better.

    <% if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].include?('title') %>
        <%= link_to @highlighting['InfoRequestEvent'][event.id]["title"], request_url(info_request) %>
        <% @highlighting['InfoRequestEvent'][event.id].delete("title") %>
    <% elsif not event.incoming_message.nil? %>
        <%= link_to "Response to '" + h(info_request.title) + "'", incoming_message_url(event.incoming_message) %>
    <% elsif not event.outgoing_message.nil? and event.event_type == 'followup_sent' %>
        <%= link_to "Follow up message for '" + h(info_request.title) + "'", outgoing_message_url(event.outgoing_message) %>
    <% else %>
        <%= link_to h(info_request.title), request_url(info_request) %>
    <% end %>

    <% if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].size > 0 %>
        <%= @highlighting['InfoRequestEvent'][event.id].values.join(" ") %>
    <% elsif not event.outgoing_message.nil? %>
        <%= excerpt(event.outgoing_message.body_without_salutation, "", 150) %>
    <% elsif not event.incoming_message.nil? %>
        <%= excerpt(event.incoming_message.get_body_for_quoting, "", 150) %>
    <% else %>
        <%= excerpt(info_request.initial_request_text, "", 150) %>
    <% end %>

        <% if event.event_type == 'sent' %>

            <%= info_request.display_status %>

            Request sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'followup_sent' %>
            Sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'response' %>
            <% if event.calculated_state.nil? %>
                Response
            <% else %>
                <%=event.display_status %>
            <% end %>
            by <%= public_body_link(info_request.public_body) %>
            to <%= user_link(info_request.user) %>
        <% else %>
            <% raise "unknown event type indexed " + event.event_type %>
        <% end %>

        on <%= simple_date(event.created_at) %>.

    <% if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].include?('title') %>
        <%= link_to @highlighting['InfoRequestEvent'][event.id]["title"], request_url(info_request) %>
        <% @highlighting['InfoRequestEvent'][event.id].delete("title") %>
    <% elsif not event.incoming_message.nil? %>
        <%= link_to "Response to '" + h(info_request.title) + "'", incoming_message_url(event.incoming_message) %>
    <% elsif not event.outgoing_message.nil? and event.event_type == 'followup_sent' %>
        <%= link_to "Follow up message for '" + h(info_request.title) + "'", outgoing_message_url(event.outgoing_message) %>
    <% else %>
        <%= link_to h(info_request.title), request_url(info_request) %>
    <% end %>

    <% if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].size > 0 %>
        <%= @highlighting['InfoRequestEvent'][event.id].values.join(" ") %>
    <% elsif not event.outgoing_message.nil? %>
        <%= excerpt(event.outgoing_message.body_without_salutation, "", 150) %>
    <% elsif not event.incoming_message.nil? %>
        <%= excerpt(event.incoming_message.get_body_for_quoting, "", 150) %>
    <% else %>
        <%= excerpt(info_request.initial_request_text, "", 150) %>
    <% end %>

        <% if event.event_type == 'sent' %>
            Request sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'followup_sent' %>
            Sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'response' %>
            <% if event.calculated_state.nil? %>
                Response
            <% else %>
                <%=event.display_status %>
            <% end %>
            by <%= public_body_link(info_request.public_body) %>
            to <%= user_link(info_request.user) %>
        <% else %>
            <% raise "unknown event type indexed " + event.event_type %>
        <% end %>

        on <%= simple_date(event.created_at) %>.


Ghetto fix resolves #6

Ghetto fix resolves #6

<%= error_messages_for 'task' %>

<%
  perms = {}
  ['comment', 'edit', 'reassign', 'prioritize', 'close', 'milestone'].each do |p|
    if @task.project_id.to_i == 0 || current_user.can?( @task.project, p )
      perms[p] = {}
    else
      perms[p] = { :readonly => 'readonly' }
    end
  end
%>

    <fieldset id="task_information" style="padding-right:0.5em;"><legend><%=_ 'Information' %></legend>

        <%=_ 'Summary' %>

      <%= text_field 'task', 'name', { :size => 47, :maxlength => 200, :style => "width:80%;"}.merge( perms['edit'] )  %>

        <%=_ 'Tags' %>

      <%= text_field 'task', 'set_tags', { :size => 47, :value => @task.tags.collect{|t| t.name}.join(', '), :autocomplete => "off", :style => "width:80%;" }.merge( perms['edit'] ) %>

        <%=_ 'Description' %>

      <%= text_area 'task', 'description', { :rows => 15, :style => "width:80%;" }.merge( perms['edit'] )  %>

        <%=_ 'Comment' %>

      <%= text_area_tag 'comment', {}, { :rows => 8, :style => "width:80%;" }.merge( perms['comment'] )  %>

        <%=_ 'Attach file' %>

        <%= file_field_tag 'tmp_files[]', { :size => 35, :class => "file" }.merge( perms['comment'] ) %>
        <% if perms['comment'].empty? %>

          <%= link_to_function _("") do |page | page.insert_html :bottom, :upload_container, " <input type=\"file\" size=\"35\" name=\"tmp_files[]\"/>
" end %>

        <% end %>

        <% if @task.new_record? %>
        <%= submit_tag _("Create"), :class => "nolabel" %>
        <%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %>
<%=_ 'Send notification emails' %>

      <% else %>
      <%= submit_tag _("Save"), :class => "nolabel",:onclick=>"return status()" %>

        <%=_ 'and' %>

        <%
          options = []
          options << [_("Leave Open"), 0] if @task.status == 0
          options << [_("Revert to Open"), 0] if @task.status != 0
          options << [_("Set in Progress"), 1] if @task.status == 0
          options << [_("Leave as in Progress"), 1] if @task.status == 1
          options << [_("Close"), 2] if @task.status == 0 || @task.status == 1
          options << [_("Leave Closed"), 2] if @task.status == 2
          options << [_("Set as Won't Fix"), 3] if @task.status == 0 || @task.status == 1
          options << [_("Leave as Won't Fix"), 3] if @task.status == 3
          options << [_("Set as Invalid"), 4] if @task.status == 0 || @task.status == 1
          options << [_("Leave as Invalid"), 4] if @task.status == 4
          options << [_("Set as Duplicate"), 5] if @task.status == 0 || @task.status == 1
          options << [_("Leave as Duplicate"), 5] if @task.status == 5
          options << [_("Wait"), 6] if @task.status < 2

          can_close = {:disabled => "disabled"} unless current_user.can?( @task.project, 'close' )
          can_close ||= {}

          defer_options = []
          defer_options << [_("Tomorrow"), tz.local_to_utc(tz.now.at_midnight + 1.days).to_s(:db)  ]
          defer_options << [_("End of week"), tz.local_to_utc(tz.now.beginning_of_week + 4.days).to_s(:db)  ]
          defer_options << [_("Next week"), tz.local_to_utc(tz.now.beginning_of_week + 7.days).to_s(:db) ]
          defer_options << [_("One week"), tz.local_to_utc(tz.now.at_midnight + 7.days).to_s(:db) ]
          defer_options << [_("Next month"), tz.local_to_utc(tz.now.next_month.beginning_of_month).to_s(:db)]
          defer_options << [_("One month"), tz.local_to_utc(tz.now.next_month.at_midnight).to_s(:db)]
        %>
        <%= select 'task', 'status', options, {:selected => @task.status}, can_close %>

            <%= _("until") %>

          <%= select 'task', 'hide_until', defer_options %>

        <%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %>

          <%=_ 'Send notification emails' %>

      <% end %>

  </fieldset>
  <% unless @task.users.empty? %>

    <%= render :partial => "history" %>

            <%= _ 'To-do' %>
            <span id="todo-status-<%= @task.dom_id %>">
              <a class="<%=(@task.todos.empty? ? "todo-status-link-empty" :"todo-status-link")%>" style="padding-right:0" href="#" onclick="Element.toggle('todo-container-<%=@task.dom_id%>'); return false;"><%=@task.todo_status%>

          <%= render :partial => "tasks/todo_container", :locals => {:task => @task, :depth => 0} %>

    <% else %>

    <% end %>
    <% unless @tags.nil? %>

    <% end %>

    <% if @task.project_id > 0
      selected_project = @task.project_id
      elsif session[:last_project_id].to_i > 0 && Project.exists?(session[:last_project_id])
      selected_project = session[:last_project_id].to_i
      elsif session[:filter_project].to_i > 0 && Project.exists?(session[:filter_project])
        selected_project = session[:filter_project].to_i
      else
        selected_project = current_user.projects.find(:first, :order => 'name').id
        end
        selected_project = current_user.projects.find(selected_project).id rescue current_user.projects.find(:first, :order => 'name').id %>
    <fieldset id="task_project_selection" style="padding-right:0;">
      <legend>
        <%=_ 'Target' %>
      </legend>

        <%=_ 'Project' %>

      <select name="task[project_id]" id="task_project_id" <%= "disabled=\"disabled\"" unless perms['reassign'].empty? %>>
        <% @clients = Customer.find(:all, :conditions => ["company_id = ?", current_user.company_id], :order => "name") %>
        <% @clients.each do |c| %>
        <% @client_projects = current_user.projects.find(:all, :conditions => ["customer_id = #{c.id} AND completed_at IS NULL"], :order => "name" ) %>
        <% if @client_projects.size > 0 %>
        <optgroup class="select_heading" label="<%= h(c.name) %>">
        <% @client_projects.each do |p| %>
        <option value="<%=p.id%>" class="select_item" <%="selected" if p.id == selected_project%>><%= p.name %></option>
        <% end %>
        </optgroup>
        <% end %>
        <% end %>
        </select>

<% if current_user.admin > 0%>

          <a href="/projects/edit/<%= selected_project %>">

    <% end %>

            <%=_ 'Milestone' %>

          <% unless @task.id.nil? %>
          <%= select 'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'milestones.due_at, milestones.name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {}, perms['milestone'] %>
          <% else %>
          <%= select'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'milestones.due_at, milestones.name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {:selected => session[:filter_milestone] ? session[:filter_milestone].to_i : 0}, perms['milestone'] %>
          <% end %>
          <% if current_user.can?( Project.find(selected_project), 'milestone' ) %>

          <% end %>

        <% users = Project.find(selected_project).users.find(:all, :order => 'name' ) rescue []
        resource_string = "<select id=\"task_users\" name=\"users[]\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('Unassigned')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\">#{us.name}</option>"}.join('') + "</select>"
        resource_string = resource_string.split(/\n/).join('').gsub(/'/, "\\\\\'")
        owner_string = ''
        num = 0
        unless @task.users.empty?
        @task.users.each do |u|
        owner_string << "
#{_('Assigned To')}" if num == 0
        owner_string << "
" if num != 0
        owner_string <<  "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{(u.id == us.id ? "selected=\"selected\"" : '')}>#{us.name}</option>"}.join('').gsub(/'/,"\\\\\'") + "</select>" #, perms['reassign'] )
        if( perms['reassign'].keys.size == 0 )
          owner_string << "" if num == 0
          owner_string << "
          " if num != 0
          end
          owner_string << "
"
          num = num + 1
          end
          owner_string = owner_string.split(/\n/).join('')
        else
        owner_string = "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{"selected" if (us.id == current_user.id && @task.created_at.nil?) }>#{us.name}</option>"}.join('') + "</select>" #, perms['reassign']
        owner_string = owner_string.split(/\n/).join('').gsub(/'/, "\\\\\'")
        if perms['reassign'].keys.size == 0
          owner_string = "
#{_('Assigned To')}#{owner_string}"
          owner_string << "
"
          end
        num = num + 1
        end
        %>

        <%= owner_string %>

          <%=_ 'Requested By' %>

        <%= text_field 'task', 'requested_by', {:size => 12}.merge(perms['edit']) %>

      </fieldset>
      <% if @task.new_record? %>
      <% else %>
      <fieldset id="task_project_client" style="padding-right:0;">
        <legend>
          <%=_ 'Client Information' %>
        </legend>
        <% client = @task.project.customer %>
        <% if File.exists?(client.logo_path) %>
				<%= "" %>
			<% else %>
			<% end %>
			<%= client.name %>

			Contact: <a href="mailto:<%= client.contact_email %>" class="tooltip" title="Send an email to <%= client.contact_name %>" ><%= client.contact_name %>

			<a href="/views/select_client/<%= @task.project.customer_id %>" class="tooltip" title="View all open tasks for <%= client.name %>">All Tasks •
			 <a target="_blank"  href="http://assets.emrl.com/pages/search.php?search=client:<%= client.name  %>" class="tooltip" title="View <%= client.name %> in the Asset Manager">Assets

			<a href="/wiki/show/<%= client.name %>" class="tooltip" title="View the Wiki for <%= client.name %>">Wiki
      <% unless client.evernote.nil? || client.evernote == '' %> •
      <a target="_blank" href="<%= client.evernote %>" class="tooltip" title="View the Evernote Notebook for <%= client.name %>">Notes
      <% end %>

	  </fieldset>
	<% end %>

      <fieldset id="task_attr" style="padding-right:0;">
        <legend><%=_ 'Attributes' %></legend>
      <%=_ 'Type' %>

        <% disabled = (perms['prioritize'].empty? || @task.new_record?) ? "" : "disabled=\"disabled\"" %>

        <input type="radio" name="task[type_id]" id="task_type_id_0" value="0" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 0 %> <%= disabled %>/>
          <label for="task_type_id_0" style="float:none;text-align:left;width:auto;margin:0;font-weight:normal;" class="tooltip" title="<%=_'Task'%>">

            <%=_'Task'%>

        <input type="radio" name="task[type_id]" id="task_type_id_1" value="1" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 1 %> <%= disabled %>/>
          <label for="task_type_id_1" style="float:none;text-align:left;width:auto;margin:0;font-weight:normal;" class="tooltip" title="<%=_'Design'%>">

            <%=_'Design'%>

        <input type="radio" name="task[type_id]" id="task_type_id_2" value="2"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 2 %> <%= disabled %>/>

            <%=_'Development'%>

        <input type="radio" name="task[type_id]" id="task_type_id_3" value="3"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 3 %> <%= disabled %>/>
          <label for="task_type_id_3" style="float:none;text-align:left;width:auto;margin:0;font-weight:normal;" title="<%=_'Research'%>" class="tooltip">

            <%=_'Research'%>

        <input type="radio" name="task[type_id]" id="task_type_id_4" value="4"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 4 %> <%= disabled %>/>
          <label for="task_type_id_4" style="float:none;text-align:left;width:auto;margin:0;font-weight:normal;" title="<%=_'Management'%>" class="tooltip">

            <%=_'Management'%>

	    <input type="radio" name="task[type_id]" id="task_type_id_5" value="5" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 5 %> <%= disabled %>/>
          <label for="task_type_id_5" style="float:none;text-align:left;width:auto;margin-left:0;font-weight:normal;" title="<%=_'Meeting'%>" class="tooltip">

           <%=_'Meeting'%>

      <%=_ 'Priority' %>
        <%= select 'task', 'priority', [[_('Critical'),3],[_('Urgent'),2],[_('High'),1],[_('Normal'),0],[_('Low'),-1],[_('Lowest'),-2]], {:selected => @task.priority}, perms['prioritize']  %>

      <%=_ 'Status' %>
        <%= select 'task', 'severity_id', [[_('Awaiting  Approval'),3],[_('Normal'),0]], {:selected => @task.severity_id}, perms['prioritize']  %>

      <% if current_user.option_tracktime.to_i == 1%>
       <%=_ 'Time Estimate' %>
      <%= text_field 'task', 'duration', {:size => 12, :value => (@task.duration.to_i > 0 ? worked_nice(@task.duration) : ""), :class => 'tooltip', :title => _('2w 3d 1h')}.merge(perms['prioritize']) %>

<% else %>
      <%= hidden_field_tag "task[duration]", "#{(@task.duration.to_i > 0 ? worked_nice(@task.duration) : "")}" %>
<% end %>
		<% range_start = Time.new.year - 5 %>
		<% range_end   = range_start + 10 %>
		<%=_ 'Start Date' %>
		<% if perms['prioritize'].empty? %>
			<%= calendar_field 'task', 'start_at', { :class => 'date tooltip', :field_title => 'Enter task start date, or click calendar button', :button_title => _('Show Calendar') },
			    { :ifFormat => current_user.date_format, :firstDay => 1, :range => [range_start, range_end], :step => 1, :showOthers => true } %>
		<% else %>
			<%= text_field 'task', 'start_at', {:size => 12, :value => @task.start_at ? @task.start_at.strftime_localized(current_user.date_format) : ''}.merge(perms['prioritize']) %>

		<% end %>

      <%=_ 'Due Date' %>
        <% if perms['prioritize'].empty? %>
          <% if( (current_user.locale || 'en_US') == 'en_US' )
               date_tooltip = _("Enter task due date, or click calendar button.
For recurring tasks, try:
every day
every thursday
every last friday
every 14 days
every 3rd monday (of a month)")
             else
               date_tooltip = _("Enter task due date, or click calendar button.")
             end %>
          <% if @task.repeat && @task.repeat.length > 0 %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar'), :value => @task.repeat_summary },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [range_start, range_end], :step => 1, :showOthers => true } %>
          <% else %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar') },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [range_start, range_end], :step => 1, :showOthers => true } %>
          <% end %>

        <% else %>
          <% if @task.repeat && @task.repeat.length > 0 %>
        <%= text_field 'task', 'due_at', {:size => 12, :value => @task.repeat_summary}.merge(perms['prioritize']) %>

          <% else %>
        <%= text_field 'task', 'due_at', {:size => 12, :value => (@task.due_at.nil? ? "" : @task.due_at.strftime_localized(current_user.date_format))}.merge(perms['prioritize']) %>

          <% end %>
        <% end %>
      </fieldset>

      <fieldset id="task_dependencies" style="padding-right:0;">
        <legend><%=_ "Dependencies"%></legend>

        <%=_ 'Depends on'%> #
        <% if perms['prioritize'].empty? %>
        <input name="dependencies[]" size="12" type="text" id="dependencies_input" title="<%=_("Enter task numbers, separated by commas. Type text to search. Hit Enter to save changes.")%>" class="tooltip" >

        <%= auto_complete_field 'dependencies_input', { :url => { :action => 'dependency_targets' }, :min_chars => 1, :frequency => 0.5, :indicator => 'loading', :select => 'complete_value', :tokens => ',' } %>
        <% else %>
        <input name="dependencies[]" size="12" type="text" disabled="disabled">
        <% end %>

        <% @task.dependencies.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

<%= link_to_task(d) %>

        <% if perms['prioritize'].empty? %>

          <% if d.done? %>
             <a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" ><i class="icon-check-sign tooltip" style="text-decoration: none; color:#000;" title="<%=_ 'Completed'%>" class="tooltip">
          <% else %>

                <a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" >

<i class="icon-minus-sign tooltip" style="text-decoration: none;" title="<%=_ 'Remove dependency'%>" class="tooltip">

                        <% end %>

        <% end %>
        <input name="dependencies[]" type="hidden" value="<%=d.task_num%>">

        <% end %>

      </fieldset>

<% unless @task.dependants.empty? %>

      <fieldset id="task_dependants" style="padding-right:0;">
        <legend><%=_ "Depended on by"%></legend>

        <% @task.dependants.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both; padding-left:16px;">

<% if d.done? %>Edit _form.shtml to remove this!<% else %><% end %><%= link_to_task(d) %>

        <% end %>

      </fieldset>

<% end %>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notification' %></legend>
        <%= _"Name / Email" %><input type="text" size="12" name="watchers[]" id="notification-input">

</fieldset>

<% if @task.attachments.size > 0 %>
    <fieldset id="task_attachments">
        <legend><%=_ "Attachments" %></legend>
        <% for file in @task.attachments %>
        <% if file.thumbnail? %>

        <a href="/project_files/show/<%=file.id%>"><img src="/project_files/thumbnail/<%=file.id%>" border="0" style="float:none;"/>

        <% end %>
        <%= link_to h(file.name), {:controller => 'project_files', :action => 'download', :id => file.id} %>
(<%=number_to_human_size(file.file_size)%>)
        <%= link_to _('[Delete]'), {:controller => 'project_files', :action => 'destroy', :id => file.id}, :confirm => _("Really delete %s?", file.name) %>

        <% end %>
      </fieldset>
      <% end %>

<%= error_messages_for 'task' %>

<%
  perms = {}
  ['comment', 'edit', 'reassign', 'prioritize', 'close', 'milestone'].each do |p|
    if @task.project_id.to_i == 0 || current_user.can?( @task.project, p )
      perms[p] = {}
    else
      perms[p] = { :readonly => 'readonly' }
    end
  end
%>

    <fieldset id="task_information" style="padding-right:0.5em;"><legend><%=_ 'Information' %></legend>

        <%=_ 'Summary' %>

      <%= text_field 'task', 'name', { :size => 47, :maxlength => 200, :style => "width:80%;"}.merge( perms['edit'] )  %>

        <%=_ 'Tags' %>

      <%= text_field 'task', 'set_tags', { :size => 47, :value => @task.tags.collect{|t| t.name}.join(', '), :autocomplete => "off", :style => "width:80%;" }.merge( perms['edit'] ) %>

        <%=_ 'Description' %>

      <%= text_area 'task', 'description', { :rows => 15, :style => "width:80%;" }.merge( perms['edit'] )  %>

        <%=_ 'Comment' %>

      <%= text_area_tag 'comment', {}, { :rows => 8, :style => "width:80%;" }.merge( perms['comment'] )  %>

        <%=_ 'Attach file' %>

        <%= file_field_tag 'tmp_files[]', { :size => 35, :class => "file" }.merge( perms['comment'] ) %>
        <% if perms['comment'].empty? %>

          <%= link_to_function _("") do |page | page.insert_html :bottom, :upload_container, " <input type=\"file\" size=\"35\" name=\"tmp_files[]\"/>
" end %>

        <% end %>

        <% if @task.new_record? %>
        <%= submit_tag _("Create"), :class => "nolabel" %>
        <%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %>
<%=_ 'Send notification emails' %>

      <% else %>
      <%= submit_tag _("Save"), :class => "nolabel",:onclick=>"return status()" %>

        <%=_ 'and' %>

        <%
          options = []
          options << [_("Leave Open"), 0] if @task.status == 0
          options << [_("Revert to Open"), 0] if @task.status != 0
          options << [_("Set in Progress"), 1] if @task.status == 0
          options << [_("Leave as in Progress"), 1] if @task.status == 1
          options << [_("Close"), 2] if @task.status == 0 || @task.status == 1
          options << [_("Leave Closed"), 2] if @task.status == 2
          options << [_("Set as Won't Fix"), 3] if @task.status == 0 || @task.status == 1
          options << [_("Leave as Won't Fix"), 3] if @task.status == 3
          options << [_("Set as Invalid"), 4] if @task.status == 0 || @task.status == 1
          options << [_("Leave as Invalid"), 4] if @task.status == 4
          options << [_("Set as Duplicate"), 5] if @task.status == 0 || @task.status == 1
          options << [_("Leave as Duplicate"), 5] if @task.status == 5
          options << [_("Wait"), 6] if @task.status < 2

          can_close = {:disabled => "disabled"} unless current_user.can?( @task.project, 'close' )
          can_close ||= {}

          defer_options = []
          defer_options << [_("Tomorrow"), tz.local_to_utc(tz.now.at_midnight + 1.days).to_s(:db)  ]
          defer_options << [_("End of week"), tz.local_to_utc(tz.now.beginning_of_week + 4.days).to_s(:db)  ]
          defer_options << [_("Next week"), tz.local_to_utc(tz.now.beginning_of_week + 7.days).to_s(:db) ]
          defer_options << [_("One week"), tz.local_to_utc(tz.now.at_midnight + 7.days).to_s(:db) ]
          defer_options << [_("Next month"), tz.local_to_utc(tz.now.next_month.beginning_of_month).to_s(:db)]
          defer_options << [_("One month"), tz.local_to_utc(tz.now.next_month.at_midnight).to_s(:db)]
        %>
        <%= select 'task', 'status', options, {:selected => @task.status}, can_close %>

            <%= _("until") %>

          <%= select 'task', 'hide_until', defer_options %>

        <%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %>

          <%=_ 'Send notification emails' %>

      <% end %>

  </fieldset>
  <% unless @task.users.empty? %>

    <%= render :partial => "history" %>

            <%= _ 'To-do' %>
            <span id="todo-status-<%= @task.dom_id %>">
              <a class="<%=(@task.todos.empty? ? "todo-status-link-empty" :"todo-status-link")%>" style="padding-right:0" href="#" onclick="Element.toggle('todo-container-<%=@task.dom_id%>'); return false;"><%=@task.todo_status%>

          <%= render :partial => "tasks/todo_container", :locals => {:task => @task, :depth => 0} %>

    <% else %>

    <% end %>
    <% unless @tags.nil? %>

    <% end %>

    <% if @task.project_id > 0
      selected_project = @task.project_id
      elsif session[:last_project_id].to_i > 0 && Project.exists?(session[:last_project_id])
      selected_project = session[:last_project_id].to_i
      elsif session[:filter_project].to_i > 0 && Project.exists?(session[:filter_project])
        selected_project = session[:filter_project].to_i
      else
        selected_project = current_user.projects.find(:first, :order => 'name').id
        end
        selected_project = current_user.projects.find(selected_project).id rescue current_user.projects.find(:first, :order => 'name').id %>
    <fieldset id="task_project_selection" style="padding-right:0;">
      <legend>
        <%=_ 'Target' %>
      </legend>

        <%=_ 'Project' %>

      <select name="task[project_id]" id="task_project_id" <%= "disabled=\"disabled\"" unless perms['reassign'].empty? %>>
        <% @clients = Customer.find(:all, :conditions => ["company_id = ?", current_user.company_id], :order => "name") %>
        <% @clients.each do |c| %>
        <% @client_projects = current_user.projects.find(:all, :conditions => ["customer_id = #{c.id} AND completed_at IS NULL"], :order => "name" ) %>
        <% if @client_projects.size > 0 %>
        <optgroup class="select_heading" label="<%= h(c.name) %>">
        <% @client_projects.each do |p| %>
        <option value="<%=p.id%>" class="select_item" <%="selected" if p.id == selected_project%>><%= p.name %></option>
        <% end %>
        </optgroup>
        <% end %>
        <% end %>
        </select>

          <a href="/projects/edit/<%= selected_project %>">

            <%=_ 'Milestone' %>

          <% unless @task.id.nil? %>
          <%= select 'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'milestones.due_at, milestones.name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {}, perms['milestone'] %>
          <% else %>
          <%= select'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'milestones.due_at, milestones.name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {:selected => session[:filter_milestone] ? session[:filter_milestone].to_i : 0}, perms['milestone'] %>
          <% end %>
          <% if current_user.can?( Project.find(selected_project), 'milestone' ) %>

          <% end %>

        <% users = Project.find(selected_project).users.find(:all, :order => 'name' ) rescue []
        resource_string = "<select id=\"task_users\" name=\"users[]\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('Unassigned')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\">#{us.name}</option>"}.join('') + "</select>"
        resource_string = resource_string.split(/\n/).join('').gsub(/'/, "\\\\\'")
        owner_string = ''
        num = 0
        unless @task.users.empty?
        @task.users.each do |u|
        owner_string << "
#{_('Assigned To')}" if num == 0
        owner_string << "
" if num != 0
        owner_string <<  "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{(u.id == us.id ? "selected=\"selected\"" : '')}>#{us.name}</option>"}.join('').gsub(/'/,"\\\\\'") + "</select>" #, perms['reassign'] )
        if( perms['reassign'].keys.size == 0 )
          owner_string << "" if num == 0
          owner_string << "
          " if num != 0
          end
          owner_string << "
"
          num = num + 1
          end
          owner_string = owner_string.split(/\n/).join('')
        else
        owner_string = "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{"selected" if (us.id == current_user.id && @task.created_at.nil?) }>#{us.name}</option>"}.join('') + "</select>" #, perms['reassign']
        owner_string = owner_string.split(/\n/).join('').gsub(/'/, "\\\\\'")
        if perms['reassign'].keys.size == 0
          owner_string = "
#{_('Assigned To')}#{owner_string}"
          owner_string << "
"
          end
        num = num + 1
        end
        %>

        <%= owner_string %>

          <%=_ 'Requested By' %>

        <%= text_field 'task', 'requested_by', {:size => 12}.merge(perms['edit']) %>

      </fieldset>
      <% if @task.new_record? %>
      <% else %>
      <fieldset id="task_project_client" style="padding-right:0;">
        <legend>
          <%=_ 'Client Information' %>
        </legend>
        <% client = @task.project.customer %>
        <% if File.exists?(client.logo_path) %>
				<%= "" %>
			<% else %>
			<% end %>
			<%= client.name %>

			Contact: <a href="mailto:<%= client.contact_email %>" class="tooltip" title="Send an email to <%= client.contact_name %>" ><%= client.contact_name %>

			<a href="/views/select_client/<%= @task.project.customer_id %>" class="tooltip" title="View all open tasks for <%= client.name %>">All Tasks •
			 <a target="_blank"  href="http://assets.emrl.com/pages/search.php?search=client:<%= client.name  %>" class="tooltip" title="View <%= client.name %> in the Asset Manager">Assets

			<a href="/wiki/show/<%= client.name %>" class="tooltip" title="View the Wiki for <%= client.name %>">Wiki
      <% unless client.evernote.nil? || client.evernote == '' %> •
      <a target="_blank" href="<%= client.evernote %>" class="tooltip" title="View the Evernote Notebook for <%= client.name %>">Notes
      <% end %>

	  </fieldset>
	<% end %>

      <fieldset id="task_attr" style="padding-right:0;">
        <legend><%=_ 'Attributes' %></legend>
      <%=_ 'Type' %>

        <% disabled = (perms['prioritize'].empty? || @task.new_record?) ? "" : "disabled=\"disabled\"" %>

        <input type="radio" name="task[type_id]" id="task_type_id_0" value="0" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 0 %> <%= disabled %>/>
          <label for="task_type_id_0" style="float:none;text-align:left;width:auto;margin:0;font-weight:normal;" class="tooltip" title="<%=_'Task'%>">

            <%=_'Task'%>

        <input type="radio" name="task[type_id]" id="task_type_id_1" value="1" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 1 %> <%= disabled %>/>
          <label for="task_type_id_1" style="float:none;text-align:left;width:auto;margin:0;font-weight:normal;" class="tooltip" title="<%=_'Design'%>">

            <%=_'Design'%>

        <input type="radio" name="task[type_id]" id="task_type_id_2" value="2"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 2 %> <%= disabled %>/>

            <%=_'Development'%>

        <input type="radio" name="task[type_id]" id="task_type_id_3" value="3"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 3 %> <%= disabled %>/>
          <label for="task_type_id_3" style="float:none;text-align:left;width:auto;margin:0;font-weight:normal;" title="<%=_'Research'%>" class="tooltip">

            <%=_'Research'%>

        <input type="radio" name="task[type_id]" id="task_type_id_4" value="4"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 4 %> <%= disabled %>/>
          <label for="task_type_id_4" style="float:none;text-align:left;width:auto;margin:0;font-weight:normal;" title="<%=_'Management'%>" class="tooltip">

            <%=_'Management'%>

	    <input type="radio" name="task[type_id]" id="task_type_id_5" value="5" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 5 %> <%= disabled %>/>
          <label for="task_type_id_5" style="float:none;text-align:left;width:auto;margin-left:0;font-weight:normal;" title="<%=_'Meeting'%>" class="tooltip">

           <%=_'Meeting'%>

      <%=_ 'Priority' %>
        <%= select 'task', 'priority', [[_('Critical'),3],[_('Urgent'),2],[_('High'),1],[_('Normal'),0],[_('Low'),-1],[_('Lowest'),-2]], {:selected => @task.priority}, perms['prioritize']  %>

      <%=_ 'Status' %>
        <%= select 'task', 'severity_id', [[_('Awaiting  Approval'),3],[_('Normal'),0]], {:selected => @task.severity_id}, perms['prioritize']  %>

      <% if current_user.option_tracktime.to_i == 1%>
       <%=_ 'Time Estimate' %>
      <%= text_field 'task', 'duration', {:size => 12, :value => (@task.duration.to_i > 0 ? worked_nice(@task.duration) : ""), :class => 'tooltip', :title => _('2w 3d 1h')}.merge(perms['prioritize']) %>

<% else %>
      <%= hidden_field_tag "task[duration]", "#{(@task.duration.to_i > 0 ? worked_nice(@task.duration) : "")}" %>
<% end %>
		<% range_start = Time.new.year - 5 %>
		<% range_end   = range_start + 10 %>
		<%=_ 'Start Date' %>
		<% if perms['prioritize'].empty? %>
			<%= calendar_field 'task', 'start_at', { :class => 'date tooltip', :field_title => 'Enter task start date, or click calendar button', :button_title => _('Show Calendar') },
			    { :ifFormat => current_user.date_format, :firstDay => 1, :range => [range_start, range_end], :step => 1, :showOthers => true } %>
		<% else %>
			<%= text_field 'task', 'start_at', {:size => 12, :value => @task.start_at ? @task.start_at.strftime_localized(current_user.date_format) : ''}.merge(perms['prioritize']) %>

		<% end %>

      <%=_ 'Due Date' %>
        <% if perms['prioritize'].empty? %>
          <% if( (current_user.locale || 'en_US') == 'en_US' )
               date_tooltip = _("Enter task due date, or click calendar button.
For recurring tasks, try:
every day
every thursday
every last friday
every 14 days
every 3rd monday (of a month)")
             else
               date_tooltip = _("Enter task due date, or click calendar button.")
             end %>
          <% if @task.repeat && @task.repeat.length > 0 %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar'), :value => @task.repeat_summary },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [range_start, range_end], :step => 1, :showOthers => true } %>
          <% else %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar') },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [range_start, range_end], :step => 1, :showOthers => true } %>
          <% end %>

        <% else %>
          <% if @task.repeat && @task.repeat.length > 0 %>
        <%= text_field 'task', 'due_at', {:size => 12, :value => @task.repeat_summary}.merge(perms['prioritize']) %>

          <% else %>
        <%= text_field 'task', 'due_at', {:size => 12, :value => (@task.due_at.nil? ? "" : @task.due_at.strftime_localized(current_user.date_format))}.merge(perms['prioritize']) %>

          <% end %>
        <% end %>
      </fieldset>

      <fieldset id="task_dependencies" style="padding-right:0;">
        <legend><%=_ "Dependencies"%></legend>

        <%=_ 'Depends on'%> #
        <% if perms['prioritize'].empty? %>
        <input name="dependencies[]" size="12" type="text" id="dependencies_input" title="<%=_("Enter task numbers, separated by commas. Type text to search. Hit Enter to save changes.")%>" class="tooltip" >

        <%= auto_complete_field 'dependencies_input', { :url => { :action => 'dependency_targets' }, :min_chars => 1, :frequency => 0.5, :indicator => 'loading', :select => 'complete_value', :tokens => ',' } %>
        <% else %>
        <input name="dependencies[]" size="12" type="text" disabled="disabled">
        <% end %>

        <% @task.dependencies.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

<%= link_to_task(d) %>

        <% if perms['prioritize'].empty? %>

          <% if d.done? %>
             <a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" ><i class="icon-check-sign tooltip" style="text-decoration: none; color:#000;" title="<%=_ 'Completed'%>" class="tooltip">
          <% else %>

                <a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" >

<i class="icon-minus-sign tooltip" style="text-decoration: none;" title="<%=_ 'Remove dependency'%>" class="tooltip">

                        <% end %>

        <% end %>
        <input name="dependencies[]" type="hidden" value="<%=d.task_num%>">

        <% end %>

      </fieldset>

<% unless @task.dependants.empty? %>

      <fieldset id="task_dependants" style="padding-right:0;">
        <legend><%=_ "Depended on by"%></legend>

        <% @task.dependants.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both; padding-left:16px;">

<% if d.done? %>Edit _form.shtml to remove this!<% else %><% end %><%= link_to_task(d) %>

        <% end %>

      </fieldset>

<% end %>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notification' %></legend>
        <%= _"Name / Email" %><input type="text" size="12" name="watchers[]" id="notification-input">

</fieldset>

<% if @task.attachments.size > 0 %>
    <fieldset id="task_attachments">
        <legend><%=_ "Attachments" %></legend>
        <% for file in @task.attachments %>
        <% if file.thumbnail? %>

        <a href="/project_files/show/<%=file.id%>"><img src="/project_files/thumbnail/<%=file.id%>" border="0" style="float:none;"/>

        <% end %>
        <%= link_to h(file.name), {:controller => 'project_files', :action => 'download', :id => file.id} %>
(<%=number_to_human_size(file.file_size)%>)
        <%= link_to _('[Delete]'), {:controller => 'project_files', :action => 'destroy', :id => file.id}, :confirm => _("Really delete %s?", file.name) %>

        <% end %>
      </fieldset>
      <% end %>


repair bug in generator for players table

<%
require 'rubygems'
require 'pokerstats/hand_statistics'
%>

class CreatePokerstats < ActiveRecord::Migration
  def self.up
	  create_table :hand_statistics do |t|
		<%= Pokerstats::HandStatistics.hand_statistics_migration_data -%>
	    t.timestamps
	  end
	  create_table :player_statistics do |t|
		t.integer :hand_statistic_id
		t.integer :player_id
		<%= Pokerstats::HandStatistics.player_statistics_migration_data -%>
	    t.timestamps
	  end
	  create_table :players do |t|
	    t.string :name
	  end
  end

  def self.down
	drop_table :players
    drop_table :player_statistics
	drop_table :hand_statistics
  end
end

<%
require 'rubygems'
require 'pokerstats/hand_statistics'
%>

class CreatePokerstats < ActiveRecord::Migration
  def self.up
	  create_table :hand_statistics do |t|
		<%= Pokerstats::HandStatistics.hand_statistics_migration_data -%>
	    t.timestamps
	  end
	  create_table :player_statistics do |t|
		t.integer :hand_statistic_id
		t.integer :player_id
		<%= Pokerstats::HandStatistics.player_statistics_migration_data -%>
	    t.timestamps
	  end
	  create_table :player do |t|
	    t.string :name
	  end
  end

  def self.down
	drop_table :player
    drop_table :player_statistics
	drop_table :hand_statistics
  end
end


ActionItem21: don't call a method before you know that there is an object to receive the call

git-svn-id: 43659daf80e124e0b603d67096418e58e4f21099@985 3f533792-8f58-4932-b0fe-aaf55b0a4547

<% if @article %>

    <%= icon('cms') %>
    <%= link_to profile.identifier, :action => 'index' %>
    <%= @article.hierarchy.map {|item| " / " + ((item == @article) ? item.name : link_to(item.name, :id => item.id)) } %>

<% else %>

    <%= icon('cms') %>
    <%= _('Content management') %>

  <% button_bar(:style => 'margin-bottom: 1em;') do %>
    <%= button('new', _('New article'), :action => 'new') %>
  <% end %>

<% end %>

<%# subitem %>
<% if !@subitems.empty? && @article %>
  <%= toggle_panel(_('Hide subitems'), _('Show subitems'), 'article-subitems') %>
<% end %>

<%= @article ? _('Subitems') : _('Articles') %>

    <% unless @subitems.empty? %>

        <% @subitems.each do |item| %>

          <%= file_manager_button(item.name, "icons-mime/#{item.icon_name}", :action => 'view', :id => item.id) %>

        <% end %>

    <% end %>

    <% if @article %>
      <% button_bar(:class => 'file-manager-controls') do %>
        <%= button('new',  _('New subitem'), :action => 'new', :parent_id => @article.id) %>
        <%= button('up', _('Go up one level'), :action => (@article.parent ? 'view' : 'index'), :id => @article.parent) %>
      <% end %>
    <% end %>

<%# display the article content %>

  <% if @article %>

<%= @article.name %>

    <% button_bar(:id => 'article-controls') do %>

        <%= _('"%{article}", last changed by %{author}') % { :article => @article.name, :author => (@article.last_changed_by ? @article.last_changed_by.name : _('Unknown User')) } %>

        <%= _('Public address of this article: %s') % (@article.public_path) %>

      <%= link_to_edit_article(@article) %>
      <%= button('home', _('Use as homepage'), { :action => 'set_home_page', :id => @article }, { :method => :post  }) %>
    <% end %>
    <%= @article.to_html %>
  <% end %>

<% if @article %>

    <%= icon('cms') %>
    <%= link_to profile.identifier, :action => 'index' %>
    <%= @article.hierarchy.map {|item| " / " + ((item == @article) ? item.name : link_to(item.name, :id => item.id)) } %>

<% else %>

    <%= icon('cms') %>
    <%= _('Content management') %>

  <% button_bar(:style => 'margin-bottom: 1em;') do %>
    <%= button('new', _('New article'), :action => 'new') %>
  <% end %>

<% end %>

<%# subitem %>
<% if !@subitems.empty? && @article %>
  <%= toggle_panel(_('Hide subitems'), _('Show subitems'), 'article-subitems') %>
<% end %>

<%= @article ? _('Subitems') : _('Articles') %>

    <% unless @subitems.empty? %>

        <% @subitems.each do |item| %>

          <%= file_manager_button(item.name, "icons-mime/#{item.icon_name}", :action => 'view', :id => item.id) %>

        <% end %>

    <% end %>

    <% if @article %>
      <% button_bar(:class => 'file-manager-controls') do %>
        <%= button('new',  _('New subitem'), :action => 'new', :parent_id => @article.id) %>
        <%= button('up', _('Go up one level'), :action => (@article.parent ? 'view' : 'index'), :id => @article.parent) %>
      <% end %>
    <% end %>

<%# display the article content %>

  <% if @article %>

<%= @article.name %>

    <% button_bar(:id => 'article-controls') do %>

        <%= _('"%{article}", last changed by %{author}') % { :article => @article.name, :author => (@article.last_changed_by.name || _('Unknown User')) } %>

        <%= _('Public address of this article: %s') % (@article.public_path) %>

      <%= link_to_edit_article(@article) %>
      <%= button('home', _('Use as homepage'), { :action => 'set_home_page', :id => @article }, { :method => :post  }) %>
    <% end %>
    <%= @article.to_html %>
  <% end %>


No more testing, I promise!

No more testing, I promise!

git-svn-id: 79eab1777d5dae6216eabab0929bfda25eda0fb7@273 ab7993de-5426-0410-a80b-baa00616f331

<% content_for :script do %>
  Tasks.sortUrl = '<%= sort_tasks_path %>'
  Event.observe(window, 'load', function() {
    Tasks.init();

    new Autocompleter.Local('new_task_name', 'categories_list',
                            <%= js_autocomplete_array(@categories) %>,
                            {tokens: ' ', fullSearch: false, frequency: 0, minChars: 1});
  });
<% end %>

<% remote_form_for(:new_task, :url => tasks_path, :html => { :id => :new_task_form }) do |f| %>
  <%= f.text_field :name %>

  <%= submit_tag "Today" %>
  <%= submit_to_remote 'when', 'Later', :url => tasks_path(:later => true) %>
  <%= link_to 'Completed', completed_tasks_path %>
<% end %>

<% if @first_time %>
  <%= render :partial => 'first_time' %>
<% end %>

  <% group_by_date(@dated_tasks).each do |date, tasks| %>
    <%= render :partial => "tasks", :locals => { :tasks => tasks, :date => date } %>
  <% end %>

  <%= render :partial => "tasks", :locals => { :tasks => @later_tasks, :date => nil } %>

<% content_for :script do %>
  Tasks.sortUrl = '<%= sort_tasks_path %>'
  Event.observe(window, 'load', function() {
    Tasks.init();

    new Autocompleter.Local('new_task_name', 'categories_list',
                            <%= js_autocomplete_array(@categories) %>,
                            {tokens: ' ', fullSearch: false, frequency: 0, minChars: 1});
  });
<% end %>

<% remote_form_for(:new_task, :url => tasks_path, :html => { :id => :new_task_form }) do |f| %>
  <%= f.text_field :name %>

  <%= submit_tag "Today" %>
  <%= submit_to_remote 'when', 'Later', :url => tasks_path(:later => true) %>
  <%= link_to 'Completed', completed_tasks_path %>
<% end %>

works! again

<% if @first_time %>
  <%= render :partial => 'first_time' %>
<% end %>

  <% group_by_date(@dated_tasks).each do |date, tasks| %>
    <%= render :partial => "tasks", :locals => { :tasks => tasks, :date => date } %>
  <% end %>

  <%= render :partial => "tasks", :locals => { :tasks => @later_tasks, :date => nil } %>


r54: we were pointing to lipid in our logo

  <title>CruiseControl.rb</title>
  <%= stylesheet_link_tag 'cruisecontrol', :media => 'all' %>
  <%= javascript_include_tag :defaults %>

  <%= link_to image_tag("cc_logo.png"), "http://cruisecontrolrb.rubyforge.org/" %>

<%= @breadcrumbs %>

version : <%= CruiseControl::VERSION::STRING %>

        <%= yield :left_side %>

        <%= yield %>

    <%= link_to image_tag("tw_dev_logo.gif"), "http://www.thoughtworks.com/" %>
    <%= image_tag "shim.gif" %>

  <title>CruiseControl.rb</title>
  <%= stylesheet_link_tag 'cruisecontrol', :media => 'all' %>
  <%= javascript_include_tag :defaults %>

  <%= link_to image_tag("cc_logo.png"), "http://lipid.rubyforge.org/" %>

<%= @breadcrumbs %>

version : <%= CruiseControl::VERSION::STRING %>

        <%= yield :left_side %>

        <%= yield %>

    <%= link_to image_tag("tw_dev_logo.gif"), "http://www.thoughtworks.com/" %>
    <%= image_tag "shim.gif" %>


use javascript_tag.

use javascript_tag.

git-svn-id: d766b2a131eb5d649bacb6a45bc0bcd899bdfdb3@192 c938ebee-df10-0410-95fc-be8c4b0ebdd5

<%= render :partial => "shared/doctype" %>

    <title>小槌</title>
    <%= render :partial => "shared/html_header" %>
    <%= stylesheet_link_tag 'login' %>
    <%= javascript_tag <<-END
window.onload = function() {
	document.getElementById("user_login_id").focus();
}
END
 %>

      Web家計簿

      小槌
      <%= image_tag("/images/kozuchi.png", :size => "48x48")%>

    <% if @flash[:notice] %>

<%=@flash[:notice]%>

    <% end %>

    <%= form_tag %>

        ログインID
        <%= text_field("user", "login_id", :size => 10) %>

        パスワード
        <%= password_field("user", "password", :size => 10) %>

        <button type="submit" id="login_button">ログイン</button>

    <%=end_form_tag%>

    <%= render :partial => "shared/footer" %>

<%= render :partial => "shared/doctype" %>

    <title>小槌</title>
    <%= render :partial => "shared/html_header" %>
    <%= stylesheet_link_tag 'login' %>

      Web家計簿

      小槌
      <%= image_tag("/images/kozuchi.png", :size => "48x48")%>

    <% if @flash[:notice] %>

<%=@flash[:notice]%>

    <% end %>

    <%= form_tag %>

        ログインID
        <%= text_field("user", "login_id", :size => 10) %>

        パスワード
        <%= password_field("user", "password", :size => 10) %>

        <button type="submit" id="login_button">ログイン</button>

    <%=end_form_tag%>

    <%= render :partial => "shared/footer" %>


added better wording to the create new profiles link as per Danielle's request

<%= link_to 'Enter motivation codes', :action => 'update_motivation_codes' %>

<%= link_to 'References: view, bypass or resend', :action => 'reference_resend_or_bypass' %>

<%= link_to 'Create new profiles (Input accepted applicants who applied by paper, or were accepted to another project)', :controller => :profiles, :action => 'new' %>

<%= link_to 'Edit manual donations', :controller => 'manual_donations', :action => 'list' %>

    <%= #link_to 'Manage custom reports', :controller => 'custom_reports', :action => 'manage_reports'
    %>

<%= link_to 'Enter motivation codes', :action => 'update_motivation_codes' %>

<%= link_to 'References: view, bypass or resend', :action => 'reference_resend_or_bypass' %>

<%= link_to 'Create new profiles (Input accepted students who applied by paper)', :controller => :profiles, :action => 'new' %>

<%= link_to 'Edit manual donations', :controller => 'manual_donations', :action => 'list' %>

    <%= #link_to 'Manage custom reports', :controller => 'custom_reports', :action => 'manage_reports'
    %>


Replaced disabled select with just the text to deal with a weird background issue on Macs

<%
desc       = @description
type       = desc.source_type
new_record = desc.new_record?
admin      = new_record || desc.is_admin?(@user)
author     = new_record || desc.is_author?(@user)
root       = is_in_admin_mode?
if new_record or admin or author or root %>

    <%= :form_description_source.t %>:

    <%=
      need_help = false
      if root
        form.select(:source_type, [
          [:form_description_source_public.l,  :public],
          [:form_description_source_foreign.l, :foreign],
          [:form_description_source_project.l, :project],
          [:form_description_source_source.l,  :source],
          [:form_description_source_user.l,    :user],
        ])
      elsif new_record and [:public, :source, :user].include?(type)
        need_help = true
        form.select(:source_type, [
          [:form_description_source_public.l, :public],
          [:form_description_source_source.l, :source],
          [:form_description_source_user.l,   :user],
        ])
      else
        "form_description_source_#{type}".to_sym.l
      end
    %>

    <%=
      args = { :size => 40 }
      if (type == :foreign or type == :project) and !root
        args[:disabled] = 'disabled'
      end
      indent + form.text_field(:source_name, args)
    %>

  <% if need_help %>

<%= :form_description_source_help.tpl %>

  <% end %>

    <%= :form_description_permissions.t %>:

    <% args = {}
    if [:public, :foreign].include?(type) and !root and !new_record
      args[:disabled] = 'disabled'
    end %>
    <%= form.check_box(:public_write, args) %>
      <%= :form_description_public_writable.t %>

    <%= form.check_box(:public, args) %>
      <%= :form_description_public_readable.t %>

    <%= :form_description_permissions_help.t %>

    <%= :License.t %>:

    <%= form.select(:license_id, @licenses) %>

    <%= :form_description_license_help.t %>

<% end %>

<%
desc       = @description
type       = desc.source_type
new_record = desc.new_record?
admin      = new_record || desc.is_admin?(@user)
author     = new_record || desc.is_author?(@user)
root       = is_in_admin_mode?
if new_record or admin or author or root %>

    <%= :form_description_source.t %>:

    <%=
      need_help = false
      if root
        form.select(:source_type, [
          [:form_description_source_public.l,  :public],
          [:form_description_source_foreign.l, :foreign],
          [:form_description_source_project.l, :project],
          [:form_description_source_source.l,  :source],
          [:form_description_source_user.l,    :user],
        ])
      elsif new_record and [:public, :source, :user].include?(type)
        need_help = true
        form.select(:source_type, [
          [:form_description_source_public.l, :public],
          [:form_description_source_source.l, :source],
          [:form_description_source_user.l,   :user],
        ])
      else
        form.select(:source_type, [
          ["form_description_source_#{type}".to_sym.l, type],
        ], {}, { :disabled => 'disabled' })
      end
    %>

    <%=
      args = { :size => 40 }
      if (type == :foreign or type == :project) and !root
        args[:disabled] = 'disabled'
      end
      indent + form.text_field(:source_name, args)
    %>

  <% if need_help %>

<%= :form_description_source_help.tpl %>

  <% end %>

    <%= :form_description_permissions.t %>:

    <% args = {}
    if [:public, :foreign].include?(type) and !root and !new_record
      args[:disabled] = 'disabled'
    end %>
    <%= form.check_box(:public_write, args) %>
      <%= :form_description_public_writable.t %>

    <%= form.check_box(:public, args) %>
      <%= :form_description_public_readable.t %>

    <%= :form_description_permissions_help.t %>

    <%= :License.t %>:

    <%= form.select(:license_id, @licenses) %>

    <%= :form_description_license_help.t %>

<% end %>