-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated views & controller. now we have a nice way of tagging project…
…s at creation and update. it's similar to the way delicious handles tagging and is way nicer than before. :)
- Loading branch information
Showing
8 changed files
with
58 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<div class="headline"><%= title %></div> | ||
<div class="form_new"> | ||
<% form_for(@project) do |f| %> | ||
<%= f.error_messages %> | ||
<table> | ||
<tr> | ||
<td><%= f.label :name, (l :name) %></td> | ||
<td><%= f.text_field :name %></td> | ||
</tr> | ||
<tr> | ||
<td><%= f.label :description, (l :description) %></td> | ||
<td><%= f.text_area :description %></td> | ||
</tr> | ||
<tr> | ||
<td><%= f.label :website, (l :website) %></td> | ||
<td><%= f.text_field :website %></td> | ||
</tr> | ||
<tr> | ||
<td><%= f.label :tag_name, (l :tags)%></td> | ||
<td> | ||
<%= f.text_field :tag_list, :size => 50 %> | ||
<div class="auto_complete" id="tag_name_auto_complete"></div> | ||
<script type="text/javascript"> | ||
var tag_name_auto_completer = new Ajax.Autocompleter('project_tag_list', 'tag_name_auto_complete', | ||
'/projects/auto_complete_for_tag_name', | ||
{ | ||
method:'get', | ||
updateElement: function(item){ | ||
var tags = $('project_tag_list').value.split(" "); | ||
tags.pop(); | ||
tags.push(item.innerText) | ||
$('project_tag_list').value = tags.join(" ") + " "}} | ||
) | ||
</script> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><%= f.label :public, (l :public) %><br /></td> | ||
<td><%= f.check_box :public %></td> | ||
</tr> | ||
<tr> | ||
<td><%= f.label :invite_only, (l :invite_only) %><br /></td> | ||
<td><%= f.check_box :invite_only %></td> | ||
</tr> | ||
<tr> | ||
<td><%= f.submit (l :create) %></td> | ||
</tr> | ||
</table> | ||
<% end %> | ||
<%= link_to 'Back', projects_path %> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1 @@ | ||
<div class="headline">Editing project</div> | ||
<div class="form_edit"> | ||
<% form_for(@project) do |f| %> | ||
<%= f.error_messages %> | ||
|
||
<p> | ||
<%= f.label :name, (l :name) %><br /> | ||
<%= f.text_field :name %> | ||
</p> | ||
<p> | ||
<%= f.label :description, (l :description) %><br /> | ||
<%= f.text_area :description %> | ||
</p> | ||
<p> | ||
<%= f.label :tag_list, (l :tags) %> | ||
<div id="project_tags" style="padding-bottom:1em"> | ||
<%= render :partial => "tag_list_item", :collection => @project.tag_list %> | ||
</div> | ||
<%= l :new_tags %>: | ||
<%= text_field_tag :new_tags, {}, :size => 30, | ||
:autocomplete => "off" %> (<%= l :seperated_by_comma %>)<br><br> | ||
<%= l :tag_search %>: | ||
<input id="tag_search" name="tag_search" type="text" value="" size="31" autocomplete="off"> | ||
|
||
<%= image_tag("spinner.gif", | ||
:align => "absmiddle", | ||
:border => 0, | ||
:id => "spinner", | ||
:style =>"display:none" ) %> | ||
<div id="tag_search_results" style="text-align:left;padding-bottom:5em"> | ||
</div> | ||
<%= observe_field 'tag_search', | ||
:frequency => 0.5, | ||
:before => "Element.show('spinner')", | ||
:success => "Element.hide('spinner')", | ||
:update => 'tag_search_results', | ||
:url => { :controller => 'projects', :action=> 'search_tags' }, | ||
:with => "'search=' + escape(value)" %> | ||
|
||
</p> | ||
<p> | ||
<%= f.label :website, (l :website) %><br /> | ||
<%= f.text_field :website %> | ||
</p> | ||
<p> | ||
<%= f.label :public, (l :public) %><br /> | ||
<%= f.check_box :public %> | ||
</p> | ||
<p> | ||
<%= f.label :invite_only, (l :invite_only) %><br /> | ||
<%= f.check_box :invite_only %> | ||
</p> | ||
<p> | ||
<%= f.submit (l :update) %> | ||
</p> | ||
<% end %> | ||
</div> | ||
|
||
<%= link_to (l :show), @project %> | | ||
<%= link_to (l :back), projects_path %> | ||
<%= render :partial => "edit_project", :locals => { :title => (l :edit_project) }%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1 @@ | ||
<div class="headline"><%= l :new_project %></div> | ||
<div class="form_new"> | ||
<% form_for(@project) do |f| %> | ||
<%= f.error_messages %> | ||
<table> | ||
<tr> | ||
<td><%= f.label :name, (l :name) %></td> | ||
<td><%= f.text_field :name %></td> | ||
</tr> | ||
<tr> | ||
<td><%= f.label :description, (l :description) %></td> | ||
<td><%= f.text_area :description %></td> | ||
</tr> | ||
<tr> | ||
<td><%= f.label :website, (l :website) %></td> | ||
<td><%= f.text_field :website %></td> | ||
</tr> | ||
<tr> | ||
<td><%= f.label :tag_name, (l :tag_search)%></td> | ||
<td> | ||
<% text_field_with_auto_complete :tag, :name, {}, {:method => :get, :skip_style => true} %> | ||
<input id="tag_list" name="project[tag_list]" size="30" type="text" /> | ||
<div class="auto_complete" id="tag_name_auto_complete"></div> | ||
<script type="text/javascript"> | ||
var tag_name_auto_completer = new Ajax.Autocompleter('tag_list', 'tag_name_auto_complete', | ||
'/projects/auto_complete_for_tag_name', | ||
{ | ||
method:'get', | ||
updateElement: function(item){ | ||
var tags = $('tag_list').value.split(" "); | ||
tags.pop(); | ||
tags.push(item.innerText) | ||
$('tag_list').value = tags.join(" ") + " "}} | ||
) | ||
</script> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><%= f.label :public, (l :public) %><br /></td> | ||
<td><%= f.check_box :public %></td> | ||
</tr> | ||
<tr> | ||
<td><%= f.label :invite_only, (l :invite_only) %><br /></td> | ||
<td><%= f.check_box :invite_only %></td> | ||
</tr> | ||
<tr> | ||
<td><%= f.submit (l :create) %></td> | ||
</tr> | ||
</table> | ||
<% end %> | ||
<%= link_to 'Back', projects_path %> | ||
</div> | ||
<%= render :partial => "edit_project", :locals => { :title => (l :new_project) }%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters