Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added description attr for organization and description field to organization views #2

Merged
merged 1 commit into from
Jun 30, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions db/migrate/20130630184240_add_description_to_organization.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddDescriptionToOrganization < ActiveRecord::Migration
def up
add_column :organizations, :description, :string
end

def down
remove_column :organizations, :description
end
end
1 change: 1 addition & 0 deletions themes/activate/views/organizations/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
= f.input :contact_name
= f.input :email
= f.input :url
= f.input :description
= f.input :topics, :input_html => { :class => 'required chzn-select-create' }
= f.buttons do
= f.submit "Update"
1 change: 1 addition & 0 deletions themes/activate/views/organizations/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
= f.input :contact_name, :label => "Contact Name", :hint => "person that can be contacted in the organization"
= f.input :email, :label => "Email", :hint => "we may use this to contact the organization"
= f.input :url, :label => "Homepage", :hint => 'for example, http://awesome-nonprofit.org'
= f.input :description, :label => "Description", :hint => "organization description or mission statement"
= f.input :topics, :input_html => { :class => 'required chzn-select-create', 'data-placeholder' => "Choose or add your own..." }
- focus_on '#organization_name'
= f.buttons do
Expand Down
14 changes: 9 additions & 5 deletions themes/activate/views/organizations/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@

%h1= @organization.name

%p
%b Description:
= @organization.description

%p
%b URL:
= source_url_link @organization

- unless @organization.topics.blank?
- unless @organization.topics.blank?
%p
%b Topics:
= render :partial => 'shared/topics', :locals => {:topics => @organization.topics}
= render :partial => 'shared/topics', :locals => {:topics => @organization.topics}

%p
%b Events:
Expand All @@ -20,10 +24,10 @@
- content_for :sidebar do
.box
%ul
%li= link_to 'Add an event', '/events/new?event[organization_id]=' + @organization.id.to_s
%li= link_to 'Add an event', '/events/new?event[organization_id]=' + @organization.id.to_s
-# XXX TODO - last line is a hack. Should use something like new_event_url after updating routes.rb,
-# or figure out how to set params to pass org id.
-# or figure out how to set params to pass org id.
%li= link_to 'Import event or calendar', new_organization_source_path(@organization)
%li= link_to 'Manage event or calendar sources', organization_sources_path(@organization)
%li= link_to 'Edit this organization', edit_organization_url
-# link_to 'Destroy', @organization, :confirm => 'Are you sure?', :method => :delete
-# link_to 'Destroy', @organization, :confirm => 'Are you sure?', :method => :delete