You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2018/10/24 20:16:00 UTC

[1/2] allura git commit: [#8093] POC of responsive override of complex admin page

Repository: allura
Updated Branches:
  refs/heads/kt/8093c [created] f9cb3088b


[#8093] POC of responsive override of complex admin page


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/483e8b47
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/483e8b47
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/483e8b47

Branch: refs/heads/kt/8093c
Commit: 483e8b47070d2c094c71ddbf71b3c1fa3e742ef1
Parents: f98ae84
Author: Kenton Taylor <kt...@slashdotmedia.com>
Authored: Tue Oct 23 18:53:18 2018 +0000
Committer: Kenton Taylor <kt...@slashdotmedia.com>
Committed: Wed Oct 24 15:35:16 2018 -0400

----------------------------------------------------------------------
 .../templates/admin_widgets/metadata_admin.html | 201 +++++++++++++++++++
 .../ext/admin/templates/project_overview.html   |  23 +++
 2 files changed, 224 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/483e8b47/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html
new file mode 100644
index 0000000..8fab79a
--- /dev/null
+++ b/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -0,0 +1,201 @@
+{#-
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+-#}
+{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
+
+<form method="POST" action="update" enctype="multipart/form-data" id="metadata_form" class="row align-justify">
+  <div class="column small-12 medium-6">
+    {%if not c.project.is_user_project %}
+        <div class="field">
+        {{ widget.display_label(widget.fields.name) }}
+        {{ widget.display_field(widget.fields.name) }}
+        </div>
+        <div class="field">
+            <label for="shortname">Unixname</label>
+            <input id="shortname" type="text" disabled="disabled" value="{{c.project.shortname}}">
+        </div>
+
+        <div class="field">
+        {{ widget.display_label(widget.fields.external_homepage) }}
+        {{widget.display_field(widget.fields.external_homepage) }}
+        </div>
+
+        <div class="field">
+        {{ widget.display_label(widget.fields.video_url) }}
+        {{widget.display_field(widget.fields.video_url) }}
+        </div>
+    {% endif %}
+
+
+
+    <div class="summary-fields field">
+        {{ widget.display_label(widget.fields.summary) }}
+        {{widget.display_field(widget.fields.summary) }}
+        <br>
+    </div>
+
+    {% if not c.project.is_user_project %}
+        <div class="description-fields field">
+        {{ widget.display_label(widget.fields.short_description) }}
+        {{ widget.display_field(widget.fields.short_description) }}
+        </div>
+
+        <div id="features" class="">
+          {{ widget.display_label(widget.fields.features) }}
+          {{ widget.display_field(widget.fields.features) }}
+        </div>
+
+        {% if tg.config.get('support_tool_choices') %}
+        <div class="support-page-fields new-visual-group">
+            Preferred Support Page (for users of your project):<br>
+            {% if c.form_errors.get('support_page_url') %}
+                <div class="error">{{c.form_errors.get('support_page_url')}}</div>
+            {% endif %}
+
+            <input name="support_page" type="radio" value=""{% if value.support_page == '' %} checked{% endif %} id="support_page_none">
+            <label for="support_page_none">None</label><br>
+            {% for ac in c.project.app_configs %}
+              {% if ac.tool_name.lower() in tg.config['support_tool_choices'].split() %}
+                <input name="support_page" type="radio" value="{{ac.options.mount_point}}" id="support_page_{{ac.options.mount_point}}"
+                       {% if value.support_page == ac.options.mount_point %} checked{% endif %}>
+                <label for="support_page_{{ac.options.mount_point}}">{{ac.options.mount_label}}</label><br>
+              {% endif %}
+            {% endfor %}
+
+            <input name="support_page" type="radio" value="_members" {% if value.support_page == '_members' %} checked{% endif %} id="support_page_members">
+            <label for="support_page_members">Contact project admins</label><br>
+            <input name="support_page" type="radio" value="_url" id="support_page_url_cb"
+                   {% if value.support_page == '_url' %} checked{% endif %}>
+            <label for="support_page_url_cb">URL: </label>
+            <input type="text" name="support_page_url" value="{{value.support_page_url}}" style="width: 70%"><br>
+        </div>
+        {% endif %}
+
+        <div class="social-media- new-visual-group">
+            <div class="field">
+                {{ widget.display_label(widget.fields.twitter_handle) }}
+                {{widget.display_field(widget.fields.twitter_handle) }}
+            </div>
+
+            <div class="field">
+            {{ widget.display_label(widget.fields.facebook_page) }}
+            {{widget.display_field(widget.fields.facebook_page) }}
+            </div>
+        </div>
+
+        {% if c.project.neighborhood.features['google_analytics'] %}
+        <div class="field new-visual-group">
+        {{ widget.display_label(widget.fields.tracking_id) }}
+        {{ widget.display_field(widget.fields.tracking_id) }}
+        </div>
+        {% endif %}
+    {% endif%}
+    {% block fields_column1_end -%}
+    {% endblock %}
+  </div>
+
+  <div class="column small-12 medium-5">
+    <label>Project Logo:</label>
+    <div id="project-icon" class="viewing">
+      {% if value.icon %}
+        <div class="viewer" style="overflow: auto">
+          <img {{ lib.project_icon_srcs(value) }} style="float:left; margin-right: 1em;" alt="">
+          {{ g.icons['edit'].render(id='edit-icon', style='display:inline-block;margin-top:15px') }}
+          {{ g.icons['delete'].render(id='delete-icon', style='display:inline-block;margin-top:15px') }}
+        </div>
+      {% else %}
+        <div class="viewer">
+          No {% if c.project.is_user_project %}user{% endif %} icon.
+          {{ g.icons['edit'].render(id='edit-icon', title='Upload one', show_title=True) }}
+        {% if c.project.is_user_project %}<br><small>
+            Or a  <a href="http://gravatar.com/">gravatar.com</a> image will be used if available.</small>{% endif %}
+        </div>
+      {% endif %}
+      <div id="project-icon-upload" class="hidden">
+          {{widget.display_field(widget.fields.icon)}}
+          <input type="submit" value="Save" name="save" style="float: none" />
+          <br><small>(best if square & hi-res. JPG, GIF, or PNG files expected.)</small>
+      </div>
+    </div>
+    {%if c.project.neighborhood.name != 'Users' or not value.is_root%}
+    <div style="clear:both">&nbsp;</div>
+
+    <div id="project-status">
+        {% set proj_text = 'Project' if value.is_root else 'Subproject' %}
+        {{proj_text}} Status:
+        <div>
+            {% if c.form_errors.get('moved_to_url') %}
+                <div class="error">{{c.form_errors.get('moved_to_url')}}</div>
+            {% endif %}
+            <input name="removal" type="radio" value="" id="removal_active_cb"
+                   {% if value.removal == '' %} checked{% endif %}>
+            <label for="removal_active_cb">Active {{proj_text}}</label>
+            <br>
+            <input name="removal" type="radio" value="moved" id="removal_moved_cb"
+                   {% if value.removal == 'moved' %} checked{% endif %}>
+            <label for="removal_moved_cb">Moved {{proj_text}} to: </label>
+            <input type="text" name="moved_to_url" value="{{value.moved_to_url}}" style="width: 60%" placeholder="http://new-website.com/example">
+            <br>
+            <input name="removal" type="radio" value="abandoned" id="removal_abandoned_cb"
+                   {% if value.removal == 'abandoned' %} checked{% endif %}>
+            <label for="removal_abandoned_cb">Abandoned {{proj_text}}</label>
+            {% if allow_project_delete or not value.is_root %}
+            <br>
+            <input name="removal" type="radio" value="deleted" id="removal_delete_cb"
+                   {% if value.removal == 'deleted' %} checked{% endif %}>
+            <label for="removal_delete_cb">Delete{% if value.removal == 'deleted' %}d{% endif %} {{proj_text}}</label>
+            {% endif %}
+            {% block status_choices_end -%}
+            {% endblock %}
+        </div>
+    </div>
+    {% endif%}
+    {% if show_export_control %}
+    <div id="export_control">
+      <div style="clear:both">&nbsp;</div>
+      <label for="export_controlled">Export Control: <small><a href="#" id="why_export">Why?</a></small></label>
+      <br>
+      <input id="export_controlled" name="export_controlled" type="checkbox" value="True"
+             {% if value.export_controlled == True %} checked{% endif %}> This project incorporates, accesses, calls upon or otherwise uses encryption software with a symmetric key length greater than 64 bits ("encryption"). This review does not include products that use encryption for authentication only.<br>
+      <div id="export_details" style="margin-left: 1em;{% if value.export_controlled == False %} display:none;{% endif %}">
+        <label>
+          <input name="export_control_type" type="radio" value="less_than_10"
+               {% if value.export_control_type == "less_than_10" %} checked{% endif %}> This Project has less than 10% U.S.-origin parts or components.<br>
+        </label>
+        <label>
+          <input name="export_control_type" type="radio" value="less_than_25"
+               {% if value.export_control_type == "less_than_25" %} checked{% endif %}> This Project has more than 10% but less than 25% U.S.-origin parts or components.<br>
+        </label>
+        <label>
+          <input id="export_restricted" name="export_control_type" type="radio" value="more_than_25"
+               {% if value.export_control_type == "more_than_25" %} checked{% endif %}> This Project has more than 25% U.S-origin parts or components.<br>
+        </label>
+      </div>
+      <div id="export_warning" class="notice"{% if value.export_controlled == False or value.export_control_type == "less_than_10" or value.export_control_type == "less_than_25" %} style="display:none"{% endif %}>You must notify BIS and the ENC Encryption Request Coordinator via e-mail of the Internet location (e.g., URL or Internet address) of the publicly available encryption source code or provide each of them a copy of the publicly available encryption source code. If you update or modify the source code, you must also provide additional copies to each of them each time the cryptographic functionality of the source code is updated or modified. In addition, if you posted the source code on the Internet, you must notify BIS and the ENC Encryption Request Coordinator each time the Internet location is changed, but you are not required to notify them of updates or modifications made to the encryption source code at the previously notified location. In all instances, submit the notif
 ication or copy to <a href="mailto:crypt@bis.doc.gov">crypt@bis.doc.gov</a> and to <a href="mailto:enc@nsa.gov">enc@nsa.gov</a>.</div>
+    </div>
+    {% endif %}
+  </div>
+  <hr class="column small-12" style="margin-top: 1em; margin-bottom: 1em;">
+  <div class="column small-12">
+    <input type="submit" value="Save">
+  </div>
+  {{lib.csrf_token()}}
+</form>
+
+{% block extra_css %}
+{% endblock %}

http://git-wip-us.apache.org/repos/asf/allura/blob/483e8b47/Allura/allura/templates_responsive/override/allura/ext/admin/templates/project_overview.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates_responsive/override/allura/ext/admin/templates/project_overview.html b/Allura/allura/templates_responsive/override/allura/ext/admin/templates/project_overview.html
new file mode 100644
index 0000000..1224749
--- /dev/null
+++ b/Allura/allura/templates_responsive/override/allura/ext/admin/templates/project_overview.html
@@ -0,0 +1,23 @@
+{#-
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+-#}
+
+{#  Responsive counterpart to legacy grid page. #}
+
+{% set legacy_chrome = False %}
+{% extends "/var/local/allura/Allura/allura/ext/admin/templates/project_overview.html" %}


[2/2] allura git commit: [#8093] Fixes for responsive prototype of project metadata admin page

Posted by ke...@apache.org.
[#8093] Fixes for responsive prototype of project metadata admin page


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/f9cb3088
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/f9cb3088
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/f9cb3088

Branch: refs/heads/kt/8093c
Commit: f9cb3088bbc2043dc966a4d1bbde9c2f5268d0e7
Parents: 483e8b4
Author: Kenton Taylor <kt...@slashdotmedia.com>
Authored: Wed Oct 24 16:14:56 2018 -0400
Committer: Kenton Taylor <kt...@slashdotmedia.com>
Committed: Wed Oct 24 16:14:56 2018 -0400

----------------------------------------------------------------------
 .../ext/admin/templates/project_overview.html   |  3 +++
 .../public/nf/js/jquery.ui.touch-punch.min.js   | 11 ++++++++++
 .../templates/admin_widgets/metadata_admin.html | 13 ++++++-----
 .../ext/admin/templates/project_overview.html   | 23 --------------------
 4 files changed, 21 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/f9cb3088/Allura/allura/ext/admin/templates/project_overview.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_overview.html b/Allura/allura/ext/admin/templates/project_overview.html
index 93686ef..c4bf11f 100644
--- a/Allura/allura/ext/admin/templates/project_overview.html
+++ b/Allura/allura/ext/admin/templates/project_overview.html
@@ -18,6 +18,9 @@
 -#}
 {% extends g.theme.master %}
 
+{%- do g.register_js('allura/js/jquery-ui.min.js', location='body_top_js') %}
+{%- do g.register_js('allura/js/jquery.ui.touch-punch.min.js', location='body_top_js') %}
+
 {% block title %}{{c.project.name}} / Metadata{% endblock %}
 
 {% block header %}Project Admin{% endblock %}

http://git-wip-us.apache.org/repos/asf/allura/blob/f9cb3088/Allura/allura/public/nf/js/jquery.ui.touch-punch.min.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/jquery.ui.touch-punch.min.js b/Allura/allura/public/nf/js/jquery.ui.touch-punch.min.js
new file mode 100644
index 0000000..31272ce
--- /dev/null
+++ b/Allura/allura/public/nf/js/jquery.ui.touch-punch.min.js
@@ -0,0 +1,11 @@
+/*!
+ * jQuery UI Touch Punch 0.2.3
+ *
+ * Copyright 2011–2014, Dave Furfero
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Depends:
+ *  jquery.ui.widget.js
+ *  jquery.ui.mouse.js
+ */
+!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStar
 t"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/f9cb3088/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index 8fab79a..f1e0df0 100644
--- a/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -18,6 +18,7 @@
 -#}
 {% import 'allura:templates/jinja_master/lib.html' as lib with context %}
 
+
 <form method="POST" action="update" enctype="multipart/form-data" id="metadata_form" class="row align-justify">
   <div class="column small-12 medium-6">
     {%if not c.project.is_user_project %}
@@ -55,7 +56,7 @@
         {{ widget.display_field(widget.fields.short_description) }}
         </div>
 
-        <div id="features" class="">
+        <div id="features" class="new-visual-group">
           {{ widget.display_label(widget.fields.features) }}
           {{ widget.display_field(widget.fields.features) }}
         </div>
@@ -86,7 +87,7 @@
         </div>
         {% endif %}
 
-        <div class="social-media- new-visual-group">
+        <div class="social-media-fields new-visual-group">
             <div class="field">
                 {{ widget.display_label(widget.fields.twitter_handle) }}
                 {{widget.display_field(widget.fields.twitter_handle) }}
@@ -132,9 +133,8 @@
           <br><small>(best if square & hi-res. JPG, GIF, or PNG files expected.)</small>
       </div>
     </div>
-    {%if c.project.neighborhood.name != 'Users' or not value.is_root%}
-    <div style="clear:both">&nbsp;</div>
 
+    {%if c.project.neighborhood.name != 'Users' or not value.is_root%}
     <div id="project-status">
         {% set proj_text = 'Project' if value.is_root else 'Subproject' %}
         {{proj_text}} Status:
@@ -165,9 +165,9 @@
         </div>
     </div>
     {% endif%}
+
     {% if show_export_control %}
-    <div id="export_control">
-      <div style="clear:both">&nbsp;</div>
+    <div id="export_control" class="new-visual-group">
       <label for="export_controlled">Export Control: <small><a href="#" id="why_export">Why?</a></small></label>
       <br>
       <input id="export_controlled" name="export_controlled" type="checkbox" value="True"
@@ -189,6 +189,7 @@
       <div id="export_warning" class="notice"{% if value.export_controlled == False or value.export_control_type == "less_than_10" or value.export_control_type == "less_than_25" %} style="display:none"{% endif %}>You must notify BIS and the ENC Encryption Request Coordinator via e-mail of the Internet location (e.g., URL or Internet address) of the publicly available encryption source code or provide each of them a copy of the publicly available encryption source code. If you update or modify the source code, you must also provide additional copies to each of them each time the cryptographic functionality of the source code is updated or modified. In addition, if you posted the source code on the Internet, you must notify BIS and the ENC Encryption Request Coordinator each time the Internet location is changed, but you are not required to notify them of updates or modifications made to the encryption source code at the previously notified location. In all instances, submit the notif
 ication or copy to <a href="mailto:crypt@bis.doc.gov">crypt@bis.doc.gov</a> and to <a href="mailto:enc@nsa.gov">enc@nsa.gov</a>.</div>
     </div>
     {% endif %}
+
   </div>
   <hr class="column small-12" style="margin-top: 1em; margin-bottom: 1em;">
   <div class="column small-12">

http://git-wip-us.apache.org/repos/asf/allura/blob/f9cb3088/Allura/allura/templates_responsive/override/allura/ext/admin/templates/project_overview.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates_responsive/override/allura/ext/admin/templates/project_overview.html b/Allura/allura/templates_responsive/override/allura/ext/admin/templates/project_overview.html
deleted file mode 100644
index 1224749..0000000
--- a/Allura/allura/templates_responsive/override/allura/ext/admin/templates/project_overview.html
+++ /dev/null
@@ -1,23 +0,0 @@
-{#-
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
--#}
-
-{#  Responsive counterpart to legacy grid page. #}
-
-{% set legacy_chrome = False %}
-{% extends "/var/local/allura/Allura/allura/ext/admin/templates/project_overview.html" %}