incubator-allura-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cory Johns <john...@gmail.com>
Subject Re: Donay/Incentify plugin
Date Fri, 13 Sep 2013 17:16:07 GMT
The theme override entry point and the app / tool entry point are separate;
my example didn't extend Application nor provide the entry point under the
[allura] group to register it as an installable tool, but you can add that
easily enough.  However, the current implementation of the theme override
is independent of the tool state, so even projects that don't have the tool
installed will get new HTML.  If desired, you could make the template check
whether the tool is installed, but, ideally, the override mechanism should
probably be extended to support selective overriding.  It would also be
nice if we didn't have to duplicate the entire template file just to add to
one small part.

I made the changes mentioned above here:
https://git-wip-us.apache.org/repos/asf?p=incubator-allura.git;a=commitdiff;h=334bc343508f832a03fc2ce1c50d95451eff7635
Now the Incentify code is only rendered if the app is installed and
the
option to show enabled.  The iframe was too big for the action bar, so I
also moved it into the ticket body.


On Fri, Sep 13, 2013 at 11:54 AM, Edit Mera <emera@donay.com> wrote:

> Hi Cory,
>
> First of all, thank you very much :) The button appears on ticket pages if
> the scripts are wrapped in a div with id="incentify-content" (forgot to
> mention, sorry).
> However, I noticed that if I have [allura.theme.override] in entry points,
> the tool is not listed anymore on admin/tools page, so I can't access the
> configuration page.
> There is an error in the log that the tool is invalid. Is it a bug or did I
> do something wrong?
>
> Regards,
> Edit
>
>
>
>
> On Wed, Sep 11, 2013 at 8:01 PM, Cory Johns <johnsca@gmail.com> wrote:
>
> > Edit,
> >
> > I've created an Allura branch with the changes at
> >
> https://git-wip-us.apache.org/repos/asf?p=incubator-allura.git;a=commitdiff;h=7b57d6fb375afd91731354a8a45401492c8aa5a4thatdoes
render the script, though the actual button doesn't seem to
> > appear, and I'm not sure what's wrong.
> >
> > The points to note are:
> >
> > 1) The ep group to enable the override is [allura.theme.override]
> > 2) The value in the template_path_rules list are the ep_name values for
> > the app to override
> > 3) You don't actually need to @expose anything, or even have an actual
> > app, just create the override directory structure and set the
> > [allura.theme.override] ep
> >
> > This could all be done as a stand-alone package; I just made it a branch
> > in Allura for ease of testing.
> >
> > I hope that makes things more clear, and I will try to improve the
> > documentation of the package_path_loader regarding these points of
> > confusion, perhaps with a reference implementation such as this.
> >
> >
> > - Cory
> >
> >
> > On Wed, Sep 11, 2013 at 6:32 AM, Edit Mera <emera@donay.com> wrote:
> >
> >> Hi Dave,
> >> Thanks for adding the Incentify plugin to the list.
> >> I need some help to customize the ticket.html template to show a panel
> >> like
> >> on this issue page http://jira.codehaus.org/browse/jruby-5603
> >> In order to do this I have to add a code snippet to the ticket.html
> >> template:
> >> <script type="text/javascript">
> >>     incentify_type = 'allura';
> >>     incentify_width = 728;
> >>     incentify_height = 90;
> >>     incentify_panel_type = 'html';
> >>    </script>
> >>    <script type="text/javascript" src="
> >> http://www.donay.com/site/scripts/incentify.js"<
> >> http://www.donay.com/site/scripts/incentify.js>
> >>
> >> async>
> >>    </script>
> >>
> >> I have read the docs at
> >> http://allura.sourceforge.net/docs/api/lib/package_path_loader.html
> >> What I tried so far:
> >> -adding [forgetracker] or [forgetracker.override] or [tickets] to
> >> Incentify
> >> setup.py,
> >> but I get 'invalid tool incentify' error in log when accessing a ticket
> >> page
> >>
> >> -adding the file
> >>
> "alluradonayincentify/override/forgetracker/templates/tracker/ticket.html"
> >>
> >> -in entry point target class (DonayIncentifyApp):
> >> template_path_rules=[['>','forgetracker']]
> >>
> >> -in a RootController class: @expose('jinja:
> >> forgetracker:templates/tracker/ticket.html')
> >> def index...
> >>
> >> What do I have to add in setup.py?
> >> What do my ticket.html/controller have to contain? Just the part which
> is
> >> new, or I have to copy the whole content from the original files and add
> >> my
> >> changes?
> >> I apologize for asking such basic things, but my python/allura
> experience
> >> is quite limited.
> >>
> >> Thanks,
> >> Edit
> >>
> >>
> >> On Wed, Jul 17, 2013 at 8:50 PM, Dave Brondsema <dave@brondsema.net>
> >> wrote:
> >>
> >> > So yesterday I came across
> >> >
> >>
> http://docs.donay.com/display/Dosense/Installing+Incentify+in+Allurawhichisa
> >>
> >> > plugin for Allura that I didn't know existed before :)  I think some
> of
> >> the
> >> > Donay developers are on this list.  Perhaps I missed it, but feel free
> >> to
> >> > publicize things like this here.  Great to see plugins being
> developed.
> >>  I
> >> > added
> >> > it to the list at
> >> https://sourceforge.net/p/allura/wiki/Extensions/(anyone feel
> >>
> >> > free to add to that)
> >> >
> >> > Also, the merge request #4 is closed now, so it may be possible to
> have
> >> a
> >> > better
> >> > version of the Incentify plugin that doesn't require template
> >> modification.
> >> >
> >> > --
> >> > Dave Brondsema : dave@brondsema.net
> >> > http://www.brondsema.net : personal
> >> > http://www.splike.com : programming
> >> >               <><
> >> >
> >>
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message