[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tpo/staging] Fix trademark models and templates



commit 593f085a54a3eae28732e4f8bb705c5cc8e1a8d8
Author: hiro <hiro@xxxxxxxxxxxxxx>
Date:   Thu Sep 5 15:22:04 2019 +0200

    Fix trademark models and templates
---
 content/about/trademark/contents.lr                |  5 ++++
 content/about/trademark/trademark-faq/contents.lr  | 12 +++++++-
 .../trademark-faq/trademark-faq-1/contents.lr      |  2 ++
 .../trademark-faq/trademark-faq-2/contents.lr      |  2 ++
 .../trademark-faq/trademark-faq-3/contents.lr      |  2 ++
 .../trademark-faq/trademark-faq-4/contents.lr      |  2 ++
 .../trademark-faq/trademark-faq-5/contents.lr      |  2 ++
 .../trademark-faq/trademark-faq-6/contents.lr      |  2 ++
 .../trademark-faq/trademark-faq-7/contents.lr      |  2 ++
 models/question.ini                                |  1 +
 models/trademark.ini                               | 34 ++++++++++++++++++++++
 templates/about.html                               |  9 +++++-
 templates/macros/topic.html                        |  2 +-
 templates/trademark.html                           |  2 +-
 14 files changed, 75 insertions(+), 4 deletions(-)

diff --git a/content/about/trademark/contents.lr b/content/about/trademark/contents.lr
index bc35d46..1dc524d 100644
--- a/content/about/trademark/contents.lr
+++ b/content/about/trademark/contents.lr
@@ -1,14 +1,19 @@
+_model: trademark
+---
 _template: about.html
 ---
 section: About
 ---
 section_id: about
 ---
+color: primary
+---
 html: trademark.html
 ---
 title: Trademark
 ---
 body:
