mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 19:45:57 +01:00
Merge branch 'master' into toggle_gravatar
Conflicts: src/main/scala/view/AvatarImageProvider.scala
This commit is contained in:
15
README.md
15
README.md
@@ -7,19 +7,20 @@ The current version of GitBucket provides a basic features below:
|
||||
|
||||
- Public / Private Git repository (http access only)
|
||||
- Repository viewer (some advanced features are not implemented)
|
||||
- Repository search (Code and Issues)
|
||||
- Wiki
|
||||
- Issues
|
||||
- Activity timeline
|
||||
- User management (for Administrators)
|
||||
- Group (like Organization in Github)
|
||||
|
||||
Following features are not implemented, but we will make them in the future release!
|
||||
|
||||
- Fork and pull request
|
||||
- Search
|
||||
- Network graph
|
||||
- Statics
|
||||
- Watch / Star
|
||||
- Team management (like Organization in Github)
|
||||
- Notification
|
||||
|
||||
If you want to try the development version of GitBucket, see the documentation for developers at [Wiki](https://github.com/takezoe/gitbucket/wiki).
|
||||
|
||||
@@ -36,6 +37,16 @@ To upgrade GitBucket, only replace gitbucket.war.
|
||||
|
||||
Release Notes
|
||||
--------
|
||||
### 1.4 - 31 Jul 2013
|
||||
- Group management.
|
||||
- Repository search for code and issues.
|
||||
- Display user related issues on the dashboard.
|
||||
- Display participants avatar of issues on the issue page.
|
||||
- Performance improvement for repository viewer.
|
||||
- Alert by milestone due date.
|
||||
- H2 database administration console.
|
||||
- Fixed some bugs.
|
||||
|
||||
### 1.3 - 18 Jul 2013
|
||||
- Batch updating for issues.
|
||||
- Display assigned user on issue list.
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>37</x>
|
||||
<y>36</y>
|
||||
<x>33</x>
|
||||
<y>18</y>
|
||||
</constraint>
|
||||
<sourceConnections/>
|
||||
<targetConnections>
|
||||
@@ -51,8 +51,8 @@
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>751</x>
|
||||
<y>47</y>
|
||||
<x>723</x>
|
||||
<y>138</y>
|
||||
</constraint>
|
||||
<sourceConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
@@ -79,8 +79,8 @@
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>882</x>
|
||||
<y>239</y>
|
||||
<x>1182</x>
|
||||
<y>339</y>
|
||||
</constraint>
|
||||
<sourceConnections/>
|
||||
<targetConnections>
|
||||
@@ -108,8 +108,8 @@
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>940</x>
|
||||
<y>615</y>
|
||||
<x>1301</x>
|
||||
<y>836</y>
|
||||
</constraint>
|
||||
<sourceConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/>
|
||||
@@ -138,8 +138,8 @@
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>420</x>
|
||||
<y>758</y>
|
||||
<x>684</x>
|
||||
<y>858</y>
|
||||
</constraint>
|
||||
<sourceConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/>
|
||||
@@ -167,8 +167,8 @@
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>307</x>
|
||||
<y>356</y>
|
||||
<x>293</x>
|
||||
<y>478</y>
|
||||
</constraint>
|
||||
<sourceConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
@@ -210,8 +210,8 @@
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>641</x>
|
||||
<y>569</y>
|
||||
<x>875</x>
|
||||
<y>677</y>
|
||||
</constraint>
|
||||
<sourceConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
@@ -283,9 +283,14 @@
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>MILESTONE_NAME</columnName>
|
||||
<logicalName>Milestone Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel/columnType"/>
|
||||
<columnName>TITLE</columnName>
|
||||
<logicalName>Title</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType">
|
||||
<name>VARCHAR</name>
|
||||
<logicalName>文字列</logicalName>
|
||||
<supportSize>true</supportSize>
|
||||
<type>12</type>
|
||||
</columnType>
|
||||
<size>100</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
@@ -293,6 +298,49 @@
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>DESCRIPTION</columnName>
|
||||
<logicalName>Description</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType">
|
||||
<name>TEXT</name>
|
||||
<logicalName>文字列</logicalName>
|
||||
<supportSize>true</supportSize>
|
||||
<type>2005</type>
|
||||
</columnType>
|
||||
<size></size>
|
||||
<notNull>false</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>DUE_DATE</columnName>
|
||||
<logicalName>Due Date</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType">
|
||||
<name>TIMESTAMP</name>
|
||||
<logicalName>日時</logicalName>
|
||||
<supportSize>false</supportSize>
|
||||
<type>93</type>
|
||||
</columnType>
|
||||
<size>10</size>
|
||||
<notNull>false</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>CLOSED_DATE</columnName>
|
||||
<logicalName>Closed Date</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[6]/columnType"/>
|
||||
<size>10</size>
|
||||
<notNull>false</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
</columns>
|
||||
<indices/>
|
||||
<backgroundColor>
|
||||
@@ -350,6 +398,36 @@
|
||||
</entry>
|
||||
</references>
|
||||
</net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<listeners serialization="custom">
|
||||
<java.beans.PropertyChangeSupport>
|
||||
<default>
|
||||
<source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/>
|
||||
<propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
|
||||
</default>
|
||||
<null/>
|
||||
</java.beans.PropertyChangeSupport>
|
||||
</listeners>
|
||||
<source class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/>
|
||||
<target class="net.java.amateras.db.visual.model.TableModel" reference="../../../../../../../../../../../../../../../../../.."/>
|
||||
<foreignKeyName>ISSUE_FK_2</foreignKeyName>
|
||||
<references>
|
||||
<entry>
|
||||
<net.java.amateras.db.visual.model.ColumnModel reference="../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel"/>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>ASSIGNED_USER_NAME</columnName>
|
||||
<logicalName>Assinged User Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>false</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
</entry>
|
||||
</references>
|
||||
</net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
</sourceConnections>
|
||||
<targetConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
@@ -375,8 +453,8 @@
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>26</x>
|
||||
<y>660</y>
|
||||
<x>18</x>
|
||||
<y>776</y>
|
||||
</constraint>
|
||||
<sourceConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/>
|
||||
@@ -462,6 +540,22 @@
|
||||
<autoIncrement>true</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>ACTION</columnName>
|
||||
<logicalName>Action</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType">
|
||||
<name>VARCHAR</name>
|
||||
<logicalName>文字列</logicalName>
|
||||
<supportSize>true</supportSize>
|
||||
<type>12</type>
|
||||
</columnType>
|
||||
<size>20</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description>Expand to VARCHAR(20) from VARCHAR(10) in 1.3</description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel reference="../../sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>CONTENT</columnName>
|
||||
@@ -498,7 +592,7 @@
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>UPDATED_DATE</columnName>
|
||||
<logicalName>Updated Date</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[7]/columnType"/>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[8]/columnType"/>
|
||||
<size>10</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
@@ -572,10 +666,11 @@
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel reference="../../sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[4]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>TITLE</columnName>
|
||||
<logicalName>Title</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[6]/columnType"/>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[7]/columnType"/>
|
||||
<size></size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
@@ -586,7 +681,7 @@
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>CONTENT</columnName>
|
||||
<logicalName>Content</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[6]/columnType"/>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[7]/columnType"/>
|
||||
<size></size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
@@ -597,7 +692,7 @@
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>REGISTERED_DATE</columnName>
|
||||
<logicalName>Registered Date</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[7]/columnType"/>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[8]/columnType"/>
|
||||
<size>10</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
@@ -608,7 +703,7 @@
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>UPDATED_DATE</columnName>
|
||||
<logicalName>Updated Date</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[7]/columnType"/>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[8]/columnType"/>
|
||||
<size>10</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
@@ -801,8 +896,8 @@
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>388</x>
|
||||
<y>166</y>
|
||||
<x>481</x>
|
||||
<y>361</y>
|
||||
</constraint>
|
||||
<sourceConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/>
|
||||
@@ -862,6 +957,250 @@
|
||||
</net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel"/>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel"/>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<listeners serialization="custom">
|
||||
<java.beans.PropertyChangeSupport>
|
||||
<default>
|
||||
<source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/>
|
||||
<propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
|
||||
</default>
|
||||
<null/>
|
||||
</java.beans.PropertyChangeSupport>
|
||||
</listeners>
|
||||
<source class="net.java.amateras.db.visual.model.TableModel">
|
||||
<listeners serialization="custom">
|
||||
<java.beans.PropertyChangeSupport>
|
||||
<default>
|
||||
<source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/>
|
||||
<propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
|
||||
</default>
|
||||
<null/>
|
||||
</java.beans.PropertyChangeSupport>
|
||||
</listeners>
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>1199</x>
|
||||
<y>25</y>
|
||||
</constraint>
|
||||
<sourceConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<listeners serialization="custom">
|
||||
<java.beans.PropertyChangeSupport>
|
||||
<default>
|
||||
<source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/>
|
||||
<propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
|
||||
</default>
|
||||
<null/>
|
||||
</java.beans.PropertyChangeSupport>
|
||||
</listeners>
|
||||
<source class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/>
|
||||
<target class="net.java.amateras.db.visual.model.TableModel" reference="../../../../../../../../../../../.."/>
|
||||
<foreignKeyName>ACTIVITY_FK_2</foreignKeyName>
|
||||
<references>
|
||||
<entry>
|
||||
<net.java.amateras.db.visual.model.ColumnModel reference="../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel"/>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>ACTIVITY_USER_NAME</columnName>
|
||||
<logicalName>Activity User Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
</entry>
|
||||
</references>
|
||||
</net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
</sourceConnections>
|
||||
<targetConnections/>
|
||||
<error></error>
|
||||
<linkedPath></linkedPath>
|
||||
<tableName>ACTIVITY</tableName>
|
||||
<logicalName>Activity</logicalName>
|
||||
<description>Since 1.2</description>
|
||||
<columns>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>ACTIVITY_ID</columnName>
|
||||
<logicalName>Activity ID</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType">
|
||||
<name>INT</name>
|
||||
<logicalName>整数</logicalName>
|
||||
<supportSize>false</supportSize>
|
||||
<type>4</type>
|
||||
</columnType>
|
||||
<size>10</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>true</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>true</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>USER_NAME</columnName>
|
||||
<logicalName>User Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>REPOSITORY_NAME</columnName>
|
||||
<logicalName>Repository Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel reference="../../sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>ACTIVITY_TYPE</columnName>
|
||||
<logicalName>Activity Type</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>MESSAGE</columnName>
|
||||
<logicalName>Message</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[5]/columnType"/>
|
||||
<size></size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>ADDITIONAL_INFO</columnName>
|
||||
<logicalName>Additional Information</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[5]/columnType"/>
|
||||
<size></size>
|
||||
<notNull>false</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>ACTIVITY_DATE</columnName>
|
||||
<logicalName>Activity Date</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[6]/columnType"/>
|
||||
<size>10</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
</columns>
|
||||
<indices/>
|
||||
<backgroundColor>
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>206</blue>
|
||||
</backgroundColor>
|
||||
<sql></sql>
|
||||
</source>
|
||||
<target class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/>
|
||||
<foreignKeyName>ACTIVITY_FK_1</foreignKeyName>
|
||||
<references/>
|
||||
</net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<listeners serialization="custom">
|
||||
<java.beans.PropertyChangeSupport>
|
||||
<default>
|
||||
<source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/>
|
||||
<propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
|
||||
</default>
|
||||
<null/>
|
||||
</java.beans.PropertyChangeSupport>
|
||||
</listeners>
|
||||
<source class="net.java.amateras.db.visual.model.TableModel">
|
||||
<listeners serialization="custom">
|
||||
<java.beans.PropertyChangeSupport>
|
||||
<default>
|
||||
<source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/>
|
||||
<propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
|
||||
</default>
|
||||
<null/>
|
||||
</java.beans.PropertyChangeSupport>
|
||||
</listeners>
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>1451</x>
|
||||
<y>577</y>
|
||||
</constraint>
|
||||
<sourceConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/>
|
||||
</sourceConnections>
|
||||
<targetConnections/>
|
||||
<error></error>
|
||||
<linkedPath></linkedPath>
|
||||
<tableName>COMMIT_LOG</tableName>
|
||||
<logicalName>Commit Log</logicalName>
|
||||
<description>Since 1.2</description>
|
||||
<columns>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>USER_NAME</columnName>
|
||||
<logicalName>User Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>true</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>REPOSITORY_NAME</columnName>
|
||||
<logicalName>Repository Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>true</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>COMMIT_ID</columnName>
|
||||
<logicalName>Commit ID</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>40</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>true</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
</columns>
|
||||
<indices/>
|
||||
<backgroundColor>
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>206</blue>
|
||||
</backgroundColor>
|
||||
<sql></sql>
|
||||
</source>
|
||||
<target class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/>
|
||||
<foreignKeyName>COMMIT_LOG_FK_1</foreignKeyName>
|
||||
<references/>
|
||||
</net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
</targetConnections>
|
||||
<error></error>
|
||||
<linkedPath></linkedPath>
|
||||
@@ -1062,6 +1401,100 @@
|
||||
</net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[3]"/>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]"/>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[6]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]"/>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[4]"/>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<listeners serialization="custom">
|
||||
<java.beans.PropertyChangeSupport>
|
||||
<default>
|
||||
<source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/>
|
||||
<propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
|
||||
</default>
|
||||
<null/>
|
||||
</java.beans.PropertyChangeSupport>
|
||||
</listeners>
|
||||
<source class="net.java.amateras.db.visual.model.TableModel">
|
||||
<listeners serialization="custom">
|
||||
<java.beans.PropertyChangeSupport>
|
||||
<default>
|
||||
<source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/>
|
||||
<propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
|
||||
</default>
|
||||
<null/>
|
||||
</java.beans.PropertyChangeSupport>
|
||||
</listeners>
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>432</x>
|
||||
<y>240</y>
|
||||
</constraint>
|
||||
<sourceConnections>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<listeners serialization="custom">
|
||||
<java.beans.PropertyChangeSupport>
|
||||
<default>
|
||||
<source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/>
|
||||
<propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
|
||||
</default>
|
||||
<null/>
|
||||
</java.beans.PropertyChangeSupport>
|
||||
</listeners>
|
||||
<source class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/>
|
||||
<target class="net.java.amateras.db.visual.model.TableModel" reference="../../../../../.."/>
|
||||
<foreignKeyName>GROUP_MEMBER_FK_2</foreignKeyName>
|
||||
<references/>
|
||||
</net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
</sourceConnections>
|
||||
<targetConnections/>
|
||||
<error></error>
|
||||
<linkedPath></linkedPath>
|
||||
<tableName>GROUP_MEMBER</tableName>
|
||||
<logicalName>Group Member</logicalName>
|
||||
<description>Since 1.4</description>
|
||||
<columns>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>GROUP_NAME</columnName>
|
||||
<logicalName>Group Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>true</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>USER_NAME</columnName>
|
||||
<logicalName>User Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>true</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
</columns>
|
||||
<indices/>
|
||||
<backgroundColor>
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>206</blue>
|
||||
</backgroundColor>
|
||||
<sql></sql>
|
||||
</source>
|
||||
<target class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/>
|
||||
<foreignKeyName>GROUP_MEMBER_FK_1</foreignKeyName>
|
||||
<references>
|
||||
<entry>
|
||||
<net.java.amateras.db.visual.model.ColumnModel reference="../../../../net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel"/>
|
||||
<net.java.amateras.db.visual.model.ColumnModel reference="../../../source/columns/net.java.amateras.db.visual.model.ColumnModel"/>
|
||||
</entry>
|
||||
</references>
|
||||
</net.java.amateras.db.visual.model.ForeignKeyModel>
|
||||
<net.java.amateras.db.visual.model.ForeignKeyModel reference="../net.java.amateras.db.visual.model.ForeignKeyModel[6]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]"/>
|
||||
</targetConnections>
|
||||
<error></error>
|
||||
<linkedPath></linkedPath>
|
||||
@@ -1089,8 +1522,8 @@
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>PASSWORD</columnName>
|
||||
<logicalName>Password</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/>
|
||||
<size>20</size>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/>
|
||||
<size>40</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
@@ -1098,18 +1531,18 @@
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>USER_TYPE</columnName>
|
||||
<logicalName>User Type</logicalName>
|
||||
<columnName>ADMINISTRATOR</columnName>
|
||||
<logicalName>Administrator</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType">
|
||||
<name>INT</name>
|
||||
<logicalName>整数</logicalName>
|
||||
<name>BOOLEAN</name>
|
||||
<logicalName>真偽値</logicalName>
|
||||
<supportSize>false</supportSize>
|
||||
<type>4</type>
|
||||
<type>16</type>
|
||||
</columnType>
|
||||
<size>10</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description>0:Normal 1:Administrator</description>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue>0</defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
@@ -1157,6 +1590,33 @@
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>IMAGE</columnName>
|
||||
<logicalName>Image</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[5]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>false</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description>Since 1.3</description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>GROUP_ACCOUNT</columnName>
|
||||
<logicalName>Group Account</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType">
|
||||
<name>BOOLEAN</name>
|
||||
<logicalName>真偽値</logicalName>
|
||||
<supportSize>false</supportSize>
|
||||
<type>16</type>
|
||||
</columnType>
|
||||
<size>10</size>
|
||||
<notNull>true</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description>Since 1.4</description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue>FALSE</defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
</columns>
|
||||
<indices>
|
||||
<net.java.amateras.db.visual.model.IndexModel>
|
||||
@@ -1184,6 +1644,91 @@
|
||||
<net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target"/>
|
||||
<net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source"/>
|
||||
<net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[3]/source"/>
|
||||
<net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[6]/source"/>
|
||||
<net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[7]/source"/>
|
||||
<net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[6]/source"/>
|
||||
<net.java.amateras.db.visual.model.TableModel>
|
||||
<listeners serialization="custom">
|
||||
<java.beans.PropertyChangeSupport>
|
||||
<default>
|
||||
<source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/>
|
||||
<propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
|
||||
</default>
|
||||
<null/>
|
||||
</java.beans.PropertyChangeSupport>
|
||||
</listeners>
|
||||
<constraint>
|
||||
<height>-1</height>
|
||||
<width>-1</width>
|
||||
<x>410</x>
|
||||
<y>860</y>
|
||||
</constraint>
|
||||
<sourceConnections/>
|
||||
<targetConnections/>
|
||||
<error></error>
|
||||
<linkedPath></linkedPath>
|
||||
<tableName>ISSUE_OUTLINE_VIEW</tableName>
|
||||
<logicalName>Issue Outline View</logicalName>
|
||||
<description>Since 1.4</description>
|
||||
<columns>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>USER_NAME</columnName>
|
||||
<logicalName>User Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[5]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>false</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>REPOSITORY_NAME</columnName>
|
||||
<logicalName>Repository Name</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel/source/columns/net.java.amateras.db.visual.model.ColumnModel[5]/columnType"/>
|
||||
<size>100</size>
|
||||
<notNull>false</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>ISSUE_ID</columnName>
|
||||
<logicalName>Issue ID</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType">
|
||||
<name>INT</name>
|
||||
<logicalName>整数</logicalName>
|
||||
<supportSize>false</supportSize>
|
||||
<type>4</type>
|
||||
</columnType>
|
||||
<size>10</size>
|
||||
<notNull>false</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
<net.java.amateras.db.visual.model.ColumnModel>
|
||||
<columnName>COMMENT_COUNT</columnName>
|
||||
<logicalName>Comment Count</logicalName>
|
||||
<columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[3]/columnType"/>
|
||||
<size>10</size>
|
||||
<notNull>false</notNull>
|
||||
<primaryKey>false</primaryKey>
|
||||
<description></description>
|
||||
<autoIncrement>false</autoIncrement>
|
||||
<defaultValue></defaultValue>
|
||||
</net.java.amateras.db.visual.model.ColumnModel>
|
||||
</columns>
|
||||
<indices/>
|
||||
<backgroundColor>
|
||||
<red>210</red>
|
||||
<green>232</green>
|
||||
<blue>249</blue>
|
||||
</backgroundColor>
|
||||
<sql></sql>
|
||||
</net.java.amateras.db.visual.model.TableModel>
|
||||
</children>
|
||||
<dommains/>
|
||||
<dialectName>H2</dialectName>
|
||||
222
etc/icons.svg
Normal file
222
etc/icons.svg
Normal file
@@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="744.09448819"
|
||||
height="1052.3622047"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="gitbucket-icons.svg">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98994949"
|
||||
inkscape:cx="361.92071"
|
||||
inkscape:cy="804.25693"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1-9"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="706"
|
||||
inkscape:window-x="1912"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="layer1-9"
|
||||
inkscape:label="Layer 1"
|
||||
transform="matrix(0.66004549,0,0,0.66004549,12.445368,29.409765)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3850"
|
||||
d="m 472.30989,191.42833 0,-128.577242 c 0,0 1.85983,-15.30681 -16.73849,-15.30681 -18.59831,0 -51.14538,0 -51.14538,0"
|
||||
style="fill:none;stroke:#008000;stroke-width:22.72570638;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
id="path2991"
|
||||
transform="translate(-110.30458,-163.64471)"
|
||||
d="m 359.99999,290.93362 c 0,57.59541 -46.6903,104.28572 -104.28571,104.28572 -57.59541,0 -104.28571,-46.69031 -104.28571,-104.28572 0,-57.5954 46.6903,-104.28571 104.28571,-104.28571 57.59541,0 104.28571,46.69031 104.28571,104.28571 z"
|
||||
sodipodi:ry="104.28571"
|
||||
sodipodi:rx="104.28571"
|
||||
sodipodi:cy="290.93362"
|
||||
sodipodi:cx="255.71428"
|
||||
style="fill:#008000;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
id="path2993"
|
||||
d="m 359.99999,290.93362 c 0,57.59541 -46.6903,104.28572 -104.28571,104.28572 -57.59541,0 -104.28571,-46.69031 -104.28571,-104.28572 0,-57.5954 46.6903,-104.28571 104.28571,-104.28571 57.59541,0 104.28571,46.69031 104.28571,104.28571 z"
|
||||
sodipodi:ry="104.28571"
|
||||
sodipodi:rx="104.28571"
|
||||
sodipodi:cy="290.93362"
|
||||
sodipodi:cx="255.71428"
|
||||
style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
sodipodi:type="arc"
|
||||
transform="matrix(0.83611704,0,0,0.83611704,-67.553199,-115.22257)" />
|
||||
<rect
|
||||
id="rect2995"
|
||||
y="54.447956"
|
||||
x="131.64735"
|
||||
height="99.221695"
|
||||
width="29.189819"
|
||||
style="fill:#008000;stroke:#ffffff;stroke-width:1.11112404" />
|
||||
<rect
|
||||
id="rect2997"
|
||||
y="173.24185"
|
||||
x="131.90559"
|
||||
height="26.258072"
|
||||
width="29.724136"
|
||||
style="fill:#008000;stroke:#ffffff;stroke-width:0.57680577" />
|
||||
<rect
|
||||
y="68.361099"
|
||||
x="357.45975"
|
||||
height="104.27071"
|
||||
width="3.2554624"
|
||||
id="rect3818"
|
||||
style="fill:#ffffff;stroke:#008000;stroke-width:22.72570638;stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
<path
|
||||
transform="matrix(1.0049237,0,0,0.61497516,6.8767865,56.890898)"
|
||||
d="m 372.74629,230.89374 a 21.718279,35.140915 0 1 1 -43.43655,0 21.718279,35.140915 0 1 1 43.43655,0 z"
|
||||
sodipodi:ry="35.140915"
|
||||
sodipodi:rx="21.718279"
|
||||
sodipodi:cy="230.89374"
|
||||
sodipodi:cx="351.02802"
|
||||
id="path3795-4"
|
||||
style="fill:#ffffff;stroke:#008000;stroke-width:12.04511132;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
transform="matrix(1.0049237,0,0,0.61497516,5.3412605,-93.432709)"
|
||||
d="m 372.74629,230.89374 a 21.718279,35.140915 0 1 1 -43.43655,0 21.718279,35.140915 0 1 1 43.43655,0 z"
|
||||
sodipodi:ry="35.140915"
|
||||
sodipodi:rx="21.718279"
|
||||
sodipodi:cy="230.89374"
|
||||
sodipodi:cx="351.02802"
|
||||
id="path3795"
|
||||
style="fill:#ffffff;stroke:#008000;stroke-width:12.04511132;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
transform="matrix(1.0049237,0,0,0.61497516,119.6654,56.992418)"
|
||||
d="m 372.74629,230.89374 a 21.718279,35.140915 0 1 1 -43.43655,0 21.718279,35.140915 0 1 1 43.43655,0 z"
|
||||
sodipodi:ry="35.140915"
|
||||
sodipodi:rx="21.718279"
|
||||
sodipodi:cy="230.89374"
|
||||
sodipodi:cx="351.02802"
|
||||
id="path3795-4-0"
|
||||
style="fill:#ffffff;stroke:#008000;stroke-width:12.04511132;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3852"
|
||||
d="m 432.02527,10.803052 0,70.691447 -45.58896,-32.134619 z"
|
||||
style="fill:#008000;stroke:#008000;stroke-width:0.83335358px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3850-4"
|
||||
d="m 475.96369,446.18012 0,-128.57725 c 0,0 1.85984,-15.30681 -16.73848,-15.30681 -18.59831,0 -51.14539,0 -51.14539,0"
|
||||
style="fill:none;stroke:#800000;stroke-width:22.72570610000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
id="path2991-8"
|
||||
transform="translate(-106.65077,91.107081)"
|
||||
d="m 359.99999,290.93362 a 104.28571,104.28571 0 1 1 -208.57142,0 104.28571,104.28571 0 1 1 208.57142,0 z"
|
||||
sodipodi:ry="104.28571"
|
||||
sodipodi:rx="104.28571"
|
||||
sodipodi:cy="290.93362"
|
||||
sodipodi:cx="255.71428"
|
||||
style="fill:#800000;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
id="path2993-8"
|
||||
d="m 359.99999,290.93362 a 104.28571,104.28571 0 1 1 -208.57142,0 104.28571,104.28571 0 1 1 208.57142,0 z"
|
||||
sodipodi:ry="104.28571"
|
||||
sodipodi:rx="104.28571"
|
||||
sodipodi:cy="290.93362"
|
||||
sodipodi:cx="255.71428"
|
||||
style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
sodipodi:type="arc"
|
||||
transform="matrix(0.83611704,0,0,0.83611704,-63.899387,139.52922)" />
|
||||
<rect
|
||||
id="rect2995-2"
|
||||
y="309.19974"
|
||||
x="135.30116"
|
||||
height="99.221687"
|
||||
width="29.189819"
|
||||
style="fill:#800000;stroke:#ffffff;stroke-width:1.11112404000000000" />
|
||||
<rect
|
||||
id="rect2997-4"
|
||||
y="427.99362"
|
||||
x="135.5594"
|
||||
height="26.258072"
|
||||
width="29.724136"
|
||||
style="fill:#800000;stroke:#ffffff;stroke-width:0.57680577000000000" />
|
||||
<rect
|
||||
y="323.11288"
|
||||
x="361.11356"
|
||||
height="104.27072"
|
||||
width="3.2554622"
|
||||
id="rect3818-5"
|
||||
style="fill:#ffffff;stroke:#800000;stroke-width:22.72570610000000000;stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
<path
|
||||
transform="matrix(1.0049237,0,0,0.61497516,10.530593,311.64269)"
|
||||
d="m 372.74629,230.89374 a 21.718279,35.140915 0 1 1 -43.43655,0 21.718279,35.140915 0 1 1 43.43655,0 z"
|
||||
sodipodi:ry="35.140915"
|
||||
sodipodi:rx="21.718279"
|
||||
sodipodi:cy="230.89374"
|
||||
sodipodi:cx="351.02802"
|
||||
id="path3795-4-5"
|
||||
style="fill:#ffffff;stroke:#800000;stroke-width:12.04511166000000000;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
transform="matrix(1.0049237,0,0,0.61497516,8.9950734,161.31908)"
|
||||
d="m 372.74629,230.89374 a 21.718279,35.140915 0 1 1 -43.43655,0 21.718279,35.140915 0 1 1 43.43655,0 z"
|
||||
sodipodi:ry="35.140915"
|
||||
sodipodi:rx="21.718279"
|
||||
sodipodi:cy="230.89374"
|
||||
sodipodi:cx="351.02802"
|
||||
id="path3795-1"
|
||||
style="fill:#ffffff;stroke:#800000;stroke-width:12.04511166000000000;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
transform="matrix(1.0049237,0,0,0.61497516,123.31921,311.7442)"
|
||||
d="m 372.74629,230.89374 a 21.718279,35.140915 0 1 1 -43.43655,0 21.718279,35.140915 0 1 1 43.43655,0 z"
|
||||
sodipodi:ry="35.140915"
|
||||
sodipodi:rx="21.718279"
|
||||
sodipodi:cy="230.89374"
|
||||
sodipodi:cx="351.02802"
|
||||
id="path3795-4-0-7"
|
||||
style="fill:#ffffff;stroke:#800000;stroke-width:12.04511166000000000;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3852-1"
|
||||
d="m 435.67907,265.55484 0,70.69144 -45.58895,-32.13461 z"
|
||||
style="fill:#800000;stroke:#800000;stroke-width:0.83335358000000004px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.6 KiB |
Binary file not shown.
@@ -2,6 +2,7 @@ import sbt._
|
||||
import Keys._
|
||||
import org.scalatra.sbt._
|
||||
import org.scalatra.sbt.PluginKeys._
|
||||
import sbt.ScalaVersion
|
||||
import twirl.sbt.TwirlPlugin._
|
||||
import com.typesafe.sbteclipse.plugin.EclipsePlugin.EclipseKeys
|
||||
|
||||
@@ -20,7 +21,10 @@ object MyBuild extends Build {
|
||||
name := Name,
|
||||
version := Version,
|
||||
scalaVersion := ScalaVersion,
|
||||
resolvers += Classpaths.typesafeReleases,
|
||||
resolvers ++= Seq(
|
||||
Classpaths.typesafeReleases,
|
||||
"amateras-repo" at "http://amateras.sourceforge.jp/mvn/"
|
||||
),
|
||||
libraryDependencies ++= Seq(
|
||||
"org.eclipse.jgit" % "org.eclipse.jgit.http.server" % "3.0.0.201306101825-r",
|
||||
"org.apache.commons" % "commons-io" % "1.3.2",
|
||||
@@ -28,6 +32,7 @@ object MyBuild extends Build {
|
||||
"org.scalatra" %% "scalatra-specs2" % ScalatraVersion % "test",
|
||||
"org.scalatra" %% "scalatra-json" % ScalatraVersion,
|
||||
"org.json4s" %% "json4s-jackson" % "3.2.4",
|
||||
"jp.sf.amateras" %% "scalatra-forms" % "0.0.1",
|
||||
"commons-io" % "commons-io" % "2.4",
|
||||
"org.pegdown" % "pegdown" % "1.3.0",
|
||||
"org.apache.commons" % "commons-compress" % "1.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.2")
|
||||
|
||||
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0")
|
||||
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1")
|
||||
|
||||
addSbtPlugin("org.scalatra.sbt" % "scalatra-sbt" % "0.2.0")
|
||||
|
||||
|
||||
@@ -8,3 +8,17 @@ ALTER TABLE GROUP_MEMBER ADD CONSTRAINT IDX_GROUP_MEMBER_FK0 FOREIGN KEY (GROUP_
|
||||
ALTER TABLE GROUP_MEMBER ADD CONSTRAINT IDX_GROUP_MEMBER_FK1 FOREIGN KEY (USER_NAME) REFERENCES ACCOUNT (USER_NAME);
|
||||
|
||||
ALTER TABLE ACCOUNT ADD COLUMN GROUP_ACCOUNT BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
CREATE OR REPLACE VIEW ISSUE_OUTLINE_VIEW AS
|
||||
SELECT
|
||||
A.USER_NAME,
|
||||
A.REPOSITORY_NAME,
|
||||
A.ISSUE_ID,
|
||||
NVL(B.COMMENT_COUNT, 0) AS COMMENT_COUNT
|
||||
FROM ISSUE A
|
||||
LEFT OUTER JOIN (
|
||||
SELECT USER_NAME, REPOSITORY_NAME, ISSUE_ID, COUNT(COMMENT_ID) AS COMMENT_COUNT FROM ISSUE_COMMENT
|
||||
WHERE ACTION IN ('comment', 'close_comment', 'reopen_comment')
|
||||
GROUP BY USER_NAME, REPOSITORY_NAME, ISSUE_ID
|
||||
) B
|
||||
ON (A.USER_NAME = B.USER_NAME AND A.REPOSITORY_NAME = B.REPOSITORY_NAME AND A.ISSUE_ID = B.ISSUE_ID);
|
||||
|
||||
22
src/main/resources/update/1_5.sql
Normal file
22
src/main/resources/update/1_5.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
ALTER TABLE REPOSITORY ADD COLUMN ORIGIN_USER_NAME VARCHAR(100);
|
||||
ALTER TABLE REPOSITORY ADD COLUMN ORIGIN_REPOSITORY_NAME VARCHAR(100);
|
||||
ALTER TABLE REPOSITORY ADD COLUMN PARENT_USER_NAME VARCHAR(100);
|
||||
ALTER TABLE REPOSITORY ADD COLUMN PARENT_REPOSITORY_NAME VARCHAR(100);
|
||||
|
||||
CREATE TABLE PULL_REQUEST(
|
||||
USER_NAME VARCHAR(100) NOT NULL,
|
||||
REPOSITORY_NAME VARCHAR(100) NOT NULL,
|
||||
ISSUE_ID INT NOT NULL,
|
||||
BRANCH VARCHAR(100) NOT NULL,
|
||||
REQUEST_USER_NAME VARCHAR(100) NOT NULL,
|
||||
REQUEST_REPOSITORY_NAME VARCHAR(100) NOT NULL,
|
||||
REQUEST_BRANCH VARCHAR(100) NOT NULL,
|
||||
COMMIT_ID_FROM VARCHAR(40) NOT NULL,
|
||||
COMMIT_ID_TO VARCHAR(40) NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE PULL_REQUEST ADD CONSTRAINT IDX_PULL_REQUEST_PK PRIMARY KEY (USER_NAME, REPOSITORY_NAME, ISSUE_ID);
|
||||
ALTER TABLE PULL_REQUEST ADD CONSTRAINT IDX_PULL_REQUEST_FK0 FOREIGN KEY (USER_NAME, REPOSITORY_NAME, ISSUE_ID) REFERENCES ISSUE (USER_NAME, REPOSITORY_NAME, ISSUE_ID);
|
||||
ALTER TABLE PULL_REQUEST ADD CONSTRAINT IDX_PULL_REQUEST_FK1 FOREIGN KEY (REQUEST_USER_NAME, REQUEST_REPOSITORY_NAME) REFERENCES REPOSITORY (USER_NAME, REPOSITORY_NAME);
|
||||
|
||||
ALTER TABLE ISSUE ADD COLUMN PULL_REQUEST BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
@@ -18,6 +18,7 @@ class ScalatraBootstrap extends LifeCycle {
|
||||
context.mount(new LabelsController, "/*")
|
||||
context.mount(new MilestonesController, "/*")
|
||||
context.mount(new IssuesController, "/*")
|
||||
context.mount(new PullRequestsController, "/*")
|
||||
context.mount(new RepositorySettingsController, "/*")
|
||||
|
||||
val dir = new java.io.File(_root_.util.Directory.GitBucketHome)
|
||||
|
||||
@@ -58,7 +58,7 @@ trait AccountControllerBase extends AccountManagementControllerBase with FlashMa
|
||||
case _ =>
|
||||
_root_.account.html.repositories(account,
|
||||
if(account.isGroupAccount) Nil else getGroupsByUserName(userName),
|
||||
getVisibleRepositories(userName, baseUrl, context.loginAccount.map(_.userName)))
|
||||
getVisibleRepositories(context.loginAccount, baseUrl, Some(userName)))
|
||||
}
|
||||
} getOrElse NotFound
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package app
|
||||
|
||||
import _root_.util.Directory._
|
||||
import _root_.util.{FileUtil, Validations}
|
||||
import _root_.util.{StringUtil, FileUtil, Validations}
|
||||
import org.scalatra._
|
||||
import org.scalatra.json._
|
||||
import org.json4s._
|
||||
@@ -10,7 +10,7 @@ import org.apache.commons.io.FileUtils
|
||||
import model.Account
|
||||
import scala.Some
|
||||
import service.AccountService
|
||||
import javax.servlet.http.{HttpSession, HttpServletRequest}
|
||||
import javax.servlet.http.{HttpServletResponse, HttpSession, HttpServletRequest}
|
||||
import java.text.SimpleDateFormat
|
||||
import javax.servlet.{FilterChain, ServletResponse, ServletRequest}
|
||||
|
||||
@@ -24,15 +24,27 @@ abstract class ControllerBase extends ScalatraFilter
|
||||
|
||||
override def doFilter(request: ServletRequest, response: ServletResponse, chain: FilterChain) {
|
||||
val httpRequest = request.asInstanceOf[HttpServletRequest]
|
||||
val path = httpRequest.getRequestURI.substring(request.getServletContext.getContextPath.length)
|
||||
val httpResponse = response.asInstanceOf[HttpServletResponse]
|
||||
val context = request.getServletContext.getContextPath
|
||||
val path = httpRequest.getRequestURI.substring(context.length)
|
||||
|
||||
if(path.startsWith("/console/")){
|
||||
Option(httpRequest.getSession.getAttribute("LOGIN_ACCOUNT").asInstanceOf[Account]).collect {
|
||||
case account if(account.isAdmin) => chain.doFilter(request, response)
|
||||
}
|
||||
} else if(path.startsWith("/git/")){
|
||||
val account = httpRequest.getSession.getAttribute("LOGIN_ACCOUNT").asInstanceOf[Account]
|
||||
if(account == null){
|
||||
// Redirect to login form
|
||||
httpResponse.sendRedirect(context + "/signin?" + path)
|
||||
} else if(account.isAdmin){
|
||||
// H2 Console (administrators only)
|
||||
chain.doFilter(request, response)
|
||||
} else {
|
||||
// Redirect to dashboard
|
||||
httpResponse.sendRedirect(context + "/")
|
||||
}
|
||||
} else if(path.startsWith("/git/")){
|
||||
// Git repository
|
||||
chain.doFilter(request, response)
|
||||
} else {
|
||||
// Scalatra actions
|
||||
super.doFilter(request, response, chain)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,30 @@
|
||||
package app
|
||||
|
||||
import util.Directory._
|
||||
import util.{JGitUtil, UsersAuthenticator}
|
||||
import util.{LockUtil, JGitUtil, UsersAuthenticator, ReferrerAuthenticator}
|
||||
import service._
|
||||
import java.io.File
|
||||
import org.eclipse.jgit.api.Git
|
||||
import org.apache.commons.io._
|
||||
import jp.sf.amateras.scalatra.forms._
|
||||
import org.eclipse.jgit.lib.PersonIdent
|
||||
|
||||
class CreateRepositoryController extends CreateRepositoryControllerBase
|
||||
with RepositoryService with AccountService with WikiService with LabelsService with ActivityService
|
||||
with UsersAuthenticator
|
||||
with UsersAuthenticator with ReferrerAuthenticator
|
||||
|
||||
/**
|
||||
* Creates new repository.
|
||||
*/
|
||||
trait CreateRepositoryControllerBase extends ControllerBase {
|
||||
self: RepositoryService with AccountService with WikiService with LabelsService with ActivityService
|
||||
with UsersAuthenticator =>
|
||||
with UsersAuthenticator with ReferrerAuthenticator =>
|
||||
|
||||
case class RepositoryCreationForm(owner: String, name: String, description: Option[String], isPrivate: Boolean, createReadme: Boolean)
|
||||
|
||||
val form = mapping(
|
||||
case class ForkRepositoryForm(owner: String, name: String)
|
||||
|
||||
val newForm = mapping(
|
||||
"owner" -> trim(label("Owner" , text(required, maxlength(40), identifier, existsAccount))),
|
||||
"name" -> trim(label("Repository name", text(required, maxlength(40), identifier, unique))),
|
||||
"description" -> trim(label("Description" , optional(text()))),
|
||||
@@ -29,6 +32,11 @@ trait CreateRepositoryControllerBase extends ControllerBase {
|
||||
"createReadme" -> trim(label("Create README" , boolean()))
|
||||
)(RepositoryCreationForm.apply)
|
||||
|
||||
val forkForm = mapping(
|
||||
"owner" -> trim(label("Repository owner", text(required))),
|
||||
"name" -> trim(label("Repository name", text(required)))
|
||||
)(ForkRepositoryForm.apply)
|
||||
|
||||
/**
|
||||
* Show the new repository form.
|
||||
*/
|
||||
@@ -39,7 +47,9 @@ trait CreateRepositoryControllerBase extends ControllerBase {
|
||||
/**
|
||||
* Create new repository.
|
||||
*/
|
||||
post("/new", form)(usersOnly { form =>
|
||||
post("/new", newForm)(usersOnly { form =>
|
||||
LockUtil.lock(s"${form.owner}/${form.name}/create"){
|
||||
if(getRepository(form.owner, form.name, baseUrl).isEmpty){
|
||||
val ownerAccount = getAccountByUserName(form.owner).get
|
||||
val loginAccount = context.loginAccount.get
|
||||
val loginUserName = loginAccount.userName
|
||||
@@ -55,12 +65,7 @@ trait CreateRepositoryControllerBase extends ControllerBase {
|
||||
}
|
||||
|
||||
// Insert default labels
|
||||
createLabel(form.owner, form.name, "bug", "fc2929")
|
||||
createLabel(form.owner, form.name, "duplicate", "cccccc")
|
||||
createLabel(form.owner, form.name, "enhancement", "84b6eb")
|
||||
createLabel(form.owner, form.name, "invalid", "e6e6e6")
|
||||
createLabel(form.owner, form.name, "question", "cc317c")
|
||||
createLabel(form.owner, form.name, "wontfix", "ffffff")
|
||||
insertDefaultLabels(loginUserName, form.name)
|
||||
|
||||
// Create the actual repository
|
||||
val gitdir = getRepositoryDir(form.owner, form.name)
|
||||
@@ -86,7 +91,9 @@ trait CreateRepositoryControllerBase extends ControllerBase {
|
||||
|
||||
val git = Git.open(tmpdir)
|
||||
git.add.addFilepattern("README.md").call
|
||||
git.commit.setMessage("Initial commit").call
|
||||
git.commit
|
||||
.setCommitter(new PersonIdent(loginUserName, loginAccount.mailAddress))
|
||||
.setMessage("Initial commit").call
|
||||
git.push.call
|
||||
|
||||
} finally {
|
||||
@@ -99,17 +106,83 @@ trait CreateRepositoryControllerBase extends ControllerBase {
|
||||
|
||||
// Record activity
|
||||
recordCreateRepositoryActivity(form.owner, form.name, loginUserName)
|
||||
}
|
||||
|
||||
// redirect to the repository
|
||||
redirect(s"/${form.owner}/${form.name}")
|
||||
}
|
||||
})
|
||||
|
||||
post("/:owner/:repository/_fork")(referrersOnly { repository =>
|
||||
val loginAccount = context.loginAccount.get
|
||||
val loginUserName = loginAccount.userName
|
||||
|
||||
LockUtil.lock(s"${loginUserName}/${repository.name}/create"){
|
||||
if(getRepository(loginUserName, repository.name, baseUrl).isEmpty){
|
||||
// Insert to the database at first
|
||||
val originUserName = repository.repository.originUserName.getOrElse(repository.owner)
|
||||
val originRepositoryName = repository.repository.originRepositoryName.getOrElse(repository.name)
|
||||
|
||||
createRepository(
|
||||
repositoryName = repository.name,
|
||||
userName = loginUserName,
|
||||
description = repository.repository.description,
|
||||
isPrivate = repository.repository.isPrivate,
|
||||
originRepositoryName = Some(originRepositoryName),
|
||||
originUserName = Some(originUserName),
|
||||
parentRepositoryName = Some(repository.name),
|
||||
parentUserName = Some(repository.owner)
|
||||
)
|
||||
|
||||
// Insert default labels
|
||||
insertDefaultLabels(loginUserName, repository.name)
|
||||
|
||||
// clone repository actually
|
||||
JGitUtil.cloneRepository(
|
||||
getRepositoryDir(repository.owner, repository.name),
|
||||
getRepositoryDir(loginUserName, repository.name))
|
||||
|
||||
// Create Wiki repository
|
||||
JGitUtil.cloneRepository(
|
||||
getWikiRepositoryDir(repository.owner, repository.name),
|
||||
getWikiRepositoryDir(loginUserName, repository.name))
|
||||
|
||||
// insert commit id
|
||||
JGitUtil.withGit(getRepositoryDir(loginUserName, repository.name)){ git =>
|
||||
JGitUtil.getRepositoryInfo(loginUserName, repository.name, baseUrl).branchList.foreach { branch =>
|
||||
JGitUtil.getCommitLog(git, branch) match {
|
||||
case Right((commits, _)) => commits.foreach { commit =>
|
||||
if(!existsCommitId(loginUserName, repository.name, commit.id)){
|
||||
insertCommitId(loginUserName, repository.name, commit.id)
|
||||
}
|
||||
}
|
||||
case Left(_) => ???
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Record activity
|
||||
recordForkActivity(repository.owner, repository.name, loginUserName)
|
||||
}
|
||||
// redirect to the repository
|
||||
redirect("/%s/%s".format(loginUserName, repository.name))
|
||||
}
|
||||
})
|
||||
|
||||
private def insertDefaultLabels(userName: String, repositoryName: String): Unit = {
|
||||
createLabel(userName, repositoryName, "bug", "fc2929")
|
||||
createLabel(userName, repositoryName, "duplicate", "cccccc")
|
||||
createLabel(userName, repositoryName, "enhancement", "84b6eb")
|
||||
createLabel(userName, repositoryName, "invalid", "e6e6e6")
|
||||
createLabel(userName, repositoryName, "question", "cc317c")
|
||||
createLabel(userName, repositoryName, "wontfix", "ffffff")
|
||||
}
|
||||
|
||||
private def existsAccount: Constraint = new Constraint(){
|
||||
def validate(name: String, value: String): Option[String] =
|
||||
if(getAccountByUserName(value).isEmpty) Some("User or group does not exist.") else None
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Duplicate check for the repository name.
|
||||
*/
|
||||
|
||||
@@ -33,14 +33,22 @@ trait DashboardControllerBase extends ControllerBase {
|
||||
|
||||
session.put(sessionKey, condition)
|
||||
|
||||
val repositories = getAccessibleRepositories(context.loginAccount, baseUrl)
|
||||
val userName = context.loginAccount.get.userName
|
||||
val repositories = getUserRepositories(userName, baseUrl).map(repo => repo.owner -> repo.name)
|
||||
val filterUser = Map(filter -> userName)
|
||||
val page = IssueSearchCondition.page(request)
|
||||
//
|
||||
dashboard.html.issues(
|
||||
issues.html.listparts(Nil, 0, 0, 0, condition),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
repositories,
|
||||
issues.html.listparts(
|
||||
searchIssue(condition, filterUser, false, (page - 1) * IssueLimit, IssueLimit, repositories: _*),
|
||||
page,
|
||||
countIssue(condition.copy(state = "open"), filterUser, false, repositories: _*),
|
||||
countIssue(condition.copy(state = "closed"), filterUser, false, repositories: _*),
|
||||
condition),
|
||||
countIssue(condition, Map.empty, false, repositories: _*),
|
||||
countIssue(condition, Map("assigned" -> userName), false, repositories: _*),
|
||||
countIssue(condition, Map("created_by" -> userName), false, repositories: _*),
|
||||
countIssueGroupByRepository(condition, filterUser, repositories: _*),
|
||||
condition,
|
||||
filter)
|
||||
|
||||
|
||||
@@ -16,19 +16,22 @@ trait IndexControllerBase extends ControllerBase {
|
||||
val loginAccount = context.loginAccount
|
||||
|
||||
html.index(getRecentActivities(),
|
||||
getAccessibleRepositories(loginAccount, baseUrl),
|
||||
getVisibleRepositories(loginAccount, baseUrl),
|
||||
loadSystemSettings(),
|
||||
loginAccount.map{ account => getRepositoryNamesOfUser(account.userName) }.getOrElse(Nil)
|
||||
loginAccount.map{ account => getUserRepositories(account.userName, baseUrl) }.getOrElse(Nil)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* JSON API for collaborator completion.
|
||||
*
|
||||
* TODO Move to other controller?
|
||||
*/
|
||||
// TODO Move to other controller?
|
||||
get("/_user/proposals")(usersOnly {
|
||||
contentType = formats("json")
|
||||
org.json4s.jackson.Serialization.write(Map("options" -> getAllUsers.filter(!_.isGroupAccount).map(_.userName).toArray))
|
||||
org.json4s.jackson.Serialization.write(
|
||||
Map("options" -> getAllUsers.filter(!_.isGroupAccount).map(_.userName).toArray)
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -128,14 +128,22 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
})
|
||||
|
||||
post("/:owner/:repository/issue_comments/new", commentForm)(readableUsersOnly { (form, repository) =>
|
||||
handleComment(form.issueId, Some(form.content), repository)() map { id =>
|
||||
handleComment(form.issueId, Some(form.content), repository)() map { case (issue, id) =>
|
||||
if(issue.isPullRequest){
|
||||
redirect(s"/${repository.owner}/${repository.name}/pull/${form.issueId}#comment-${id}")
|
||||
} else {
|
||||
redirect(s"/${repository.owner}/${repository.name}/issues/${form.issueId}#comment-${id}")
|
||||
}
|
||||
} getOrElse NotFound
|
||||
})
|
||||
|
||||
post("/:owner/:repository/issue_comments/state", issueStateForm)(readableUsersOnly { (form, repository) =>
|
||||
handleComment(form.issueId, form.content, repository)() map { id =>
|
||||
handleComment(form.issueId, form.content, repository)() map { case (issue, id) =>
|
||||
if(issue.isPullRequest){
|
||||
redirect(s"/${repository.owner}/${repository.name}/pull/${form.issueId}#comment-${id}")
|
||||
} else {
|
||||
redirect(s"/${repository.owner}/${repository.name}/issues/${form.issueId}#comment-${id}")
|
||||
}
|
||||
} getOrElse NotFound
|
||||
})
|
||||
|
||||
@@ -294,23 +302,17 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
content foreach ( recordCommentIssueActivity(owner, name, userName, issueId, _) )
|
||||
recordActivity foreach ( _ (owner, name, userName, issueId, issue.title) )
|
||||
|
||||
commentId
|
||||
(issue, commentId)
|
||||
}
|
||||
}
|
||||
|
||||
private def searchIssues(filter: String, repository: RepositoryService.RepositoryInfo) = {
|
||||
val owner = repository.owner
|
||||
val repoName = repository.name
|
||||
val userName = if(filter != "all") Some(params("userName")) else None
|
||||
val filterUser = Map(filter -> params.getOrElse("userName", ""))
|
||||
val page = IssueSearchCondition.page(request)
|
||||
val sessionKey = s"${owner}/${repoName}/issues"
|
||||
|
||||
val page = try {
|
||||
val i = params.getOrElse("page", "1").toInt
|
||||
if(i <= 0) 1 else i
|
||||
} catch {
|
||||
case e: NumberFormatException => 1
|
||||
}
|
||||
|
||||
// retrieve search condition
|
||||
val condition = if(request.getQueryString == null){
|
||||
session.get(sessionKey).getOrElse(IssueSearchCondition()).asInstanceOf[IssueSearchCondition]
|
||||
@@ -319,17 +321,17 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
session.put(sessionKey, condition)
|
||||
|
||||
issues.html.list(
|
||||
searchIssue(owner, repoName, condition, filter, userName, (page - 1) * IssueLimit, IssueLimit),
|
||||
searchIssue(condition, filterUser, false, (page - 1) * IssueLimit, IssueLimit, owner -> repoName),
|
||||
page,
|
||||
(getCollaborators(owner, repoName) :+ owner).sorted,
|
||||
getMilestones(owner, repoName),
|
||||
getLabels(owner, repoName),
|
||||
countIssue(owner, repoName, condition.copy(state = "open"), filter, userName),
|
||||
countIssue(owner, repoName, condition.copy(state = "closed"), filter, userName),
|
||||
countIssue(owner, repoName, condition, "all", None),
|
||||
context.loginAccount.map(x => countIssue(owner, repoName, condition, "assigned", Some(x.userName))),
|
||||
context.loginAccount.map(x => countIssue(owner, repoName, condition, "created_by", Some(x.userName))),
|
||||
countIssueGroupByLabels(owner, repoName, condition, filter, userName),
|
||||
countIssue(condition.copy(state = "open"), filterUser, false, owner -> repoName),
|
||||
countIssue(condition.copy(state = "closed"), filterUser, false, owner -> repoName),
|
||||
countIssue(condition, Map.empty, false, owner -> repoName),
|
||||
context.loginAccount.map(x => countIssue(condition, Map("assigned" -> x.userName), false, owner -> repoName)),
|
||||
context.loginAccount.map(x => countIssue(condition, Map("created_by" -> x.userName), false, owner -> repoName)),
|
||||
countIssueGroupByLabels(owner, repoName, condition, filterUser),
|
||||
condition,
|
||||
filter,
|
||||
repository,
|
||||
|
||||
400
src/main/scala/app/PullRequestsController.scala
Normal file
400
src/main/scala/app/PullRequestsController.scala
Normal file
@@ -0,0 +1,400 @@
|
||||
package app
|
||||
|
||||
import util.{LockUtil, CollaboratorsAuthenticator, JGitUtil, ReferrerAuthenticator}
|
||||
import util.Directory._
|
||||
import util.Implicits._
|
||||
import service._
|
||||
import org.eclipse.jgit.api.Git
|
||||
import jp.sf.amateras.scalatra.forms._
|
||||
import org.eclipse.jgit.transport.RefSpec
|
||||
import org.apache.commons.io.FileUtils
|
||||
import scala.collection.JavaConverters._
|
||||
import org.eclipse.jgit.lib.PersonIdent
|
||||
import org.eclipse.jgit.api.MergeCommand.FastForwardMode
|
||||
import service.IssuesService._
|
||||
import service.PullRequestService._
|
||||
import util.JGitUtil.DiffInfo
|
||||
import scala.Some
|
||||
import service.RepositoryService.RepositoryTreeNode
|
||||
import util.JGitUtil.CommitInfo
|
||||
|
||||
class PullRequestsController extends PullRequestsControllerBase
|
||||
with RepositoryService with AccountService with IssuesService with PullRequestService with MilestonesService with ActivityService
|
||||
with ReferrerAuthenticator with CollaboratorsAuthenticator
|
||||
|
||||
trait PullRequestsControllerBase extends ControllerBase {
|
||||
self: RepositoryService with IssuesService with MilestonesService with ActivityService with PullRequestService
|
||||
with ReferrerAuthenticator with CollaboratorsAuthenticator =>
|
||||
|
||||
val pullRequestForm = mapping(
|
||||
"title" -> trim(label("Title" , text(required, maxlength(100)))),
|
||||
"content" -> trim(label("Content", optional(text()))),
|
||||
"targetUserName" -> trim(text(required, maxlength(100))),
|
||||
"targetBranch" -> trim(text(required, maxlength(100))),
|
||||
"requestUserName" -> trim(text(required, maxlength(100))),
|
||||
"requestBranch" -> trim(text(required, maxlength(100))),
|
||||
"commitIdFrom" -> trim(text(required, maxlength(40))),
|
||||
"commitIdTo" -> trim(text(required, maxlength(40)))
|
||||
)(PullRequestForm.apply)
|
||||
|
||||
val mergeForm = mapping(
|
||||
"message" -> trim(label("Message", text(required)))
|
||||
)(MergeForm.apply)
|
||||
|
||||
case class PullRequestForm(
|
||||
title: String,
|
||||
content: Option[String],
|
||||
targetUserName: String,
|
||||
targetBranch: String,
|
||||
requestUserName: String,
|
||||
requestBranch: String,
|
||||
commitIdFrom: String,
|
||||
commitIdTo: String)
|
||||
|
||||
case class MergeForm(message: String)
|
||||
|
||||
get("/:owner/:repository/pulls")(referrersOnly { repository =>
|
||||
searchPullRequests(None, repository)
|
||||
})
|
||||
|
||||
get("/:owner/:repository/pulls/:userName")(referrersOnly { repository =>
|
||||
searchPullRequests(Some(params("userName")), repository)
|
||||
})
|
||||
|
||||
get("/:owner/:repository/pull/:id")(referrersOnly { repository =>
|
||||
val owner = repository.owner
|
||||
val name = repository.name
|
||||
val issueId = params("id").toInt
|
||||
|
||||
getPullRequest(owner, name, issueId) map { case(issue, pullreq) =>
|
||||
JGitUtil.withGit(getRepositoryDir(owner, name)){ git =>
|
||||
val requestCommitId = git.getRepository.resolve(pullreq.requestBranch)
|
||||
|
||||
val (commits, diffs) =
|
||||
getRequestCompareInfo(owner, name, pullreq.commitIdFrom, owner, name, pullreq.commitIdTo)
|
||||
|
||||
pulls.html.pullreq(
|
||||
issue, pullreq,
|
||||
getComments(owner, name, issueId.toInt),
|
||||
(getCollaborators(owner, name) :+ owner).sorted,
|
||||
getMilestonesWithIssueCount(owner, name),
|
||||
commits,
|
||||
diffs,
|
||||
requestCommitId.getName,
|
||||
if(issue.closed){
|
||||
false
|
||||
} else {
|
||||
checkConflict(owner, name, pullreq.branch, owner, name, pullreq.requestBranch)
|
||||
},
|
||||
hasWritePermission(owner, name, context.loginAccount),
|
||||
repository,
|
||||
s"${baseUrl}${context.path}/git/${pullreq.requestUserName}/${pullreq.requestRepositoryName}.git")
|
||||
}
|
||||
|
||||
} getOrElse NotFound
|
||||
})
|
||||
|
||||
post("/:owner/:repository/pull/:id/merge", mergeForm)(collaboratorsOnly { (form, repository) =>
|
||||
LockUtil.lock(s"${repository.owner}/${repository.name}/merge"){
|
||||
val issueId = params("id").toInt
|
||||
|
||||
getPullRequest(repository.owner, repository.name, issueId).map { case (issue, pullreq) =>
|
||||
val remote = getRepositoryDir(repository.owner, repository.name)
|
||||
val tmpdir = new java.io.File(getTemporaryDir(repository.owner, repository.name), s"merge-${issueId}")
|
||||
val git = Git.cloneRepository.setDirectory(tmpdir).setURI(remote.toURI.toString).call
|
||||
|
||||
try {
|
||||
// mark issue as merged and close.
|
||||
val loginAccount = context.loginAccount.get
|
||||
createComment(repository.owner, repository.name, loginAccount.userName, issueId, "Merge", "merge")
|
||||
createComment(repository.owner, repository.name, loginAccount.userName, issueId, "Close", "close")
|
||||
updateClosed(repository.owner, repository.name, issueId, true)
|
||||
recordMergeActivity(repository.owner, repository.name, loginAccount.userName, issueId, form.message)
|
||||
|
||||
// fetch pull request to working repository
|
||||
val pullRequestBranchName = s"gitbucket-pullrequest-${issueId}"
|
||||
|
||||
git.fetch
|
||||
.setRemote(getRepositoryDir(repository.owner, repository.name).toURI.toString)
|
||||
.setRefSpecs(new RefSpec(s"refs/pull/${issueId}/head:refs/heads/${pullRequestBranchName}")).call
|
||||
|
||||
// merge pull request
|
||||
git.checkout.setName(pullreq.branch).call
|
||||
|
||||
val result = git.merge
|
||||
.include(git.getRepository.resolve(pullRequestBranchName))
|
||||
.setFastForward(FastForwardMode.NO_FF)
|
||||
.setCommit(false)
|
||||
.call
|
||||
|
||||
if(result.getConflicts != null){
|
||||
throw new RuntimeException("This pull request can't merge automatically.")
|
||||
}
|
||||
|
||||
// merge commit
|
||||
git.getRepository.writeMergeCommitMsg(
|
||||
s"Merge pull request #${issueId} from ${pullreq.requestUserName}/${pullreq.requestRepositoryName}\n"
|
||||
+ form.message)
|
||||
|
||||
git.commit
|
||||
.setCommitter(new PersonIdent(loginAccount.userName, loginAccount.mailAddress))
|
||||
.call
|
||||
|
||||
// push
|
||||
git.push.call
|
||||
|
||||
val (commits, _) = getRequestCompareInfo(repository.owner, repository.name, pullreq.commitIdFrom,
|
||||
pullreq.requestUserName, pullreq.requestRepositoryName, pullreq.commitIdTo)
|
||||
|
||||
commits.flatten.foreach { commit =>
|
||||
if(!existsCommitId(repository.owner, repository.name, commit.id)){
|
||||
insertCommitId(repository.owner, repository.name, commit.id)
|
||||
}
|
||||
}
|
||||
|
||||
redirect(s"/${repository.owner}/${repository.name}/pull/${issueId}")
|
||||
|
||||
} finally {
|
||||
git.getRepository.close
|
||||
FileUtils.deleteDirectory(tmpdir)
|
||||
}
|
||||
} getOrElse NotFound
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Checks whether conflict will be caused in merging.
|
||||
* Returns true if conflict will be caused.
|
||||
*/
|
||||
private def checkConflict(userName: String, repositoryName: String, branch: String,
|
||||
requestUserName: String, requestRepositoryName: String, requestBranch: String): Boolean = {
|
||||
// TODO Are there more quick way?
|
||||
LockUtil.lock(s"${userName}/${repositoryName}/merge-check"){
|
||||
val remote = getRepositoryDir(userName, repositoryName)
|
||||
val tmpdir = new java.io.File(getTemporaryDir(userName, repositoryName), "merge-check")
|
||||
if(tmpdir.exists()){
|
||||
FileUtils.deleteDirectory(tmpdir)
|
||||
}
|
||||
|
||||
val git = Git.cloneRepository.setDirectory(tmpdir).setURI(remote.toURI.toString).call
|
||||
try {
|
||||
git.checkout.setName(branch).call
|
||||
|
||||
git.fetch
|
||||
.setRemote(getRepositoryDir(requestUserName, requestRepositoryName).toURI.toString)
|
||||
.setRefSpecs(new RefSpec(s"refs/heads/${branch}:refs/heads/${requestBranch}")).call
|
||||
|
||||
val result = git.merge
|
||||
.include(git.getRepository.resolve("FETCH_HEAD"))
|
||||
.setCommit(false).call
|
||||
|
||||
result.getConflicts != null
|
||||
|
||||
} finally {
|
||||
git.getRepository.close
|
||||
FileUtils.deleteDirectory(tmpdir)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get("/:owner/:repository/compare")(collaboratorsOnly { forkedRepository =>
|
||||
(forkedRepository.repository.originUserName, forkedRepository.repository.originRepositoryName) match {
|
||||
case (Some(originUserName), Some(originRepositoryName)) => {
|
||||
getRepository(originUserName, originRepositoryName, baseUrl).map { originRepository =>
|
||||
withGit(
|
||||
getRepositoryDir(originUserName, originRepositoryName),
|
||||
getRepositoryDir(forkedRepository.owner, forkedRepository.name)
|
||||
){ (oldGit, newGit) =>
|
||||
val oldBranch = JGitUtil.getDefaultBranch(oldGit, originRepository).get._2
|
||||
val newBranch = JGitUtil.getDefaultBranch(newGit, forkedRepository).get._2
|
||||
|
||||
redirect(s"${context.path}/${forkedRepository.owner}/${forkedRepository.name}/compare/${originUserName}:${oldBranch}...${newBranch}")
|
||||
}
|
||||
} getOrElse NotFound
|
||||
}
|
||||
case _ => {
|
||||
JGitUtil.withGit(getRepositoryDir(forkedRepository.owner, forkedRepository.name)){ git =>
|
||||
val defaultBranch = JGitUtil.getDefaultBranch(git, forkedRepository).get._2
|
||||
redirect(s"${context.path}/${forkedRepository.owner}/${forkedRepository.name}/compare/${defaultBranch}...${defaultBranch}")
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
get("/:owner/:repository/compare/*...*")(collaboratorsOnly { repository =>
|
||||
val Seq(origin, forked) = multiParams("splat")
|
||||
val (originOwner, tmpOriginBranch) = parseCompareIdentifie(origin, repository.owner)
|
||||
val (forkedOwner, tmpForkedBranch) = parseCompareIdentifie(forked, repository.owner)
|
||||
|
||||
(getRepository(originOwner, repository.name, baseUrl),
|
||||
getRepository(forkedOwner, repository.name, baseUrl)) match {
|
||||
case (Some(originRepository), Some(forkedRepository)) => {
|
||||
withGit(
|
||||
getRepositoryDir(originOwner, repository.name),
|
||||
getRepositoryDir(forkedOwner, repository.name)
|
||||
){ case (oldGit, newGit) =>
|
||||
val originBranch = JGitUtil.getDefaultBranch(oldGit, originRepository, tmpOriginBranch).get._2
|
||||
val forkedBranch = JGitUtil.getDefaultBranch(newGit, forkedRepository, tmpForkedBranch).get._2
|
||||
|
||||
val forkedId = getForkedCommitId(oldGit, newGit,
|
||||
originOwner, repository.name, originBranch,
|
||||
forkedOwner, repository.name, forkedBranch)
|
||||
|
||||
val oldId = oldGit.getRepository.resolve(forkedId)
|
||||
val newId = newGit.getRepository.resolve(forkedBranch)
|
||||
|
||||
val (commits, diffs) = getRequestCompareInfo(
|
||||
originOwner, repository.name, oldId.getName,
|
||||
forkedOwner, repository.name, newId.getName)
|
||||
|
||||
pulls.html.compare(
|
||||
commits,
|
||||
diffs,
|
||||
repository.repository.originUserName.map { userName =>
|
||||
getRepositoryNames(getForkedRepositoryTree(userName, repository.name))
|
||||
} getOrElse Nil,
|
||||
originBranch,
|
||||
forkedBranch,
|
||||
oldId.getName,
|
||||
newId.getName,
|
||||
checkConflict(originOwner, repository.name, originBranch, forkedOwner, repository.name, forkedBranch),
|
||||
repository,
|
||||
originRepository,
|
||||
forkedRepository)
|
||||
}
|
||||
}
|
||||
case _ => NotFound
|
||||
}
|
||||
})
|
||||
|
||||
post("/:owner/:repository/pulls/new", pullRequestForm)(referrersOnly { (form, repository) =>
|
||||
val loginUserName = context.loginAccount.get.userName
|
||||
|
||||
val issueId = createIssue(
|
||||
owner = repository.owner,
|
||||
repository = repository.name,
|
||||
loginUser = loginUserName,
|
||||
title = form.title,
|
||||
content = form.content,
|
||||
assignedUserName = None,
|
||||
milestoneId = None,
|
||||
isPullRequest = true)
|
||||
|
||||
createPullRequest(
|
||||
originUserName = repository.owner,
|
||||
originRepositoryName = repository.name,
|
||||
issueId = issueId,
|
||||
originBranch = form.targetBranch,
|
||||
requestUserName = form.requestUserName,
|
||||
requestRepositoryName = repository.name,
|
||||
requestBranch = form.requestBranch,
|
||||
commitIdFrom = form.commitIdFrom,
|
||||
commitIdTo = form.commitIdTo)
|
||||
|
||||
// fetch requested branch
|
||||
JGitUtil.withGit(getRepositoryDir(repository.owner, repository.name)){ git =>
|
||||
git.fetch
|
||||
.setRemote(getRepositoryDir(form.requestUserName, repository.name).toURI.toString)
|
||||
.setRefSpecs(new RefSpec(s"refs/heads/${form.requestBranch}:refs/pull/${issueId}/head"))
|
||||
.call
|
||||
}
|
||||
|
||||
recordPullRequestActivity(repository.owner, repository.name, loginUserName, issueId, form.title)
|
||||
|
||||
redirect(s"/${repository.owner}/${repository.name}/pulls/${issueId}")
|
||||
})
|
||||
|
||||
/**
|
||||
* Handles w Git object simultaneously.
|
||||
*/
|
||||
private def withGit[T](oldDir: java.io.File, newDir: java.io.File)(action: (Git, Git) => T): T = {
|
||||
val oldGit = Git.open(oldDir)
|
||||
val newGit = Git.open(newDir)
|
||||
try {
|
||||
action(oldGit, newGit)
|
||||
} finally {
|
||||
oldGit.getRepository.close
|
||||
newGit.getRepository.close
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses branch identifier and extracts owner and branch name as tuple.
|
||||
*
|
||||
* - "owner:branch" to ("owner", "branch")
|
||||
* - "branch" to ("defaultOwner", "branch")
|
||||
*/
|
||||
private def parseCompareIdentifie(value: String, defaultOwner: String): (String, String) =
|
||||
if(value.contains(':')){
|
||||
val array = value.split(":")
|
||||
(array(0), array(1))
|
||||
} else {
|
||||
(defaultOwner, value)
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts all repository names from [[service.RepositoryService.RepositoryTreeNode]] as flat list.
|
||||
*/
|
||||
private def getRepositoryNames(node: RepositoryTreeNode): List[String] =
|
||||
node.owner :: node.children.map { child => getRepositoryNames(child) }.flatten
|
||||
|
||||
/**
|
||||
* Returns the identifier of the root commit (or latest merge commit) of the specified branch.
|
||||
*/
|
||||
private def getForkedCommitId(oldGit: Git, newGit: Git, userName: String, repositoryName: String, branch: String,
|
||||
requestUserName: String, requestRepositoryName: String, requestBranch: String): String =
|
||||
JGitUtil.getCommitLogs(newGit, requestBranch, true){ commit =>
|
||||
existsCommitId(userName, repositoryName, commit.getName) &&
|
||||
JGitUtil.getBranchesOfCommit(oldGit, commit.getName).contains(branch)
|
||||
}.head.id
|
||||
|
||||
private def getRequestCompareInfo(userName: String, repositoryName: String, branch: String,
|
||||
requestUserName: String, requestRepositoryName: String, requestCommitId: String): (Seq[Seq[CommitInfo]], Seq[DiffInfo]) = {
|
||||
|
||||
withGit(
|
||||
getRepositoryDir(userName, repositoryName),
|
||||
getRepositoryDir(requestUserName, requestRepositoryName)
|
||||
){ (oldGit, newGit) =>
|
||||
val oldId = oldGit.getRepository.resolve(branch)
|
||||
val newId = newGit.getRepository.resolve(requestCommitId)
|
||||
|
||||
val commits = newGit.log.addRange(oldId, newId).call.iterator.asScala.map { revCommit =>
|
||||
new CommitInfo(revCommit)
|
||||
}.toList.splitWith{ (commit1, commit2) =>
|
||||
view.helpers.date(commit1.time) == view.helpers.date(commit2.time)
|
||||
}
|
||||
|
||||
val diffs = JGitUtil.getDiffs(newGit, oldId.getName, newId.getName, true)
|
||||
|
||||
(commits, diffs)
|
||||
}
|
||||
}
|
||||
|
||||
private def searchPullRequests(userName: Option[String], repository: RepositoryService.RepositoryInfo) = {
|
||||
val owner = repository.owner
|
||||
val repoName = repository.name
|
||||
val filterUser = userName.map { x => Map("created_by" -> x) } getOrElse Map("all" -> "")
|
||||
val page = IssueSearchCondition.page(request)
|
||||
val sessionKey = s"${owner}/${repoName}/pulls"
|
||||
|
||||
// retrieve search condition
|
||||
val condition = if(request.getQueryString == null){
|
||||
session.get(sessionKey).getOrElse(IssueSearchCondition()).asInstanceOf[IssueSearchCondition]
|
||||
} else IssueSearchCondition(request)
|
||||
|
||||
session.put(sessionKey, condition)
|
||||
|
||||
pulls.html.list(
|
||||
searchIssue(condition, filterUser, true, (page - 1) * PullRequestLimit, PullRequestLimit, owner -> repoName),
|
||||
getPullRequestCount(condition.state == "closed", Some(owner, repoName)),
|
||||
userName,
|
||||
page,
|
||||
countIssue(condition.copy(state = "open"), filterUser, true, owner -> repoName),
|
||||
countIssue(condition.copy(state = "closed"), filterUser, true, owner -> repoName),
|
||||
countIssue(condition, Map.empty, true, owner -> repoName),
|
||||
condition,
|
||||
repository,
|
||||
hasWritePermission(owner, repoName, context.loginAccount))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -45,7 +45,15 @@ trait RepositorySettingsControllerBase extends ControllerBase with FlashMapSuppo
|
||||
* Save the repository options.
|
||||
*/
|
||||
post("/:owner/:repository/settings/options", optionsForm)(ownerOnly { (form, repository) =>
|
||||
saveRepositoryOptions(repository.owner, repository.name, form.description, form.defaultBranch, form.isPrivate)
|
||||
saveRepositoryOptions(
|
||||
repository.owner,
|
||||
repository.name,
|
||||
form.description,
|
||||
form.defaultBranch,
|
||||
repository.repository.parentUserName.map { _ =>
|
||||
repository.repository.isPrivate
|
||||
} getOrElse form.isPrivate
|
||||
)
|
||||
flash += "info" -> "Repository settings has been updated."
|
||||
redirect(s"/${repository.owner}/${repository.name}/settings/options")
|
||||
})
|
||||
|
||||
@@ -37,49 +37,29 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
fileList(_)
|
||||
})
|
||||
|
||||
/**
|
||||
* Displays the file list of the repository root and the specified branch.
|
||||
*/
|
||||
get("/:owner/:repository/tree/:id")(referrersOnly {
|
||||
fileList(_, params("id"))
|
||||
})
|
||||
|
||||
/**
|
||||
* Displays the file list of the specified path and branch.
|
||||
*/
|
||||
get("/:owner/:repository/tree/:id/*")(referrersOnly {
|
||||
fileList(_, params("id"), multiParams("splat").head)
|
||||
})
|
||||
|
||||
/**
|
||||
* Displays the commit list of the specified branch.
|
||||
*/
|
||||
get("/:owner/:repository/commits/:branch")(referrersOnly { repository =>
|
||||
val branchName = params("branch")
|
||||
val page = params.getOrElse("page", "1").toInt
|
||||
JGitUtil.withGit(getRepositoryDir(repository.owner, repository.name)){ git =>
|
||||
JGitUtil.getCommitLog(git, branchName, page, 30) match {
|
||||
case Right((logs, hasNext)) =>
|
||||
repo.html.commits(Nil, branchName, repository, logs.splitWith{ (commit1, commit2) =>
|
||||
view.helpers.date(commit1.time) == view.helpers.date(commit2.time)
|
||||
}, page, hasNext)
|
||||
case Left(_) => NotFound
|
||||
}
|
||||
get("/:owner/:repository/tree/*")(referrersOnly { repository =>
|
||||
val (id, path) = splitPath(repository, multiParams("splat").head)
|
||||
if(path.isEmpty){
|
||||
fileList(repository, id)
|
||||
} else {
|
||||
fileList(repository, id, path)
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Displays the commit list of the specified resource.
|
||||
*/
|
||||
get("/:owner/:repository/commits/:branch/*")(referrersOnly { repository =>
|
||||
val branchName = params("branch")
|
||||
val path = multiParams("splat").head //.replaceFirst("^tree/.+?/", "")
|
||||
get("/:owner/:repository/commits/*")(referrersOnly { repository =>
|
||||
val (branchName, path) = splitPath(repository, multiParams("splat").head)
|
||||
val page = params.getOrElse("page", "1").toInt
|
||||
|
||||
JGitUtil.withGit(getRepositoryDir(repository.owner, repository.name)){ git =>
|
||||
JGitUtil.getCommitLog(git, branchName, page, 30, path) match {
|
||||
case Right((logs, hasNext)) =>
|
||||
repo.html.commits(path.split("/").toList, branchName, repository,
|
||||
repo.html.commits(if(path.isEmpty) Nil else path.split("/").toList, branchName, repository,
|
||||
logs.splitWith{ (commit1, commit2) =>
|
||||
view.helpers.date(commit1.time) == view.helpers.date(commit2.time)
|
||||
}, page, hasNext)
|
||||
@@ -91,10 +71,9 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
/**
|
||||
* Displays the file content of the specified branch or commit.
|
||||
*/
|
||||
get("/:owner/:repository/blob/:id/*")(referrersOnly { repository =>
|
||||
val id = params("id") // branch name or commit id
|
||||
get("/:owner/:repository/blob/*")(referrersOnly { repository =>
|
||||
val (id, path) = splitPath(repository, multiParams("splat").head)
|
||||
val raw = params.get("raw").getOrElse("false").toBoolean
|
||||
val path = multiParams("splat").head //.replaceFirst("^tree/.+?/", "")
|
||||
|
||||
JGitUtil.withGit(getRepositoryDir(repository.owner, repository.name)){ git =>
|
||||
val revCommit = JGitUtil.getRevCommitFromId(git, git.getRepository.resolve(id))
|
||||
@@ -203,6 +182,24 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
}
|
||||
})
|
||||
|
||||
get("/:owner/:repository/network/members")(referrersOnly { repository =>
|
||||
repo.html.forked(
|
||||
getForkedRepositoryTree(
|
||||
repository.repository.originUserName.getOrElse(repository.owner),
|
||||
repository.repository.originRepositoryName.getOrElse(repository.name)),
|
||||
repository)
|
||||
})
|
||||
|
||||
private def splitPath(repository: service.RepositoryService.RepositoryInfo, path: String): (String, String) = {
|
||||
val id = repository.branchList.collectFirst {
|
||||
case branch if(path == branch || path.startsWith(branch + "/")) => branch
|
||||
} orElse repository.tags.collectFirst {
|
||||
case tag if(path == tag.name || path.startsWith(tag.name + "/")) => tag.name
|
||||
} orElse Some(path) get
|
||||
|
||||
(id, path.substring(id.length).replaceFirst("^/", ""))
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides HTML of the file list.
|
||||
*
|
||||
@@ -218,7 +215,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
JGitUtil.withGit(getRepositoryDir(repository.owner, repository.name)){ git =>
|
||||
val revisions = Seq(if(revstr.isEmpty) repository.repository.defaultBranch else revstr, repository.branchList.head)
|
||||
// get specified commit
|
||||
revisions.map { rev => (git.getRepository.resolve(rev), rev)}.find(_._1 != null).map { case (objectId, revision) =>
|
||||
JGitUtil.getDefaultBranch(git, repository, revstr).map { case (objectId, revision) =>
|
||||
val revCommit = JGitUtil.getRevCommitFromId(git, objectId)
|
||||
|
||||
// get files
|
||||
|
||||
@@ -22,7 +22,7 @@ trait SearchControllerBase extends ControllerBase { self: RepositoryService
|
||||
case class SearchForm(query: String, owner: String, repository: String)
|
||||
|
||||
post("/search", searchForm){ form =>
|
||||
redirect(s"${form.owner}/${form.repository}/search?q=${StringUtil.urlEncode(form.query)}")
|
||||
redirect(s"/${form.owner}/${form.repository}/search?q=${StringUtil.urlEncode(form.query)}")
|
||||
}
|
||||
|
||||
get("/:owner/:repository/search")(referrersOnly { repository =>
|
||||
|
||||
@@ -59,7 +59,7 @@ trait WikiControllerBase extends ControllerBase {
|
||||
val commitId = params("commitId").split("\\.\\.\\.")
|
||||
|
||||
JGitUtil.withGit(getWikiRepositoryDir(repository.owner, repository.name)){ git =>
|
||||
wiki.html.compare(Some(pageName), getWikiDiffs(git, commitId(0), commitId(1)), repository)
|
||||
wiki.html.compare(Some(pageName), JGitUtil.getDiffs(git, commitId(0), commitId(1), true), repository)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -67,7 +67,7 @@ trait WikiControllerBase extends ControllerBase {
|
||||
val commitId = params("commitId").split("\\.\\.\\.")
|
||||
|
||||
JGitUtil.withGit(getWikiRepositoryDir(repository.owner, repository.name)){ git =>
|
||||
wiki.html.compare(None, getWikiDiffs(git, commitId(0), commitId(1)), repository)
|
||||
wiki.html.compare(None, JGitUtil.getDiffs(git, commitId(0), commitId(1), true), repository)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -106,8 +106,9 @@ trait WikiControllerBase extends ControllerBase {
|
||||
|
||||
get("/:owner/:repository/wiki/:page/_delete")(collaboratorsOnly { repository =>
|
||||
val pageName = StringUtil.urlDecode(params("page"))
|
||||
val account = context.loginAccount.get
|
||||
|
||||
deleteWikiPage(repository.owner, repository.name, pageName, context.loginAccount.get.userName, s"Delete ${pageName}")
|
||||
deleteWikiPage(repository.owner, repository.name, pageName, account.userName, account.mailAddress, s"Delete ${pageName}")
|
||||
updateLastActivityDate(repository.owner, repository.name)
|
||||
|
||||
redirect(s"/${repository.owner}/${repository.name}/wiki")
|
||||
|
||||
@@ -7,6 +7,11 @@ object IssueId extends Table[(String, String, Int)]("ISSUE_ID") with IssueTempla
|
||||
def byPrimaryKey(owner: String, repository: String) = byRepository(owner, repository)
|
||||
}
|
||||
|
||||
object IssueOutline extends Table[(String, String, Int, Int)]("ISSUE_OUTLINE_VIEW") with IssueTemplate {
|
||||
def commentCount = column[Int]("COMMENT_COUNT")
|
||||
def * = userName ~ repositoryName ~ issueId ~ commentCount
|
||||
}
|
||||
|
||||
object Issues extends Table[Issue]("ISSUE") with IssueTemplate with MilestoneTemplate {
|
||||
def openedUserName = column[String]("OPENED_USER_NAME")
|
||||
def assignedUserName = column[String]("ASSIGNED_USER_NAME")
|
||||
@@ -15,7 +20,8 @@ object Issues extends Table[Issue]("ISSUE") with IssueTemplate with MilestoneTem
|
||||
def closed = column[Boolean]("CLOSED")
|
||||
def registeredDate = column[java.util.Date]("REGISTERED_DATE")
|
||||
def updatedDate = column[java.util.Date]("UPDATED_DATE")
|
||||
def * = userName ~ repositoryName ~ issueId ~ openedUserName ~ milestoneId.? ~ assignedUserName.? ~ title ~ content.? ~ closed ~ registeredDate ~ updatedDate <> (Issue, Issue.unapply _)
|
||||
def pullRequest = column[Boolean]("PULL_REQUEST")
|
||||
def * = userName ~ repositoryName ~ issueId ~ openedUserName ~ milestoneId.? ~ assignedUserName.? ~ title ~ content.? ~ closed ~ registeredDate ~ updatedDate ~ pullRequest <> (Issue, Issue.unapply _)
|
||||
|
||||
def byPrimaryKey(owner: String, repository: String, issueId: Int) = byIssue(owner, repository, issueId)
|
||||
}
|
||||
@@ -31,4 +37,5 @@ case class Issue(
|
||||
content: Option[String],
|
||||
closed: Boolean,
|
||||
registeredDate: java.util.Date,
|
||||
updatedDate: java.util.Date)
|
||||
updatedDate: java.util.Date,
|
||||
isPullRequest: Boolean)
|
||||
28
src/main/scala/model/PullRequest.scala
Normal file
28
src/main/scala/model/PullRequest.scala
Normal file
@@ -0,0 +1,28 @@
|
||||
package model
|
||||
|
||||
import scala.slick.driver.H2Driver.simple._
|
||||
|
||||
object PullRequests extends Table[PullRequest]("PULL_REQUEST") with IssueTemplate {
|
||||
def branch = column[String]("BRANCH")
|
||||
def requestUserName = column[String]("REQUEST_USER_NAME")
|
||||
def requestRepositoryName = column[String]("REQUEST_REPOSITORY_NAME")
|
||||
def requestBranch = column[String]("REQUEST_BRANCH")
|
||||
def commitIdFrom = column[String]("COMMIT_ID_FROM")
|
||||
def commitIdTo = column[String]("COMMIT_ID_TO")
|
||||
def * = userName ~ repositoryName ~ issueId ~ branch ~ requestUserName ~ requestRepositoryName ~ requestBranch ~ commitIdFrom ~ commitIdTo <> (PullRequest, PullRequest.unapply _)
|
||||
|
||||
def byPrimaryKey(userName: String, repositoryName: String, issueId: Int) = byIssue(userName, repositoryName, issueId)
|
||||
def byPrimaryKey(userName: Column[String], repositoryName: Column[String], issueId: Column[Int]) = byIssue(userName, repositoryName, issueId)
|
||||
}
|
||||
|
||||
case class PullRequest(
|
||||
userName: String,
|
||||
repositoryName: String,
|
||||
issueId: Int,
|
||||
branch: String,
|
||||
requestUserName: String,
|
||||
requestRepositoryName: String,
|
||||
requestBranch: String,
|
||||
commitIdFrom: String,
|
||||
commitIdTo: String
|
||||
)
|
||||
@@ -9,7 +9,11 @@ object Repositories extends Table[Repository]("REPOSITORY") with BasicTemplate {
|
||||
def registeredDate = column[java.util.Date]("REGISTERED_DATE")
|
||||
def updatedDate = column[java.util.Date]("UPDATED_DATE")
|
||||
def lastActivityDate = column[java.util.Date]("LAST_ACTIVITY_DATE")
|
||||
def * = userName ~ repositoryName ~ isPrivate ~ description.? ~ defaultBranch ~ registeredDate ~ updatedDate ~ lastActivityDate <> (Repository, Repository.unapply _)
|
||||
def originUserName = column[String]("ORIGIN_USER_NAME")
|
||||
def originRepositoryName = column[String]("ORIGIN_REPOSITORY_NAME")
|
||||
def parentUserName = column[String]("PARENT_USER_NAME")
|
||||
def parentRepositoryName = column[String]("PARENT_REPOSITORY_NAME")
|
||||
def * = userName ~ repositoryName ~ isPrivate ~ description.? ~ defaultBranch ~ registeredDate ~ updatedDate ~ lastActivityDate ~ originUserName.? ~ originRepositoryName.? ~ parentUserName.? ~ parentRepositoryName.? <> (Repository, Repository.unapply _)
|
||||
|
||||
def byPrimaryKey(owner: String, repository: String) = byRepository(owner, repository)
|
||||
}
|
||||
@@ -22,5 +26,9 @@ case class Repository(
|
||||
defaultBranch: String,
|
||||
registeredDate: java.util.Date,
|
||||
updatedDate: java.util.Date,
|
||||
lastActivityDate: java.util.Date
|
||||
lastActivityDate: java.util.Date,
|
||||
originUserName: Option[String],
|
||||
originRepositoryName: Option[String],
|
||||
parentUserName: Option[String],
|
||||
parentRepositoryName: Option[String]
|
||||
)
|
||||
|
||||
@@ -103,6 +103,27 @@ trait ActivityService {
|
||||
None,
|
||||
currentDate)
|
||||
|
||||
def recordForkActivity(userName: String, repositoryName: String, activityUserName: String) =
|
||||
Activities.autoInc insert(userName, repositoryName, activityUserName,
|
||||
"fork",
|
||||
s"[user:${activityUserName}] forked [repo:${userName}/${repositoryName}] to [repo:${activityUserName}/${repositoryName}]",
|
||||
None,
|
||||
currentDate)
|
||||
|
||||
def recordPullRequestActivity(userName: String, repositoryName: String, activityUserName: String, issueId: Int, title: String): Unit =
|
||||
Activities.autoInc insert(userName, repositoryName, activityUserName,
|
||||
"open_pullreq",
|
||||
s"[user:${activityUserName}] opened pull request [pullreq:${userName}/${repositoryName}#${issueId}]",
|
||||
Some(title),
|
||||
currentDate)
|
||||
|
||||
def recordMergeActivity(userName: String, repositoryName: String, activityUserName: String, issueId: Int, message: String): Unit =
|
||||
Activities.autoInc insert(userName, repositoryName, activityUserName,
|
||||
"merge_pullreq",
|
||||
s"[user:${activityUserName}] merged pull request [pullreq:${userName}/${repositoryName}#${issueId}]",
|
||||
Some(message),
|
||||
currentDate)
|
||||
|
||||
def insertCommitId(userName: String, repositoryName: String, commitId: String) = {
|
||||
CommitLog insert (userName, repositoryName, commitId)
|
||||
}
|
||||
|
||||
@@ -42,18 +42,18 @@ trait IssuesService {
|
||||
/**
|
||||
* Returns the count of the search result against issues.
|
||||
*
|
||||
* @param owner the repository owner
|
||||
* @param repository the repository name
|
||||
* @param condition the search condition
|
||||
* @param filter the filter type ("all", "assigned" or "created_by")
|
||||
* @param userName the filter user name required for "assigned" and "created_by"
|
||||
* @param filterUser the filter user name (key is "all", "assigned" or "created_by", value is the user name)
|
||||
* @param onlyPullRequest if true then counts only pull request, false then counts both of issue and pull request.
|
||||
* @param repos Tuple of the repository owner and the repository name
|
||||
* @return the count of the search result
|
||||
*/
|
||||
def countIssue(owner: String, repository: String, condition: IssueSearchCondition, filter: String, userName: Option[String]): Int = {
|
||||
def countIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean,
|
||||
repos: (String, String)*): Int = {
|
||||
// TODO It must be _.length instead of map (_.issueId) list).length.
|
||||
// But it does not work on Slick 1.0.1 (worked on Slick 1.0.0).
|
||||
// https://github.com/slick/slick/issues/170
|
||||
(searchIssueQuery(owner, repository, condition, filter, userName) map (_.issueId) list).length
|
||||
(searchIssueQuery(repos, condition, filterUser, onlyPullRequest) map (_.issueId) list).length
|
||||
}
|
||||
/**
|
||||
* Returns the Map which contains issue count for each labels.
|
||||
@@ -61,14 +61,13 @@ trait IssuesService {
|
||||
* @param owner the repository owner
|
||||
* @param repository the repository name
|
||||
* @param condition the search condition
|
||||
* @param filter the filter type ("all", "assigned" or "created_by")
|
||||
* @param userName the filter user name required for "assigned" and "created_by"
|
||||
* @return the Map which contains issue count for each labels (key is label name, value is issue count),
|
||||
* @param filterUser the filter user name (key is "all", "assigned" or "created_by", value is the user name)
|
||||
* @return the Map which contains issue count for each labels (key is label name, value is issue count)
|
||||
*/
|
||||
def countIssueGroupByLabels(owner: String, repository: String, condition: IssueSearchCondition,
|
||||
filter: String, userName: Option[String]): Map[String, Int] = {
|
||||
filterUser: Map[String, String]): Map[String, Int] = {
|
||||
|
||||
searchIssueQuery(owner, repository, condition.copy(labels = Set.empty), filter, userName)
|
||||
searchIssueQuery(Seq(owner -> repository), condition.copy(labels = Set.empty), filterUser, false)
|
||||
.innerJoin(IssueLabels).on { (t1, t2) =>
|
||||
t1.byIssue(t2.userName, t2.repositoryName, t2.issueId)
|
||||
}
|
||||
@@ -83,35 +82,55 @@ trait IssuesService {
|
||||
}
|
||||
.toMap
|
||||
}
|
||||
/**
|
||||
* Returns list which contains issue count for each repository.
|
||||
* If the issue does not exist, its repository is not included in the result.
|
||||
*
|
||||
* @param condition the search condition
|
||||
* @param filterUser the filter user name (key is "all", "assigned" or "created_by", value is the user name)
|
||||
* @param repos Tuple of the repository owner and the repository name
|
||||
* @return list which contains issue count for each repository
|
||||
*/
|
||||
def countIssueGroupByRepository(
|
||||
condition: IssueSearchCondition, filterUser: Map[String, String], repos: (String, String)*): List[(String, String, Int)] = {
|
||||
searchIssueQuery(repos, condition.copy(repo = None), filterUser, false)
|
||||
.groupBy { t =>
|
||||
t.userName ~ t.repositoryName
|
||||
}
|
||||
.map { case (repo, t) =>
|
||||
repo ~ t.length
|
||||
}
|
||||
.filter (_._3 > 0.bind)
|
||||
.list
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the search result against issues.
|
||||
*
|
||||
* @param owner the repository owner
|
||||
* @param repository the repository name
|
||||
* @param condition the search condition
|
||||
* @param filter the filter type ("all", "assigned" or "created_by")
|
||||
* @param userName the filter user name required for "assigned" and "created_by"
|
||||
* @param filterUser the filter user name (key is "all", "assigned" or "created_by", value is the user name)
|
||||
* @param onlyPullRequest if true then returns only pull request, false then returns both of issue and pull request.
|
||||
* @param offset the offset for pagination
|
||||
* @param limit the limit for pagination
|
||||
* @param repos Tuple of the repository owner and the repository name
|
||||
* @return the search result (list of tuples which contain issue, labels and comment count)
|
||||
*/
|
||||
def searchIssue(owner: String, repository: String, condition: IssueSearchCondition,
|
||||
filter: String, userName: Option[String], offset: Int, limit: Int): List[(Issue, List[Label], Int)] = {
|
||||
def searchIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean,
|
||||
offset: Int, limit: Int, repos: (String, String)*): List[(Issue, List[Label], Int)] = {
|
||||
|
||||
// get issues and comment count
|
||||
val issues = searchIssueQuery(owner, repository, condition, filter, userName)
|
||||
.leftJoin(Query(IssueComments)
|
||||
.filter { t =>
|
||||
(t.byRepository(owner, repository)) &&
|
||||
(t.action inSetBind Seq("comment", "close_comment", "reopen_comment"))
|
||||
// get issues and comment count and labels
|
||||
searchIssueQuery(repos, condition, filterUser, onlyPullRequest)
|
||||
.innerJoin(IssueOutline).on { (t1, t2) => t1.byIssue(t2.userName, t2.repositoryName, t2.issueId) }
|
||||
.leftJoin (IssueLabels) .on { case ((t1, t2), t3) => t1.byIssue(t3.userName, t3.repositoryName, t3.issueId) }
|
||||
.leftJoin (Labels) .on { case (((t1, t2), t3), t4) => t3.byLabel(t4.userName, t4.repositoryName, t4.labelId) }
|
||||
.map { case (((t1, t2), t3), t4) =>
|
||||
(t1, t2.commentCount, t4.labelId.?, t4.labelName.?, t4.color.?)
|
||||
}
|
||||
.groupBy { _.issueId }
|
||||
.map { case (issueId, t) => issueId ~ t.length }).on((t1, t2) => t1.issueId is t2._1)
|
||||
.sortBy { case (t1, t2) =>
|
||||
.sortBy(_._4) // labelName
|
||||
.sortBy { case (t1, commentCount, _,_,_) =>
|
||||
(condition.sort match {
|
||||
case "created" => t1.registeredDate
|
||||
case "comments" => t2._2
|
||||
case "comments" => commentCount
|
||||
case "updated" => t1.updatedDate
|
||||
}) match {
|
||||
case sort => condition.direction match {
|
||||
@@ -120,39 +139,40 @@ trait IssuesService {
|
||||
}
|
||||
}
|
||||
}
|
||||
.map { case (t1, t2) => (t1, t2._2.ifNull(0)) }
|
||||
.drop(offset).take(limit)
|
||||
.list
|
||||
|
||||
// get labels
|
||||
val labels = Query(IssueLabels)
|
||||
.innerJoin(Labels).on { (t1, t2) =>
|
||||
t1.byLabel(t2.userName, t2.repositoryName, t2.labelId)
|
||||
}
|
||||
.filter { case (t1, t2) =>
|
||||
(t1.byRepository(owner, repository)) &&
|
||||
(t1.issueId inSetBind (issues.map(_._1.issueId)))
|
||||
}
|
||||
.sortBy { case (t1, t2) => t1.issueId ~ t2.labelName }
|
||||
.map { case (t1, t2) => (t1.issueId, t2) }
|
||||
.list
|
||||
|
||||
issues.map { case (issue, commentCount) =>
|
||||
(issue, labels.collect { case (issueId, labels) if(issueId == issue.issueId) => labels }, commentCount)
|
||||
.splitWith { (c1, c2) =>
|
||||
c1._1.userName == c2._1.userName &&
|
||||
c1._1.repositoryName == c2._1.repositoryName &&
|
||||
c1._1.issueId == c2._1.issueId
|
||||
}
|
||||
.map { issues => issues.head match {
|
||||
case (issue, commentCount, _,_,_) =>
|
||||
(issue,
|
||||
issues.flatMap { t => t._3.map (
|
||||
Label(issue.userName, issue.repositoryName, _, t._4.get, t._5.get)
|
||||
)} toList,
|
||||
commentCount)
|
||||
}} toList
|
||||
}
|
||||
|
||||
/**
|
||||
* Assembles query for conditional issue searching.
|
||||
*/
|
||||
private def searchIssueQuery(owner: String, repository: String, condition: IssueSearchCondition, filter: String, userName: Option[String]) =
|
||||
private def searchIssueQuery(repos: Seq[(String, String)], condition: IssueSearchCondition,
|
||||
filterUser: Map[String, String], onlyPullRequest: Boolean) =
|
||||
Query(Issues) filter { t1 =>
|
||||
(t1.byRepository(owner, repository)) &&
|
||||
condition.repo
|
||||
.map { _.split('/') match { case array => Seq(array(0) -> array(1)) } }
|
||||
.getOrElse (repos)
|
||||
.map { case (owner, repository) => t1.byRepository(owner, repository) }
|
||||
.foldLeft[Column[Boolean]](false) ( _ || _ ) &&
|
||||
(t1.closed is (condition.state == "closed").bind) &&
|
||||
(t1.milestoneId is condition.milestoneId.get.get.bind, condition.milestoneId.flatten.isDefined) &&
|
||||
(t1.milestoneId isNull, condition.milestoneId == Some(None)) &&
|
||||
(t1.assignedUserName is userName.get.bind, filter == "assigned") &&
|
||||
(t1.openedUserName is userName.get.bind, filter == "created_by") &&
|
||||
(t1.assignedUserName is filterUser("assigned").bind, filterUser.get("assigned").isDefined) &&
|
||||
(t1.openedUserName is filterUser("created_by").bind, filterUser.get("created_by").isDefined) &&
|
||||
(t1.pullRequest is true.bind, onlyPullRequest) &&
|
||||
(IssueLabels filter { t2 =>
|
||||
(t2.byIssue(t1.userName, t1.repositoryName, t1.issueId)) &&
|
||||
(t2.labelId in
|
||||
@@ -164,7 +184,7 @@ trait IssuesService {
|
||||
}
|
||||
|
||||
def createIssue(owner: String, repository: String, loginUser: String, title: String, content: Option[String],
|
||||
assignedUserName: Option[String], milestoneId: Option[Int]) =
|
||||
assignedUserName: Option[String], milestoneId: Option[Int], isPullRequest: Boolean = false) =
|
||||
// next id number
|
||||
sql"SELECT ISSUE_ID + 1 FROM ISSUE_ID WHERE USER_NAME = $owner AND REPOSITORY_NAME = $repository FOR UPDATE".as[Int]
|
||||
.firstOption.filter { id =>
|
||||
@@ -179,7 +199,8 @@ trait IssuesService {
|
||||
content,
|
||||
false,
|
||||
currentDate,
|
||||
currentDate)
|
||||
currentDate,
|
||||
isPullRequest)
|
||||
|
||||
// increment issue id
|
||||
IssueId
|
||||
@@ -250,39 +271,44 @@ trait IssuesService {
|
||||
val keywords = splitWords(query.toLowerCase)
|
||||
|
||||
// Search Issue
|
||||
val issues = Query(Issues).filter { t =>
|
||||
val issues = Issues
|
||||
.innerJoin(IssueOutline).on { case (t1, t2) =>
|
||||
t1.byIssue(t2.userName, t2.repositoryName, t2.issueId)
|
||||
}
|
||||
.filter { case (t1, t2) =>
|
||||
keywords.map { keyword =>
|
||||
(t.title.toLowerCase like (s"%${likeEncode(keyword)}%", '^')) ||
|
||||
(t.content.toLowerCase like (s"%${likeEncode(keyword)}%", '^'))
|
||||
(t1.title.toLowerCase like (s"%${likeEncode(keyword)}%", '^')) ||
|
||||
(t1.content.toLowerCase like (s"%${likeEncode(keyword)}%", '^'))
|
||||
} .reduceLeft(_ && _)
|
||||
}.map { t => (t, 0, t.content.?) }
|
||||
}
|
||||
.map { case (t1, t2) =>
|
||||
(t1, 0, t1.content.?, t2.commentCount)
|
||||
}
|
||||
|
||||
// Search IssueComment
|
||||
val comments = Query(IssueComments).innerJoin(Issues).on { case (t1, t2) =>
|
||||
val comments = IssueComments
|
||||
.innerJoin(Issues).on { case (t1, t2) =>
|
||||
t1.byIssue(t2.userName, t2.repositoryName, t2.issueId)
|
||||
}.filter { case (t1, t2) =>
|
||||
}
|
||||
.innerJoin(IssueOutline).on { case ((t1, t2), t3) =>
|
||||
t2.byIssue(t3.userName, t3.repositoryName, t3.issueId)
|
||||
}
|
||||
.filter { case ((t1, t2), t3) =>
|
||||
keywords.map { query =>
|
||||
t1.content.toLowerCase like (s"%${likeEncode(query)}%", '^')
|
||||
}.reduceLeft(_ && _)
|
||||
}.map { case (t1, t2) => (t2, t1.commentId, t1.content.?) }
|
||||
|
||||
def getCommentCount(issue: Issue): Int = {
|
||||
Query(IssueComments)
|
||||
.filter { t =>
|
||||
t.byIssue(issue.userName, issue.repositoryName, issue.issueId) &&
|
||||
(t.action inSetBind Seq("comment", "close_comment", "reopen_comment"))
|
||||
}
|
||||
.map(_.issueId)
|
||||
.list.length
|
||||
.map { case ((t1, t2), t3) =>
|
||||
(t2, t1.commentId, t1.content.?, t3.commentCount)
|
||||
}
|
||||
|
||||
issues.union(comments).sortBy { case (issue, commentId, _) =>
|
||||
issues.union(comments).sortBy { case (issue, commentId, _, _) =>
|
||||
issue.issueId ~ commentId
|
||||
}.list.splitWith { case ((issue1, _, _), (issue2, _, _)) =>
|
||||
}.list.splitWith { case ((issue1, _, _, _), (issue2, _, _, _)) =>
|
||||
issue1.issueId == issue2.issueId
|
||||
}.map { result =>
|
||||
val (issue, _, content) = result.head
|
||||
(issue, getCommentCount(issue) , content.getOrElse(""))
|
||||
}.map { _.head match {
|
||||
case (issue, _, content, commentCount) => (issue, commentCount, content.getOrElse(""))
|
||||
}
|
||||
}.toList
|
||||
}
|
||||
|
||||
@@ -333,6 +359,13 @@ object IssuesService {
|
||||
param(request, "state", Seq("open", "closed")).getOrElse("open"),
|
||||
param(request, "sort", Seq("created", "comments", "updated")).getOrElse("created"),
|
||||
param(request, "direction", Seq("asc", "desc")).getOrElse("desc"))
|
||||
|
||||
def page(request: HttpServletRequest) = try {
|
||||
val i = param(request, "page").getOrElse("1").toInt
|
||||
if(i <= 0) 1 else i
|
||||
} catch {
|
||||
case e: NumberFormatException => 1
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
57
src/main/scala/service/PullRequestService.scala
Normal file
57
src/main/scala/service/PullRequestService.scala
Normal file
@@ -0,0 +1,57 @@
|
||||
package service
|
||||
|
||||
import scala.slick.driver.H2Driver.simple._
|
||||
import Database.threadLocalSession
|
||||
|
||||
import model._
|
||||
|
||||
trait PullRequestService { self: IssuesService =>
|
||||
import PullRequestService._
|
||||
|
||||
def getPullRequest(owner: String, repository: String, issueId: Int): Option[(Issue, PullRequest)] = {
|
||||
val issue = getIssue(owner, repository, issueId.toString)
|
||||
if(issue.isDefined){
|
||||
Query(PullRequests).filter(_.byPrimaryKey(owner, repository, issueId)).firstOption match {
|
||||
case Some(pullreq) => Some((issue.get, pullreq))
|
||||
case None => None
|
||||
}
|
||||
} else None
|
||||
}
|
||||
|
||||
def getPullRequestCount(closed: Boolean, repository: Option[(String, String)]): List[PullRequestCount] =
|
||||
Query(PullRequests)
|
||||
.innerJoin(Issues).on { (t1, t2) => t1.byPrimaryKey(t2.userName, t2.repositoryName, t2.issueId) }
|
||||
.filter { case (t1, t2) =>
|
||||
(t2.closed is closed.bind) &&
|
||||
(t1.userName is repository.get._1, repository.isDefined) &&
|
||||
(t1.repositoryName is repository.get._2, repository.isDefined)
|
||||
}
|
||||
.groupBy { case (t1, t2) => t2.openedUserName }
|
||||
.map { case (userName, t) => userName ~ t.length }
|
||||
.list
|
||||
.map { x => PullRequestCount(x._1, x._2) }
|
||||
.sortBy(_.count).reverse
|
||||
|
||||
def createPullRequest(originUserName: String, originRepositoryName: String, issueId: Int,
|
||||
originBranch: String, requestUserName: String, requestRepositoryName: String, requestBranch: String,
|
||||
commitIdFrom: String, commitIdTo: String): Unit =
|
||||
PullRequests insert (PullRequest(
|
||||
originUserName,
|
||||
originRepositoryName,
|
||||
issueId,
|
||||
originBranch,
|
||||
requestUserName,
|
||||
requestRepositoryName,
|
||||
requestBranch,
|
||||
commitIdFrom,
|
||||
commitIdTo))
|
||||
|
||||
}
|
||||
|
||||
object PullRequestService {
|
||||
|
||||
val PullRequestLimit = 25
|
||||
|
||||
case class PullRequestCount(userName: String, count: Int)
|
||||
|
||||
}
|
||||
@@ -15,8 +15,12 @@ trait RepositoryService { self: AccountService =>
|
||||
* @param userName the user name of the repository owner
|
||||
* @param description the repository description
|
||||
* @param isPrivate the repository type (private is true, otherwise false)
|
||||
* @param originRepositoryName specify for the forked repository. (default is None)
|
||||
* @param originUserName specify for the forked repository. (default is None)
|
||||
*/
|
||||
def createRepository(repositoryName: String, userName: String, description: Option[String], isPrivate: Boolean): Unit = {
|
||||
def createRepository(repositoryName: String, userName: String, description: Option[String], isPrivate: Boolean,
|
||||
originRepositoryName: Option[String] = None, originUserName: Option[String] = None,
|
||||
parentRepositoryName: Option[String] = None, parentUserName: Option[String] = None): Unit = {
|
||||
Repositories insert
|
||||
Repository(
|
||||
userName = userName,
|
||||
@@ -26,7 +30,11 @@ trait RepositoryService { self: AccountService =>
|
||||
defaultBranch = "master",
|
||||
registeredDate = currentDate,
|
||||
updatedDate = currentDate,
|
||||
lastActivityDate = currentDate)
|
||||
lastActivityDate = currentDate,
|
||||
originUserName = originUserName,
|
||||
originRepositoryName = originRepositoryName,
|
||||
parentUserName = parentUserName,
|
||||
parentRepositoryName = parentRepositoryName)
|
||||
|
||||
IssueId insert (userName, repositoryName, 0)
|
||||
}
|
||||
@@ -53,39 +61,6 @@ trait RepositoryService { self: AccountService =>
|
||||
def getRepositoryNamesOfUser(userName: String): List[String] =
|
||||
Query(Repositories) filter(_.userName is userName.bind) map (_.repositoryName) list
|
||||
|
||||
/**
|
||||
* Returns the list of specified user's repositories information.
|
||||
*
|
||||
* @param userName the user name
|
||||
* @param baseUrl the base url of this application
|
||||
* @param loginUserName the logged in user name
|
||||
* @return the list of repository information which is sorted in descending order of lastActivityDate.
|
||||
*/
|
||||
def getVisibleRepositories(userName: String, baseUrl: String, loginUserName: Option[String]): List[RepositoryInfo] = {
|
||||
val q1 = Repositories
|
||||
.filter { t => t.userName is userName.bind }
|
||||
.map { r => r }
|
||||
|
||||
val q2 = Collaborators
|
||||
.innerJoin(Repositories).on((t1, t2) => t1.byRepository(t2.userName, t2.repositoryName))
|
||||
.filter{ case (t1, t2) => t1.collaboratorName is userName.bind}
|
||||
.map { case (t1, t2) => t2 }
|
||||
|
||||
def visibleFor(t: Repositories.type, loginUserName: Option[String]) = {
|
||||
loginUserName match {
|
||||
case Some(x) => (t.isPrivate is false.bind) || (
|
||||
(t.isPrivate is true.bind) && ((t.userName is x.bind) || (Collaborators.filter { c =>
|
||||
c.byRepository(t.userName, t.repositoryName) && (c.collaboratorName is x.bind)
|
||||
}.exists)))
|
||||
case None => (t.isPrivate is false.bind)
|
||||
}
|
||||
}
|
||||
|
||||
q1.union(q2).filter(visibleFor(_, loginUserName)).sortBy(_.lastActivityDate desc).list map { repository =>
|
||||
new RepositoryInfo(JGitUtil.getRepositoryInfo(repository.userName, repository.repositoryName, baseUrl), repository)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the specified repository information.
|
||||
*
|
||||
@@ -96,34 +71,62 @@ trait RepositoryService { self: AccountService =>
|
||||
*/
|
||||
def getRepository(userName: String, repositoryName: String, baseUrl: String): Option[RepositoryInfo] = {
|
||||
(Query(Repositories) filter { t => t.byRepository(userName, repositoryName) } firstOption) map { repository =>
|
||||
new RepositoryInfo(JGitUtil.getRepositoryInfo(repository.userName, repository.repositoryName, baseUrl), repository)
|
||||
new RepositoryInfo(
|
||||
JGitUtil.getRepositoryInfo(repository.userName, repository.repositoryName, baseUrl),
|
||||
repository,
|
||||
getForkedCount(
|
||||
repository.originUserName.getOrElse(repository.userName),
|
||||
repository.originRepositoryName.getOrElse(repository.repositoryName)
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
def getUserRepositories(userName: String, baseUrl: String): List[RepositoryInfo] = {
|
||||
Query(Repositories).filter { t1 =>
|
||||
(t1.userName is userName.bind) ||
|
||||
(Query(Collaborators).filter { t2 => t2.byRepository(t1.userName, t1.repositoryName) && (t2.collaboratorName is userName.bind)} exists)
|
||||
}.sortBy(_.lastActivityDate desc).list.map{ repository =>
|
||||
new RepositoryInfo(
|
||||
JGitUtil.getRepositoryInfo(repository.userName, repository.repositoryName, baseUrl),
|
||||
repository,
|
||||
getForkedCount(
|
||||
repository.originUserName.getOrElse(repository.userName),
|
||||
repository.originRepositoryName.getOrElse(repository.repositoryName)
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of accessible repositories information for the specified account user.
|
||||
* Returns the list of visible repositories for the specified user.
|
||||
* If repositoryUserName is given then filters results by repository owner.
|
||||
*
|
||||
* @param account the account
|
||||
* @param loginAccount the logged in account
|
||||
* @param baseUrl the base url of this application
|
||||
* @return the repository informations which is sorted in descending order of lastActivityDate.
|
||||
* @param repositoryUserName the repository owner (if None then returns all repositories which are visible for logged in user)
|
||||
* @return the repository information which is sorted in descending order of lastActivityDate.
|
||||
*/
|
||||
def getAccessibleRepositories(account: Option[Account], baseUrl: String): List[RepositoryInfo] = {
|
||||
|
||||
def newRepositoryInfo(repository: Repository): RepositoryInfo = {
|
||||
new RepositoryInfo(JGitUtil.getRepositoryInfo(repository.userName, repository.repositoryName, baseUrl), repository)
|
||||
}
|
||||
|
||||
(account match {
|
||||
def getVisibleRepositories(loginAccount: Option[Account], baseUrl: String, repositoryUserName: Option[String] = None): List[RepositoryInfo] = {
|
||||
(loginAccount match {
|
||||
// for Administrators
|
||||
case Some(x) if(x.isAdmin) => Query(Repositories)
|
||||
// for Normal Users
|
||||
case Some(x) if(!x.isAdmin) =>
|
||||
Query(Repositories) filter { t => (t.isPrivate is false.bind) ||
|
||||
(Query(Collaborators).filter(t2 => t2.byRepository(t.userName, t.repositoryName) && (t2.collaboratorName is x.userName.bind)) exists)
|
||||
(Query(Collaborators).filter { t2 => t2.byRepository(t.userName, t.repositoryName) && (t2.collaboratorName is x.userName.bind)} exists)
|
||||
}
|
||||
// for Guests
|
||||
case None => Query(Repositories) filter(_.isPrivate is false.bind)
|
||||
}).sortBy(_.lastActivityDate desc).list.map(newRepositoryInfo _)
|
||||
}).filter { t =>
|
||||
repositoryUserName.map { userName => t.userName is userName.bind } getOrElse ConstColumn.TRUE
|
||||
}.sortBy(_.lastActivityDate desc).list.map{ repository =>
|
||||
new RepositoryInfo(
|
||||
JGitUtil.getRepositoryInfo(repository.userName, repository.repositoryName, baseUrl),
|
||||
repository,
|
||||
getForkedCount(
|
||||
repository.originUserName.getOrElse(repository.userName),
|
||||
repository.originRepositoryName.getOrElse(repository.repositoryName)
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,17 +192,39 @@ trait RepositoryService { self: AccountService =>
|
||||
}
|
||||
}
|
||||
|
||||
// TODO It must be _.length instead of map (_.issueId) list).length.
|
||||
// But it does not work on Slick 1.0.1 (worked on Slick 1.0.0).
|
||||
// https://github.com/slick/slick/issues/170
|
||||
private def getForkedCount(userName: String, repositoryName: String): Int =
|
||||
Query(Repositories).filter { t =>
|
||||
(t.originUserName is userName.bind) && (t.originRepositoryName is repositoryName.bind)
|
||||
}.list.length
|
||||
|
||||
|
||||
def getForkedRepositoryTree(userName: String, repositoryName: String): RepositoryTreeNode = {
|
||||
RepositoryTreeNode(userName, repositoryName,
|
||||
Query(Repositories).filter { t =>
|
||||
(t.parentUserName is userName.bind) && (t.parentRepositoryName is repositoryName.bind)
|
||||
}.map { t =>
|
||||
t.userName ~ t.repositoryName
|
||||
}.list.map { case (userName, repositoryName) =>
|
||||
getForkedRepositoryTree(userName, repositoryName)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
object RepositoryService {
|
||||
|
||||
case class RepositoryInfo(owner: String, name: String, url: String, repository: Repository,
|
||||
commitCount: Int, branchList: List[String], tags: List[util.JGitUtil.TagInfo]){
|
||||
commitCount: Int, forkedCount: Int, branchList: List[String], tags: List[util.JGitUtil.TagInfo]){
|
||||
|
||||
def this(repo: JGitUtil.RepositoryInfo, model: Repository) = {
|
||||
this(repo.owner, repo.name, repo.url, model, repo.commitCount, repo.branchList, repo.tags)
|
||||
def this(repo: JGitUtil.RepositoryInfo, model: Repository, forkedCount: Int) = {
|
||||
this(repo.owner, repo.name, repo.url, model, repo.commitCount, forkedCount, repo.branchList, repo.tags)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
case class RepositoryTreeNode(owner: String, name: String, children: List[RepositoryTreeNode])
|
||||
|
||||
}
|
||||
@@ -4,10 +4,7 @@ import java.io.File
|
||||
import java.util.Date
|
||||
import org.eclipse.jgit.api.Git
|
||||
import org.apache.commons.io.FileUtils
|
||||
import util.JGitUtil.DiffInfo
|
||||
import util.{Directory, JGitUtil}
|
||||
import org.eclipse.jgit.treewalk.CanonicalTreeParser
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import util.{Directory, JGitUtil, LockUtil}
|
||||
|
||||
object WikiService {
|
||||
|
||||
@@ -31,40 +28,13 @@ object WikiService {
|
||||
*/
|
||||
case class WikiPageHistoryInfo(name: String, committer: String, message: String, date: Date)
|
||||
|
||||
/**
|
||||
* lock objects
|
||||
*/
|
||||
private val locks = new ConcurrentHashMap[String, AnyRef]()
|
||||
|
||||
/**
|
||||
* Returns the lock object for the specified repository.
|
||||
*/
|
||||
private def getLockObject(owner: String, repository: String): AnyRef = synchronized {
|
||||
val key = owner + "/" + repository
|
||||
if(!locks.containsKey(key)){
|
||||
locks.put(key, new AnyRef())
|
||||
}
|
||||
locks.get(key)
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronizes a given function which modifies the working copy of the wiki repository.
|
||||
*
|
||||
* @param owner the repository owner
|
||||
* @param repository the repository name
|
||||
* @param f the function which modifies the working copy of the wiki repository
|
||||
* @tparam T the return type of the given function
|
||||
* @return the result of the given function
|
||||
*/
|
||||
def lock[T](owner: String, repository: String)(f: => T): T = getLockObject(owner, repository).synchronized(f)
|
||||
|
||||
}
|
||||
|
||||
trait WikiService {
|
||||
import WikiService._
|
||||
|
||||
def createWikiRepository(loginAccount: model.Account, owner: String, repository: String): Unit = {
|
||||
lock(owner, repository){
|
||||
LockUtil.lock(s"${owner}/${repository}/wiki"){
|
||||
val dir = Directory.getWikiRepositoryDir(owner, repository)
|
||||
if(!dir.exists){
|
||||
try {
|
||||
@@ -126,7 +96,7 @@ trait WikiService {
|
||||
def saveWikiPage(owner: String, repository: String, currentPageName: String, newPageName: String,
|
||||
content: String, committer: model.Account, message: String): Unit = {
|
||||
|
||||
lock(owner, repository){
|
||||
LockUtil.lock(s"${owner}/${repository}/wiki"){
|
||||
// clone working copy
|
||||
val workDir = Directory.getWikiWorkDir(owner, repository)
|
||||
cloneOrPullWorkingCopy(workDir, owner, repository)
|
||||
@@ -162,8 +132,9 @@ trait WikiService {
|
||||
/**
|
||||
* Delete the wiki page.
|
||||
*/
|
||||
def deleteWikiPage(owner: String, repository: String, pageName: String, committer: String, message: String): Unit = {
|
||||
lock(owner, repository){
|
||||
def deleteWikiPage(owner: String, repository: String, pageName: String,
|
||||
committer: String, mailAddress: String, message: String): Unit = {
|
||||
LockUtil.lock(s"${owner}/${repository}/wiki"){
|
||||
// clone working copy
|
||||
val workDir = Directory.getWikiWorkDir(owner, repository)
|
||||
cloneOrPullWorkingCopy(workDir, owner, repository)
|
||||
@@ -175,34 +146,12 @@ trait WikiService {
|
||||
git.rm.addFilepattern(pageName + ".md").call
|
||||
|
||||
// commit and push
|
||||
// TODO committer's mail address
|
||||
git.commit.setAuthor(committer, committer + "@devnull").setMessage(message).call
|
||||
git.commit.setAuthor(committer, mailAddress).setMessage(message).call
|
||||
git.push.call
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns differences between specified commits.
|
||||
*/
|
||||
def getWikiDiffs(git: Git, commitId1: String, commitId2: String): List[DiffInfo] = {
|
||||
// get diff between specified commit and its previous commit
|
||||
val reader = git.getRepository.newObjectReader
|
||||
|
||||
val oldTreeIter = new CanonicalTreeParser
|
||||
oldTreeIter.reset(reader, git.getRepository.resolve(commitId1 + "^{tree}"))
|
||||
|
||||
val newTreeIter = new CanonicalTreeParser
|
||||
newTreeIter.reset(reader, git.getRepository.resolve(commitId2 + "^{tree}"))
|
||||
|
||||
import scala.collection.JavaConverters._
|
||||
git.diff.setNewTree(newTreeIter).setOldTree(oldTreeIter).call.asScala.map { diff =>
|
||||
DiffInfo(diff.getChangeType, diff.getOldPath, diff.getNewPath,
|
||||
JGitUtil.getContent(git, diff.getOldId.toObjectId, false).map(new String(_, "UTF-8")),
|
||||
JGitUtil.getContent(git, diff.getNewId.toObjectId, false).map(new String(_, "UTF-8")))
|
||||
}.toList
|
||||
}
|
||||
|
||||
private def cloneOrPullWorkingCopy(workDir: File, owner: String, repository: String): Unit = {
|
||||
if(!workDir.exists){
|
||||
val git =
|
||||
|
||||
@@ -49,6 +49,7 @@ object AutoUpdate {
|
||||
* The history of versions. A head of this sequence is the current BitBucket version.
|
||||
*/
|
||||
val versions = Seq(
|
||||
Version(1, 5),
|
||||
Version(1, 4),
|
||||
new Version(1, 3){
|
||||
override def update(conn: Connection): Unit = {
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.eclipse.jgit.util.io.DisabledOutputStream
|
||||
import org.eclipse.jgit.errors.MissingObjectException
|
||||
import java.util.Date
|
||||
import org.eclipse.jgit.api.errors.NoHeadException
|
||||
import service.RepositoryService
|
||||
|
||||
/**
|
||||
* Provides complex JGit operations.
|
||||
@@ -132,15 +133,18 @@ object JGitUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns RevCommit from the commit id.
|
||||
* Returns RevCommit from the commit or tag id.
|
||||
*
|
||||
* @param git the Git object
|
||||
* @param commitId the ObjectId of the commit
|
||||
* @return the RevCommit for the specified commit
|
||||
* @param objectId the ObjectId of the commit or tag
|
||||
* @return the RevCommit for the specified commit or tag
|
||||
*/
|
||||
def getRevCommitFromId(git: Git, commitId: ObjectId): RevCommit = {
|
||||
def getRevCommitFromId(git: Git, objectId: ObjectId): RevCommit = {
|
||||
val revWalk = new RevWalk(git.getRepository)
|
||||
val revCommit = revWalk.parseCommit(commitId)
|
||||
val revCommit = revWalk.parseAny(objectId) match {
|
||||
case r: RevTag => revWalk.parseCommit(r.getObject)
|
||||
case _ => revWalk.parseCommit(objectId)
|
||||
}
|
||||
revWalk.dispose
|
||||
revCommit
|
||||
}
|
||||
@@ -152,12 +156,7 @@ object JGitUtil {
|
||||
withGit(getRepositoryDir(owner, repository)){ git =>
|
||||
try {
|
||||
// get commit count
|
||||
val i = git.log.all.call.iterator
|
||||
var commitCount = 0
|
||||
while(i.hasNext && commitCount <= 1000){
|
||||
i.next
|
||||
commitCount = commitCount + 1
|
||||
}
|
||||
val commitCount = git.log.all.call.iterator.asScala.map(_ => 1).take(1000).sum
|
||||
|
||||
RepositoryInfo(
|
||||
owner, repository, s"${baseUrl}/git/${owner}/${repository}.git",
|
||||
@@ -295,22 +294,15 @@ object JGitUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the commit list between two revisions.
|
||||
*
|
||||
* @param git the Git object
|
||||
* @param from the from revision
|
||||
* @param to the to revision
|
||||
* @return the commit list
|
||||
*/
|
||||
def getCommitLog(git: Git, from: String, to: String): List[CommitInfo] = {
|
||||
def getCommitLogs(git: Git, begin: String, includesLastCommit: Boolean = false)
|
||||
(endCondition: RevCommit => Boolean): List[CommitInfo] = {
|
||||
@scala.annotation.tailrec
|
||||
def getCommitLog(i: java.util.Iterator[RevCommit], logs: List[CommitInfo]): List[CommitInfo] =
|
||||
i.hasNext match {
|
||||
case true => {
|
||||
val revCommit = i.next
|
||||
if(revCommit.name == from){
|
||||
logs
|
||||
if(endCondition(revCommit)){
|
||||
if(includesLastCommit) logs :+ new CommitInfo(revCommit) else logs
|
||||
} else {
|
||||
getCommitLog(i, logs :+ new CommitInfo(revCommit))
|
||||
}
|
||||
@@ -319,7 +311,7 @@ object JGitUtil {
|
||||
}
|
||||
|
||||
val revWalk = new RevWalk(git.getRepository)
|
||||
revWalk.markStart(revWalk.parseCommit(git.getRepository.resolve(to)))
|
||||
revWalk.markStart(revWalk.parseCommit(git.getRepository.resolve(begin)))
|
||||
|
||||
val commits = getCommitLog(revWalk.iterator, Nil)
|
||||
revWalk.release
|
||||
@@ -328,6 +320,18 @@ object JGitUtil {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the commit list between two revisions.
|
||||
*
|
||||
* @param git the Git object
|
||||
* @param from the from revision
|
||||
* @param to the to revision
|
||||
* @return the commit list
|
||||
*/
|
||||
// TODO swap parameters 'from' and 'to'!?
|
||||
def getCommitLog(git: Git, from: String, to: String): List[CommitInfo] =
|
||||
getCommitLogs(git, to)(_.getName == from)
|
||||
|
||||
/**
|
||||
* Returns the latest RevCommit of the specified path.
|
||||
*
|
||||
@@ -348,51 +352,11 @@ object JGitUtil {
|
||||
* @return the list of latest commit
|
||||
*/
|
||||
def getLatestCommitFromPaths(git: Git, paths: List[String], revision: String): Map[String, RevCommit] = {
|
||||
|
||||
val map = new scala.collection.mutable.HashMap[String, RevCommit]
|
||||
|
||||
val revWalk = new RevWalk(git.getRepository)
|
||||
revWalk.markStart(revWalk.parseCommit(git.getRepository.resolve(revision)))
|
||||
//revWalk.sort(RevSort.REVERSE);
|
||||
val i = revWalk.iterator
|
||||
|
||||
while(i.hasNext && map.size != paths.length){
|
||||
val commit = i.next
|
||||
if(commit.getParentCount == 0){
|
||||
// Initial commit
|
||||
val treeWalk = new TreeWalk(git.getRepository)
|
||||
treeWalk.reset()
|
||||
treeWalk.setRecursive(true)
|
||||
treeWalk.addTree(commit.getTree)
|
||||
while (treeWalk.next) {
|
||||
paths.foreach { path =>
|
||||
if(treeWalk.getPathString.startsWith(path) && !map.contains(path)){
|
||||
map.put(path, commit)
|
||||
}
|
||||
}
|
||||
}
|
||||
treeWalk.release
|
||||
} else {
|
||||
(0 to commit.getParentCount - 1).foreach { i =>
|
||||
val parent = revWalk.parseCommit(commit.getParent(i).getId())
|
||||
val df = new DiffFormatter(DisabledOutputStream.INSTANCE)
|
||||
df.setRepository(git.getRepository)
|
||||
df.setDiffComparator(RawTextComparator.DEFAULT)
|
||||
df.setDetectRenames(true)
|
||||
val diffs = df.scan(parent.getTree(), commit.getTree)
|
||||
diffs.asScala.foreach { diff =>
|
||||
paths.foreach { path =>
|
||||
if(diff.getChangeType != ChangeType.DELETE && diff.getNewPath.startsWith(path) && !map.contains(path)){
|
||||
map.put(path, commit)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
revWalk.release
|
||||
}
|
||||
map.toMap
|
||||
val start = getRevCommitFromId(git, git.getRepository.resolve(revision))
|
||||
paths.map { path =>
|
||||
val commit = git.log.add(start).addPath(path).setMaxCount(1).call.iterator.next
|
||||
(path, commit)
|
||||
}.toMap
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -438,26 +402,8 @@ object JGitUtil {
|
||||
if(commits.length >= 2){
|
||||
// not initial commit
|
||||
val oldCommit = commits(1)
|
||||
getDiffs(git, oldCommit.getName, id, fetchContent)
|
||||
|
||||
// get diff between specified commit and its previous commit
|
||||
val reader = git.getRepository.newObjectReader
|
||||
|
||||
val oldTreeIter = new CanonicalTreeParser
|
||||
oldTreeIter.reset(reader, git.getRepository.resolve(oldCommit.name + "^{tree}"))
|
||||
|
||||
val newTreeIter = new CanonicalTreeParser
|
||||
newTreeIter.reset(reader, git.getRepository.resolve(id + "^{tree}"))
|
||||
|
||||
import scala.collection.JavaConverters._
|
||||
git.diff.setNewTree(newTreeIter).setOldTree(oldTreeIter).call.asScala.map { diff =>
|
||||
if(!fetchContent || FileUtil.isImage(diff.getOldPath) || FileUtil.isImage(diff.getNewPath)){
|
||||
DiffInfo(diff.getChangeType, diff.getOldPath, diff.getNewPath, None, None)
|
||||
} else {
|
||||
DiffInfo(diff.getChangeType, diff.getOldPath, diff.getNewPath,
|
||||
JGitUtil.getContent(git, diff.getOldId.toObjectId, false).filter(FileUtil.isText).map(new String(_, "UTF-8")),
|
||||
JGitUtil.getContent(git, diff.getNewId.toObjectId, false).filter(FileUtil.isText).map(new String(_, "UTF-8")))
|
||||
}
|
||||
}.toList
|
||||
} else {
|
||||
// initial commit
|
||||
val walk = new TreeWalk(git.getRepository)
|
||||
@@ -476,6 +422,27 @@ object JGitUtil {
|
||||
}
|
||||
}
|
||||
|
||||
def getDiffs(git: Git, from: String, to: String, fetchContent: Boolean): List[DiffInfo] = {
|
||||
val reader = git.getRepository.newObjectReader
|
||||
val oldTreeIter = new CanonicalTreeParser
|
||||
oldTreeIter.reset(reader, git.getRepository.resolve(from + "^{tree}"))
|
||||
|
||||
val newTreeIter = new CanonicalTreeParser
|
||||
newTreeIter.reset(reader, git.getRepository.resolve(to + "^{tree}"))
|
||||
|
||||
import scala.collection.JavaConverters._
|
||||
git.diff.setNewTree(newTreeIter).setOldTree(oldTreeIter).call.asScala.map { diff =>
|
||||
if(!fetchContent || FileUtil.isImage(diff.getOldPath) || FileUtil.isImage(diff.getNewPath)){
|
||||
DiffInfo(diff.getChangeType, diff.getOldPath, diff.getNewPath, None, None)
|
||||
} else {
|
||||
DiffInfo(diff.getChangeType, diff.getOldPath, diff.getNewPath,
|
||||
JGitUtil.getContent(git, diff.getOldId.toObjectId, false).filter(FileUtil.isText).map(new String(_, "UTF-8")),
|
||||
JGitUtil.getContent(git, diff.getNewId.toObjectId, false).filter(FileUtil.isText).map(new String(_, "UTF-8")))
|
||||
}
|
||||
}.toList
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the list of branch names of the specified commit.
|
||||
*/
|
||||
@@ -524,6 +491,15 @@ object JGitUtil {
|
||||
}
|
||||
}
|
||||
|
||||
def cloneRepository(from: java.io.File, to: java.io.File): Unit = {
|
||||
val git = Git.cloneRepository.setURI(from.toURI.toString).setDirectory(to).setBare(true).call
|
||||
try {
|
||||
setReceivePack(git.getRepository)
|
||||
} finally {
|
||||
git.getRepository.close
|
||||
}
|
||||
}
|
||||
|
||||
def isEmpty(git: Git): Boolean = git.getRepository.resolve(Constants.HEAD) == null
|
||||
|
||||
private def setReceivePack(repository: org.eclipse.jgit.lib.Repository): Unit = {
|
||||
@@ -532,4 +508,14 @@ object JGitUtil {
|
||||
config.save
|
||||
}
|
||||
|
||||
def getDefaultBranch(git: Git, repository: RepositoryService.RepositoryInfo,
|
||||
revstr: String = ""): Option[(ObjectId, String)] = {
|
||||
Seq(
|
||||
if(revstr.isEmpty) repository.repository.defaultBranch else revstr,
|
||||
repository.branchList.head
|
||||
).map { rev =>
|
||||
(git.getRepository.resolve(rev), rev)
|
||||
}.find(_._1 != null)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
36
src/main/scala/util/LockUtil.scala
Normal file
36
src/main/scala/util/LockUtil.scala
Normal file
@@ -0,0 +1,36 @@
|
||||
package util
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.locks.{ReentrantLock, Lock}
|
||||
|
||||
object LockUtil {
|
||||
|
||||
/**
|
||||
* lock objects
|
||||
*/
|
||||
private val locks = new ConcurrentHashMap[String, Lock]()
|
||||
|
||||
/**
|
||||
* Returns the lock object for the specified repository.
|
||||
*/
|
||||
private def getLockObject(key: String): Lock = synchronized {
|
||||
if(!locks.containsKey(key)){
|
||||
locks.put(key, new ReentrantLock())
|
||||
}
|
||||
locks.get(key)
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronizes a given function which modifies the working copy of the wiki repository.
|
||||
*/
|
||||
def lock[T](key: String)(f: => T): T = {
|
||||
val lock = getLockObject(key)
|
||||
try {
|
||||
lock.lock()
|
||||
f
|
||||
} finally {
|
||||
lock.unlock()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,19 +13,19 @@ trait AvatarImageProvider { self: RequestCache =>
|
||||
protected def getAvatarImageHtml(userName: String, size: Int,
|
||||
mailAddress: String = "", tooltip: Boolean = false)(implicit context: app.Context): Html = {
|
||||
|
||||
val src = if(getSystemSettings().gravatar){
|
||||
getAccountByUserName(userName).collect { case account if(account.image.isEmpty && !account.isGroupAccount) =>
|
||||
val src = getAccountByUserName(userName).map { account =>
|
||||
if(account.image.isEmpty && getSystemSettings().gravatar){
|
||||
s"""http://www.gravatar.com/avatar/${StringUtil.md5(account.mailAddress)}?s=${size}"""
|
||||
} else {
|
||||
s"""${context.path}/${userName}/_avatar"""
|
||||
}
|
||||
} getOrElse {
|
||||
if(mailAddress.nonEmpty){
|
||||
if(mailAddress.nonEmpty && getSystemSettings().gravatar){
|
||||
s"""http://www.gravatar.com/avatar/${StringUtil.md5(mailAddress)}?s=${size}"""
|
||||
} else {
|
||||
s"""${context.path}/${userName}/_avatar"""
|
||||
}
|
||||
}
|
||||
} else {
|
||||
s"""${context.path}/${userName}/_avatar"""
|
||||
}
|
||||
|
||||
if(tooltip){
|
||||
Html(s"""<img src="${src}" class="avatar" style="width: ${size}px; height: ${size}px;" data-toggle="tooltip" title="${userName}"/>""")
|
||||
|
||||
@@ -51,9 +51,17 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
|
||||
def link(value: String, repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context): Html =
|
||||
Html(convertRefsLinks(value, repository))
|
||||
|
||||
def cut(value: String, length: Int): String =
|
||||
if(value.length > length){
|
||||
value.substring(0, length) + "..."
|
||||
} else {
|
||||
value
|
||||
}
|
||||
|
||||
def activityMessage(message: String)(implicit context: app.Context): Html =
|
||||
Html(message
|
||||
.replaceAll("\\[issue:([^\\s]+?)/([^\\s]+?)#((\\d+))\\]" , s"""<a href="${context.path}/$$1/$$2/issues/$$3">$$1/$$2#$$3</a>""")
|
||||
.replaceAll("\\[pullreq:([^\\s]+?)/([^\\s]+?)#((\\d+))\\]" , s"""<a href="${context.path}/$$1/$$2/pull/$$3">$$1/$$2#$$3</a>""")
|
||||
.replaceAll("\\[repo:([^\\s]+?)/([^\\s]+?)\\]" , s"""<a href="${context.path}/$$1/$$2\">$$1/$$2</a>""")
|
||||
.replaceAll("\\[branch:([^\\s]+?)/([^\\s]+?)#([^\\s]+?)\\]", s"""<a href="${context.path}/$$1/$$2/tree/$$3">$$3</a>""")
|
||||
.replaceAll("\\[tag:([^\\s]+?)/([^\\s]+?)#([^\\s]+?)\\]" , s"""<a href="${context.path}/$$1/$$2/tree/$$3">$$3</a>""")
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
<i class="icon-lock"></i>
|
||||
}
|
||||
</div>
|
||||
@if(repository.repository.originUserName.isDefined){
|
||||
<div class="small muted">forked from <a href="@path/@repository.repository.parentUserName/@repository.repository.parentRepositoryName">@repository.repository.parentUserName/@repository.repository.parentRepositoryName</a></div>
|
||||
}
|
||||
@if(repository.repository.description.isDefined){
|
||||
<div>@repository.repository.description</div>
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
allCount: Int,
|
||||
assignedCount: Int,
|
||||
createdByCount: Int,
|
||||
repositories: List[service.RepositoryService.RepositoryInfo],
|
||||
repositories: List[(String, String, Int)],
|
||||
condition: service.IssuesService.IssueSearchCondition,
|
||||
filter: String)(implicit context: app.Context)
|
||||
@import context._
|
||||
@@ -13,19 +13,19 @@
|
||||
<div class="span3">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li@if(filter == "all"){ class="active"}>
|
||||
<a href="/dashboard/issues/repos@condition.toURL">
|
||||
<a href="@path/dashboard/issues/repos@condition.toURL">
|
||||
<span class="count-right">@allCount</span>
|
||||
In your repositories
|
||||
</a>
|
||||
</li>
|
||||
<li@if(filter == "assigned"){ class="active"}>
|
||||
<a href="/dashboard/issues/assigned@condition.toURL">
|
||||
<a href="@path/dashboard/issues/assigned@condition.toURL">
|
||||
<span class="count-right">@assignedCount</span>
|
||||
Assigned to you
|
||||
</a>
|
||||
</li>
|
||||
<li@if(filter == "created_by"){ class="active"}>
|
||||
<a href="/dashboard/issues/created_by@condition.toURL">
|
||||
<a href="@path/dashboard/issues/created_by@condition.toURL">
|
||||
<span class="count-right">@createdByCount</span>
|
||||
Created by you
|
||||
</a>
|
||||
@@ -33,11 +33,11 @@
|
||||
</ul>
|
||||
<hr/>
|
||||
<ul class="nav nav-pills nav-stacked small">
|
||||
@repositories.map { repository =>
|
||||
<li>
|
||||
<a href="@condition.copy(repo = Some(repository.owner + "/" + repository.name)).toURL">
|
||||
<span class="count-right">0</span>
|
||||
@repository.owner/@repository.name
|
||||
@repositories.map { case (owner, name, count) =>
|
||||
<li@if(condition.repo == Some(owner + "/" + name)){ class="active"}>
|
||||
<a href="@condition.copy(repo = Some(owner + "/" + name)).toURL">
|
||||
<span class="count-right">@count</span>
|
||||
@owner/@name
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@(active: String = "")(implicit context: app.Context)
|
||||
@import context._
|
||||
<ul class="nav nav-tabs">
|
||||
<li@if(active == ""){ class="active"}><a href="/">News Feed</a></li>
|
||||
<li@if(active == ""){ class="active"}><a href="@path/">News Feed</a></li>
|
||||
@if(loginAccount.isDefined){
|
||||
<li@if(active == "issues"){ class="active"}><a href="/dashboard/issues/repos">Issues</a></li>
|
||||
<li@if(active == "issues"){ class="active"}><a href="@path/dashboard/issues/repos">Issues</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
@(active: String, repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
<div class="pull-right">
|
||||
<div class="input-prepend">
|
||||
<input type="button" id="fork" class="btn" value="Fork" style="margin-bottom: 10px;"/>
|
||||
<span class="add-on"><a href="@url(repository)/network/members">@repository.forkedCount</a></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head">
|
||||
<a href="@url(repository.owner)">@repository.owner</a> / <a href="@url(repository)">@repository.name</a>
|
||||
@if(repository.repository.isPrivate){
|
||||
<i class="icon-lock"></i>
|
||||
}
|
||||
@defining(repository.repository){ x =>
|
||||
@if(repository.repository.originRepositoryName.isDefined){
|
||||
<div class="forked">
|
||||
forked from <a href="@path/@x.parentUserName/@x.parentRepositoryName">@x.parentUserName/@x.parentRepositoryName</a>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<table class="global-nav box-header">
|
||||
<tr>
|
||||
@@ -15,6 +28,9 @@
|
||||
<th class="box-header@if(active=="issues"){ active}">
|
||||
<a href="@url(repository)/issues">Issues</a>
|
||||
</th>
|
||||
<th class="box-header@if(active=="pulls"){ active}">
|
||||
<a href="@url(repository)/pulls">Pull Requests</a>
|
||||
</th>
|
||||
<th class="box-header@if(active=="wiki"){ active}">
|
||||
<a href="@url(repository)/wiki">Wiki</a>
|
||||
</th>
|
||||
@@ -25,11 +41,20 @@
|
||||
}
|
||||
</tr>
|
||||
</table>
|
||||
<form method="POST" id="repository_form">
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('table.global-nav th.box-header').click(function(){
|
||||
location.href = $(this).find('a').attr('href');
|
||||
return false;
|
||||
});
|
||||
|
||||
// TODO Execute by Ajax?
|
||||
$('#fork').click(function(){
|
||||
var form = $('form#repository_form');
|
||||
form.attr('action', '@path/@repository.owner/@repository.name/_fork');
|
||||
form.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
@(buttonValue: String = "")(body: Html)
|
||||
@(buttonValue: String = "", prefix: String = "")(body: Html)
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
|
||||
@if(buttonValue == ""){
|
||||
@if(buttonValue.isEmpty){
|
||||
<i class="icon-cog"></i>
|
||||
} else {
|
||||
@if(prefix.nonEmpty){
|
||||
<span class="muted">@prefix:</span>
|
||||
}
|
||||
<strong>@buttonValue</strong>
|
||||
}
|
||||
<span class="caret"></span>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@(activities: List[model.Activity],
|
||||
repositories: List[service.RepositoryService.RepositoryInfo],
|
||||
recentRepositories: List[service.RepositoryService.RepositoryInfo],
|
||||
systemSettings: service.SystemSettingsService.SystemSettings,
|
||||
userRepositories: List[String])(implicit context: app.Context)
|
||||
userRepositories: List[service.RepositoryService.RepositoryInfo])(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@main("GitBucket"){
|
||||
@@ -28,9 +28,15 @@
|
||||
<td>No repositories</td>
|
||||
</tr>
|
||||
} else {
|
||||
@userRepositories.map { repositoryName =>
|
||||
@userRepositories.map { repository =>
|
||||
<tr>
|
||||
<td><a href="@path/@loginAccount.get.userName/@repositoryName"><strong>@repositoryName</strong></a></td>
|
||||
<td>
|
||||
@if(repository.owner == loginAccount.get.userName){
|
||||
<a href="@url(repository)"><strong>@repository.name</strong></a>
|
||||
} else {
|
||||
<a href="@url(repository)">@repository.owner/<strong>@repository.name</strong></a>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
@@ -43,12 +49,12 @@
|
||||
Recent updated repositories
|
||||
</th>
|
||||
</tr>
|
||||
@if(repositories.isEmpty){
|
||||
@if(recentRepositories.isEmpty){
|
||||
<tr>
|
||||
<td>No repositories</td>
|
||||
</tr>
|
||||
} else {
|
||||
@repositories.map { repository =>
|
||||
@recentRepositories.map { repository =>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="@url(repository)">@repository.owner/<strong>@repository.name</strong></a>
|
||||
|
||||
29
src/main/twirl/issues/commentform.scala.html
Normal file
29
src/main/twirl/issues/commentform.scala.html
Normal file
@@ -0,0 +1,29 @@
|
||||
@(issue: model.Issue,
|
||||
hasWritePermission: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@if(loginAccount.isDefined){
|
||||
<form method="POST" validate="true">
|
||||
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
|
||||
<div class="box issue-comment-box">
|
||||
<div class="box-content">
|
||||
@helper.html.preview(repository, "", false, true, "width: 680px; height: 100px;")
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<input type="hidden" name="issueId" value="@issue.issueId"/>
|
||||
<input type="submit" class="btn btn-success" formaction="@url(repository)/issue_comments/new" value="Comment"/>
|
||||
@if((!issue.isPullRequest || !issue.closed) && (hasWritePermission || issue.openedUserName == loginAccount.get.userName)){
|
||||
<input type="submit" class="btn" formaction="@url(repository)/issue_comments/state" value="@{if(issue.closed) "Reopen" else "Close"}" id="action"/>
|
||||
}
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('#action').click(function(){
|
||||
$('<input type="hidden">').attr('name', 'action').val($(this).val().toLowerCase()).appendTo('form');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
61
src/main/twirl/issues/commentlist.scala.html
Normal file
61
src/main/twirl/issues/commentlist.scala.html
Normal file
@@ -0,0 +1,61 @@
|
||||
@(comments: List[model.IssueComment],
|
||||
hasWritePermission: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@comments.map { comment =>
|
||||
@if(comment.action != "close" && comment.action != "reopen" && comment.action != "merge"){
|
||||
<div class="issue-avatar-image">@avatar(comment.commentedUserName, 48)</div>
|
||||
<div class="box issue-comment-box" id="comment-@comment.commentId">
|
||||
<div class="box-header-small">
|
||||
<i class="icon-comment"></i>
|
||||
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> commented
|
||||
<span class="pull-right">
|
||||
@datetime(comment.registeredDate)
|
||||
@if(comment.action != "commit" && (hasWritePermission || loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){
|
||||
<a href="#" data-comment-id="@comment.commentId"><i class="icon-pencil"></i></a>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
<div class="box-content"class="issue-content" id="commentContent-@comment.commentId">
|
||||
@markdown(comment.content, repository, false, true)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if(comment.action == "merge"){
|
||||
<div class="small" style="margin-top: 10px; margin-bottom: 10px;">
|
||||
<span class="label label-info">Merged</span>
|
||||
@avatar(comment.commentedUserName, 20)
|
||||
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> merged the pull request @datetime(comment.registeredDate)
|
||||
</div>
|
||||
}
|
||||
@if(comment.action == "close" || comment.action == "close_comment"){
|
||||
<div class="small issue-comment-action">
|
||||
<span class="label label-important">Closed</span>
|
||||
@avatar(comment.commentedUserName, 20)
|
||||
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> closed the issue @datetime(comment.registeredDate)
|
||||
</div>
|
||||
}
|
||||
@if(comment.action == "reopen" || comment.action == "reopen_comment"){
|
||||
<div class="small issue-comment-action">
|
||||
<span class="label label-success">Reopened</span>
|
||||
@avatar(comment.commentedUserName, 20)
|
||||
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> reopened the issue @datetime(comment.registeredDate)
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('i.icon-pencil').click(function(){
|
||||
var id = $(this).closest('a').data('comment-id');
|
||||
$.get('@url(repository)/issue_comments/_data/' + id,
|
||||
{
|
||||
dataType : 'html'
|
||||
},
|
||||
function(data){
|
||||
$('#commentContent-' + id).empty().html(data);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -17,132 +17,9 @@
|
||||
</ul>
|
||||
<div class="row-fluid">
|
||||
<div class="span10">
|
||||
<div class="issue-avatar-image">@avatar(issue.openedUserName, 48)</div>
|
||||
<div class="box issue-box">
|
||||
<div class="box-content" style="padding: 0px;">
|
||||
<div class="issue-header">
|
||||
@if(hasWritePermission || loginAccount.map(_.userName == issue.openedUserName).getOrElse(false)){
|
||||
<span class="pull-right"><a class="btn btn-small" href="#" id="edit">Edit</a></span>
|
||||
}
|
||||
<div class="small muted">
|
||||
<a href="@url(issue.openedUserName)" class="username">@issue.openedUserName</a> opened this issue @datetime(issue.registeredDate)
|
||||
</div>
|
||||
<h4 id="issueTitle">@issue.title</h4>
|
||||
</div>
|
||||
<div class="issue-info">
|
||||
<span id="label-assigned">
|
||||
@issue.assignedUserName.map { userName =>
|
||||
@avatar(userName, 20) <a href="@url(userName)" class="username strong">@userName</a> is assigned
|
||||
}.getOrElse("No one is assigned")
|
||||
</span>
|
||||
@if(hasWritePermission){
|
||||
@helper.html.dropdown() {
|
||||
<li><a href="javascript:void(0);" class="assign" data-name=""><i class="icon-remove-circle"></i> Clear assignee</a></li>
|
||||
@collaborators.map { collaborator =>
|
||||
<li><a href="javascript:void(0);" class="assign" data-name="@collaborator"><i class="icon-white"></i>@avatar(collaborator, 20) @collaborator</a></li>
|
||||
}
|
||||
}
|
||||
}
|
||||
<div class="pull-right">
|
||||
<span id="label-milestone">
|
||||
@issue.milestoneId.map { milestoneId =>
|
||||
@milestones.collect { case (milestone, _, _) if(milestone.milestoneId == milestoneId) =>
|
||||
Milestone: <strong>@milestone.title</strong>
|
||||
}
|
||||
}.getOrElse("No milestone")
|
||||
</span>
|
||||
<div id="milestone-progress-area">
|
||||
@issue.milestoneId.map { milestoneId =>
|
||||
@milestones.collect { case (milestone, openCount, closeCount) if(milestone.milestoneId == milestoneId) =>
|
||||
@issues.milestones.html.progress(openCount + closeCount, closeCount, false)
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@if(hasWritePermission){
|
||||
@helper.html.dropdown() {
|
||||
<li><a href="javascript:void(0);" class="milestone" data-id=""><i class="icon-remove-circle"></i> No milestone</a></li>
|
||||
@milestones.map { case (milestone, _, _) =>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId" data-title="@milestone.title">
|
||||
<i class="icon-white"></i> @milestone.title
|
||||
<div class="small" style="padding-left: 20px;">
|
||||
@milestone.dueDate.map { dueDate =>
|
||||
@if(isPast(dueDate)){
|
||||
<img src="@assets/common/images/alert_mono.png"/>Due in @date(dueDate)
|
||||
} else {
|
||||
<span class="muted">Due in @date(dueDate)</span>
|
||||
}
|
||||
}.getOrElse {
|
||||
<span class="muted">No due date</span>
|
||||
}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="issue-content" id="issueContent">
|
||||
@markdown(issue.content getOrElse "No description given.", repository, false, true)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="issue-participants">
|
||||
@defining((issue.openedUserName :: comments.map(_.commentedUserName)).distinct){ participants =>
|
||||
<strong>@participants.size</strong> @plural(participants.size, "participant")
|
||||
@participants.map { participant => <a href="@url(participant)">@avatar(participant, 20, tooltip = true)</a> }
|
||||
}
|
||||
</div>
|
||||
@comments.map { comment =>
|
||||
@if(comment.action != "close" && comment.action != "reopen"){
|
||||
<div class="issue-avatar-image">@avatar(comment.commentedUserName, 48)</div>
|
||||
<div class="box issue-comment-box" id="comment-@comment.commentId">
|
||||
<div class="box-header-small">
|
||||
<i class="icon-comment"></i>
|
||||
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> commented
|
||||
<span class="pull-right">
|
||||
@datetime(comment.registeredDate)
|
||||
@if(comment.action != "commit" && (hasWritePermission || loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){
|
||||
<a href="#" data-comment-id="@comment.commentId"><i class="icon-pencil"></i></a>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
<div class="box-content"class="issue-content" id="commentContent-@comment.commentId">
|
||||
@markdown(comment.content, repository, false, true)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if(comment.action == "close" || comment.action == "close_comment"){
|
||||
<div class="small issue-comment-action">
|
||||
<span class="label label-important">Closed</span>
|
||||
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> closed the issue @datetime(comment.registeredDate)
|
||||
</div>
|
||||
}
|
||||
@if(comment.action == "reopen" || comment.action == "reopen_comment"){
|
||||
<div class="small issue-comment-action">
|
||||
<span class="label label-success">Reopened</span>
|
||||
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> reopened the issue @datetime(comment.registeredDate)
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@if(loginAccount.isDefined){
|
||||
<form method="POST" validate="true">
|
||||
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
|
||||
<div class="box issue-comment-box">
|
||||
<div class="box-content">
|
||||
@helper.html.preview(repository, "", false, true, "width: 680px; height: 100px;")
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<input type="hidden" name="issueId" value="@issue.issueId"/>
|
||||
<input type="submit" class="btn btn-success" formaction="@url(repository)/issue_comments/new" value="Comment"/>
|
||||
@if(hasWritePermission || issue.openedUserName == loginAccount.get.userName){
|
||||
<input type="submit" class="btn" formaction="@url(repository)/issue_comments/state" value="@{if(issue.closed) "Reopen" else "Close"}" id="action"/>
|
||||
}
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
@issuedetail(issue, comments, collaborators, milestones, hasWritePermission, repository)
|
||||
@commentlist(comments, hasWritePermission, repository)
|
||||
@commentform(issue, hasWritePermission, repository)
|
||||
</div>
|
||||
<div class="span2">
|
||||
@if(issue.closed) {
|
||||
@@ -182,82 +59,6 @@
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
@if(issue.assignedUserName.isDefined){
|
||||
$('a.assign[data-name=@issue.assignedUserName] i').attr('class', 'icon-ok');
|
||||
}
|
||||
@if(issue.milestoneId.isDefined){
|
||||
$('a.milestone[data-id=@issue.milestoneId] i').attr('class', 'icon-ok');
|
||||
}
|
||||
|
||||
$('#edit').click(function(){
|
||||
$.get('@url(repository)/issues/_data/@issue.issueId',
|
||||
{
|
||||
dataType : 'html'
|
||||
},
|
||||
function(data){
|
||||
$('#issueContent').empty().html(data);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a.assign').click(function(){
|
||||
var $this = $(this);
|
||||
var userName = $this.data('name');
|
||||
$.post('@url(repository)/issues/@issue.issueId/assign',
|
||||
{
|
||||
assignedUserName: userName
|
||||
},
|
||||
function(){
|
||||
$('a.assign i.icon-ok').attr('class', 'icon-white');
|
||||
if(userName == ''){
|
||||
$('#label-assigned').text('No one is assigned');
|
||||
} else {
|
||||
$('#label-assigned').empty()
|
||||
.append($this.find('img.avatar').clone(false)).append(' ')
|
||||
.append($('<a class="username strong">').attr('href', '@path/' + userName).text(userName))
|
||||
.append(' is assigned');
|
||||
$('a.assign[data-name=' + userName + '] i').attr('class', 'icon-ok');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('a.milestone').click(function(){
|
||||
var title = $(this).data('title');
|
||||
var milestoneId = $(this).data('id');
|
||||
$.post('@url(repository)/issues/@issue.issueId/milestone',
|
||||
{
|
||||
milestoneId: milestoneId
|
||||
},
|
||||
function(data){
|
||||
console.log(data);
|
||||
$('a.milestone i.icon-ok').attr('class', 'icon-white');
|
||||
if(milestoneId == ''){
|
||||
$('#label-milestone').text('No milestone');
|
||||
$('#milestone-progress-area').empty();
|
||||
} else {
|
||||
$('#label-milestone').html($('<span>').append('Milestone: ').append($('<strong>').text(title)));
|
||||
$('#milestone-progress-area').html(data);
|
||||
$('a.milestone[data-id=' + milestoneId + '] i').attr('class', 'icon-ok');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('i.icon-pencil').click(function(){
|
||||
var id = $(this).closest('a').data('comment-id');
|
||||
$.get('@url(repository)/issue_comments/_data/' + id,
|
||||
{
|
||||
dataType : 'html'
|
||||
},
|
||||
function(data){
|
||||
$('#commentContent-' + id).empty().html(data);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#action').click(function(){
|
||||
$('<input type="hidden">').attr('name', 'action').val($(this).val().toLowerCase()).appendTo('form');
|
||||
});
|
||||
|
||||
$('a.toggle-label').click(function(){
|
||||
var path, icon;
|
||||
var i = $(this).children('i');
|
||||
|
||||
148
src/main/twirl/issues/issuedetail.scala.html
Normal file
148
src/main/twirl/issues/issuedetail.scala.html
Normal file
@@ -0,0 +1,148 @@
|
||||
@(issue: model.Issue,
|
||||
comments: List[model.IssueComment],
|
||||
collaborators: List[String],
|
||||
milestones: List[(model.Milestone, Int, Int)],
|
||||
hasWritePermission: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
<div class="issue-avatar-image">@avatar(issue.openedUserName, 48)</div>
|
||||
<div class="box issue-box">
|
||||
<div class="box-content" style="padding: 0px;">
|
||||
<div class="issue-header">
|
||||
@if(hasWritePermission || loginAccount.map(_.userName == issue.openedUserName).getOrElse(false)){
|
||||
<span class="pull-right"><a class="btn btn-small" href="#" id="edit">Edit</a></span>
|
||||
}
|
||||
<div class="small muted">
|
||||
<a href="@url(issue.openedUserName)" class="username">@issue.openedUserName</a> opened this issue @datetime(issue.registeredDate)
|
||||
</div>
|
||||
<h4 id="issueTitle">@issue.title</h4>
|
||||
</div>
|
||||
<div class="issue-info">
|
||||
<span id="label-assigned">
|
||||
@issue.assignedUserName.map { userName =>
|
||||
@avatar(userName, 20) <a href="@url(userName)" class="username strong">@userName</a> is assigned
|
||||
}.getOrElse("No one is assigned")
|
||||
</span>
|
||||
@if(hasWritePermission){
|
||||
@helper.html.dropdown() {
|
||||
<li><a href="javascript:void(0);" class="assign" data-name=""><i class="icon-remove-circle"></i> Clear assignee</a></li>
|
||||
@collaborators.map { collaborator =>
|
||||
<li><a href="javascript:void(0);" class="assign" data-name="@collaborator"><i class="icon-white"></i>@avatar(collaborator, 20) @collaborator</a></li>
|
||||
}
|
||||
}
|
||||
}
|
||||
<div class="pull-right">
|
||||
<span id="label-milestone">
|
||||
@issue.milestoneId.map { milestoneId =>
|
||||
@milestones.collect { case (milestone, _, _) if(milestone.milestoneId == milestoneId) =>
|
||||
Milestone: <strong>@milestone.title</strong>
|
||||
}
|
||||
}.getOrElse("No milestone")
|
||||
</span>
|
||||
<div id="milestone-progress-area">
|
||||
@issue.milestoneId.map { milestoneId =>
|
||||
@milestones.collect { case (milestone, openCount, closeCount) if(milestone.milestoneId == milestoneId) =>
|
||||
@issues.milestones.html.progress(openCount + closeCount, closeCount, false)
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@if(hasWritePermission){
|
||||
@helper.html.dropdown() {
|
||||
<li><a href="javascript:void(0);" class="milestone" data-id=""><i class="icon-remove-circle"></i> No milestone</a></li>
|
||||
@milestones.map { case (milestone, _, _) =>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId" data-title="@milestone.title">
|
||||
<i class="icon-white"></i> @milestone.title
|
||||
<div class="small" style="padding-left: 20px;">
|
||||
@milestone.dueDate.map { dueDate =>
|
||||
@if(isPast(dueDate)){
|
||||
<img src="@assets/common/images/alert_mono.png"/>Due in @date(dueDate)
|
||||
} else {
|
||||
<span class="muted">Due in @date(dueDate)</span>
|
||||
}
|
||||
}.getOrElse {
|
||||
<span class="muted">No due date</span>
|
||||
}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="issue-content" id="issueContent">
|
||||
@markdown(issue.content getOrElse "No description given.", repository, false, true)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="issue-participants">
|
||||
@defining((issue.openedUserName :: comments.map(_.commentedUserName)).distinct){ participants =>
|
||||
<strong>@participants.size</strong> @plural(participants.size, "participant")
|
||||
@participants.map { participant => <a href="@url(participant)">@avatar(participant, 20, tooltip = true)</a> }
|
||||
}
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
@if(issue.assignedUserName.isDefined){
|
||||
$('a.assign[data-name=@issue.assignedUserName] i').attr('class', 'icon-ok');
|
||||
}
|
||||
@if(issue.milestoneId.isDefined){
|
||||
$('a.milestone[data-id=@issue.milestoneId] i').attr('class', 'icon-ok');
|
||||
}
|
||||
|
||||
$('#edit').click(function(){
|
||||
$.get('@url(repository)/issues/_data/@issue.issueId',
|
||||
{
|
||||
dataType : 'html'
|
||||
},
|
||||
function(data){
|
||||
$('#issueContent').empty().html(data);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a.assign').click(function(){
|
||||
var $this = $(this);
|
||||
var userName = $this.data('name');
|
||||
$.post('@url(repository)/issues/@issue.issueId/assign',
|
||||
{
|
||||
assignedUserName: userName
|
||||
},
|
||||
function(){
|
||||
$('a.assign i.icon-ok').attr('class', 'icon-white');
|
||||
if(userName == ''){
|
||||
$('#label-assigned').text('No one is assigned');
|
||||
} else {
|
||||
$('#label-assigned').empty()
|
||||
.append($this.find('img.avatar').clone(false)).append(' ')
|
||||
.append($('<a class="username strong">').attr('href', '@path/' + userName).text(userName))
|
||||
.append(' is assigned');
|
||||
$('a.assign[data-name=' + userName + '] i').attr('class', 'icon-ok');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('a.milestone').click(function(){
|
||||
var title = $(this).data('title');
|
||||
var milestoneId = $(this).data('id');
|
||||
$.post('@url(repository)/issues/@issue.issueId/milestone',
|
||||
{
|
||||
milestoneId: milestoneId
|
||||
},
|
||||
function(data){
|
||||
console.log(data);
|
||||
$('a.milestone i.icon-ok').attr('class', 'icon-white');
|
||||
if(milestoneId == ''){
|
||||
$('#label-milestone').text('No milestone');
|
||||
$('#milestone-progress-area').empty();
|
||||
} else {
|
||||
$('#label-milestone').html($('<span>').append('Milestone: ').append($('<strong>').text(title)));
|
||||
$('#milestone-progress-area').html(data);
|
||||
$('a.milestone[data-id=' + milestoneId + '] i').attr('class', 'icon-ok');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -145,10 +145,19 @@
|
||||
<label class="checkbox" style="cursor: default;">
|
||||
<input type="checkbox" value="@issue.issueId"/>
|
||||
}
|
||||
@if(repository.isEmpty){
|
||||
<a href="@path/@issue.userName/@issue.repositoryName">@issue.repositoryName</a> ・
|
||||
@if(issue.isPullRequest){
|
||||
<img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png"/>
|
||||
} else {
|
||||
<img src="@assets/common/images/issue-@(if(issue.closed) "closed" else "open").png"/>
|
||||
}
|
||||
@if(repository.isEmpty){
|
||||
<a href="@path/@issue.userName/@issue.repositoryName">@issue.repositoryName</a> ・
|
||||
}
|
||||
@if(issue.isPullRequest){
|
||||
<a href="@path/@issue.userName/@issue.repositoryName/pull/@issue.issueId" class="issue-title">@issue.title</a>
|
||||
} else {
|
||||
<a href="@path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-title">@issue.title</a>
|
||||
}
|
||||
@labels.map { label =>
|
||||
<span class="label-color small" style="background-color: #@label.color; color: #@label.fontColor; padding-left: 4px; padding-right: 4px">@label.labelName</span>
|
||||
}
|
||||
@@ -158,13 +167,15 @@
|
||||
}
|
||||
#@issue.issueId
|
||||
</span>
|
||||
<div class="small muted">
|
||||
<div class="small muted" style="margin-left: 20px;">
|
||||
Opened by <a href="@url(issue.openedUserName)" class="username">@issue.openedUserName</a> @datetime(issue.registeredDate)
|
||||
@if(commentCount > 0){
|
||||
<i class="icon-comment"></i><a href="@path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-comment-count">@commentCount @plural(commentCount, "comment")</a>
|
||||
}
|
||||
</div>
|
||||
@if(hasWritePermission){
|
||||
</label>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
28
src/main/twirl/pulls/commits.scala.html
Normal file
28
src/main/twirl/pulls/commits.scala.html
Normal file
@@ -0,0 +1,28 @@
|
||||
@(issue: model.Issue,
|
||||
pullreq: model.PullRequest,
|
||||
commits: Seq[Seq[util.JGitUtil.CommitInfo]],
|
||||
hasWritePermission: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
<div class="box">
|
||||
<table class="table table-file-list" style="border: 1px solid silver;">
|
||||
@commits.map { day =>
|
||||
<tr>
|
||||
<th colspan="3" class="box-header" style="font-weight: normal;">@date(day.head.time)</th>
|
||||
</tr>
|
||||
@day.map { commit =>
|
||||
<tr>
|
||||
<td style="width: 20%;">
|
||||
@avatar(commit.committer, 20)
|
||||
<a href="@url(commit.committer)" class="username">@commit.committer</a>
|
||||
</td>
|
||||
<td>@commit.shortMessage</td>
|
||||
<td style="width: 10%; text-align: right;">
|
||||
<a href="@url(repository)/commit/@commit.id" class="monospace">@commit.id.substring(0, 7)</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
188
src/main/twirl/pulls/compare.scala.html
Normal file
188
src/main/twirl/pulls/compare.scala.html
Normal file
@@ -0,0 +1,188 @@
|
||||
@(commits: Seq[Seq[util.JGitUtil.CommitInfo]],
|
||||
diffs: Seq[util.JGitUtil.DiffInfo],
|
||||
members: List[String],
|
||||
originId: String,
|
||||
forkedId: String,
|
||||
sourceId: String,
|
||||
commitId: String,
|
||||
hasConflict: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo,
|
||||
originRepository: service.RepositoryService.RepositoryInfo,
|
||||
forkedRepository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@import org.eclipse.jgit.diff.DiffEntry.ChangeType
|
||||
@html.main("Pull Requests - " + repository.owner + "/" + repository.name){
|
||||
@html.header("pulls", repository)
|
||||
<div style="border: 1px solid #eee; background-color: #f8f8f8; margin-bottom: 10px; padding: 8px;">
|
||||
<div id="compare-info">
|
||||
<a href="#" id="edit-compare-condition" class="btn btn-mini pull-right">Edit</a>
|
||||
<span class="label label-info monospace">@originRepository.owner:@originId</span> ... <span class="label label-info monospace">@forkedRepository.owner:@forkedId</span>
|
||||
</div>
|
||||
<div id="compare-edit" style="display: none;">
|
||||
<a href="#" id="cancel-condition-editing" class="pull-right"><i class="icon-remove-circle"></i></a>
|
||||
@if(members.nonEmpty){
|
||||
@helper.html.dropdown(originRepository.owner + "/" + repository.name, "base fork") {
|
||||
@members.map { member =>
|
||||
<li><a href="#" class="origin-owner" data-name="@member">@helper.html.checkicon(member == originRepository.owner) @member/@repository.name</a></li>
|
||||
}
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown(originId, "base") {
|
||||
@originRepository.branchList.map { branch =>
|
||||
<li><a href="#" class="origin-branch" data-name="@branch">@helper.html.checkicon(branch == originId) @branch</a></li>
|
||||
}
|
||||
}
|
||||
...
|
||||
@if(members.nonEmpty){
|
||||
@helper.html.dropdown(forkedRepository.owner + "/" + repository.name, "head fork") {
|
||||
@members.map { member =>
|
||||
<li><a href="#" class="forked-owner" data-name="@member">@helper.html.checkicon(member == forkedRepository.owner) @member/@repository.name</a></li>
|
||||
}
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown(forkedId, "compare") {
|
||||
@forkedRepository.branchList.map { branch =>
|
||||
<li><a href="#" class="forked-branch" data-name="@branch">@helper.html.checkicon(branch == forkedId) @branch</a></li>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if(commits.nonEmpty){
|
||||
<div style="margin-bottom: 10px;" id="create-pull-request">
|
||||
<a href="#" class="btn" id="show-form">Click to create a pull request for this comparison</a>
|
||||
</div>
|
||||
<div id="pull-request-form" class="box" style="display: none;">
|
||||
<div class="box-content">
|
||||
<form method="POST" action="@path/@originRepository.owner/@repository.name/pulls/new" validate="true">
|
||||
<div style="width: 260px; position: absolute; margin-left: 635px;">
|
||||
@if(hasConflict){
|
||||
<h4>We can’t automatically merge these branches</h4>
|
||||
<p>Don't worry, you can still submit the pull request.</p>
|
||||
} else {
|
||||
<h4 style="color: #468847;">Able to merge</h4>
|
||||
<p>These branches can be automatically merged.</p>
|
||||
}
|
||||
<input type="submit" class="btn btn-success btn-block" value="Send pull request"/>
|
||||
</div>
|
||||
<div style="width: 620px; border-right: 1px solid #d4d4d4;">
|
||||
<span class="error" id="error-title"></span>
|
||||
<input type="text" name="title" style="width: 600px" placeholder="Title"/>
|
||||
@helper.html.preview(repository, "", false, true, "width: 600px; height: 200px;")
|
||||
<input type="hidden" name="targetUserName" value="@originRepository.owner"/>
|
||||
<input type="hidden" name="targetBranch" value="@originId"/>
|
||||
<input type="hidden" name="requestUserName" value="@forkedRepository.owner"/>
|
||||
<input type="hidden" name="requestBranch" value="@forkedId"/>
|
||||
<input type="hidden" name="commitIdFrom" value="@sourceId"/>
|
||||
<input type="hidden" name="commitIdTo" value="@commitId"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if(commits.isEmpty){
|
||||
<table class="table table-bordered table-hover table-issues">
|
||||
<tr>
|
||||
<td style="padding: 20px; background-color: #eee; text-align: center;">
|
||||
<h4>There isn't anything to compare.</h4>
|
||||
<strong>@originRepository.owner:@originId</strong> and <strong>@forkedRepository.owner:@forkedId</strong> are identical.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
} else {
|
||||
<div class="box">
|
||||
<table class="table table-file-list" style="border: 1px solid silver;">
|
||||
@commits.map { day =>
|
||||
<tr>
|
||||
<th colspan="3" class="box-header" style="font-weight: normal;">@date(day.head.time)</th>
|
||||
</tr>
|
||||
@day.map { commit =>
|
||||
<tr>
|
||||
<td style="width: 20%;">
|
||||
@avatar(commit.committer, 20)
|
||||
<a href="@url(commit.committer)" class="username">@commit.committer</a>
|
||||
</td>
|
||||
<td>@commit.shortMessage</td>
|
||||
<td style="width: 10%; text-align: right;">
|
||||
<a href="@url(repository)/commit/@commit.id" class="monospace">@commit.id.substring(0, 7)</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<div class="pull-right" style="margin-bottom: 10px;">
|
||||
<input id="toggle-file-list" type="button" class="btn" value="Show file list"/>
|
||||
</div>
|
||||
Showing @diffs.size changed @plural(diffs.size, "file")
|
||||
</div>
|
||||
<ul id="commit-file-list" style="display: none;">
|
||||
@diffs.zipWithIndex.map { case (diff, i) =>
|
||||
<li@if(i > 0){ class="border"}>
|
||||
<a href="#diff-@i">
|
||||
@if(diff.changeType == ChangeType.COPY || diff.changeType == ChangeType.RENAME){
|
||||
<img src="@assets/common/images/diff_move.png"/> @diff.oldPath -> @diff.newPath
|
||||
}
|
||||
@if(diff.changeType == ChangeType.ADD){
|
||||
<img src="@assets/common/images/diff_add.png"/> @diff.newPath
|
||||
}
|
||||
@if(diff.changeType == ChangeType.MODIFY){
|
||||
<img src="@assets/common/images/diff_edit.png"/> @diff.newPath
|
||||
}
|
||||
@if(diff.changeType == ChangeType.DELETE){
|
||||
<img src="@assets/common/images/diff_delete.png"/> @diff.oldPath
|
||||
}
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
@helper.html.diff(diffs, repository, Some(commitId))
|
||||
}
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('#edit-compare-condition').click(function(){
|
||||
$('#compare-info').hide();
|
||||
$('#compare-edit').show();
|
||||
});
|
||||
|
||||
$('#cancel-condition-editing').click(function(){
|
||||
$('#compare-info').show();
|
||||
$('#compare-edit').hide();
|
||||
});
|
||||
|
||||
$('a.origin-owner, a.forked-owner, a.origin-branch, a.forked-branch').click(function(){
|
||||
var e = $(this);
|
||||
e.parents('ul').find('i').attr('class', 'icon-white');
|
||||
e.find('i').attr('class', 'icon-ok');
|
||||
e.parents('div.btn-group').find('button strong').text(e.text());
|
||||
|
||||
@if(members.isEmpty){
|
||||
location.href = '@url(repository)/compare/' +
|
||||
$.trim($('i.icon-ok').parents('a.origin-branch').data('name')) + '...' +
|
||||
$.trim($('i.icon-ok').parents('a.forked-branch').data('name'));
|
||||
} else {
|
||||
location.href = '@url(repository)/compare/' +
|
||||
$.trim($('i.icon-ok').parents('a.origin-owner' ).data('name')) + ':' +
|
||||
$.trim($('i.icon-ok').parents('a.origin-branch').data('name')) + '...' +
|
||||
$.trim($('i.icon-ok').parents('a.forked-owner' ).data('name')) + ':' +
|
||||
$.trim($('i.icon-ok').parents('a.forked-branch').data('name'));
|
||||
}
|
||||
});
|
||||
|
||||
$('#show-form').click(function(){
|
||||
$(this).hide();
|
||||
$('#pull-request-form').show();
|
||||
});
|
||||
|
||||
$('#toggle-file-list').click(function(){
|
||||
$('#commit-file-list').toggle();
|
||||
if($(this).val() == 'Show file list'){
|
||||
$(this).val('Hide file list');
|
||||
} else {
|
||||
$(this).val('Show file list');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
124
src/main/twirl/pulls/discussion.scala.html
Normal file
124
src/main/twirl/pulls/discussion.scala.html
Normal file
@@ -0,0 +1,124 @@
|
||||
@(issue: model.Issue,
|
||||
pullreq: model.PullRequest,
|
||||
comments: List[model.IssueComment],
|
||||
collaborators: List[String],
|
||||
milestones: List[(model.Milestone, Int, Int)],
|
||||
hasConflict: Boolean,
|
||||
hasWritePermission: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo,
|
||||
requestRepositoryUrl: String)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
<div class="row-fluid">
|
||||
<div class="span10">
|
||||
@issues.html.issuedetail(issue, comments, collaborators, milestones, hasWritePermission, repository)
|
||||
@issues.html.commentlist(comments, hasWritePermission, repository)
|
||||
|
||||
@if(hasWritePermission && !issue.closed){
|
||||
<div class="box issue-comment-box" style="background-color: #d8f5cd;">
|
||||
<div class="box-content"class="issue-content" style="border: 1px solid #95c97e; padding: 10px;">
|
||||
<div id="merge-pull-request">
|
||||
<div class="pull-right">
|
||||
<input type="button" class="btn btn-success" id="merge-pull-request-button" value="Merge pull request"@if(hasConflict){ disabled="true"}/>
|
||||
</div>
|
||||
<div>
|
||||
@if(hasConflict){
|
||||
<strong>We can’t automatically merge this pull request.</strong>
|
||||
} else {
|
||||
<strong>This pull request can be automatically merged.</strong>
|
||||
}
|
||||
</div>
|
||||
<div class="small">
|
||||
@if(hasConflict){
|
||||
<a href="#" id="show-command-line">Use the command line</a> to resolve conflicts before continuing.
|
||||
} else {
|
||||
You can also merge branches on the <a href="#" id="show-command-line">command line</a>.
|
||||
}
|
||||
</div>
|
||||
<div id="command-line" style="display: none;">
|
||||
<hr>
|
||||
@if(hasConflict){
|
||||
<strong>Checkout via command line</strong>
|
||||
<p>
|
||||
If you cannot merge a pull request automatically here, you have the option of checking
|
||||
it out via command line to resolve conflicts and perform a manual merge.
|
||||
</p>
|
||||
} else {
|
||||
<strong>Merging via command line</strong>
|
||||
<p>
|
||||
If you do not want to use the merge button or an automatic merge cannot be performed,
|
||||
you can perform a manual merge on the command line.
|
||||
</p>
|
||||
}
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">HTTP</span>
|
||||
<input type="text" value="@requestRepositoryUrl" id="repository-url" readonly>
|
||||
</div>
|
||||
<p>
|
||||
<strong>Step 1:</strong> Check out a new branch to test the changes — run this from your project directory
|
||||
</p>
|
||||
<pre>git checkout -b @{pullreq.requestUserName}-@{pullreq.requestBranch} @{pullreq.requestBranch}</pre>
|
||||
<p>
|
||||
<strong>Step 2:</strong> Bring in @{pullreq.requestUserName}'s changes and test
|
||||
</p>
|
||||
<pre>git pull @{requestRepositoryUrl} @{pullreq.requestBranch}</pre>
|
||||
<p>
|
||||
<strong>Step 3:</strong> Merge the changes and update the server
|
||||
</p>
|
||||
<pre>git checkout master
|
||||
git merge @{pullreq.requestUserName}-@{pullreq.branch}
|
||||
git push origin @{pullreq.branch}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="confirm-merge-form" style="display: none;">
|
||||
<form method="POST" action="@url(repository)/pull/@issue.issueId/merge">
|
||||
<div>
|
||||
<strong>Merge pull request #@issue.issueId from @{pullreq.requestUserName}/@{pullreq.requestBranch}</strong>
|
||||
</div>
|
||||
<span id="error-message" class="error"></span>
|
||||
<textarea name="message" style="width: 680px; height: 80px;">@issue.title</textarea>
|
||||
<div>
|
||||
<input type="button" class="btn" value="Cancel" id="cancel-merge-pull-request"/>
|
||||
<input type="submit" class="btn btn-success" value="Confirm merge"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@issues.html.commentform(issue, hasWritePermission, repository)
|
||||
</div>
|
||||
<div class="span2">
|
||||
@if(issue.closed) {
|
||||
@if(comments.exists(_.action == "merge")){
|
||||
<span class="label label-info issue-status">Merged</span>
|
||||
} else {
|
||||
<span class="label label-important issue-status">Closed</span>
|
||||
}
|
||||
} else {
|
||||
<span class="label label-success issue-status">Open</span>
|
||||
}
|
||||
<div class="small" style="text-align: center;">
|
||||
<strong>@comments.size</strong> @plural(comments.size, "comment")
|
||||
</div>
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
$('#show-command-line').click(function(){
|
||||
$('#command-line').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#merge-pull-request-button').click(function(){
|
||||
$('#merge-pull-request').hide();
|
||||
$('#confirm-merge-form').show();
|
||||
});
|
||||
|
||||
$('#cancel-merge-pull-request').click(function(){
|
||||
$('#confirm-merge-form').hide();
|
||||
$('#merge-pull-request').show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
48
src/main/twirl/pulls/files.scala.html
Normal file
48
src/main/twirl/pulls/files.scala.html
Normal file
@@ -0,0 +1,48 @@
|
||||
@(issue: model.Issue,
|
||||
pullreq: model.PullRequest,
|
||||
diffs: Seq[util.JGitUtil.DiffInfo],
|
||||
commitId: String,
|
||||
hasWritePermission: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@import org.eclipse.jgit.diff.DiffEntry.ChangeType
|
||||
<div>
|
||||
<div class="pull-right" style="margin-bottom: 10px;">
|
||||
<input id="toggle-file-list" type="button" class="btn" value="Show file list"/>
|
||||
</div>
|
||||
Showing @diffs.size changed @plural(diffs.size, "file")
|
||||
</div>
|
||||
<ul id="commit-file-list" style="display: none;">
|
||||
@diffs.zipWithIndex.map { case (diff, i) =>
|
||||
<li@if(i > 0){ class="border"}>
|
||||
<a href="#diff-@i">
|
||||
@if(diff.changeType == ChangeType.COPY || diff.changeType == ChangeType.RENAME){
|
||||
<img src="@assets/common/images/diff_move.png"/> @diff.oldPath -> @diff.newPath
|
||||
}
|
||||
@if(diff.changeType == ChangeType.ADD){
|
||||
<img src="@assets/common/images/diff_add.png"/> @diff.newPath
|
||||
}
|
||||
@if(diff.changeType == ChangeType.MODIFY){
|
||||
<img src="@assets/common/images/diff_edit.png"/> @diff.newPath
|
||||
}
|
||||
@if(diff.changeType == ChangeType.DELETE){
|
||||
<img src="@assets/common/images/diff_delete.png"/> @diff.oldPath
|
||||
}
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
@helper.html.diff(diffs, repository, Some(commitId))
|
||||
<script>
|
||||
$(function(){
|
||||
$('#toggle-file-list').click(function(){
|
||||
$('#commit-file-list').toggle();
|
||||
if($(this).val() == 'Show file list'){
|
||||
$(this).val('Hide file list');
|
||||
} else {
|
||||
$(this).val('Show file list');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
141
src/main/twirl/pulls/list.scala.html
Normal file
141
src/main/twirl/pulls/list.scala.html
Normal file
@@ -0,0 +1,141 @@
|
||||
@(issues: List[(model.Issue, List[model.Label], Int)],
|
||||
counts: List[service.PullRequestService.PullRequestCount],
|
||||
filter: Option[String],
|
||||
page: Int,
|
||||
openCount: Int,
|
||||
closedCount: Int,
|
||||
allCount: Int,
|
||||
condition: service.IssuesService.IssueSearchCondition,
|
||||
repository: service.RepositoryService.RepositoryInfo,
|
||||
hasWritePermission: Boolean)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@html.main("Pull Requests - " + repository.owner + "/" + repository.name){
|
||||
@html.header("pulls", repository)
|
||||
<div class="row-fluid">
|
||||
<div class="span3">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li@if(filter.isEmpty){ class="active"}>
|
||||
<a href="@url(repository)/pulls">
|
||||
<span class="count-right">@allCount</span>
|
||||
All Requests
|
||||
</a>
|
||||
</li>
|
||||
@if(loginAccount.isDefined){
|
||||
<li@if(filter.map(_ == loginAccount.get.userName).getOrElse(false)){ class="active"}>
|
||||
<a href="@url(repository)/pulls/@loginAccount.map(_.userName)">
|
||||
<span class="count-right">@counts.find(_.userName == loginAccount.get.userName).map(_.count)</span>
|
||||
Yours
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
<hr>
|
||||
<ul class="nav nav-pills nav-stacked small">
|
||||
@counts.map { user =>
|
||||
@if(loginAccount.isEmpty || loginAccount.get.userName != user.userName){
|
||||
<li@if(filter.map(_ == user.userName).getOrElse(false)){ class="active"}>
|
||||
<a href="@url(repository)/pulls/@user.userName">
|
||||
<span class="count-right">@user.count</span>
|
||||
@user.userName
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="span9">
|
||||
@if(hasWritePermission){
|
||||
<div class="pull-right">
|
||||
@helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.PullRequestService.PullRequestLimit, 7, condition.toURL)
|
||||
<a href="@url(repository)/compare" class="btn btn-success">New pull request</a>
|
||||
</div>
|
||||
}
|
||||
<div class="btn-group">
|
||||
<a class="btn@if(condition.state == "open"){ active}" href="@condition.copy(state = "open").toURL">@openCount Open</a>
|
||||
<a class="btn@if(condition.state == "closed"){ active}" href="@condition.copy(state = "closed").toURL">@closedCount Closed</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
Sort:
|
||||
<strong>
|
||||
@if(condition.sort == "created" && condition.direction == "desc"){ Newest }
|
||||
@if(condition.sort == "created" && condition.direction == "asc" ){ Oldest }
|
||||
@if(condition.sort == "comments" && condition.direction == "desc"){ Most commented }
|
||||
@if(condition.sort == "comments" && condition.direction == "asc" ){ Least commented }
|
||||
@if(condition.sort == "updated" && condition.direction == "desc"){ Recently updated }
|
||||
@if(condition.sort == "updated" && condition.direction == "asc" ){ Least recently updated }
|
||||
</strong>
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a href="@condition.copy(sort="created", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "created" && condition.direction == "desc") Newest
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="created", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "created" && condition.direction == "asc") Oldest
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="comments", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "desc") Most commented
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="comments", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "asc") Least commented
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="updated", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "desc") Recently updated
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="updated", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "asc") Least recently updated
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<table class="table table-bordered table-hover table-issues">
|
||||
@if(issues.isEmpty){
|
||||
<tr>
|
||||
<td style="padding: 20px; background-color: #eee; text-align: center;">
|
||||
No pull requests to show.
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@issues.map { case (issue, labels, commentCount) =>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png"/>
|
||||
<a href="@path/@issue.userName/@issue.repositoryName/pull/@issue.issueId" class="issue-title">@issue.title</a>
|
||||
<span class="pull-right muted">#@issue.issueId</span>
|
||||
<div style="margin-left: 20px;">
|
||||
@issue.content.map { content =>
|
||||
@cut(content, 90)
|
||||
}.getOrElse {
|
||||
<span class="muted">No description available</span>
|
||||
}
|
||||
</div>
|
||||
<div class="small muted" style="margin-left: 20px;">
|
||||
@avatar(issue.openedUserName, 20) by <a href="@url(issue.openedUserName)" class="username">@issue.openedUserName</a> @datetime(issue.registeredDate)
|
||||
@if(commentCount > 0){
|
||||
<i class="icon-comment"></i><a href="@path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-comment-count">@commentCount @plural(commentCount, "comment")</a>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<div class="pull-right">
|
||||
@helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.PullRequestService.PullRequestLimit, 10, condition.toURL)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
39
src/main/twirl/pulls/pullreq.scala.html
Normal file
39
src/main/twirl/pulls/pullreq.scala.html
Normal file
@@ -0,0 +1,39 @@
|
||||
@(issue: model.Issue,
|
||||
pullreq: model.PullRequest,
|
||||
comments: List[model.IssueComment],
|
||||
collaborators: List[String],
|
||||
milestones: List[(model.Milestone, Int, Int)],
|
||||
commits: Seq[Seq[util.JGitUtil.CommitInfo]],
|
||||
diffs: Seq[util.JGitUtil.DiffInfo],
|
||||
commitId: String,
|
||||
hasConflict: Boolean,
|
||||
hasWritePermission: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo,
|
||||
requestRepositoryUrl: String)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@html.main("%s - Pull Request #%d - %s/%s".format(issue.title, issue.issueId, repository.owner, repository.name)){
|
||||
@html.header("pulls", repository)
|
||||
<ul class="nav nav-tabs" id="pullreq-tab">
|
||||
<li class="active"><a href="#discussion">Discussion</a></li>
|
||||
<li><a href="#commits">Commits <span class="badge">@commits.flatten.size</span></a></li>
|
||||
<li><a href="#files">Files Changed <span class="badge">@diffs.size</span></a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="discussion">
|
||||
@pulls.html.discussion(issue, pullreq, comments, collaborators, milestones, hasConflict, hasWritePermission, repository, requestRepositoryUrl)
|
||||
</div>
|
||||
<div class="tab-pane" id="commits">
|
||||
@pulls.html.commits(issue, pullreq, commits, hasWritePermission, repository)
|
||||
</div>
|
||||
<div class="tab-pane" id="files">
|
||||
@pulls.html.files(issue, pullreq, diffs, commitId, hasWritePermission, repository)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<script>
|
||||
$('#pullreq-tab a').click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).tab('show');
|
||||
});
|
||||
</script>
|
||||
28
src/main/twirl/repo/forked.scala.html
Normal file
28
src/main/twirl/repo/forked.scala.html
Normal file
@@ -0,0 +1,28 @@
|
||||
@(members: service.RepositoryService.RepositoryTreeNode,
|
||||
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="@url(repository)/network/members">Members</a></li>
|
||||
</ul>
|
||||
<h3>Members of the @repository.name Network</h3>
|
||||
<ul>
|
||||
@renderTree(members)
|
||||
</ul>
|
||||
}
|
||||
|
||||
@renderTree(node: service.RepositoryService.RepositoryTreeNode) = {
|
||||
<li>
|
||||
<div style="font-size: 120%; margin-bottom: 8px;">
|
||||
@avatar(node.owner, 20) <a href="@url(node.owner)">@node.owner</a> / <a href="@path/@node.owner/@node.name">@node.name</a>
|
||||
</div>
|
||||
@if(node.children.nonEmpty){
|
||||
<ul>
|
||||
@node.children.map { child =>
|
||||
@renderTree(child)
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</li>
|
||||
}
|
||||
@@ -13,8 +13,7 @@
|
||||
<label for="description"><strong>Description</strong></label>
|
||||
<input type="text" name="description" id="description" style="width: 600px;" value="@repository.repository.description"/>
|
||||
</fieldset>
|
||||
<hr>
|
||||
<fieldset>
|
||||
<fieldset class="margin">
|
||||
<label for="defaultBranch"><strong>Default Branch</strong></label>
|
||||
<select name="defaultBranch" id="defaultBranch">
|
||||
@repository.branchList.map { branch =>
|
||||
@@ -22,10 +21,12 @@
|
||||
}
|
||||
</select>
|
||||
</fieldset>
|
||||
<hr>
|
||||
<fieldset class="margin">
|
||||
<label>
|
||||
<input type="radio" name="isPrivate" value="false"@if(!repository.repository.isPrivate){ checked}>
|
||||
<input type="radio" name="isPrivate" value="false"
|
||||
@if(!repository.repository.isPrivate ){ checked }
|
||||
@if(repository.repository.parentUserName.isDefined){ disabled }
|
||||
>
|
||||
<strong>Public</strong><br>
|
||||
<div>
|
||||
<span class="note">All users and guests can read this repository.</span>
|
||||
@@ -34,7 +35,10 @@
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>
|
||||
<input type="radio" name="isPrivate" value="true"@if(repository.repository.isPrivate){ checked}>
|
||||
<input type="radio" name="isPrivate" value="true"
|
||||
@if(repository.repository.isPrivate ){ checked }
|
||||
@if(repository.repository.parentUserName.isDefined){ disabled }
|
||||
>
|
||||
<strong>Private</strong><br>
|
||||
<div>
|
||||
<span class="note">Only collaborators can read this repository.</span>
|
||||
|
||||
@@ -81,11 +81,11 @@
|
||||
<servlet>
|
||||
<servlet-name>H2Console</servlet-name>
|
||||
<servlet-class>org.h2.server.web.WebServlet</servlet-class>
|
||||
<!--
|
||||
<init-param>
|
||||
<param-name>webAllowOthers</param-name>
|
||||
<param-value></param-value>
|
||||
</init-param>
|
||||
<!--
|
||||
<init-param>
|
||||
<param-name>trace</param-name>
|
||||
<param-value></param-value>
|
||||
@@ -99,4 +99,11 @@
|
||||
<url-pattern>/console/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- Session timeout -->
|
||||
<!-- ===================================================================== -->
|
||||
<session-config>
|
||||
<session-timeout>1440</session-timeout>
|
||||
</session-config>
|
||||
|
||||
</web-app>
|
||||
@@ -56,7 +56,7 @@ table.global-nav {
|
||||
table.global-nav th {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 8px;
|
||||
width: 25%;
|
||||
width: 20%;
|
||||
border-bottom: 2px solid silver;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -70,6 +70,19 @@ table.global-nav th a:link, table.global-nav th a:hover, table.global-nav th a:v
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div.input-prepend span.add-on {
|
||||
background-color: white;
|
||||
-webkit-border-radius: 0 4px 4px 0;
|
||||
-moz-border-radius: 0 4px 4px 0;
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
|
||||
/*
|
||||
div.input-prepend span.add-on a {
|
||||
color: #333;
|
||||
}
|
||||
*/
|
||||
|
||||
/* ======================================================================== */
|
||||
/* General Styles */
|
||||
/* ======================================================================== */
|
||||
@@ -82,6 +95,16 @@ div.head a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.head div.forked {
|
||||
font-size: 60%;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
div.head div.forked a {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
|
||||
div.container {
|
||||
width: 920px;
|
||||
}
|
||||
@@ -257,15 +280,23 @@ div.account-image {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
ul.dropdown-menu {
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
ul.dropdown-menu li {
|
||||
border-bottom: 1px solid #eee;
|
||||
font-size: 85%;
|
||||
}
|
||||
|
||||
ul.dropdown-menu li a {
|
||||
padding: 2px 10px;
|
||||
}
|
||||
|
||||
ul.dropdown-menu :last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************/
|
||||
/* Sign-in form */
|
||||
/****************************************************************************/
|
||||
|
||||
BIN
src/main/webapp/assets/common/images/issue-closed.png
Normal file
BIN
src/main/webapp/assets/common/images/issue-closed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 452 B |
BIN
src/main/webapp/assets/common/images/issue-open.png
Normal file
BIN
src/main/webapp/assets/common/images/issue-open.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 450 B |
BIN
src/main/webapp/assets/common/images/pullreq-closed.png
Normal file
BIN
src/main/webapp/assets/common/images/pullreq-closed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 390 B |
BIN
src/main/webapp/assets/common/images/pullreq-open.png
Normal file
BIN
src/main/webapp/assets/common/images/pullreq-open.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 391 B |
Reference in New Issue
Block a user