From b0a90fefe612bcef809e28c9937d9669c52cf197 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Mon, 20 Aug 2007 14:36:36 +0000 Subject: [PATCH] ActionItem6: added user documentation to the actions of enterprise managment --- app/controllers/enterprise_controller.rb | 6 +++--- app/views/enterprise/_enterprise.rhtml | 5 +++++ app/views/enterprise/_search_box.rhtml | 1 + app/views/enterprise/edit.rhtml | 2 +- app/views/enterprise/list.rhtml | 7 ++++++- app/views/enterprise/show.rhtml | 3 +++ 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/controllers/enterprise_controller.rb b/app/controllers/enterprise_controller.rb index c6f7c72..1f17be2 100644 --- a/app/controllers/enterprise_controller.rb +++ b/app/controllers/enterprise_controller.rb @@ -86,11 +86,11 @@ class EnterpriseController < ApplicationController def activate @enterprise = Enterprise.find(params[:id]) if @enterprise.update_attribute('active', true) - flash[:notice] = 'Enterprise successfuly activacted' - render :action => 'show' + flash[:notice] = _('Enterprise successfuly activacted') else - redirect_to :action => 'show', :id => @enterprise + flash[:notice] = _('Failed to activate the enterprise') end + redirect_to :action => 'index' end protected diff --git a/app/views/enterprise/_enterprise.rhtml b/app/views/enterprise/_enterprise.rhtml index 9172dc5..346106b 100644 --- a/app/views/enterprise/_enterprise.rhtml +++ b/app/views/enterprise/_enterprise.rhtml @@ -1,6 +1,11 @@
  • <%= link_to enterprise.name, :action => 'show', :id => enterprise %> <%= link_to _('Edit'), :action => 'edit', :id => enterprise %> +<%= help _('Change the infomation about the enterprise') %> <%= link_to _('Delete'), :action => 'destroy', :id => enterprise %> +<%= help _('Remove the enterprise from the system') %> <%= link_to _('Affiliate'), :action => 'affiliate', :id => enterprise unless @my_enterprises.include?(enterprise) %> +<%= help _('Be a member of the enterprise') unless @my_enterprises.include?(enterprise) %> +<%= link_to _('Activate'), :action => 'activate', :id => enterprise if @my_pending_enterprises.include?(enterprise) %> +<%= help _('Activate the profile of an approved enterprise') if @my_pending_enterprises.include?(enterprise) %>
  • diff --git a/app/views/enterprise/_search_box.rhtml b/app/views/enterprise/_search_box.rhtml index 895590d..a4f1582 100644 --- a/app/views/enterprise/_search_box.rhtml +++ b/app/views/enterprise/_search_box.rhtml @@ -2,5 +2,6 @@ <% form_tag :action => 'search' do %> <%= text_field_tag 'query' %> <%= submit_tag _('Search') %> + <%= help _('Search enteprises by tag or name') %> <% end %> diff --git a/app/views/enterprise/edit.rhtml b/app/views/enterprise/edit.rhtml index 88fd12d..b238d4a 100644 --- a/app/views/enterprise/edit.rhtml +++ b/app/views/enterprise/edit.rhtml @@ -4,6 +4,6 @@ <% form_tag :action => 'update', :id => @enterprise do %> <%= render :partial => 'form' %> -

    <%= submit_tag _('Register') %> +

    <%= submit_tag _('Update') %> <%= link_to _('Cancel'), :action => 'index' %>

    <% end %> diff --git a/app/views/enterprise/list.rhtml b/app/views/enterprise/list.rhtml index d6e468e..27d9e2a 100644 --- a/app/views/enterprise/list.rhtml +++ b/app/views/enterprise/list.rhtml @@ -1,6 +1,9 @@ <%= render :partial => 'search_box' %> -

    <%= link_to _('Register new enterprise'), :action => 'register_form' %>

    +

    <%= link_to _('Register new enterprise'), :action => 'register_form' %> +<%= help _('Creates a new enterprise') %> +

    +

    <%= _('Listing my enterprises') %>

    <% end %> +<% unless @enterprises.blank? %>

    <%= _('Other Enterprises') %>

    +<% end %> diff --git a/app/views/enterprise/show.rhtml b/app/views/enterprise/show.rhtml index 1437438..1b55b1a 100644 --- a/app/views/enterprise/show.rhtml +++ b/app/views/enterprise/show.rhtml @@ -16,5 +16,8 @@

    <%= _('Tags:') %> <%= @enterprise.tag_list %>

    <%= link_to _('Edit enterprise'), :action => 'edit', :id => @enterprise %> +<%= help _('Change the information about the enterprise') %> <%= link_to _('Delete enterprise'), :action => 'destroy', :id => @enterprise %> +<%= help _('Remove the enterprise from the system') %> <%= link_to _('Affiliate'), :action => 'affiliate' unless @my_enterprises.include?(@enterprise) %> +<%= help _('Be a member of the enterprise') %> -- libgit2 0.21.2