+
+ <% if @topic.author == current_user %>
+
+ <% end %>
+
+
+
+
+ <%= render "topics/filter_subnav" %>
+
+ <%= render "topics/comments" %>
-
diff --git a/config/locales/en/community.yml b/config/locales/en/community.yml
index 137787563..d7a892aa8 100644
--- a/config/locales/en/community.yml
+++ b/config/locales/en/community.yml
@@ -14,29 +14,31 @@ en:
proposal: Participate in the community of this proposal. An active community can help to improve the content of the proposal and boost its dissemination to get more support.
investment: Participate in the community of this budget investment. An active community can help to improve the content of the budget investment and boost its dissemination to get more support.
create_first_community_topic:
- first_theme_not_logged_in: No issue yet available, participate creating the first one. Click on the create new topic button.
+ first_theme_not_logged_in: No issue available, participate creating the first one.
first_theme: Create the first community topic
- sub_first_theme: To create a theme you have to %{link}
- sign_link: "access %{org_name}"
+ sub_first_theme: "To create a theme you must to %{sign_in} o %{sign_up}."
+ sign_in: "sign in"
+ sign_up: "sign up"
tab:
participants: Participants
sidebar:
participate: Participate
new_topic: Create topic
- disabled_info_title: You need to be logged to create a new topic
topic:
- edit_button: Edit
- destroy_button: Destroy
+ edit: Edit topic
+ destroy: Destroy topic
comments:
one: 1 comment
other: "%{count} comments"
zero: No comments
+ author: Author
+ back: Back to %{community} %{proposal}
topic:
create: Create a topic
edit: Edit Topic
form:
- topic_title: Topic Title
- topic_description: Description
+ topic_title: Title
+ topic_text: Initial text
new:
submit_button: Create topic
edit:
diff --git a/config/locales/es/community.yml b/config/locales/es/community.yml
index abfe24a67..f08a4918a 100644
--- a/config/locales/es/community.yml
+++ b/config/locales/es/community.yml
@@ -14,29 +14,31 @@ es:
proposal: Participa en la comunidad de esta propuesta. Una comunidad activa puede ayudar a mejorar el contenido de la propuesta así como a dinamizar su difusión para conseguir más apoyos.
investment: Participa en la comunidad de este proyecto de inversión. Una comunidad activa puede ayudar a mejorar el contenido del proyecto de inversión así como a dinamizar su difusión para conseguir más apoyos.
create_first_community_topic:
- first_theme_not_logged_in: Aún no hay ningun tema disponible, participa creando el primero. Haz click en el botón crear nuevo tema.
+ first_theme_not_logged_in: No hay ningún tema disponible, participa creando el primero.
first_theme: Crea el primer tema de la comunidad
- sub_first_theme: Para crear un tema tienes que %{link}
- sign_link: "acceder a %{org_name}"
+ sub_first_theme: "Para crear un tema debes %{sign_in} o %{sign_up}."
+ sign_in: "iniciar sesión"
+ sign_up: "registrarte"
tab:
participants: Participantes
sidebar:
participate: Participa
new_topic: Crea un tema
- disabled_info_title: Necesitas estar logueado para crear un nuevo tema
topic:
- edit_button: Editar
- destroy_button: Eliminar
+ edit: Editar tema
+ destroy: Eliminar tema
comments:
zero: Sin comentarios
one: 1 Comentario
other: "%{count} Comentarios"
+ author: Autor
+ back: Volver a %{community} %{proposal}
topic:
create: Crear un tema
edit: Editar tema
form:
- topic_title: Titulo del tema
- topic_description: Descripción
+ topic_title: Título
+ topic_text: Texto inicial
new:
submit_button: Crear tema
edit:
diff --git a/spec/features/communities_spec.rb b/spec/features/communities_spec.rb
index 2909f416e..725364074 100644
--- a/spec/features/communities_spec.rb
+++ b/spec/features/communities_spec.rb
@@ -24,16 +24,6 @@ feature 'Communities' do
expect(page).to have_content proposal.title
expect(page).to have_content "Participate in the community of this proposal"
expect(page).to have_link("Create topic", href: new_community_topic_path(community))
- expect(page).not_to have_selector(".button.disabled", text: "Create topic")
- end
-
- scenario 'Should display disabled create topic button when user is not logged' do
- proposal = create(:proposal)
- community = proposal.community
-
- visit community_path(community)
-
- expect(page).to have_selector(".button.disabled", text: "Create topic")
end
scenario 'Should display without_topics_text and participants when there are not topics' do
@@ -100,7 +90,7 @@ feature 'Communities' do
expect(topic2.title).to appear_before(topic1.title)
end
- scenario 'Should display topic edit button when author is logged' do
+ scenario 'Should display topic edit button on topic show when author is logged' do
proposal = create(:proposal)
community = proposal.community
user = create(:user)
@@ -108,15 +98,11 @@ feature 'Communities' do
topic2 = create(:topic, community: community)
login_as(user)
- visit community_path(community)
+ visit community_topic_path(community, topic1)
+ expect(page).to have_link("Edit topic", href: edit_community_topic_path(community, topic1))
- within "#topic_#{topic1.id}" do
- expect(page).to have_link("Edit", href: edit_community_topic_path(community, topic1))
- end
-
- within "#topic_#{topic2.id}" do
- expect(page).not_to have_link("Edit", href: edit_community_topic_path(community, topic2))
- end
+ visit community_topic_path(community, topic2)
+ expect(page).not_to have_link("Edit topic", href: edit_community_topic_path(community, topic2))
end
scenario 'Should display participant when there is topics' do
diff --git a/spec/features/topics_specs.rb b/spec/features/topics_specs.rb
index 0ba674844..a4c8c8ff9 100644
--- a/spec/features/topics_specs.rb
+++ b/spec/features/topics_specs.rb
@@ -4,13 +4,16 @@ feature 'Topics' do
context 'New' do
- scenario 'Should display disabled button to new topic page without user logged', :js do
+ scenario 'Create new topic link should redirect to sign up for anonymous users', :js do
proposal = create(:proposal)
community = proposal.community
+ logout
visit community_path(community)
+ click_link "Create topic"
- expect(page).to have_selector(".button.expanded.disabled")
+ expect(page).to have_content "Sign in with:"
+ expect(current_path).to eq(new_user_session_path)
end
scenario 'Can access to new topic page with user logged', :js do
@@ -34,8 +37,8 @@ feature 'Topics' do
click_link "Create topic"
- expect(page).to have_content "Topic Title"
- expect(page).to have_content "Description"
+ expect(page).to have_content "Title"
+ expect(page).to have_content "Initial text"
expect(page).to have_content "Recommendations to create a topic"
expect(page).to have_content "Do not write the topic title or whole sentences in capital letters. On the internet that is considered shouting. And no one likes to be yelled at."
expect(page).to have_content "Any topic or comment that implies an illegal action will be eliminated, also those that intend to sabotage the spaces of the subject, everything else is allowed."
@@ -128,9 +131,9 @@ feature 'Topics' do
user = create(:user)
topic = create(:topic, community: community, author: user)
login_as(user)
- visit community_path(community)
+ visit community_topic_path(community, topic)
- click_link "Destroy"
+ click_link "Destroy topic"
expect(page).to have_content "Topic deleted successfully."
expect(page).not_to have_content topic.title