Commit Graph

222 Commits

Author SHA1 Message Date
Paul Eggleton
df76a64d95 update.py: avoid writing bitbake.lock/cache to current directory
Create a temporary directory for these files.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-06 18:07:56 +00:00
Paul Eggleton
0c7dcedca6 Use TemplateView for simple views instead of custom functions
The simple views for about and the submit thanks pages don't need
special views, so the standard TemplateView can be used.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-06 16:55:28 +00:00
Paul Eggleton
93be8b1172 Move all templates to a templates directory
This should allow the templates to be found and swapped out more easily.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-06 16:55:23 +00:00
Paul Eggleton
5308e03c9e Add django-simple-captcha to list of modules on about page
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-06 15:43:38 +00:00
Paul Eggleton
46e579b6e6 Show count of layers to be reviewed next to Review link
Add a badge next to the Review link (when shown for users with the
publish permission) on all pages showing how many layers need to be
reviewed, if any.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-06 09:16:19 +00:00
Paul Eggleton
3f967cf751 Allow usage URL to point to a file within the repository
This means the usage URL can point to a file whose contents may be
different per branch (e.g. a README file).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-05 20:37:49 +00:00
Paul Eggleton
354e368aa2 Add support for handling multiple branches
Change the data structure to support multiple branches. At the top level
there is a set list of Branch objects, and then a LayerBranch object
between each layer and the maintainers, dependencies, recipes and
machines, so that the set of each can be different per branch. The
branch is a session option, and can be selected via a drop-down that is
shown for all pages.

Additionally, with this change we avoid the need to run the update
script within a build environment set up with oe-init-build-env - since
we need a specific version of BitBake per branch we now use our own copy
of BitBake which is fetched by the script itself. The update script will
need to be called multiple times however - once per branch.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-05 20:37:48 +00:00
Paul Eggleton
0d52678697 Remove remnant of previous status filtering from layer list view
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-05 11:07:17 +00:00
Paul Eggleton
8a81235dba Filter out current layer from dependencies list in edit form
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-05 11:07:17 +00:00
Paul Eggleton
2ad289e312 Fix static pathing to use staticfiles
This is the recommended best practice.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 16:58:07 +00:00
Paul Eggleton
b3f0569640 Rename SubmitLayerForm class to EditLayerForm
Remain consistent with other naming.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 15:55:23 +00:00
Paul Eggleton
aa1dd0b822 Remove unneeded useredit variable from edit_layer_view
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 15:54:59 +00:00
Paul Eggleton
4b3aad2cea Add CAPTCHA to submission form
This should prevent spamming even though this is less likely with this
kind of site.

The CAPTCHA does not show when editing, only submitting, and is also not
shown for authenticated users.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 15:48:38 +00:00
Paul Eggleton
482abdcc8a Submit/edit form tweaks
* Don't specify action on form - this is best practice and avoids the
  need to have separate form tags for submit and edit
* Add a short introduction to the submit form
* Focus first field on load only if first field is empty (avoids doing
  this focusing on the edit form which is not really useful).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 14:36:41 +00:00
Paul Eggleton
a8ae70a600 Remove Submit layer link when on submit/edit pages
This avoids changes being accidentally lost when either editing or
submitting a layer.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 14:36:41 +00:00
Belen Barros
f178ea3151 Styles for the submit layers form
Improve styling and layout

Signed-off-by: Belen Barros <belen.barros.pena@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 14:36:41 +00:00
Paul Eggleton
0e14cf17d8 Hide extra maintainer forms and show each one on request
Hide all empty maintainer forms and have a button to "add" another
maintainer which just uses jQuery to show the next hidden form. Up to
10 maintainers can be added which should be more than enough.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 14:36:41 +00:00
Paul Eggleton
9a3bfac320 Add ability to delete unpublished layers
If we get bogus or duplicate entries we'll want the ability to delete
them easily before publishing (without needing to have access to the
admin interface), so add this ability. Being able to delete a published
layer might be a bit dangerous and is less likely to be needed so that
is disallowed for now.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 14:36:41 +00:00
Paul Eggleton
26ab9dbb28 Add ability to add, edit and delete layer notes
This allows adding an important notice to a layer e.g. "this layer is
deprecated, please use layer xyz instead". Only one layer note can be
added through the interface although the data structures allow multiple,
so notes may be added programmatically without disturbing user-added
ones.

With this change we also add a get_absolute_url() function to the
LayerItem model and change the calls to reverse() for layers to use it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 14:36:41 +00:00
Paul Eggleton
e6d7b215a6 Allow setting active/inactive maintainer status when editing layer
If editing rather than submitting we want users to be able to make an
existing maintainer inactive.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-27 23:10:34 +00:00
Paul Eggleton
ad5e8f0524 Clarify language around publishing layers
Show "unpublished" rather than "new" in dependencies list in submit
form, and mention publishing as the operation in the "thanks for
submitting" page.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-27 23:10:28 +00:00
Paul Eggleton
3f60b3fba3 Improve detail page for unpublished layers
* Add a label making it clear the layer is unpublished
* Hide recipes list header since there should never be any recipes (as
  the update script doesn't process unpublished layers)
* Add test links for base URLs

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-27 12:10:49 +00:00
Paul Eggleton
47981c57ad Add edit form template missing from last commit
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-27 10:57:19 +00:00
Paul Eggleton
c40bfedd4a Implement editing of layers
Allow users with publish permission to edit any layer, and users with
the same email address as one of the maintainers of a layer to edit that
layer.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-27 10:34:02 +00:00
Paul Eggleton
1e3f451139 Fix Publish Layer button on layer detail
Show button only if user has appropriate permission, and remove the
duplicate button at the end of the page as it's unlikely to be useful.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 23:40:12 +00:00
Paul Eggleton
89d4f9ea6b Don't show last commit date on layer detail if field is null
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 22:38:44 +00:00
Paul Eggleton
88ada21861 Prevent users without publish permission from viewing unpublished layers
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 22:36:39 +00:00
Paul Eggleton
2ea10c869e Add last commit date to layer detail
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 19:13:34 +00:00
Paul Eggleton
5b9f65880d Enable autoescaping in more places
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 18:28:26 +00:00
Paul Eggleton
30d64cafda Style new (unpublished) layers differently in dependency list on submit form
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 18:02:21 +00:00
Paul Eggleton
440a972f60 Add searchable machine index
The number of machines is likely to be quite high and it may not be
immediately clear to users which layer machines can be found in, so add
a searchable index to help with this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 17:51:16 +00:00
Paul Eggleton
8e49392398 Render dependency checklist within submit form template
Previously I had added a custom widget to handle this, but it turns out
it's not flexible enough - we want to style items individually (not done
yet) and reorder checked items to the top on refresh (done).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 17:50:43 +00:00
Paul Eggleton
1ca1674042 Disable Submit Layer link when already on submission form
If we don't do this then clicking on the link when you're already on the
submission form will reload it, blanking out all the values.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 15:43:13 +00:00
Paul Eggleton
431f2fba17 Add javascript code to split name/email pairs in maintainer fields
In the submit layer form, if a user pastes/types in a name/email pair
(e.g. My Name <my.email@example.com>) then this will automatically be
split into the name and email input fields, saving the user from doing
this by hand (since this is a common notation within repositories and
documentation.)

Additionally, if there is any text after the email address then move it
into the responsibility field unless the responsibility has been entered
by the user.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 15:35:41 +00:00
Paul Eggleton
4756fed86f Drop created_date field from LayerItem
We have django-reversion to handle auditing/history now so we don't need
an explicit field to hold the creation date.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 14:59:26 +00:00
Paul Eggleton
b9b77b8be1 Make it easier to select repo URL/subdir on detail page
Add an icon with some javascript to select the URL / subdir text so it
can be easily copied (since dragging can easily select unwanted text
from the rest of the page).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 14:24:42 +00:00
Paul Eggleton
d56d280be7 Use top commit for subdirectory instead of repository in update script
If there is more than one layer in a repository, we want the latest
commit in the subdirectory not the entire repository (since we use it
to determine the last commit date which should show how "fresh" the
layer is).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 11:26:00 +00:00
Paul Eggleton
e0f8a05423 Handle updating of inc files/classes within same layer
If we aren't doing a full refresh, when changes to an included/required
file or an inherited class occur we need to update all of the files that
depend on them. BitBake records these dependencies, so read them and
record them against each recipe.

At the moment this only handles dependencies within the same layer; that
is probably sufficient to handle most changes for the purposes of
extracting the data this application cares about. A future improved
solution will probably involve making use of BitBake's cache rather than
and parsing all layers and their dependencies rather than individual
recipes.

This change also adds -x/--nofetch and -n/--dry-run options for
debugging as well as some further debug messages.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 11:05:43 +00:00
Paul Eggleton
b47400c38d Don't stop parsing layer on fatal error in update script
"Fatal" errors during parsing a single recipe (such as finding legacy
staging) shouldn't stop us from parsing the rest of the layer. To do
this we need to catch BaseException instead of Exception as fatal errors
end up calling sys.exit.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 11:04:43 +00:00
Paul Eggleton
b3003840e6 Fix update script to handle layers which include/inherit files from other layers
Parse layer.conf files so that BBPATH is set correctly as well as any
other custom variables. This required the repository fetching to be
split out of the update process and done first so that we're sure we
have the data for the other layers.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-25 16:14:50 +00:00
Paul Eggleton
6bc9beea4b Improve about page
Add titles, credits and list of components used.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-25 13:41:14 +00:00
Paul Eggleton
f6c10424e4 Add OE favicon
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-25 12:07:33 +00:00
Paul Eggleton
516e3d198f Increase number of recipes per page to 50 in recipes list
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-25 11:28:06 +00:00
Paul Eggleton
cbeba65dac Use scrolling list of checkboxes for dependencies on submit form
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-25 11:03:54 +00:00
Paul Eggleton
3964071e9d Use a formset in submit layer form to handle maintainers
Formsets allow us to have separate fields for name/email for each
maintainer, as well as being able to collect the responsibility field
value. Also split the form to be output field-by-field to allow styling.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-25 11:03:32 +00:00
Paul Eggleton
d8c6824f30 Add help text to model fields
Add some explanatory help text which can be used in the submission form.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-25 10:13:05 +00:00
Paul Eggleton
e4eb8213cf Collect machine information from layers
Look for conf/machine/*.conf and add a record for each file found. These
are displayed in the layer detail page if any are present.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-24 23:14:53 +00:00
Paul Eggleton
3b5c7ad825 Add ability to update specific layers by name
Add a -l / --layers option to the update script.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-24 21:22:49 +00:00
Paul Eggleton
f3174e16f6 Fix update script to handle includes from other directories
Set BBPATH so that files from the layer can be found when recipes use
include/require pointing to files with a specific path, or use
inherit to inherit a class in the layer.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-24 21:10:37 +00:00
Paul Eggleton
6c12135117 Don't fail with an error due to unset LICENSE
meta-ti has a recipe in it that causes parsing to fail with a fatal
error due to LICENSE not being set; for the purposes of the layer index
just set a default value for LICENSE so that this doesn't break parsing.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-24 20:50:52 +00:00
Paul Eggleton
355c92cfe7 Add mailing list field to layer
Enable recording the mailing list associated with each layer, if any.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-23 23:48:06 +00:00
Paul Eggleton
8b742732d8 Clarify BSP layer type description
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-23 22:48:49 +00:00
Paul Eggleton
95ec84a8c3 Add javascript to submit form to auto-set web URL fields
If the repo URL matches known public hosting sites (i.e.
git.openembedded.org, git.yoctoproject.org, github.com, gitorious.org,
bitbucket.org) then we can set the web URLs automatically and save the
submitter from having to figure them out themselves.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-23 22:32:13 +00:00
Paul Eggleton
6cd47bdd82 Handle web interfaces with different URL schemes
Some git web interfaces use different paths for files (blobs) and
directories when it comes to browsing; this means we need to have a
separate field for the base URL for files.

Additionally, Gitweb typically puts the path within the URL instead of
at the end (although the parameters can be reordered) and cannot handle
the file parameter (f=) being specified with no value. So, to add some
flexibility, add the ability to use a positional macro %path% to
optionally specify where to put the path. If needed, square brackets
can be used in conjunction with %path% to exclude parts of the string
when there is no path, i.e. we want to browse the root. For example, the
following base URL:

  http://git.example.com/?p=somerepo.git;a=tree;[;f=%path%];hb=HEAD

would be translated to this with a path of "path/to/dir":

  http://git.example.com/?p=somerepo.git;a=tree;f=path/to/dir;hb=HEAD

and this if no path were specified:

  http://git.example.com/?p=somerepo.git;a=tree;hb=HEAD

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-23 20:33:24 +00:00
Paul Eggleton
4fef5c0c8e Don't default layer type in submit layer form
We want to force selection of a specific layer type, otherwise many
submitters will just leave it at the default value.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-23 16:44:59 +00:00
Paul Eggleton
710bc8fbb5 Add stacked dependency/maintainer records to layer in admin
Allows adding/editing dependencies and maintainers against each layer
more easily.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-23 14:16:56 +00:00
Paul Eggleton
08051e1ccf Show layer notes records as alerts on layer detail
These can be used to show important notes (e.g. "This layer is
deprecated, use layer xyz instead.") as eye-catching alerts at the top
of the detail page.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-22 17:49:50 +00:00
Belen Barros
18bbce1de9 Layer details style changes
Changed to full screen layout to improve the table display
and get rid of the accordion for the layer information.

Signed-off-by: Belen Barros <belen.barros.pena@intel.com>
2013-02-22 17:11:20 +00:00
Paul Eggleton
ea213c8007 Add a basic about page
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-20 11:20:11 +00:00
Paul Eggleton
d5b15d2bdd Disable pagination for layer list
The layer list has a javascript-based search which won't interact well
with server-based pagination, so disable it for the moment.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-19 18:28:48 +00:00
Paul Eggleton
02f7ca3b2d Improve pagination for recipe list
Use a Django snippet to make pagination display a bit nicer (compressed
form instead of showing all page numbers). In order to interact properly
with GET requests, an additional snippet was required to add parameters
to the URL (why doesn't Django provide this out of the box?).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-19 18:28:48 +00:00
Paul Eggleton
430ae4f90e Improve recipe search
* Use more traditional GET instead of POST method
* Search in pn, summary, description and filename instead of just pn

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-19 17:22:45 +00:00
Paul Eggleton
fd600fb716 Initial version of recipe detail page
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-19 17:22:40 +00:00
Paul Eggleton
05ceb17487 Admin interface improvements
* Set custom title for admin pages
* Use reasonable field widths on editing pages
* Allow filtering and searching by useful fields
* Disable editing of recipe records
* Disable editing of layer fields set by the update script
* Show "Layers" instead of "Layer items" for layers
* Show "Layer dependencies" instead of "Layer dependencys"
* Show layer name in maintainers listing

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-19 12:02:04 +00:00
Paul Eggleton
df6a33967e Clear default value of DESCRIPTION before parsing recipes
By default, if DESCRIPTION is not set it takes the value of SUMMARY.
However, within this tool it is useful for us to be able to tell when
DESCRIPTION has not been set so we want it to be blank if that is the
case.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-18 16:29:01 +00:00
Paul Eggleton
873093d2e4 Clear default value of HOMEPAGE before parsing recipes
The default value of HOMEPAGE ('unknown', set from bitbake.conf) is not
particularly helpful - we want it to be blank if it's not set, so just
set it to blank before parsing each recipe.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-18 16:23:37 +00:00
Paul Eggleton
dc4494aa8a Return blank URL for recipe file if layer's web tree base URL is not set
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-18 16:00:43 +00:00
Paul Eggleton
22b7918bf2 Allow a name to be shown even if parsing recipe failed
If recipe parsing failed the pn field will be blank, but for display
purposes we can take a guess from the filename.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-18 15:40:09 +00:00
Paul Eggleton
f5e37e18c0 Ensure publishing a layer already published does nothing
Just in case two users go to publish the same layer at around the same
time, avoid saving the record for a user who tries to publishes it after
the first time.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-14 07:35:07 +00:00
Paul Eggleton
eebbcf66c1 Fix validation to allow blank web tree start URL
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-14 07:26:52 +00:00
Paul Eggleton
45514d387b Enable auditing using django-reversion and django-reversion-compare
Collect history for changes, and allow browsing / reverting / comparison
within the admin interface.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-14 07:25:21 +00:00
Paul Eggleton
2eb5f38b21 Initial commit of layerindex-web
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-13 12:09:57 +00:00