Permalink
Browse files

Tweaked the startup/proposal list page, proposal review page and limi…

…ted the number of proposals per startup to 1. Closes #17.
  • Loading branch information...
fredwu committed Jul 19, 2011
1 parent d901bd5 commit 5be56ec572d46718b6ad004af8b236dcd87d8f29
@@ -0,0 +1,6 @@
+jQuery ->
+ $('#contact_founder').hide()
+ $('input[rel=contact_founder]').click((e) ->
+ $('#contact_founder').slideDown()
+ e.preventDefault()
+ )
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -416,11 +416,16 @@ nav.pagination {
margin-left: $avatar_size + 10px;
min-height: $avatar_size;
- .message_meta {
+ .message_meta,
+ .message_meta_secondary {
color: $secondary_colour_h;
font-size: $font_size_small;
margin-bottom: 5px;
}
+
+ .message_meta_secondary {
+ color: $secondary_colour;
+ }
}
}
}
@@ -558,7 +563,7 @@ nav.pagination {
}
}
- .grid_6 ul.resource_list {
+ #profile_team ul.resource_list {
li.mini_profile {
$profile_width: grid_cells(3);
@@ -652,6 +657,34 @@ form.read_only {
}
}
+/* ------------------------------
+ private message
+------------------------------ */
+
+#business_proposal_private_message {
+ > h2 {
+ border-bottom: 1px dotted $secondary_colour_h;
+ padding-bottom: 10px;
+ margin-bottom: 10px;
+ }
+
+ ul#messages {
+ li:first-child hr {
+ display: none;
+ }
+ }
+}
+
+#action_buttons {
+ > form {
+ float: left;
+
+ input {
+ margin: 0 20px 10px 0;
+ }
+ }
+}
+
/* ------------------------------
footer
------------------------------ */
@@ -20,7 +20,7 @@ def create
end
def send_private_message
- result = current_user.send_private_message(User.find(params[:users]), params[:message][:content])
+ result = current_user.send_private_message(User.find(params[:message][:users] || params[:users]), params[:message][:content])
respond_to do |format|
format.json { render :json => result }
@@ -41,4 +41,16 @@ def reply_private_message
format.html { redirect_to :back }
end
end
+
+ def archive_private_message
+ Message.topics.find(params[:id]).mark_as_archived!
+
+ respond_to do |format|
+ format.json { render :json => result }
+ format.html do
+ flash[:success] = t('text.message_is_archived')
+ redirect_to :back
+ end
+ end
+ end
end
View
@@ -112,6 +112,8 @@ def user_role(user)
end
def create_proposal(investors = [], attributes = {}, stage = 'draft', private_message = I18n.t('text.default_text_for_proposal_review'))
+ raise Exceptions::NotAllowed if proposals.count >= Settings.startup.proposal.limit
+
proposal = proposals.create(attributes)
update_and_submit_proposal(proposal, investors, attributes, stage)
send_private_message_to_investors(proposal, investors, private_message) if stage == 'submitted'
@@ -11,5 +11,5 @@
- if collection.any?
ul#messages
- collection.each do |resource|
- li.message= render 'messages/show', :resource => resource, :meta => meta
+ li.message= render "messages/#{meta[:show_view] || 'show'}", :resource => resource, :meta => meta
= show_pagination collection, :param_name => :p
@@ -0,0 +1,17 @@
+hr
+.message_user
+ = render 'startups/avatar', :startup => resource.proposal.startup
+.message_container
+ .message_meta
+ =' link_to resource.proposal.startup.name, startup_path(resource.proposal.startup)
+ = time_ago(resource.created_at)
+ .message_meta_secondary
+ = "#{t('label.founder')}: "
+ =' link_to resource.user.name, username_path(resource.user.username)
+ = "#{t('label.from')}: #{resource.user.location}, #{t('label.raise')}: #{number_to_currency(resource.proposal.startup.funds_to_raise)}, #{t('label.stage')}: #{resource.proposal.startup.stage}"
+ .message_content
+ - if meta[:linkable]
+ = link_to resource.content, my_private_message_path(resource)
+ - else
+ = resource.content
+
@@ -3,15 +3,36 @@
= render 'users/proposal_inboxes'
- else
= render 'users/message_inboxes'
-.grid_9
+.grid_9#business_proposal_private_message
- if @topic.is_with_proposal?
h1= t('label.business_proposal')
ul
li= "#{t('label.submitted_by')}: #{link_to @topic.user.name, user_path(@topic.user)} (#{link_to @topic.proposal.startup.name, startup_path(@topic.proposal.startup)})".html_safe
li= "#{t('label.submitted_to')}: #{link_to @topic.target.name, user_path(@topic.target)}".html_safe
hr
- .read_only= render 'proposals/read_only', :resource => @topic.proposal
+ h2= "#{t('label.startup')} #{t('label.details')}"
+ = render 'startups/mini_profile', :startup => @topic.proposal.startup, :meta => { :hide_team_members => true, :hide_editable => true }
+ hr
+ h2= "#{t('label.business_proposal')} #{t('label.details')}"
+ = render 'proposals/read_only', :resource => @topic.proposal
+
+ hr
+ h2= t('label.actions')
+ #action_buttons
+ = form_tag do |f|
+ = submit_tag t('label.contact_founder'), :rel => 'contact_founder'
+ = simple_form_for @topic, :url => my_private_message_path(@topic), :method => :delete do |f|
+ = f.button :submit, t('label.not_interested')
+ .clear
+
+ #contact_founder
+ = simple_form_for Message.new, :url => my_private_messages_path do |f|
+ = f.input :users, :as => :hidden, :input_html => { :value => @topic.user.id }
+ = f.input :content
+ = f.button :submit
+ .clear
+ hr
h2= t('label.comments')
ul#messages
li.message= render 'show', :resource => @topic, :meta => {}
@@ -1,5 +1,6 @@
ul#proposal_section_selector.multistage_selector
li= link_to t('label.product'), '#product'
+ li= link_to t('label.team'), '#team'
li= link_to t('label.market'), '#market'
li= link_to t('label.competition'), '#competition'
li= link_to t('label.investment'), '#investment', :class => 'last'
@@ -14,8 +15,16 @@ ul#proposal_section_selector.multistage_selector
.attribute= resource.pitch
= f.label :introduction
.attribute= resource.introduction
- .grouped_buttons
- = submit_tag t('label.next'), :class => 'navigation next'
+ fieldset#team
+ #profile_team
+ = f.label t('label.members')
+ .attribute= render 'users/index', :collection => resource.startup.members, :meta => { :parent => resource.startup, :role_identifier => 'member' }
+ = f.label t('label.investors')
+ .attribute= render 'users/index', :collection => resource.startup.investors, :meta => { :parent => resource.startup, :role_identifier => 'investors' }
+ = f.label t('label.advisors')
+ .attribute= render 'users/index', :collection => resource.startup.advisors, :meta => { :parent => resource.startup, :role_identifier => 'advisors' }
+ = f.label t('label.incubators')
+ .attribute= render 'users/index', :collection => resource.startup.incubators, :meta => { :parent => resource.startup, :role_identifier => 'incubators' }
fieldset#market
legend= t('label.market')
h2= t('label.one_year_market')
@@ -39,9 +48,6 @@ ul#proposal_section_selector.multistage_selector
= f.label :five_year_marketing_strategy
.attribute= resource.five_year_marketing_strategy
= f.input :five_year_gross_profit_margin
- .grouped_buttons
- = submit_tag t('label.prev'), :class => 'navigation prev'
- = submit_tag t('label.next'), :class => 'navigation next'
fieldset#competition
legend= t('label.competition')
= f.label :competitors_details
@@ -50,9 +56,6 @@ ul#proposal_section_selector.multistage_selector
.attribute= resource.competitive_edges
= f.label :competing_strategy
.attribute= resource.competing_strategy
- .grouped_buttons
- = submit_tag t('label.prev'), :class => 'navigation prev'
- = submit_tag t('label.next'), :class => 'navigation next'
fieldset#investment
legend= t('label.investment')
= f.input :investment_amount
@@ -62,8 +65,3 @@ ul#proposal_section_selector.multistage_selector
= f.label :spending_plan
.attribute= resource.spending_plan
= f.input :next_investment_round
- .grouped_buttons
- = submit_tag t('label.prev'), :class => 'navigation prev'
- - unless resource.proposal_stage_identifier == 'submitted'
- = submit_tag t('label.save_draft')
- = submit_tag t('label.submit_proposal')
@@ -1,2 +1,2 @@
div style="height: 50px; width: 50px; overflow: hidden;"
- = link_to image_tag(startup.logo_avatar, :alt => startup.name), resource_path(startup)
+ = link_to image_tag(startup.logo_avatar, :alt => startup.name), startup_path(startup)
@@ -1,11 +1,12 @@
-- if startup.founder == current_user
+- if startup.founder == current_user && !meta[:hide_editable]
= render 'shared/editable', :edit_target => '#profile_details'
.mini_profile.inline_edtiable_container
#profile_details data-target_link="#{startup_profile_details_path(startup)}"
- = render 'profile_details', :startup => startup
+ = render 'startups/profile_details', :startup => startup
.clear
- hr
- #profile_team
- = render 'profile_team', :startup => startup
+ - unless meta[:hide_team_members]
+ hr
+ #profile_team
+ = render 'startups/profile_team', :startup => startup
@@ -1,23 +1,23 @@
.team
h2= t('label.members')
- = render 'add_user_link', :startup => startup, :role_identifier => 'member'
+ = render 'startups/add_user_link', :startup => startup, :role_identifier => 'member'
= render 'users/index', :collection => startup.members, :meta => { :removable => true, :editable => true, :parent => startup, :role_identifier => 'member' }
.clear
.team
h2= t('label.investors')
- = render 'add_user_link', :startup => startup, :role_identifier => 'investor'
+ = render 'startups/add_user_link', :startup => startup, :role_identifier => 'investor'
= render 'users/index', :collection => startup.investors, :meta => { :removable => true, :editable => true, :parent => startup, :role_identifier => 'investor' }
.clear
.team
h2= t('label.advisors')
- = render 'add_user_link', :startup => startup, :role_identifier => 'advisor'
+ = render 'startups/add_user_link', :startup => startup, :role_identifier => 'advisor'
= render 'users/index', :collection => startup.advisors, :meta => { :removable => true, :editable => true, :parent => startup, :role_identifier => 'advisor' }
.clear
.team
h2= t('label.incubators')
- = render 'add_user_link', :startup => startup, :role_identifier => 'incubator'
+ = render 'startups/add_user_link', :startup => startup, :role_identifier => 'incubator'
= render 'users/index', :collection => startup.incubators, :meta => { :removable => true, :editable => true, :parent => startup, :role_identifier => 'incubator' }
.clear
@@ -4,13 +4,16 @@ ul.resource_list.startup_list
hr
.profile_pic
- = render 'avatar', :startup => startup, :meta => {}
+ = render 'avatar', :startup => startup
.profile_meta
h2= link_to startup.name, startup_path(startup)
ul
li= startup.pitch
- li.secondary= startup.location
+ li.secondary
+ = "#{t('label.founder')}: "
+ =' link_to startup.founder.name, username_path(startup.founder.username)
+ = "#{t('label.from')}: #{startup.founder.location}, #{t('label.raise')}: #{number_to_currency(startup.funds_to_raise)}, #{t('label.stage')}: #{startup.stage}"
.profile_metrics
.follow_button= follow_button(startup)
@@ -1,5 +1,5 @@
.grid_6
- = render 'mini_profile', :startup => resource
+ = render 'mini_profile', :startup => resource, :meta => {}
.grid_6.inline_edtiable_container
- if resource.founder == current_user
= render 'shared/editable', :edit_target => '#gallery', :url => startup_upload_photos_path(resource)
@@ -12,7 +12,8 @@
hr
h2= t('label.business_proposals')
ul
- - resource.proposals.each_with_index do |proposal, index|
- li
- = link_to "#{t('label.business_proposal')} #{index + 1} (#{t("startup.proposal_stage_identifiers.#{proposal.proposal_stage_identifier}")})", edit_startup_proposal_path(resource, proposal)
- li.create_new= link_to t('label.create_new'), new_startup_proposal_path(resource)
+ - if resource.proposals.any?
+ - resource.proposals.each_with_index do |proposal, index|
+ li= link_to "#{t('label.business_proposal')} #{index + 1} (#{t("startup.proposal_stage_identifiers.#{proposal.proposal_stage_identifier}")})", edit_startup_proposal_path(resource, proposal)
+ - else
+ li.create_new= link_to t('label.create_new'), new_startup_proposal_path(resource)
@@ -1,4 +1,4 @@
.grid_3
= render 'users/proposal_inboxes'
.grid_9
- = render 'messages/index', :collection => @messages, :meta => { :linkable => true }
+ = render 'messages/index', :collection => @messages, :meta => { :linkable => true, :show_view => 'show_with_startup' }
View
@@ -57,13 +57,15 @@ en:
label:
home: Home
loading: Loading
+ actions: Actions
create: Create
update: Update
add: Add
edit: Edit
update: Update
delete: Delete
remove: Remove
+ archive: Archive
cancel: Cancel
close: Close
confirm: Confirm
@@ -139,6 +141,12 @@ en:
messages_inbox: Messages inbox
proposals_inbox: Proposals inbox
delete_the_image_below: Delete the image below
+ contact_founder: Contact founder
+ details: Details
+ not_interested: Not interested
+ from: From
+ raise: Raise
+ stage: Stage
message:
proposal_saved: The proposal has been saved!
proposal_submitted: The proposal has been submitted to the investors!
@@ -150,3 +158,4 @@ en:
enter_recipient_names: Recipient name ...
enter_investor_names: Investor names ...
no_more_selections_allowed: No more selections are allowed.
+ message_is_archived: The message is archived.
Oops, something went wrong.

0 comments on commit 5be56ec

Please sign in to comment.