Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: alabs/15mcc
base: ff707fd6c3
...
head fork: alabs/15mcc
compare: 33c49293f9
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
View
22 webapp/app/assets/javascripts/forms.js
@@ -1,3 +1,18 @@
+
+
+function check_author_checker(){
+ // para el checkbox de "Soy el autor"
+ if ( $('.author_myself').is(':checked') ) {
+ $('.author-field').slideUp('slow');
+ $('.author-field input').removeAttr('required');
+ } else {
+ $('.author-field').slideDown('slow');
+ $('.author-field input').attr('required', 'required');
+ }
+}
+
+
+
$(function(){
// date and time picker for Fecha
@@ -348,4 +363,11 @@ $(function(){
source: country_list
});
+ // para el checkbox de "Soy el autor"
+ check_author_checker();
+
+ $('.author_myself').on('change', function(){
+ check_author_checker();
+ })
+
});
View
2  webapp/app/assets/stylesheets/application.css.sass
@@ -192,6 +192,8 @@ form
.gmaps4rails_map, .map_container
height: 300px
width: 624px
+ #author_myself_label
+ display: inline-block
.hr-profile
View
7 webapp/app/models/content.rb
@@ -23,6 +23,13 @@ class Content
belongs_to :user
field :user_id, type: String
+ # Puede ser que el mismo usuario creador de la ficha
+ # sea el autor de la obra
+ field :author_myself, type: String
+ # o sino puede ser un nombre/link
+ field :author_name, type: String
+ field :author_link, type: String
+
#address
field :address, type: String
field :city, type: String
View
18 webapp/app/views/images/_create_step.html.erb
@@ -21,6 +21,24 @@
<%= f.file_field :img, required: true, class: 'upload' %>
<p class="help-block"><%= I18n.t("help.image.archive") %></p>
</div>
+
+ <% if user_signed_in? %>
+ <%= f.check_box :author_myself, :class => "author_myself" do %>
+ <%= I18n.t("help.content.author.myself") %>
+ <% end %>
+ <% end %>
+
+ <div class="form-field author-field">
+ <%= f.text_field :author_name, class: 'span8', :required => "true" do %>
+ <p class="help-block"><%= I18n.t("help.content.author.name") %></p>
+ <% end %>
+ </div>
+
+ <div class="form-field author-field">
+ <%= f.text_field :author_link, class: 'span8', :type => "url" do %>
+ <p class="help-block"><%= I18n.t("help.content.author.url") %></p>
+ <% end %>
+ </div>
<div class="form-field">
<%= f.text_field :tag_list, class: 'span8', :required => 'true' do %>
View
18 webapp/app/views/partials/_form_for_content.html.erb
@@ -1,3 +1,21 @@
+ <% if user_signed_in? %>
+ <%= f.check_box :author_myself, :class => "author_myself" do %>
+ <%= I18n.t("help.content.author.myself") %>
+ <% end %>
+ <% end %>
+
+ <div class="form-field author-field">
+ <%= f.text_field :author_name, class: 'span8', :required => "true" do %>
+ <p class="help-block"><%= I18n.t("help.content.author.name") %></p>
+ <% end %>
+ </div>
+
+ <div class="form-field author-field">
+ <%= f.text_field :author_link, class: 'span8', :type => "url" do %>
+ <p class="help-block"><%= I18n.t("help.content.author.url") %></p>
+ <% end %>
+ </div>
+
<div class="form-field">
<%= f.text_field :tag_list, class: 'span8', :required => "true" do %>
<p class="help-block"><%= I18n.t("help.content.tags") %></p>
View
11 webapp/app/views/partials/_metadata.html.erb
@@ -17,6 +17,17 @@
<p><strong>Latitud:</strong> <%= content.latitude %></p>
<p><strong>Longitud:</strong> <%= content.longitude %></p>
<p><strong>Tags:</strong> <%= content.tag_list %></p>
+
+ <% if content.author_myself == "1" %>
+ <p><strong>Autor:</strong><%= link_to content.user.username, profile_path(content.user) %></p>
+ <% else %>
+ <% if content.author_link %>
+ <p><strong>Autor:</strong> <%= link_to content.author_name, content.author_link %></p>
+ <% else %>
+ <p><strong>Autor:</strong> <%= content.author_name %></p>
+ <% end %>
+ <% end %>
+
</div>
<div class="well">
<% if content.user %>
View
1  webapp/config/environments/development.rb
@@ -37,6 +37,7 @@
# Configuración para ActionMailer
config.action_mailer.smtp_settings = {
+ :port => 1025,
:enable_starttls_auto => false
}
View
7 webapp/config/locales/es.yml
@@ -201,6 +201,9 @@ es:
mongoid:
attributes:
content:
+ author_myself: ""
+ author_name: "Autor (nombre)"
+ author_link: "Autor (URL)"
title: "Título"
tag_list: "Etiquetas"
happened_at: "¿Cuándo ha ocurrido?"
@@ -268,3 +271,7 @@ es:
address: "Ayuda de la direccion"
city: "Ayuda de la ciudad"
country: "Ayuda de la país"
+ author:
+ myself: "Soy el autor"
+ name: "Autor (nombre)"
+ url: "Autor (URL)"

No commit comments for this range

Something went wrong with that request. Please try again.