Add communities and topics
This commit is contained in:
15
app/views/topics/_form.html.erb
Normal file
15
app/views/topics/_form.html.erb
Normal 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 %>
|
||||
16
app/views/topics/_topics.html.erb
Normal file
16
app/views/topics/_topics.html.erb
Normal 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 %>
|
||||
10
app/views/topics/edit.html.erb
Normal file
10
app/views/topics/edit.html.erb
Normal 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>
|
||||
12
app/views/topics/new.html.erb
Normal file
12
app/views/topics/new.html.erb
Normal 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>
|
||||
5
app/views/topics/show.html.erb
Normal file
5
app/views/topics/show.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<%= render "shared/back_link" %>
|
||||
<br>
|
||||
Comunidad: <%= @community.proposal.title %>
|
||||
<br>
|
||||
<%= @topic.title %>
|
||||
Reference in New Issue
Block a user