Commits

Olemis Lang committed fbf9ffe

BH Theme #474 : Changeset popup in blame view powered by Bootstrap modal styling

  • Participants
  • Parent commits fd939ae
  • Branches t474_responsive

Comments (0)

Files changed (1)

File t474/t474_r1467231_vcs_browser_blame.diff

 # Parent a71345ccf4b219becda951854ffa91cc767e38e9
 BH Theme #474 : Blame view in repository browser
 
-diff -r a71345ccf4b2 bloodhound_theme/bhtheme/htdocs/bloodhound.css
---- a/bloodhound_theme/bhtheme/htdocs/bloodhound.css	Fri Apr 12 10:35:22 2013 +0000
-+++ b/bloodhound_theme/bhtheme/htdocs/bloodhound.css	Sat Apr 13 21:17:11 2013 -0500
+diff --git a/bloodhound_theme/bhtheme/htdocs/bloodhound.css b/bloodhound_theme/bhtheme/htdocs/bloodhound.css
+--- a/bloodhound_theme/bhtheme/htdocs/bloodhound.css
++++ b/bloodhound_theme/bhtheme/htdocs/bloodhound.css
 @@ -1115,6 +1115,22 @@
   white-space: nowrap;
  }
 \ No newline at end of file
 +}
 +
-diff -r a71345ccf4b2 bloodhound_theme/bhtheme/theme.py
---- a/bloodhound_theme/bhtheme/theme.py	Fri Apr 12 10:35:22 2013 +0000
-+++ b/bloodhound_theme/bhtheme/theme.py	Sat Apr 13 21:17:11 2013 -0500
-@@ -389,7 +389,6 @@
+diff --git a/trac/trac/htdocs/js/blame.js b/bloodhound_theme/bhtheme/htdocs/js/blame.js
+copy from trac/trac/htdocs/js/blame.js
+copy to bloodhound_theme/bhtheme/htdocs/js/blame.js
+--- a/trac/trac/htdocs/js/blame.js
++++ b/bloodhound_theme/bhtheme/htdocs/js/blame.js
+@@ -82,15 +82,21 @@
+             // create new message panel
+             if (!data)
+               data = "<strong>" + _("(no changeset information)") + "</strong>";
+-            message = $('<div class="message">').css("position", "absolute")
+-                .append($('<div class="inlinebuttons">')
+-                .append($('<input value="' + _("Close") + '" type="button">').click(hide)))
+-                .append($('<div>').html(data))
++            // **************
++            // Bloodhound theme (Bootstrap)
++            // **************
++            message = $('<div class="message modal">').css("position", "absolute").css('margin-left', 'auto')
++                .append($('<div class="modal-header">')
++                  .append($('<button title="' + _("Close") + '" type="button" class="close">').click(hide).html('&times;'))
++                  .append('<button title="' + _('Scroll to bottom') + '" class="close" type="button"><i class="icon-arrow-down"></i></button>')
++                  .append('<button title="' + _('Scroll to top') + '" class="close" type="button"><i class="icon-arrow-up"></i></button>')
++                  .append($('<h3>').text(_("Recent changes"))))
++                .append($('<div class="modal-body">').html(data))
+               .appendTo("body");
+ 
+             // workaround non-clickable "Close" issue in Firefox
+             if ($.browser.mozilla || $.browser.safari)
+-              message.find("div.inlinebuttons").next().css("clear", "right");
++              message.find("div.modal-header").next().css("clear", "right");
+   
+             show();
+           }, 'html');
+diff --git a/bloodhound_theme/bhtheme/theme.py b/bloodhound_theme/bhtheme/theme.py
+--- a/bloodhound_theme/bhtheme/theme.py
++++ b/bloodhound_theme/bhtheme/theme.py
+@@ -16,7 +16,7 @@
+ #  specific language governing permissions and limitations
+ #  under the License.
+ 
+-import sys, copy
++import sys, copy, re
+ 
+ from genshi.builder import tag
+ from genshi.core import TEXT
+@@ -389,7 +389,10 @@
                  resourcepath_template='bh_path_links.html',
                  path_depth_limit=2
              ))
 -        add_stylesheet(req, 'theme/css/browser.css')
++        for script in req.chrome.get('scripts', []):
++            # FIXME : Improve
++            script['href'] = re.sub(r'^(.*)common/(js/blame.js)$',
++                                    r'\1theme/\2', script['href'])
  
  
      def _add_products_general_breadcrumb(self, req, template, data,