Add communities and topics

This commit is contained in:
taitus
2017-08-07 12:51:49 +02:00
parent ee3b3f2c85
commit 43c17c3fc7
20 changed files with 210 additions and 10 deletions

View File

@@ -0,0 +1,15 @@
<%= form_for([@community, @topic]) do |f| %>
<%= render 'shared/errors', resource: @topic %>
<div class="row">
<div class="small-12 column">
<%= f.label :title, t("topic.form.topic_title") %>
<%= f.text_field :title %>
</div>
<div class="actions small-12 column">
<%= f.submit(class: "button", value: t("topic.#{action_name}.form.submit_button")) %>
</div>
</div>
<% end %>

View File

@@ -0,0 +1,16 @@
<div class="order">
Ordenar por:
</div>
<br>
<% if topics.any? %>
<% topics.each do |topic| %>
<div id="<%= dom_id(topic) %>">
<%= link_to topic.title, community_topic_path(@community, topic) %>
<% if topic.author == current_user %>
<%= link_to t("topic.edit"), edit_community_topic_path(@community.id, topic), class: 'button expanded' %>
<% end %>
</div>
<% end %>
<% else %>
Crea el primer tema de la comunidad!!!
<% end %>

View File

@@ -0,0 +1,10 @@
<div class="topic-form row">
<div class="small-12 column">
<%= render "shared/back_link" %>
<h1><%= t("topic.edit.editing") %></h1>
<%= render "form" %>
</div>
</div>

View File

@@ -0,0 +1,12 @@
<div class="topic-new row">
<div class="small-12 medium-9 column">
<h1><%= t("topic.create") %></h1>
<%= render '/topics/form' %>
<%#= render '/topics/form', form_url: budget_investments_path(@budget) %>
</div>
<div class="small-12 medium-9 column">
Recomendaciones para crear un tema
</div>
</div>

View File

@@ -0,0 +1,5 @@
<%= render "shared/back_link" %>
<br>
Comunidad: <%= @community.proposal.title %>
<br>
<%= @topic.title %>