+
 # General Statement of Trademark and Copyright
 
 Content on this site is Copyright The Tor Project, Inc.. Reproduction of content is permitted under a [Creative Commons Attribution 3.0 United States License](https://creativecommons.org/licenses/by/3.0/us/). All use under such license must be accompanied by a clear and prominent attribution that identifies The Tor Project, Inc. as the owner and originator of such content. The Tor Project Inc. reserves the right to change licenses and permissions at any time in its sole discretion.
diff --git a/content/about/trademark/trademark-faq/contents.lr b/content/about/trademark/trademark-faq/contents.lr
index 35a1f52..464fb37 100644
--- a/content/about/trademark/trademark-faq/contents.lr
+++ b/content/about/trademark/trademark-faq/contents.lr
@@ -1,5 +1,15 @@
 _model: topic
 ---
+_template: about.html
+---
+section: About
+---
+section_id: about
+---
+html: trademark.html
+---
+color: primary
+---
 title: Tor Trademark Frequently Asked Questions
 ---
-seo_slug: Tor Trademark FAQs
+seo_slug: tor-trademark-faqs
diff --git a/content/about/trademark/trademark-faq/trademark-faq-1/contents.lr b/content/about/trademark/trademark-faq/trademark-faq-1/contents.lr
index 9c53669..0d60105 100644
--- a/content/about/trademark/trademark-faq/trademark-faq-1/contents.lr
+++ b/content/about/trademark/trademark-faq/trademark-faq-1/contents.lr
@@ -2,6 +2,8 @@ _model: question
 ---
 title: How can I use the name "Tor"?
 ---
+_hidden: yes
+---
 seo_slug: how-to-use-tor-trademark
 ---
 description:
diff --git a/content/about/trademark/trademark-faq/trademark-faq-2/contents.lr b/content/about/trademark/trademark-faq/trademark-faq-2/contents.lr
index a8ac499..7e6fc04 100644
--- a/content/about/trademark/trademark-faq/trademark-faq-2/contents.lr
+++ b/content/about/trademark/trademark-faq/trademark-faq-2/contents.lr
@@ -2,6 +2,8 @@ _model: question
 ---
 title: Can I use the Tor onion logo?
 ---
+_hidden: yes
+---
 seo_slug: can-I-use-tor-onion-logo
 ---
 description:
diff --git a/content/about/trademark/trademark-faq/trademark-faq-3/contents.lr b/content/about/trademark/trademark-faq/trademark-faq-3/contents.lr
index a7fe8bb..06c3770 100644
--- a/content/about/trademark/trademark-faq/trademark-faq-3/contents.lr
+++ b/content/about/trademark/trademark-faq/trademark-faq-3/contents.lr
@@ -2,6 +2,8 @@ _model: question
 ---
 title: Can I use the word "Tor" as part of the name of my product or my domain name?
 ---
+_hidden: yes
+---
 seo_slug: tor-product-domain-name
 ---
 description:
diff --git a/content/about/trademark/trademark-faq/trademark-faq-4/contents.lr b/content/about/trademark/trademark-faq/trademark-faq-4/contents.lr
index 534a68b..80a8b9e 100644
--- a/content/about/trademark/trademark-faq/trademark-faq-4/contents.lr
+++ b/content/about/trademark/trademark-faq/trademark-faq-4/contents.lr
@@ -2,6 +2,8 @@ _model: question
 ---
 title: What about cute Tor-derived names in research paper titles?
 ---
+_hidden: yes
+---
 seo_slug: tor-derived-names
 ---
 description:
diff --git a/content/about/trademark/trademark-faq/trademark-faq-5/contents.lr b/content/about/trademark/trademark-faq/trademark-faq-5/contents.lr
index 8f74633..e621368 100644
--- a/content/about/trademark/trademark-faq/trademark-faq-5/contents.lr
+++ b/content/about/trademark/trademark-faq/trademark-faq-5/contents.lr
@@ -2,6 +2,8 @@ _model: question
 ---
 title: Does this mean you're enforcing trademark rights?
 ---
+_hidden: yes
+---
 seo_slug: enforcing-trademark-rights
 ---
 description:
diff --git a/content/about/trademark/trademark-faq/trademark-faq-6/contents.lr b/content/about/trademark/trademark-faq/trademark-faq-6/contents.lr
index 32dd43e..ab1a3e8 100644
--- a/content/about/trademark/trademark-faq/trademark-faq-6/contents.lr
+++ b/content/about/trademark/trademark-faq/trademark-faq-6/contents.lr
@@ -2,6 +2,8 @@ _model: question
 ---
 title: What if I produce non-open source, commercial products based on Tor?
 ---
+_hidden: yes
+---
 seo_slug: commercial-tor-derivatives
 ---
 description:
diff --git a/content/about/trademark/trademark-faq/trademark-faq-7/contents.lr b/content/about/trademark/trademark-faq/trademark-faq-7/contents.lr
index 7f5b9c5..85d599b 100644
--- a/content/about/trademark/trademark-faq/trademark-faq-7/contents.lr
+++ b/content/about/trademark/trademark-faq/trademark-faq-7/contents.lr
@@ -2,6 +2,8 @@ _model: question
 ---
 title: Are there official licensees of the Tor trademarks?
 ---
+_hidden: yes
+---
 seo_slug: tor-licensees
 ---
 description:
diff --git a/models/question.ini b/models/question.ini
index 5e01769..fecf955 100644
--- a/models/question.ini
+++ b/models/question.ini
@@ -2,6 +2,7 @@
 name = Question
 label = {{ this.title }}
 translate = True
+hidden = yes
 
 [fields.title]
 label = Title
diff --git a/models/trademark.ini b/models/trademark.ini
new file mode 100644
index 0000000..892b5f1
--- /dev/null
+++ b/models/trademark.ini
@@ -0,0 +1,34 @@
+[model]
+name = Trademark
+label = {{ this.title }}
+hidden = yes
+
+[fields.title]
+label = Title
+type = string
+
+[fields.section]
+label = Section
+type = string
+translate = True
+
+[fields.section_id]
+label = Section_id
+type = string
+translate = False
+
+[fields.body]
+label = Body
+type = markdown
+
+[fields.color]
+label = Color
+type = string
+
+[fields.html]
+label = Html
+type = string
+
+[children]
+model = topic
+order_by = title
diff --git a/templates/about.html b/templates/about.html
index 706617d..d1ab9de 100644
--- a/templates/about.html
+++ b/templates/about.html
@@ -8,7 +8,14 @@
     <div class="container-fluid">
       <div class="row flex-xl-nowrap">
         <main role="main" class="mx-auto col-12 {{ bag('alternatives', this.alt, 'order') }}">
-          {% if this.path == "/about/history" %}
+          {% if this.path == "/about" %}
+            {% set p1 = this.children.get('history') %}
+            <div class="container py-3 mt-5 content">
+              <div class="col-sm-9">
+                {{ p1.body }}
+              </div>
+            </div>
+          {% elif this.path == "/about/history" %}
             <div class="container py-3 mt-5 preamble">
               {{ this.parent.body }}
             </div>
diff --git a/templates/macros/topic.html b/templates/macros/topic.html
index 2558e79..0439c82 100644
--- a/templates/macros/topic.html
+++ b/templates/macros/topic.html
@@ -9,7 +9,7 @@
   <div id="{{ t.control }}" role="tabpanel" data-parent="#topics" class="anchor-spacer">
     <div id="{{ t.control }}Accordion" data-children=".question">
       <h5 class="text-muted mb-3 p-0 {{ bag('alternatives', alternative, 'direction') }}">{{ item.title }}</h5>
-      {% for q in item.children %}
+      {% for q in site.query(item.path).include_undiscoverable(true) %}
         {{ render_question(q, item._id, alternative) }}
       {% endfor %}
     </div>
diff --git a/templates/trademark.html b/templates/trademark.html
index 5794309..f37aa27 100644
--- a/templates/trademark.html
+++ b/templates/trademark.html
@@ -1,6 +1,6 @@
 {% from "macros/topic.html" import render_topic %}
 <div class="container py3">
-  {% for item in this.children %}
+  {% for item in site.query('/about/trademark').include_hidden(true) %}
     {{ render_topic(item, this.alt) }}
   {% endfor %}
 </div>



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits